instruction
stringclasses
9 values
input
stringlengths
279
5.47k
output
stringlengths
6
9.58k
You are an expert OpenCV code reviewer specializing in test coverage and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/misc/python/test/test_dnn.py **Change Type:** modified **Context:** PR #26026: Add support for boolan input/outputs in python bindings **Code Changes:** ```diff @@ -546,5 +546,24 @@ def test_net_builder(self): out = net.forward() self.assertEqual(out.shape, (1, 2, 3, 4)) + ...
Without names it will replace x input
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/misc/python/test/test_dnn.py **Change Type:** modified **Context:** PR #26026: Add support for boolan input/outputs in python bindings **Code Changes:** ```diff @@ -546,5 +546,24 @@ def test_net_builder(self): out = net.forward() self.assertEqual(out.shape, (1, 2, 3, 4)) + ...
Technically yes, but how to do that without adding extra funtionality in `modules/dnn/misc/python/test/test_dnn.py` file?
You are an expert OpenCV code reviewer specializing in test coverage and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/misc/python/test/test_dnn.py **Change Type:** modified **Context:** PR #26026: Add support for boolan input/outputs in python bindings **Code Changes:** ```diff @@ -546,5 +546,24 @@ def test_net_builder(self): out = net.forward() self.assertEqual(out.shape, (1, 2, 3, 4)) + ...
How would you implement this functionality?
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/misc/python/test/test_dnn.py **Change Type:** modified **Context:** PR #26026: Add support for boolan input/outputs in python bindings **Code Changes:** ```diff @@ -546,5 +546,24 @@ def test_net_builder(self): out = net.forward() self.assertEqual(out.shape, (1, 2, 3, 4)) + ...
There is no generic testing method in test_dnn.py - you can create input/output in runtime as numpy array
You are an expert OpenCV code reviewer specializing in test coverage and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/misc/python/test/test_dnn.py **Change Type:** modified **Context:** PR #26026: Add support for boolan input/outputs in python bindings **Code Changes:** ```diff @@ -546,5 +546,24 @@ def test_net_builder(self): out = net.forward() self.assertEqual(out.shape, (1, 2, 3, 4)) + ...
Alternatively, let's make input data more complex - initialize them randomly instead of zeros/ones https://github.com/opencv/opencv_extra/pull/1201/files#diff-066596aee5ba198740fae15d7e39dd3c0bebcec5c6d5faab96a61c2c5de97863R404
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/types.hpp **Change Type:** modified **Context:** PR #26022: imgproc: use double to determine whether the corners points are within src **Review Line:** 475 **Code Changes:** ```diff @@ -475,7 +475,14 @@ template<typename _Tp> class Rect_ template<typename _Tp2> operator...
Did you try `explicit` for conversion operator instead? (to avoid unexpected conversions) (since C++11: https://en.cppreference.com/w/cpp/language/cast_operator )
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/types.hpp **Change Type:** modified **Context:** PR #26022: imgproc: use double to determine whether the corners points are within src **Review Line:** 475 **Code Changes:** ```diff @@ -475,7 +475,14 @@ template<typename _Tp> class Rect_ template<typename _Tp2> operator...
>Did you try explicit for conversion operator instead? (to avoid unexpected conversions) I think it is not easy, because `cv::Point` and `cv::Rect` is used for drawing functions in `imgproc`, so there are many side-effetcs not only OpenCV library but also user-applications. (I would like to do that if possible...) Foll...
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_color.cpp **Change Type:** modified **Context:** PR #25981: imgproc: add specific error code when cvtColor is used on an image with an invalid number of channels **Code Changes:** ```diff @@ -3203,4 +3203,20 @@ TEST(ImgProc_RGB2Lab, NaN_21111) #endif } +// See https://github.com...
> Chennels typo
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/imgproc/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25932: Added xxxApprox overloads for YUV color conversions in HAL and AlgorithmHint to cvtColor **Review Line:** 466 **Code Changes:** ```diff + @param scn source image channels (3 or 4) + @param swapBlue if set to true B ...
why 'Approx' is in the function name? Why not pass algorithm hint as a parameter?
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/imgproc/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25932: Added xxxApprox overloads for YUV color conversions in HAL and AlgorithmHint to cvtColor **Review Line:** 466 **Code Changes:** ```diff + @param scn source image channels (3 or 4) + @param swapBlue if set to true B ...
The existing API is already used in 3rd party HAL like Carotene, KleidiCV and some other. So we need to in introduce new API anyway. The solution just follows current HAL design.
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 #25832: Add support for QNX **Code Changes:** ```diff @@ -767,7 +767,7 @@ if(UNIX OR MINGW) elseif(EMSCRIPTEN) # no need to link to system libs with emscripten elseif(QNXNTO) - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m) + ...
It doesn't look correct. Why do we need that?
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/OpenCVFindLibsGrfmt.cmake **Change Type:** modified **Context:** PR #25832: Add support for QNX **Review Line:** 30 **Code Changes:** ```diff endif() - find_package(ZLIB "${MIN_VER_ZLIB}") + if(QNX) + set(ZLIB_FOUND TRUE) + set(ZLIB_LIBRARY z) + set(ZLIB_LIBRARIES z) + else() + find_p...
Why different names?
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/OpenCVInstallLayout.cmake **Change Type:** modified **Context:** PR #25832: Add support for QNX **Code Changes:** ```diff @@ -56,6 +56,24 @@ elseif(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) ocv_update(OPENCV_JNI_INSTALL_PATH "java${_jni_suffix}") ocv_update(OPENCV_JNI_BIN_INSTAL...
> OPENCV_VERSION_PLAIN and > opencv4 below. It makes sense to avoid such mess.
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/OpenCVUtils.cmake **Change Type:** modified **Context:** PR #25832: Add support for QNX **Review Line:** 315 **Code Changes:** ```diff else() - include_directories(AFTER SYSTEM "${dir}") + if(${CMAKE_SYSTEM_NAME} MATCHES QNX) + include_directories(AFTER "${dir}") + else() + ...
What is the problem? message? If there is no SYSTEM headers support then it should be disabled on CMake level.
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/utils/filesystem.private.hpp **Change Type:** modified **Context:** PR #25832: Add support for QNX **Code Changes:** ```diff @@ -13,7 +13,7 @@ /* not supported */ # elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \ defined __FreeBSD__ || d...
Keep the first free lines of the license header unchanged. Put this after 3 lines.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/ts/src/ts.cpp **Change Type:** modified **Context:** PR #25832: Add support for QNX **Code Changes:** ```diff @@ -1035,7 +1035,8 @@ static std::string findData(const std::string& relative_path, bool required, boo } } #ifdef OPENCV_TEST_DATA_INSTALL_PATH - datapath = path_join("./", ...
It is a validation of input parameters. No sense to make them conditional.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/ts/src/ts.cpp **Change Type:** modified **Context:** PR #25832: Add support for QNX **Code Changes:** ```diff @@ -1035,7 +1035,8 @@ static std::string findData(const std::string& relative_path, bool required, boo } } #ifdef OPENCV_TEST_DATA_INSTALL_PATH - datapath = path_join("./", ...
Looks like a bug for all platforms.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVUtils.cmake **Change Type:** modified **Context:** PR #25832: Add support for QNX **Review Line:** 315 **Code Changes:** ```diff else() - include_directories(AFTER SYSTEM "${dir}") + if(${CMAKE_SYSTEM_NAME} MATCHES QNX) + include_directories(AFTER "${dir}") + else() + ...
```console cd /home/chachoi/chachoi-world/qnx-ports/opencv/nto-aarch64-le/build/modules/imgcodecs && /home/chachoi/qnx800/host/linux/x86_64/usr/bin/qcc -lang-c++ -DCVAPI_EXPORTS -DHAVE_IMGCODEC_HDR -DHAVE_IMGCODEC_PFM -DHAVE_IMGCODEC_PXM -DHAVE_IMGCODEC_SUNRASTER -DHAVE_WEBP -DOPJ_STATIC -D_USE_MATH_DEFINES -D__OPENCV_...
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 #25832: Add support for QNX **Code Changes:** ```diff @@ -767,7 +767,7 @@ if(UNIX OR MINGW) elseif(EMSCRIPTEN) # no need to link to system libs with emscripten elseif(QNXNTO) - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m) + ...
https://github.com/opencv/opencv/blob/4.10.0/CMakeLists.txt#L534
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 #25832: Add support for QNX **Code Changes:** ```diff @@ -767,7 +767,7 @@ if(UNIX OR MINGW) elseif(EMSCRIPTEN) # no need to link to system libs with emscripten elseif(QNXNTO) - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m) + ...
without `${}`
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 #25832: Add support for QNX **Code Changes:** ```diff @@ -767,7 +767,7 @@ if(UNIX OR MINGW) elseif(EMSCRIPTEN) # no need to link to system libs with emscripten elseif(QNXNTO) - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m) + ...
Problem is still here.
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/OpenCVFindLibsGrfmt.cmake **Change Type:** modified **Context:** PR #25832: Add support for QNX **Review Line:** 30 **Code Changes:** ```diff endif() - find_package(ZLIB "${MIN_VER_ZLIB}") + if(QNX) + set(ZLIB_FOUND TRUE) + set(ZLIB_LIBRARY z) + set(ZLIB_LIBRARIES z) + else() + find_p...
Problem is still here.
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/OpenCVFindLibsGrfmt.cmake **Change Type:** modified **Context:** PR #25832: Add support for QNX **Review Line:** 30 **Code Changes:** ```diff endif() - find_package(ZLIB "${MIN_VER_ZLIB}") + if(QNX) + set(ZLIB_FOUND TRUE) + set(ZLIB_LIBRARY z) + set(ZLIB_LIBRARIES z) + else() + find_p...
There are 2 same cases below.
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 #25832: Add support for QNX **Code Changes:** ```diff @@ -767,7 +767,7 @@ if(UNIX OR MINGW) elseif(EMSCRIPTEN) # no need to link to system libs with emscripten elseif(QNXNTO) - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m) + ...
We don't need to introduce `QNX_PYTHON_INSTALL_PATH` (google doesn't know that anyway). Just specify `OPENCV_PYTHON_INSTALL_PATH` value to CMake thorugh command-line or via `cmake/OpenCVInstallLayout.cmake`
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/pyramids.cpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Code Changes:** ```diff @@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int } -#if defined(HAVE_IPP) -namespace cv -{ -static boo...
Need to describe the issue, or, better, create a ticket and add link here.
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/pyramids.cpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Code Changes:** ```diff @@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int } -#if defined(HAVE_IPP) -namespace cv -{ -static boo...
It's already disabled. modules/core/include/opencv2/core/private.hpp:198:#define IPP_DISABLE_PYRAMIDS_DOWN 1 // Different results
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/pyramids.cpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Code Changes:** ```diff @@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int } -#if defined(HAVE_IPP) -namespace cv -{ -static boo...
Opened an issue: #25976 Since there's no corresponding functions in ippicv, I propose to remove this implementation. It's easier to write it from scratch than fixing this code that looks like it's in a middle of refactoring.
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/pyramids.cpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Code Changes:** ```diff @@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int } -#if defined(HAVE_IPP) -namespace cv -{ -static boo...
submat check should be used too.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/pyramids.cpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Code Changes:** ```diff @@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int } -#if defined(HAVE_IPP) -namespace cv -{ -static boo...
Please remove the comment too. It's not relevant any more.
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/pyramids.cpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Code Changes:** ```diff @@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int } -#if defined(HAVE_IPP) -namespace cv -{ -static boo...
Scope of this variable could be reduced.
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/imgproc/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Review Line:** 1070 **Code Changes:** ```diff + @param margin_top Top margins for source image + @param margin_right Right margins for source image + @param margin_bottom B...
What is our plan to enable such feature in all filters. Starting with the name - shall we use _roi in the name? And pass the whole image size and roi inside? How to make it python-compatible? (Numpy does not have a notion of roi)
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/imgproc/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Review Line:** 1070 **Code Changes:** ```diff + @param margin_top Top margins for source image + @param margin_right Right margins for source image + @param margin_bottom B...
1. It's already done in current HAL API for filters. 2. Python and Numpy is not related here. Unfortunately we do not have solution for it.
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25970: pyrDown: offset HAL added, IPP removed **Review Line:** 1070 **Code Changes:** ```diff + @param margin_top Top margins for source image + @param margin_right Right margins for source image + @param margin_bottom B...
* Numpy supports array slicing (though I am not sure if the slices can be passed outside of the Python) * Taking the ROI from source image then applying filter should produce the same result as doing it vice versa (i.e. applying filter then taking the ROI of the result). We can recommend Python users to stick to the se...
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 #25519: Improved classification sample **Code Changes:** ```diff @@ -8,206 +8,256 @@ #include "common.hpp" -std::string param_keys = - "{ help h | | Print help message. }" - "{ @alias | | An alias name of ...
some compilers complain about `while (true) {...}`. Use `for (;;) {...}` instead
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 #25519: Improved classification sample **Code Changes:** ```diff @@ -8,206 +8,256 @@ #include "common.hpp" -std::string param_keys = - "{ help h | | Print help message. }" - "{ @alias | | An alias name of ...
why use `cv::` if we already put `using namespace cv;` in the beginning of the sample. Normally, in OpenCV samples we don't use `cv::` to make the code cleaner.
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 #25519: Improved classification sample **Code Changes:** ```diff @@ -8,206 +8,256 @@ #include "common.hpp" -std::string param_keys = - "{ help h | | Print help message. }" - "{ @alias | | An alias name of ...
can you modify the sample to use text names for backend and target instead of numbers? e.g. ``` classification -backend openvino -target opencl_fp16 -input lena.jpg ``` I would put the functions that convert names to id's into common.h
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/models.yml **Change Type:** modified **Context:** PR #25519: Improved classification sample **Code Changes:** ```diff @@ -207,34 +207,46 @@ faster_rcnn_tf: # Image classification models. ################################################################################ -# SqueezeNet v1.1 from h...
why don't we use the model with the latest opset? https://github.com/onnx/models/raw/69c5d3751dda5349fd3fc53f525395d180420c07/vision/classification/inception_and_googlenet/googlenet/model/googlenet-8.onnx
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 #25519: Improved classification sample **Code Changes:** ```diff @@ -8,206 +8,256 @@ #include "common.hpp" -std::string param_keys = - "{ help h | | Print help message. }" - "{ @alias | | An alias name of ...
It's wrong line.
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 #25519: Improved classification sample **Code Changes:** ```diff @@ -8,206 +8,256 @@ #include "common.hpp" -std::string param_keys = - "{ help h | | Print help message. }" - "{ @alias | | An alias name of ...
It may be network stream. I propose always use VideoCapture. It supports sequence of images too.
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:** samples/dnn/common.hpp **Change Type:** modified **Context:** PR #25519: Improved classification sample **Code Changes:** ```diff @@ -1,5 +1,5 @@ #include <opencv2/core/utils/filesystem.hpp> - +#include<iostream> using namespace cv; std::string genArgument(const std::string& argName, const std::string& ...
Why not OpenCV constants?
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 #25519: Improved classification sample **Code Changes:** ```diff @@ -8,206 +8,256 @@ #include "common.hpp" -std::string param_keys = - "{ help h | | Print help message. }" - "{ @alias | | An alias name of ...
We have imagelist approach is some samples. I propose to use it here too. See https://github.com/opencv/opencv/blob/d1b643a05a70a21355f4a9d3761de58f4d690b7b/samples/cpp/calibration.cpp#L301 for example. File format is described in the sample header.
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/calibinit.cpp **Change Type:** modified **Context:** PR #25991: Improve corners matching in ChessBoardDetector::NeighborsFinder::findCornerNeighbor **Code Changes:** ```diff @@ -222,7 +222,7 @@ class ChessBoardDetector int all_quads_count; struct NeighborsFinder { - con...
`i` is bad name here. Please use something meaningful.
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/calib3d/include/opencv2/calib3d.hpp **Change Type:** modified **Context:** PR #25943: Added fisheye::distortPoints with non-identity projection matrix **Review Line:** 3841 **Code Changes:** ```diff Note that the function assumes the camera intrinsic matrix of the undistorted points to be identi...
here K is Knew, but it's called just "K". In the overloaded function below "K" is old K, and there is separate "Knew". I think, it's a bit confusing.
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/fisheye.cpp **Change Type:** modified **Context:** PR #25943: Added fisheye::distortPoints with non-identity projection matrix **Review Line:** 331 **Code Changes:** ```diff + cv::Mat normalized(undistorted.size(), CV_64FC2); + + Mat Knew = Kundistorted.getMat(); + + double cx, c...
we have special function that helps to process vector of points in different formats, called checkVector(). I don't see it here.
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/fisheye.cpp **Change Type:** modified **Context:** PR #25943: Added fisheye::distortPoints with non-identity projection matrix **Code Changes:** ```diff @@ -315,6 +315,48 @@ void cv::fisheye::distortPoints(InputArray undistorted, OutputArray distorted, I } } +void cv::fisheye::dis...
why use Matx33f, especially after .getMat()? Why not use Mat and `.at<float>(i,j)` below?
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/fisheye.cpp **Change Type:** modified **Context:** PR #25943: Added fisheye::distortPoints with non-identity projection matrix **Review Line:** 349 **Code Changes:** ```diff + } + + size_t n = undistorted.total(); + const Vec2f* Xf = undistorted.ptr<Vec2f>(); + const Vec2d* Xd...
isn't double precision too heavy here? Shall we use the same data type as input points? Maybe we could add a helper function to do this `{(x-cx)/fx, (y-cy)/fy}` normalization?
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/calib3d/include/opencv2/calib3d.hpp **Change Type:** modified **Context:** PR #25943: Added fisheye::distortPoints with non-identity projection matrix **Review Line:** 3841 **Code Changes:** ```diff Note that the function assumes the camera intrinsic matrix of the undistorted points to be identi...
Renamed the parameter and added reference.
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/fisheye.cpp **Change Type:** modified **Context:** PR #25943: Added fisheye::distortPoints with non-identity projection matrix **Review Line:** 331 **Code Changes:** ```diff + cv::Mat normalized(undistorted.size(), CV_64FC2); + + Mat Knew = Kundistorted.getMat(); + + double cx, c...
It's camera matrix 3x3, not vector. Reworked code a bit.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ndsrvp/src/integral.cpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -3,6 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "ndsrvp_hal.hpp" +#include "opencv2/imgproc/hal/interface.h" +#...
What is `opencv2/core.hpp` for? By design HAL should not use anything from the main library except for `*/hal/interface.h` headers.
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/imgwarp.cpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -2268,16 +2268,7 @@ class WarpAffineInvoker : short *XY = __XY.data(), *A = __A.data(); const int AB_BITS = MAX(10, (int)INTER_BITS); ...
Please extract the whole block to some `cv::hal::` function. Define it here: https://github.com/opencv/opencv/blob/4.x/modules/imgproc/include/opencv2/imgproc/hal/hal.hpp Implementation can reside somewhere in this file (imgwarp.cpp). This new function should first try external HAL function (using [CALL_HAL](https://gi...
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/integral.cpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -3,6 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "ndsrvp_hal.hpp" +#include "opencv2/imgproc/hal/interface.h" +#...
Inclusion of `opencv2/core.hpp` has been removed. Related functions are moved to `cvutils.hpp` and `cvutils.cpp`.
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/imgwarp.cpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -2268,16 +2268,7 @@ class WarpAffineInvoker : short *XY = __XY.data(), *A = __A.data(); const int AB_BITS = MAX(10, (int)INTER_BITS); ...
4 new functions have been extracted. Further accuracy checks might be needed for other related platforms(AVX2, LASX, etc.).
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ndsrvp/include/imgproc.hpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -1,18 +1,12 @@ // 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 would be better to add missing constants to the `imgproc/hal/interface.h` and use them in HAL.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ndsrvp/src/remap.cpp **Change Type:** added **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -0,0 +1,188 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this...
Why not just std::vector or even std::array? It's safe in terms of memory leaks.
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/imgproc/include/opencv2/imgproc/hal/hal.hpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Review Line:** 123 **Code Changes:** ```diff const double M[9], int interpolation, int borderType, const double borderValue[4]); ...
Do we really need public functions for it?
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/include/opencv2/imgproc/hal/hal.hpp **Change Type:** modified **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Review Line:** 123 **Code Changes:** ```diff const double M[9], int interpolation, int borderType, const double borderValue[4]); ...
We might want to test them separately or use in other modules (contrib or custom). I think we can leave them public for consistency with other`cv::hal::` functions.
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/remap.cpp **Change Type:** added **Context:** PR #25786: 3rdparty: NDSRVP - Part 1.5: New Interfaces **Code Changes:** ```diff @@ -0,0 +1,188 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this...
Sure. `fastMalloc` has been changed to `std::array` now.
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/nary_eltwise_layers.cpp **Change Type:** modified **Context:** PR #25630: dnn: parallelize nary elementwise forward implementation & enable related conformance tests **Code Changes:** ```diff @@ -44,13 +44,11 @@ class NaryEltwiseHelper CV_FINAL std::vector<int> all_ndims; std...
> `nstripes = getNumThreads();` This should not be used. Already discussed several months ago - e.g. #23047
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/nary_eltwise_layers.cpp **Change Type:** modified **Context:** PR #25630: dnn: parallelize nary elementwise forward implementation & enable related conformance tests **Code Changes:** ```diff @@ -44,13 +44,11 @@ class NaryEltwiseHelper CV_FINAL std::vector<int> all_ndims; std...
Changed. Performance results are also updated.
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_allocator.cpp **Change Type:** added **Context:** PR #25979: Set and check allocator pointer for all cv::Mat instances **Review Line:** 141 **Code Changes:** ```diff + size_t expect_allocated = 16*16*sizeof(uchar) + 32*32*sizeof(uchar); + EXPECT_EQ(expect_allocated, DummyAllocato...
Test fails in case of using of `--gtest_repeat` flag.
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.cpp **Change Type:** modified **Context:** PR #25979: Set and check allocator pointer for all cv::Mat instances **Review Line:** 701 **Code Changes:** ```diff a = a0; try { u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored *...
`umatrix.cpp` has the similar code related to Mat (besides of tons of code related to UMat): https://github.com/opencv/opencv/blob/4.10.0/modules/core/src/umatrix.cpp#L601
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.cpp **Change Type:** modified **Context:** PR #25979: Set and check allocator pointer for all cv::Mat instances **Review Line:** 701 **Code Changes:** ```diff a = a0; try { u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored *...
UMat handles allocators a bit different. I propose to handle it with dedicated PR. Need to discuss it first.
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/onnx/onnx_importer.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Code Changes:** ```diff @@ -3239,6 +3239,17 @@ void ONNXImporter::parseQuantDequant(LayerParams& layerParams, const opencv_onnx // or 1-D tensor (per-channel quantized). ...
Attributes in a node_proto is parsed already (populateNet() -> handleNode() -> [getLayerParams()](https://github.com/opencv/opencv/blob/f1aef892bfe7b30255050275fdb80d2ec108a9a4/modules/dnn/src/onnx/onnx_importer.cpp#L505)) and is not necessary to do it manually if you are not making any modification to the value.
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_onnx_conformance.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Code Changes:** ```diff @@ -224,6 +224,7 @@ static const TestCase testConformanceConfig[] = { {"test_depthtospace_example", 1, 1}, {"test_dequantizelinear", 3, 1...
The official model has 3 inputs, so it should be `3`. Please do not modify the model and just take it from the official onnx repo. --- You can modify onnx importer to take scale & zp as inputs if they cannot be found in constants. Then you need to modify the forward pass in the implemenetation as well.
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_conformance.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Code Changes:** ```diff @@ -224,6 +224,7 @@ static const TestCase testConformanceConfig[] = { {"test_depthtospace_example", 1, 1}, {"test_dequantizelinear", 3, 1...
Done and updated the PR description as well as the test cases!
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 115 **Code Changes:** ```diff + mat.create(subTargetShape.size(), subTargetShape.data(), CV_32FC1); + + copyVecToMat(mat,data); + + broadcas...
I propose to drop `template` as we are operating a `CV_32FC1` Mat either way. --- If you want to keep template, you will need to distinguish between types and use `char` along with elementwise to do the correct copy.
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/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...
zero point is optional for both quantize linear and dequantize linear.
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/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...
Scale and zero point are just needed to be broadcast once. After that, they should not be processed again.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_onnx_conformance_layer_parser_denylist.inl.hpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Code Changes:** ```diff @@ -89,8 +89,6 @@ "test_convtranspose_pad", "test_convtranspose_pads", "test_convtranspose_with_kernel", -"test_dequan...
drop the comment if not needed
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_onnx_conformance_layer_parser_denylist.inl.hpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Code Changes:** ```diff @@ -89,8 +89,6 @@ "test_convtranspose_pad", "test_convtranspose_pads", "test_convtranspose_with_kernel", -"test_dequan...
drop the comment if not needed
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/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 code block inside `if(inputs.size() > 1)` is executed only when scale and zero point are provided as inputs to the layer. In this case, the `broadcastScaleAndZeropoint` function in the `finalize` method is not called because the necessary data (scale and zero point) was not available at the time of the layer's crea...
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 115 **Code Changes:** ```diff + mat.create(subTargetShape.size(), subTargetShape.data(), CV_32FC1); + + copyVecToMat(mat,data); + + broadcas...
I decided to use `template` because `std::vector<T>& data` can be either `vector<float>` in the case of scale or `vector<int>` in the case of zero point. When copying the data into the matrix the vector is indexed and then cast to float. Does it make sense?
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 115 **Code Changes:** ```diff + mat.create(subTargetShape.size(), subTargetShape.data(), CV_32FC1); + + copyVecToMat(mat,data); + + broadcas...
> then cast to float No, this is wrong assumption. ```cpp mat.create(subTargetShape.size(), subTargetShape.data(), CV_32FC1); ``` If you want to use template, you should create mat from the correct type.
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/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...
Use `CV_Check(inputs.size(), inputs.size() >= 1 && inputs.size() <= 3, "your error message")` instead
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/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...
Use `CV_CheckXX` instead.
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
`CV_CheckXX`
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/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...
But the next inference still gets scale and zero point from inputs. The point is we avoid this from the second time.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**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...
Can we avoid creating a new Mat here? Repeating is like reusing a piece of memory multiple times. We can rewrite the forward implementation with a loop, each time it proceeds with a correct step. So we can save time and memory from creating new Mat. --- Also if this is implemented in the end, could you put the core fun...
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/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...
This can be done later when we need to fuse qdq.
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 277 **Code Changes:** ```diff if (is1D) { Mat inputTmp; divide(inputs[0], scalesMat, inputTmp); - ...
The change looks strange. Please add test for the case.
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/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...
please add brief description what the flag means.
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/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...
There is cv::Mat::copyTo, if you really need a copy.
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/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...
Why do you need a copy here? Also you can push std::vector<> as input to function with InputArray. It's handled automatically.
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 15 **Code Changes:** ```diff @@ -15,7 +15,10 @@ namespace dnn static void broadcast1D2TargetMat(Mat& data, const MatShape& targetShape, int axis) {...
You can use InputArray for data and get rid of copy before the call.
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 277 **Code Changes:** ```diff if (is1D) { Mat inputTmp; divide(inputs[0], scalesMat, inputTmp); - ...
The quantization formula was changed to adhere to the [onnx quantization standard](https://github.com/onnx/onnx/blob/main/docs/Operators.md#QuantizeLinear). The test cases introduced in PR opencv/opencv_extra#1181 verify the correctness of the quantization operation
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/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...
destination is OutputArray. You can pass vector there too.
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 277 **Code Changes:** ```diff if (is1D) { Mat inputTmp; divide(inputs[0], scalesMat, inputTmp); - ...
> The change looks strange. Please add test for the case. We got conformance tests working ok already. See https://github.com/opencv/opencv/actions/runs/10096457129/job/27931214005?pr=25644#step:19:5202 for example, ``` [ RUN ] Test_ONNX_conformance.Layer_Test/test_quantizelinear_OCV_CPU, where GetParam() = (test_quant...
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/int8layers/quantization_utils.cpp **Change Type:** modified **Context:** PR #25644: [GSoC] dnn: Blockwise quantization support **Review Line:** 15 **Code Changes:** ```diff @@ -15,7 +15,10 @@ namespace dnn static void broadcast1D2TargetMat(Mat& data, const MatShape& targetShape, int axis) {...
In this case, I do need a copy. The input `std::vector` must be copied into the matrices `scalesMat` and `zeropointsMat` that will be used to compute the quantization in the `forward` function.
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/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...
`const MatShape&`
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/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_offs...
It works if dst_mat is continuous. Please add at least CV_Assert before the loop.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**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) ); //...
I believe stream will be closed automatically in its destructor.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**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) ); //...
Done. Unified the macro.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**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_sqr...
Please add comment and/or reference, where you got -36.73f