Thank you for your response Bill!
The px
and u0
variables were class variables, and already defined in the class as double
. I should have been clearer on that!
After further deliberation and bug testing, I have found that the matrix is indeed being populated with variables. The problem is with the further implementation of those very matrices.
My program uses the camera and distortion matrices in order to rectify the image taken by the camera, using the cv::undistort()
function. When I try to write the variable directly as such:
distortion_matrix.at<double>(0, 0) = -0.24054321189834804;
the rectification process works as intended. However, when I use a variable with the exact same number assigned to it, as such:
double kud = -0.24054321189834804;
distortion_matrix.at<double>(0, 0) = kud;
I receive a very poorly rectified image.
I think you may be on to something with the possible “truncation” of the double
variable. I remember reading somewhere that double values have something like a fifteen decimal digit precision, yet the variable I am defining has nearly twenty.
I’ll have to do some more research, to find out if that’s the case!
Cheers,
C.Fox