trouble using axes in imcrop
Show older comments
I am trying to register one image with another. I am able to apply the transforms (translation, rotation and translation) to the one image which gets it to where I want it to go. However, due to these transforms the resulting image is larger than my other image. I am able to overlay them using imshow, but I would now like to crop the larger (transformed) image to be the same size as the base image (basically where the two images overlap). I do not understand how the axes work with imcrop. Below is how I plot it, followed by the failed attempt at cropping.
figure; imshow(registered,'Xdata', xdat, 'Ydata', ydat)
hold on
h = imshow(base,gray(256));
set(h,'AlphaData',0.3)
hold off
[basey, basex] = size(base)
rect = [1 1 basex basey];
[xdat ydat final rect]=imcrop(registered);
I have tried a bunch of variations of the above for imcrop but no luck. The xdat and ydat run from negative numbers while my base image starts at the origin. I hope it is clear what I am trying to do here. Thanks in advance.
Answers (1)
Image Analyst
on 21 Feb 2013
0 votes
Did you see the demos for imregister()? I think that does what you want.
1 Comment
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!