Matlab-vision包学习-Image Registration and Geometric Transformation
2015-10-05 16:35
686 查看
在这一篇中,我们将介绍一个新的函数:estimateGeometricTransform,其它的函数都在之前介绍学习过了。
函数/Functions
函数名称:estimateGeometricTransform
功能:利用匹配的特征点对估计几何变换(Similarity,affine,projective transformations)
语法:tform = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType);
[tform,inlierpoints1,inlierpoints2] = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType);
[_,status] = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType);
[ _ ] = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType,Name,Value);
其中,matchedPoints1和matchedPoints2分别表示两个图像匹配的对应点;tform是几何变换对象(affine2d object/projective2d object);transformType是可以取值为’similarity'/'affine'/'projective',即几何变换的类型;status为返回状态,具体取值如下表;inlierpoints1和inlierpoints2分别为两个图像对应的内点;Name为用一对单引号包含的字符串,Value为对应Name的值。
status及含义
Name&Value参数
举例:
函数/Functions
函数名称:estimateGeometricTransform
功能:利用匹配的特征点对估计几何变换(Similarity,affine,projective transformations)
语法:tform = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType);
[tform,inlierpoints1,inlierpoints2] = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType);
[_,status] = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType);
[ _ ] = estimateGeometricTransform(matchedPoints1, matchedPoints2,transformType,Name,Value);
其中,matchedPoints1和matchedPoints2分别表示两个图像匹配的对应点;tform是几何变换对象(affine2d object/projective2d object);transformType是可以取值为’similarity'/'affine'/'projective',即几何变换的类型;status为返回状态,具体取值如下表;inlierpoints1和inlierpoints2分别为两个图像对应的内点;Name为用一对单引号包含的字符串,Value为对应Name的值。
status | 含义 |
---|---|
0 | 无错误 |
1 | matchedPoints1 和 matchedPoints2点不足 |
2 | 足够的内点没有发现 |
Name | Value |
---|---|
'MaxNumTrials' | 默认值为1000,范围为正整数,为了获取最大内点进行随机试验的次数,取较大的值时,能够提高估计的鲁棒性 |
'Confidence' | 默认值为99,范围为(0,100),获取最爱内点的置信度,取较大值时能够提高估计的鲁棒性 |
'MaxDistance' | 默认值为1.5,范围为>0,可以衡量误差 |
close all; clear all; clc; % 原图像 original = imread('cameraman.tif'); imshow(original); title('Base image'); % 退化图像 distorted = imresize(original,0.7); distorted = imrotate(distorted,31); figure; imshow(distorted); title('Transformed image'); % 提取SURF特征点 ptsOriginal = detectSURFFeatures(original); ptsDistorted = detectSURFFeatures(distorted); % 获取描述子 [featuresOriginal,validPtsOriginal] = extractFeatures(original,ptsOriginal); [featuresDistorted,validPtsDistorted] = extractFeatures(distorted,ptsDistorted); % 描述子匹配 index_pairs = matchFeatures(featuresOriginal,featuresDistorted); % 匹配的特征点 matchedPtsOriginal = validPtsOriginal(index_pairs(:,1)); matchedPtsDistorted = validPtsDistorted(index_pairs(:,2)); %显示匹配结果 figure; showMatchedFeatures(original,distorted,matchedPtsOriginal,matchedPtsDistorted); title('Matched SURF points, including outliers'); %估计几何变换矩阵 [tform,inlierPtsDistorted,inlierPtsOriginal] = estimateGeometricTransform(matchedPtsDistorted,matchedPtsOriginal,'similarity'); figure; showMatchedFeatures(original,distorted,inlierPtsOriginal,inlierPtsDistorted); title('Matched inlier points'); %反变换图像 outputView = imref2d(size(original)); Ir = imwarp(distorted,tform,'OutputView',outputView); figure; imshow(Ir); title('Recovered image');
相关文章推荐
- matlab for循环的三种类型
- Matlab - 产生高斯噪声
- Matlab-vision包学习-Feature Detection,Extraction and Matching-显示匹配结果的函数
- Matlab-vision包学习-Feature Detection,Extraction and Matching-匹配
- matlab中plot画图参数的设置
- Matlab-vision包学习-Feature Detection,Extraction and Matching-提取HOG描述子
- 《数字图像处理原理与实践(MATLAB文本)》书代码Part7
- Matlab-vision包学习-Feature Detection,Extraction and Matching-提取描述子
- 谱聚类(NJW算法 Matlab代码)
- Matlab-vision包学习-Feature Detection,Extraction and Matching-SURF检测blob
- matlab 利用while循环计算平均值和方差(第二版)
- Matlab-vision包学习-Feature Detection,Extraction and Matching-MSER特征提取
- matlab 利用while循环计算平均值和方差
- Matlab-vision包学习-Feature Detection,Extraction and Matching-最小特征值角点检测
- Matlab-vision包学习-Feature Detection,Extraction and Matching-Harris角点检测
- Matlab-vision包学习-Feature Detection,Extraction and Matching-FAST角点检测
- Matlab-vision包学习-Feature Detection,Extraction and Matching-BRISK角点检测
- C程序调用matlab (Win8 64 bit + VS 2013 + Matlab R2014a)
- matlab中hold指令、figure指令及subplot指令的使用
- matlab中hold指令、figure指令及subplot指令的使用