Bonjour à tous,

Voilà je n'arrive pas à porter ce code Opencv 1.0 sous Opencv 2.1. Le programme plante lorsque je fais appel à : cvFindFundamentalMat avec les paramètres spécifiés.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
		//declare useful typedefs
	typedef vector <CvPoint2D32f> CVPOINT2D32F_VECTOR;
	std::vector <CVPOINT2D32F_VECTOR> allPoints;
 
	....
 
	int i1,i2;
	i2 =0;
	int numPoints = allPoints[0].size();
	CvMat* points1;
	CvMat* points2;
	CvMat* status;
	CvMat* fundMatr;
 
	points1 = cvCreateMat(2,numPoints,CV_32F);
	points2 = cvCreateMat(2,numPoints,CV_32F);
	status = cvCreateMat(1,numPoints,CV_32F);
 
	for ( i1 = 0; i1 < numPoints; i1++) {
 
		cvSetReal2D(points1,0,i1,allPoints[0][i1].x/1); 
		cvSetReal2D(points1,1,i1,allPoints[0][i1].y/1); 
 
		cvSetReal2D(points2,0,i1,allPoints[1][i1].x/1); 
		cvSetReal2D(points2,1,i1,allPoints[1][i1].y/1); 
	}
 
 
	//create the output fundamental matrix
	fundMatr = cvCreateMat(3,3,CV_32F);
 
	//see opencv manual for other options in computing the fundamental matrix	
	int num = cvFindFundamentalMat(points1,points2,fundMatr,CV_FM_8POINT,1.0,0.9999,status);
Voyez-vous quelle modification apporter au code ?

Merci d'avance