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

Is the extrinsic well calibrated? #110

Open
heyfluke opened this issue Jan 18, 2023 · 1 comment
Open

Is the extrinsic well calibrated? #110

heyfluke opened this issue Jan 18, 2023 · 1 comment

Comments

@heyfluke
Copy link

I am integrating synced 4-cam image to a surrounding view system.
The left and right camera seems not calibrated well.

See equirectangular projected images:

out_erp_full

out_erp_left

out_erp_rear

My code is straightforward:

step 1:
generate spherical vertex in OpenGL coordinate.

step 2:
for all vertex (Pw) do cam_to_img() convertion which is 3d to 2d projection.

    glm::mat3 Tw = glm::mat3(0,0,-1,
             -1,0,0,
             0,1,0); // gl to vehicle
    glm::vec3 Pc = Tw * glm::transpose(R) * Pw + t;

    if (Pc.z < 0) {
        return glm::vec2(-1,-1);
    }
    float chi = sqrt(Pc.x*Pc.x + Pc.y*Pc.y);
    float theta = atan2(chi, Pc.z);
    float theta2 = theta*theta, theta3 = theta2*theta, theta4 = theta2*theta2;
    float rho = k1*theta + k2*theta2 + k3*theta3 + k4*theta4;
    glm::vec2 uv;
    if (chi != 0) {
        uv.x = rho * Pc.x / chi;
    } else {
        uv.x = 0.0;
    }
    if (chi != 0) {
        uv.y = rho * Pc.y / chi;
    } else {
        uv.y = 0.0;
    }
    uv.x += resolution.x/2; // roughly cx
    uv.y += resolution.y/2;
    return uv;
@heyfluke
Copy link
Author

BTW. images are 5710 - 5713

@heyfluke heyfluke changed the title Is the extrinsic right calibrated? Is the extrinsic well calibrated? Jan 18, 2023
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