From: Rajesh on
Hi,
I have a set of radiographic images of an object taken at different angles. 180images to be precise (2 deg step). I know that the center of rotation did not match with the cg of the specimen accurately and therefore i want to shift each of the images with certain pixel value which is not essentially integer but a real number. I also want the image size retained . something like circshift but it doesn't operate on real numbers :(

The Shift between image at 0 deg (image1) and that at 180 deg (image91) is 13 pixels. thus, I need a shift of 6.3 pixel for image at 0 deg(image-1),6.16 for image at 2 deg (image2) etc upto 0.14 pixel for the image at 90 deg (image 45) in one direction (say right) then same in reverse direction for image 46 to image 91. then a similar cycle for the rest 90 images.

My questions:
Is the above approach the most efficient to do what i desire?

Is there a method to shift the images by real number pixel (may be with help of linear interpolation)?

what is the use of fftshift function is it relevant in this case?

thanks.
From: ImageAnalyst on
Try interp2().

I don't think fftshift() applies here since you're not taking the
fft. fftshift() basically puts the origin at the center of the array
instead of at the first (corner) pixel, which makes it more intuitive
for viewing the spectrum.
From: Rajesh on
Thanks.

interp2 gives me the interpolated values but i need to shift the image which is the main problem here.

i found fftshift on 'See Also' for Circshift function thats why i queried about it.
Can the image be effectively shifted in the frequency domain?

Also, let me put this example here:
shifted_image=circshift(image1,[0,-6]);
above line is fine for me only problem is i need to shift by 6.32 pixels instead of 6. which the function doesnt allow. any other method for this?
From: ImageAnalyst on
And can you explain why you don't think interp2 can do shifting?

Think about it some, and I think you'll come around to my way of
thinking where I know it can shift an image by fractional pixel
distances.

From: Rajesh on
Ok i was thinking too deep to get the simple thing with this interp2 and got the answer from shalin mehta's post.
http://www.mathworks.com/matlabcentral/newsreader/view_thread/261037#720879

but again let me repeat my concerns that i have put there (excuse for beating around).

The image needs a uniform background and interp2 is disturbing it for the shifted region.
tried the conv2 as suggested by Mat in the same post but that too, a) works only for frations below 1 & b) leaves the shifted columns disturbed.

also need a faster working function since it has to handle many images in a loop.

am i asking for too much... guess not. Not sure.
thanks.
 |  Next  |  Last
Pages: 1 2
Prev: error management in optimization
Next: Convolution?