-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow arbitrary pinhole camera #2564
Conversation
parameters. In this function, it is responsibility of the users to verify the validity of the parameters, in contrast to `ConvertFromPinholeCameraParameters()` function. This can be useful to render images or depthmaps without any restriction in FOV, zoom, etc.
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
|
Can you please try |
Style applied to the following files: /home/pablo/MS/Open3D_pablospe_PR/cpp/pybind/visualization/viewcontrol.cpp
Thanks, Wei Dong! I know you from your time at CVG :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @pablospe)
cpp/open3d/visualization/visualizer/ViewControl.cpp, line 191 at r2 (raw file):
} bool ViewControl::ConvertFromArbitraryPinholeCameraParameters(
Many lines of code are duplicates here. I guess a better practice could be adding a flag to ConvertFromPinholeCameraParameters
, and change the condition checks accordingly: ViewControl::ConvertFromPinholeCameraParameters(const camera::PinholeCameraParameters & parameters, bool allow_arbitrary=false)
cpp/pybind/visualization/viewcontrol.cpp, line 74 at r2 (raw file):
.def("convert_from_pinhole_camera_parameters", &ViewControl::ConvertFromPinholeCameraParameters, "parameter"_a)
As mentioned above, might be good to add "allow_arbitrary"_a directly to convert_from_pinhole_camera_parameters
Haha, nice to meet you here again! :-) |
Sounds good. I will implement the changes, it will be a few What I tried was to implement To be sincere I don't really understand why all these restrictions are needed in the first place, I believe the reason is to control, for instance, the amount of zoom the user can make to avoid going to infinity. Sometimes I actually would wish to be able to do "more zoom" and I find these constraints a limitation (especially for headless rendering where no user interaction is envolved). I also noticed (but only in Windows) that I can't render images of bigger size than my screen resolution, so the limit for the window size might be related to GLFW. Also, for the FOV, I didn't find a good reason to have a |
@theNded I made the changes you requested, but I now get the following error when importing open3d in python (compilation and installation seems with
Here the proposed code: |
Sorry for coming back late, I will give you an update today! |
It was from this line. Pybind has changed its API but docstring is still there. Removing this line will fix the problem. |
Totally forgot about that. Thanks a lot for taking the time to look at it, specially now it is CVPR deadline! :) |
… camera parameters. This can be useful to render images or depthmaps without any restriction on window size, FOV and zoom.
@errissa This PR lgtm and won't interrupt current functionalities. May I merge if you think it looks fine? |
@theNded This looks good to merge to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r3, 2 of 2 files at r4.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @pablospe)
@pablospe could you please share the corresponding python wheel that fixes this issue? |
In this example of use (python): https://github.com/pablospe/open3D_depthmap_example I believe in the open3d version 0.11.3 these commits will be included. I just don't know what is the open3d roadmap and how often a new version is released. Hopefully it is released soon: |
Function to get view controller from arbitrary pinhole camera parameters. In this function, it is responsibility of the users to
verify the validity of the parameters, in contrast to
ConvertFromPinholeCameraParameters()
function. This can be useful to render images or depthmaps without any restriction in FOV, zoom, etc.Example of use (python): https://github.com/pablospe/open3D_depthmap_example
(code is already compiled, and can be installed with pip).
This PR is related to the following git issues: #1417, #497, #727, #834, #1389, #2443, #1164, #2036, #2190.
This change is