双目视觉测量的,极线匹配
来源:互联网 发布:网络传奇游戏排行榜 编辑:程序博客网 时间:2024/05/01 01:37
基于OpenCV的立体匹配与极线几何测试,VC6+OpenCV+MDI框架,匹配用SIFT,基础矩阵算法可选,默认为RANSAC。
鼠标在左或右图单击,在另一图上则画出对应的极线,蓝色表示。
当年的日志:
完成cpp版的sift移植.
2:16 2006-5-26
贴一点代码:
- void CMyEpilineView::OnLButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
- CMainFrame *pFrame = (CMainFrame *)AfxGetApp()->m_pMainWnd;
- CMyEpilineView *another;//先判断是否为左或右视图
- if(this==pFrame->m_leftView)
- another=pFrame->m_rightView;
- else if(this==pFrame->m_rightView)
- another=pFrame->m_leftView;
- else
- return;
- if (!pFrame->m_fundamental_matrix) // 当没计算基础矩阵时
- return;
- cvCircle(this->GetDocument()->m_image, cvPoint(point.x,point.y), 2, CV_RGB(0,0,255), 1,8,0);
- this->Invalidate(TRUE);
- CvMat* points1 = cvCreateMat(2,3,CV_32F);//1个点不行!最少为3,虽然只用1个点
- cvmSet(points1,0,0, point.x );
- cvmSet(points1,1,0, point.y );
- CvMat *correspondent_lines= cvCreateMat(3,3,CV_32F);//最少为3
- if(this==pFrame->m_leftView)
- cvComputeCorrespondEpilines(points1,1,pFrame->m_fundamental_matrix,correspondent_lines);
- else if(this==pFrame->m_rightView)
- cvComputeCorrespondEpilines(points1,2,pFrame->m_fundamental_matrix,correspondent_lines);
- else
- return;
- //float a = correspondent_lines->data.ptr[j]+.000001;
- //float b = (correspondent_lines->data.ptr+correspondent_lines->step)[j]+.000001;
- //float c = (correspondent_lines->data.ptr+correspondent_lines->step*2)[j];
- float a = cvmGet(correspondent_lines, 0, 0 );
- float b = cvmGet(correspondent_lines, 1, 0 );
- float c = cvmGet(correspondent_lines, 2, 0 );
- cvReleaseMat(&points1);
- cvReleaseMat(&correspondent_lines);
- cvLine( another->GetDocument()->m_image, cvPoint( 0, (int)-c/b ),
- cvPoint(another->GetDocument()->m_image->width,(int)(-c-a*another->GetDocument()->m_image->width)/b), CV_RGB(0,0,255),1,8,0 );
- //cvCircle(image2, cvPoint( (int)cvmGet(points2,0,i),(int)cvmGet(points2,1,i) ), 2, CV_RGB(255,0,0), 1,8,0);
- //printf("epiline:(0,%d)-->(%d,0)\n",(int)-c/b,(int)-c/a);
- //printf("%f,%f,%f\n",a,b,c);
- another->Invalidate();
- // cvNamedWindow("click epiline",1);
- // cvShowImage("click epiline",another->GetDocument()->m_image);
- // cvWaitKey(0);
- CScrollView::OnLButtonDown(nFlags, point);
- }
上图:
上图:
0 0
- 双目视觉测量的,极线匹配
- opencv双目视觉标定、匹配和测量
- opencv双目视觉标定、匹配和测量 (附代码)
- opencv双目视觉标定、匹配和测量 (附代码)
- 【计算机视觉】 opencv双目视觉标定、匹配和测量 (附代码)
- 基于双目立体视觉的物体三维尺寸测量
- 双目视觉---立体匹配介绍
- 【立体视觉】双目图像匹配
- 双目视觉的框架
- 双目视觉的标定
- 双目视觉——立体匹配基本理论
- 双目立体视觉SAD匹配算法
- 双目视觉---图像匹配基本算法总结
- 双目视觉测量系统设计中的一些注意事项
- 一些双目视觉的资料
- 双目立体视觉的发展
- 双目立体视觉的原理
- 双目视觉
- Ubuntu 14.04远程登录服务器--ssh的安装和配置
- sgu258:Almost Lucky Numbers(数位DP)
- java序列化
- Android-带清除按钮的输入框实现
- fatal: Not a git repository (or any parent up to mount parent /media) Stopping at filesystem boundar
- 双目视觉测量的,极线匹配
- leetcode - Valid Number
- DOM性能瓶颈与Javascript性能优化
- java 属性拷贝工具类
- iOS读取通讯录
- Python深入:02浅拷贝深拷贝
- db2 建库,建表空间,索引空间的一点参考
- eclipse大小写转换快捷键
- std::function 和 std::bind