1 | initial version |
No idea. There's nothing wrong with the distortion coefficients, the camera matrix, or the undistort function. They produce a perfectly reasonable image when I grab one from my computer.
But those aren't the values you are using. Look in the nested for loops. You are altering the values in data, which is the values you are using in CameraMatrix. When you construct a Mat from a pointer, it doesn't copy the memory. So altering the values inside the data array alters the CameraMatrix.
2 | No.2 Revision |
No idea. There's nothing wrong with the distortion coefficients, the camera matrix, or the undistort function. They produce a perfectly reasonable image when I grab one from my computer.
But those aren't the values you are using. Look in the nested for loops. You are altering the values in data, which is the values you are using in CameraMatrix. When you construct a Mat from a pointer, it doesn't copy the memory. So altering the values inside the data array alters the CameraMatrix.