instruction
stringclasses
9 values
input
stringlengths
279
5.47k
output
stringlengths
6
9.58k
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:** 3rdparty/hal_rvv/hal_rvv_1p0/integral.hpp **Change Type:** added **Context:** PR #27060: [hal_rvv] Add cv::integral implementation and more types of input for test **Code Changes:** ```diff @@ -0,0 +1,173 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file f...
Do not expose the `struct rvv` into `cv_hal_rvv` namespace, see https://github.com/opencv/opencv/pull/26865#discussion_r1977097854.
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:** 3rdparty/hal_rvv/hal_rvv_1p0/types.hpp **Change Type:** modified **Context:** PR #27060: [hal_rvv] Add cv::integral implementation and more types of input for test **Review Line:** 705 **Code Changes:** ```diff + template <size_t idx> \ + inline void ...
`vcreate` is not supported in clang 17. Use this instead. ```cpp vuint8m2_t v{}; v = __riscv_vset_v_u8m1_u8m2(v, 0, x); v = __riscv_vset_v_u8m1_u8m2(v, 1, y); ```
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:** 3rdparty/hal_rvv/hal_rvv_1p0/types.hpp **Change Type:** modified **Context:** PR #27060: [hal_rvv] Add cv::integral implementation and more types of input for test **Review Line:** 705 **Code Changes:** ```diff + template <size_t idx> \ + inline void ...
I prefer both. Note that `__riscv_vset` needs an immediate number for the second argument.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/libtiff/tif_hash_set.c **Change Type:** modified **Context:** PR #27343: build: fix more warnings from recent gcc versions after #27337 **Review Line:** 370 **Code Changes:** ```diff @@ -367,7 +367,7 @@ static bool TIFFHashSetRehash(TIFFHashSet *set) { int nNewAllocatedSize = anPrimes[set->nIn...
Upstream of libtiff has fixed this: https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tif_hash_set.c#L370
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/libtiff/tif_hash_set.c **Change Type:** modified **Context:** PR #27343: build: fix more warnings from recent gcc versions after #27337 **Review Line:** 149 **Code Changes:** ```diff @@ -146,7 +146,7 @@ TIFFHashSet *TIFFHashSetNew(TIFFHashSetHashFunc fnHashFunc, set->fnEqualFunc = fnEqualFunc ?...
Upstream of libtiff has fixed this: https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tif_hash_set.c#L149
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/legacy_backend.hpp **Change Type:** modified **Context:** PR #27307: TFLite fixes for Face Blendshapes V2 **Review Line:** 216 **Code Changes:** ```diff @@ -213,6 +213,7 @@ struct BlobManager { reuse(bestBlobPin, lp); dst = bestBlob.reshape(1, 1)...
Probably, make sense to move to a separate PR?
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #26109: Replace operators with wrapper functions on universal intrinsics backends **Code Changes:** ```diff @@ -717,44 +717,70 @@ namespace CV__SIMD_NAMESPACE { /** @brief SIMD processing state cleanup call */ ...
This function causes a compilation error, which recursively calls itself. But it should call the `v_add` function from other backends. This function works well but fails with intrin_cpp.hpp`. ``` In file included from /home/wanli/workspace/opencv_china/opencv/modules/core/test/test_intrin128.simd.hpp:7, from /home/wanl...
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin_wasm.hpp **Change Type:** modified **Context:** PR #26109: Replace operators with wrapper functions on universal intrinsics backends **Review Line:** 1697 **Code Changes:** ```diff } inline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b) { @@ -170...
you can reduce amount of operations here like (a+b) + (c+d).
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_intrin_utils.hpp **Change Type:** modified **Context:** PR #27337: build: fix warnings from recent gcc versions **Code Changes:** ```diff @@ -24,6 +24,17 @@ void test_hal_intrin_float16(); //============================================================================================...
Conditions are the same. Is it a typo?
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 #27297: imgcodecs: png: add log if first chunk is not IHDR **Review Line:** 297 **Code Changes:** ```diff + { + CV_LOG_ERROR(NULL, "CgBI chunk (Apple private) found as the first chunk. IHDR is expected."); + return...
chatGPT suggests ``` if (id == id_CgBI) { CV_LOG_ERROR(NULL, "CgBI chunk (Apple private) found as the first chunk. IHDR is expected."); } else { CV_LOG_ERROR(NULL, "IHDR chunk shall be first. This data may be broken or malformed."); } ```
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
I propose to replace it with if..else or more usual `offset = ? : ; j+= offset;`
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
The same remark on condition.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
This has been modified as well.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
What if _dst.cols <= 2*nlanes? Just skipped?
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
If you meant to take care of the tail with vectorization, you should take a look at this trick (line 161 to 166): https://github.com/opencv/opencv/blob/cb87f05e4bbae077e266d15b571ed8b23598d265/modules/core/src/convert.simd.hpp#L157-L171
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
this will not be skipped. when cols <= 2* lanes, - limit gets increased after this loop. "limit = size.width" - then it gets done in "for( ; j < limit; j++ )" loop above.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
I meant to handle the tail with the same main vector path by allowing overwriting in the next row.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
Check this: ```.diff diff --git a/modules/imgproc/src/median_blur.simd.hpp b/modules/imgproc/src/median_blur.simd.hpp index 7cc0aa693c..6185f5f9fd 100644 --- a/modules/imgproc/src/median_blur.simd.hpp +++ b/modules/imgproc/src/median_blur.simd.hpp @@ -693,8 +693,15 @@ medianBlur_SortNet( const Mat& _src, Mat& _dst, int...
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
Well, the starting index for j entering this loop should be cn (m=3) or cn*2 (m=5). So, the corrected version is as below. ```.diff diff --git a/modules/imgproc/src/median_blur.simd.hpp b/modules/imgproc/src/median_blur.simd.hpp index 7cc0aa693c..6185f5f9fd 100644 --- a/modules/imgproc/src/median_blur.simd.hpp +++ b/mo...
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
Adjusting the start index fixes the issue. Yes, performance is the same as before. Do you wish to commit/author this? This tail handling method is better.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/median_blur.simd.hpp **Change Type:** modified **Context:** PR #27299: imgproc: medianblur: Performance improvement **Code Changes:** ```diff @@ -13,6 +13,7 @@ // Copyright (C) 2000-2008, 2018, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights...
This trick is originally from Halide, IIRC. It is widely used in the codebase. I suggest to use the same to keep consistency and readability. You are welcome to do the change.
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/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -726,8 +726,14 @@ class CV_EXPORTS_W IStreamReader public: virtual ~IStreamReader(); - /** @brief Read bytes from stream */ - ...
I don't know if it may break ObjC bindings introduced in https://github.com/opencv/opencv/pull/25584
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/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -726,8 +726,14 @@ class CV_EXPORTS_W IStreamReader public: virtual ~IStreamReader(); - /** @brief Read bytes from stream */ - ...
IMHO, It should be kept wrapped as arguments of binding functions rely on this type. What is the error? Can we override behavior in java/gen_dict.json?
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/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -726,8 +726,14 @@ class CV_EXPORTS_W IStreamReader public: virtual ~IStreamReader(); - /** @brief Read bytes from stream */ - ...
Without `CV_EXPORTS_W` we also loose Python type hints.
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/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -726,8 +726,14 @@ class CV_EXPORTS_W IStreamReader public: virtual ~IStreamReader(); - /** @brief Read bytes from stream */ - ...
There is a minor error in gen_java but I were able to fix it. Let me try use a generated bindings again.
You are an expert OpenCV code reviewer specializing in test coverage and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/test/VideoCaptureTest.java **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -1,27 +1,41 @@ package org.opencv.test.videoio; import java.util.List; +import java.io.File; +import java.io.RandomAccessFile; ...
What is `0` used for?
You are an expert OpenCV code reviewer specializing in test coverage and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/test/VideoCaptureTest.java **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -1,27 +1,41 @@ package org.opencv.test.videoio; import java.util.List; +import java.io.File; +import java.io.RandomAccessFile; ...
Native object address, not used actually. Shall we hide it?
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/test/VideoCaptureTest.java **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 106 **Code Changes:** ```diff + + IStreamReader stream = new IStreamReader() + { + @Override + public long ...
I propose to add check if buffer length equal to size. Just to highlight bugs.
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/misc/java/src/cpp/videoio_converters.hpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 12 **Code Changes:** ```diff +#include "opencv2/videoio/videoio.hpp" + +class JavaStreamReader : public cv::IStreamReader +{ +public: + Jav...
> The JNIEnv is used for thread-local storage. For this reason, you cannot share a JNIEnv between threads. If a piece of code has no other way to get its JNIEnv, you should share the JavaVM, and use GetEnv to discover the thread's JNIEnv. (Assuming it has one; see AttachCurrentThread below.) Source: https://developer.a...
You are an expert OpenCV code reviewer specializing in test coverage and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/test/VideoCaptureTest.java **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Code Changes:** ```diff @@ -1,27 +1,41 @@ package org.opencv.test.videoio; import java.util.List; +import java.io.File; +import java.io.RandomAccessFile; ...
Fixed by `ManualFuncs`
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/videoio/misc/java/test/VideoCaptureTest.java **Change Type:** modified **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 106 **Code Changes:** ```diff + + IStreamReader stream = new IStreamReader() + { + @Override + public long ...
Sure. Also make sense to highlight in docstring that it's pre-allocated
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/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 58 **Code Changes:** ```diff + if (!m_read) + return 0; + JNIEnvHandler handler(vm); + JNIEnv* env = handler.env; + if (!en...
In general these callbacks are called from FFmpeg non-Java threads. `JNIEnv` may be not available for native threads. Should we use `AttachCurrentThread` in that case instead of `return 0` ? Docs: > For example, a thread started with pthread_create() or std::thread can be attached using the AttachCurrentThread() or Att...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 58 **Code Changes:** ```diff + if (!m_read) + return 0; + JNIEnvHandler handler(vm); + JNIEnv* env = handler.env; + if (!en...
Added `AttachCurrentThread` if `GetEnv` returns specific `JNI_EDETACHED` error.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 58 **Code Changes:** ```diff + if (!m_read) + return 0; + JNIEnvHandler handler(vm); + JNIEnv* env = handler.env; + if (!en...
> But there is dedicated issue with detaching of such threads. Do you mean there is some bug in JNI or we also responsible for `DetachCurrentThread` call?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 58 **Code Changes:** ```diff + if (!m_read) + return 0; + JNIEnvHandler handler(vm); + JNIEnv* env = handler.env; + if (!en...
> we also responsible this.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 24 **Code Changes:** ```diff + + ~JNIEnvHandler() + { + if (env && detach) + { + vm->DetachCurrentThread(); + ...
BTW, this could significantly slowdown execution through attach-detach on each callback call.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 58 **Code Changes:** ```diff + if (!m_read) + return 0; + JNIEnvHandler handler(vm); + JNIEnv* env = handler.env; + if (!en...
Added in the latest commit for every read/seek call
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 24 **Code Changes:** ```diff + + ~JNIEnvHandler() + { + if (env && detach) + { + vm->DetachCurrentThread(); + ...
I can move it to the wrapper class, just few minutes
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 24 **Code Changes:** ```diff + + ~JNIEnvHandler() + { + if (env && detach) + { + vm->DetachCurrentThread(); + ...
There is no guarantee that wrapper class uses the same thread,
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/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 24 **Code Changes:** ```diff + + ~JNIEnvHandler() + { + if (env && detach) + { + vm->DetachCurrentThread(); + ...
I propose to add some wording into docs that callbacks are called from the "creation thread" (this is how FFmpeg works for now), so we would not handle case with unknown "native threads" here.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/misc/java/src/cpp/videoio_converters.cpp **Change Type:** added **Context:** PR #27284: Java VideoCapture buffered stream constructor **Review Line:** 24 **Code Changes:** ```diff + + ~JNIEnvHandler() + { + if (env && detach) + { + vm->DetachCurrentThread(); + ...
Agree, actually, I have concern that even if read/seek were used in the thread that requires `AttachCurrentThread`, the destructor of `JavaStreamReader` might be called in the main thread
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** hal/riscv-rvv/src/imgproc/common.hpp **Change Type:** added **Context:** PR #27301: hal/riscv-rvv: refactor the building process **Code Changes:** ```diff @@ -0,0 +1,76 @@ +// 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 use CV_HAL_BORDER_XXX constants from `modules/core/include/opencv2/core/hal/interface.h`
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/sum_ipp.cpp **Change Type:** added **Context:** PR #27346: New HAL entry for cv::sum and IPP adoption **Review Line:** 1 **Code Changes:** ```diff @@ -0,0 +1,55 @@ +#include "ipp_hal_core.hpp" + +#include <opencv2/core.hpp> +#include <opencv2/core/base.hpp> + +#if IPP_VERSION_X100 >= 700 ```
License header.
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/sum.dispatch.cpp **Change Type:** modified **Context:** PR #27346: New HAL entry for cv::sum and IPP adoption **Code Changes:** ```diff @@ -10,14 +10,6 @@ #include "sum.simd.hpp" #include "sum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists...
`CV_CheckLE` is preferable,
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/sum_ipp.cpp **Change Type:** added **Context:** PR #27346: New HAL entry for cv::sum and IPP adoption **Review Line:** 1 **Code Changes:** ```diff @@ -0,0 +1,55 @@ +#include "ipp_hal_core.hpp" + +#include <opencv2/core.hpp> +#include <opencv2/core/base.hpp> + +#if IPP_VERSION_X100 >= 700 ```
There are no license headers in IPP HAL for now. I'll fix it with another PR.
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/attention_layer.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Code Changes:** ```diff @@ -24,6 +24,105 @@ static void packWeight(size_t num_heads, size_t head_size, size_t input_hidden_s } } + +static void rotationKernel( + float* data,...
No need to duplicate tail and scalar core. You can just close `#if (CV_SIMD || CV_SIMD_SCALABLE)` condition right after vectorized loop and extract `d` from ifdef.. In case, if vector intrinsics are not available, d = 0 and "tail" will be just main loop.
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/attention_layer.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Code Changes:** ```diff @@ -24,6 +24,105 @@ static void packWeight(size_t num_heads, size_t head_size, size_t input_hidden_s } } + +static void rotationKernel( + float* data,...
We have `v_sincos` to optimize it: https://docs.opencv.org/5.x/df/d91/group__core__hal__intrin.html#gaebe923bb2935eae727994a359c8c49c0
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Review Line:** 746 **Code Changes:** ```diff @@ -743,6 +743,32 @@ TEST_F(Layer_RNN_Test, get_set_test) EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); } +TEST(Layer_MHARoPe_Test_Accuracy...
It'll be great, if the test imports ONNX, but not create the attention layer in code. It allows to check parser and ensure that the implementation handles feasible graph.
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/attention_layer.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Code Changes:** ```diff @@ -24,6 +24,105 @@ static void packWeight(size_t num_heads, size_t head_size, size_t input_hidden_s } } + +static void rotationKernel( + float* data,...
CV_SIMD_WIDTH is compile time constant. It may not work correctly with _SCALABLE branch. please use `VTraits<xxx>::max_nlanes` instead. For fixed-size SIMD it works in the same way.
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/dnn/test/test_layers.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Review Line:** 746 **Code Changes:** ```diff @@ -743,6 +743,32 @@ TEST_F(Layer_RNN_Test, get_set_test) EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); } +TEST(Layer_MHARoPe_Test_Accuracy...
This is a little tricky due to compatibility issues with onnx runtime on my dev machine (apple silicon) I have just checked, do_rotary flag is ignored. so i can't produce a reference output of the corresponding onnx (with `do_rotary=1`) model locally. I also opened an issue at https://github.com/microsoft/onnxruntime 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/attention_layer.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Code Changes:** ```diff @@ -24,6 +24,105 @@ static void packWeight(size_t num_heads, size_t head_size, size_t input_hidden_s } } + +static void rotationKernel( + float* data,...
Yes, it does not work, because `w` value is not known in compile time. `VTraits<xxx>::max_nlanes` is compile time constant. It's equal to `CV_SIMD_WIDTH` for fixed SIMD size architectures (x86). RISC-V RVV vector size is not known in compile time, but we know maximum vector length and use it for intermediate buffers 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/attention_layer.cpp **Change Type:** modified **Context:** PR #27238: Rotary positional embeddings **Code Changes:** ```diff @@ -24,6 +24,105 @@ static void packWeight(size_t num_heads, size_t head_size, size_t input_hidden_s } } + +static void rotationKernel( + float* data,...
I have replaced CV_SIMD_WIDTH with VTraits<v_float32>::max_nlanes for both CV_SIMD and CV_SIMD_SCALABLE branch
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/obsensor_uvc_stream_channel.cpp **Change Type:** modified **Context:** PR #27230: videoio: add Orbbec Gemini 330 camera support **Review Line:** 69 **Code Changes:** ```diff #define fourCc2Int(a, b, c, d) \ @@ -62,6 +66,7 @@ const std::map<uint32_t, FrameFormat> fourccToOBFo...
`fourCc2Int('Y', '1', '6', ' ')` and `fourCc2Int('Z', '1', '6', ' ')` are both mapped to `FRAME_FORMAT_Y16`?
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/obsensor_uvc_stream_channel.cpp **Change Type:** modified **Context:** PR #27230: videoio: add Orbbec Gemini 330 camera support **Review Line:** 69 **Code Changes:** ```diff #define fourCc2Int(a, b, c, d) \ @@ -62,6 +66,7 @@ const std::map<uint32_t, FrameFormat> fourccToOBFo...
Still not working.
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/obsensor_uvc_stream_channel.cpp **Change Type:** modified **Context:** PR #27230: videoio: add Orbbec Gemini 330 camera support **Code Changes:** ```diff @@ -35,19 +35,23 @@ namespace cv { namespace obsensor { +const ObExtensionUnit OBSENSOR_COMMON_XU_UNIT = { XU_UNIT_ID_...
Why do you need resize and crop for the camera frames? I propose to return them in original size. Also resized does not support in-place processing. The code always triggers srcMat realloc.
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:** 3rdparty/hal_rvv/hal_rvv_1p0/transpose.hpp **Change Type:** added **Context:** PR #27229: HAL: implemented cv_hal_transpose in hal_rvv **Review Line:** 208 **Code Changes:** ```diff + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0 + }; + Transpose2dFunc func = tab[element_size]...
`element_size` may trigger out-of-bound access issue. I propose to add range check before.
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:** 3rdparty/hal_rvv/hal_rvv_1p0/transpose.hpp **Change Type:** added **Context:** PR #27229: HAL: implemented cv_hal_transpose in hal_rvv **Review Line:** 208 **Code Changes:** ```diff + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0 + }; + Transpose2dFunc func = tab[element_size]...
It is checked before calling hal: https://github.com/opencv/opencv/blob/e37819c2ac1b8ec2beac917bba0d885c79195603/modules/core/src/matrix_transform.cpp#L181
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
It's redundant.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
`dst_temp1 = cv::Mat(height_a, width_d, CV_32FC1);` Why do you need roi `cv::Rect(0, 0, width_d, height_a)` here?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
As optimization hint: A*B = B_transopsed * A_transposed.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
Hi Alex u mean line no 669 ?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
Hi Alex we added it here in case the original dst has some padding, i.e. stride > width*sizeof(datatype), since in case of inplace, we are making dst_temp of width * height size
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
No need to reset local pointers before return call.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_core.cpp **Change Type:** modified **Context:** PR #27184: FastCV gemm hal **Code Changes:** ```diff @@ -623,4 +623,119 @@ int fastcv_hal_SVD32f( } CV_HAL_RETURN(status, fastcv_hal_SVD32f); +} + +int fastcv_hal_gemm32f( + const float* src1, + size_t ...
`copyTo()` handles strides correctly. No need in roi.
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/tutorials/calib3d/camera_calibration_pattern/camera_calibration_pattern.markdown **Change Type:** modified **Context:** PR #27221: minor changes in calib3d docs for clarity **Code Changes:** ```diff @@ -11,7 +11,7 @@ Create calibration pattern {#tutorial_camera_calibration_pattern} | Compatibility | Ope...
the measurement units
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:** platforms/android/build_sdk.py **Change Type:** modified **Context:** PR #27239: Android-SDK: check flag IPP package **Code Changes:** ```diff @@ -380,7 +380,40 @@ def get_ndk_dir(): return android_sdk_ndk_bundle return None +def check_cmake_flag_enabled(cmake_file, flag_name, strict=True): +...
It makes sense to move key name to the function parameters. E.g. check_cmake_flag_enabled(cmake_file, "HAVE_IPP") The same function may be used for KleidiCV and other dependencies.
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:** platforms/android/build_sdk.py **Change Type:** modified **Context:** PR #27239: Android-SDK: check flag IPP package **Code Changes:** ```diff @@ -380,7 +380,40 @@ def get_ndk_dir(): return android_sdk_ndk_bundle return None +def check_cmake_flag_enabled(cmake_file, flag_name, strict=True): +...
I propose to add command line option, e.g. "--strict-dependencies" to make the check optional.
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:** platforms/android/build_sdk.py **Change Type:** modified **Context:** PR #27239: Android-SDK: check flag IPP package **Code Changes:** ```diff @@ -380,7 +380,40 @@ def get_ndk_dir(): return android_sdk_ndk_bundle return None +def check_cmake_flag_enabled(cmake_file, flag_name, strict=True): +...
Move into ``` for i, abi in enumerate(ABIs): ``` and check configuration.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,194 @@ +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/objdetect.hpp> +#include <op...
`getChartsRGB()` 1) returns matrix as a value, 2) that needs to be further reshaped. `getRefColor()` 1) returns matrix via output parameter 2) that does not need to be reshaped. please, align API and output shapes in both cases.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Review Line:** 178 **Code Changes:** ```diff + } + } + else if (key == 27) exit(0); + } + if(found)...
don't print colors on each frame. print them in the end.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,194 @@ +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/objdetect.hpp> +#include <op...
there is still missing branch that processes still images
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,194 @@ +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/objdetect.hpp> +#include <op...
why do we wait for another key press after user pressed ESC?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,194 @@ +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/objdetect.hpp> +#include <op...
please remove this printf(). When the pattern is detected, patches are outlined anyway. No need to create extra noise in terminal
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,194 @@ +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/objdetect.hpp> +#include <op...
`getChartsRGB()` and `getRefColors()` still use different ways to return data. Can `getRefColors()` return Mat as return value?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Review Line:** 175 **Code Changes:** ```diff + } + else{ + cout<<"No color chart detected!!"<<endl; +...
1) when user presses ESCAPE, he does not get colors printed. 2) what if the board was never detected?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,194 @@ +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/objdetect.hpp> +#include <op...
`processFrame()` should return bool and colors need to be printed only when the chart is detected
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/macbeth_chart_detection.cpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Review Line:** 153 **Code Changes:** ```diff + + Mat src, tgt; + bool found = false; + if (isVideo){ + cout<<"To print the actual colo...
put `bool found = false;` before while loop
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/objdetect/src/mcc/checker_detector.hpp **Change Type:** added **Context:** PR #26906: Adding macbeth chart detector to objdetect module from opencv_contrib **Review Line:** 48 **Code Changes:** ```diff + typedef std::vector<Point> PointsVector; + typedef std::vector<PointsVector> ContoursVector...
Adding a fix in this PR https://github.com/opencv/opencv/pull/27246
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27217: Optimize gaussian blur performance in FastCV HAL **Code Changes:** ```diff @@ -536,30 +536,88 @@ class FcvGaussianBlurLoop_Invoker : public cv::ParallelLoopBody { public: - FcvGaussianBlurLoop_Invoker(cons...
Build warning: ``` [660/2676] Building CXX object 3rdparty/fastcv/CMakeFiles/fastcv_hal.dir/src/fastcv_hal_imgproc.cpp.o /mnt/Projects/Projects/opencv/3rdparty/fastcv/src/fastcv_hal_imgproc.cpp:671:58: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] 671 | if( border_type != cv:...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
`stripeHeight = nThreads * 10;` sounds strange. More threads -> larger piece for each thread.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
``` if(inPlace) dst_temp = cv::Mat(height, width, src_depth); else dst_temp = cv::Mat(height, width, src_depth, (void*)dst_data, dst_step); ``` Why do you need roi `cv::Rect(0, 0, width, height)` here?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
Hi Alex we added it in case the original dst has some padding (stride > width * sizeof(datatype)), so to only access the width * height data part
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
Hi Alex We tested this and found it having good speed, since usually threads are 8 as per our experiments. Please guide what optimizations we can do here.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
`copyTo()` handles strides correctly. No need to use roi. It creates redundant cv::Mat object.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
threads are 8. It's not true: - Android build uses 2 threads by default. It's done to prevent overheating, but may be changed in future. - Linux builds use all available cores. - parallel_for_ serializes nested parallel_for_ calls. So you can easily get 1 here.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp **Change Type:** modified **Context:** PR #27182: Parallel_for in box Filter and support for 32f box filter in Fastcv hal **Code Changes:** ```diff @@ -314,6 +314,69 @@ int fastcv_hal_sobel( CV_HAL_RETURN(status, hal_sobel); } +class FcvBoxLoop_Invoker : pub...
We usually set granularity to some reasonable size for single thread. OpenCV uses dynamic scheduling, so all other steps are done automatically.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/mat.hpp **Change Type:** modified **Context:** PR #27265: 5.x merge 4.x - OpenCV Contrib: https://github.com/opencv/opencv_contrib/pull/3928 OpenCV Extra: https://github.com/opencv/opencv_extra/pul... **Code Changes:** ```diff @@ -494,6 +494,7 @@ class CV_EXPORTS _OutputArra...
Looks like this change is wrong.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/highgui/src/window_QT.cpp **Change Type:** modified **Context:** PR #27265: 5.x merge 4.x - OpenCV Contrib: https://github.com/opencv/opencv_contrib/pull/3928 OpenCV Extra: https://github.com/opencv/opencv_extra/pul... **Review Line:** 1668 **Code Changes:** ```diff - if (guiMainThread) - g...
Destructor has not been removed in header file (#27170).
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/hal_rvv_1p0/norm.hpp **Change Type:** renamed **Context:** PR #27265: 5.x merge 4.x - OpenCV Contrib: https://github.com/opencv/opencv_contrib/pull/3928 OpenCV Extra: https://github.com/opencv/opencv_extra/pul... **Review Line:** 1 **Code Changes:** ```diff @@ -1016,7 +1016,7 @@ inline int norm...
Changes in this file needs to be reverted except line 1014.
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/hal_rvv_1p0/norm_diff.hpp **Change Type:** renamed **Context:** PR #27265: 5.x merge 4.x - OpenCV Contrib: https://github.com/opencv/opencv_contrib/pull/3928 OpenCV Extra: https://github.com/opencv/opencv_extra/pul... **Review Line:** 1 **Code Changes:** ```diff @@ -1128,7 +1128,7 @@ inline int...
Changes in this file needs to be reverted except line 1128.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ipphal/CMakeLists.txt **Change Type:** modified **Context:** PR #27194: Migrated IPP impl for flip and transpose to HAL **Review Line:** 27 **Code Changes:** ```diff if(HAVE_IPP_ICV) target_compile_definitions(ipphal PRIVATE HAVE_IPP_ICV) endif() +if(HAVE_IPP_IW) + target_compile_definitions...
PRIVATE? This macro is used in "interface" headers.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ipphal/CMakeLists.txt **Change Type:** modified **Context:** PR #27194: Migrated IPP impl for flip and transpose to HAL **Review Line:** 27 **Code Changes:** ```diff if(HAVE_IPP_ICV) target_compile_definitions(ipphal PRIVATE HAVE_IPP_ICV) endif() +if(HAVE_IPP_IW) + target_compile_definitions...
Good point. Fixed.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ipphal/CMakeLists.txt **Change Type:** modified **Context:** PR #27194: Migrated IPP impl for flip and transpose to HAL **Review Line:** 27 **Code Changes:** ```diff if(HAVE_IPP_ICV) target_compile_definitions(ipphal PRIVATE HAVE_IPP_ICV) endif() +if(HAVE_IPP_IW) + target_compile_definitions...
Looks like I cannot make it public for now. We get redefinition issue. The macros are defined by both HAL and IPP core. I made it private for now to exclude the redefinition issue and added note to CMake.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 143 **Code Changes:** ```diff + outs[0] = outs[0].reshape(0, std::vector<int>{1, 8400, nc + 4}); } + // assert if last dim is 85 or 84 + ...
Check also that `outs[0].dims == 2` before.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 138 **Code Changes:** ```diff @@ -131,25 +135,30 @@ void yoloPostProcessing( // remove the second element outs.pop_back(); // unsq...
8400 is also depends on number of classes? So should it be `(nc + 4) * 100` or not?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 138 **Code Changes:** ```diff @@ -131,25 +135,30 @@ void yoloPostProcessing( // remove the second element outs.pop_back(); // unsq...
`nc` seems redundant as it can be computed from original shape: ```cpp int nc = outs[0].total() / 8400 - 4; ``` or, if 8400 is also depends on `nc`: ```cpp int nc = sqrt(outs[0].total() / 100) - 4; ```
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 138 **Code Changes:** ```diff @@ -131,25 +135,30 @@ void yoloPostProcessing( // remove the second element outs.pop_back(); // unsq...
> 8400 is also depends on number of classes? So should it be `(nc + 4) * 100` or not? 8400 depends on number of anchors only and has nothing to do with `nc`. `nc` depends on which dataset detector what trained. On `COCO` dataset `nc = 80`. For other datasets it might be different.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 138 **Code Changes:** ```diff @@ -131,25 +135,30 @@ void yoloPostProcessing( // remove the second element outs.pop_back(); // unsq...
I strongly believe that it should stay as a papermeter. As this is a parameter during traning. Computing it via `outs[0]` is kind of hack.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 138 **Code Changes:** ```diff @@ -131,25 +135,30 @@ void yoloPostProcessing( // remove the second element outs.pop_back(); // unsq...
The corner case is a background class. Some training utils may include this as a separate class - some not. So even if you trained model for 80 real classes, there is a variation nc=80 nc=81 and it may confuse even more.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/yolo_detector.cpp **Change Type:** modified **Context:** PR #25794: Add sample support of `YOLOv9` and `YOLOv10` in OpenCV **Review Line:** 138 **Code Changes:** ```diff @@ -131,25 +135,30 @@ void yoloPostProcessing( // remove the second element outs.pop_back(); // unsq...
Computing `nc` using number of anchor points is not good since number of anchors depens on the image size. Inference can happen on different image resolutons, depending on use case.