Skip to content

fix: cuboid projection passes wrong point list to projectPoints - #7

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:masterfrom
andrewwhitecdw:bugfix/cuboid-9c241777
Open

andrewwhitecdw wants to merge 1 commit into
NVIDIA:masterfrom
andrewwhitecdw:bugfix/cuboid-9c241777

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026 •

Copy link
Copy Markdown

Problem

fix: cuboid projection passes wrong point list to projectPoints

Fix

Replace:

        transformed_vertices = [0, 0, 0] * CuboidVertexType.TotalVertexCount
        for vertex_index in range(CuboidVertexType.TotalVertexCount):
            vertex3d = self._vertices[vertex_index]
            transformed_vertices[vertex_index] = world_transform_matrix * vertex3d

        projected_vertices = cv2.projectPoints(transformed_vertices, rvec, tvec, 
                                camera_intrinsic_matrix, dist_coeffs)

        return Cuboid2d(projected_vertices)

with:

        transformed_vertices = []
        for vertex_index in range(CuboidVertexType.TotalVertexCount):
            vertex3d = self._vertices[vertex_index]
            transformed_vertices.append(world_transform_matrix * vertex3d)
        transformed_vertices = np.array(transformed_vertices, dtype=np.float32)

        projected_vertices, _ = cv2.projectPoints(transformed_vertices, rvec, tvec, 
                                camera_intrinsic_matrix, dist_coeffs)

        return Cuboid2d(projected_vertices.reshape(-1, 2))

Files changed

  • nvdu/core/cuboid.py

@andrewwhitecdw
andrewwhitecdw marked this pull request as ready for review July 27, 2026 21:13
@andrewwhitecdw

Copy link
Copy Markdown
Author

Closing this sweep-generated PR: sole commit is missing a valid Signed-off-by trailer. It does not meet the sweep requirements (single signed-off commit).

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

Successfully merging this pull request may close these issues.

1 participant