필터 지우기
필터 지우기

Matching two images by extracting surf features

조회 수: 3 (최근 30일)
annmaria
annmaria 2015년 7월 16일
I want to compare the two images and recover the transformed image by extracting surf features. But I got the recovered image as a blank image. My code is given below
Iin = imread('H:\mainproject\matlabtry\OpenSURF_version1c\A.bmp'); imshow(Iin); title('Base image');
Iin=imresize(Iin,[512 512]);
% Iout = imresize(Iin, 0.7); figure;
% Iout = imrotate(Iout, 31);
Iout=imread('H:\mainproject\matlabtry\OpenSURF_version1c\A1.bmp');imshow(Iout); title('Transformed image');
Iout=imresize(Iout,[512 512]);
% detect and extract features from both images
ptsIn = detectSURFFeatures(Iin);
ptsOut = detectSURFFeatures(Iout);
[featuresIn validPtsIn] = extractFeatures(Iin, ptsIn);
[featuresOut validPtsOut] = extractFeatures(Iout, ptsOut);
% match feature vectors
index_pairs = matchFeatures(featuresIn, featuresOut);
% get matching points
matchedPtsIn = validPtsIn(index_pairs(:,1));
matchedPtsOut = validPtsOut(index_pairs(:,2));
cvexShowMatches(Iin,Iout,matchedPtsIn,matchedPtsOut);
title('Matched SURF points, including outliers');
% compute the transformation matrix using RANSAC
gte = vision.GeometricTransformEstimator;
gte.Transform = 'Nonreflective similarity';
[tform inlierIdx] = step(gte, matchedPtsOut.Location, ...
matchedPtsIn.Location);
cvexShowMatches(Iin,Iout,matchedPtsIn(inlierIdx),...
matchedPtsOut(inlierIdx),'inliersIn','inliersOut');
title('Matching inliers');
% recover the original image Iin from Iout
agt = vision.GeometricTransformer;
Ir = step(agt, im2single(Iout), tform);
figure; imshow(Ir); title('Recovered image');
input images are
</matlabcentral/answers/uploaded_files/34230/recovered%20image.jpg> anyone please help me to solve this problem

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by