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

Camera module #42

Open
asd33015 opened this issue Feb 9, 2023 · 8 comments
Open

Camera module #42

asd33015 opened this issue Feb 9, 2023 · 8 comments

Comments

@asd33015
Copy link

asd33015 commented Feb 9, 2023

Good day,
Could the project support the opencv camera module (i.e., camera matrix and distortion module) to save the image?
Thanks for help.

Best Regards

@robertsulej
Copy link
Member

Hi,

I can look into this. The implementation could use distortion coefficients and camera intrinsic parameters in the camera shader. Performace overhead should be rather minimal, I think.

Can you share your use case? It is always helpful for development.

Thanks!

@asd33015
Copy link
Author

Thank you very much for your help!

Yes, I can share my case. The thing I would like to implement is that importing a textured 3D mesh and rendering it with HDRI background. Additionally, I can set up various cameras to show the results in different views.

Thanks for help again.
Best Regards.

@asd33015
Copy link
Author

Hi,

May I ask how to implement the camera shader of OpenCV that I mentioned above?

Thanks for help.
Best Regards.

@robertsulej
Copy link
Member

I have to add it on my side. I should have a time slot to do this over the weekend. Then I'll cut the new release together with a few other improvements - I'll let you know here when it is ready.

@robertsulej
Copy link
Member

I added intrinsics matrix to camera setup and update. Example is here. It is still on the brach since I am trying to find an efficient method to calculate distort map to include distortion coefficients (undistort is easy, but inverse covering full view with no missing spots - need figure it out).

@asd33015
Copy link
Author

I added intrinsics matrix to camera setup and update. Example is here. It is still on the brach since I am trying to find an efficient method to calculate distort map to include distortion coefficients (undistort is easy, but inverse covering full view with no missing spots - need figure it out).

Thank you so much for taking the time to respond to my query. I look forward to using the features and functions in the future!

Best Regards.

@asd33015
Copy link
Author

Hi robertsulej,

Could I use the intrinsic parameters with pixel unit for the rendering the image if I can't get the sensor height and other variables with mm unit?
Thank you so much for taking the time to implement the utilities !

Best Regards.

@robertsulej
Copy link
Member

Sure, it is all relative calculations and you can assume 1 px = 1 mm, and then set sensor height to the image height (note that fx and fy in the camera matrix will need to be updated accordingly if object sizes and locations are not changed).

I also checked again these functions and found error in cx calculations. Fixes are now pushed to master branch.

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