nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgcodecs/include/opencv2/imgcodecs.hpp
**Change Type:** modified
**Context:** PR #22128: [GSoC 2022] Multipage Image Decoder API

**Code Changes:**
```diff
@@ -332,6 +332,51 @@ CV_EXPORTS_W bool haveImageReader( const String& filename );
  */
 CV_EXPORTS_W bool haveImageWriter( const String& filename );
 
+/** @brief To read Multi Page images on demand
+
+The ImageCollection class provides iterator API to read multi page images on demand. Create iterator
+to the collection of the images and iterate over the collection. Decode the necessary page with operator*.
+
+The performance of page decoding is O(1) if collection is increment sequentially. If the user wants to access random page,
```

Review comment:
I rechecked all cases and it looks like the only dangerous case is something like this: ``` auto current_frame = decoder.at(i); decoder.releaseCache(); ``` releaseCache invalidates references (`auto` is `Mat&`), but it's expected behavior. In all other cases like `cv::Mat img = decoder.at(i);` `cv::Mat` copy constructor is called and user code does not suffer. So you are right! Let's go ahead with references then.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -123,6 +123,7 @@ enum VideoCaptureAPIs {
        CAP_INTEL_MFX    = 2300,         //!< Intel MediaSDK
        CAP_XINE         = 2400,         //!< XINE engine (Linux)
        CAP_UEYE         = 2500,         //!< uEye Camera API
+       CAP_OBSENSOR     = 2600,         //!< For Orbbec 3D-Sensor device/module (Astra+, Femto)
      };
 
 /** @brief cv::VideoCapture generic properties identifier.
@@ -654,6 +655,35 @@ enum { CAP_PROP_IMAGES_BASE = 18000,
 
```

Review comment:
Please align the brackets of `enum`, here and the belowing.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
Namespaces do not need to be indented.
**File:** samples/cpp/videocapture_obsensor.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,74 @@
+#include <opencv2/videoio.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgproc.hpp>
+#include <iostream>
+
+using namespace cv;
+int main()
+{
+    VideoCapture obsensorCapture(0, CAP_OBSENSOR);
```

Review comment:
`argc` and `argv` are never used.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,379 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
CI's Log ``` obsensor_stream_channel_v4l2.cpp:350:31: warning: narrowing conversion of '((((int)ctrl) == 1) ? 512 : ((((int)ctrl) == 2) ? 64 : 1024))' from 'int' to '__u16' {aka 'short unsigned int'} [-Wnarrowing] 350 | .size = ctrl == 1 ? 512 : (ctrl == 2 ? 64 : 1024), ```
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,379 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
CI's Log: ``` bsensor_stream_channel_v4l2.cpp:330:31: warning: narrowing conversion of '((((int)ctrl) == 1) ? 512 : ((((int)ctrl) == 2) ? 64 : 1024))' from 'int' to '__u16' {aka 'short unsigned int'} [-Wnarrowing] 330 | .size = ctrl == 1 ? 512 : (ctrl == 2 ? 64 : 1024), ```
**File:** modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,265 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
`data` and `dataSize` were never used.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,103 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
The guarding macros should look like this `OPENCV_module_name_header_name_HPP`.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,103 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
Format issues, a space is required after `}`.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,103 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
The enumeration should look like this: ```C++ enum StreamType { }; ``` Here and the bellowing.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,103 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
The struct should look like this: ```C++ struct CameraParam { }; ```
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,103 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
Please avoid use the `std::shared_ptr` in OpenCV, use `Ptr<>` instead. Here and the bellowing.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
the for loop should like this ```C++ for () { } ``` And the if loop should like this: ```C++ if () { } ``` Please put a line break after `(...)`. Here and the bellowing.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
function code style ```C++ void func() { } ```
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
function code style. `{`
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
meaningless `;`.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
`Ptr<>`
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,505 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
`makePtr<MSMFStreamChannel>(devInfo)`
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,180 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
Please use a regular C++ structure: ```C++ struct FrameRate { unsigned int denominator; unsigned int numerator; }; ```
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,379 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
`Ptr<>`
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,379 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
`makePtr<>()`
**File:** modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,265 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
A new line is required before `{`. Here and bellowing.
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 137

**Code Changes:**
```diff
+
+    virtual void start(const StreamProfile& profile, FrameCallback frameCallback) override;
+    virtual void stop() override;
+
+private:
+    virtual bool setXu(uint8_t ctrl, const uint8_t* data, uint32_t len) override;
+    virtual bool getXu(uint8_t ctrl, uint8_t** data, uint32_t* len) override;
+
+private:
+    MFContext& mfContext_;
+
```

Review comment:
can we use `int ctrl` instead of `uint8_t ctrl`?
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 156

**Code Changes:**
```diff
+    ComPtr<IKsControl> xuKsControl_ = nullptr;
+    int xuNodeId_;
+
+    FrameCallback frameCallback_;
+    StreamProfile currentProfile_;
+    int8_t currentStreamIndex_;
+
+    StreamState streamState_;
+    std::mutex streamStateMutex_;
+    std::condition_variable streamStateCv_;
+
```

Review comment:
`int currentStreamIndex_;`?
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,180 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
it's recommended to use `std::vector<uint8_t>` to avoid any possible problems with memory leaks.
**File:** modules/videoio/src/cap_obsensor_capture.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,150 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+/*
+* Copyright(C) 2022 by ORBBEC Technology., Inc.
+* Authors:
+*   Huang Zhenchang <yufeng@orbbec.com>
+*
```

Review comment:
the same expression is duplicated 4 times. Can we move `camParam_.p1[2]*2/640 + 0.5` outside of switch and give this scale some meaningful name?
**File:** samples/cpp/videocapture_obsensor.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 27

**Code Changes:**
```diff
+    Mat depthMap;
+    Mat adjDepthMap;
+    while (true)
+    {
+        // Grab depth map like this:
+        // obsensorCapture >> depthMap;
+
+        // Another way to grab depth map (and bgr image).
+        if (obsensorCapture.grab())
+        {
+            if (obsensorCapture.retrieve(image, CAP_OBSENSOR_BGR_IMAGE))
```

Review comment:
Can we remove this piece of code? I see a very similar chunk of code below
**File:** samples/cpp/videocapture_obsensor.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 27

**Code Changes:**
```diff
+    Mat depthMap;
+    Mat adjDepthMap;
+    while (true)
+    {
+        // Grab depth map like this:
+        // obsensorCapture >> depthMap;
+
+        // Another way to grab depth map (and bgr image).
+        if (obsensorCapture.grab())
+        {
+            if (obsensorCapture.retrieve(image, CAP_OBSENSOR_BGR_IMAGE))
```

Review comment:
I will remove this and add some comments
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 137

**Code Changes:**
```diff
+
+    virtual void start(const StreamProfile& profile, FrameCallback frameCallback) override;
+    virtual void stop() override;
+
+private:
+    virtual bool setXu(uint8_t ctrl, const uint8_t* data, uint32_t len) override;
+    virtual bool getXu(uint8_t ctrl, uint8_t** data, uint32_t* len) override;
+
+private:
+    MFContext& mfContext_;
+
```

Review comment:
According to the UVC protocol ， the range of `ctrl` is limited on: 0~255
**File:** modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 156

**Code Changes:**
```diff
+    ComPtr<IKsControl> xuKsControl_ = nullptr;
+    int xuNodeId_;
+
+    FrameCallback frameCallback_;
+    StreamProfile currentProfile_;
+    int8_t currentStreamIndex_;
+
+    StreamState streamState_;
+    std::mutex streamStateMutex_;
+    std::condition_variable streamStateCv_;
+
```

Review comment:
`currentStreamIndex_` is less than 5, and `currentStreamIndex_ < 0` mean error!
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -123,6 +123,7 @@ enum VideoCaptureAPIs {
        CAP_INTEL_MFX    = 2300,         //!< Intel MediaSDK
        CAP_XINE         = 2400,         //!< XINE engine (Linux)
        CAP_UEYE         = 2500,         //!< uEye Camera API
+       CAP_OBSENSOR     = 2600,         //!< For Orbbec 3D-Sensor device/module (Astra+, Femto)
      };
 
 /** @brief cv::VideoCapture generic properties identifier.
@@ -654,6 +655,35 @@ enum { CAP_PROP_IMAGES_BASE = 18000,
 
```

Review comment:
> iamge typo
**File:** modules/videoio/cmake/detect_obsensor.cmake
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,18 @@
+# --- obsensor ---
+if(NOT HAVE_OBSENSOR)
+  if(WIN32)
+    check_include_file(mfapi.h HAVE_MFAPI)
+    if(HAVE_MFAPI)
+      set(HAVE_OBSENSOR TRUE)
+      set(HAVE_OBSENSOR_MSMF TRUE)
+      ocv_add_external_target(obsensor "" "" "HAVE_OBSENSOR;HAVE_OBSENSOR_MSMF")
+    endif()
```

Review comment:
> CMAKE_REQUIRED_QUIET We don't need this really.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -123,6 +123,7 @@ enum VideoCaptureAPIs {
        CAP_INTEL_MFX    = 2300,         //!< Intel MediaSDK
        CAP_XINE         = 2400,         //!< XINE engine (Linux)
        CAP_UEYE         = 2500,         //!< uEye Camera API
+       CAP_OBSENSOR     = 2600,         //!< For Orbbec 3D-Sensor device/module (Astra+, Femto)
      };
 
 /** @brief cv::VideoCapture generic properties identifier.
@@ -654,6 +655,35 @@ enum { CAP_PROP_IMAGES_BASE = 18000,
 
```

Review comment:
> `enum {` Avoid using of anonymous enums. Add name for them and put into documentation information about where it should be used.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 664

**Code Changes:**
```diff
+    @{
+*/
+//! OBSENSOR data given from image generator
+enum VideoCaptureOBSensorDataType{ 
+    CAP_OBSENSOR_DEPTH_MAP = 0, //!< Depth values in mm (CV_16UC1)
+    CAP_OBSENSOR_BGR_IMAGE = 1, //!< Data given from BGR stream generator
+    CAP_OBSENSOR_IR_IMAGE = 2   //!< Data given from IR stream generator(CV_16UC1)
+};
+
+//! OBSENSOR stream generator
+enum VideoCaptureOBSensorGenerators{ 
```

Review comment:
BGR image is preserved to default stream 0 (of any VideoCapture backend)
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -123,6 +123,7 @@ enum VideoCaptureAPIs {
        CAP_INTEL_MFX    = 2300,         //!< Intel MediaSDK
        CAP_XINE         = 2400,         //!< XINE engine (Linux)
        CAP_UEYE         = 2500,         //!< uEye Camera API
+       CAP_OBSENSOR     = 2600,         //!< For Orbbec 3D-Sensor device/module (Astra+, Femto)
      };
 
 /** @brief cv::VideoCapture generic properties identifier.
@@ -654,6 +655,35 @@ enum { CAP_PROP_IMAGES_BASE = 18000,
 
```

Review comment:
0,1,2,3 - these values conflict with regular common properties. Add `CAP_OBSENSOR*10` to values.
**File:** samples/cpp/videocapture_obsensor.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,74 @@
+#include <opencv2/videoio.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgproc.hpp>
+#include <iostream>
+
+using namespace cv;
+int main()
+{
+    VideoCapture obsensorCapture(0, CAP_OBSENSOR);
```

Review comment:
`.isOpened()` check would be useful here.
**File:** samples/cpp/videocapture_obsensor.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )
**Review Line:** 27

**Code Changes:**
```diff
+    Mat depthMap;
+    Mat adjDepthMap;
+    while (true)
+    {
+        // Grab depth map like this:
+        // obsensorCapture >> depthMap;
+
+        // Another way to grab depth map (and bgr image).
+        if (obsensorCapture.grab())
+        {
+            if (obsensorCapture.retrieve(image, CAP_OBSENSOR_BGR_IMAGE))
```

Review comment:
"default" grab should be preserved for BGR frames (not depth or whatever)
**File:** samples/cpp/videocapture_obsensor.cpp
**Change Type:** added
**Context:** PR #22196: videoio: add support for obsensor (Orbbec RGB-D Camera )

**Code Changes:**
```diff
@@ -0,0 +1,74 @@
+#include <opencv2/videoio.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgproc.hpp>
+#include <iostream>
+
+using namespace cv;
+int main()
+{
+    VideoCapture obsensorCapture(0, CAP_OBSENSOR);
```

Review comment:
`waitKey(1)` or `pollKey()`