如何根据角点做两幅opencv 图像做差之间的仿射变换

您的位置: &
基于角点匹配的密封条截面图像分块配准算法
优质期刊推荐 上传我的文档
 下载
 收藏
一线资深机电工程师,国家二级汽车运动裁判,曾参加广东省乃至国家级各类汽车运动等。
 下载此文档
基于Harris角点与SIFT特征的近景影像匹配
下载积分:0
内容提示:基于Harris角点与SIFT特征的近景影像匹配
文档格式:PDF|
浏览次数:88|
上传日期: 07:32:12|
文档星级:
全文阅读已结束,此文档不支持下载
该用户还上传了这些文档
基于Harris角点与SIFT特征的近景影像匹配
关注微信公众号查看: 21421|回复: 23|关注: 0
如何根据角点做两幅图像之间的仿射变换
<h1 style="color:# 麦片财富积分
新手, 积分 5, 距离下一级还需 45 积分
各位大侠有没有研究图像仿射变换的,具体来讲就是:有两幅图像(其中一幅是模板,另一幅是被检测的),我们的目标是找到被检测图片跟模板之间的不同(例如:缺少或多点东西)。现在组长的思路是:先提取出两幅图像的角点(已完成),然后根据角点做仿射变换,再匹配找不同。我查了些资料,论坛有高手做处匹配结果的,但是也只能知道哪些点跟哪些点匹配,却无法知道哪里不一样,更不能知道怎么不一样了。不知道我的意思有没有表述明白,请各位研究过的同志给予一下帮助,不胜感激!
MATLAB 图像处理与计算机视觉版块优秀回答者
<h1 style="color:# 麦片财富积分
关注者: 20
这些matlab的computer vision toolbox都有现成的吧。
<h1 style="color:# 麦片财富积分
荒草 发表于
这些matlab的computer vision toolbox都有现成的吧。
matlab中好像都是要手动选择特征点的,我们想做的是自动匹配的。
<h1 style="color:# 麦片财富积分
现在问题换成& &根据匹配结果做投影变换,找到匹配点后,如何找投影方程呢?
MATLAB 图像处理与计算机视觉版块优秀回答者
<h1 style="color:# 麦片财富积分
关注者: 20
bingjilin1125 发表于
现在问题换成& &根据匹配结果做投影变换,找到匹配点后,如何找投影方程呢? ...
给你个例子吧,希望有所帮助。%% Read Frames from a Movie File
filename1 = '..\image\test3.bmp';
filename2 = '..\image\test4.bmp';
hVideoSrcA = vision.VideoFileReader(filename1, 'ImageColorSpace', 'Intensity');
hVideoSrcB = vision.VideoFileReader(filename2, 'ImageColorSpace', 'Intensity');
imgA = step(hVideoSrcA);
imgB = step(hVideoSrcB);
imshowpair(imgA, imgB, 'montage');
title(['Frame A',repmat(' ',[1 70]), 'Frame B']);
imshowpair(imgA, imgB, 'ColorChannels', 'red-cyan');
title('Color composite (frame A = red, frame B = cyan)')
%% Collect Salient Points from Each Frame
ptThresh = 0.1;
pointsA = detectFASTFeatures(imgA, 'MinContrast',ptThresh);
pointsB = detectFASTFeatures(imgB, 'MinContrast',ptThresh);
% Display corners found in images A and B
imshow(imgA); hold on
plot(pointsA);
title('Corners in A');
imshow(imgB); hold on
plot(pointsB);
title('Corners in B');
%% Select Correspondences Between Points
% Extract FREAK descriptors for the corners
[featuresA, pointsA] = extractFeatures(imgA, pointsA);
[featuresB, pointsB] = extractFeatures(imgB, pointsB);
indexPairs = matchFeatures(featuresA, featuresB);
pointsA = pointsA(indexPairs(:,1), :);
pointsB = pointsB(indexPairs(:,2), :);
showMatchedFeatures(imgA, imgB, pointsA, pointsB);
legend('A','B');
%% Estimating Transform from Noisy Correspondences
[tform, pointsBm, pointsAm] = estimateGeometricTransform(pointsB, pointsA, 'affine');
imgBp = imwarp(imgB, tform, 'OutputView', imref2d(size(imgB)));
pointsBmp = transformPointsForward(tform, pointsBm.Location);
showMatchedFeatures(imgA, imgBp, pointsAm, pointsBmp);
legend('A', 'B');
%% Transform approximation and Smoothing
% Extract scale and rotation part sub-matrix
H = tform.T;
R = H(1:2, 1:2);
% Compute theta from mean of two possible arctangents
theta = mean([atan2(R(2),R(1)) atan2(-R(3),R(4))]);
% compute scale from mean of two stable mean calculations
scale = mean(R([1 4])/cos(theta));
% Translation remains the same:
translation = H(3, 1:2);
% Reconstitute new s-R-t transform:
HsRt = [[scale*[cos(theta) -sin(theta);sin(theta) cos(theta)];translation],[0 0 1]'];
tformsRT = affine2d(HsRt);
imgBold = imwarp(imgB, tform, 'OutputView', imref2d(size(imgB)));
imgBsRt = imwarp(imgB, tformsRT, 'OutputView', imref2d(size(imgB)));
figure
imshowpair(imgBold,imgBsRt,'ColorChannels','red-cyan');
title('Color composite of affine and s-R-t transform outputs');复制代码
MATLAB 图像处理与计算机视觉版块优秀回答者
<h1 style="color:# 麦片财富积分
关注者: 20
上面这个程序得在matlab R2013a上才能运行成功,之前的版本貌似还没有detectFASTFeatures这个函数。如果你没有安装matlab R2013a的话,就换个算法吧,比如说换成detectSURFFeature或者detectHarrisFeatures函数
<h1 style="color:# 麦片财富积分
各位大神求一个抖动的视频!~
<h1 style="color:# 麦片财富积分
上面这个程序得在matlab R2013a上才能运行成功,之前的版本貌似还没有detectFASTFeatures这个函数。如果你 ...
detectSURFFeature或者detectHarrisFeatures函数 是不是在2010版也没有啊,我查找了没有啊
MATLAB 图像处理与计算机视觉版块优秀回答者
<h1 style="color:# 麦片财富积分
关注者: 20
detectSURFFeature或者detectHarrisFeatures函数 是不是在2010版也没有啊,我查找了没有啊 ...
既然自己都查了,就相信自己吧。
<h1 style="color:# 麦片财富积分
既然自己都查了,就相信自己吧。
不是,我的matlab是简装版,我是想问下这三个函数detectFASTFeatures、detectSURFFeature或者detectHarrisFeatures函数,只有在2013版本才有吗?
站长推荐 /2
机器视觉和人工智能在医疗设备中的应用及实现
MATLAB中文论坛是全球最大的 MATLAB & Simulink 中文社区。用户免费注册会员后,即可下载代码,讨论问题,请教资深用户及结识书籍作者。立即注册加入我们吧!
MATLAB官方社交平台
MATLAB中文论坛微社区}

我要回帖

更多关于 excel怎么做函数图像 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信