Hello! I just started a project on which I use cvFindStereoCorrespondence to create a disparity map.
My procedure goes like this, I grab the video and create IplImage src1 and src2 from two grayscale images!
To be more precise I use the type is ofxCvGrayscaleImage which I convert easily to IplImage (as CvImage and IplImage just need a typecast)
I then make matrices from these IplImages with:
mat1 = cvCreateMat( src->height, src->width, CV_32FC1 ); cvConvert( src, mat1 ); mat2 = cvCreateMat( src->height, src->width, CV_32FC1 ); cvConvert( src2, mat2 );
I then create space for the fundamental matrix :
fundamental_matrix = cvCreateMat(3, 3, CV_32FC1);
and pass all the matrices in cvFindFundamentalMat :
cvFindFundamentalMat(mat1, mat2, fundamental_matrix,CV_FM_RANSAC, 3, 0.99); //not sure about 3
when I run this I get :
OpenCV ERROR: One of arguments’ values is out of range (Both input and output point dimensionality must be 2,3 or 4) in function cvConvertPointsHomogeneous, cvfundam.cpp(1270)
I think that what it obviously says is that the way I created my matrices is wrong
Any ideas why my matrices are wrong? (I think it might be something with the grayscale part of my problem)
Thank you in advance!
PS. ? also contacted the opencv mailing list, but I needed to post here just in case