estimateGeometricTransform

function [tform, inlier_points1, inlier_points2, status]     =  estimateGeometricTransform(matched_points1, matched_points2,transform_type, varargin)


估计匹配点的几何变换

 tform = estimateGeometricTransform(matchedPoints1,matchedPoints2, transformType) 

返回二维矩阵,即变换矩阵。matchedPoints1 和matchedPoints2 可以是 cornerPoints objects,SURFPoints objects, MSERRegions objects, BRISKPoints objects, or M-by-2
 matrices of [x,y] coordinates.

transformType参数可以是:‘similarity’或‘affine’或‘projective’。

matchedPoints1和matchedPoints1之间的异常点使用M-estimator SAmple Consensus(MSAC)算法进行排除。MSAC是Random Sample Consensus(RANSAC)的变形。如果transformType设置成‘similarity’或‘affine’返回值tform是一个affine2d类型,否则是projective2d。


 [tform,inlierPoints1,inlierPoints2] = estimateGeometricTransform(...)也返回了相匹配的特征点。

 [tform,inlierPoints1,inlierPoints2,status] = estimateGeometricTransform(...)还返回了以下可能状态值。

0:没有错误

1:matchedPoints1和matchedPoints2中没有足够的点

2:没有发现足够的匹配点

当STATUS没有输出时,函数将会给出错误。如上

[...] = estimateGeometricTransform(matchedPoints1,matchedPoints2, transformType,Name,Value) 

附加name-value参数对,描述如下:


‘MaxNumTrails’  正整数:随机特征,值变大鞥能够提高输出的鲁棒性

 Default value: 1000

‘Confidence’  0<C<100,寻找最大值的可信度(百分比)。值变大能够提高输出鲁棒性

Default value: 99

‘MaxDistance’ 正值,投影位置和相关位置之间的最大像素距离

Default value: 1.5


%   Class Support
%   -------------
%   matchedPoints1 and matchedPoints2 must be cornerPoints objects,
%   SURFPoints objects, MSERRegions objects, BRISKPoints objects, or M-by-2
%   matrices of [x,y] coordinates.
%
%   % EXAMPLE: Recover a transformed image using SURF feature points
%   % --------------------------------------------------------------
%   Iin  = imread('cameraman.tif'); imshow(Iin); title('Base image');
%   Iout = imresize(Iin, 0.7); Iout = imrotate(Iout, 31);
%   figure; imshow(Iout); title('Transformed image');
%  
%   % 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);
%   matchedPtsIn  = validPtsIn(index_pairs(:,1));
%   matchedPtsOut = validPtsOut(index_pairs(:,2));
%   figure; showMatchedFeatures(Iin,Iout,matchedPtsIn,matchedPtsOut);
%   title('Matched SURF points, including outliers');
%  
%   % Exclude the outliers and compute the transformation matrix
%   [tform,inlierPtsOut,inlierPtsIn] = estimateGeometricTransform(...
%        matchedPtsOut,matchedPtsIn,'similarity');
%   figure; showMatchedFeatures(Iin,Iout,inlierPtsIn,inlierPtsOut);
%   title('Matched inlier points');
%  
%   % Recover the original image Iin from Iout
%   outputView = imref2d(size(Iin));
%   Ir = imwarp(Iout, tform, 'OutputView', outputView);
%   figure; imshow(Ir); title('Recovered image');

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值