使用cv::findFundamentalMat要注意的几点
来源:互联网 发布:ubuntu重启网络命令 编辑:程序博客网 时间:2024/05/21 10:50
在新版的OpenCV中,很多C代码都被重新封装成了C++代码,相应的其调用接口也发生了改变,而文档中的叙述也越来越不清楚,往往导致使用过程中出现各种问题。
//! the algorithm for finding fundamental matrix
enum
{
};
//! finds fundamental matrix from a set of corresponding 2D points
CV_EXPORTS Mat findFundamentalMat( const Mat& points1, const Mat& points2,
//! finds fundamental matrix from a set of corresponding 2D points
CV_EXPORTS_W Mat findFundamentalMat( const Mat& points1, const Mat& points2,
// vector<KeyPoint> m_LeftKey;
//
// vector<DMatch> m_Matches;
// 以上三个变量已经被计算出来,分别是提取的关键点及其匹配,下面直接计算F
// 分配空间
int ptCount = (int)m_Matches.size();
Mat p1(ptCount, 2, CV_32F);
Mat p2(ptCount, 2, CV_32F);
// 把Keypoint转换为Mat
Point2f pt;
for (int i=0; i<ptCount; i++)
{
}
// 用RANSAC方法计算F
// Mat m_Fundamental;
// 上面这个变量是基本矩阵
// vector<uchar> m_RANSACStatus;
// 上面这个变量已经定义过,用于存储RANSAC后每个点的状态
m_Fundamental = findFundamentalMat(p1, p2, m_RANSACStatus, FM_RANSAC);
// 计算野点个数
int OutlinerCount = 0;
for (int i=0; i<ptCount; i++)
{
}
// 计算内点
// vector<Point2f> m_LeftInlier;
//
//
// 上面三个变量用于保存内点和匹配关系
int InlinerCount = ptCount - OutlinerCount;
m_InlierMatches.resize(InlinerCount);
m_LeftInlier.resize(InlinerCount);
m_RightInlier.resize(InlinerCount);
InlinerCount = 0;
for (int i=0; i<ptCount; i++)
{
}
// 把内点转换为drawMatches可以使用的格式
vector<KeyPoint> key1(InlinerCount);
vector<KeyPoint> key2(InlinerCount);
KeyPoint::convert(m_LeftInlier, key1);
KeyPoint::convert(m_RightInlier, key2);
// 显示计算F过后的内点匹配
// Mat m_matLeftImage;
// Mat m_matRightImage;
// 以上两个变量保存的是左右两幅图像
Mat OutImage;
drawMatches(m_matLeftImage, key1, m_matRightImage, key2, m_InlierMatches, OutImage);
cvNamedWindow( "Match features", 1);
cvShowImage("Match features", &(IplImage(OutImage)));
cvWaitKey( 0 );
cvDestroyWindow( "Match features" );
初始匹配:
RANSAC过后的内点匹配:
- 使用cv::findFundamentalMat要注意的几点
- 使用cv::findFundamentalMat要注意的几点
- 使用cv::findFundamentalMat要注意的几点
- 使用cv::findFundamentalMat要注意的几点
- 使用cv::findFundamentalMat要注意的几点
- 使用cv::findFundamentalMat要注意的几点
- OleDbCommand 或 OdbcCommand 使用参数要注意的几点。
- OleDbCommand 或 OdbcCommand 使用参数要注意的几点。
- OleDbCommand 或 OdbcCommand 使用参数要注意的几点。
- OleDbCommand 或 OdbcCommand 使用参数要注意的几点
- OleDbCommand 或 OdbcCommand 使用参数要注意的几点。
- MacVim 使用 ConqueTerm 插件要注意的几点
- 关于使用ActionBar要注意的几点<动态更新...>
- 使用密码文件的几点注意
- 使用SqlDataReader注意的几点
- 使用SqlDataReader注意的几点
- 使用SqlDataReader注意的几点
- 使用SqlDataReader注意的几点
- svn merge 时候出现的问题以及解决方法
- c++中的quick_sort
- (Android特效)—OriSim3D-Android--opengl 实现各种逼真折纸效果
- Letter Combinations of a Phone Number
- 清华的精神
- 使用cv::findFundamentalMat要注意的几点
- springMVC Spring MVC 异常处理
- 如何在VC中调用CLAPACK
- Android APK插件化——第三方专门做APK插件化的公司
- JAVA多线程和并发性知识点总结
- php匿名函数
- linux-centos65-jdk安装-亲测可用
- rk3188--3.initramfs_data.cpio的生成及使用
- tomcat配置https 单向 以及 双向 验证