Sorry for the title gore, but basically I am tracking the downward vertical flow of some bubbles. I have two images, the first at t=0, and then the bubbles have moved vertically to t=t. So basically I have the same image in both, but one is shifted by the vertical velocity of the bubbles.
I am applying a normxcorr2 to get my result, and it is working very well.
My code right now looks like this:
ccr = ccr = normxcorr2(img1,img2);
yoffset = ypeak-size(img2,1);
xoffset = xpeak-size(img2,2);
So visually inspecting my result, the match works very well.
My question is that from understanding what I am doing, if I was to apply just xcorr2, I would need to subtract the mean from each image (so that I have equal negative and positive values for the xcorr). Why don't I need to do this the normxcorr2.
I have tried applying just xcorr2 on img1 and img2, and also have tried applying xcorr2 on
img1 = img1 - mean(mean(img1))
I receive a similar, but different answer. Any ideas why?
Any sort of explanation here would be greatly appreciated.