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/dnn/src/layers/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | It's enough to specify 16-22 |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | let's: 1. put a loop inside parallel_for to handle a range of rows: ``` int nstripes = Hout*C*N; parallel_for_(Range(0, nstripes), [&](const Range& range) { for (int row = range.start; row < range.end; row++) { int n = row/(Hout*C); int c = (row - n*Hout*C)/Hout; int y = row % Hout; if (type == CV_8U && interpolation =... |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | Make normToPix branchless to facilitate auto vectorization: ``` static inline void normToPix(float nx, float ny, int W, int H, bool align_corners, float& x, float& y) { float delta = float(align_corners); x = ((nx + 1.f)*(W - delta) + (delta - 1.f))*0.5f; y = ((ny + 1.f)*(H - delta) + (delta - 1.f))*0.5f; } ``` basical... |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | this code with nested lambda functions is not going to be fast. Please, rewrite this code without lambda functions that are called inside the innermost loop. Don't use `fetch()` blindly, 'cause it's very slow. Check that the whole 2x2 fetched neighborhood of the pixel is inside the image, in this case simply convert to... |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | use more correct `saturate_cast<int>(x);` |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | Please, optimize it. Don't use loops here to compute coefficients. In OpenCV we have optimized bicubic intepolation in `cv::resize()`, take the code from there: https://github.com/opencv/opencv/blob/6d889ee74c94124f6492eb8f0d50946d9c31d8e9/modules/imgproc/src/resize.cpp#L964. Make sure that both variants produce the sa... |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | compute the sumwx and sumwy analytically. |
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/gridsample_layer.cpp
**Change Type:** added
**Context:** PR #27700: Added gridsample layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,328 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
... | don't use loops to do cubic interpolation |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #27755: Optimize FFmpeg VideoCapture with swscale threads option
**Code Changes:**
```diff
@@ -607,6 +607,7 @@ struct CvCapture_FFMPEG
int hw_device;
int use_opencl;
int extraDataIdx;
+ int requestedThreads;
... | OpenCV initializes threading for encoder in the following way: ``` if (!enc->thread_count) { int nCpus = cv::getNumberOfCPUs(); int requestedThreads = std::min(nCpus, 16); // [OPENCV:FFMPEG:24] Application has requested XX threads. Using a thread count greater than 16 is not recommended. std::string threads_option = ut... |
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/bitshift_layer.cpp
**Change Type:** added
**Context:** PR #27666: Added bitshift layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,137 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// ... | no need to cast to U — shiftVal is already of U 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/layers/bitshift_layer.cpp
**Change Type:** added
**Context:** PR #27666: Added bitshift layer to new DNN engine
**Review Line:** 13
**Code Changes:**
```diff
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
+// ONNX reference: BitShift operator
+// Spec: https://onnx.ai/onnx/operato... | please, put a note here that broadcasting is not fully supported, only the same shapes (`array shift array`) or `array shift scalar` |
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/bitshift_layer.cpp
**Change Type:** added
**Context:** PR #27666: Added bitshift layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,137 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// ... | extra conversion into a temporary array is too big overhead for such a simple operation. Please, rewrite it to avoid the use of temporary array. |
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/bitshift_layer.cpp
**Change Type:** added
**Context:** PR #27666: Added bitshift layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,137 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// ... | check that inputs[1] == inputs[0] or inputs[1] has 0 dimensions. |
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/bitshift_layer.cpp
**Change Type:** added
**Context:** PR #27666: Added bitshift layer to new DNN engine
**Review Line:** 90
**Code Changes:**
```diff
+ void getTypes(const std::vector<MatType>& in, const int reqOut, const int reqInt,
+ std::vector<MatType>& out, st... | according to ONNX specification, there must be `in[1] == in[0]`. Please, check it. |
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/core/misc/java/gen_dict.json
**Change Type:** modified
**Context:** PR #27567: Enable Java wrapper generation for Vec4i
**Code Changes:**
```diff
@@ -648,6 +648,31 @@
"jni_var": "Vec3d %(n)s(%(n)s_val0, %(n)s_val1, %(n)s_val2)",
"suffix": "DDD"
},
+ "Vec4i": ... | I propose to presume `.val` here and below for compatibility with existing code. |
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:** doc/opencv.bib
**Change Type:** modified
**Context:** PR #27730: doc: fix doxygen warnings for imgcodecs, flann and objdetect
**Review Line:** 1440
**Code Changes:**
```diff
@@ -1431,14 +1431,6 @@ @article{Viola04
publisher = {Kluwer Academic Publishers},
url = {https://www.face-rec.org/algorithms/Boos... | Can you add the url field in the other bibtex file? |
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/OpenCVDetectCUDAUtils.cmake
**Change Type:** modified
**Context:** PR #27537: Refactor Blackwell - In CUDA 13: - 10.0 is b100/b200 same for aarch64 (gb200) - 10.3 is GB300 - 11.0 is Thor with new OpenRm driver (moves ...
**Code Changes:**
```diff
@@ -109,7 +109,7 @@ macro(ocv_initialize_nvidia_device_g... | Hm.. each option here is yet another kernel build. Longer build and fatter binary. I would say, that we do not need all possible combinations, if the target is defined by the arch name. "12.0;12.1" most probably should be just 12.1. The same for 10.x variations, if pure 10.0 devices do not exist and 10.3 is minimal pro... |
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback. | **File:** cmake/OpenCVDetectCUDAUtils.cmake
**Change Type:** modified
**Context:** PR #27537: Refactor Blackwell - In CUDA 13: - 10.0 is b100/b200 same for aarch64 (gb200) - 10.3 is GB300 - 11.0 is Thor with new OpenRm driver (moves ...
**Code Changes:**
```diff
@@ -109,7 +109,7 @@ macro(ocv_initialize_nvidia_device_g... | Hello, In CUDA 13 10.0 is b100/b200 same for aarch64 (gb200) 10.3 is GB300 11.0 is Thor with new OpenRm driver (moves to SBSA) 12.0 is RTX/RTX PRO 12.1 is Spark GB10 feel free to change it or recommend me the most optimized codegen there |
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/OpenCVDetectCUDAUtils.cmake
**Change Type:** modified
**Context:** PR #27537: Refactor Blackwell - In CUDA 13: - 10.0 is b100/b200 same for aarch64 (gb200) - 10.3 is GB300 - 11.0 is Thor with new OpenRm driver (moves ...
**Code Changes:**
```diff
@@ -109,7 +109,7 @@ macro(ocv_initialize_nvidia_device_g... | Orin is moving to sbsa (deletes old nvgpu) in Q1 2026. I don’t if it will mantain the same codegen |
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/OpenCVDetectCUDAUtils.cmake
**Change Type:** modified
**Context:** PR #27537: Refactor Blackwell - In CUDA 13: - 10.0 is b100/b200 same for aarch64 (gb200) - 10.3 is GB300 - 11.0 is Thor with new OpenRm driver (moves ...
**Code Changes:**
```diff
@@ -109,7 +109,7 @@ macro(ocv_initialize_nvidia_device_g... | There is new option that is putting f 10.0f and takes optimizarion for all blackwell family |
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/OpenCVDetectCUDAUtils.cmake
**Change Type:** modified
**Context:** PR #27537: Refactor Blackwell - In CUDA 13: - 10.0 is b100/b200 same for aarch64 (gb200) - 10.3 is GB300 - 11.0 is Thor with new OpenRm driver (moves ...
**Code Changes:**
```diff
@@ -109,7 +109,7 @@ macro(ocv_initialize_nvidia_device_g... | Separator needs to be a `;` not a `,` in `...;10.3,11.0;...` for the compute capability autodetection to work. |
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/OpenCVDetectCUDAUtils.cmake
**Change Type:** modified
**Context:** PR #27537: Refactor Blackwell - In CUDA 13: - 10.0 is b100/b200 same for aarch64 (gb200) - 10.3 is GB300 - 11.0 is Thor with new OpenRm driver (moves ...
**Code Changes:**
```diff
@@ -109,7 +109,7 @@ macro(ocv_initialize_nvidia_device_g... | Yeah, good catch. Done! |
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/cuda_info.cpp
**Change Type:** modified
**Context:** PR #27636: cuda 13.0 compatibility
**Code Changes:**
```diff
@@ -424,7 +424,9 @@ int cv::cuda::DeviceInfo::clockRate() const
#ifndef HAVE_CUDA
throw_no_cuda();
#else
- return deviceProps().get(device_id_)->clockRate;
+ int clo... | > modules\core\src\cuda_info.cpp(951): error C2039: 'clockRate': is not a member of 'cudaDeviceProp' |
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/cuda_info.cpp
**Change Type:** modified
**Context:** PR #27636: cuda 13.0 compatibility
**Code Changes:**
```diff
@@ -424,7 +424,9 @@ int cv::cuda::DeviceInfo::clockRate() const
#ifndef HAVE_CUDA
throw_no_cuda();
#else
- return deviceProps().get(device_id_)->clockRate;
+ int clo... | `maxTexture1DLinear` has been depreciated not `maxTexture1D` See > opencv\modules\core\src\cuda_info.cpp(566): error C2039: 'maxTexture1DLinear': is not a member of 'cudaDeviceProp' |
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/src/grfmt_bmp.cpp
**Change Type:** modified
**Context:** PR #27559: imgcodecs: bmp: support to write 32bpp BMP with BI_BITFIELDS
**Code Changes:**
```diff
@@ -42,6 +42,7 @@
#include "precomp.hpp"
#include "grfmt_bmp.hpp"
+#include "opencv2/core/utils/logger.hpp"
namespace cv
{
@@ -6... | According to the documentation (32-bit section of the table): > The bitmap has a maximum of 2^32 colors. If the bV5Compression member of the BITMAPV5HEADER is BI_RGB, the bmiColors member of [BITMAPINFO](https://learn.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-bitmapinfo) is NULL. Each DWORD in the bitmap... |
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/src/grfmt_bmp.cpp
**Change Type:** modified
**Context:** PR #27559: imgcodecs: bmp: support to write 32bpp BMP with BI_BITFIELDS
**Code Changes:**
```diff
@@ -42,6 +42,7 @@
#include "precomp.hpp"
#include "grfmt_bmp.hpp"
+#include "opencv2/core/utils/logger.hpp"
namespace cv
{
@@ -6... | In case if BI_RGB format is set in header it's not RGBX, it's RGB according to the documentation. Need to understand how the user generated it. |
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_bmp.cpp
**Change Type:** modified
**Context:** PR #27559: imgcodecs: bmp: support to write 32bpp BMP with BI_BITFIELDS
**Code Changes:**
```diff
@@ -42,6 +42,7 @@
#include "precomp.hpp"
#include "grfmt_bmp.hpp"
+#include "opencv2/core/utils/logger.hpp"
namespace cv
{
@@ -6... | OK, I revert to support reading. With ffmpeg , Windows Bitmap files saved in AV_PIX_FMT_BGRA format seems not able to read after this fix. - BITMAPINFOHEADER - biBitCount = 32 - biCompression = BI_RGB - BGRA data is stored. https://github.com/FFmpeg/FFmpeg/blob/2fffa01ddb777871cd53ef6c92f5c19cae8afe16/libavcodec/bmpenc... |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #27691: FFmpeg 8.0 support.
**Review Line:** 690
**Code Changes:**
```diff
if( video_st )
{
#ifdef CV_FFMPEG_CODECPAR
+// avcodec_close removed in FFmpeg release 8.0
+# if (LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(62, ... | avcodec_free_context in the `#else`? |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #27691: FFmpeg 8.0 support.
**Review Line:** 690
**Code Changes:**
```diff
if( video_st )
{
#ifdef CV_FFMPEG_CODECPAR
+// avcodec_close removed in FFmpeg release 8.0
+# if (LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(62, ... | I think it should be `avcodec_free_context(&context);` for any version |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #27691: FFmpeg 8.0 support.
**Review Line:** 690
**Code Changes:**
```diff
if( video_st )
{
#ifdef CV_FFMPEG_CODECPAR
+// avcodec_close removed in FFmpeg release 8.0
+# if (LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(62, ... | There is avcodec_free_context at line 699. Is not it enough? |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #27691: FFmpeg 8.0 support.
**Review Line:** 2020
**Code Changes:**
```diff
+ AVPacketSideData* sd = video_st->codecpar->coded_side_data;
+ int nb_sd = video_st->codecpar->nb_coded_side_data;
+ if (sd && nb_sd > 0)
+ ... | This segfaults if `av_packet_side_data_get` returns NULL. Which is does if there is no side data present. See https://ffmpeg.org/doxygen/8.0/group__lavc__packet__side__data.html#ga61a3a0fba92a308208c8ab957472d23c. This showed up in `videoio_encapsulate.write/7` of `opencv_test_videoio`. |
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/python/multiview_calibration.py
**Change Type:** modified
**Context:** PR #27651: fix empty intrinsics handling and minor calibration improvements
**Code Changes:**
```diff
@@ -18,9 +18,10 @@
import numpy as np
import yaml
import math
+import warnings
def insideImageMask(pts, w, h):
- return... | I propose to print a message that the same K and distortion is applied for all cameras. |
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 #27710: Added Pow layer to new DNN engine
**Review Line:** 792
**Code Changes:**
```diff
}
- int type_for_dispatch = op == OPERATION::WHERE ? outputs.front().type() : inputs.front().type();
- typ... | why Pow does not use the broadcasting mechanism of all other binary operations (such as SUB or DIV)? |
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/is_inf_layer.cpp
**Change Type:** added
**Context:** PR #27660: Added IsInf 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://opencv.org... | please, put the link to description of the operation at onnx.ai and also specify, which opsets 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/is_inf_layer.cpp
**Change Type:** added
**Context:** PR #27660: Added IsInf layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,122 @@
+// 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 th... | I would split this into different loops: ``` if (detectPositive && detectNegative) { for (...) ... // just check for cvIsInf() } else if (detectPositive) { for (...) ... // cvIsInf(v) && v > 0 } else if (detectNegative) { for (...) ... // cvIsInf(v) && v < 0 } else { // report error? } ``` |
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/is_inf_layer.cpp
**Change Type:** added
**Context:** PR #27660: Added IsInf layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,122 @@
+// 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 th... | it would be nice to make this loop parallel just to eliminate possible bottlenecks when everything else in the model graph is parallel |
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/is_inf_layer.cpp
**Change Type:** added
**Context:** PR #27660: Added IsInf layer to new DNN engine
**Review Line:** 112
**Code Changes:**
```diff
+ const size_t total = X.total();
+ uchar* dst = Y.ptr<uchar>();
+
+ switch (depth) {
+ case CV_32F: comput... | bfloat and hfloat should be supported as well. 1) Add optional WT=T parameter to computeIsInfMask. 2) Change `T v = src[i];` to `WT v = WT(src[i]);`. 3) use WT=float for hfloat and bfloat |
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/cpu_kernels/convolution.cpp
**Change Type:** renamed
**Context:** PR #23192: DNN: Refactor the fast conv structure
**Code Changes:**
```diff
@@ -10,11 +10,19 @@
*/
#include "../../precomp.hpp"
-#include "fast_convolution.hpp"
-#include "fast_convolution.simd.hpp"
+#include "convolu... | Calling NEON code through `opt_NEON::` requires the support of complete NEON dispatch. Using the `cpu_baseline` namespace is a temporary solution. |
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/cpu_kernels/convolution.cpp
**Change Type:** renamed
**Context:** PR #23192: DNN: Refactor the fast conv structure
**Code Changes:**
```diff
@@ -10,11 +10,19 @@
*/
#include "../../precomp.hpp"
-#include "fast_convolution.hpp"
-#include "fast_convolution.simd.hpp"
+#include "convolu... | AFAIK, NEON could be enabled as a baseline only. Dispatching of NEON is not supported due to issues with ABI. Ref: https://developer.arm.com/documentation/den0018/a/Compiling-NEON-Instructions/GCC-command-line-options/Option-to-enable-use-of-NEON-and-floating-point-instructions --- > convBlock_NEON in general we should... |
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/cpu_kernels/convolution.cpp
**Change Type:** renamed
**Context:** PR #23192: DNN: Refactor the fast conv structure
**Code Changes:**
```diff
@@ -10,11 +10,19 @@
*/
#include "../../precomp.hpp"
-#include "fast_convolution.hpp"
-#include "fast_convolution.simd.hpp"
+#include "convolu... | How about leaving the NEON code in a separated file with `neon.hpp` suffix and `opt_NEON` 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/cpu_kernels/convolution.cpp
**Change Type:** renamed
**Context:** PR #23192: DNN: Refactor the fast conv structure
**Code Changes:**
```diff
@@ -10,11 +10,19 @@
*/
#include "../../precomp.hpp"
-#include "fast_convolution.hpp"
-#include "fast_convolution.simd.hpp"
+#include "convolu... | > separated file with `neon.hpp` suffix With `.neon.cpp` suffix. Take a look how it is done here: https://github.com/opencv/opencv/blob/4.7.0/modules/imgproc/src/resize.avx2.cpp |
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/src/layers/cpu_kernels/conv_block.simd.hpp
**Change Type:** added
**Context:** PR #23192: DNN: Refactor the fast conv structure
**Code Changes:**
```diff
@@ -0,0 +1,259 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level di... | Line 11 should do the same. Code from `conv_block.neon.cpp` should be moved here as there is "no difference" against AVX+ code above. |
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_spng.cpp
**Change Type:** modified
**Context:** PR #27621: Add strict validation for encoding parameters
**Code Changes:**
```diff
@@ -482,6 +482,7 @@ SPngEncoder::SPngEncoder()
m_support_metadata[IMAGE_METADATA_EXIF] = true;
m_support_metadata[IMAGE_METADATA_XMP] = true... | todo: replace from early return to break |
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 #27621: Add strict validation for encoding parameters
**Code Changes:**
```diff
@@ -913,6 +913,7 @@ PngEncoder::PngEncoder()
memset(palette, 0, sizeof(palette));
memset(trns, 0, sizeof(trns));
memset(op, 0, sizeof(op... | todo: replace from early return to break |
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 #27657: Added heuristic to allocate buffer for FAST features depending on input image resolution
**Code Changes:**
```diff
@@ -429,8 +429,10 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
{
CV... | there are a few typos: 1) resoption => resolution, 2) propably => probably. recommended comment: "Use a simple heuristic depending on the image resolution; can probably be reduced even further". also, sizeof(KeyPoint) is 28 bytes. If, say, image has a modest (by modern standards) resolution of 24Mpix, the buffer will h... |
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 #27592: Added image super-resolution samples using seemoredetails model
**Review Line:** 532
**Code Changes:**
```diff
+################################################################################
+
+seemoredetails:
+ load_info:
+ url: ... | 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/models.yml
**Change Type:** modified
**Context:** PR #27592: Added image super-resolution samples using seemoredetails model
**Review Line:** 532
**Code Changes:**
```diff
+################################################################################
+
+seemoredetails:
+ load_info:
+ url: ... | Addressed 👍 : [Github](https://github.com/Naresh-19/opencv-superres-models) |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | maybe we can avoid a special branch just for rank == 0 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/layers/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | hfloat/bfloat should be handled with custom implementations of isNonZero: they should just check for 0x0/0x8000 case (one function is enough for both hfloat and bfloat): ``` static inline isNonZeroF16(uint16_t val) { return (val&0x7fff) != 0; } ... X.type() == CV_16F || X.type() == CV_16BF ? isNonZeroF16(*X.ptr<uint16_... |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Review Line:** 169
**Code Changes:**
```diff
+
+ const int depth = CV_MAT_DEPTH(X.type());
+ std::vector<size_t> nzcounts;
+ std::vector<size_t> nzstart;
+ ... | put this into a template function with parallel loop inside. Compute number of non-zero elements for each stripe. After you computed number of non-zero elements in each stripe, compute cumsum: ``` constexpr int nstripes = 16; std::vector<size_t> nzcounts(nstripes, 0); std::vector<size_t> nzstart(nstripes+1, 0); paralle... |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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 function is too expensive. Replace it with a nested loop, say, 3D loop: outermost iteration will cover all dimensions but the last two, the pre-last dimension and then the innermost one. or at least 2D loop: all dimensions but the last one and the innermost dimension. |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | again, cover all types, not just a few selected types. Put implementation into a template 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/layers/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | pass nstripes as function parameter, to make sure that all stages of the algorithm use exactly the same number of stripes. |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | why do we have this complex nested loop? Can we have a simple loop where we check inside when the last coordinate reaches the maximum possible value and then we recompute ND index (from the raw index). We can put this check before emitting next ND index, and then we don't need the initialization loop before the main lo... |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | we don't need separate versions for CV_8U and CV_8S. we don't need separate versions for CV_16U and CV_16S. we don't need separate versions for CV_32U and CV_32S. we don't need separate versions for CV_64U and CV_64S. |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | can we retain only a single switch statement? All the memory allocation logic can be put into helper methods, that we will call from each branch of this 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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | use `std::array<int, CV_MAX_DIM>` |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | do something like this: ``` coord[rank-1] = lastDimSize - 1; for (;i < i1; i++) { if (++coord[rank-1] >= lastDimSize) { // recompute all coordinates (coord) from 'i' int idxLinear = i; for (int d = rank-1; d >= 0; d--) { coord[d] = idxLinear % shape[d]; idxLinear /= shape[d]; } } if (isNonZero(data[i])) { for (int d = ... |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Review Line:** 197
**Code Changes:**
```diff
+ MatShape outShape = shape(rank, (int)nnz);
+ auto kind = out_arr.kind();
+ std::vector<Mat>* out_mats = nullptr;
... | ``` std::vector<Mat>* out_mats = nullptr; std::vector<UMat>* out_umats = nullptr; Mat Y; if (kind == _InputArray::STD_VECTOR_MAT) { out_mats = &out_arr.getMatVecRef(); out_mats->resize(1); out_mats->at(0).fit(outShape, CV_64S); Y = out_mats->at(0); } else { CV_Assert(kind == _InputArray::STD_VECTOR_UMAT); out_umats = &... |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | `std::fill`? |
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/nonzero_layer.cpp
**Change Type:** added
**Context:** PR #27701: Added nonzero layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,243 @@
+// 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... | same thing, reduce the number of branches |
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/is_nan_layer.cpp
**Change Type:** added
**Context:** PR #27661: Added IsNan layer to new DNN engine
**Code Changes:**
```diff
@@ -0,0 +1,91 @@
+// 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 thi... | please, make this loop parallel |
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/is_nan_layer.cpp
**Change Type:** added
**Context:** PR #27661: Added IsNan layer to new DNN engine
**Review Line:** 80
**Code Changes:**
```diff
+ const int depth = CV_MAT_DEPTH(X.type());
+ const size_t total = X.total();
+ uchar* dst = Y.ptr<uchar>();
+
+ ... | hfloat and bfloat should be supported as well |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/perf/perf_decode_encode.cpp
**Change Type:** modified
**Context:** PR #27605: Performance tests for writing and reading animations
**Code Changes:**
```diff
@@ -7,10 +7,82 @@
namespace opencv_test
{
-#ifdef HAVE_PNG
-
using namespace perf;
+static Animation makeCirclesAnimation(Size ... | Img is local variable inside for loop body and re-created on each loop iteration. No need to call clone 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/imgcodecs/perf/perf_decode_encode.cpp
**Change Type:** modified
**Context:** PR #27605: Performance tests for writing and reading animations
**Code Changes:**
```diff
@@ -7,10 +7,82 @@
namespace opencv_test
{
-#ifdef HAVE_PNG
-
using namespace perf;
+static Animation makeCirclesAnimation(Size ... | As soon as it's perf test, I propose to exclude file i/o from scope and use in-memory encoding with imencodeanimation |
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/3d/include/opencv2/3d/mst.hpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -0,0 +1,65 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// o... | remove _DETAIL |
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/3d/include/opencv2/3d/mst.hpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -0,0 +1,65 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// o... | Please use doxygen notation for the documentation. |
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/3d/include/opencv2/3d/mst.hpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -0,0 +1,65 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// o... | The graph may have 2 or more isolated pieces. I propose the following: 1. return status, e.g. bool 2. add `CV_OUT std::vector<MSTEdge>&` parameter for result. Also the solution will be more friendly solution for Python and Java bindings. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/3d/src/mst.cpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Review Line:** 148
**Code Changes:**
```diff
+ resultingEdges.clear();
+ if (numNodes <= 0 || inputEdges.empty() || root < 0 || root >= numNodes)
+ return false;
+
+ bool result ... | Please use `CV_TRACE_FUNCTION();` as the first statement of exported function. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/3d/src/mst.cpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -0,0 +1,163 @@
+// 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 distrib... | It's definitely invalid user input. It should not be just ignored. We use CV_Assert / CV_Error and throw exception with it. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/3d/src/mst.cpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -0,0 +1,163 @@
+// 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 distrib... | It's the only place where false is returned, besides the obvious one. What happens if the MST cannot be built, e.g. the graph consists of 2 split sub-graphs? I would say, it should return false too. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/3d/src/rgbd/pose_graph.cpp
**Change Type:** modified
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -3,8 +3,9 @@
// of this distribution and at http://opencv.org/license.html
#include "../precomp.hpp"
-#include "sparse_block_matrix.hpp"
#include "... | Looks like some data specific parameter. I propose to add lambda parameter with default value 0.485 to `initializePosesWithMST` to have opportunity to change it without OpenCV modification and rebuild. The value may be promoted to the weight calculator as parameter 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/3d/test/test_mst.cpp
**Change Type:** added
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Review Line:** 271
**Code Changes:**
```diff
+ << "Prim's MST size incorrect for large graph: expected "
+ << (numNodes - 1) << " edges, got " << primMST.size() << ".";
+ ... | Please add a couple of tests with negative scenarios: - split graph of 2-3 sub-graphs - one isolated node in the graph |
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/3d/test/test_pose_graph.cpp
**Change Type:** modified
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -155,6 +155,119 @@ TEST(PoseGraph, sphereG2O)
}
}
+TEST(PoseGraphMST, optimization)
+{
+ applyTestTag(CV_TEST_TAG_LONG, CV_TEST_TAG_DEBUG_VE... | We have saveMesh / savePointCloud for obj and ply i/o. Please use it: https://docs.opencv.org/5.x/da/d35/group____3d.html#gad565f2878b3d8c3f959ae7967a520bb2 |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/3d/test/test_pose_graph.cpp
**Change Type:** modified
**Context:** PR #27423: Feat #25150: Pose Graph MST initialization
**Code Changes:**
```diff
@@ -155,6 +155,119 @@ TEST(PoseGraph, sphereG2O)
}
}
+TEST(PoseGraphMST, optimization)
+{
+ applyTestTag(CV_TEST_TAG_LONG, CV_TEST_TAG_DEBUG_VE... | Looks like this code is not needed any more, as you added implementation with `saveMesh` below. |
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/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 propose to not touch the constructor, but add `setLegacyFlag()` method. It's easier to remove legacy method in future than break compatibility for all code that uses Charuco. |
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 believe we should minimize or do not bring code with legacy/buggy behavior from `opencv_contrib` into the main repository (as we don't really want to support/maintain that). If `setLegacyFlag()` doesn't work, then I propose to create `CharucoBoardLegacy` or `cv::aruco::legacy::CharucoBoard` in `opencv_contrib/modules... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/aruco/aruco_board.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -229,7 +229,8 @@ struct GridBoardImpl : public Board::Impl {
Board::Impl(_dictionary),
size(_size),
markerLength(_markerLength),... | actually, this is the only important bit. Generating board images in the legacy format is nice for consistency with the flag, but not really desirable. Could we introduce a function that shuffles `impl->objPoints` from new to old layout? This would fix detection of existing boards which is the main issue here. |
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, ... | > Deciding otherwise will inevitably lead to systems version upgrades silently failing without an evident explanation. one way or another, mentioning this change in the release notes would have been nice.. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/aruco/aruco_board.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -229,7 +229,8 @@ struct GridBoardImpl : public Board::Impl {
Board::Impl(_dictionary),
size(_size),
markerLength(_markerLength),... | ```impl->objPoints``` is also used further down in the constructor in ```calcNearestMarkerCorners()```. So reshuffling also needs to include to clear whatever is going on there and execute it again. This is what I meant before with clearing and recreating the board again. Sure it's possible to do, but not really elegan... |
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 believe we should minimize or do not bring code with legacy/buggy behavior from `opencv_contrib` into the main repository (as we don't really want to support/maintain that). > > If `setLegacyFlag()` doesn't work, then I propose to create `CharucoBoardLegacy` or `cv::aruco::legacy::CharucoBoard` in `opencv_contrib/m... |
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/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, ... | The insistence on the black-box-first design is admittedly baffling. I've had a custom WBF aruco slide made for microscopy calibration with chrome deposition on glass that cost hundreds of dollars, and now I can't upgrade opencv beyond 4.5.5 without my calibration code breaking completely. |
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, ... | probably it makes sense to dub the BBF order (i.e. 4.6, 4.7 behavior) "legacy" and hence set the flag to false by default. I doubt that with that many WBF patterns in the wild and WBF effectively being the default from 4.8 on BBF will be anything but legacy. |
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, ... | Resolved: constructor is not being touched. Different board layouts are supported by `setBBF(bool)` method. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/aruco/aruco_board.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -229,7 +229,8 @@ struct GridBoardImpl : public Board::Impl {
Board::Impl(_dictionary),
size(_size),
markerLength(_markerLength),... | Added `setBBF()` method to switch between layouts without modifying the constructor. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/aruco/aruco_board.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -229,7 +229,8 @@ struct GridBoardImpl : public Board::Impl {
Board::Impl(_dictionary),
size(_size),
markerLength(_markerLength),... | Default value is not initialized in constructor (must be set to `false`). |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/aruco/aruco_board.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -229,7 +229,8 @@ struct GridBoardImpl : public Board::Impl {
Board::Impl(_dictionary),
size(_size),
markerLength(_markerLength),... | Default value is not initialized in constructor (must be set to `false`). |
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(... | Avoid `for loops` over parameters in test bodies. In case of failure there would be unclear message without information about used parameters. Also due to `for loops` it is hard to debug/reproduce the problem. It is better to add parameter and/or separate test case. |
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 see the point, and I suppose the point is equaly valid for the already existing `for loops` over `distance`/`yaw`/`pitch` to which I only extended a `BFF` loop. To get a real improvement here, all the `for loops` should be unraveled. I can try to make a proposal. But I must say the intention of the pull request is to... |
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(... | Resolved: I removed the for-loop over BBF by splitting the test case into black-box-first and white-box-first. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/aruco/aruco_board.cpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -229,7 +229,8 @@ struct GridBoardImpl : public Board::Impl {
Board::Impl(_dictionary),
size(_size),
markerLength(_markerLength),... | Name must be `legacyPattern`, value is `false` |
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
**Review Line:** 194
**Code Changes:**
```diff
void CV_CharucoPoseEstimation::run(int) {
int iter = 0;
Mat cameraMatrix = Mat::eye(3, 3, CV_64FC1);
- Size imgSize(... | Why are test parameters changed? |
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
**Review Line:** 201
**Code Changes:**
```diff
aruco::CharucoBoard board(Size(4, 4), 0.03f, 0.015f, aruco::getPredefinedDictionary(aruco::DICT_6X6_250));
+ board.setLegacy... | Why are test parameters changed? |
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
**Review Line:** 201
**Code Changes:**
```diff
aruco::CharucoBoard board(Size(4, 4), 0.03f, 0.015f, aruco::getPredefinedDictionary(aruco::DICT_6X6_250));
+ board.setLegacy... | > Why are test parameters changed? Test parameter change was required in `CV_CharucoPoseEstimation` because the aruco detection had trouble to detect the all aruco code in the low resolution test image at maximum angle. The pose estimation test fails if not all codes are properly detected. But the failure is not actual... |
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
**Review Line:** 194
**Code Changes:**
```diff
void CV_CharucoPoseEstimation::run(int) {
int iter = 0;
Mat cameraMatrix = Mat::eye(3, 3, CV_64FC1);
- Size imgSize(... | See answer below regarding focal length in the camera matrix. The artifically projected board was too small for all codes to be recognizable. |
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
**Review Line:** 201
**Code Changes:**
```diff
aruco::CharucoBoard board(Size(4, 4), 0.03f, 0.015f, aruco::getPredefinedDictionary(aruco::DICT_6X6_250));
+ board.setLegacy... | See attached some debug images of the test (required some additional code to create debug output). The aruco detection simply fails with the smaller original settings. Aruco id=1 is not recognized. My guess is due to the low resolution and the aliased artifical image, but I did not dig deeper as I understood this test ... |
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
**Review Line:** 201
**Code Changes:**
```diff
aruco::CharucoBoard board(Size(4, 4), 0.03f, 0.015f, aruco::getPredefinedDictionary(aruco::DICT_6X6_250));
+ board.setLegacy... | Here zoomed into both versions, old test settings vs. new test settings, showing the difference a bit more clearly.  |
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 do have a small patch ready and working for the three relevant loops in `test_charucodetection.cpp`. It also requires to increase the virtual image resolution for the distance in `CV_CharucoDiamondDetection` which is otherwise unaffected by this PR. Debug image output code would also be included (but disabled) in the... |
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/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** modified
**Context:** PR #23153: ChArUco pre460 pattern support
**Code Changes:**
```diff
@@ -146,6 +146,18 @@ class CV_EXPORTS_W_SIMPLE CharucoBoard : public Board {
CV_WRAP CharucoBoard(const Size& size, float squareLength, f... | Documentation/comments should be more clear now. I had the parameter change to `legacyParamter` per directions in the other comment, but I am happy to change it again to anything else like `chessboardPatternCompatibility` if this would be the accepted name? |
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, ... | Sorry, there is useful information for discussion here. Please don't mark as resolved for now. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.