From: aurelien on
Hi users,

Here's my problem, I'll try to explain it as clear as possible.

So first, I have a distorted image in the y direction and also another image which gives me the pixel displacement delta(y).

It can be expressed like : y(distorted)=y(undistorted) + delta(y)

And all I want is the undisorted image which corresponds to my "real" object.
So I should do an interpolation of the signal intensity in the warped (acquired) image at a given location : y(distorted) - delta(y) and the new pixel is placed at the positionned y(undistorted).

I think I should use the interp1 function but it's not completely clear to me how to do that. That would be great if you could give me some clues.
From: ImageAnalyst on
You don't need any interpolation, just use regular indexing and
assignment to get your new translated image. You'll have to get your
starting and stopping rows properly so that you don't get negative
indices, but that's about it. Your translated image will of course be
shorter than your original unless you want to shift in some background
pixels along the top or bottom edge.

Maybe you could even use circshift() and then just crop off the top or
bottom band (of deltay rows) that got wrapped around.