资源简介
多幅图像拼接matlab实现 sift特征提取、描述、匹配、RANSAC、仿射变换
代码片段和文件信息
function H = ComputeAffineMatrix( Pt1 Pt2 )
%ComputeAffineMatrix
% Computes the transformation matrix that transforms a point from
% coordinate frame 1 to coordinate frame 2
%Input:
% Pt1: N * 2 matrix each row is a point in image 1
% (N must be at least 3)
% Pt2: N * 2 matrix each row is the point in image 2 that
% matches the same point in image 1 (N should be more than 3)
%Output:
% H: 3 * 3 affine transformation matrix
% such that H*pt1(i:) = pt2(i:)
N = size(Pt11);
if size(Pt1 1) ~= size(Pt2 1)
error(‘Dimensions unmatched.‘);
elseif N<3
error(‘At least 3 points are required.‘);
end
% Convert the input points to homogeneous coordintes.
P1 = [Pt1‘;ones(1N)];
P2 = [Pt2‘;ones(1N)];
% Now we must solve for the unknown H that satisfies H*P1=P2
% But MATLAB needs a system in the form Ax=b and A\b solves for x.
% In other words the unknown matrix must be on the right.
% But we can use the properties of matrix transpose to get something
% in that form. Just take the transpose of both sides of our equation
% above to yield P1‘*H‘=P2‘. Then MATLAB can solve for H‘ and we can
% transpose the result to produce H.
H = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% YOUR CODE HERE: %
% Use MATLAB‘s “A\b“ syntax to solve for H_transpose as discussed %
% above then convert it to the final H %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
H_transpose=P1‘\P2‘;
H=H_transpose‘;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% END OF YOUR CODE %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sometimes numerical issues cause least-squares to produce a bottom
% row which is not exactly [0 0 1] which confuses some of the later
% code. So we‘ll ensure the bottom row is exactly [0 0 1].
H(3:) = [0 0 1];
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12292 2014-10-06 11:35 PA1\.DS_Store
文件 8435 2013-10-09 22:09 PA1\alternate template for LaTeX users\cvpr.sty
文件 10285 2013-10-09 22:09 PA1\alternate template for LaTeX users\yourSUNetID_PA1.tex
文件 207 2013-10-02 19:11 PA1\checkpoint\Affine_ref.mat
文件 987133 2013-10-02 19:23 PA1\checkpoint\Match_input.mat
文件 255 2013-10-02 19:27 PA1\checkpoint\Match_ref.mat
文件 76813 2013-10-06 12:46 PA1\checkpoint\SIFT_ref.mat
文件 2387 2016-10-19 15:55 PA1\ComputeAffineMatrix.m
文件 64410 2009-10-10 11:54 PA1\data\campus_000.jpg
文件 52963 2009-10-10 11:54 PA1\data\campus_001.jpg
文件 36253 2009-10-10 11:54 PA1\data\campus_002.jpg
文件 39294 2009-10-10 11:54 PA1\data\campus_003.jpg
文件 57098 2009-10-10 11:54 PA1\data\campus_004.jpg
文件 108679 2013-10-06 11:17 PA1\data\pine1.jpg
文件 128952 2013-10-06 11:18 PA1\data\pine2.jpg
文件 126069 2013-10-06 11:18 PA1\data\pine3.jpg
文件 120636 2013-10-06 11:18 PA1\data\pine4.jpg
文件 195037 2009-10-10 12:37 PA1\data\trees_000.jpg
文件 230526 2009-10-10 12:49 PA1\data\trees_001.jpg
文件 253284 2009-10-10 12:37 PA1\data\trees_002.jpg
文件 267269 2009-10-10 12:37 PA1\data\trees_003.jpg
文件 39785 2013-10-03 19:52 PA1\data\uttower1.jpg
文件 39568 2013-10-03 19:52 PA1\data\uttower2.jpg
文件 38794 2013-10-06 00:14 PA1\data\uttower2_bad.jpg
文件 169535 2013-10-05 17:04 PA1\data\uttower2_scaledup.jpg
文件 21755 2013-10-12 01:34 PA1\data\yard1.jpg
文件 19016 2013-10-12 01:34 PA1\data\yard2.jpg
文件 15919 2013-10-12 01:34 PA1\data\yard3.jpg
文件 14347 2013-10-12 01:34 PA1\data\yard4.jpg
文件 203176 2009-10-11 14:14 PA1\data\yosemite1.jpg
............此处省略69个文件信息
- 上一篇:matlab计算峰值旁瓣比和积分旁瓣比
- 下一篇:多机器人路径规划-matlab
相关资源
- 多机器人路径规划-matlab
- matlab计算峰值旁瓣比和积分旁瓣比
- 空间三自由度机械臂MATLAB仿真模型
- 模型预测控制MPC程序
- MATLAB工具箱大全,各种算法
- MATLAB下人脸图像的PCA重构
- 人脸表情识别matlab代码
- 雷达回波信号建模与仿真研究
- matlab图像粗糙度计算
- ransac 的详细介绍以及matlabtoolbox的使用
- matlab基于暗通道原理去雾算法
- matlab版图像矫正源码
- matlab音乐合成108267
- 基于MATLAB的DVB系统仿真程序
- matlab中关于三维重建的源代码,《计
- 人脸人眼定位算法matlab实现代码
- MATLAB底层代码实现深度学习LeNet网络
- MATLAB R2016a数字图像处理算法分析与实
- 基于MATLAB的一维条形码检测
- comsol和matlab接口
- MATLAB语音信号分析与合成代码
- 基于MATLAB的直线天线阵的仿真
- Matlab编写的决策树及剪枝算法实现数
- matlab教程(张志涌)
- 数值计算方法课后编程
- 蒙特卡洛随机潮流与和密度估计Matl
- LDA与PCA的讲解与matlab演示
- kriging 详细插值matlab程序 代码
- CT图像重建 matlab 程序
- 基于MATLAB的三相异步电机转速调节的
评论
共有 条评论