I am working with OpenCV and C++ for a project and I found the following problem: after initializing a mat with the following statement
Mat or_mat=Mat(img->height,img->width,CV_32FC1); check the following value
or_mat.at <float> (i, j) = atan (fy / fx) / 2 +1.5707963; After completing returning the mat for the output of the function but when I go to read there are many values that do not correspond to the output. Precise in incorrect values for the I-4.31602e +008 is inserted and if I make a cout the value of the expression is correct. What could be the error??
relevant Code:
Mat or_mat=Mat(img->height,img->width,CV_32FC1); to angle if(fx > 0){ or_mat.at<float>(i,j) = atan(fy/fx)/2+1.5707963; } else if(fx<0 && fy >0){ or_mat.at<float>(i,j) = atan(fy/fx)/2+3.1415926; } else if(fx<0 && fy <0){ or_mat.at<float>(i,j) = atan(fy/fx)/2; } else if(fy!=0 && fx==0){ or_mat.at<float>(i,j) = 1.5707963; } I have to calculate the local orientation of the fingerprint image, the following code I have omitted several statements and calculations that do not have errors.
CV_32FC1orCV_32FC3. And post the relevant code.