videoio: add Orbbec Gemini 330 camera support#27230
videoio: add Orbbec Gemini 330 camera support#27230asmorkalov merged 10 commits intoopencv:4.xfrom sirudoi:4.x
Conversation
|
@fengyuentau Could you handle the pr? |
@kaingwade will help to test this PR once we get the camera. |
kaingwade
left a comment
There was a problem hiding this comment.
Tested the latest Gemini 330 series on Windows 10 and Ubuntu 22.04 (6.8.0-57),335/335L/336 work well, but 336L only outputs the RGB stream.
| if(WIN32) | ||
| # copy orbbecsdk dll to output floader | ||
| if(MSVC_IDE) | ||
| file(COPY ${OrbbecSDK_DLL_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Release) | ||
| file(COPY ${OrbbecSDK_DLL_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug) | ||
| file(COPY ${OrbbecSDK_RUNTIME_RESOURCE_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Release) | ||
| file(COPY ${OrbbecSDK_RUNTIME_RESOURCE_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug) | ||
|
|
||
| file(COPY ${OrbbecSDK_LIBRARY} DESTINATION ${LIBRARY_OUTPUT_PATH}/Release) | ||
| file(COPY ${OrbbecSDK_LIBRARY} DESTINATION ${LIBRARY_OUTPUT_PATH}/Debug) | ||
| elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Visual")) | ||
| file(COPY ${OrbbecSDK_DLL_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}) | ||
| file(COPY ${OrbbecSDK_RUNTIME_RESOURCE_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}) | ||
| file(COPY ${OrbbecSDK_LIBRARY} DESTINATION ${LIBRARY_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}) | ||
| else() | ||
| file(COPY ${OrbbecSDK_DLL_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}) | ||
| file(COPY ${OrbbecSDK_RUNTIME_RESOURCE_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}) | ||
| file(COPY ${OrbbecSDK_LIBRARY} DESTINATION ${LIBRARY_OUTPUT_PATH}) | ||
| endif() | ||
| else() | ||
| file(COPY ${OrbbecSDK_RUNTIME_RESOURCE_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}) | ||
| file(COPY ${OrbbecSDK_DLL_FILES} DESTINATION ${LIBRARY_OUTPUT_PATH}) |
There was a problem hiding this comment.
Unlike on MacOS, on Windows and Linux functionality of Orbbec SDK is integrated into OpenCV other than calling the SDK directly. These lines are not involved.
|
LGTM. |
| cv::Mat srcMat(frame->height, frame->width, CV_16UC1, frame->data); | ||
| cv::resize(srcMat, srcMat, cv::Size(), scale, scale, cv::INTER_LINEAR); | ||
|
|
||
| // left/right crop | ||
| const int valid_width = srcMat.cols - crop_left - crop_right; | ||
| if (valid_width <= 0 || srcMat.rows <= 0) { | ||
| CV_LOG_ERROR(NULL, "Invalid horizontal crop parameters"); | ||
| return; | ||
| } | ||
| srcMat = srcMat(cv::Rect(crop_left, 0, valid_width, srcMat.rows)); | ||
|
|
||
| // top padding | ||
| if (pad_top > 0) { | ||
| cv::copyMakeBorder(srcMat, srcMat, pad_top, 0, 0, 0, cv::BORDER_CONSTANT, 0); | ||
| } | ||
|
|
||
| // bottom crop | ||
| const int valid_height = srcMat.rows - crop_bottom; | ||
| if (valid_height <= 0) { | ||
| CV_LOG_ERROR(NULL, "Invalid vertical crop parameters"); | ||
| return; | ||
| } | ||
| srcMat = srcMat(cv::Rect(0, 0, srcMat.cols, valid_height)); |
There was a problem hiding this comment.
Why do you need resize and crop for the camera frames? I propose to return them in original size.
Also resized does not support in-place processing. The code always triggers srcMat realloc.
There was a problem hiding this comment.
Why do you need resize and crop for the camera frames? I propose to return them in original size. Also resized does not support in-place processing. The code always triggers srcMat realloc.
Hi, the resize/crop operations ensured pixel alignment between depth and color streams with mismatched resolutions. Without them, users would receive misaligned data. I now enforce matching resolutions to eliminate these steps. Thank you for your insight!
…the cropping operation.
videoio: add Orbbec Gemini 330 camera support opencv#27230 ### 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 - [x] The feature is well documented and sample code can be built with the project CMake ### Description of Changes #### motivated: - Orbbec has launched a new RGB-D camera — the Gemini 330. To fully leverage the capabilities of the Gemini 330, Orbbec simultaneously released version 2 of the open-source OrbbecSDK. This PR adapts the support for the Gemini 330 series cameras to better meet and respond to users’ application requirements. #### change: - Add support for the Orbbec Gemini330 camera. - Fixed an issue with Femto Mega on Windows 10/11; for details, see [issue](opencv#23237 (comment)). - When enabling `HAVE_OBSENSOR_ORBBEC_SDK`, the build now fetches version 2 of the OrbbecSDK, and the sample API calls have been updated to the v2 format. ### Testing | OS | Compiler | Camera | Result | |:----------:|:---------------------------------------:|:-----------------:|:------:| | Windows 11 | (VS2022) MSVC runtime library version 14.40 | Gemini 335/336L | Pass | | Windows 11 | (VS2022) MSVC runtime library version 14.19 | Gemini 335/336L | Pass | | Ubuntu22.04| GCC 11.4 | Gemini 335/336L | Pass | | Ubuntu18.04| GCC 7.5 | Gemini 335/336L | Pass | ### Acknowledgements Thank you to the OpenCV team for the continuous support and for creating such a robust open source project. I appreciate the valuable feedback from the community and reviewers, which has helped improve the quality of this contribution!
Add macOS support for Orbbec Gemini330 camera #27930 ### Description of Changes Adds macOS support for Orbbec Gemini330 in videoio by integrating OrbbecSDK v2. Completes the non-macOS work in [#27230](#27230). #### Motivation [#27230](#27230) skipped macOS. On macOS, UVC alone lacks required device controls; OrbbecSDK v2 provides them. #### Key Change - macOS: fetch/link OrbbecSDK v2.5.5 (replaces v1.9.4). - videoio (macOS): switch OrbbecSDK API usage from v1 to v2. ### 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 - [x] The feature is well documented and sample code can be built with the project CMake
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Description of Changes
motivated:
change:
HAVE_OBSENSOR_ORBBEC_SDK, the build now fetches version 2 of the OrbbecSDK, and the sample API calls have been updated to the v2 format.Testing
Acknowledgements
Thank you to the OpenCV team for the continuous support and for creating such a robust open source project. I appreciate the valuable feedback from the community and reviewers, which has helped improve the quality of this contribution!