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

Image to World Coordinate Transformation #101

Open
gnanukoth opened this issue Apr 12, 2024 · 1 comment
Open

Image to World Coordinate Transformation #101

gnanukoth opened this issue Apr 12, 2024 · 1 comment

Comments

@gnanukoth
Copy link

Hello, Currently we are using the hl2ss package to stream the HoloLens 2 sensor data for one of our applications. We process the image stream to detect objects in the environment. We would like to display the detected objects using a AR bounding box in the HoloLens user view. For this we want to be able to transform the detected object image coordinates to the 3d world coordinates. Is there any relevant function that you have developed, as part of the package, that can handle this? If not, could you give any suggestions as to how this transformation can be achieved or what parameters would be of relevance? Thanks!

@jdibenes
Copy link
Owner

Hello,
Try getting the depth value for the image points (for example, as in sample_pv_depth_lt.py), then use the PV intrinsics, extrinsics, and pose to convert the image points (u,v) and depth to world space:

[x, y, z] = depth[v, u] * [u, v, 1] @ color_intrinsics[:3,:3]^(-1)
[x, y, z, 1]_world = [x, y, z, 1] @ color_extrinsics^(-1) @ pv_pose

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

2 participants