nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/src/int8layers/quantization_utils.cpp
**Change Type:** modified
**Context:** PR #25644: [GSoC] dnn: Blockwise quantization support

**Code Changes:**
```diff
@@ -15,7 +15,10 @@ namespace dnn
 static void broadcast1D2TargetMat(Mat& data, const MatShape& targetShape, int axis)
 {
     // The data is the 1-D scales or zeropoints.
-    CV_Assert(axis >= 0 && targetShape.size() > axis && data.total() == targetShape[axis]);
+    CV_CheckGE(axis, 0, "Quantization axis must be non-negative.");
+    CV_CheckGT((int)targetShape.size(),axis,"Quantization axis must be within the valid range of target shape dimensions.");
+    CV_CheckEQ((int)data.total(), (int)targetShape[axis], "Data total size must match the size of the specified target dimension.");
+
     std::vector<int> broadcast_axes;
```

Review comment:
`const MatShape&`
**File:** modules/dnn/src/int8layers/quantization_utils.cpp
**Change Type:** modified
**Context:** PR #25644: [GSoC] dnn: Blockwise quantization support
**Review Line:** 82

**Code Changes:**
```diff
+
+        for (int j = 0; j < num_chunks; ++j) {
+            memcpy(dst_mat.data + dst_offset, src_mat.data + src_offset, chunk_size);
+            src_offset += chunk_size;
+            dst_offset += chunk_size * repetitions;
+        }
+    }
+}
+
+template <typename T>
+static void copyVecToMat(Mat& mat, const std::vector<T>& data){
```

Review comment:
It works if dst_mat is continuous. Please add at least CV_Assert before the loop.
**File:** modules/imgcodecs/src/grfmt_bmp.cpp
**Change Type:** modified
**Context:** PR #25975: Improved error handling in image codecs.

**Code Changes:**
```diff
@@ -635,38 +635,40 @@ bool  BmpEncoder::write( const Mat& img, const std::vector<int>& )
         m_buf->reserve( alignSize(fileSize + 16, 256) );
 
     // write signature 'BM'
-    strm.putBytes( fmtSignBmp, (int)strlen(fmtSignBmp) );
+    CHECK_WRITE(strm.putBytes( fmtSignBmp, (int)strlen(fmtSignBmp) ));
 
     // write file header
-    strm.putDWord( validateToInt(fileSize) ); // file size
-    strm.putDWord( 0 );
```

Review comment:
I believe stream will be closed automatically in its destructor.
**File:** modules/imgcodecs/src/grfmt_bmp.cpp
**Change Type:** modified
**Context:** PR #25975: Improved error handling in image codecs.

**Code Changes:**
```diff
@@ -635,38 +635,40 @@ bool  BmpEncoder::write( const Mat& img, const std::vector<int>& )
         m_buf->reserve( alignSize(fileSize + 16, 256) );
 
     // write signature 'BM'
-    strm.putBytes( fmtSignBmp, (int)strlen(fmtSignBmp) );
+    CHECK_WRITE(strm.putBytes( fmtSignBmp, (int)strlen(fmtSignBmp) ));
 
     // write file header
-    strm.putDWord( validateToInt(fileSize) ); // file size
-    strm.putDWord( 0 );
```

Review comment:
Done. Unified the macro.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
Please add comment and/or reference, where you got -36.73f
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
`exp` call is not needed, if x == 0.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
The same for the constant. It's used several times. I propose to introduce named constant with description and use it.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
Added source.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
Guarded the constant with an anonymous namespace.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
Looks like the extra conditions are redundant. You can replace for loop with: ``` for (; i < len - vlanes; i += vlanes) ``` It's applicable for all cases in the PR.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
The idea is to also apply intrinsics on the tail by fetching the last vlanes elements, although it may introduce duplicated computation. This trick is borrowed from Halide. Below is an example. Assume vlanes=4 and we have 7 elements. Without this trick, the last 3 elements have to be processed by a extra for loop. With this trick, it works like two times of loop, both of which process 4 elements, but the second loop takes elements of index 4567, while the first takes 1234 (index 4 element is processed twice).
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
I got the point. The problem is that you introduce several extra conditions in the loop. I propose to extract the condition and add vectorized tail computation with overlap after the loop.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25881: dnn: optimize activations with v_exp

**Code Changes:**
```diff
@@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor {
                       one = vx_setall_f32(1.0f),
                       reciprocal_sqrt2 = vx_setall_f32(M_SQRT1_2);
             for (; i <= len - vlanes; i += vlanes) {
-                if (i + vlanes > len) {
-                    if (i == 0 || i == len) {
-                        break;
-                    }
-                    i = len - vlanes;
-                }
```

Review comment:
> Problem is spreading over codebase. I volunteer to take care of this if there is a list of this problem.
**File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #25936: HAL for dot product added
**Review Line:** 916

**Code Changes:**
```diff
+ * @param type Data type of both images, for example CV_8U or CV_32F
+ * @param dot_val Pointer to resulting dot product value
+ * @return int
+ */
+inline int hal_ni_dotProduct(const uchar* a_data, size_t a_step, const uchar* b_data, size_t b_step, int width, int height,
+                             int type, double *dot_val)
+{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+
+//! @cond IGNORED
+#define cv_hal_dotProduct hal_ni_dotProduct
+//! @endcond
```

Review comment:
can we return int64_t instead of double?
**File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #25936: HAL for dot product added
**Review Line:** 916

**Code Changes:**
```diff
+ * @param type Data type of both images, for example CV_8U or CV_32F
+ * @param dot_val Pointer to resulting dot product value
+ * @return int
+ */
+inline int hal_ni_dotProduct(const uchar* a_data, size_t a_step, const uchar* b_data, size_t b_step, int width, int height,
+                             int type, double *dot_val)
+{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+
+//! @cond IGNORED
+#define cv_hal_dotProduct hal_ni_dotProduct
+//! @endcond
```

Review comment:
Public interface: `double Mat::dot(InputArray _mat) const`. `int64_t` looks strange. Also the `::dot()` may handle floats and doubles.
**File:** modules/core/src/matmul.dispatch.cpp
**Change Type:** modified
**Context:** PR #25936: HAL for dot product added
**Review Line:** 998

**Code Changes:**
```diff
@@ -995,9 +995,18 @@ double Mat::dot(InputArray _mat) const
     CV_INSTRUMENT_REGION();
 
     Mat mat = _mat.getMat();
+    CV_Assert_N( mat.type() == type(), mat.size == size);
+
     int cn = channels();
+    if (this->dims <= 2)
+    {
+        double product = 0;
```

Review comment:
`CV_Assert_N` is deprecated due to malformed or useless error messages. Use `CV_Check*` instead.
**File:** modules/core/test/test_arithm.cpp
**Change Type:** modified
**Context:** PR #25902: Mask support with CV_Bool in ts and core

**Code Changes:**
```diff
@@ -2462,23 +2462,22 @@ TEST(Compare, regression_16F_do_not_crash)
     EXPECT_NO_THROW(cv::compare(mat1, mat2, dst, cv::CMP_EQ));
 }
 
-
 TEST(Core_minMaxIdx, regression_9207_1)
 {
     const int rows = 4;
     const int cols = 3;
     uchar mask_[rows*cols] = {
```

Review comment:
We should not modify existed tests. We should add new tests for new types support.
**File:** modules/core/test/test_arithm.cpp
**Change Type:** modified
**Context:** PR #25902: Mask support with CV_Bool in ts and core

**Code Changes:**
```diff
@@ -2462,23 +2462,22 @@ TEST(Compare, regression_16F_do_not_crash)
     EXPECT_NO_THROW(cv::compare(mat1, mat2, dst, cv::CMP_EQ));
 }
 
-
 TEST(Core_minMaxIdx, regression_9207_1)
 {
     const int rows = 4;
     const int cols = 3;
     uchar mask_[rows*cols] = {
```

Review comment:
I would make it random, 8U or bool
**File:** modules/core/include/opencv2/core.hpp
**Change Type:** modified
**Context:** PR #25902: Mask support with CV_Bool in ts and core

**Code Changes:**
```diff
@@ -352,8 +352,8 @@ result of an incorrect sign in the case of overflow.
 @param src2 second input array or a scalar.
 @param dst output array that has the same size and number of channels as the input array(s); the
 depth is defined by dtype or src1/src2.
-@param mask optional operation mask - 8-bit single channel array, that specifies elements of the
-output array to be changed.
+@param mask optional operation mask - CV_8U, CV_8S or CV_Bool single channel array, that specifies elements
+of the output array to be changed.
 @param dtype optional depth of the output array (see the discussion below).
 @sa subtract, addWeighted, scaleAdd, Mat::convertTo
```

Review comment:
why not add CV_8S as yet another option, since we are doing changes anyway
**File:** modules/core/test/test_arithm.cpp
**Change Type:** modified
**Context:** PR #25902: Mask support with CV_Bool in ts and core

**Code Changes:**
```diff
@@ -2462,23 +2462,22 @@ TEST(Compare, regression_16F_do_not_crash)
     EXPECT_NO_THROW(cv::compare(mat1, mat2, dst, cv::CMP_EQ));
 }
 
-
 TEST(Core_minMaxIdx, regression_9207_1)
 {
     const int rows = 4;
     const int cols = 3;
     uchar mask_[rows*cols] = {
```

Review comment:
Added couple of more tests.
**File:** modules/imgcodecs/src/loadsave.cpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder

**Code Changes:**
```diff
@@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) {
     m_decoder->setSource(filename);
     CV_Assert(m_decoder->readHeader());
 
-    // count the pages of the image collection
-    size_t count = 1;
-    while(m_decoder->nextPage()) count++;
-
-    m_size = count;
+    m_size = m_decoder->getFrameCount();
```

Review comment:
It should be removed then, right? As soon as following `m_size = count;`
**File:** modules/imgcodecs/src/loadsave.cpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder

**Code Changes:**
```diff
@@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) {
     m_decoder->setSource(filename);
     CV_Assert(m_decoder->readHeader());
 
-    // count the pages of the image collection
-    size_t count = 1;
-    while(m_decoder->nextPage()) count++;
-
-    m_size = count;
+    m_size = m_decoder->getFrameCount();
```

Review comment:
Also there is GDAL branch bellow.
**File:** modules/imgcodecs/src/loadsave.cpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder

**Code Changes:**
```diff
@@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) {
     m_decoder->setSource(filename);
     CV_Assert(m_decoder->readHeader());
 
-    // count the pages of the image collection
-    size_t count = 1;
-    while(m_decoder->nextPage()) count++;
-
-    m_size = count;
+    m_size = m_decoder->getFrameCount();
```

Review comment:
``` m_size = m_decoder->getFrameCount(); if (m_size > 0) { m_pages.resize(m_size); return; } ``` if `m_frame_count` set by `m_decoder->readHeader()` set m_size and return.. otherways the following code needed. To remove the code below, we need to make sure that all decoders set the `m_frame_count` variable.
**File:** modules/imgcodecs/src/loadsave.cpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder

**Code Changes:**
```diff
@@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) {
     m_decoder->setSource(filename);
     CV_Assert(m_decoder->readHeader());
 
-    // count the pages of the image collection
-    size_t count = 1;
-    while(m_decoder->nextPage()) count++;
-
-    m_size = count;
+    m_size = m_decoder->getFrameCount();
```

Review comment:
`m_frame_count = 1;` default for all decoders except AvifDecoder and TiffDecoder.
**File:** modules/imgcodecs/src/loadsave.cpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder
**Review Line:** 1272

**Code Changes:**
```diff
@@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) {
     m_decoder->setSource(filename);
     CV_Assert(m_decoder->readHeader());
 
-    // count the pages of the image collection
-    size_t count = 1;
-    while(m_decoder->nextPage()) count++;
-
-    m_size = count;
+    m_size = m_decoder->getFrameCount();
     m_pages.resize(m_size);
-    // Reinitialize the decoder because we advanced to the last page while counting the pages of the image
-#ifdef HAVE_GDAL
-    if (m_flags != IMREAD_UNCHANGED && (m_flags & IMREAD_LOAD_GDAL) == IMREAD_LOAD_GDAL) {
-        m_decoder = GdalDecoder().newDecoder();
```

Review comment:
You now need a GDAL implementation right?
**File:** modules/imgcodecs/src/loadsave.cpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder
**Review Line:** 1272

**Code Changes:**
```diff
@@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) {
     m_decoder->setSource(filename);
     CV_Assert(m_decoder->readHeader());
 
-    // count the pages of the image collection
-    size_t count = 1;
-    while(m_decoder->nextPage()) count++;
-
-    m_size = count;
+    m_size = m_decoder->getFrameCount();
     m_pages.resize(m_size);
-    // Reinitialize the decoder because we advanced to the last page while counting the pages of the image
-#ifdef HAVE_GDAL
-    if (m_flags != IMREAD_UNCHANGED && (m_flags & IMREAD_LOAD_GDAL) == IMREAD_LOAD_GDAL) {
-        m_decoder = GdalDecoder().newDecoder();
```

Review comment:
current GDAL decoder reads only one image. deleted lines changes nothing for actual GDAL decoder. imho adding overridden `nextPage()` to GDAL decoder should be in scope of other PR
**File:** modules/imgcodecs/include/opencv2/imgcodecs.hpp
**Change Type:** modified
**Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder

**Code Changes:**
```diff
@@ -305,11 +305,13 @@ The function imreadmulti loads a specified range from a multi-page image from th
 */
 CV_EXPORTS_W bool imreadmulti(const String& filename, CV_OUT std::vector<Mat>& mats, int start, int count, int flags = IMREAD_ANYCOLOR);
 
-/** @brief Returns the number of images inside the give file
+/** @brief Returns the number of images inside the given file
 
-The function imcount will return the number of pages in a multi-page image, or 1 for single-page images
+The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise.
+If the image cannot be decoded, 0 is returned.
```

Review comment:
This comment used the future tense, let's make it simpler: The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise. If the image cannot be decoded, 0 is returned.
**File:** modules/videoio/src/cap_obsensor_capture.cpp
**Change Type:** modified
**Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera
**Review Line:** 39

**Code Changes:**
```diff
     static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16};
-    static const obsensor::StreamProfile gemini2depthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y14};
-    static const obsensor::StreamProfile astra2depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile gemini2DepthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile astra2DepthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile megaColorProfile = {1280, 720, 30, obsensor::FRAME_FORMAT_MJPG};
+    static const obsensor::StreamProfile megaDepthProfile = {640, 576, 30, obsensor::FRAME_FORMAT_Y16};
 
     streamChannelGroup_ = obsensor::getStreamChannelGroup(index);
     if (!streamChannelGroup_.empty())
@@ -46,11 +48,17 @@ VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false)
```

Review comment:
Why Motion JPEG? I propose to preserve the best quality by default, if possible.
**File:** modules/videoio/src/cap_obsensor_capture.cpp
**Change Type:** modified
**Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera
**Review Line:** 39

**Code Changes:**
```diff
     static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16};
-    static const obsensor::StreamProfile gemini2depthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y14};
-    static const obsensor::StreamProfile astra2depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile gemini2DepthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile astra2DepthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile megaColorProfile = {1280, 720, 30, obsensor::FRAME_FORMAT_MJPG};
+    static const obsensor::StreamProfile megaDepthProfile = {640, 576, 30, obsensor::FRAME_FORMAT_Y16};
 
     streamChannelGroup_ = obsensor::getStreamChannelGroup(index);
     if (!streamChannelGroup_.empty())
@@ -46,11 +48,17 @@ VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false)
```

Review comment:
For platform compatibility reasons, the YUYV format does not pass on some of the lower performance platforms we tested.
**File:** modules/videoio/src/cap_obsensor_capture.cpp
**Change Type:** modified
**Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera
**Review Line:** 39

**Code Changes:**
```diff
     static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16};
-    static const obsensor::StreamProfile gemini2depthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y14};
-    static const obsensor::StreamProfile astra2depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile gemini2DepthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile astra2DepthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y14};
+    static const obsensor::StreamProfile megaColorProfile = {1280, 720, 30, obsensor::FRAME_FORMAT_MJPG};
+    static const obsensor::StreamProfile megaDepthProfile = {640, 576, 30, obsensor::FRAME_FORMAT_Y16};
 
     streamChannelGroup_ = obsensor::getStreamChannelGroup(index);
     if (!streamChannelGroup_.empty())
@@ -46,11 +48,17 @@ VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false)
```

Review comment:
I propose to make MJPEG optional. (M)JPEG makes frames a bit blury. It affects feature detectors.