when I debug this code it does not enter cvundistortpoint and gives me this error: Stack around the variable 'input' was corrupted. I've read similar answers to this question but none of them was in OpenCV, does this make any difference? Is it because of my _src and _dest matrix size? I've put 'for' loop to see whether _src is being filled or not.
float input [2][2] = {{xR , yR},{xL , yL}};
float src[1][4], dest[1][4];
CvMat _src = cvMat(1, 4, CV_64FC2, src );
CvMat _dest = cvMat(1, 4, CV_64FC2, dest );
for(int k = 0; k<2; k++)
{
for(int l = 0; l < 2; l++)
{
CV_MAT_ELEM(_src,float,0,k*2+l) = input[k][l];
float f =CV_MAT_ELEM(_src,float,0,k*2+l);
cout<<endl<<"undis"<<endl<<f<<endl;
}//end forj
}//end fori
cvUndistortPoints(&_src, &_dest, &_intrinsic1, &_Distortion1);