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

CloudViewer: addOrUpdateFrustum doesn't show correctly the actual frustum (with cx/cy offsets) #1216

Open
matlabbe opened this issue Feb 6, 2024 · 0 comments

Comments

@matlabbe
Copy link
Member

matlabbe commented Feb 6, 2024

The problem with the current way to display it is that cx/cy are assumed to be exactly at the center of the image, which often are not, so the frustum shown is the ideal straight frustum based on field of view.

Similarly to jsk camera info display using image_geometry::PinholeCameraModel::projectPixelTo3dRay to find the 4 corners of the frustum, we could use internal CameraModel::project() with depth=1 (or actual max distance of the frustum) to get the four corners:

void CameraModel::project(float u, float v, float depth, float & x, float & y, float & z) const
{
if(depth > 0.0f)
{
// Fill in XYZ
x = (u - cx()) * depth / fx();
y = (v - cy()) * depth / fy();
z = depth;

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