Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kaingwade
Copy link
Contributor

@kaingwade kaingwade commented Apr 14, 2024

The PR is to combine the examples videocapture_openni.cpp, videocapture_realsense.cpp and videocapture_obsensor.cpp into videocapture_depth.cpp.

Tested cameras and OS using this sample are listed below:

Windows 10 Ubuntu 22.04 Mac M1 14.3
Orbbec Gemini 2 Series
RealSense D435, D455
Kinect, XtionPRO - - -

Note:

  • OpenNI based cameras (Kinect, XtionPRO) are not tested as I don't have them.
  • RealSense D435 and D455 don't work on Mac with OpenCV.

@kaingwade
Copy link
Contributor Author

There is an older example orbbec_astra.cpp in the tutorial_code folder which demonstrates how to use the OpenNI based Orbbec cameras with OpenCV. These cameras are already discontinued and newer Orbbec cameras are all using the UVC protocols. Should we remove the older sample? @vpisarev

@kaingwade kaingwade added category: samples cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) labels Apr 14, 2024
@kaingwade kaingwade added this to the 5.0 milestone Apr 14, 2024
@asmorkalov
Copy link
Contributor

@kaingwade Thanks a lot for the contribution. Please take https://docs.opencv.org/4.x/d4/d65/tutorial_orbbec_astra.html in account too.

@kaingwade
Copy link
Contributor Author

orbbec_astra.cpp is added into the new sample videocapture_depth.cpp

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new sample looks like just mix of 4 original pieces. Almost no unification.
I propose the following:

  • Presume original orbbec_astra.cpp as it uses 2 VideoCapture instances and manual threading/synchronization. I propose to rename it to something line openni_orbbec_astra.cpp and mention that there is is alternative SDK in the sample description.
  • Unify other 3 branches to use the same loop.
  • Backport Orbbec OpenNI related changes in documentation to 4.x to fix it too.

asmorkalov pushed a commit that referenced this pull request Jul 1, 2024
Update the tutorial of using Orbbec Astra cameras #25813

This PR is the backport of Orbbec OpenNI-based Astra camera related changes from #25410 to the 4.x branch, which includes updating the tutorial of Orbbec Astra cameras, renaming `orbbec_astra.cpp`.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
@asmorkalov
Copy link
Contributor

@kaingwade I merged your patch to 4.x and it was promoted to 5.x in #25840. You need to rebase and solve the conflicts.

@kaingwade
Copy link
Contributor Author

The new sample looks like just mix of 4 original pieces. Almost no unification. I propose the following:

  • Presume original orbbec_astra.cpp as it uses 2 VideoCapture instances and manual threading/synchronization. I propose to rename it to something line openni_orbbec_astra.cpp and mention that there is is alternative SDK in the sample description.
  • Unify other 3 branches to use the same loop.
  • Backport Orbbec OpenNI related changes in documentation to 4.x to fix it too.

Done.

@asmorkalov
Copy link
Contributor

Run cd $HOME/build && python3 $HOME/scripts/warnings-handling.py
/home/ci/opencv/samples/cpp/videocapture_depth.cpp:146:40: warning: 'flagIR' may be used uninitialized in this function [-Wmaybe-uninitialized]

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, besides minor comments. Could you add list of tested cameras to the PR description? It'll be useful for issues triaging.

@asmorkalov asmorkalov self-assigned this Jul 3, 2024
@asmorkalov asmorkalov merged commit bd1f9cd into opencv:5.x Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: samples cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants