Control Point Registration with Matlab

1 view (last 30 days)
Yulia
Yulia on 23 Oct 2014
Hello,
I'm new to Matlab and I'm trying to do a Control Point Registration using your guide: http://www.mathworks.com/help/images/point-mapping.html
The result I get is two pictures one on top of the other but they are misaligned .
Can you please tell me what am I doing wrong ?
Thank you.
Here is the code:
function [Y] =EBL
ReferenceImg=imread('GFI.jpg'); %This is the fixed image
CroppedImg=imcrop(ReferenceImg); %Crop fixed image
close %close the imcrop window
MovingImg = imread('GF.bmp'); %This is the moving picture
ResizedIReferenceImg= imresize(CroppedImg,[1000 1000]); %resize the fixed image
ResizedMovingImg= imresize(MovingImg,[1000 1000]);%resize the moving image
[input_points,base_points] = cpselect(ResizedMovingImg,ResizedIReferenceImg,'Wait', true);%Estimate transformation
tform = fitgeotrans(input_points,base_points,'projective');
B = imwarp(ResizedMovingImg,tform);
imshow(B)
hold on
t=imagesc(ResizedIReferenceImg);%Set transparency of fixed image
set(t,'AlphaData',0.5);
end

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!