feat: up triangle, point-plane distance, exact camera size #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes on API change after this PR:
disable_up_triangle=False
has been replaced byup_triangle=True
in the new API.Up triangle
Now, we draw the "up triangle" by default, similar to Blender. The up direction is the negative Y direction per OpenCV convention. You may set
![](https://private-user-images.githubusercontent.com/1501945/270129123-be2b1715-fc0e-4060-a647-db430f0510c0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NjIzMzQsIm5iZiI6MTcyMTc2MjAzNCwicGF0aCI6Ii8xNTAxOTQ1LzI3MDEyOTEyMy1iZTJiMTcxNS1mYzBlLTQwNjAtYTY0Ny1kYjQzMGYwNTEwYzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMTkxMzU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTkzZjM4MGExNzI3Mzg1Mjc2NjY4ZTU5NWZkZTg3MjM3YmJlN2UxZGFmMjdiZGRhNTQ4ZGZjN2U1NzdjZmRhNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.e_cDGZwCSbLbmf9nFHoKo8QoCb54q7lm9wbstO6_YPc)
disable_up_triangle=True
to suppress drawing the up triangle.Absolute camera scale
The camera frame now has an absolute scale, defined by the distance from the camera center to the visualized image plane. E.g., if you set the size to 1, you will get a camera frame where the distance between its camera center and the visualized image plane is 1.
![](https://private-user-images.githubusercontent.com/1501945/270129316-989e5f11-d6a4-42f2-9bcf-011ef37d65b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NjIzMzQsIm5iZiI6MTcyMTc2MjAzNCwicGF0aCI6Ii8xNTAxOTQ1LzI3MDEyOTMxNi05ODllNWYxMS1kNmE0LTQyZjItOWJjZi0wMTFlZjM3ZDY1YjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMTkxMzU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmIzNTU4YzEzNzYwYzcwZTg1N2I3YmZmMzdiOWIxNDg0OTk3MWE5NTQ5Y2M1Yjk1NzgyOTEyZThhOGI2YTEyNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.05qlsEszs_PL-DqZPXji1l6JKbBJeRCbf3igcib7-hQ)
Image width/height for camera plotter
Now, we support specifying
image_wh
when plotting camera frames. This is useful when the camera center is not exactly at the center of the image plane.Point to plane distance
Now we can compute point-to-plane distance, where the plane is represented by 3 points. See
ct.solver.point_plane_distance_three_points()
.