zz:http://blog.csdn.net/gnuhpc/archive/2009/06/22/4287859.aspx
#include <iostream>
#include <cv.h>
//------------ 各種外部変数 ----------//
double first[12][2] =
{
{488.362, 169.911},
{449.488, 174.44},
{408.565, 179.669},
{364.512, 184.56},
{491.483, 122.366},
{451.512, 126.56},
{409.502, 130.342},
{365.5, 134},
{494.335, 74.544},
{453.5, 76.5},
{411.646, 79.5901},
{366.498, 81.6577}
};
double second[12][2] =
{
{526.605, 213.332},
{470.485, 207.632},
{417.5, 201},
{367.485, 195.632},
{530.673, 156.417},
{473.749, 151.39},
{419.503, 146.656},
{368.669, 142.565},
{534.632, 97.5152},
{475.84, 94.6777},
{421.16, 90.3223},
{368.5, 87.5}
};
int main(int argc,char *argv[])
{
CvMat *firstM = cvCreateMat(12,2,CV_64FC1);
cvSetData(firstM,first,firstM->step);
CvMat *secondM = cvCreateMat(12,2,CV_64FC1);
cvSetData(secondM,second,secondM->step);
CvMat *FMat= cvCreateMat(3,3,CV_64FC1);
if(cvFindFundamentalMat(firstM,secondM,FMat,CV_FM_RANSAC,1.00,0.99) == 0){
std::cerr << "Can't Get F Mat/n";
return -1;
}
for(int y = 0; y < 3;++y){
for(int x = 0; x < 3;++x)
{
std::cout << CV_MAT_ELEM(*FMat,double,y,x) << " ";
}
std::cout << "/n";
}
cvReleaseMat(&firstM);
cvReleaseMat(&secondM);
cvReleaseMat(&FMat);
return EXIT_SUCCESS;
}