Homography单应性矩阵程序实现
来源:互联网 发布:数据库获取当前时间 编辑:程序博客网 时间:2024/06/06 14:04
单应性矩阵重要应用在求解两幅图像的映射关系,或者图像坐标与世界坐标的映射关系。
这里主要在张正有相机标定法的基础上,求解H。
具体理论为请点:相机标定法-张正有
Opencv程序实现
std::vector<Point2f> pt1(4); std::vector<Point2f> pt2(4); pt1[0] = Point2f(0,0) ; pt1[1] = Point2f(1,0) ; pt1[2] = Point2f(1,1) ; pt1[3] = Point2f(0,1) ; pt2[0] = Point2f(496.01f,147.48f); //496.0167 147.4822 pt2[1] = Point2f(492,419); pt2[2] = Point2f(118,355); pt2[3] = Point2f(200,98); std::vector<unsigned char> inliersMask(4); cv::Mat h = cv::findHomography( (Mat)pt1, (Mat)pt2, CV_FM_RANSAC, 1.0,inliersMask);
Matlab程序实现
m=[496.01,492,118,200;147.48,419,355,98;1,1,1,1];M=[0 1 1 0; 0 0 1 1; 1 1 1 1 ];load ('mx1.mat');NP = size(m,2);p=ones(2*NP,9);for i=1:NP %每幅图像取NP个点 p(2*i-1,:)=[M(:,i)' 0 0 0 -m(1,i)*M(:,i)']; p(2*i,:)= [0 0 0 M(:,i)' -m(2,i)*M(:,i)'];end;[U S V]=svd(p); %正交分解H=V(:,9); %取V的最后一列H=H/H(9); %归一化options = optimset('LargeScale','off','LevenbergMarquardt','on');% 使用lsqnonlin进行非线性最小二乘求解x = lsqnonlin( @fun1, reshape(H,1,9) , [],[],options, m, M);H=reshape(x,3,3); % 将矩阵H恢复为3*3H=H';f=H;
0 0
- Homography单应性矩阵程序实现
- Homography,opencv,单应性矩阵的计算原理
- Homography单应矩阵
- Homography单应矩阵
- 关于单应性矩阵的理解:Homography matrix for dummies
- 单应矩阵Homography介绍
- 单应矩阵Homography求解
- Homography estimation实现
- homography单应性求解
- 单应性变换(Homography)
- 单应性变换(Homography)
- Homography
- 平面单应矩阵Homography介绍
- 单应性(homography)变换的推导
- 从Homography矩阵得到旋转和平移量(From Homography to Rotation and Translation)
- 单应性(homography)变换的公式推导过程
- STM32F407实现矩阵键盘程序
- Java程序实现矩阵乘法
- win10 edge打不开,解决方案
- 【hibernate进阶】hibernate持久化对象的三种状态
- Weka中文乱码解决方法
- 三个故事
- 第十一周上机实践项目3(2):警察和厨师
- Homography单应性矩阵程序实现
- 随笔
- 深入学习java集合:LinkedHashMap<K,V>实现
- Win8风格界面效果
- Unity Oculus开发注意事项
- javax.persistence.Table.indexes()[Ljavax/persistence/Index;
- 睡眠理发师问题
- 深入学习java集合:Hashtable<K,V>实现
- 简单配置yum源安装软件