资源简介
prosac的源代码,内附实例,适合初学者。
代码片段和文件信息
#include “stdafx.h“
#include “time.h“
#include “Prosac.h“
#include “opencv/cv.h“
#include “opencv2/opencv.hpp“
#include “opencv2/core/core.hpp“
#include “opencv2/features2d/features2d.hpp“
#include “opencv2/highgui/highgui.hpp“
#include “opencv2/calib3d/calib3d.hpp“
using namespace cv;
#include “fstream“
#include “iostream“
using namespace std;
int a[20000];
int counts=0;
int comb(int mint k)
{ int ij;
for (i=m;i>=k;i--)
{ a[k]=i;
if (k>1)
comb(i-1k-1);
else
{
counts++;
}
}
return counts;
}
void main()
{
//注意:在使用前需要对要粗匹配进行匹配度的降序排列,不然可能失效。如sift和surf等就存在匹配度的高低问题,有些算法没有就不适用哦
int point_num=9;
CvMat* object_points = cvCreateMat(point_num2CV_32F);;
CvMat* image_points = cvCreateMat(point_num2CV_32F);;
CvMat* Hom = cvCreateMat(33CV_32FC1);
CvMat* status= cvCreateMat(1point_numCV_8U);
CV_MAT_ELEM(*object_pointsfloat00)=0; CV_MAT_ELEM(*object_pointsfloat01)=0;
CV_MAT_ELEM(*object_pointsfloat10)=0; CV_MAT_ELEM(*object_pointsfloat11)=16.5;
CV_MAT_ELEM(*object_pointsfloat20)=0; CV_MAT_ELEM(*object_pointsfloat21)=33;
CV_MAT_ELEM(*object_pointsfloat30)=16.5; CV_MAT_ELEM(*object_pointsfloat31)=0;
CV_MAT_ELEM(*object_pointsfloat40)=16.5; CV_MAT_ELEM(*object_pointsfloat41)=16.5;
CV_MAT_ELEM(*object_pointsfloat50)=16.5; CV_MAT_ELEM(*object_pointsfloat51)=33;
CV_MAT_ELEM(*object_pointsfloat60)=33; CV_MAT_ELEM(*object_pointsfloat61)=0;
CV_MAT_ELEM(*object_pointsfloat70)=33; CV_MAT_ELEM(*object_pointsfloat71)=16.5;
CV_MAT_ELEM(*object_pointsfloat80)=33; CV_MAT_ELEM(*object_pointsfloat81)=33;
CV_MAT_ELEM(*image_pointsfloat00)=71; CV_MAT_ELEM(*image_pointsfloat01)=101;
CV_MAT_ELEM(*image_pointsfloat10)=71; CV_MAT_ELEM(*image_pointsfloat11)=117;
CV_MAT_ELEM(*image_pointsfloat20)=71; CV_MAT_ELEM(*image_pointsfloat21)=132;
CV_MAT_ELEM(*image_pointsfloat30)=86; CV_MAT_ELEM(*image_pointsfloat31)=170;
CV_MAT_ELEM(*image_pointsfloat40)=87; CV_MAT_ELEM(*image_pointsfloat41)=116;
CV_MAT_ELEM(*image_pointsfloat50)=87; CV_MAT_ELEM(*image_pointsfloat51)=132;
CV_MAT_ELEM(*image_pointsfloat60)=101; CV_MAT_ELEM(*image_pointsfloat61)=100;
CV_MAT_ELEM(*image_pointsfloat70)=102; CV_MAT_ELEM(*image_pointsfloat71)=116;
CV_MAT_ELEM(*image_pointsfloat80)=103; CV_MAT_ELEM(*image_pointsfloat81)=131;
int *ret_iterBest=0;int *ret_iterUsed=0;
while(1)
{
counts=0;
cvFindHomography_Prosac(object_pointsimage_pointsHom150.99126-1comb(point_num4)ret_iterBestret_iterUsedstatus);
for(int i=0;i<3;i++)
cout< for(int j=0;j<9;j++)
cout<<(int)CV_MAT_ELEM(*statusuchar0j)< }
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4854 2012-05-04 16:35 Prosac\Prosac\shiyan\shiyan.vcproj
文件 403562 2012-05-03 18:26 Prosac\Prosac\shiyan\opencv_core231.lib
文件 599562 2012-05-03 18:28 Prosac\Prosac\shiyan\opencv_features2d231.lib
文件 1177 2012-05-02 11:05 Prosac\Prosac\shiyan\ReadMe.txt
文件 233 2012-05-02 11:05 Prosac\Prosac\shiyan\stdafx.h
文件 114168 2012-05-03 18:27 Prosac\Prosac\shiyan\opencv_flann231.lib
文件 431112 2012-05-04 14:14 Prosac\Prosac\shiyan\opencv_gpu231.lib
文件 890668 2012-05-03 18:28 Prosac\Prosac\shiyan\opencv_haartraining_engine.lib
文件 144804 2012-05-03 18:27 Prosac\Prosac\shiyan\opencv_highgui231.lib
文件 19516 2012-05-04 16:35 Prosac\Prosac\shiyan\Prosac.h
文件 498 2012-05-02 11:05 Prosac\Prosac\shiyan\targetver.h
文件 211 2012-05-02 11:05 Prosac\Prosac\shiyan\stdafx.cpp
文件 296752 2012-05-03 18:27 Prosac\Prosac\shiyan\opencv_imgproc231.lib
文件 384020 2012-05-04 14:14 Prosac\Prosac\shiyan\opencv_legacy231.lib
文件 263150 2012-05-03 18:27 Prosac\Prosac\shiyan\opencv_ml231.lib
文件 337252 2012-05-04 14:14 Prosac\Prosac\shiyan\opencv_objdetect231.lib
文件 1427 2012-05-04 23:00 Prosac\Prosac\shiyan\shiyan.vcproj.E6F4FA065120441.Administrator.user
文件 303068 2012-05-03 18:27 Prosac\Prosac\shiyan\opencv_ts231.lib
文件 161652 2012-05-03 18:27 Prosac\Prosac\shiyan\opencv_video231.lib
文件 14258 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\BuildLog.htm
文件 663 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\shiyan.exe.em
文件 68608 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\vc90.idb
文件 3211264 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\shiyan.pch
文件 126976 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\vc90.pdb
文件 12721 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\stdafx.obj
文件 8377 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\shiyan.obj
文件 728 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\shiyan.exe.em
文件 621 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\shiyan.exe.intermediate.manifest
文件 67 2012-05-02 14:13 Prosac\Prosac\shiyan\Debug\mt.dep
文件 288824 2012-05-04 14:14 Prosac\Prosac\shiyan\opencv_calib3d231.lib
............此处省略29个文件信息
- 上一篇:shippower软件
- 下一篇:安卓调用百度地图实现
评论
共有 条评论