Hi, I have two images of same size such that
im1_o=image at time 0
im2_1=image at time 1
I want to compute displacement vetor for these two images using intensity correlation for given Window size (odd). I donot understand where to start. Can I use some builtin function of matlab? Any help or link to some code.

2 Comments

any thing like this available?

Sign in to comment.

 Accepted Answer

Alex Taylor
Alex Taylor on 25 May 2011

0 votes

If you look at the cross correlation registration demo in the Image Processing Toolbox, you'll see how normxcorr2 can be used to solve for the displacement vector you are interested in.

2 Comments

Sh Ahmadi
Sh Ahmadi on 2 Jun 2019
Edited: Sh Ahmadi on 2 Jun 2019
Hi , I'm tring to open this link , but is not active. How I can log in to this link ?
any solution plzz

Sign in to comment.

More Answers (2)

Aaronne
Aaronne on 25 Aug 2011
Edited: John Kelly on 27 May 2014

1 vote

I guess you are looking for something at the end the page
Use 'quiver' function.
Thanks.
doc normxcorr2

7 Comments

shah baba
shah baba on 23 May 2011
CAn i define my window size? Moreover i have images of same size , so what should i do. Im2_1 is registered in im1_0m already.
1) Yes, the size of template - the first input argument to normxcorr2
2) If you have them registered already then why do you need to calculate a displacement vector...?
shah baba
shah baba on 23 May 2011
After registration, you can compare features in the images to see how a river has migrated, how an area is flooded, ...
So then why do you need a displacement vector? Wouldn't an image subtraction work. You're not going to be able to calculate a displacement vector for an object that is not in both images (e.g. flood waters v. Vicksburg MS)
shah baba
shah baba on 24 May 2011
Dear, Think about change in position of river, or any other object. I have a object in image 1 at position [x y] and in second is [x1,y1], So, in sequence it will be [xn,y,n].
But the object is changing size (i.e. morphing) and so what you want is the new area defined by the flood. This is not a displacement vector as there is something completely new in the image. A displacement vector is the change in location of an object in BOTH images. So what you want to do is register the images to the best of your ability and then do an image comparison, such as a subtraction/area calculation/segmentation etc, to figure out how much has flooded. Post your images if you want better answers.
shah baba
shah baba on 24 May 2011
Thanx for your kind reply. Infact I need only displacement vector.
Situation:
I have image of object (going under deformation) at 0 epoch and n Epoch.
I can get difference when I have displacement_vector1 (image1-image0) based on correlation and then I make image of displacement_vector1. Length of vector is displacement.
Now Why I registered first to avoide instability of camera during experiment.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!