nareshmlx/opencv-pr huggingface dataset:
**File:** modules/3d/src/pointcloud/io_base.hpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors
**Review Line:** 23

**Code Changes:**
```diff
 using PointCloudDecoder = std::unique_ptr<BasePointCloudDecoder>;
 using PointCloudEncoder = std::unique_ptr<BasePointCloudEncoder>;
 
+// for OBJ files: to read vertices, normals and texture coords as they are given in the file
+// or duplicate them according to faces
+const int READ_AS_IS_FLAG = 1;
+
 ///////////////////////////////// base class for decoders ////////////////////////
 class BasePointCloudDecoder
 {
 public:
```

Review comment:
I propose to add flag parameter to public API as it's done in `imread` and make it public option.
**File:** modules/3d/src/pointcloud/io_obj.cpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors

**Code Changes:**
```diff
@@ -12,12 +12,24 @@ namespace cv {
 
 std::unordered_set<std::string> ObjDecoder::m_unsupportedKeys;
 
-void ObjDecoder::readData(std::vector<Point3f> &points, std::vector<Point3f> &normals, std::vector<Point3_<uchar>> &rgb, std::vector<std::vector<int32_t>> &indices)
+void ObjDecoder::readData(std::vector<Point3f>& points, std::vector<Point3f>& normals, std::vector<Point3f>& rgb)
 {
-    points.clear();
-    normals.clear();
-    rgb.clear();
```

Review comment:
Here's a parsing exception which is a normal situation: it throws when a face does not use normals or texture coordinates. In that case the corresponding `idx[j]` is marked by -1, this is checked later.
**File:** modules/3d/src/pointcloud/io_ply.cpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors
**Review Line:** 471

**Code Changes:**
```diff
             offset = offsetof(VertexFields, r);
-        if (p.name == "green")
+        if (p.name == "green" || p.name == "diffuse_green")
             offset = offsetof(VertexFields, g);
-        if (p.name == "blue")
+        if (p.name == "blue"  || p.name == "diffuse_blue")
             offset = offsetof(VertexFields, b);
         vertexOffsets[j] = offset;
     }
@@ -426,18 +504,12 @@ void PlyDecoder::parseBody(std::ifstream &file, std::vector<Point3f> &points, st
             size_t offset = vertexOffsets[j];
```

Review comment:
I've never seen such PLY files; maybe we'd better add such a check.
**File:** modules/3d/src/pointcloud/io_base.hpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors
**Review Line:** 23

**Code Changes:**
```diff
 using PointCloudDecoder = std::unique_ptr<BasePointCloudDecoder>;
 using PointCloudEncoder = std::unique_ptr<BasePointCloudEncoder>;
 
+// for OBJ files: to read vertices, normals and texture coords as they are given in the file
+// or duplicate them according to faces
+const int READ_AS_IS_FLAG = 1;
+
 ///////////////////////////////// base class for decoders ////////////////////////
 class BasePointCloudDecoder
 {
 public:
```

Review comment:
This flag has internal usage only, we don't need it in public API. The behavior this flag implements is what differs `loadPointCloud()` and `loadMesh()`: vertices duplication when face uses different indices.
**File:** modules/3d/src/pointcloud/io_obj.cpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors
**Review Line:** 209

**Code Changes:**
```diff
+                {
+                    rgb.push_back(rgbList.at(vi[i]));
+                }
+
+                texCoords.push_back(texCoordList.at(ti[i]));
+                normals.push_back(nrmList.at(ni[i]));
+            }
+
+            indices.push_back(newvi);
+        }
+    }
```

Review comment:
It makes sense to call reserve() for all vectors, to prevent reallocs on push_back().
**File:** modules/3d/src/pointcloud/io_ply.cpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors

**Code Changes:**
```diff
@@ -13,22 +13,28 @@
 
 namespace cv {
 
-void PlyDecoder::readData(std::vector<Point3f> &points, std::vector<Point3f> &normals, std::vector<Point3_<uchar>> &rgb, std::vector<std::vector<int32_t>> &indices)
+static const std::set<std::string> colorKeys = { "red", "diffuse_red", "green", "diffuse_green", "blue", "diffuse_blue" };
+
+void PlyDecoder::readData(std::vector<Point3f>& points, std::vector<Point3f>& normals, std::vector<Point3f>& rgb,
+                          std::vector<Point3f>& texCoords, int& nTexCoords,
+                          std::vector<std::vector<int32_t>>& indices, int /*flags*/)
```

Review comment:
Why 32-bit int is not normalized? What about float branch present in the old version of the code?
**File:** modules/3d/src/pointcloud/io_obj.cpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors
**Review Line:** 209

**Code Changes:**
```diff
+                {
+                    rgb.push_back(rgbList.at(vi[i]));
+                }
+
+                texCoords.push_back(texCoordList.at(ti[i]));
+                normals.push_back(nrmList.at(ni[i]));
+            }
+
+            indices.push_back(newvi);
+        }
+    }
```

Review comment:
At least in internal loops, this makes sense
**File:** modules/3d/src/pointcloud/io_ply.cpp
**Change Type:** modified
**Context:** PR #25221: OBJ and PLY loaders extention to support texture coordinates and difused colors

**Code Changes:**
```diff
@@ -13,22 +13,28 @@
 
 namespace cv {
 
-void PlyDecoder::readData(std::vector<Point3f> &points, std::vector<Point3f> &normals, std::vector<Point3_<uchar>> &rgb, std::vector<std::vector<int32_t>> &indices)
+static const std::set<std::string> colorKeys = { "red", "diffuse_red", "green", "diffuse_green", "blue", "diffuse_blue" };
+
+void PlyDecoder::readData(std::vector<Point3f>& points, std::vector<Point3f>& normals, std::vector<Point3f>& rgb,
+                          std::vector<Point3f>& texCoords, int& nTexCoords,
+                          std::vector<std::vector<int32_t>>& indices, int /*flags*/)
```

Review comment:
We do not load any fields except uint8 and float32 in fact. The code for other data types is excessive, I'll remove it. We can also implement other types, with or without normalization, but not earlier than we actually encounter such PLY files.
**File:** modules/highgui/misc/java/src/java/highgui+HighGui.java
**Change Type:** modified
**Context:** PR #25322: Update highgui+HighGui.java - toBufferedImage Modifying the original array copying method here can double the speed.

**Code Changes:**
```diff
@@ -62,14 +62,9 @@ public static Image toBufferedImage(Mat m) {
         if (m.channels() > 1) {
             type = BufferedImage.TYPE_3BYTE_BGR;
         }
-
-        int bufferSize = m.channels() * m.cols() * m.rows();
-        byte[] b = new byte[bufferSize];
-        m.get(0, 0, b); // get all the pixels
         BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);
-
```

Review comment:
The comment is redundant.
**File:** modules/highgui/misc/java/src/java/highgui+HighGui.java
**Change Type:** modified
**Context:** PR #25322: Update highgui+HighGui.java - toBufferedImage Modifying the original array copying method here can double the speed.

**Code Changes:**
```diff
@@ -62,14 +62,9 @@ public static Image toBufferedImage(Mat m) {
         if (m.channels() > 1) {
             type = BufferedImage.TYPE_3BYTE_BGR;
         }
-
-        int bufferSize = m.channels() * m.cols() * m.rows();
-        byte[] b = new byte[bufferSize];
-        m.get(0, 0, b); // get all the pixels
         BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);
-
```

Review comment:
Trailing white space.
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25225: Expand 0D layer test
**Review Line:** 348

**Code Changes:**
```diff
+    ),
+/*output blob shape*/ testing::Values(
+        std::vector<int>({1}),
+        std::vector<int>({1, 1}),
+        std::vector<int>({1, 1, 1}),
+        std::vector<int>({1, 1, 1, 1})
+    )
+));
+
 }}
```

Review comment:
Test is weak.
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #25277: Added int tests for CumSum, Scatter, Tile and ReduceSum dnn layers
**Review Line:** 2646

**Code Changes:**
```diff
+
+TEST_P(Test_ONNX_layers, ScatterInt)
+{
+    testONNXModels("scatter_int32", npy, 0, 0, false, true, 3);
+    testONNXModels("scatter_int64", npy, 0, 0, false, true, 3);
+}
+
+TEST_P(Test_ONNX_layers, TileInt)
+{
+    testONNXModels("tile_int32");
+    testONNXModels("tile_int64");
```

Review comment:
What about scatterND?
**File:** modules/dnn/test/test_int.cpp
**Change Type:** modified
**Context:** PR #25277: Added int tests for CumSum, Scatter, Tile and ReduceSum dnn layers

**Code Changes:**
```diff
@@ -496,4 +496,197 @@ INSTANTIATE_TEST_CASE_P(/**/, Test_Flatten_Int, Combine(
     dnnBackendsAndTargets()
 ));
 
+typedef testing::TestWithParam<tuple<int, tuple<Backend, Target> > > Test_Tile_Int;
+TEST_P(Test_Tile_Int, random)
+{
+    int matType = get<0>(GetParam());
+    tuple<Backend, Target> backend_target= get<1>(GetParam());
+    Backend backend = get<0>(backend_target);
```

Review comment:
I propose to remove disabled test for now and add it in pr with fix.
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #25277: Added int tests for CumSum, Scatter, Tile and ReduceSum dnn layers

**Code Changes:**
```diff
@@ -1194,6 +1194,9 @@ void ONNXImporter::parseReduce(LayerParams& layerParams, const opencv_onnx::Node
     int num_inputs = node_proto.input_size();
     CV_Check(num_inputs, num_inputs >= 1 && num_inputs <= 2, "DNN/ONNX: Reduce layers should have at least one input and at most two inputs");
 
+    if (num_inputs >= 2)
+        CV_CheckTrue(constBlobs.find(node_proto.input(1)) != constBlobs.end(), "Reduce layer doesn't support non contant axes");
+
     // "axes" is turned to one of the inputs since opset 18,
     // except for ReduceSum, which has "axes" input since opset 13.
     if (!layerParams.has("axes") && num_inputs == 2 && constBlobs.find(node_proto.input(1)) != constBlobs.end()) {
```

Review comment:
`num_inputs => 2`?
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #25277: Added int tests for CumSum, Scatter, Tile and ReduceSum dnn layers
**Review Line:** 2646

**Code Changes:**
```diff
+
+TEST_P(Test_ONNX_layers, ScatterInt)
+{
+    testONNXModels("scatter_int32", npy, 0, 0, false, true, 3);
+    testONNXModels("scatter_int64", npy, 0, 0, false, true, 3);
+}
+
+TEST_P(Test_ONNX_layers, TileInt)
+{
+    testONNXModels("tile_int32");
+    testONNXModels("tile_int64");
```

Review comment:
https://github.com/opencv/opencv/pull/25330
**File:** modules/dnn/test/test_int.cpp
**Change Type:** modified
**Context:** PR #25277: Added int tests for CumSum, Scatter, Tile and ReduceSum dnn layers
**Review Line:** 682

**Code Changes:**
```diff
+                {
+                    inIndices[1] = j;
+                    value += getValueAt(input, inIndices.data());
+                }
+            }
+            EXPECT_EQ(getValueAt(re, reIndices.data()), value);
+        }
+    }
+}
+
+INSTANTIATE_TEST_CASE_P(/**/, Test_Reduce_Int, Combine(
```

Review comment:
Can we use `cv::reduce` for reference data?
**File:** modules/dnn/test/test_int.cpp
**Change Type:** modified
**Context:** PR #25277: Added int tests for CumSum, Scatter, Tile and ReduceSum dnn layers
**Review Line:** 682

**Code Changes:**
```diff
+                {
+                    inIndices[1] = j;
+                    value += getValueAt(input, inIndices.data());
+                }
+            }
+            EXPECT_EQ(getValueAt(re, reIndices.data()), value);
+        }
+    }
+}
+
+INSTANTIATE_TEST_CASE_P(/**/, Test_Reduce_Int, Combine(
```

Review comment:
It supports only 2d matrices
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #25217: core: Rename `cv::float16_t` to `cv::hfloat`

**Code Changes:**
```diff
@@ -809,40 +809,20 @@ using std::uint64_t;
 namespace cv
 {
 
-class float16_t
+class hfloat
 {
 public:
 #if CV_FP16_TYPE
 
```

Review comment:
I believe we need to drop this line when porting to 5.x.
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #25217: core: Rename `cv::float16_t` to `cv::hfloat`
**Review Line:** 903

**Code Changes:**
```diff
+    hfloat res(out.f);
+    return res;
+#endif
+}
+
+typedef hfloat float16_t;
+
 }
 #endif
 
```

Review comment:
`float16_t` used in convolution related code should be valid, which is exactly `float16_t` from `arm_neon.h`. I am not sure about the `float16_t` in `onnx_graph_simplifier.cpp` though.
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #25217: core: Rename `cv::float16_t` to `cv::hfloat`
**Review Line:** 903

**Code Changes:**
```diff
+    hfloat res(out.f);
+    return res;
+#endif
+}
+
+typedef hfloat float16_t;
+
 }
 #endif
 
```

Review comment:
This may conflict with compilers too: `typedef __fp16 float16_t;` Need to use `#if !defined(__OPENCV_BUILD) && !defined(OPENCV_HIDE_FLOAT16_T)` compilation guard.
**File:** 3rdparty/orbbecsdk/orbbecsdk.cmake
**Change Type:** added
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...
**Review Line:** 1

**Code Changes:**
```diff
@@ -0,0 +1,18 @@
+function(download_orbbec_sdk root_var)
+    set(ORBBECSDK_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/orbbecsdk")
+    set(ORBBECSDK_FILE_HASH_CMAKE "2624c84837d3416fd8b3e95750e6e725")
+    ocv_download(FILENAME "v1.9.4.tar.gz"
+                HASH ${ORBBECSDK_FILE_HASH_CMAKE}
+                URL "https://github.com/orbbec/OrbbecSDK/archive/refs/tags/v1.9.4/"
```

Review comment:
It's bad idea. SDK should be vendored in 3rdparty or pointed by CMake. Reasons: - Git pulled version is unpredictable. - On-the-go download from Github that may be not available during build - Pollute OpenCv repo during development.
**File:** modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...
**Review Line:** 319

**Code Changes:**
```diff
-            param.p0[3] = 235.787f;
-            param.p1[0] = 516.652f;
-            param.p1[1] = 516.692f;
-            param.p1[2] = 322.988f;
-            param.p1[3] = 235.787f;
+            param.p0[0] = 519.342f;
+            param.p0[1] = 519.043f;
+            param.p0[2] = 319.41f;
+            param.p0[3] = 240.839f;
+            param.p1[0] = 519.342f;
+            param.p1[1] = 519.043f;
```

Review comment:
Why? What is data source?
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...

**Code Changes:**
```diff
@@ -474,9 +474,11 @@ OCV_OPTION(WITH_ONNX "Include Microsoft ONNX Runtime support" OFF
 OCV_OPTION(WITH_TIMVX "Include Tim-VX support" OFF
   VISIBLE_IF TRUE
   VERIFY HAVE_TIMVX)
-# attention: Astra2, Gemini2, and Gemini2L cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions.
-OCV_OPTION(WITH_OBSENSOR "Include obsensor support (Orbbec RGB-D modules: Astra+/Femto)" ON
-  VISIBLE_IF (WIN32 AND NOT ARM AND NOT WINRT AND NOT MINGW) OR ( UNIX AND NOT APPLE AND NOT ANDROID)
+# Attention when OBSENSOR_USE_ORBBEC_SDK set to off:
+#   Astra2 cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions.
+OCV_OPTION(OBSENSOR_USE_ORBBEC_SDK "Use Orbbec SDK as backend to support more camera models and platforms (force to ON on MacOS)" OFF)
```

Review comment:
Turn it OFF as before
**File:** modules/videoio/src/cap_obsensor_capture.cpp
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...

**Code Changes:**
```diff
@@ -23,7 +23,8 @@
 
 #include "cap_obsensor_capture.hpp"
 #include "cap_obsensor/obsensor_stream_channel_interface.hpp"
-#ifdef HAVE_OBSENSOR
+
+#if defined(HAVE_OBSENSOR) && !defined(HAVE_OBSENSOR_ORBBEC_SDK)
 namespace cv {
 Ptr<IVideoCapture> create_obsensor_capture(int index)
 {
```

Review comment:
We've update the depth frame format from Y14 to Y16 to improve compatibility with different versions of Linux, involving a 2-bit left-shift for each pixel. Thus, we need to divide by 4 here to maintain the accuracy of the depth values.
**File:** modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...
**Review Line:** 319

**Code Changes:**
```diff
-            param.p0[3] = 235.787f;
-            param.p1[0] = 516.652f;
-            param.p1[1] = 516.692f;
-            param.p1[2] = 322.988f;
-            param.p1[3] = 235.787f;
+            param.p0[0] = 519.342f;
+            param.p0[1] = 519.043f;
+            param.p0[2] = 319.41f;
+            param.p0[3] = 240.839f;
+            param.p1[0] = 519.342f;
+            param.p1[1] = 519.043f;
```

Review comment:
This is the default parameter of the Gemin2 camera provided by our algorithm department, which will be more accurate than the previous version.
**File:** 3rdparty/orbbecsdk/orbbecsdk.cmake
**Change Type:** added
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...
**Review Line:** 1

**Code Changes:**
```diff
@@ -0,0 +1,18 @@
+function(download_orbbec_sdk root_var)
+    set(ORBBECSDK_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/orbbecsdk")
+    set(ORBBECSDK_FILE_HASH_CMAKE "2624c84837d3416fd8b3e95750e6e725")
+    ocv_download(FILENAME "v1.9.4.tar.gz"
+                HASH ${ORBBECSDK_FILE_HASH_CMAKE}
+                URL "https://github.com/orbbec/OrbbecSDK/archive/refs/tags/v1.9.4/"
```

Review comment:
You can use `ocv_download` for versioning. Example: https://github.com/opencv/opencv/blob/bfad61f43344f5d84bef86617bd4c1bacec0fe94/3rdparty/libtim-vx/tim-vx.cmake#L14-L20
**File:** modules/videoio/cmake/detect_obsensor.cmake
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...

**Code Changes:**
```diff
@@ -1,28 +1,54 @@
 # --- obsensor ---
 if(NOT HAVE_OBSENSOR)
-  if(WIN32)
-    check_include_file(mfapi.h HAVE_MFAPI)
-    check_include_file(vidcap.h HAVE_VIDCAP)
-    if(HAVE_MFAPI AND HAVE_VIDCAP)
-      set(HAVE_OBSENSOR TRUE)
-      set(HAVE_OBSENSOR_MSMF TRUE)
-      ocv_add_external_target(obsensor "" "" "HAVE_OBSENSOR;HAVE_OBSENSOR_MSMF")
```

Review comment:
Use `ocv_install_target` instead otherwise library cannot be found. Example: ``` ocv_install_target(tim-vx EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev) ```
**File:** modules/videoio/cmake/detect_obsensor.cmake
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...

**Code Changes:**
```diff
@@ -1,28 +1,54 @@
 # --- obsensor ---
 if(NOT HAVE_OBSENSOR)
-  if(WIN32)
-    check_include_file(mfapi.h HAVE_MFAPI)
-    check_include_file(vidcap.h HAVE_VIDCAP)
-    if(HAVE_MFAPI AND HAVE_VIDCAP)
-      set(HAVE_OBSENSOR TRUE)
-      set(HAVE_OBSENSOR_MSMF TRUE)
-      ocv_add_external_target(obsensor "" "" "HAVE_OBSENSOR;HAVE_OBSENSOR_MSMF")
```

Review comment:
Looks like libOrbbecSDK is not going to be built along with opencv; they use prebuilt library instead (which is not open-sourced). In this case, libOrbbecSDK should be installed along with libopencv_*.dylib in the same directory.
**File:** modules/videoio/cmake/detect_obsensor.cmake
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...

**Code Changes:**
```diff
@@ -1,28 +1,54 @@
 # --- obsensor ---
 if(NOT HAVE_OBSENSOR)
-  if(WIN32)
-    check_include_file(mfapi.h HAVE_MFAPI)
-    check_include_file(vidcap.h HAVE_VIDCAP)
-    if(HAVE_MFAPI AND HAVE_VIDCAP)
-      set(HAVE_OBSENSOR TRUE)
-      set(HAVE_OBSENSOR_MSMF TRUE)
-      ocv_add_external_target(obsensor "" "" "HAVE_OBSENSOR;HAVE_OBSENSOR_MSMF")
```

Review comment:
> Looks like libOrbbecSDK is not going to be built along with opencv; they use prebuilt library instead (which is not open-sourced). In this case, libOrbbecSDK should be installed along with libopencv_*.dylib in the same directory. Okay, I will fix this issue
**File:** modules/videoio/cmake/detect_obsensor.cmake
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...
**Review Line:** 2

**Code Changes:**
```diff
@@ -1,28 +1,54 @@
 # --- obsensor ---
 if(NOT HAVE_OBSENSOR)
-  if(WIN32)
-    check_include_file(mfapi.h HAVE_MFAPI)
-    check_include_file(vidcap.h HAVE_VIDCAP)
-    if(HAVE_MFAPI AND HAVE_VIDCAP)
-      set(HAVE_OBSENSOR TRUE)
```

Review comment:
We should distribute licenses of used 3rdparty code (not only for downloaded cases but also if we use preinstalled SDKs). Please use `ocv_install_3rdparty_licenses` macro with appropriate file from SDK.
**File:** modules/videoio/cmake/detect_obsensor.cmake
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...
**Review Line:** 2

**Code Changes:**
```diff
@@ -1,28 +1,54 @@
 # --- obsensor ---
 if(NOT HAVE_OBSENSOR)
-  if(WIN32)
-    check_include_file(mfapi.h HAVE_MFAPI)
-    check_include_file(vidcap.h HAVE_VIDCAP)
-    if(HAVE_MFAPI AND HAVE_VIDCAP)
-      set(HAVE_OBSENSOR TRUE)
```

Review comment:
> We should distribute licenses of used 3rdparty code (not only for downloaded cases but also if we use preinstalled SDKs). Please use `ocv_install_3rdparty_licenses` macro with appropriate file from SDK. I have added relevant operations.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #24877: Orbbec Camera supports MacOS，Gemini2 and Gemini2L support Y16 format - note: 1.Gemini2 and Gemini2L must use the latest firmware -- https:/...

**Code Changes:**
```diff
@@ -474,9 +474,11 @@ OCV_OPTION(WITH_ONNX "Include Microsoft ONNX Runtime support" OFF
 OCV_OPTION(WITH_TIMVX "Include Tim-VX support" OFF
   VISIBLE_IF TRUE
   VERIFY HAVE_TIMVX)
-# attention: Astra2, Gemini2, and Gemini2L cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions.
-OCV_OPTION(WITH_OBSENSOR "Include obsensor support (Orbbec RGB-D modules: Astra+/Femto)" ON
-  VISIBLE_IF (WIN32 AND NOT ARM AND NOT WINRT AND NOT MINGW) OR ( UNIX AND NOT APPLE AND NOT ANDROID)
+# Attention when OBSENSOR_USE_ORBBEC_SDK set to off:
+#   Astra2 cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions.
+OCV_OPTION(OBSENSOR_USE_ORBBEC_SDK "Use Orbbec SDK as backend to support more camera models and platforms (force to ON on MacOS)" OFF)
```

Review comment:
banckend - typo.