M.ain Content

eStimateGeometricTransform.

从匹配点对估计几何变换

Description

例子

tform= eStisimeGeometricTransform(matchedPoints1matchedPoints2transformType的)返回2-D几何变换对象,tform。Thetform对象映射inliersmatchedPoints1对替代者matchedPoints2

该功能不包括使用M估计的样本共识(MSAC)算法的异常值。MSAC算法是随机样本共识(RANSAC)算法的变体。Results may not be identical between runs because of the randomized nature of the MSAC algorithm.

笔记

This function will be removed in a future release. Use theeStimateGeometricTransform.2DoreStimateGeometricTransform.3.D函数提供更多的功能。

例子

[tforminlierpoints1inlierpoints2] = eStisimeGeometricTransform(matchedPoints1matchedPoints2transformType的)返回相应的Inlier点inlierpoints1andinlierpoints2

例子

[___status] = eStisimeGeometricTransform(matchedPoints1matchedPoints2transformType的)返回状态代码0.1, 要么2。如果你不请求statuscode output, the function returns an error for conditions that cannot produce results.

[___] = eStisimeGeometricTransform(matchedPoints1matchedPoints2transformType姓名那Value的)uses additional options specified by one or more姓名那Valuearguments.

Examples

collapse all

Read an image and display it.

原始= imread('cameraman.tif');imshow(original) title('Base Image'的)

扭曲并显示变换的图像。

distorted = imresize(original,0.7); distorted = imrotate(distorted,31); figure imshow(distorted) title('转换图像'的)

Detect and extract features from the original and the transformed images.

ptsoriginal =探测器(原始);ptsdistorted =检测(扭曲);[特征素,validptsoriginal] =提取物(原始,冒号);[具有截图,validptsdistorted] =提取物(扭曲,ptorted,ptordistored);

M.atch and display features between the images.

index_pairs = matchfeatures(特征逻辑,特点);matchedptsoriginal = validptsoriginal(index_pairs(:,1));matchedptsdistored = validptsdistorted(index_pairs(:,2));Figure ShowMatchedFeatures(原始,扭曲,Matchedptsoriginal,MatchedptsDistorted)标题('Matched SURF Points With Outliers');

Exclude the outliers, estimate the transformation matrix, and display the results.

[tform,inlieridx] = estimateGeometricTransform2D(MatchedPtsDistorted,MatchedPtSoriginal,'similarity');InLierptsDistorted = matchedptsdistorted(inlieridx,:);Inlierptsoriginal = matchedptsoriginal(Inlieridx,:);Figure ShowMatchedFeatures(原始,扭曲,inlierptsoriginal,InLierptsdistorted)标题('Matched Inlier Points'的)

Use the estimated transformation to recover and display the original image from the distorted image.

outputView = imref2d(size(original)); Ir = imwarp(distorted,tform,'OutputView'那outputView); figure imshow(Ir); title('Recovered Image');

Input Arguments

collapse all

来自image 1的匹配点,指定为aKAZEPointscornerPoints目的那截图Surfpoints.目的那MSERREGIONS.目的那ORBPoints目的那Brikspoints.or anM.-2矩阵[x,y]坐标。该功能不包括使用M估计的样本共识(MSAC)算法的异常值。MSAC算法是随机样本共识(RANSAC)算法的变体。

M.atched points from image 2, specified as either aKAZEPointscornerPoints目的那截图Surfpoints.目的那MSERREGIONS.目的那ORBPoints目的那Brikspoints.or anM.-2矩阵[x,y]坐标。该功能不包括使用M估计的样本共识(MSAC)算法的异常值。MSAC算法是随机样本共识(RANSAC)算法的变体。

变换类型那specified as one of three character strings. You can set the transform type to either'similarity''仿射', 要么'投影'。匹配成对的数量越大,估计变换的准确性越大。每个变换类型的最小匹配点数数:

变换类型 M.inimum Number of Matched Pairs of Points
'similarity' 2
'仿射' 3.
'投影' 4.

数据类型:char

名称 - 值参数

指定可选的逗号分离对姓名那Valuearguments.姓名是参数名称和Valueis the corresponding value.姓名must appear inside quotes. You can specify several name and value pair arguments in any order as姓名1那Value1,...,NameN,ValueN

Example:'Confidence'99将置信度值设置为99

M.aximum number of random trials for finding the inliers, specified as the comma-separated pair consisting of 'maxnumtrial'和一个正整数标量。增加此值以额外计算为代价提高了结果的稳健性。

数据类型:单身的|double|INT8.|int16|int32|int64|uint8.|uint16|UINT32|UINT64

信心of finding the maximum number of inliers, specified as the comma-separated pair consisting of '信心' and a percentage numeric scalar in the range (0 100). Increasing this value improves the robustness of the results at the expense of additional computations.

数据类型:单身的|double|INT8.|int16|int32|int64|uint8.|uint16|UINT32|UINT64

M.aximum distance in pixels, from a point to the projection of its corresponding point, specified as the comma-separated pair consisting of 'Maxdistance.'和一个正数标量。相应的投影基于估计的变换。

数据类型:单身的|double|INT8.|int16|int32|int64|uint8.|uint16|UINT32|UINT64

输出参数

collapse all

Geometric transformation, returned as either anAffine2d.目的or aprojective2d目的。

The returned geometric transformation matrix maps the inliers inmatchedPoints1对替代者matchedPoints2。When you set thetransformType输入到任一个'similarity'or'仿射',函数返回一个Affine2d.目的。Otherwise, it returns aprojective2d目的。

Status code, returned as the value0.1, 要么2

status Description
0. No error.
1 matchedPoints1andmatchedPoints2输入不包含足够的点。
2 发现没有足够的恋人。

如果你不请求status代码输出,函数将为无法生成结果的两个条件抛出错误。

数据类型:double

Image 1中的Inlier点,返回与输入匹配点相同的类型。

Inlier points in image 2, returned as the same type as the input matching points.

References

[1] Hartley, R., and A. Zisserman, "Multiple View Geometry in Computer Vision,"剑桥大学出版社那20.0.3.。

[2] Torr, P. H. S., and A. Zisserman, "MLESAC: A New Robust Estimator with Application to Estimating Image Geometry,"计算机视觉和图像理解那20.0.0.。

扩展能力

Introduced in R2013a