instruction
stringclasses
9 values
input
stringlengths
279
5.47k
output
stringlengths
6
9.58k
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/phasecorr.cpp **Change Type:** modified **Context:** PR #27368: imgproc: vectorize cv::createHanningWindow **Code Changes:** ```diff @@ -38,6 +38,7 @@ #include "precomp.hpp" #include <vector> +#include "opencv2/core/hal/intrin.hpp" namespace cv { @@ -614,16 +615,45 @@ void cv::cre...
What if drop the condition and just use scalar tail for it? IMHO it should fix small performance degradation on arm.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/deblurring.cpp **Change Type:** added **Context:** PR #27349: Added DNN based deblurring samples **Code Changes:** ```diff @@ -0,0 +1,136 @@ +/* +This file is part of OpenCV project. +It is subject to the license terms in the LICENSE file found in the top-level directory +of this distribution and...
You can get rid of the conversion, if merge channels in proper order.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/deblurring.cpp **Change Type:** added **Context:** PR #27349: Added DNN based deblurring samples **Code Changes:** ```diff @@ -0,0 +1,136 @@ +/* +This file is part of OpenCV project. +It is subject to the license terms in the LICENSE file found in the top-level directory +of this distribution and...
``` vector<Mat> channels = { Mat(output_transposed.size[1], output_transposed.size[2], CV_32F, output_transposed.ptr<float>(0)), Mat(output_transposed.size[1], output_transposed.size[2], CV_32F, output_transposed.ptr<float>(1)), Mat(output_transposed.size[1], output_transposed.size[2], CV_32F, output_transposed.ptr<flo...
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_webp.cpp **Change Type:** modified **Context:** PR #27457: fix for the issue #27456 **Code Changes:** ```diff @@ -155,14 +155,16 @@ bool WebPDecoder::readHeader() webp_data.size = data.total(); WebPAnimDecoderOptions dec_options; - WebPAnimDecoderOptions...
That encode is actually useless right?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/color.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,391 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
Modern copyright header
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/photo/src/ccm/distance.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,80 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-...
Should we move it to public 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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
use ColorSpace
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
use ColorSpace
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
use LinearizationType
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
setLinearization
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
please rename it to computeColorCorrectionMatrix() to avoid confusion with another "ccm" - "color correction model", make it return matrix: ``` CV_WRAP Mat compute(); ```
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
rename to `CV_WRAP Mat getColorCorrectionMatrix() const;`
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
probably rename to ``` CV_WRAP void correctImage(InputArray src, OutputArray dst, bool islinear = false); ```
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
==> `CV_WRAP ColorCorrectionModel(const Mat& src, const Mat& colors, COLOR_SPACE ref_cs, const Mat& colored);`
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
==> `CV_WRAP ColorCorrectionModel(const Mat& src, const Mat& colors, COLOR_SPACE ref_cs);`
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
``` CV_WRAP Mat getSrcLinearRGB() const; CV_WRAP Mat getRefLinearRGB() const; ```
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
We use all capital letters for constant names.
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
The same note about capital letters, e.g. `COLOR_SPACE_AppleRGB` -> `COLOR_SPACE_APPLE_RGB`
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
please use `int` for `constcolor`. Unfortunately not all bindings generators support enums for now.
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
Also please use InputArray here and bellow. It allows to add non-cpu branches in future without API 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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
InputArray, OutputArray?
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
`const &` is redundant here. Please use just `double gamma`.
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
The same here and bellow.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/perf/perf_ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 20 **Code Changes:** ```diff +{ + string path = cvtest::findDataFile("cv/mcc/mcc_ccm_test.yml"); + FileStorage fs(path, FileStorage::READ); ...
`ASSERT_FALSE(chartsRGB.empty());`
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/photo/test/test_precomp.hpp **Change Type:** modified **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -1,11 +1,15 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the...
using namespace is very bad practice. It affects everything, even, if the header is not included directly.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/color_correction_model.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,224 @@ +//! [tutorial] +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/imgcodecs.hpp> +...
Please use FileStorage and read/write methods for the model.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/python/color_correction_model.py **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,185 @@ +import cv2 as cv +import numpy as np +import argparse +import sys +import os +sys.path.append(os.path.join(os...
Please add couple of python tests. They are executed by CI automatically.
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/photo/src/ccm/utils.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 39 **Code Changes:** ```diff +/** @brief multiple the function used to compute an array with n channels + mulipied by ccm. + @param xyz th...
Most probably the function may be replaced with cv::transform https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga393164aa54bb9169ce0a8cc44e08ff22
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/photo/src/ccm/utils.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 32 **Code Changes:** ```diff + +/** @brief maskCopyTo a function to delete unsatisfied elementwise. + @param src the input array, type of Mat. ...
there is Mat.copyTo() with mask support instead of it.
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/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,113 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
inRange should be enough instead of it: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/python/color_correction_model.py **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,185 @@ +import cv2 as cv +import numpy as np +import argparse +import sys +import os +sys.path.append(os.path.join(os...
Which location should the test be added? Inside ccm directory or in modules/python/tests ?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 15 **Code Changes:** ```diff +#include "linearize.hpp" +#include <cmath> +namespace cv { +namespace ccm { + +class ColorCorrectionModel::Impl +{ +pu...
Space line before class.
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/photo/ccm/color_correction_model.markdown **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,53 @@ +Color Correction Model{#tutorial_ccm_color_correction_model} +=========================== + +In...
It makes sense to add reference to anym, but not list all variants here. It may change in time, but we always forget about text.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/color_correction_model.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,224 @@ +//! [tutorial] +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/imgcodecs.hpp> +...
There is a mistake here: `--input=--ccm_file`
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/cpp/color_correction_model.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,224 @@ +//! [tutorial] +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/imgcodecs.hpp> +...
I would say that if + verbose error message is preferable here. Just exception with assert condition is cryptic for user.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/test/test_ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,302 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
FileStorage supports in-memory operations. You can get just strings and compare without disc i/o.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,113 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
Why not just cvtColor?
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/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 111 **Code Changes:** ```diff + Mat mask; + inRange(src, lower_bound, upper_bound, mask); + mask /= 255; + + return mask; +} +} +} //...
normalize with NORM_MIN_MAX does the same: https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd
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/photo/src/ccm/linearize.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,260 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the to...
empty line is redundant.
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/photo/src/ccm/color.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,108 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
IO object should be passed by reference. I do not see why we need a copy each time.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/color.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,391 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
just `history.find`? It's std::map and the key value may appear only once, if it's there.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/color.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,391 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
``` if(save) { std::shared_ptr<Color> color = std::make_shared<Color>(ops.run(colors), other); history[other] = color; return *color; } else { return Color(ops.run(colors), other); } ```
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/perf/perf_ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,103 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
It makes sense to use some popular image size line 1920x1080, or, better, make a parameterized test and benchmark several popular resolutions.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/color.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,391 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
`std::shared_ptr` is redundant here. You can just return `Color` object and store it as ColorCorrectionModel::Impl field.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,557 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-leve...
`dst` is bad name. There are many clashes with method parameter name.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,557 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-leve...
Also shared_ptr looks redundant here.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,557 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-leve...
There is `cv::mixChannels` channels to reach the same result faster without extra allocations: https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga51d768c270a1cdd3497255017c4504be
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/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,557 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-leve...
No need to spit cv::Mat by channels for it. cv::sum supports channels: https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,113 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
I propose to convert Gamma correction to public function with InputArray and OutputArray. It's useful independently from the pipeline and also may be significantly optimized with universal intrinsics.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 16 **Code Changes:** ```diff +namespace cv { +namespace ccm { + +void gammaCorrection(InputArray _src, OutputArray _dst, double gamma) +{ + Mat...
please add CV_Assert with input type checks at least. The function is public API now and should handle invalid input correctly.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,557 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-leve...
You add even more operations with memory. simgle mixChannels without split and merge can do it.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,557 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-leve...
The code with ccm0 and coeffs looks very cryptic. I proposr to create ccm0 with proper shape with zeros , e.g. cv::Mat::zeros() and then set non-zero values for it. It's less amount of code, but there is no strange resize/reshape and `shape/3` values.
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/photo/src/ccm/utils.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,145 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-le...
It should go to make ccm header to be included into documentation and bindings. Please CV_EXPORTS_W to generate Java and Python bindings for it too.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 111 **Code Changes:** ```diff + Mat mask; + inRange(src, lower_bound, upper_bound, mask); + mask /= 255; + + return mask; +} +} +} //...
The function needs the mask as an output of values in upper bound and lower bound. I don't think this can be replaced
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/operations.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 50 **Code Changes:** ```diff +{ + ops.insert(ops.end(), other.ops.begin(), other.ops.end()); + return *this; +}; + +Mat Operations::run...
I tried it, but it cannot be replaced by Mat&
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/photo/include/opencv2/photo/ccm.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,322 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found i...
`\n` is not needed here and other documentation strings.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/perf/perf_ccm.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 41 **Code Changes:** ```diff +PERF_TEST(CV_ccm_perf_720_1280, correctImage) +{ + string path = cvtest::findDataFile("cv/mcc/mcc_ccm_test.yml");...
`ASSERT_FALSE(chartsRGB.empty());` here and bellow.
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/color_correction_model.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,224 @@ +//! [tutorial] +#include <opencv2/core.hpp> +#include <opencv2/highgui.hpp> +#include <opencv2/imgcodecs.hpp> +...
I propose to Move BRG/RGB logic into model with a flag (default to bgr). All OpenCV functions are designed for BGR. The flag allows to make optimizations without API change.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/linearize.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Code Changes:** ```diff @@ -0,0 +1,284 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the to...
`make_shared<>`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/photo/src/ccm/utils.cpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 16 **Code Changes:** ```diff +namespace cv { +namespace ccm { + +void gammaCorrection(InputArray _src, OutputArray _dst, double gamma) +{ + Mat...
It's still relevant.
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/photo/src/ccm/utils.hpp **Change Type:** added **Context:** PR #27051: Adding color correction module to photo module from opencv_contrib **Review Line:** 39 **Code Changes:** ```diff +/** @brief multiple the function used to compute an array with n channels + mulipied by ccm. + @param xyz th...
Still relevant.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/objdetect/include/opencv2/objdetect.hpp **Change Type:** modified **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -729,7 +729,8 @@ class CV_EXPORTS_W QRCodeEncoder { }; enum ECIEncodings { - ECI_UTF8 = 26 + ECI_SHIFT_JIS = 20, + ECI_U...
This enum confuses a bit
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/objdetect/include/opencv2/objdetect.hpp **Change Type:** modified **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -729,7 +729,8 @@ class CV_EXPORTS_W QRCodeEncoder { }; enum ECIEncodings { - ECI_UTF8 = 26 + ECI_SHIFT_JIS = 20, + ECI_U...
m.b. latest frame or latest detectAndDecode 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/objdetect/src/qrcode.cpp **Change Type:** modified **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -963,6 +963,7 @@ struct ImplContour : public GraphicalCodeDetector::Impl double epsX, epsY; mutable vector<vector<Point2f>> alignmentMarkers; mutable vec...
why not just int for codeIdx + assert? Unsigned types is a pain for Java.
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/objdetect/misc/java/gen_dict.json **Change Type:** added **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -0,0 +1,68 @@ +{ + "ManualFuncs" : { + "QRCodeEncoder" : { + "QRCodeEncoder" : { + "j_code" : [ + "\n", +...
The comments are not related.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/objdetect/include/opencv2/objdetect/graphical_code_detector.hpp **Change Type:** modified **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -73,6 +73,17 @@ class CV_EXPORTS_W_SIMPLE GraphicalCodeDetector { */ CV_WRAP bool detectAndDecodeMulti(InputArray img, ...
Java bindings use just cv::Mat for it. There is MatOfBytes specialization. M.b. reuse it too?
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/objdetect/include/opencv2/objdetect/graphical_code_detector.hpp **Change Type:** modified **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -73,6 +73,17 @@ class CV_EXPORTS_W_SIMPLE GraphicalCodeDetector { */ CV_WRAP bool detectAndDecodeMulti(InputArray img, ...
In such way user should call an extra method: ```java MatOfByte output = detector.detectAndDecodeBytes(qrcode); new String(output.toArray(), "Shift_JIS")); ```
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/objdetect/src/qrcode.cpp **Change Type:** modified **Context:** PR #24426: Consider QRCode ECI encoding **Code Changes:** ```diff @@ -963,6 +963,7 @@ struct ImplContour : public GraphicalCodeDetector::Impl double epsX, epsY; mutable vector<vector<Point2f>> alignmentMarkers; mutable vec...
It makes resize/reserve `encodings` vector first to reduce reallocs.
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/java/generator/android-21/java/org/opencv/android/JavaCamera2View.java **Change Type:** modified **Context:** PR #27419: Fixed Android setCameraIndex issue. **Code Changes:** ```diff @@ -96,8 +96,10 @@ protected boolean selectCamera() { Log.e(LOGTAG, "Error: camera isn't detected.");...
`chosen`
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 #27421: Cover all seek directions in VideoCapture Java test **Code Changes:** ```diff @@ -123,6 +123,10 @@ public long seek(long offset, int origin) { if (origin == 0) ...
`(0, SEEK_END)` should point to `f.length()` not `f.length() - 1`
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/dnn/CMakeLists.txt **Change Type:** modified **Context:** PR #27428: Cmake protobuf_generate_cpp deprecated use protobuf_generate **Code Changes:** ```diff @@ -115,8 +115,22 @@ if(HAVE_PROTOBUF) if(PROTOBUF_UPDATE_FILES) file(GLOB proto_files "${CMAKE_CURRENT_LIST_DIR}/src/tensorflow/*.prot...
> protobuf_generate Added in version 3.13. It breaks build with older CMake. I propose to add CMake version check and presume the old branch for old CMake.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** hal/ipp/include/ipp_hal_core.hpp **Change Type:** modified **Context:** PR #27354: Update IPP integration - Please merge together with https://github.com/opencv/opencv_3rdparty/pull/96 Supported IPP version was updated to ... **Review Line:** 20 **Code Changes:** ```diff @@ -17,15 +17,18 @@ int ipp_hal_minMa...
There is still old versions (e.g. Apple Mac, Linux 32-bit) Also there are generic IPP releases, which may behave in different way and may have these "old" issues. Could you please add version check instead (with using of `HAVE_IPP_ICV` if necessary)?
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** hal/ipp/include/ipp_hal_core.hpp **Change Type:** modified **Context:** PR #27354: Update IPP integration - Please merge together with https://github.com/opencv/opencv_3rdparty/pull/96 Supported IPP version was updated to ... **Review Line:** 20 **Code Changes:** ```diff @@ -17,15 +17,18 @@ int ipp_hal_minMa...
I've returned it, but comparison with only one version, because the issue appeared only in the previous update, which is already was done for 64-bit Linux and Windows only.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/distransform.cpp **Change Type:** modified **Context:** PR #24535: Handle huge images in IPP distanceTransform **Code Changes:** ```diff @@ -817,14 +817,15 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe Size size = src.size(); int border = ...
Need to check how it worked with ROI dst before.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/distransform.cpp **Change Type:** modified **Context:** PR #24535: Handle huge images in IPP distanceTransform **Code Changes:** ```diff @@ -817,14 +817,15 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe Size size = src.size(); int border = ...
probably related to this discussion: https://github.com/opencv/opencv/issues/12018. Changed check to INT_MAX overflow
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/distransform.cpp **Change Type:** modified **Context:** PR #24535: Handle huge images in IPP distanceTransform **Code Changes:** ```diff @@ -817,14 +817,15 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe Size size = src.size(); int border = ...
the right link about `isContinuous()` mess: #11505
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp **Change Type:** modified **Context:** PR #27153: fix #26276: cv::VideoWriter fails writing colorless images **Code Changes:** ```diff @@ -2525,11 +2525,13 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int // check parameters ...
In case of `encode_video = False` we should accept only raw bytes arrays. So we should have CV_8UC1 data type only. Expected layout is 1xN or Nx1. This change must be reverted.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp **Change Type:** modified **Context:** PR #27153: fix #26276: cv::VideoWriter fails writing colorless images **Code Changes:** ```diff @@ -2525,11 +2525,13 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int // check parameters ...
> inputMat ... inputMat "In-place" ops should not be used in general (causes extra `.clone()` call).
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp **Change Type:** modified **Context:** PR #27153: fix #26276: cv::VideoWriter fails writing colorless images **Code Changes:** ```diff @@ -2525,11 +2525,13 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int // check parameters ...
What is about other cases? 16UC3?
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp **Change Type:** modified **Context:** PR #27153: fix #26276: cv::VideoWriter fails writing colorless images **Code Changes:** ```diff @@ -2525,11 +2525,13 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int // check parameters ...
Good point. I had focused only on the explicitly supported types (CV_8UC1, CV_16UC1, CV_8UC3) and overlooked the possibility of unsupported inputs like CV_16UC3. I’ll address this as well.
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/videoio/src/cap_ffmpeg_impl.hpp **Change Type:** modified **Context:** PR #27153: fix #26276: cv::VideoWriter fails writing colorless images **Code Changes:** ```diff @@ -2525,11 +2525,13 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int // check parameters ...
This is a part of external API (`cap_ffmpeg_legacy_api.hpp`), we can't just change parameters meaning.
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/videoio/src/cap_ffmpeg_impl.hpp **Change Type:** modified **Context:** PR #27153: fix #26276: cv::VideoWriter fails writing colorless images **Code Changes:** ```diff @@ -2525,11 +2525,13 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int // check parameters ...
I completely missed that detail... As its part of external API, I'm going to revert it back to using the number of channels
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_mat.cpp **Change Type:** modified **Context:** PR #27362: Fix empty ND-array construction **Review Line:** 1466 **Code Changes:** ```diff + EXPECT_LE(mat_nd.total(), 1u); + EXPECT_FALSE(mat_nd.empty()); +#endif + EXPECT_EQ(mat.total(), 0u); + EXPECT_TRUE(mat.empty()); +} + ...
suggest to add some checks to the test: ``` TEST(Core_Mat, empty) { // Should not crash. uint8_t data[2] = {0, 1}; cv::Mat mat_nd(/*ndims=*/0, /*sizes=*/nullptr, CV_8UC1, /*data=*/data); cv::Mat1b mat(0, 0, /*data=*/data, /*steps=*/1); EXPECT_EQ(mat_nd.dims, 0); EXPECT_EQ(mat.dims, 2); EXPECT_LE(mat_nd.total(), 1u); //...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/src/matrix.cpp **Change Type:** modified **Context:** PR #27362: Fix empty ND-array construction **Review Line:** 318 **Code Changes:** ```diff @@ -315,7 +315,7 @@ void finalizeHdr(Mat& m) m.rows = m.cols = -1; if(m.u) m.datastart = m.data = m.u->data; - if( m.data ) + ...
adding `d > 0` is fine. I'd also suggest to modify the else branch: ``` else m.dataend = m.datalimit = 0; ``` to ``` else m.dataend = m.datalimit = m.data; ``` that will make behaviour of both constructors of an empty matrix more consistent.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_mat.cpp **Change Type:** modified **Context:** PR #27362: Fix empty ND-array construction **Review Line:** 1466 **Code Changes:** ```diff + EXPECT_LE(mat_nd.total(), 1u); + EXPECT_FALSE(mat_nd.empty()); +#endif + EXPECT_EQ(mat.total(), 0u); + EXPECT_TRUE(mat.empty()); +} + ...
> // 0 for 4.x, 1 for 5.x Do we really to introduce support in OpenCV 4.x for functionality which has different behavior in OpenCV 5.x.
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_openvino/dnn_openvino.markdown **Change Type:** modified **Context:** PR #27363: Feature: Add OpenVINO NPU support **Code Changes:** ```diff @@ -26,3 +26,14 @@ There are 2 approaches how to get OpenCV: - Build OpenCV from source code against specific version of OpenVINO. This approach ...
Try use `&reg;` instead of ®
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_openvino/dnn_openvino.markdown **Change Type:** modified **Context:** PR #27363: Feature: Add OpenVINO NPU support **Code Changes:** ```diff @@ -26,3 +26,14 @@ There are 2 approaches how to get OpenCV: - Build OpenCV from source code against specific version of OpenVINO. This approach ...
fixed for &trade; too
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_fitellipse.cpp **Change Type:** modified **Context:** PR #26299: Add getClosestEllipsePoints() function to get the closest point on an ellipse **Code Changes:** ```diff @@ -113,4 +113,197 @@ TEST(Imgproc_FitEllipse_HorizontalLine, accuracy) { EXPECT_NEAR(el.angle, 90, 0.1); } ...
Check correctness
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/src/shapedescr.cpp **Change Type:** modified **Context:** PR #26299: Add getClosestEllipsePoints() function to get the closest point on an ellipse **Code Changes:** ```diff @@ -877,6 +877,121 @@ cv::RotatedRect cv::fitEllipseDirect( InputArray _points ) return box; } +namespace cv +{ ...
Keep using Matx instead of Mat, since Matx is instantly allocated on stack and for Matx there is also overloaded '*' opereator. Here you basically initialize quite big structure Mat and allocate the Mat data in heap for each single point, which is very bad.
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_subdivision2d.cpp **Change Type:** modified **Context:** PR #27149: Fix #25696: Solved the problem in Subdiv2D, empty delaunay triangulation **Code Changes:** ```diff @@ -50,4 +50,18 @@ TEST(Imgproc_Subdiv2D_getTriangleList, regression_5788) EXPECT_EQ(trig_cnt, 105); } +TEST...
CI Warning: ``` warning: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Wsign-compare] ``` Also GTest macro signature says that expected value should go first.
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_legacy_ops.h **Change Type:** added **Context:** PR #27327: Restored legacy intrinsics operators in a separate header - resolves #27267 * New header with removed universal intrinsics operator overloa... **Review Line:** 22 **Code Changes:** ```diff +#warning "Oper...
It is only since OpenCV 4.11 the Universal Intrinscs operators have been removed? I don't understand, I had to [fix some code](https://github.com/lagadic/visp/commit/9ed0300507e13dddd83fd62a799f5039025ea44e) since OpenCV 4.9 release. https://github.com/opencv/opencv/pull/24371
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/calib3d/src/solvepnp.cpp **Change Type:** modified **Context:** PR #27311: Added warning if projected axes are out of camera frame in drawAxes **Review Line:** 123 **Code Changes:** ```diff + allIn &= imageRect.contains(imagePoints[i]); + } + + if (!allIn) + { + CV_LOG_WARNING(...
> relaible Small typo. I am not a native english speaker, my proposition: &#8594; "Some of the projected axes endpoints are outside of the image bounds. The drawn axes may not be reliable with strong lens distortion ." (accurate / correct instead?) <details> <summary>off topic</summary> <s> --- I would add in the messa...
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/calib3d/src/solvepnp.cpp **Change Type:** modified **Context:** PR #27311: Added warning if projected axes are out of camera frame in drawAxes **Review Line:** 123 **Code Changes:** ```diff + allIn &= imageRect.contains(imagePoints[i]); + } + + if (!allIn) + { + CV_LOG_WARNING(...
> "You may want to pass a zero-distortion coefficient vector to avoid this issue." (or NULL?) It generates incorrect result for cameras with visible distortion. Axes will be shifted from expected location.
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/gapi/CMakeLists.txt **Change Type:** modified **Context:** PR #27355: Check MS Media Foundation availability in G-API too **Review Line:** 384 **Code Changes:** ```diff @@ -380,6 +380,15 @@ if(WIN32) ocv_target_link_libraries(${the_module} PRIVATE wsock32 ws2_32) endif() +ocv_option(OPENCV_GAPI...
OPENCV_GAPU_MSMF OPENCV_GAPI_MSMF typo
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/gapi/CMakeLists.txt **Change Type:** modified **Context:** PR #27355: Check MS Media Foundation availability in G-API too **Review Line:** 384 **Code Changes:** ```diff @@ -380,6 +380,15 @@ if(WIN32) ocv_target_link_libraries(${the_module} PRIVATE wsock32 ws2_32) endif() +ocv_option(OPENCV_GAPI...
`TARGET ocv.3rdparty.msmf` should be used instead of `HAVE_MSMF`.
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/gapi/CMakeLists.txt **Change Type:** modified **Context:** PR #27355: Check MS Media Foundation availability in G-API too **Review Line:** 389 **Code Changes:** ```diff +if(HAVE_MSMF AND OPENCV_GAPI_MSMF) + if(TARGET opencv_test_gapi) + ocv_target_compile_definitions(opencv_test_gapi PRIVATE -DHA...
`HAVE_MSMF` already comes with target `ocv.3rdparty.msmf`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_math.cpp **Change Type:** modified **Context:** PR #27331: Add tests for solveCubic **Review Line:** 2539 **Code Changes:** ```diff + EXPECT_NEAR(roots[0], 1., 1e-8); + EXPECT_NEAR(roots[1], 2., 1e-8); + if (num_roots == 3) + { + EXPECT_NEAR(roots...
I would expect deterministic behavour on amount of solutions on all platforms. Is not it?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_math.cpp **Change Type:** modified **Context:** PR #27331: Add tests for solveCubic **Review Line:** 2585 **Code Changes:** ```diff + EXPECT_NEAR(roots[0], 1., 1e-8); + EXPECT_NEAR(roots[1], 2., 1e-8); + if (num_roots == 3) + { + EXPECT_NEAR(roots...
The same issue.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_math.cpp **Change Type:** modified **Context:** PR #27331: Add tests for solveCubic **Review Line:** 2539 **Code Changes:** ```diff + EXPECT_NEAR(roots[0], 1., 1e-8); + EXPECT_NEAR(roots[1], 2., 1e-8); + if (num_roots == 3) + { + EXPECT_NEAR(roots...
The test is about: ``` 2 * x^3 - 10 * x^2 + 16 * x - 8 = 2 * (x - 1) * (x - 2)^2 = 0 ``` So, it has `2` roots - `1` and `2` (with multiplicity equal to `2`). But on some platforms due to round-off error implementation says that it has `3` roots - `1`, `2 + eps1` and `2 + eps2` (so, it gives `2` roots almost equal to `2...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** hal/riscv-rvv/src/imgproc/histogram.cpp **Change Type:** modified **Context:** PR #27332: hal/imgproc: add hal for calcHist and implement in hal/riscv-rvv **Review Line:** 268 **Code Changes:** ```diff + } + } + p0 += step0; + } + } + } + ...
It makes sense to return not_implemented for other depth. Just in case of new types support in 5.x.