instruction
stringclasses
9 values
input
stringlengths
279
5.47k
output
stringlengths
6
9.58k
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
I propose to revert changes in this files and use: - https://github.com/opencv/opencv/pull/25930
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
> ENABLE_BF16 Toolchain files have issue with cached variables (not available to them - just add `message()`),
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** platforms/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
Toolchain files are not used for native compilation. We need a robust solution for such cases too, e.g. through `OPENCV_EXTRA_*` flags (currently they are applied after the feature checks)
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
The main idea here is to avoid modifying _arch_ compiler flags at all. If I understand correctly, changes in #25930 will still try to append custom flags and run compiler checks. For example, with that patch, if we compile OpenCV with `-DCMAKE_CXX_FLAGS="-mcpu=cortex-a72" -DCPU_BASELINE=NEON_FP16` options (`cortex-a72`...
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
For native compilation we assume that toolchain have architecture flags set by default.
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
For example on Armbian 12 (OrangePi) I have: ``` g++ -march=native -Q --target-help | grep march -march= armv8.2-a+crypto+fp16+rcpc+dotprod ```
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
I've checked this variable, it seem to be working. I build with `-DENABLE_BF16=ON` and got `-march=armv8.6-a` in the compiler string. We use this approach in XuanTie cmake toolchain: https://github.com/opencv/opencv/blob/4.x/platforms/linux/riscv64-071-gcc.toolchain.cmake (`CORE` variable)
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
Just add `message()` and run. Also add `message() for modified `CMAKE_CXX_FLAGS` because you got the `else()` branch in case of undefined value.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** platforms/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
> `-march=native` It is not a default actually. "Native" case is already properly handled by the current scripts: https://github.com/opencv/opencv/blob/4.10.0/cmake/OpenCVCompilerOptimizations.cmake#L167
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
> avoid modifying arch compiler flags at all For dispatched optimization we still need to modify compiler flags anyway. > make this build incompatible with explicitly requested CPU If compiler doesn't fail on `try_compile()` in that case then it could be workaronded through `-DCPU_NEON_FP16_FLAGS_ON=` CMake override.
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
Besides of DETECT, empty or other values of CPU_BASELINE are used for **limiting** of used features in OpenCV without touching compiler flags.
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
> For dispatched optimization we still need to modify compiler flags anyway. Yes, perhaps users will be required to manually provide flags for dispatched files via `CPU_XXX_FLAGS_ON` variables. Examples with our cmake-toolchain file from this PR: * Build with RVV as a baseline: ` -DENABLE_RVV=ON` * Build without RVV in...
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** platforms/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
Oh, I remembered, it was an issue with CMAKE_CXX_FLAGS. As I understand, modern cmake (3.7+) have respective `_INIT` variables for toolchain files specifically (https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_INIT.html). In new commit I've updated some of our toolchains to use them too.
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
Looks like these options are lost: - https://pullrequest.opencv.org/buildbot/builders/precommit_armv8/builds/100061 - https://pullrequest.opencv.org/buildbot/builders/precommit_armv7/builds/100073
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
`CPU_BASELINE=NATIVE` should be supported.
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Review Line:** 586 **Code Changes:** ```diff set(CPU_${OPT}_USAGE_COUNT...
`CPU_BASELINE_DISABLE` should not affect `CPU_DISPATCH` modes.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** platforms/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
This is because cmake version on buildbot is too old (3.5.1) for this [feature](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_INIT.html) (`CMAKE_<LANG>_FLAGS_INIT`). I propose raising minimum cmake version to 3.7.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
I'm still against forcing of `DETECT`. It could be default, but it should not be forced. We should not block user to disable some OpenCV intrinsics, e.g. for debug/testing purposes. Even if they are "enabled in compiler".
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
Why do we lost `_IMPLIES` configuration?
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** CMakeLists.txt **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -145,7 +145,7 @@ if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE) endif() if(CM...
There is already something for platforms: https://github.com/opencv/opencv/tree/4.x/cmake/platforms We could add similar for processors.
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/linux/flags-aarch64.cmake **Change Type:** added **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -0,0 +1,19 @@ +# see https://gcc.gnu.org/onlinedocs/gc...
Google uses `-march=armv8.2-a+bf16` for dispatched code: https://github.com/google/XNNPACK/blob/f416ab3d2781c8eb53eaa999239138296146b5e0/CMakeLists.txt#L836 Why do we need `8.4`?
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** CMakeLists.txt **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -145,7 +145,7 @@ if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE) endif() if(CM...
> platforms/linux OSX/iOS? android? other OS? We should not depend on "linux" here.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** CMakeLists.txt **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -145,7 +145,7 @@ if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE) endif() if(CM...
This block's purpose is to use the same flags for native Linux compilation as for cross-compilation with **our** toolchain files. * It is not applicable to Android, because it uses own toolchain files from NDK and doesn't have native compilation (or does it?). * Also not applicable to OSX/iOS because we rely on CMake/X...
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** platforms/linux/flags-aarch64.cmake **Change Type:** added **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -0,0 +1,19 @@ +# see https://gcc.gnu.org/onlinedocs/gc...
I used this table from GCC documentation to establish baselines with assumption that actual hardware also lines up with it and there are no platforms which have `dotprod` on top of `armv8.2-a`, plus an assumption that compiler can optimize code better for such "baseline" arch. ``` arch value Architecture Includes by de...
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** CMakeLists.txt **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -145,7 +145,7 @@ if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE) endif() if(CM...
Perhaps we can move this specific block to `Linux.cmake` if it has all used variables being set at the time of importing (e.g. `CMAKE_CROSSCOMPILING`). I'll try it.
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
I had concerns that it might affect compilation flags for dispatched or baseline files. I'll try to restore it.
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
I've added support of an empty `CPU_BASELINE`. Currently this configuration is broken due to incorrect macros being used somewhere in DNN inline optimizations: compiler has feature enabled and some macros are enabled too, but some other macros from generated cv_cpu_config.hpp are disabled, thus causing missing symbols....
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/linux/flags-aarch64.cmake **Change Type:** added **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -0,0 +1,19 @@ +# see https://gcc.gnu.org/onlinedocs/gc...
Changed it to use `armv8.2-a+...` combination with feature flags. It became slightly more complicated, but I believe it's OK. Please let me know if we need to revert it.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
Just "empty" handling is not enough. > We should not block user to disable some OpenCV intrinsics, e.g. for debug/testing purposes. Even if they are "enabled in compiler".
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** CMakeLists.txt **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -145,7 +145,7 @@ if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE) endif() if(CM...
Lets move out that from the root CMake file.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
User can disable OpenCV intrinsics on affected platforms in two ways: * set `-DCPU_BASELINE=` - disable all intrinsics * set `-DCPU_BASELINE_DISABLE=RVV` - disable selected categories Example: ``` cmake \ -DRISCV_CLANG_BUILD_ROOT=/chains/llvm-main -DRISCV_GCC_INSTALL_ROOT=/chains/riscv-gcc-14.1.0 -DCMAKE_TOOLCHAIN_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:** CMakeLists.txt **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -145,7 +145,7 @@ if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE) endif() if(CM...
Moved to `cmake/platforms/OpenCV-Linux.cmake`
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/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
Lets remove `set(CPU_BASELINE "DETECT")`. Warning message is enough.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/platforms/OpenCV-Linux.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -1 +1,9 @@ -# empty +if((CMAKE_CXX_COMPILER_ID MATCH...
Lets remove this comment as file is not "intentionally empty" anymore.
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/linux/arm.toolchain.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -48,32 +48,23 @@ if(NOT DEFINED ARM_LINUX_SYSROOT A...
My experiments has shown that unfortunately `FLAGS_INIT` vars do not work with regular `FLAGS` variables as I expected. They are not appended to initial value, but override it: ``` cmake \ -DCMAKE_TOOLCHAIN_FILE=/work/opencv/platforms/linux/riscv64-clang.toolchain.cmake \ ../opencv # result: -march=rv64gc ... # this is...
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/linux/flags-aarch64.cmake **Change Type:** added **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -0,0 +1,19 @@ +# see https://gcc.gnu.org/onlinedocs/gc...
Also added to the toolchain ability to disable NEON for AArch64 by explicitly setting `ENABLE_NEON` to `OFF`.
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVCompilerOptimizations.cmake **Change Type:** modified **Context:** PR #25901: RISC-V/AArch64: disable CPU features detection - This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU... **Code Changes:** ```diff @@ -104,7 +104,7 @@ ocv_optimization_process_obsol...
The goal is to avoid modifying compiler flags unnecessarily, as this can lead to incompatibilities and performance issues, especially when specific CPU architectures are requested. Users should have the option to manually set flags for dispatched files via CPU_XXX_FLAGS_ON. In the case of RVV, -DCPU_DISPATCH=RVV -DCPU_...
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVUtils.cmake **Change Type:** modified **Context:** PR #26234: move the gcc6 compatibility check to occur on a per-directory basis, … **Code Changes:** ```diff @@ -353,23 +353,23 @@ function(ocv_target_include_directories target) #ocv_debug_message("ocv_target_include_directories(${target} ${AR...
> `"${dir}"` Please use `dir MATCHES ...` without variable unpacking.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVUtils.cmake **Change Type:** modified **Context:** PR #26234: move the gcc6 compatibility check to occur on a per-directory basis, … **Code Changes:** ```diff @@ -353,23 +353,23 @@ function(ocv_target_include_directories target) #ocv_debug_message("ocv_target_include_directories(${target} ${AR...
Use `dir MATCHES "/usr/include$"` See line 309
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVUtils.cmake **Change Type:** modified **Context:** PR #26234: move the gcc6 compatibility check to occur on a per-directory basis, … **Code Changes:** ```diff @@ -353,23 +353,23 @@ function(ocv_target_include_directories target) #ocv_debug_message("ocv_target_include_directories(${target} ${AR...
got it! sorry about that
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/features2d/akaze_matching/akaze_matching.markdown **Change Type:** modified **Context:** PR #25292: features2d cleanup: Move several feature detectors and descriptors to opencv_contrib - features2d cleanup: #24999 The PR moves KAZE, AKAZE,... **Code Changes:** ```diff @@ -22,6 +22,8 @@ number o...
Use markdown notation for links.
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/features2d/akaze_tracking/akaze_tracking.markdown **Change Type:** modified **Context:** PR #25292: features2d cleanup: Move several feature detectors and descriptors to opencv_contrib - features2d cleanup: #24999 The PR moves KAZE, AKAZE,... **Code Changes:** ```diff @@ -17,6 +17,8 @@ Introduc...
Use markdown notation for links.
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/perf/perf_warp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 50 **Code Changes:** ```diff + } + case CV_16U: { + cvtest::fillGradient<uint16_t>(src); + if(bo...
OpenVX support is removed in https://github.com/opencv/opencv/pull/25197. So I remove this test. Also removed perf data from `$opencv_extra/testdata/perf/imgproc.xml`.
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/perf/perf_warp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 117 **Code Changes:** ```diff - PERF_TEST_P( TestWarpPerspectiveNear_t, WarpPerspectiveNear, Combine( ...
OpenVX support is removed in https://github.com/opencv/opencv/pull/25197. So I remove this test. Also removed perf data from `$opencv_extra/testdata/perf/imgproc.xml`.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/CMakeLists.txt **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -10,6 +10,7 @@ ocv_add_dispatched_file(median_blur SSE2 SSE4_1 AVX2) ocv_add_dispatched_file(morph SSE2 SSE4_1 AVX2) ocv_a...
what about NEON_FP16?
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/CMakeLists.txt **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -10,6 +10,7 @@ ocv_add_dispatched_file(median_blur SSE2 SSE4_1 AVX2) ocv_add_dispatched_file(morph SSE2 SSE4_1 AVX2) ocv_a...
Added. But actually `FP16` is set to be one of the baselines according to the CMake log: ``` -- CPU/HW features: -- Baseline: NEON FP16 -- Dispatched code generation: NEON_DOTPROD NEON_FP16 NEON_BF16 -- requested: NEON_FP16 NEON_BF16 NEON_DOTPROD -- NEON_DOTPROD (1 files): + NEON_DOTPROD -- NEON_FP16 (3 files): + NEON_...
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 2231 **Code Changes:** ```diff inline v_int16x8 v_floor(const v_float16x8 &a) { - int16x8_t a1 = vcvtq_s16_f...
The instruction is not available on armv7, but available on aarch32 and aarch64. We need macro check 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/core/include/opencv2/core/hal/intrin_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -2228,9 +2228,7 @@ inline v_int16x8 v_round(const v_float16x8 &a) inline v_int16x8 v_floor(const v...
The instruction is available on aarch32 too https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvtmq_s32_f32
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/perf/perf_warp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -12,7 +12,7 @@ CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR) CV_ENUM(InterTypeExtended, INTER_NEAREST, INTER_LINEAR, ...
no need in extra line here.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_imgwarp_strict.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -150,7 +150,7 @@ void CV_ImageWarpBaseTest::generate_test_data() while (depth == CV_8S || depth == CV_32S...
please remove.
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/perf/perf_warp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -12,7 +12,7 @@ CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR) CV_ENUM(InterTypeExtended, INTER_NEAREST, INTER_LINEAR, ...
Will remove later. Need this for testing purposes.
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/warp_kernels.simd.hpp **Change Type:** added **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -0,0 +1,2137 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file ...
Will try in the next commit.
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -2228,9 +2228,7 @@ inline v_int16x8 v_round(const v_float16x8 &a) inline v_int16x8 v_floor(const v...
I was struggled at armv7 support. There is no existing macros indicating if target supports only armv7.
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 2231 **Code Changes:** ```diff inline v_int16x8 v_floor(const v_float16x8 &a) { - int16x8_t a1 = vcvtq_s16_f...
Do we have an existing macro indicating the target platform is armv7?
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -2228,9 +2228,7 @@ inline v_int16x8 v_round(const v_float16x8 &a) inline v_int16x8 v_floor(const v...
There is manual "CAROTENE_NEON_ARCH" option. Looks like we need build check or handle march option correctly.
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -2228,9 +2228,7 @@ inline v_int16x8 v_round(const v_float16x8 &a) inline v_int16x8 v_floor(const v...
> need build check or handle march option correctly. That sounds like a dedicated PR. How about guard it (as well as the above one) with `CV_NEON_AARCH64` for now?
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 2231 **Code Changes:** ```diff inline v_int16x8 v_floor(const v_float16x8 &a) { - int16x8_t a1 = vcvtq_s16_f...
Input is of type `v_float16x8`. I guess compile flag `+fp16` can only be used with >= `armv8.2a` right? In this case, no need to guard with `__ARM_ARCH > 7` then.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/warp_kernels.simd.hpp **Change Type:** added **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -0,0 +1,2137 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file ...
`.simd.hpp` should not have `cv::Mat` or other C++ classes in their API.
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/warp_kernels.simd.hpp **Change Type:** added **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 91 **Code Changes:** ```diff + if( p < 0 ) + p = -p - 1 + delta; + else + p ...
How to guarantee avoidance of infinite 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/imgproc/src/warp_kernels.simd.hpp **Change Type:** added **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -0,0 +1,2137 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file ...
There are many of those scattered in the code. One of them is: https://github.com/opencv/opencv/blob/babc669dba4c1f55a0acc904e47bf2186aa8f7d1/modules/imgproc/src/bilateral_filter.simd.hpp#L55-L60
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/warp_kernels.simd.hpp **Change Type:** added **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 91 **Code Changes:** ```diff + if( p < 0 ) + p = -p - 1 + delta; + else + p ...
I don't know. Ask people who wrote that originally: https://github.com/opencv/opencv/blob/babc669dba4c1f55a0acc904e47bf2186aa8f7d1/modules/core/src/copy.cpp#L806-L817
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_neon.hpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -2228,9 +2228,7 @@ inline v_int16x8 v_round(const v_float16x8 &a) inline v_int16x8 v_floor(const v...
Please use __ARM_ARCH > 7 check. I have armv7 board and test it regularly.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/perf/opencl/perf_imgwarp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 78 **Code Changes:** ```diff const int type = get<1>(params), interpolation = get<2>(params); - const double eps =...
Looks like the change does not make sense as soon as you introduced `AlgorithmHint`. I reverted the change and no not see regressions with Intel OpenCL (iGPU) and NVIDIA GF 1080.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/ocl/test_warp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 175 **Code Changes:** ```diff @@ -172,7 +172,7 @@ OCL_TEST_P(WarpAffine, Mat) { for (int j = 0; j < test_loop_times; j++) ...
I propose to convert it to conditions with explicit types. We have fp16, int64, bool that comes after fp64. Also it's hard to understand the condition.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/ocl/test_warp.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 192 **Code Changes:** ```diff @@ -189,7 +189,7 @@ OCL_TEST_P(WarpAffine, inplace_25853) // when src and dst are the same variabl...
The same proposal here.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_imgwarp_strict.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Code Changes:** ```diff @@ -150,7 +150,7 @@ void CV_ImageWarpBaseTest::generate_test_data() while (depth == CV_8S || depth == CV_32S...
The change is not relevant after AlgorithmHint introduction. It passes without the change on Intel at least.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_imgwarp_strict.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 153 **Code Changes:** ```diff @@ -150,7 +150,7 @@ void CV_ImageWarpBaseTest::generate_test_data() while (depth == CV_...
The change triggers massve OpenCL code compilation errors for the new case. Some check should be added on OpenCL side. See attached log. [Uploading test.log…]()
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_imgwarp_strict.cpp **Change Type:** modified **Context:** PR #25984: imgproc: add optimized warpAffine kernels for 8U/16U/32F + C1/C3/C4 inputs **Review Line:** 153 **Code Changes:** ```diff @@ -150,7 +150,7 @@ void CV_ImageWarpBaseTest::generate_test_data() while (depth == CV_...
I added check to OpenCL code.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
Why is this test disabled?
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
It takes a lot of time compared to the other tests. The last time I added such a heavy test I was advised to not run it by default, see https://github.com/opencv/opencv/pull/23076#discussion_r1060193514
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
Instead of two comparison we can make one simpler check: ```.cpp im1 = 0; img2 = 0; cv::fillPoly(img1, ...); cv::polylines(img2, ...); // same color EXPECT_MAT_N_DIFF(img1, img2, 0); ```
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
I suggest reducing this test by: 1. use only corners and the middle as the first point: ```.cpp for (int x1 = 0; x1 < imgSize; x1 += imgSize / 2) // imgSize = 49 for (int y1 = 0; y1 < imgSize; y1 += imgSize / 2) ``` 2. Draw on two separate images and compare them afterwards (see my other comment) I've prepared an examp...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
Make one `vector<vector<Point>>` with all required data and pass it directly to the function: ```.cpp std::vector<std::vector<cv::Point>> polygonPoints {{ {x1, y1}, {x2, y2} }}; ```
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
What about other line types? `LINE_AA`? Will it work the same as before?
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/drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Review Line:** 1302 **Code Changes:** ```diff if (t0.y != t1.y) { pt0c.y = t0.y; pt1c.y = t1.y; - pt0c.x = (int64)...
Does any test check clipping scenario? Non-zero shift?
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/drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Review Line:** 1302 **Code Changes:** ```diff if (t0.y != t1.y) { pt0c.y = t0.y; pt1c.y = t1.y; - pt0c.x = (int64)...
I did not add tests for all scenarios since `fillPoly` and `polylines` handle incoming points slightly different and also have differences in drawing the contours for certain parameters. To make the contours match in all scenarios probably both functions would need further adjustments. This PR should fix the matching c...
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_drawing.cpp **Change Type:** modified **Context:** PR #26187: Fix fillPoly drawing over boundaries **Code Changes:** ```diff @@ -680,6 +680,75 @@ TEST(Drawing, fillpoly_circle) EXPECT_LT(diff_fp3, 1.); } +TEST(Drawing, fillpoly_contours) +{ + const int imgSize = 50; + ...
`LINE_AA` is not affected by the changes of this PR so it works the same, but it does not pass the test due to the reasons mentioned in the other comment. `LINE_4` passes this test with any shift. `LINE_8` passes this test only with a zero shift. It fails for non-zero shifts, most likely because the methods to draw the...
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin_math.hpp **Change Type:** modified **Context:** PR #25892: Add support for v_sin and v_cos (Sine and Cosine) **Review Line:** 410 **Code Changes:** ```diff } //! @} +//! @name Sine and Cosine +//! @{ +template<typename _TpVec16F, typename _TpVec16S> +inline vo...
It'll be great to add reference to the algorithm source/description and m.b. how the coefficients are generated.
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin_math.hpp **Change Type:** modified **Context:** PR #25892: Add support for v_sin and v_cos (Sine and Cosine) **Review Line:** 410 **Code Changes:** ```diff } //! @} +//! @name Sine and Cosine +//! @{ +template<typename _TpVec16F, typename _TpVec16S> +inline vo...
I can't find the original algorithm, the approximate implementations are the same and they refer to (it's already existed in the `intrin_math.hpp` ``` /* Universal Intrinsics implementation of sin, cos, exp and log Inspired by Intel Approximate Math library, and based on the corresponding algorithms of the cephes math ...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/ocl/test_arithm.cpp **Change Type:** modified **Context:** PR #26256: extended Norm tests to prove that cv::norm() already supports all the… **Review Line:** 2041 **Code Changes:** ```diff @@ -2038,7 +2038,7 @@ OCL_INSTANTIATE_TEST_CASE_P(Arithm, Magnitude, Combine(::testing::Values(CV_32F,...
`OCL_ABSOLUTELY_ALL_DEPTHS` => `OCL_ALL_NUMERICAL_DEPTHS`, because bool is not there.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/ocl/test_arithm.cpp **Change Type:** modified **Context:** PR #26256: extended Norm tests to prove that cv::norm() already supports all the… **Review Line:** 2041 **Code Changes:** ```diff @@ -2038,7 +2038,7 @@ OCL_INSTANTIATE_TEST_CASE_P(Arithm, Magnitude, Combine(::testing::Values(CV_32F,...
added norm for Bool 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/core/include/opencv2/core/hal/intrin_cpp.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Code Changes:** ```diff @@ -263,7 +263,7 @@ Most of these operations return only one value. ### Other math -- Some frequent operations: ...
It is expected that tests like `hal_intrin*CPP_EMULATOR` call the code from `intrin_cpp.hpp`. But they don't. To debug modify `intrin_cpp.hpp`: ```.diff #define OPENCV_HAL_IMPL_MATH_FUNC(func, cfunc, _Tp2) \ template<typename _Tp, int n> inline v_reg<_Tp2, n> func(const v_reg<_Tp, n>& a) \ { \ + printf(#func " is calle...
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_math.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Code Changes:** ```diff @@ -2,10 +2,6 @@ // It is subject to the license terms in the LICENSE file found in the top-level directory // of ...
I propose to use templates here. v_int##TpSuffix and v_float##TpSuffix will be template arguments.
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_math.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Code Changes:** ```diff @@ -2,10 +2,6 @@ // It is subject to the license terms in the LICENSE file found in the top-level directory // of ...
OK, but it will introduce many parameters and may use the macro to maintain the code.
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_math.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Code Changes:** ```diff @@ -2,10 +2,6 @@ // It is subject to the license terms in the LICENSE file found in the top-level directory // of ...
Wouldn't wide intrinsics like `vx_setall_f32` work here? Or maybe we can introduce traits type (or extend existing ones) which would map `_setall_` to corresponding types.
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_lasx.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Review Line:** 563 **Code Changes:** ```diff inline _Tpvec v256_setall_##suffix(_Tp v) \ { ret...
if you copy-paste code 3+ times, when we have anti-pattern and design should be changed.
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_avx.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Code Changes:** ```diff @@ -447,6 +447,10 @@ OPENCV_HAL_IMPL_AVX_LOADSTORE_FLT(v_float64x4, double, pd, __m128d) { return _Tpvec(_mm256_...
> `_Tpvec /*unused*/` Template should be used instead. Static code analyzers dislike passing of uninitialized vars.
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_avx.hpp **Change Type:** modified **Context:** PR #25891: Resolve Compilation Error for v_func Function in SIMD Emulator **Review Line:** 451 **Code Changes:** ```diff @@ -447,6 +447,10 @@ OPENCV_HAL_IMPL_AVX_LOADSTORE_FLT(v_float64x4, double, pd, __m128d) { ...
Mess of v256_ / v_ (which is used for 128-bit)
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/calib/include/opencv2/calib.hpp **Change Type:** modified **Context:** PR #26221: Reworked multiview calibration interface **Code Changes:** ```diff @@ -449,7 +449,7 @@ enum { CALIB_USE_INTRINSIC_GUESS = 0x00001, //!< Use user provided intrinsics as // for stereo rectification CALIB_Z...
`std::vector<Size>` => `const std::vector<Size>&`? Also, shall I specify size for each single image even if they are the same? Can I just pass a vector of a single Size?
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/calib/src/multiview_calibration.cpp **Change Type:** modified **Context:** PR #26221: Reworked multiview calibration interface **Review Line:** 510 **Code Changes:** ```diff - const std::vector<Size> &imageSize, InputArray detectionMask, - OutputArrayOfArrays Rs, OutputArrayOfArrays Ts,...
Does this algorithm requires all images at once? If not, it would be more convenient (and efficient) to make iterative interface, e.g.: ```.cpp MultiviewCalib calib(...); for(...) { calib.addFrame(...); } SomeResult res = calib.getResults(); ```
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/calib/src/multiview_calibration.cpp **Change Type:** modified **Context:** PR #26221: Reworked multiview calibration interface **Review Line:** 510 **Code Changes:** ```diff - const std::vector<Size> &imageSize, InputArray detectionMask, - OutputArrayOfArrays Rs, OutputArrayOfArrays Ts,...
The algorithm does not use frames, but point coordinates only. The first step calibrates intrinsics and build spanning tree. The second step makes global optimization for all frames. So iterative API is not possible here.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/multiview_calibration_sample.cpp **Change Type:** modified **Context:** PR #25022: Add Charuco board support to multiview calibration sample (C++) **Code Changes:** ```diff @@ -7,12 +7,14 @@ #include <opencv2/calib3d.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/imgproc.hpp> +#includ...
It does not work, if not all Charuco corners are detected/labeled correctly. corners array will contain (-1,-1) and it'll be used in calibration pipeline.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/multiview_calibration_sample.cpp **Change Type:** modified **Context:** PR #25022: Add Charuco board support to multiview calibration sample (C++) **Code Changes:** ```diff @@ -7,12 +7,14 @@ #include <opencv2/calib3d.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/imgproc.hpp> +#includ...
I put it to be (-1, -1) on purpose, as internally, I would check whether the point is inside the image frame x in (0, width-1), y in (0, height-1). If not, this point will be discarded. I design the input of the method to be like this so that I only need to feed in a single copy of the objective points. Otherwise, I wo...
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/dnn/dnn_yolo/dnn_yolo.markdown **Change Type:** modified **Context:** PR #25710: Merged yolo_detector and object detection sample **Code Changes:** ```diff @@ -150,13 +150,12 @@ Once we have our ONNX graph of the model, we just simply can run with OpenCV's s 3. Run the following command: @c...
Yolo detector sample was removed in the PR.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/object_detection.cpp **Change Type:** modified **Context:** PR #25710: Merged yolo_detector and object detection sample **Code Changes:** ```diff @@ -1,68 +1,114 @@ +//![includes] #include <fstream> #include <sstream> #include <opencv2/dnn.hpp> #include <opencv2/imgproc.hpp> +#include <open...
`test_name` -> `yolo_name` or something similar.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/object_detection.cpp **Change Type:** modified **Context:** PR #25710: Merged yolo_detector and object detection sample **Code Changes:** ```diff @@ -1,68 +1,114 @@ +//![includes] #include <fstream> #include <sstream> #include <opencv2/dnn.hpp> #include <opencv2/imgproc.hpp> +#include <open...
postrpocessing type from yaml file should be used here to support yolonas like models.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/object_detection.cpp **Change Type:** modified **Context:** PR #25710: Merged yolo_detector and object detection sample **Code Changes:** ```diff @@ -1,68 +1,114 @@ +//![includes] #include <fstream> #include <sstream> #include <opencv2/dnn.hpp> #include <opencv2/imgproc.hpp> +#include <open...
The same relevant for python code. Also there conditions are different.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/include/opencv2/imgcodecs.hpp **Change Type:** modified **Context:** PR #26152: Documentation update for imagecodecs **Code Changes:** ```diff @@ -222,9 +222,9 @@ enum ImwriteHDRCompressionFlags { @anchor imread -The function imread loads an image from the specified file and returns it...
`Mat::data = NULL` is bad check. `Mat::empty()` should be used instead.
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_sunras.cpp **Change Type:** modified **Context:** PR #26152: Documentation update for imagecodecs **Review Line:** 25 **Code Changes:** ```diff #include "grfmt_sunras.hpp" @@ -60,6 +22,7 @@ SunRasterDecoder::SunRasterDecoder() m_encoding = RAS_STANDARD; m_maptype = RMT_...
Please extend existing test to cover the new feature.
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_sunras.cpp **Change Type:** modified **Context:** PR #26152: Documentation update for imagecodecs **Review Line:** 25 **Code Changes:** ```diff #include "grfmt_sunras.hpp" @@ -60,6 +22,7 @@ SunRasterDecoder::SunRasterDecoder() m_encoding = RAS_STANDARD; m_maptype = RMT_...
when `m_buf_supported = false;` imencode function writes the data into a temporary file. so tests already cover the functionality of `m_buf_supported = true;`