Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calibration Failed #8

Open
TsingLoo opened this issue Feb 26, 2023 · 1 comment
Open

Calibration Failed #8

TsingLoo opened this issue Feb 26, 2023 · 1 comment

Comments

@TsingLoo
Copy link

Your research and project inspires me a lot. I have synthesized new frames and points data from my Unity project. However, when it comes to the calibration stage, something goes wrong.

Since I setup the scene with six cameras from the same prefab at different locations and orientations, the intrinsic of each camera should be the same and extrinsic may vary from each other. However, by running the 'calibrateCamera.py' script, only some of the cameras get calibrated correctlly.
9.3530737478068772e+02 0. 9.5999987323376331e+02 0. 9.3530737395304050e+02 5.3999992195891150e+02 0. 0. 1.</data></camera_matrix>

The fx, fy, cx, cy of the wrong calibrations may suffer a dicrapency from the correct one.
<data> 6.2205436588916064e+02 0. 7.6815935516113848e+02 0. 6.0663721630513464e+02 8.1161463688244953e+02 0. 0. 1.</data></camera_matrix>

I follow the structure of the demo data in 'matchings' folder, data is available here: matchings.zip
image

I want to know whether there is something required to be noticed when running the 'calibrateCamera.py' script

@TsingLoo
Copy link
Author

TsingLoo commented Mar 3, 2023

It seems that this line goes wrong.

cv2.calibrateCamera(points_3d, points_2d, (IMAGE_HEIGHT, IMAGE_WIDTH), cameraMatrix, None,

As the OpenCV document mentioned, the objectPoints should be a vector of vectors of calibration pattern points in the calibration pattern coordinate space(in different views). However, the cv2.calibrateCamera here only takes corresponding 2D-3D points from the same one view, which may be not enough for further calibration. Besides, I don't know why the size of the image is h*w, while the input frame is actually w*h.

I get the usable calibration by CalibrationTool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant