Unexpected cameraMatrix from calibrateCamera
When calling calibrateCamera I specify the CV_CALIB_FIX_PRINCIPAL_POINT flag. So I expect the cx and cy of the resulting cameraMatrix to reflect the middle of the screen. My camera is 1280 width and 1024 high. But I get a cx of 512 and a cy of 640. I expected the other way around because x is in the width direction. Do I misunderstand something?
Are you sure you are populating the cameraMatrix with the correct Cx, Cy before passing it in to calibrateCamera?
Maybe add to your question with an example image, and copy and paste in a code snippet just long enough to show the problem, along with some debug output?
Finally, what version of openCV are you using, on what architecture platform?
OpenCV 3.4.1 on Windows 10 According the documentation, calibrateCamera will set cx and cy to the middle of the screen. So the values 512 and 640 do make sense. But I do not understand that cx = 512 instead of 640. And cy = 640 in tead of 512.
If you print out the imageSize parameter height (y) and width (x) are they 1024 and 1280 too?