I need help with this image processing problem?

I have been working with a series of images taken by an invasive recording technique. One of problems with these frames is that the lines (rows) in the image are misaligned, due to some inevitable artifacts in the recording set up. I wrote a function that fixes the misalignments by maximizing the correlation between the adjacent lines. The function works well but there is one problem.It does not work so well on the first and last rows. As you see in the image, the corners contain only zeros ( because I segmented the main bundle from the background )
The function works almost perfect in the middle rows, but in the upper and lower section of the image, it does not work well and even sometimes the alignment gets worse.
so here are my questions:
1) what is the reason? is it because of those areas of zeros that affect the correlation?
2) how can I get over this problem?
thank you all

 采纳的回答

Maybe try imregister() instead of normxcorr2(). I think it should work on "images" that are a single line.

5 个评论

thanks but I dont think I can use imregister(). I am not a professional in image registeration but as far as I know it maps the two matrices and I am not trying to do any trackings. I only want to align them. anyway thanks for your help. in fact you gave me the idea of maximizing the correaltion.
It aligns two matrices, which could be line n and line (n+1). I think you were maybe using corr() or something instead of normxcorr2(), which would perform better. Was that the case? If so, did normxcorr2() improve it for you?
that is right. I used corr(). I tried to use cross-correlation but I did not get satisfactory result. In my algorithm I divide the image in the blocks of 2 lines and process each block independently and for each block I delay both of the lines by a "lag" value which is passed as an input argument to find the best match. But if use cross-correlation I should define the shorter line as the template and delay only that one to find the best match and it does not give any good results.
Am I using the cross-correlation in the right way?
by the way, It seems that I have to process the image in the independent blocks, otherwise the output image is skewed.
Why is one line shorter? Why not just take the whole lines and put them both into imregister() or normxcorr2()?
I used normxcorr2 and result got a little bit better. It is also faster now. thanks a lot for your helps and suggestions.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by