instruction stringclasses 9
values | input stringlengths 279 5.47k | output stringlengths 6 9.58k |
|---|---|---|
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | I'm not quite sure about this, but I have seen same usage in [calibinit.cpp](https://github.com/opencv/opencv/blob/cac5b0fe5a3e06718a6cb408d6468ff87428ef2a/modules/calib3d/src/calibinit.cpp#L2261-L2266). Maybe in Release build, `CV_LOG_DEBUG` doesn't use `e`, then `CV_UNUSED` can supress the warning? |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF),... | In my test data, the 2D points are from the normalized image coordiante system, that's why the camera matrix is `Mat::eye(3, 3, CV_64FC1)`. So, the reprojection error here is not in pixel unit. As you can see, the focal length of my camera is about 460.0, and the tolerance of reprojection error is set to 4 pixels. It s... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF),... | Fixed now. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF),... | You are right. I did not see that the camera matrix is identity. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | Yes, I think that it is to probably suppress warning in release mode. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | Maybe something like this? This is to explain to the user that everything went fine (consensus set was found that agree with the hypothesis), but issue occurs when computing the final pose using all the points in the consensus set. ```suggestion CV_LOG_DEBUG(NULL, "solvePnPRansac(): solvePnP stage to compute the final ... |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF),... | I would add some comments before this line to explain this test: - with this specific data - when computing the final pose using points in the consensus set with `SOLVEPNP_ITERATIVE` and `solvePnP()` - an exception is thrown from `solvePnP` because there are 5 non-coplanar 3D points and the DLT algorithm needs at least... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326
**Code Changes:**
```diff
+ {
+ if (flags == SOLVEPNP_ITERATIVE &&
+ npoints1 == 5 &&
+ e.what() &&
+ ... | This part changes behavior of the case which is not covered by PR's description: - `result = solvePnP()` doesn't throw exception - it returns `result <= 0` Alternative #19492 preserves behavior of non-exception case. --- > When I call solvePnPRansac with 69 points (data I provided above), then I should get a result (ev... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326
**Code Changes:**
```diff
+ {
+ if (flags == SOLVEPNP_ITERATIVE &&
+ npoints1 == 5 &&
+ e.what() &&
+ ... | You are right, the logging strategy here is problematic. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326
**Code Changes:**
```diff
+ {
+ if (flags == SOLVEPNP_ITERATIVE &&
+ npoints1 == 5 &&
+ e.what() &&
+ ... | Main question is about the final returned value. |result = solvePnP|(1) existed code|(2) This PR| (3) PR 19492|case4(no PR) |---|---|---|---|---| |result > 0|true|true|true|true| |result<=0|false|true (❓) |false|false| |exception|exception|true (❓)|true (❓)| false| |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Review Line:** 326
**Code Changes:**
```diff
+ {
+ if (flags == SOLVEPNP_ITERATIVE &&
+ npoints1 == 5 &&
+ e.what() &&
+ ... | I think you meant to @ someone else (not me)? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/matrix_sparse.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard
**Review Line:** 174
**Code Changes:**
```diff
@@ -171,7 +171,14 @@ void SparseMat::Hdr::clear()
hashtab.clear();
hashtab.resize(HASH_SIZE0);
pool.clear();
+#if defined(__GNUC__) && (__... | It's not safe replacement. Pool elements cannot be used after it, but they could be before. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/test/test_filter.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard
**Code Changes:**
```diff
@@ -1865,107 +1865,65 @@ TEST(Imgproc_PreCornerDetect, accuracy) { CV_PreCornerDetectTest test; test.safe
TEST(Imgproc_Integral, accuracy) { CV_IntegralTest test; test.safe... | What issue does it solve? I prefer the original version. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/test/test_filter.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard
**Code Changes:**
```diff
@@ -1865,107 +1865,65 @@ TEST(Imgproc_PreCornerDetect, accuracy) { CV_PreCornerDetectTest test; test.safe
TEST(Imgproc_Integral, accuracy) { CV_IntegralTest test; test.safe... | Perhaps this test should be rewritten using `ASSERT/EXPECT_NO_THROW` and `SCOPED_TRACE` :slightly_smiling_face: |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/src/generalized_hough.cpp
**Change Type:** modified
**Context:** PR #26590: support C++20 standard
**Code Changes:**
```diff
@@ -692,7 +692,11 @@ namespace
getContourPoints(edges, dx, dy, points);
features.resize(levels_ + 1);
- std::for_each(features.begin(), featu... | I think lambda capture list should be kept as small as possible. If compatibility with C++11 should be preserved, then ```suggestion const size_t maxBufferSize = maxBufferSize_; std::for_each(features.begin(), features.end(), [maxBufferSize](std::vector<Feature>& e) { e.clear(); e.reserve(maxBufferSize); }); ``` otherw... |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/gpt2_inference.py
**Change Type:** modified
**Context:** PR #26584: Update printingin GPT2 sample
**Code Changes:**
```diff
@@ -30,21 +30,17 @@
python gpt2_inference.py --model=<path-to-onnx-model> --prompt=<use-promt-of-the-same-length-used-while-exporting>
'''
-
-
import numpy as np
... | I propose to raise the limitation up to 1000 tockens or more. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples
**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>... | The path of the models are confusing. Warning messages require setting `OPENCV_SAMPLES_DATA_PATH` or `OPENCV_DOWNLOAD_CACHE_DIR`; when `OPENCV_SAMPLES_DATA_PATH` is set, another warning appear: FileNotFoundError: File xxxx not found! Please specify the path to /opencv/samples/data in the OPENCV_SAMPLES_DATA_PATH enviro... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples
**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>... | Such main does not make a lot of sense. I propose to rename "run" to "main" and remove it. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples
**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>... | Why do you use 100 here? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/object_tracker.cpp
**Change Type:** added
**Context:** PR #26202: Improved Tracker Samples
**Code Changes:**
```diff
@@ -0,0 +1,309 @@
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/video.hpp>... | yes, 100ms is too long delay. Should be decreased to 10. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/ml/src/svm.cpp
**Change Type:** modified
**Context:** PR #26587: Fix #25812: Add error handling for invalid nu parameter in SVM NU_SVC
**Review Line:** 1462
**Code Changes:**
```diff
COPYRIGHT NOTICE
----------------
@@ -1458,9 +1460,1... | CV_Error raises exception. The method would interrupt execution here instead of false result. Alternative solution is just log message like ``` CV_LOG_ERROR(NULL, "Training cases incompatible with nu parameter—try a lower value."); ``` |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/misc/objc/common/CvTypeExt.swift
**Change Type:** modified
**Context:** PR #26559: Fixed cv::Mat type constants in ObjC and Swift.
**Review Line:** 55
**Code Changes:**
```diff
@@ -53,7 +53,7 @@ public extension CvType {
static let CV_16FC4: Int32 = CV_16FC(4)
static let CV_CN_MAX = ... | Still wrong outdated value. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/highgui/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26563: Missing include directories needed for wayland-util and xkbcommon
**Code Changes:**
```diff
@@ -83,6 +83,7 @@ if(WITH_WAYLAND AND HAVE_WAYLAND)
endif()
endif()
+ ocv_module_include_directories(${WAYLAND_CLIENT_INCLUDE... | I propose to add includes to line 85 into `if(WITH_WAYLAND AND HAVE_WAYLAND)` condition scope. and stay the line as is. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/src/drawing.cpp
**Change Type:** modified
**Context:** PR #26513: Fix for issue 26264
**Code Changes:**
```diff
@@ -2477,21 +2477,70 @@ void cv::drawContours( InputOutputArray _image, InputArrayOfArrays _contours,
CV_Assert(ncontours <= (size_t)std::numeric_limits<int>::max());
if (... | Most likely faster because there is no dynamic re-allocation ```cpp indexesToFill.resize(end-i); indexesToFill = iota<int>(indexesToFill.begin(), indexesToFill.end(), i); ``` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/src/drawing.cpp
**Change Type:** modified
**Context:** PR #26513: Fix for issue 26264
**Code Changes:**
```diff
@@ -2477,21 +2477,70 @@ void cv::drawContours( InputOutputArray _image, InputArrayOfArrays _contours,
CV_Assert(ncontours <= (size_t)std::numeric_limits<int>::max());
if (... | Maybe initialize hierarchy as ```cpp Mat_<Vec4i> hierarchy = _hierarchy.getMat(); ``` so that you do not type `.at<Vec4i>` every time |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/src/drawing.cpp
**Change Type:** modified
**Context:** PR #26513: Fix for issue 26264
**Review Line:** 2531
**Code Changes:**
```diff
+ next = hierarchy(next)[0]; // next sibling
+ }
}
- for (; i < end; ++i)
+ }
+ std::vector<Mat> contoursToFill... | ```cpp contoursToFill.reserve(indexesToFill.size()); ``` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/test/test_contours.cpp
**Change Type:** modified
**Context:** PR #26513: Fix for issue 26264
**Code Changes:**
```diff
@@ -446,9 +446,9 @@ static void d2xy(int n, int d, int *x, int *y)
}
}
-TEST(Imgproc_FindContours, hilbert)
+static Mat draw_hilbert(int n = 64, int scale = 10)
{
- ... | why not put it into for loop? |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/stitching/include/opencv2/stitching.hpp
**Change Type:** modified
**Context:** PR #26516: Document some stitching methods and enable bindings for them.
**Review Line:** 308
**Code Changes:**
```diff
+ */
+ CV_WRAP std::vector<int> component() const { return indices_; }
+
+ /** Returns estim... | As I can see `setTransform` method is not wrapped, it seems that is not possible to set `cameras_` from Python. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/stitching/include/opencv2/stitching.hpp
**Change Type:** modified
**Context:** PR #26516: Document some stitching methods and enable bindings for them.
**Review Line:** 308
**Code Changes:**
```diff
+ */
+ CV_WRAP std::vector<int> component() const { return indices_; }
+
+ /** Returns estim... | There is issue in current generator implementation: ``` In file included from /mnt/Projects/Projects/opencv/modules/python/src2/cv2.cpp:88: /mnt/Projects/Projects/opencv-build/modules/python_bindings_generator/pyopencv_generated_types_content.h: In function ‘PyObject* pyopencv_cv_Stitcher_setTransform(PyObject*, PyObje... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/tensorflow/tf_importer.cpp
**Change Type:** modified
**Context:** PR #26394: Modified tensorflow parser for the new dnn engine
**Review Line:** 636
**Code Changes:**
```diff
friend class TFLayerHandler;
@@ -603,6 +633,80 @@ class TFImporter
void parseCustomLayer (tensorflow::... | const std::vector<std::string>& |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/tensorflow/tf_importer.cpp
**Change Type:** modified
**Context:** PR #26394: Modified tensorflow parser for the new dnn engine
**Code Changes:**
```diff
@@ -10,9 +10,11 @@ Implementation of Tensorflow models parser
*/
#include "../precomp.hpp"
+#include "../net_impl.hpp"
#include <open... | Please add meaningful error message. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/clapack/runtime/cblas_wrap.c
**Change Type:** added
**Context:** PR #18571: Added clapack
**Review Line:** 286
**Code Changes:**
```diff
+ }
+ if (info)
+ fprintf(stderr, "Parameter %d to routine %s was incorrect\n", info, rout);
+ vfprintf(stderr, form, argptr);
+ va_end(argptr);
+ i... | Looks like a bug: #26528 --- > `exit(-1)` Should not have that. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #26503: Fixed test LSTM warning.
**Review Line:** 2745
**Code Changes:**
```diff
@@ -2742,7 +2742,7 @@ INSTANTIATE_TEST_CASE_P(TestLayerFusion, ConvolutionActivationEltwiseFusion, Com
TEST(Layer_LSTM, repeatedInference)
{
- std... | `true` value is a default, so it could be removed. Reproduce with `OPENCV_TEST_CHECK_OPTIONAL_DATA=1` environment variable. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #26503: Fixed test LSTM warning.
**Review Line:** 2745
**Code Changes:**
```diff
@@ -2742,7 +2742,7 @@ INSTANTIATE_TEST_CASE_P(TestLayerFusion, ConvolutionActivationEltwiseFusion, Com
TEST(Layer_LSTM, repeatedInference)
{
- std... | Addressed in https://github.com/opencv/ci-gha-workflow/pull/198 |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #26459: HAL added for absdiff(array, scalar) + related fixes
**Code Changes:**
```diff
@@ -109,9 +109,10 @@ Add scalar: _dst[i] = src[i] + scalar
@param width width of the images
@param height height of the images
@param scalar... | shall it be unsigned/uint32_t type for the output array? |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #26459: HAL added for absdiff(array, scalar) + related fixes
**Code Changes:**
```diff
@@ -109,9 +109,10 @@ Add scalar: _dst[i] = src[i] + scalar
@param width width of the images
@param height height of the images
@param scalar... | discussed, fixed |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/layers/recurrent2_layers.cpp
**Change Type:** added
**Context:** PR #26391: LSTM layer for new graph engine.
**Code Changes:**
```diff
@@ -0,0 +1,605 @@
+// 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 ... | Please use modern license header, e.g. https://github.com/opencv/opencv/blob/4.x/modules/dnn/src/backend.cpp |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/layers/recurrent2_layers.cpp
**Change Type:** added
**Context:** PR #26391: LSTM layer for new graph engine.
**Code Changes:**
```diff
@@ -0,0 +1,605 @@
+// 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 ... | Please remove if not relevant. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 1331
**Code Changes:**
```diff
#endif
testONNXModels("split_max");
}
-
+// Fails with the new engine. Output shape [?, N, OutputSize] not supported by new graph e... | Please add note why the test is disabled. Here and bellow. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/layers/recurrent2_layers.cpp
**Change Type:** added
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 194
**Code Changes:**
```diff
+ std::vector<MatType>& outputs,
+ std::vector<MatType>& internals) const CV_OVERRIDE
+ ... | According to implementation, only fp32 and m.b. fp64 are supported. Need ti add check/assert here. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/layers/recurrent2_layers.cpp
**Change Type:** added
**Context:** PR #26391: LSTM layer for new graph engine.
**Code Changes:**
```diff
@@ -0,0 +1,605 @@
+// 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 ... | Please add check that the layer got enough inputs. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/layers/recurrent2_layers.cpp
**Change Type:** added
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 467
**Code Changes:**
```diff
+
+ vconcat(part1, part2, dst);
+
+ int finalShape[] = {2, batchSize, numHidden};
+ dst = ds... | redundant space line. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/init.cpp
**Change Type:** modified
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 212
**Code Changes:**
```diff
@@ -209,6 +209,7 @@ void initializeLayerFactory()
CV_DNN_REGISTER_LAYER_CLASS(FlowWarp, FlowWarpLayer);
CV_DNN_REGISTER_LAYER_CLASS(LSTM... | That is the first layer named in such a way. I think that layer name should remain the same while `Impl` class should be different for different versions of the engine |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/init.cpp
**Change Type:** modified
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 212
**Code Changes:**
```diff
@@ -209,6 +209,7 @@ void initializeLayerFactory()
CV_DNN_REGISTER_LAYER_CLASS(FlowWarp, FlowWarpLayer);
CV_DNN_REGISTER_LAYER_CLASS(LSTM... | Not first. Here are some examples [[1](https://github.com/opencv/opencv/blob/979428d5908b5396237b18cbd50d0b18265e2463/modules/dnn/src/init.cpp#L92)], [[2](https://github.com/opencv/opencv/blob/979428d5908b5396237b18cbd50d0b18265e2463/modules/dnn/src/init.cpp#L88)], [[3](https://github.com/opencv/opencv/blob/979428d5908... |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 1331
**Code Changes:**
```diff
#endif
testONNXModels("split_max");
}
-
+// Fails with the new engine. Output shape [?, N, OutputSize] not supported by new graph e... | Is that comment still actual? To understand why working tests have been disabled and no new alternatives added. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/test/test_layers.cpp
**Change Type:** modified
**Context:** PR #26391: LSTM layer for new graph engine.
**Review Line:** 2745
**Code Changes:**
```diff
TestLayerFusion::dnnBackendsAndTargetsForFusionTests()
));
+TEST(Layer_LSTM, repeatedInference)
+{
+ std::string o... | Merged against RED CI: ``` [----------] 1 test from Layer_LSTM [ RUN ] Layer_LSTM.repeatedInference TEST ERROR: Don't use 'optional' findData() for dnn/onnx/models/onnxscript_lstm.onnx unknown file: Failure C++ exception with description "OpenCV(5.0.0-pre) /build/precommit_linux64/5.x/opencv/modules/ts/src/ts.cpp:969: ... |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp
**Change Type:** modified
**Context:** PR #26454: imgproc: fix perf regressions on the c4 kernels of warpAffine / warpPerspective / remap
**Code Changes:**
```diff
@@ -543,6 +543,40 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float32, vfloat32m2_t, floa... | why `n` parameter is passed? Let's get rid of it. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp
**Change Type:** modified
**Context:** PR #26454: imgproc: fix perf regressions on the c4 kernels of warpAffine / warpPerspective / remap
**Code Changes:**
```diff
@@ -543,6 +543,40 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float32, vfloat32m2_t, floa... | let's get rid of 'n' parameter in the newly added intrinsics. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp
**Change Type:** modified
**Context:** PR #26454: imgproc: fix perf regressions on the c4 kernels of warpAffine / warpPerspective / remap
**Code Changes:**
```diff
@@ -543,6 +543,40 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float32, vfloat32m2_t, floa... | ~I am afraid that we cannot, since `v_store` is already defined.~ Ok, never mind. Tested and it can work without `n`. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp
**Change Type:** modified
**Context:** PR #26454: imgproc: fix perf regressions on the c4 kernels of warpAffine / warpPerspective / remap
**Code Changes:**
```diff
@@ -543,6 +543,40 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float32, vfloat32m2_t, floa... | Done. Also removed `n` parameter from last PR. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #25624: HAL added for add(array, scalar)
**Review Line:** 590
**Code Changes:**
```diff
#endif
+typedef int (*ScalarFunc)(const uchar* src, size_t step_src,
+ uchar* dst, size_t step_dst, int width, int height... | `usrdata` is not supported, this should be fixed for more common cases |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #25624: HAL added for add(array, scalar)
**Review Line:** 113
**Code Changes:**
```diff
+@param dst_step destination image step
+@param width width of the images
+@param height height of the images
+@param scalar_data pointer to s... | if we want to support C1, C3 etc. scalars, we need to add `int nchannels` (check that the name is consistent with other HAL entries) |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #25624: HAL added for add(array, scalar)
**Review Line:** 113
**Code Changes:**
```diff
+@param dst_step destination image step
+@param width width of the images
+@param height height of the images
+@param scalar_data pointer to s... | Probably we will add support for more channels in later PRs For now we leave it just for 1 channel |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26303: Skip KleidiCV in offline build
**Code Changes:**
```diff
@@ -935,7 +935,7 @@ if(HAVE_OPENVX)
endif()
endif()
-if(WITH_KLEIDICV)
+if(HAVE_KLEIDICV)
ocv_debug_message(STATUS "Enable KleidiCV acceleration")
if(NOT ";${OpenCV_HAL};" MAT... | This skips `add_subdirectory()` call if user specifies `cmake -DOpenCV_HAL=kleidicv ...`. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26303: Skip KleidiCV in offline build
**Code Changes:**
```diff
@@ -935,7 +935,7 @@ if(HAVE_OPENVX)
endif()
endif()
-if(WITH_KLEIDICV)
+if(HAVE_KLEIDICV)
ocv_debug_message(STATUS "Enable KleidiCV acceleration")
if(NOT ";${OpenCV_HAL};" MAT... | What is the problem to follow carotene design? |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26420: Support 0d/1d Mat in FileStorage
**Review Line:** 2054
**Code Changes:**
```diff
+ EXPECT_EQ(src.size, dst.size);
+ EXPECT_EQ(cv::norm(src, dst, NORM_INF), 0.0);
+}
+
+typedef testing::TestWithParam<const char*> FileStorage... | This test raises debug assertion ``` [ RUN ] Core_InputOutput/FileStorage_exact_type.empty_mat/0, where GetParam() = ".yml" unknown file: Failure C++ exception with description "OpenCV(5.0.0-pre) /work/opencv/modules/core/include/opencv2/core/mat.inl.hpp:1349: error: (-215:Assertion failed) i < dims() in function 'oper... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #26420: Support 0d/1d Mat in FileStorage
**Review Line:** 2054
**Code Changes:**
```diff
+ EXPECT_EQ(src.size, dst.size);
+ EXPECT_EQ(cv::norm(src, dst, NORM_INF), 0.0);
+}
+
+typedef testing::TestWithParam<const char*> FileStorage... | Please take a look at https://github.com/opencv/opencv/pull/26444 |
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511
**Code Changes:**
```diff
- cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
- ... | AFAIK these kind of functions were keeped in 4.x for compatibility as discussed in https://github.com/opencv/opencv/pull/26259 |
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511
**Code Changes:**
```diff
- cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
- ... | Currently, this is only used internally, it is not part of the public C API (which does not have much in calib3d, cf https://github.com/opencv/opencv/blob/4.x/modules/calib3d/include/opencv2/calib3d/calib3d_c.h). This PR switches the C code that uses it to C++, so there is no need for that function anymore. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511
**Code Changes:**
```diff
- cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
- ... | for example https://github.com/shimat/opencvsharp uses cvUndistortPoints. shouldn't this be preserved? |
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511
**Code Changes:**
```diff
- cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
- ... | ``` git grep cvUndistortPoints ``` dies not return anything in their repo, where do they use it? They use `cv::undistortPoints` which is the C++ API. `modules/calib3d/src/calib3d_c_api.h` is an internal header so modifying it fine, other projects cannot use the API it offers. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511
**Code Changes:**
```diff
- cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
- ... | sorry let me check again |
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/undistort.dispatch.cpp
**Change Type:** modified
**Context:** PR #26437: backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x
**Review Line:** 511
**Code Changes:**
```diff
- cvUndistortPointsInternal(_src, _dst, _cameraMatrix, _distCoeffs, matR, matP,
- ... | I agree, the C API is till used, but the API removed in this PR is INTERNAL to OpenCV, nobody outside of OpenCV is using it because they cannot use it: the header that declares it is not public, it is in `src`, not in `include`. `cvUndistortPoints` was removed from the public C API 6 years ago in https://github.com/ope... |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** cmake/OpenCVMinDepVersions.cmake
**Change Type:** modified
**Context:** PR #26287: build: transition to C++17, minor changes in documentation - * Raise C++ standard to C++17 * Show warnings for possible configuration issue...
**Review Line:** 3
**Code Changes:**
```diff
@@ -1,5 +1,6 @@
if(NOT DEFINED MIN_VE... | Let's use the lowest possible version. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** cmake/OpenCVDetectCXXCompiler.cmake
**Change Type:** modified
**Context:** PR #26287: build: transition to C++17, minor changes in documentation - * Raise C++ standard to C++17 * Show warnings for possible configuration issue...
**Review Line:** 212
**Code Changes:**
```diff
+ if("cxx_std_17" IN_LIST CMAKE_... | C++11 support is implied by C++17 support - so i presume `HAVE_CXX11` could be removed completely? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x
**Code Changes:**
```diff
@@ -42,7 +42,6 @@
#include "precomp.hpp"
#include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
#in... | `dABdA` and `dABdB` are optional. `cvarrToMat` returns empty Mat if the pointer is nullptr. Empty Mat is not equal to `cv::NoArray()`. You have to check pointers on wrapper side and put `cv::noArray` for optional outputs. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x
**Code Changes:**
```diff
@@ -42,7 +42,6 @@
#include "precomp.hpp"
#include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
#in... | The same for optional params. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x
**Code Changes:**
```diff
@@ -42,7 +42,6 @@
#include "precomp.hpp"
#include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
#in... | I actually removed the function |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26414: backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x
**Code Changes:**
```diff
@@ -42,7 +42,6 @@
#include "precomp.hpp"
#include "hal_replacement.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
#in... | I actually removed the function |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 2127
**Code Changes:**
```diff
std::string platform, deviceName;
... | NULL can't be handled |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/highgui/src/window.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 665
**Code Changes:**
```diff
@@ -662,7 +662,7 @@ int cv::waitKey(in... | I propose to drop it in 5.x |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_dshow.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 306
**Code Changes:**
```diff
- const char* s = getenv("OP... | I propose to use generic logging here with default environment variables. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 932
**Code Changes:**
```diff
{
-#ifndef NO_GETENV
- ... | I propose to use generic logging here with default environment variables. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 539
**Code Changes:**
```diff
@@ -536,6 +536,7 @@ OCV_OPTION(ENABLE_CONFIG_VERIFICAT... | iOS and derivatives? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/highgui/src/window.cpp
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 665
**Code Changes:**
```diff
@@ -662,7 +662,7 @@ int cv::waitKey(in... | OK, but this PR is for 4.x, so we'll need to remove it after these changes make their way to 5.x. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26331: build: made environment access a separate feature - - changed second argument of the `getConfigurationParameterString` to `std::string` fro...
**Review Line:** 539
**Code Changes:**
```diff
@@ -536,6 +536,7 @@ OCV_OPTION(ENABLE_CONFIG_VERIFICAT... | I'm not sure, it seems that we have no any specific handling for iOS. Perhaps this platform supports environment variables. If Apple compiler defines `NO_GETENV`, then it would automatically disable our getenv support even if cmake option is turned OFF. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/segmentation.cpp
**Change Type:** modified
**Context:** PR #26347: Updated segmentation sample as per current update usage and engine
**Code Changes:**
```diff
@@ -12,81 +12,176 @@ using namespace cv;
using namespace std;
using namespace dnn;
+const string about =
+ "Use this script to... | Please add fallback to ENGINE_CLASSIC, if device/target is not OCV/CPU. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/segmentation.cpp
**Change Type:** modified
**Context:** PR #26347: Updated segmentation sample as per current update usage and engine
**Code Changes:**
```diff
@@ -12,81 +12,176 @@ using namespace cv;
using namespace std;
using namespace dnn;
+const string about =
+ "Use this script to... | It does not print command line options. The command line parser may add custom test to printMessage with ::about(): https://docs.opencv.org/5.x/d0/d2e/classcv_1_1CommandLineParser.html#a2e11e779047efded23f75d9c5c5dd82e |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/segmentation.py
**Change Type:** modified
**Context:** PR #26347: Updated segmentation sample as per current update usage and engine
**Code Changes:**
```diff
@@ -1,140 +1,176 @@
import cv2 as cv
import argparse
import numpy as np
-import sys
from common import *
-backends = (cv.dnn.DNN_B... | The same idea for fallback. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/ndsrvp/src/bilateralFilter.cpp
**Change Type:** added
**Context:** PR #26364: 3rdparty: NDSRVP - Part 2.1: Filter-Related Functions
**Code Changes:**
```diff
@@ -0,0 +1,270 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level d... | I propose to return `CV_HAL_ERROR_NOT_IMPLEMENTED` instead of assert. Just in case if some branches are added to main OpenCV. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/ndsrvp/src/bilateralFilter.cpp
**Change Type:** added
**Context:** PR #26364: 3rdparty: NDSRVP - Part 2.1: Filter-Related Functions
**Code Changes:**
```diff
@@ -0,0 +1,270 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level d... | lrint behaviour depends on external state defined by `fesetround`. Do you have alternative for it? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/classification.cpp
**Change Type:** modified
**Context:** PR #26334: Modify DNN Samples to use ENGINE_CLASSIC for Non-Default Back-end or Target
**Code Changes:**
```diff
@@ -143,7 +143,11 @@ int main(int argc, char** argv)
}
CV_Assert(!model.empty());
//! [Read and initialize netw... | Let it be `ENGINE_AUTO`. It fails back to classic in case of issues. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26390: Disable SME2 branches in KleidiCV as it's incompatible with some CLang versions, e.g. NDK 28b1
**Review Line:** 23
**Code Changes:**
```diff
@@ -20,4 +20,5 @@ else()
set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/kleidicv/klei... | `if(ANDRROID)` ? |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26390: Disable SME2 branches in KleidiCV as it's incompatible with some CLang versions, e.g. NDK 28b1
**Review Line:** 23
**Code Changes:**
```diff
@@ -20,4 +20,5 @@ else()
set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/kleidicv/klei... | It's not specific to Android, it's clang side effect. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/caffe/caffe_importer.cpp
**Change Type:** modified
**Context:** PR #26208: Modified Caffe parser to support the new dnn engine
**Code Changes:**
```diff
@@ -40,6 +40,7 @@
//M*/
#include "../precomp.hpp"
+#include "../net_impl.hpp"
#ifdef HAVE_PROTOBUF
#include <iostream>
@@ -53,8 +54,... | `const &`? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/caffe/caffe_importer.cpp
**Change Type:** modified
**Context:** PR #26208: Modified Caffe parser to support the new dnn engine
**Code Changes:**
```diff
@@ -40,6 +40,7 @@
//M*/
#include "../precomp.hpp"
+#include "../net_impl.hpp"
#ifdef HAVE_PROTOBUF
#include <iostream>
@@ -53,8 +54,... | ``` if(!newEngine) { addedBlobs.clear(); addedBlobs.reserve(layersSize + 1); } ``` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/caffe/caffe_importer.cpp
**Change Type:** modified
**Context:** PR #26208: Modified Caffe parser to support the new dnn engine
**Review Line:** 758
**Code Changes:**
```diff
+ engine = engine_forced;
+
CaffeImporter caffeImporter(prototxt.c_str(), caffeModel.c_str());
Net net... | What about fallback, if the new engine cannot handle the model? |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/caffe/caffe_importer.cpp
**Change Type:** modified
**Context:** PR #26208: Modified Caffe parser to support the new dnn engine
**Review Line:** 758
**Code Changes:**
```diff
+ engine = engine_forced;
+
CaffeImporter caffeImporter(prototxt.c_str(), caffeModel.c_str());
Net net... | Look like it is unnecessary. The parser doesn't fall in tests |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/include/opencv2/features2d.hpp
**Change Type:** modified
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -70,6 +70,13 @@
@{
@defgroup features2d_hal_interface Interface
@}
+
+ @defgroup features2d_annoy Approxim... | ANNOY_DIST is inside AnnoyIndex, don't duplicate prefix => ANNIndex::DIST_EUCLIDEAN. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/include/opencv2/features2d.hpp
**Change Type:** modified
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -70,6 +70,13 @@
@{
@defgroup features2d_hal_interface Interface
@}
+
+ @defgroup features2d_annoy Approxim... | use 'Approximate Nearest Neighbor Search' instead of 'Annoy' here |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/test/test_nearestneighbors.cpp
**Change Type:** modified
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -330,4 +330,55 @@ TEST(Features2d_FLANN_Saved, regression) { CV_FlannSavedIndexTest test; test.saf
#endif
+class CV_AnnoyTe... | The function should return void, if you want to use EXPECT_ macro. https://google.github.io/googletest/advanced.html#using-assertions-in-sub-routines |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | Let's use seed from OpenCV RNG. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | It's not safe solution. errorMsg is empty and msg will be nullptr or the allocated buffer size is unpredictable. In case of error it leads to extra memory corruption. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | The same issue with memory corruption. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | The same error. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | The same error. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | Why do you introduce seed range limitation? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -0,0 +1,264 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | you can easily get rid of memcpy if create `std::vector` from `indices.ptr<int>(i)` and `dists.ptr<DataType>(i)`. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/src/annoy.cpp
**Change Type:** added
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Review Line:** 54
**Code Changes:**
```diff
+ ANNIndexImpl(int dimension) : dim(dimension)
+ {
+ index = makePtr<::cvannoy::AnnoyIndex<int, DataType, DistanceType... | I propose to return bool and print error to log, but not throw exception, if `addItems` was not successful. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/include/opencv2/features2d.hpp
**Change Type:** modified
**Context:** PR #25708: Add interface to Annoy which will replace the FLANN
**Code Changes:**
```diff
@@ -70,6 +70,13 @@
@{
@defgroup features2d_hal_interface Interface
@}
+
+ @defgroup features2d_annoy Approxim... | The description does not match implementation. 1. The both outputs are optional. 2. The output is re-created, if it has unexpected size or type. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.