showMatchedFeatures, MATLAB. features, - , N x 2. , , . , .
, - , (, , , ).
MATLAB:
http://www.mathworks.com/help/vision/ref/showmatchedfeatures.html
, :
http://www.mathworks.com/help/vision/ref/showmatchedfeatures.html#btfmijs
: Computer Vision showMatchedFeatures. , . Computer Vision, , . , (uint8, uint16 ..) .
, Image Processing Toolbox, - :
% Assuming im1 and im2 are already loaded into your environment
% im1 and im2 are the two images you are comparing to
% points1 and points2 are M x 2 matrices of corresponding points
% between im1 and im2
% The co-ordinates in the ith row of points1 correspond to the
% ith row of points2
% Important Note: Each row assumes co-ordinates in (x,y) format
% x - horizontal, y - vertical
% y is assumed to be y-down (i.e. downwards is positive)
figure;
stackedImage = cat(2, im1, im2); % Places the two images side by side
imshow(stackedImage);
width = size(im1, 2);
hold on;
numPoints = size(points1, 1); % points2 must have same
% Note, we must offset by the width of the image
for i = 1 : numPoints
plot(points1(i, 1), points1(i, 2), 'y+', points2(i, 1) + width, ...
points2(i, 2), 'y+');
line([points1(i, 1) points2(i, 1) + width], [points1(i, 2) points2(i, 2)], ...
'Color', 'yellow');
end
, showMatchedFeatures.
, ?
, , , (.. / ), , , - - sum. . , , :
figure;
[rows1,cols1] = size(im1);
[rows2,cols2] = size(im2);
%// Create blank image
stackedImage = zeros(max([rows1,rows2]), cols1+cols2);
stackedImage = cast(stackedImage, class(im1)); %// Make sure we cast output
%// Place two images side by side
stackedImage(1:rows1,1:cols1) = im1;
stackedImage(1:rows2,cols1+1:cols1+cols2) = im2;
%// Code from before
imshow(stackedImage);
width = size(im1, 2);
hold on;
numPoints = size(points1, 1); % points2 must have same
% Note, we must offset by the width of the image
for i = 1 : numPoints
plot(points1(i, 1), points1(i, 2), 'y+', points2(i, 1) + width, ...
points2(i, 2), 'y+');
line([points1(i, 1) points2(i, 1) + width], [points1(i, 2) points2(i, 2)], ...
'Color', 'yellow');
end