trouble using axes in imcrop
이전 댓글 표시
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.
답변 (1개)
Image Analyst
2013년 2월 21일
0 개 추천
Did you see the demos for imregister()? I think that does what you want.
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!