Skip to content

Throw an error on non-zero k4, k5 or k6 #3611

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

Open
Yubel426 opened this issue Mar 12, 2025 · 3 comments · May be fixed by #3612
Open

Throw an error on non-zero k4, k5 or k6 #3611

Yubel426 opened this issue Mar 12, 2025 · 3 comments · May be fixed by #3612

Comments

@Yubel426
Copy link

Hi @jb-ye @devernay, why is there a problem when k4 is not equal to 0? #3355 #3381 When reading the camera distortion coefficients such as this, k4 is correctly assigned as the fourth-order radial distortion coefficient rather than the fourth coefficient. The current approach makes data with non-zero k4 coefficient like fisheye unusable.

@f-dy
Copy link
Contributor

f-dy commented Mar 14, 2025

Take a look closely at the colmap distortion model and the nerfstudio distortion model. They are equivalent up to k3. For fisheye cameras, you should use the fisheye model, not a perspective model.

@f-dy
Copy link
Contributor

f-dy commented Mar 14, 2025

Are you saying that for the fisheye camera model, k4 is interpreted correctly? I'll fix it for you

@Yubel426
Copy link
Author

elif camera.model == "OPENCV_FISHEYE":
    out["fl_x"] = float(camera_params[0])
    out["fl_y"] = float(camera_params[1])
    out["cx"] = float(camera_params[2])
    out["cy"] = float(camera_params[3])
    out["k1"] = float(camera_params[4])
    out["k2"] = float(camera_params[5])
    out["k3"] = float(camera_params[6])
    out["k4"] = float(camera_params[7])

I think k4 is correctly assigned as the fourth-order radial distortion coefficient and error check can be removed.

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