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/objdetect/test/test_charucodetection.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -12,15 +12,19 @@ namespace opencv_test { namespace {
* @brief Get a synthetic image of Chessboard in perspective
*/
static Mat projectChessboard(... | I was more thinking of just explicitly listing the values to be iterated over: ```diff -for(double distance = 0.2; distance <= 0.3; distance += 0.1) { +for(double distance : {0.2, 0.3}) { ``` |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/test/test_charucodetection.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -12,15 +12,19 @@ namespace opencv_test { namespace {
* @brief Get a synthetic image of Chessboard in perspective
*/
static Mat projectChessboard(... | I created a separate PR for this: https://github.com/opencv/opencv/pull/23271. I think listing the values `0.2` and `0.3` explicitly is more straightforward than using a temporary value (`int i`), at least for these small `for` loops. The other PR is only in draft because this PR here needs to be merged first, or there... |
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/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Review Line:** 146
**Code Changes:**
```diff
@@ -146,6 +146,18 @@ class CV_EXPORTS_W_SIMPLE CharucoBoard : public Board {
CV_WRAP CharucoBoard(const Size& size, ... | I'm interest as well to understand when this pul request will be close? |
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/size_layer.cpp
**Change Type:** added
**Context:** PR #27656: Added Size layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,70 @@
+// 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 d... | Why not just `Mat::total()*Mat::channels()`? |
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/size_layer.cpp
**Change Type:** added
**Context:** PR #27656: Added Size layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,70 @@
+// 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 d... | That's incorrect for ND cv::Mat. Use `total`: https://github.com/opencv/opencv/blob/649dc297cb6949ad324aa5fcac67dc0456915802/modules/dnn/include/opencv2/dnn/shape_utils.hpp#L155 |
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/det_layer.cpp
**Change Type:** added
**Context:** PR #27658: Added Determinant (Det) layer to new DNN engine
**Review Line:** 7
**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://o... | please, add the link to onnx.ai (description of Det) and specify which opset's are supported |
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/det_layer.cpp
**Change Type:** added
**Context:** PR #27658: Added Determinant (Det) layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,143 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | remove all cv::. We are already inside cv namespace |
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/det_layer.cpp
**Change Type:** added
**Context:** PR #27658: Added Determinant (Det) layer to new DNN engine
**Review Line:** 123
**Code Changes:**
```diff
+ } else {
+ A.convertTo(temp, CV_32F);
+ det = determinant(temp);
+ ... | add support for bfloat and hfloat: 1) declare temporary `Mat temp;` outside of `for (int bi = r.start ...)` loop. 2) replace double det = cv::determinant(A); with ``` double det; if (type == CV_32F || type == CV_64F) { det = determinant(A); } else { A.convertTo(temp, CV_32F); det = determinant(temp); } ``` 3) add 2 mor... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*
+ * 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 ... | There is no need of explicitly adding findFile 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/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Review Line:** 12
**Code Changes:**
```diff
+ * @file alpha_matting.cpp
+ * @brief MODNet Alpha Matting using OpenCV DNN
+ *
+ * This sample demonstrates human portrait alpha matting usin... | Add link to original github implementation |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*
+ * 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 ... | Move the composting in processImage function. Return only resized alpha_mask |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Review Line:** 11
**Code Changes:**
```diff
+
+MODNet Alpha Matting with OpenCV DNN
+
+This sample demonstrates human portrait alpha matting using MODNet model.
+MODNet is a trimap-free po... | Add github url to original implementation 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:** samples/dnn/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | define the function out of apply_modnet |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | Move the overlay and imshow functions into main. apply_modnet should return alpha_mask and composite |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | move composting to apply_modnet function, just return alpha_mask |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Review Line:** 12
**Code Changes:**
```diff
+ * @file alpha_matting.cpp
+ * @brief MODNet Alpha Matting using OpenCV DNN
+ *
+ * This sample demonstrates human portrait alpha matting usin... | Added original GitHub link. |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Review Line:** 11
**Code Changes:**
```diff
+
+MODNet Alpha Matting with OpenCV DNN
+
+This sample demonstrates human portrait alpha matting using MODNet model.
+MODNet is a trimap-free po... | Added original GitHub link. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*
+ * 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 ... | Moved compositing to `processImage`; now returning only resized `alpha_mask`. |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | Moved `draw_label` outside `apply_modnet`. |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | Moved overlay and imshow to `main`; `apply_modnet` now returns `alpha_mask` and `composite`. |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | Moved compositing to `apply_modnet`; now returning only `alpha_mask`. |
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/models.yml
**Change Type:** modified
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Review Line:** 523
**Code Changes:**
```diff
+ mean: [0.0, 0.0, 0.0]
+ scale: 0.00784313725
+ width: 512
+ height: 512
+ rgb: true
+ sample: "alpha_matting"
``` | Could you add link to the original repo with the model, rather than own fork? If it's not possible, please extend your repo with: - Link to the original model and/or paper. - Command line / pre-requsites to export ONNX - License information and credits. |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | I wound say, it should be inside of `apply_modnet` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*
+ * 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 ... | There is no such step in Python version. Why do you need 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/alpha_matting.cpp
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*
+ * 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 ... | It was intended as an extra normalization, but since the Python version doesn't perform this step and it's not essential, I’ve removed it for consistency. |
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/alpha_matting.py
**Change Type:** added
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Code Changes:**
```diff
@@ -0,0 +1,177 @@
+"""
+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 distri... | Moved inside of `apply_modnet`. |
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #27593: Add Alpha matting samples (C++ and Python)
**Review Line:** 523
**Code Changes:**
```diff
+ mean: [0.0, 0.0, 0.0]
+ scale: 0.00784313725
+ width: 512
+ height: 512
+ rgb: true
+ sample: "alpha_matting"
``` | Since the original repository does not provide an ONNX model, I have extended my repository based on the referenced comment. https://github.com/HarxSan/Modnet/blob/main/README.md |
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/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -104,8 +104,24 @@ inline int hal_ni_FAST_NMS(const uchar* src_data, size_t src_step, uchar* dst_da
*/
inline int hal_ni_FAST(const uchar... | It's dangerous replacement. HAL uses C style API without std::vector on purpose. HAL may be a binary built with own STL. It means that std::vector on HAL side and OpenCV side may be different with different memory layout. |
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/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -104,8 +104,24 @@ inline int hal_ni_FAST_NMS(const uchar* src_data, size_t src_step, uchar* dst_da
*/
inline int hal_ni_FAST(const uchar... | Indeed. But I haven't figured out a way to modify the member `size` in `std::vector<cv::KeyPoint>& keypoints` by simply reinterpreting `keypoints.data()` to `uchar*`. The original `CALL_HAL`, causes wrong keypoint count in accuracy test since it compares the member `size` of the output `std::vector<cv::KeyPoint>`. Is t... |
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:** hal/riscv-rvv/include/features2d.hpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Review Line:** 14
**Code Changes:**
```diff
+
+namespace cv { namespace rvv_hal { namespace features2d {
+
+#if CV_HAL_RVV_1P0_ENABLED
+
+int FAST(const uchar* src_data, size... | Newline before this line 13. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/riscv-rvv/src/features2d/fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,256 @@
+#include "rvv_hal.hpp"
+#include "common.hpp"
+#include <cfloat>
+
+namespace cv { namespace rvv_hal { namespace features2d {
+
+s... | Drop this line and the multiple empty lines after that. |
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/riscv-rvv/src/features2d/fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,256 @@
+#include "rvv_hal.hpp"
+#include "common.hpp"
+#include <cfloat>
+
+namespace cv { namespace rvv_hal { namespace features2d {
+
+s... | Drop comments 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/features2d/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | Comments are not aligned. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | Second line is not aligned. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | Newline before end of file |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/riscv-rvv/src/features2d/fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,256 @@
+#include "rvv_hal.hpp"
+#include "common.hpp"
+#include <cfloat>
+
+namespace cv { namespace rvv_hal { namespace features2d {
+
+s... | I suspect that you can also use `std::vector` as buffer container just like carotene does. |
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/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -104,8 +104,24 @@ inline int hal_ni_FAST_NMS(const uchar* src_data, size_t src_step, uchar* dst_da
*/
inline int hal_ni_FAST(const uchar... | A simple solution is that you can extract the macro of calling HAL, manually call HAL function and do a resize on the vector before returning. E.g. ```.diff diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index a9615da5bd..b00b80818d 100644 --- a/modules/features2d/src/fast.cpp +++ b/modu... |
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:** hal/riscv-rvv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -17,7 +17,8 @@ endif()
target_include_directories(${HAL_LIB_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/modules/core/include
- ... | hal/riscv-rvv/CMakeLists.txt:20: trailing whitespace. + ${CMAKE_SOURCE_DIR}/modules/imgproc/include |
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/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | There are warnings: ``` /home/ci/opencv/modules/features2d/perf/perf_fast.cpp: In member function 'virtual void opencv_test::Fast_Params_detect::PerfTestBody()': /home/ci/opencv/modules/features2d/perf/perf_fast.cpp:24:9: warning: declaration of 'threshold' shadows a global declaration [-Wshadow] 24 | int threshold = g... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/features2d/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | Warnings: Warning: /home/ci/opencv/modules/features2d/perf/perf_fast.cpp:34:11: warning: unused variable 't1' [-Wunused-variable] Warning: /home/ci/opencv/modules/features2d/perf/perf_fast.cpp:38:11: warning: unused variable 't2' [-Wunused-variable] |
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/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | Drop this since `TEST_CYCLE` already does the job. |
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/features2d/perf/perf_fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+#include "perf_precomp.hpp"
+#include "perf_feature2d.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
+typedef tuple<int,... | If you do not plan to update data for sanity check, drop the comment. |
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/fast.cpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -435,11 +435,23 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
cv::Mat img = _img.getMat();
CALL_HAL(f... | Why they are changed? |
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/fast.cpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -435,11 +435,23 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
cv::Mat img = _img.getMat();
CALL_HAL(f... | The first `resize(10000)` is used for initial memory allocation. Otherwise if this is not done, `resize(keypoints_count)` after `CALL_HAL` may cause unexpected outcome in the vector |
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/fast.cpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -435,11 +435,23 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
cv::Mat img = _img.getMat();
CALL_HAL(f... | I mean you don't have to change keypoints and keypoints_count and it is still calling resize before entering hal, right? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/riscv-rvv/src/features2d/fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,256 @@
+#include "rvv_hal.hpp"
+#include "common.hpp"
+#include <cfloat>
+
+namespace cv { namespace rvv_hal { namespace features2d {
+
+s... | Memset is redundant if patternSize == 16. I propose to move to `default` branch. |
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/fast.cpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -435,11 +435,23 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
cv::Mat img = _img.getMat();
CALL_HAL(f... | you don't need extra variable. Use the following code instead: ``` KeyPoint* kps = (KeyPoint*)malloc(sizeof(kps[0]) * keypoints_count); int hal_ret = cv_hal_FAST(img.data, img.step, img.cols, img.rows, (void**)&kps, &keypoints_count, threshold, nonmax_suppression, type, realloc); if (hal_ret == CV_HAL_ERROR_OK) { keypo... |
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/features2d/src/hal_replacement.hpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -104,8 +104,24 @@ inline int hal_ni_FAST_NMS(const uchar* src_data, size_t src_step, uchar* dst_da
*/
inline int hal_ni_FAST(const uchar... | We usually presume backward compatibility in HAL. I propose to presume the original API and add new entrypoint with realloc, e.g. `hal_ni_FAST_withRealloc`. On caller side you need to try the new one, then the old one and then default impl. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/riscv-rvv/src/features2d/fast.cpp
**Change Type:** added
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Code Changes:**
```diff
@@ -0,0 +1,256 @@
+#include "rvv_hal.hpp"
+#include "common.hpp"
+#include <cfloat>
+
+namespace cv { namespace rvv_hal { namespace features2d {
+
+s... | CI node has 128x2-bit width of register, so max number of uint16_t elements in a lane is 16. 25 is just wrong. |
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/fast.cpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Review Line:** 438
**Code Changes:**
```diff
@@ -435,11 +435,23 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
cv::Mat img = _img.getM... | Need to revert back for HAL version 1. |
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/fast.cpp
**Change Type:** modified
**Context:** PR #27391: hal/riscv-rvv: implement FAST keypoint detection
**Review Line:** 438
**Code Changes:**
```diff
@@ -435,11 +435,23 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
cv::Mat img = _img.getM... | HAL v2 is called first. when calling HAL v1, it is set back to 10k at line 449. |
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/trilu_layer.cpp
**Change Type:** modified
**Context:** PR #27655: Added proper type handling for TRILU layer
**Review Line:** 56
**Code Changes:**
```diff
- auto *cur_dst = dst + ((w * h) * i + (w * l + cmin));
+ size_t offset = (static_cas... | just wondering if it will be a good idea to assert `elemSize` is positive or check in `if (cmin < w && num_zeros > 0 && elemSize > 0)` . Please feel free to ignore if it is not applicable |
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_obsensor_liborbbec.cpp
**Change Type:** modified
**Context:** PR #27610: Added timestamps support for Orbbec SDK backend in VideoIO.
**Code Changes:**
```diff
@@ -83,7 +83,31 @@ double VideoCapture_obsensor::getProperty(int propIdx) const
case CAP_PROP_OBSENSOR_INTRINSIC_CY:
... | These should be in the `switch` statement. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/test/test_png.cpp
**Change Type:** modified
**Context:** PR #27598: Fixed build with libpng older than 1.5.x and reduced test memory consumption
**Code Changes:**
```diff
@@ -19,7 +19,9 @@ TEST(Imgcodecs_Png, write_big)
EXPECT_EQ(13917, img.rows);
vector<uchar> buff;
- ASSERT... | `ASSERT_NO_THROW(status = imencode(".png", img, buff, { IMWRITE_PNG_ZLIBBUFFER_SIZE, 1024*1024 }));` enough for creating the same sized buffer. |
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/connectedcomponents.cpp
**Change Type:** modified
**Context:** PR #27582: Take into account overflow for connected components
**Code Changes:**
```diff
@@ -261,13 +261,24 @@ namespace cv{
template<typename LabelT>
inline static
- void flattenL(LabelT *P, const int start, co... | You can use `CV_CheckLE` instead of new function everywhere: https://docs.opencv.org/4.x/d1/d26/check_8hpp.html#a7b8e786a57dcee88dc0cae752adab921 |
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/connectedcomponents.cpp
**Change Type:** modified
**Context:** PR #27582: Take into account overflow for connected components
**Code Changes:**
```diff
@@ -261,13 +261,24 @@ namespace cv{
template<typename LabelT>
inline static
- void flattenL(LabelT *P, const int start, co... | I agree that it is better to use `CV_CheckLT` in the implementation of the new function (done). But I would prefer to use the new function everywhere instead of its implementation - it is shorter, clearer (the name of the function serves as a fairly clear comment) and if we, for example, want to change the error messag... |
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/distransform.cpp
**Change Type:** modified
**Context:** PR #27432: Correct IPP distanceTransform results with single thread
**Code Changes:**
```diff
@@ -796,6 +796,22 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
ippFree( pBuffer... | I recommend you to add comment with link to the original bug and couple of words why the loop is needed. The reason of "clipping" is not obvious. |
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/distransform.cpp
**Change Type:** modified
**Context:** PR #27432: Correct IPP distanceTransform results with single thread
**Code Changes:**
```diff
@@ -796,6 +796,22 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
ippFree( pBuffer... | Sure, added the comment |
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 #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -1569,6 +1569,29 @@ TEST(Core_InputOutput, FileStorage_json_null_object)
fs.release();
}
+TEST(Core_InputOutput, FileSt... | Not clear for me. `"\"\\\"\":1,"` has a key `"\"` so equivalent in json is `{ "\"\\\"": 1}` |
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 #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -1569,6 +1569,29 @@ TEST(Core_InputOutput, FileStorage_json_null_object)
fs.release();
}
+TEST(Core_InputOutput, FileSt... | The C++ string version is slightly different since back slash is eliminated in the preprocessing stage during compiling. So to get the equivalent version in C++ from JSON text, we need to - prefix each back slash in key with a back slash, - prefix each quote in key with a back slash, - use double quote to contain the s... |
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 #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -1569,6 +1569,29 @@ TEST(Core_InputOutput, FileStorage_json_null_object)
fs.release();
}
+TEST(Core_InputOutput, FileSt... | I mean the comment above should be actual to be copied to .json file and give the same test results. However in this example: ```json { "\"": 1, "\\": 59, "Ġ\"": 366, "\\\\": 6852 } ``` ```python import json f = open("file.json", "rt"); print(json.load(f).keys()) # dict_keys(['"', '\\', 'Ġ"', '\\\\']) ``` Probably comm... |
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 #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -1569,6 +1569,29 @@ TEST(Core_InputOutput, FileStorage_json_null_object)
fs.release();
}
+TEST(Core_InputOutput, FileSt... | Do you mean the last key `"\\\\"` is not aligned? --- I don't get where is not the same test results? The `test` string translates to `{"\"":1,"\\":59,"Ġ\"":366,"\\\\":6852}` listed in the comment after compiling. |
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 #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -1569,6 +1569,29 @@ TEST(Core_InputOutput, FileStorage_json_null_object)
fs.release();
}
+TEST(Core_InputOutput, FileSt... | I got your point here. Looks like we need to actually eliminate back slash from the string before creating the node with this string as key. |
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/persistence_json.cpp
**Change Type:** modified
**Context:** PR #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -419,18 +419,27 @@ class JSONParser : public FileStorageParser
CV_PARSE_ERROR_CPP( "Key must start with \'... | please remove debug print |
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/persistence_json.cpp
**Change Type:** modified
**Context:** PR #27587: core: support parsing back slash `\` in `parseKey` in FileStorage (JSON)
**Code Changes:**
```diff
@@ -419,18 +419,27 @@ class JSONParser : public FileStorageParser
CV_PARSE_ERROR_CPP( "Key must start with \'... | let's remove if not used |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/ipp/src/warp_ipp.cpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Code Changes:**
```diff
@@ -0,0 +1,367 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// ... | ```suggestion {{1, 0}, {1, 0}, {0, 0}, {1, 0}}, //32F ``` |
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:** hal/ipp/include/ipp_hal_imgproc.hpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Code Changes:**
```diff
@@ -0,0 +1,27 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level dire... | ```suggestion int dst_height, const double M[9], int interpolation, int borderType, const double borderValue[4]); ``` |
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:** hal/ipp/include/ipp_hal_imgproc.hpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Code Changes:**
```diff
@@ -0,0 +1,27 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level dire... | The change shall be applied to avoid warning in Android build |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/ipp/src/warp_ipp.cpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Code Changes:**
```diff
@@ -0,0 +1,367 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// ... | I propose to use `CV_DEPTH_MAX` instead of 7. OpenCV 5.x supports more types. The table will be just extended with zeros. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** hal/ipp/src/warp_ipp.cpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Code Changes:**
```diff
@@ -0,0 +1,367 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// ... | I propose to use CV_DEPTH_MAX instead of 7. OpenCV 5.x supports more types. The table will be just extended with zeros. |
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:** hal/ipp/include/ipp_hal_imgproc.hpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Review Line:** 5
**Code Changes:**
```diff
@@ -0,0 +1,27 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in... | Please add copyright header here and in all new files. |
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:** hal/ipp/include/ipp_hal_imgproc.hpp
**Change Type:** added
**Context:** PR #27324: Moved IPP impl of warpAffine and warpPerspective to HAL
**Review Line:** 5
**Code Changes:**
```diff
@@ -0,0 +1,27 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in... | Copyrights were added. |
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/dnn/include/opencv2/dnn/all_layers.hpp
**Change Type:** modified
**Context:** PR #27508: IfLayer add to new DNN engine
**Code Changes:**
```diff
@@ -585,6 +585,18 @@ CV__DNN_INLINE_NS_BEGIN
static Ptr<RequantizeLayer> create(const LayerParams ¶ms);
};
+ // Forward declaration f... | IfLayer should override Layer::subgraphs() method. `then_else()` method is not needed, please, remove it. |
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/net_impl2.cpp
**Change Type:** modified
**Context:** PR #27508: IfLayer add to new DNN engine
**Code Changes:**
```diff
@@ -253,7 +253,6 @@ Arg Net::Impl::newArg(const std::string& name, ArgKind kind, bool allowEmptyName
return Arg(idx);
}
-
int Net::Impl::findDim(const std::string& ... | not sure why you disabled this check |
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/net_impl2.cpp
**Change Type:** modified
**Context:** PR #27508: IfLayer add to new DNN engine
**Review Line:** 682
**Code Changes:**
```diff
+ layer->finalize(inpMats, outMats);
+ layer->forward(inpMats, outMats, tempMats);
+ }
+ else {
+ Ptr... | I suggest to have check for empty subgraphs first. ``` std::vector<Ptr<Graph>>* subgraphs = layer->subgraphs(); if (!subgraphs) { // main branch, true for 99.9% of layers if (finalizeLayers) layer->finalize(inpMats, outMats); layer->forward(inpMats, outMats, tempMats); } else { Ptr<IfLayer> iflayer = layer.dynamicCast<... |
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_layer_parser_denylist.inl.hpp
**Change Type:** modified
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -394,9 +394,6 @@
"test_tfidfvectorizer_tf_uniandbigrams_skip5", // Issue:: Parser: Can't create layer... | What about remaining top_k 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/dnn/test/test_onnx_conformance_layer_parser_denylist.inl.hpp
**Change Type:** modified
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -394,9 +394,6 @@
"test_tfidfvectorizer_tf_uniandbigrams_skip5", // Issue:: Parser: Can't create layer... | Removed from deny list, they're working fine |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Review Line:** 7
**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution an... | please, add description similar to other new layers, e.g. https://github.com/opencv/opencv/blob/5.x/modules/dnn/src/layers/expand2_layer.cpp: 1) link to the description. 2) which opset's are supported. |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | I suggest to avoid using addOffset() and minusOffset(). Construct ComparatorGreater/ComparatorLess inside the inner loop, this is super-cheap operation, and pass the proper data there. |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | I believe, it's wrong. In the case of dynamic TopK "K" parameter should be taken from the tensor itself, not shape of the tensor. |
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/layers/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | you don't need std::stable_sort, because you take into account index order inside the comparator class. And you don't need std::sort, because you don't need completely sorted array. Use std::partial_sort. Also, sorting is done on array that is not continuous in memory. Please, copy elements to a temporary vector (make ... |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | this is very suspicious place. Subsequent offset values inside loop form arithmetic progression (for fixed b). You add this offset to data inside cmp.addOffset(), so data addresses form geometric progression. It's wrong, they should form arithmetic progression as well. That's why I suggest you to remove addOffset and m... |
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/layers/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | 1) add CV_16BF branch as well 2) sorting hfloat's on x86 and sorting bfloat's on any platform will be slow because there is no support in hardware for scalar arithmetics on such types. Add yet another parameter, WT (work type) to the template method, set it to the type itself for all types except for hfloat and bfloat.... |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | I suggest you to construct `ComparatorGreater<T>` or `ComparatorLess<T>` (actually, it should be WT instead of T, see the comment below) inside FindTopK(), depending on the `largest` flag. This way you reduce the amount of code with basically no loss in efficiency, you will have just one switch |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | modify it to take 2 `std::pair<>` and don't use indirect access to data: ``` template <typename T, typename VT> class ComparatorLess { using value_type = std::pair<T, VT> bool operator() (const value_type& a, const value_type& b) const { return (a.second < b.second || (a.second == b.second && a.first < b.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/layers/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | simply pass cmp 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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | no need to pass data pointer into the constructor anymore |
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/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | it should be `std::pair<uint32_t, WT>` 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/layers/topk2_layer.cpp
**Change Type:** added
**Context:** PR #27547: Added TopK layer with dynamic K support for new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,218 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-lev... | cast T => WT: `sortbuf[u].second = WT(inPtr[offset + u * inner]);` |
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_png.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -218,16 +218,14 @@ bool PngDecoder::InitPngPtr() {
return false;
m_info_ptr = png_create_info_struct(m_png_ptr);
- m... | Please remove XMP from todo. It's added by the PR. |
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/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -218,16 +218,14 @@ bool PngDecoder::InitPngPtr() {
return false;
m_info_ptr = png_create_info_struct(m_png_ptr);
- m... | The idea of zero separator should be documented somewhere. It's not obvious from OpenCV API how to use the key-value approach. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -9,7 +9,142 @@
namespace opencv_test { namespace {
-/**
+ static Mat makeCirclesImage(Size size, int type, int nbits)
+ {
+... | Are there images with Text and XML in PNG test suite? It'll be great to test not only with self-generated files/ |
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/imgcodecs/include/opencv2/imgcodecs.hpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -253,11 +253,13 @@ enum ImwriteGIFCompressionFlags {
enum ImageMetadataType
{
- IMAGE_METADATA_UNKNOWN = -1,
- IM... | AVIF is not mentioned. |
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_base.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Review Line:** 60
**Code Changes:**
```diff
@@ -56,6 +56,8 @@ BaseImageDecoder::BaseImageDecoder()
m_scale_denom = 1;
m_use_rgb = false;
m_frame_c... | ``` enum ImageMetadataType { IMAGE_METADATA_UNKNOWN = -1, // Unrecognized IMAGE_METADATA_EXIF = 0, IMAGE_METADATA_XMP = 1, IMAGE_METADATA_ICCP = 2, IMAGE_METADATA_TEXT = 3, IMAGE_METADATA_MAX = 3 // Highest legal index (NOT a count) }; ``` // Allocate metadata storage std::vector<std::vector<uchar>> m_metadata(IMAGE_ME... |
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/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -9,7 +9,142 @@
namespace opencv_test { namespace {
-/**
+ static Mat makeCirclesImage(Size size, int type, int nbits)
+ {
+... | Could you add some comment how you got/generated the bytes array? |
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/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -9,7 +9,142 @@
namespace opencv_test { namespace {
-/**
+ static Mat makeCirclesImage(Size size, int type, int nbits)
+ {
+... | it is generated by chatGPT. let me add a comment later. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Review Line:** 59
**Code Changes:**
```diff
+ '<','/','x',':','x','m','p','m','e','t','a','>',0
+ };
+ }
+
+ // Returns a Minimal ICC pro... | Why do you use different ICCP metadata generators for WEBP and PNG? I would expect it's the same for different formats, is not 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/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Review Line:** 59
**Code Changes:**
```diff
+ '<','/','x',':','x','m','p','m','e','t','a','>',0
+ };
+ }
+
+ // Returns a Minimal ICC pro... | No different data was intended; it was just temporary test data and has been fixed in the latest commit. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27503: [GSOC 2025] PNG&WebP Metadata Reading Writing Improvements
**Code Changes:**
```diff
@@ -9,7 +9,142 @@
namespace opencv_test { namespace {
-/**
+ static Mat makeCirclesImage(Size size, int type, int nbits)
+ {
+... | There is `Imgcodecs_WebP, ReadWriteWithExifXmpIccp`. I propose to remove ad-hoc cases here. Also I propose to extent the test parameters list and add orientation check for webp too. Most probably you have to add an image to opencv_extra. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/test/test_exif.cpp
**Change Type:** modified
**Context:** PR #27583: Jpeg Metadata (iccp and xmp)
**Review Line:** 570
**Code Changes:**
```diff
EXPECT_EQ(exif.type(), CV_8U);
EXPECT_EQ(exif.total(), exif_size);
ASSERT_GE(exif_size, 26u); // minimal exif should take at least ... | The macro was added for some old versions of PNG without exif support. I propose to restore it back. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.