instruction
stringclasses
9 values
input
stringlengths
279
5.47k
output
stringlengths
6
9.58k
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26849: APNG encoding optimization **Code Changes:** ```diff @@ -814,6 +814,10 @@ PngEncoder::PngEncoder() next_seq_num = 0; trnssize = 0; palsize = 0; + m_compression_level = Z_BEST_SPEED; + m_compression_stra...
shouldn't that be in `if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 )` below ?
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/filter.hpp **Change Type:** added **Context:** PR #27045: 5.x merge 4.x - No related changes in extra and contrib #26441 from sturkmen72:upd_tutorials #26849 from sturkmen72:apng-writeanimation #26... **Review Line:** 7 **Code Changes:** ```diff +// It is subject to the license t...
I noticed this in PR #27026, but that PR has already been closed. I'm not sure whether I should create a separate issue for such a small problem or mention it somewhere and address it in a larger update. So, I’m bringing it up here. I think it should be added in `hal_rvv.hpp` like [this](https://github.com/opencv/openc...
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/filter.hpp **Change Type:** added **Context:** PR #27045: 5.x merge 4.x - No related changes in extra and contrib #26441 from sturkmen72:upd_tutorials #26849 from sturkmen72:apng-writeanimation #26... **Review Line:** 7 **Code Changes:** ```diff +// It is subject to the license t...
Feel free to resolve it in 4.x.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/filter.hpp **Change Type:** added **Context:** PR #27045: 5.x merge 4.x - No related changes in extra and contrib #26441 from sturkmen72:upd_tutorials #26849 from sturkmen72:apng-writeanimation #26... **Review Line:** 7 **Code Changes:** ```diff +// It is subject to the license t...
I will resolve it later.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/calib3d/src/stereosgbm.cpp **Change Type:** modified **Context:** PR #26996: fix Logical defect in FilterSpecklesImpl **Code Changes:** ```diff @@ -2345,21 +2345,33 @@ void filterSpecklesImpl(cv::Mat& img, int newVal, int maxSpeckleSize, int maxDif using namespace cv; int width = img.cols...
I propose to get rid of braces in the first case, and add a comment to each sum part to mark corresponding buffer name.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/pyramids.hpp **Change Type:** added **Context:** PR #26958: Add RISC-V HAL implementation for cv::pyrDown and cv::pyrUp **Code Changes:** ```diff @@ -0,0 +1,719 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top...
Let's avoid `CV_Assert` too. Just return NOT_IMPLEMENTED in this case. Here and in other places.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/pyramids.hpp **Change Type:** added **Context:** PR #26958: Add RISC-V HAL implementation for cv::pyrDown and cv::pyrUp **Review Line:** 515 **Code Changes:** ```diff + } + int width0 = std::min((src_width-PD_SZ/2-1)/2 + 1, dst_width); + + for (int x = 0; x <= PD_SZ+1; x...
Not sure what to do with `borderInterpolate`. Perhaps it should be implemented here as well (maybe in limited version only for acceptable border modes).
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/pyramids.hpp **Change Type:** added **Context:** PR #26958: Add RISC-V HAL implementation for cv::pyrDown and cv::pyrUp **Review Line:** 515 **Code Changes:** ```diff + } + int width0 = std::min((src_width-PD_SZ/2-1)/2 + 1, dst_width); + + for (int x = 0; x <= PD_SZ+1; x...
Carotene(ARM HAL) copied this function from ::cv into its self namespace, I will follow this.
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/src/norm.simd.hpp **Change Type:** added **Context:** PR #26885: core: vectorize cv::normalize / cv::norm **Code Changes:** ```diff @@ -0,0 +1,676 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this d...
This is introduced to workaround failed tests on ci of rvv node. The RVV CI node is getting some accuracy issues on the normL2 with double only. But it works fine on real hardware. Could it be some qemu bugs?
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/src/norm.simd.hpp **Change Type:** added **Context:** PR #26885: core: vectorize cv::normalize / cv::norm **Code Changes:** ```diff @@ -0,0 +1,676 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this d...
This is introduce to workaround failed tests on ci of rvv node. The RVV CI node is getting some accuracy issues on the normL1 with double only. But it works fine on real hardware. Could it be some qemu bugs?
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/src/norm.simd.hpp **Change Type:** added **Context:** PR #26885: core: vectorize cv::normalize / cv::norm **Code Changes:** ```diff @@ -0,0 +1,676 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this d...
This is introduced to workaround failed tests on ci of rvv node. The RVV CI node is getting weird some accuracy issues on the normL2 with double. But it works fine on real hardware. Could it be some qemu bugs?
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/src/norm.simd.hpp **Change Type:** added **Context:** PR #26885: core: vectorize cv::normalize / cv::norm **Code Changes:** ```diff @@ -0,0 +1,676 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this d...
This is introduced to workaround failed tests on ci of rvv node. The RVV CI node is getting weird some accuracy issues on the normL1 with double. But it works fine on real hardware. Could it be some qemu bugs?
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/norm.dispatch.cpp **Change Type:** renamed **Context:** PR #26885: core: vectorize cv::normalize / cv::norm **Code Changes:** ```diff @@ -7,6 +7,9 @@ #include "opencl_kernels_core.hpp" #include "stat.hpp" +#include "norm.simd.hpp" +#include "norm.simd_declarations.hpp" + /**************...
All ifs may be squeezed to single call. `if( normType == NORM_L2 )` is needed for sqrt only.
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/src/norm.dispatch.cpp **Change Type:** renamed **Context:** PR #26885: core: vectorize cv::normalize / cv::norm **Code Changes:** ```diff @@ -7,6 +7,9 @@ #include "opencl_kernels_core.hpp" #include "stat.hpp" +#include "norm.simd.hpp" +#include "norm.simd_declarations.hpp" + /**************...
For norm inf, `result` needs to be `float` while others are `double`. Fixed in the latest commit.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
I propose to refactor the test to parameterized test. The loop is not needed and GTest names them in logs and highlights failures.
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_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
This test is weak because it tests explicit HAL call and the same HAL call at https://github.com/opencv/opencv/blob/8e65075c1e6810c3ffbf38093f4e5fc167d76ea7/modules/core/src/matrix_decomp.cpp#L187
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_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
typo? `std::get<2>(GetParam());`
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_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
`throw SkipTestException("message");` It's equivalent to your code, but marks the test as skipped in report and logs.
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_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
I propose to invert the ground truth calculation: generate A and x with randu, calculate b with multiplication, use A and b for test and x as ground truth.
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/core/test/test_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
Please remove commented 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/core/test/test_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
I've inverted the test but keep comparison between `A * x` and `A * x0` because test `x` vs `x0` gives bigger error on `size=15`: ``` [ RUN ] Core_HAL/mat_decomp.accuracy/7, where GetParam() = (5, Cholesky, 15) /home/d.kurtaev/opencv/modules/core/test/test_hal_core.cpp:189: Failure Expected: (cvtest::norm(x, x0, NORM_I...
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_hal_core.cpp **Change Type:** modified **Context:** PR #26887: invSqrt SIMD_SCALABLE implementation & HAL tests refactoring - Enable CV_SIMD_SCALABLE for invSqrt. * Banana Pi BF3 (SpacemiT K1) RISC-V * ... **Code Changes:** ```diff @@ -42,168 +42,163 @@ namespace opencv_test { names...
`a0 * x0` is `b` otherwise `b` is not used.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26915: imgcodecs: fix PNG read on BE platforms (s390x) - Resolves #26913 Related(?): #25715 #26832 **Code Changes:** ```diff @@ -121,16 +121,16 @@ namespace cv { -const uint32_t id_IHDR = 0x52444849; // PNG header -const uint3...
since we just made `id` correct in both cases, why change the return here? wouldn't just `return id;` now be ok for both?
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_png.cpp **Change Type:** modified **Context:** PR #26915: imgcodecs: fix PNG read on BE platforms (s390x) - Resolves #26913 Related(?): #25715 #26832 **Code Changes:** ```diff @@ -121,16 +121,16 @@ namespace cv { -const uint32_t id_IHDR = 0x52444849; // PNG header -const uint3...
Yes, it needs further investigation - tests on other platforms fail with other PNG files.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26915: imgcodecs: fix PNG read on BE platforms (s390x) - Resolves #26913 Related(?): #25715 #26832 **Code Changes:** ```diff @@ -121,16 +121,16 @@ namespace cv { -const uint32_t id_IHDR = 0x52444849; // PNG header -const uint3...
Actually the proper way is to use: ``` const uint32_t id = png_get_uint_32(size_d + 4); ```
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/calib3d/src/fundam.cpp **Change Type:** modified **Context:** PR #26921: Fix assertion in cv2.sampsonDistance **Code Changes:** ```diff @@ -1224,7 +1224,7 @@ double cv::sampsonDistance(InputArray _pt1, InputArray _pt2, InputArray _F) { CV_INSTRUMENT_REGION(); - CV_Assert(_pt1.type() == CV_...
Please use Mat::depth() instead of bit magic: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a8da9f853b6f3a29d738572fd1ffc44c0
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/src/grfmt_gif.hpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Code Changes:** ```diff @@ -11,14 +11,35 @@ namespace cv { -enum GifOpMode -{ - GRFMT_GIF_Nothing = 0, - GRFMT_GIF_PreviousImage = 1, - GRFMT_GIF_Background = 2, - G...
consider using enum GifDisposeMethod { GIF_DISPOSE_NA = 0, GIF_DISPOSE_NONE = 1, GIF_DISPOSE_RESTORE_BACKGROUND = 2, GIF_DISPOSE_RESTORE_PREVIOUS = 3, };
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_gif.cpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Code Changes:** ```diff @@ -24,7 +24,6 @@ GifDecoder::GifDecoder() { hasRead = false; hasTransparentColor = false; transparentColor = 0; - opMode = GRFMT_GIF_Nothi...
`uchar flag = GifDisposeMethod::GIF_DISPOSE_RESTORE_PREVIOUS << 2;`
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_gif.cpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Code Changes:** ```diff @@ -24,7 +24,6 @@ GifDecoder::GifDecoder() { hasRead = false; hasTransparentColor = false; transparentColor = 0; - opMode = GRFMT_GIF_Nothi...
I'm sorry I changed it to use new enum, but I missed to use restoreToPrevious method. I fixed it.
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_gif.cpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Code Changes:** ```diff @@ -24,7 +24,6 @@ GifDecoder::GifDecoder() { hasRead = false; hasTransparentColor = false; transparentColor = 0; - opMode = GRFMT_GIF_Nothi...
M.b. stupid question: why do you use flag values 0,1,2, and then shift left / shift right them during IO? The flag values may be shifted here once. Also please replace & 0x3 with some meaningful constant name like `GIF_DISPOSE_FLAG_MASK`.
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_gif.cpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Code Changes:** ```diff @@ -24,7 +24,6 @@ GifDecoder::GifDecoder() { hasRead = false; hasTransparentColor = false; transparentColor = 0; - opMode = GRFMT_GIF_Nothi...
The out-of-bound check looks strange. Need to check if it's possible and it's not a bug/broken input. We should not silently ignore input issues.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/test/test_gif.cpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Review Line:** 373 **Code Changes:** ```diff +// See https://github.com/opencv/opencv/issues/26924 +TEST(Imgcodecs_Gif, decode_disposal_method) +{ + const string root = cvtest:...
Looks like it's a new file. Please create PR to opencv_extra repo with the same branch name.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/test/test_gif.cpp **Change Type:** modified **Context:** PR #26930: imgcodecs: gif: support Disposal Method **Review Line:** 373 **Code Changes:** ```diff +// See https://github.com/opencv/opencv/issues/26924 +TEST(Imgcodecs_Gif, decode_disposal_method) +{ + const string root = cvtest:...
I'm sorry I created branch which has same name this patch so its test is passed, but I forget to create PR. Please could you merge this pull request ? https://github.com/opencv/opencv_extra/pull/1239
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/features2d/test/test_fast.cpp **Change Type:** modified **Context:** PR #26907: Migrate remaning OpenVX integrations to OpenVX HAL (features2d) **Code Changes:** ```diff @@ -118,8 +118,8 @@ void CV_FastTest::run( int ) read( fs["exp_kps2"], exp_kps2, Mat() ); fs.release(); - if ( exp_...
Maybe `ASSERT_TRUE` would be better in this case? Here and on line 163 (`ASSERT_GT`).
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/imgwarp.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Review Line:** 3990 **Code Changes:** ```diff @@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input return k.run(2, globalThre...
Please presume the API in 4.x, but remove in 5.x. Backward compatibility is important.
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.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Review Line:** 1116 **Code Changes:** ```diff @@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak) } } -//** @deprecated */ -TEST(Imgproc_linearPolar, identity)...
I propose to not remove test till the API is there in 4.x.
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/imgwarp.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Review Line:** 3990 **Code Changes:** ```diff @@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input return k.run(2, globalThre...
I closed the PR in the `4.x` branch of OpenCV (#26909) and made the relevant changes in the `5.x` branch. I hope that's fine.
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/imgwarp.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Review Line:** 3990 **Code Changes:** ```diff @@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input return k.run(2, globalThre...
Please remove the function from header file 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/imgproc/test/test_imgwarp.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Code Changes:** ```diff @@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak) } } -//** @deprecated */ -TEST(Imgproc_linearPolar, identity) -{ - const int N =...
The test should be either removed or updated to call `warpPolar`.
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/imgwarp.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Review Line:** 1467 **Code Changes:** ```diff @@ -1432,150 +1432,6 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input return k.run(2, globalThre...
Corresponding `*.cl` files should be removed 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/imgproc/test/test_imgwarp.cpp **Change Type:** modified **Context:** PR #26914: removal of deprecated functions in imgproc **Code Changes:** ```diff @@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak) } } -//** @deprecated */ -TEST(Imgproc_linearPolar, identity) -{ - const int N =...
There is Imgproc_warpPolar.identity test. It implements the same procedure, but with the new API. So, the test may be removed without coverage loss.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/video/misc/java/test/TrackerCreateTest.java **Change Type:** modified **Context:** PR #26875: Added trackers factory with pre-loaded dnn models **Review Line:** 63 **Code Changes:** ```diff public void testCreateTrackerGOTURN() { + Net net; + try { + String protoFile = n...
GOTURN files can be located in separate folders - weights in OPENCV_DNN_TEST_DATA_PATH, prototxt in OPENCV_TEST_DATA_PATH.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/video/misc/java/test/TrackerCreateTest.java **Change Type:** modified **Context:** PR #26875: Added trackers factory with pre-loaded dnn models **Review Line:** 65 **Code Changes:** ```diff + try { + String protoFile = new File(testDataPath, "dnn/gsoc2016-goturn/goturn.prototxt").to...
Maybe `throw new TestSkipException();`?
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/video/misc/java/test/TrackerCreateTest.java **Change Type:** modified **Context:** PR #26875: Added trackers factory with pre-loaded dnn models **Review Line:** 63 **Code Changes:** ```diff public void testCreateTrackerGOTURN() { + Net net; + try { + String protoFile = n...
I fixed data search logic and introduced `modelsDataPath` to find files correctly.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVFindLibsPerf.cmake **Change Type:** modified **Context:** PR #26917: Switch to static instance of FastCV **Code Changes:** ```diff @@ -181,7 +181,14 @@ endif(WITH_KLEIDICV) if(WITH_FASTCV) if((EXISTS ${FastCV_INCLUDE_PATH}) AND (EXISTS ${FastCV_LIB_PATH})) message(STATUS "Use external Fa...
I believe we don't need special `NOTFOUND` handling - it should be built into the `if` [command](https://cmake.org/cmake/help/latest/command/if.html): > True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number (including floating point numbers). False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, ...
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_io.cpp **Change Type:** modified **Context:** PR #26883: Remove code duplication from test for FileStorage Base64 **Code Changes:** ```diff @@ -611,28 +611,20 @@ static void test_filestorage_basic(int write_flags, const char* suffix_name, boo { /* init */ /* a...
`EXPECT_MAT_NEAR(_2d_in_u8, _2d_out_u8, 0)` or `EXPECT_MAT_N_DIFF(_2d_in_u8, _2d_out_u8, 0)` or `EXPECT_PRED_FORMAT2(cvtest::MatComparator(0, 0), _2d_in_u8, _2d_out_u8);` should be enough here. The in and out matrices should be bit exact, right?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_io.cpp **Change Type:** modified **Context:** PR #26883: Remove code duplication from test for FileStorage Base64 **Code Changes:** ```diff @@ -611,28 +611,20 @@ static void test_filestorage_basic(int write_flags, const char* suffix_name, boo { /* init */ /* a...
it may be replaced with cv::randu output, right?
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/core/test/test_io.cpp **Change Type:** modified **Context:** PR #26883: Remove code duplication from test for FileStorage Base64 **Code Changes:** ```diff @@ -611,28 +611,20 @@ static void test_filestorage_basic(int write_flags, const char* suffix_name, boo { /* init */ /* a...
Extra function is not needed at all: ``` cv::Mat _2d_out_u8(rows, cols, type, scalar); // scalar is not needed here most probably cv::randu(_2d_out_u8, min, max); ```` See https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga1ba1026dca0807b27057ba6a49d258c0
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/split.hpp **Change Type:** added **Context:** PR #26884: [HAL] split8u RVV 1.0 **Code Changes:** ```diff @@ -0,0 +1,93 @@ +// 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 ...
Is it for particular version of Clang?
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/split.hpp **Change Type:** added **Context:** PR #26884: [HAL] split8u RVV 1.0 **Code Changes:** ```diff @@ -0,0 +1,93 @@ +// 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 ...
The same question
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/split.hpp **Change Type:** added **Context:** PR #26884: [HAL] split8u RVV 1.0 **Code Changes:** ```diff @@ -0,0 +1,93 @@ +// 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 ...
idk i copied it from merge.hpp
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/mean.dispatch.cpp **Change Type:** modified **Context:** PR #26895: Use HAL for cv::mean function too **Code Changes:** ```diff @@ -130,13 +130,29 @@ Scalar mean(InputArray _src, InputArray _mask) CV_Assert( mask.empty() || mask.type() == CV_8U ); int k, cn = src.channels(), dept...
Is it possible to use CALL_HAL_RET macro here and below?
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/mean.dispatch.cpp **Change Type:** modified **Context:** PR #26895: Use HAL for cv::mean function too **Code Changes:** ```diff @@ -130,13 +130,29 @@ Scalar mean(InputArray _src, InputArray _mask) CV_Assert( mask.empty() || mask.type() == CV_8U ); int k, cn = src.channels(), dept...
The macro expects, that the return value is the last HAL function parameter. It's not applicable here.
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/mean.dispatch.cpp **Change Type:** modified **Context:** PR #26895: Use HAL for cv::mean function too **Code Changes:** ```diff @@ -130,13 +130,29 @@ Scalar mean(InputArray _src, InputArray _mask) CV_Assert( mask.empty() || mask.type() == CV_8U ); int k, cn = src.channels(), dept...
Perhaps we should add a new macro which doesn't pass `retval` to HAL function: ```.cpp // name TBD #define CALL_HAL_RET2(name, fun, retval, ...) \ int res = __CV_EXPAND(fun(__VA_ARGS__)); \ if (res == CV_HAL_ERROR_OK) \ return retval; \ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ CV_Error_(cv::Error::StsInternal, \...
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/mean.dispatch.cpp **Change Type:** modified **Context:** PR #26895: Use HAL for cv::mean function too **Review Line:** 139 **Code Changes:** ```diff + + CV_Assert( cn <= 4 ); CV_IPP_RUN(IPP_VERSION_X100 >= 700, ipp_mean(src, mask, s), s) + if (src.isContinuous() && mask.isCont...
Usually we put HAL call before IPP.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/atan.hpp **Change Type:** added **Context:** PR #26853: Add RISC-V HAL implementation for fastAtan32f/fastAtan64f **Review Line:** 19 **Code Changes:** ```diff +#include <cfloat> + +namespace cv::cv_hal_rvv { + +namespace detail { +// ref: mathfuncs_core.simd.hpp +static constexp...
Could you add reference to the computation method, name, formula, whatever to identify the approach? Constants meaning and other arithmetic details will be more obvious with such details.
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/atan.hpp **Change Type:** added **Context:** PR #26853: Add RISC-V HAL implementation for fastAtan32f/fastAtan64f **Review Line:** 19 **Code Changes:** ```diff +#include <cfloat> + +namespace cv::cv_hal_rvv { + +namespace detail { +// ref: mathfuncs_core.simd.hpp +static constexp...
This implementation didn't introduce any new math approach, the constants were simply polynomial coefficients copied from https://github.com/opencv/opencv/blob/08a24ba2cf5007a2639035cc9661e18f3637223e/modules/core/src/mathfuncs_core.simd.hpp#L36-L39 Presumably it's a 7th degree polynomial approximation for Arctan(x) wh...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/inpainting.cpp **Change Type:** added **Context:** PR #26736: Added lama inpainting onnx model sample **Review Line:** 17 **Code Changes:** ```diff + + ./example_dnn_inpainting + The system will ask you to draw the mask on area to be inpainted + + You can download lama inpainting mod...
I propose to add reference to the original model and how it was converted, if it's not onnx or simplification was applied.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/inpainting.cpp **Change Type:** added **Context:** PR #26736: Added lama inpainting onnx model sample **Code Changes:** ```diff @@ -0,0 +1,230 @@ +/* +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 distributio...
{ formatting is different.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/inpainting.cpp **Change Type:** added **Context:** PR #26736: Added lama inpainting onnx model sample **Code Changes:** ```diff @@ -0,0 +1,230 @@ +/* +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 distributio...
I propose to print hot keys at the very beginning to make them more obvious.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/inpainting.cpp **Change Type:** added **Context:** PR #26736: Added lama inpainting onnx model sample **Review Line:** 13 **Code Changes:** ```diff +Copyright (C) 2025, Bigvision LLC. + +How to use: + Sample command to run: + + ./example_dnn_inpainting + The system will ask you to dr...
the comment should describe how to provide custom input, e.g. `./example_dnn_inpainting [--input=<image_name>]`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/inpainting.cpp **Change Type:** added **Context:** PR #26736: Added lama inpainting onnx model sample **Code Changes:** ```diff @@ -0,0 +1,230 @@ +/* +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 distributio...
there should be a loop: until user presses 'escape', he/she should be able to draw another mask on the same original image.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/inpainting.cpp **Change Type:** added **Context:** PR #26736: Added lama inpainting onnx model sample **Review Line:** 1 **Code Changes:** ```diff @@ -0,0 +1,230 @@ +/* +This file is part of OpenCV project. +It is subject to the license terms in the LICENSE file found in the top-level directory +...
OpenCV license should be inserted before BigVision copyright in order to avoid any confusion
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_io.cpp **Change Type:** modified **Context:** PR #26846: Fix bug with int64 support for FileStorage **Code Changes:** ```diff @@ -2003,6 +2003,64 @@ TEST(Core_InputOutput, FileStorage_invalid_attribute_value_regression_25946) ASSERT_EQ(0, std::remove(fileName.c_str())); } +// s...
pleas use `tempfile()` call for file name. Not all platforms allow file i/o in current directory.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_io.cpp **Change Type:** modified **Context:** PR #26846: Fix bug with int64 support for FileStorage **Review Line:** 2061 **Code Changes:** ```diff + fs["Int64Min"] >> value; + EXPECT_EQ(value, INT64_MIN); + + fs["Int64Max"] >> value; + EXPECT_EQ(value, INT6...
The file is not removed. Actually you can use in-memory representation of FileStorage to exclude file io from pipeline. See https://docs.opencv.org/4.x/da/d56/classcv_1_1FileStorage.html#a973e41cb75ef6230412a567723b7482dabdde7670c9c7e472f8445932ea7cbbf7
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_gif.cpp **Change Type:** modified **Context:** PR #26859: imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE **Code Changes:** ```diff @@ -14,7 +14,7 @@ namespace cv ////////////////////////////////////////////////////////////////////// GifDecoder::GifDecoder() { ...
It's error. I propose to include amount of channels to error message in printf style like https://github.com/opencv/opencv/blob/c21d0ad9d08d364542bb4a6eb971ee3051ccba63/modules/imgcodecs/src/grfmt_jpeg.cpp#L771
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/test/test_gif.cpp **Change Type:** modified **Context:** PR #26859: imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE **Code Changes:** ```diff @@ -241,17 +241,17 @@ TEST(Imgcodecs_Gif, read_gif_special){ const string gif_filename2 = root + "gifsuite/special2.gif"; cons...
the color conversion is not needed, if you use imread without flags.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/test/test_gif.cpp **Change Type:** modified **Context:** PR #26859: imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE **Code Changes:** ```diff @@ -241,17 +241,17 @@ TEST(Imgcodecs_Gif, read_gif_special){ const string gif_filename2 = root + "gifsuite/special2.gif"; cons...
'special1.png' and `special2.png` have alpha channel, but ‘special1.gif' and `special2.png` do not. Having different arguments to imread() for each image type would have obscured the purpose of the test, so I modified it so that all imread()s use the same arguments `cv::IMREAD_COLOR`.
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 #26859: imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE **Code Changes:** ```diff @@ -413,13 +413,13 @@ can be saved using this function, with these exceptions: - With JPEG 2000 encoder, 8-bit unsigned (CV...
8-bit single-channel images (CV_8UC1) are not supported by the GIF specification due to its limitation to indexed color formats.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/include/opencv2/imgcodecs.hpp **Change Type:** modified **Context:** PR #26859: imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE **Code Changes:** ```diff @@ -413,13 +413,13 @@ can be saved using this function, with these exceptions: - With JPEG 2000 encoder, 8-bit unsigned (CV...
note : i support the idea of getting help from AI about documentation improvements. The GIF encoder supports saving 8-bit unsigned (CV_8U) images. GIF images with an alpha channel can be saved using this function. To achieve this, create an 8-bit 4-channel (CV_8UC4) BGRA image, ensuring the alpha channel is the last co...
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/include/opencv2/imgcodecs.hpp **Change Type:** modified **Context:** PR #26859: imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE **Code Changes:** ```diff @@ -413,13 +413,13 @@ can be saved using this function, with these exceptions: - With JPEG 2000 encoder, 8-bit unsigned (CV...
updated document preview is here. https://pullrequest.opencv.org/buildbot/export/pr/26859/docs/d4/da8/group__imgcodecs.html#ga8ac397bd09e48851665edbe12aa28f25
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26854: Fix oss-fuzz bugs 391934081 and 392318892 **Code Changes:** ```diff @@ -325,15 +325,6 @@ bool PngDecoder::readHeader() bop = chunk.p[33]; } - if (id == id_bKGD) - { - // The...
It should be BGR by default, right?
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_png.cpp **Change Type:** modified **Context:** PR #26854: Fix oss-fuzz bugs 391934081 and 392318892 **Code Changes:** ```diff @@ -325,15 +325,6 @@ bool PngDecoder::readHeader() bop = chunk.p[33]; } - if (id == id_bKGD) - { - // The...
> It should be BGR by default, right? i think RGB is OK as far as i test before. to other applications opens the file.
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_png.cpp **Change Type:** modified **Context:** PR #26854: Fix oss-fuzz bugs 391934081 and 392318892 **Code Changes:** ```diff @@ -325,15 +325,6 @@ bool PngDecoder::readHeader() bop = chunk.p[33]; } - if (id == id_bKGD) - { - // The...
related test is also expect RGB
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26854: Fix oss-fuzz bugs 391934081 and 392318892 **Code Changes:** ```diff @@ -325,15 +325,6 @@ bool PngDecoder::readHeader() bop = chunk.p[33]; } - if (id == id_bKGD) - { - // The...
OpenCV uses BGR everywhere by default, including colors on drawing. We should align the implementation then.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26854: Fix oss-fuzz bugs 391934081 and 392318892 **Code Changes:** ```diff @@ -325,15 +325,6 @@ bool PngDecoder::readHeader() bop = chunk.p[33]; } - if (id == id_bKGD) - { - // The...
Right, that is what the doc says anyway
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/test/test_denoising.cpp **Change Type:** modified **Context:** PR #26831: added 16-bit support to fastNlMeansDenoising and updated tests **Code Changes:** ```diff @@ -165,4 +165,33 @@ TEST(Photo_Denoising, speed) printf("execution time: %gms\n", t*1000./getTickFrequency()); } +// Relate...
Please use cv::PSNR instead: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga3119e3ea73010a6f810bb05aa36ac8d6
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/OpenCVFindAVIF.cmake **Change Type:** modified **Context:** PR #26762: Fixed AVIF linkage on Windows **Code Changes:** ```diff @@ -19,7 +19,7 @@ if(TARGET avif) MARK_AS_ADVANCED(AVIF_LIBRARY) SET(AVIF_FOUND TRUE) - GET_TARGET_PROPERTY(AVIF_LIBRARY avif LOCATION) + SET(AVIF_LIBRARY avi...
Is this variable really necessary? I suppose all `INTERFACE_LINK_LIBRARIES` from `avif` target would be automatically linked by cmake. Perhaps we don't need to read target properties at all.
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/OpenCVFindAVIF.cmake **Change Type:** modified **Context:** PR #26762: Fixed AVIF linkage on Windows **Code Changes:** ```diff @@ -19,7 +19,7 @@ if(TARGET avif) MARK_AS_ADVANCED(AVIF_LIBRARY) SET(AVIF_FOUND TRUE) - GET_TARGET_PROPERTY(AVIF_LIBRARY avif LOCATION) + SET(AVIF_LIBRARY avi...
the difference was only in cmake output. now for shared and static lib output is like `AVIF: avif (ver 1.1.1)`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26851: fix related the issue 22551 **Code Changes:** ```diff @@ -126,9 +126,10 @@ const uint32_t id_acTL = 0x4C546361; // Animation control chunk const uint32_t id_fcTL = 0x4C546366; // Frame control chunk const uint32_t id_IDAT...
Please just move id_tExt to the line above and respect the alphabetical order. Thx. This PNG_USER_CHUNK_MALLOC_MAX could also be an env variable that the user can change.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26851: fix related the issue 22551 **Code Changes:** ```diff @@ -126,9 +126,10 @@ const uint32_t id_acTL = 0x4C546361; // Animation control chunk const uint32_t id_fcTL = 0x4C546366; // Frame control chunk const uint32_t id_IDAT...
> Please just move id_tExt to the line above and respect the alphabetical order. Thx. This PNG_USER_CHUNK_MALLOC_MAX could also be an env variable that the user can change. done.
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_jpegxl.cpp **Change Type:** modified **Context:** PR #26844: imgcodecs: jpegxl: imdecode() directly read from memory **Code Changes:** ```diff @@ -28,13 +28,15 @@ static void cbRGBAtoGRAY_32F(void *opaque, size_t x, size_t y, size_t num_pixels /////////////////////// JpegXLDeco...
If I understood correctly, The m_read_buffer is resized only once here ant it's size is always 16k. The `m_read_buffer` is used in ::read() only. M.b. it's better to make it local variable there. If you need the buffer shared between readHeader and readData then it makes sense to initialize the buffer in decoder constr...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26835: Corrections on bKGD chunk writing and reading in PNG **Code Changes:** ```diff @@ -327,11 +327,10 @@ bool PngDecoder::readHeader() if (id == id_bKGD) { // The spec is actually more complex: h...
You should use png_get_uint_16
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26835: Corrections on bKGD chunk writing and reading in PNG **Code Changes:** ```diff @@ -327,11 +327,10 @@ bool PngDecoder::readHeader() if (id == id_bKGD) { // The spec is actually more complex: h...
Actually, let's follow the spec: `size != 8 + 1 && size != 8 + 2 && size != 8 + 6`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/grfmt_png.cpp **Change Type:** modified **Context:** PR #26835: Corrections on bKGD chunk writing and reading in PNG **Review Line:** 726 **Code Changes:** ```diff + // 8=HDR+size, (1, 2 or 6)=size of bKGD chunk, 4=CRC // The spec is actually more complex: // ht...
Thx, I had forgotten the CRC !
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/perf/perf_decode_encode.cpp **Change Type:** added **Context:** PR #26872: Performance tests for image encoders and decoders and code cleanup **Review Line:** 70 **Code Changes:** ```diff + +PERF_TEST_P(Decode, bgr, testing::ValuesIn(exts)) +{ + String filename = getDataPath("perf/1920x1...
`EXPECT_FALSE(src.empty()) << Cannot open test image perf/1920x1080.png`;
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/perf/perf_decode_encode.cpp **Change Type:** added **Context:** PR #26872: Performance tests for image encoders and decoders and code cleanup **Review Line:** 84 **Code Changes:** ```diff + +PERF_TEST_P(Decode, rgb, testing::ValuesIn(exts)) +{ + String filename = getDataPath("perf/1920x1...
`EXPECT_FALSE(src.empty()) << Cannot open test image perf/1920x1080.png;`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/perf/perf_decode_encode.cpp **Change Type:** added **Context:** PR #26872: Performance tests for image encoders and decoders and code cleanup **Code Changes:** ```diff @@ -0,0 +1,131 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found...
Add sanity check if the file read correctly.
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/norm.cpp **Change Type:** modified **Context:** PR #26804: Add RISC-V HAL implementation for cv::norm and cv::normalize **Review Line:** 630 **Code Changes:** ```diff Mat src = _src.getMat(), mask = _mask.getMat(); + int depth = src.depth(), cn = src.channels(); + if( src.dims <= ...
Usually we have HAL call before IPP branch (and after OCL).
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/norm.cpp **Change Type:** modified **Context:** PR #26804: Add RISC-V HAL implementation for cv::norm and cv::normalize **Review Line:** 1127 **Code Changes:** ```diff + Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat(); + int depth = src1.depth(), cn = src1.chann...
Usually we have HAL call before IPP branch (and after OCL).
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/norm.cpp **Change Type:** modified **Context:** PR #26804: Add RISC-V HAL implementation for cv::norm and cv::normalize **Review Line:** 1127 **Code Changes:** ```diff + Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat(); + int depth = src1.depth(), cn = src1.chann...
Fixed. `ipp_norm` supports CV_RELATIVE, so I have to modify HAL implement to move CALL_HAL before IPP.
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/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #26789: Add RISC-V HAL implementation for minMaxIdx **Review Line:** 912 **Code Changes:** ```diff @@ -911,8 +911,26 @@ inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* s inline int hal_ni_minMaxIdx(...
It breaks existing HAL implementations.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #26789: Add RISC-V HAL implementation for minMaxIdx **Review Line:** 912 **Code Changes:** ```diff @@ -911,8 +911,26 @@ inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* s inline int hal_ni_minMaxIdx(...
Should I create a new HAL interface, or just simply remove these lines below? https://github.com/opencv/opencv/blob/133fda3c56bc7199de86c94f1522d56d7253bc6a/modules/core/src/minmax.cpp#L1515-L1519 Without `mask_step` argument, it is impossible to implement the HAL when mask is not continuous.
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #26789: Add RISC-V HAL implementation for minMaxIdx **Review Line:** 912 **Code Changes:** ```diff @@ -911,8 +911,26 @@ inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* s inline int hal_ni_minMaxIdx(...
I have tried to keep the ABI by creating a new interface.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/hal_rvv/hal_rvv_1p0/minmax.hpp **Change Type:** added **Context:** PR #26789: Add RISC-V HAL implementation for minMaxIdx **Code Changes:** ```diff @@ -0,0 +1,335 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +...
In general it is hard to debug multi-line macros. C++ template-based approach is preferable.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** 3rdparty/ippicv/ippicv.cmake **Change Type:** modified **Context:** PR #26463: Update IPP integration - Please merge together with https://github.com/opencv/opencv_3rdparty/pull/88 Supported IPP version was updated to ... **Review Line:** 5 **Code Changes:** ```diff @@ -2,7 +2,7 @@ function(download_ippicv r...
- [ ] Shouldn't it be different for x86 and x86_64 as only x86_64 ICV packages are available since IPP 2022.0.0?
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/filter.hpp **Change Type:** modified **Context:** PR #26850: Update includes in filter.hpp **Review Line:** 47 **Code Changes:** ```diff @@ -43,6 +43,9 @@ #ifndef OPENCV_IMGPROC_FILTER_HPP #define OPENCV_IMGPROC_FILTER_HPP +#include <opencv2/core.hpp> +#include <vector> + namespace c...
please add space before namespace.
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_android_camera.cpp **Change Type:** modified **Context:** PR #26837: Zoom functionality for Android native camera capture **Review Line:** 433 **Code Changes:** ```diff { @@ -437,6 +430,12 @@ class AndroidCameraCapture : public IVideoCapture retur...
I propose to document the option for Android in https://github.com/opencv/opencv/blob/ab77e1cfc87d7908c09fa4d11cbeaac9e4c663fb/modules/videoio/include/opencv2/videoio.hpp#L171.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/include/opencv2/imgproc.hpp **Change Type:** modified **Context:** PR #26836: Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding **Code Changes:** ```diff @@ -329,7 +329,8 @@ enum ThresholdTypes { THRESH_TOZERO_INV = 4, //!< \f[\texttt{dst} (x,y) = \fork{0}...
The name is very controversial. I propose `THRESH_DRYRUN` 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:** modules/imgproc/test/ocl/test_imgproc.cpp **Change Type:** modified **Context:** PR #26836: Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding **Code Changes:** ```diff @@ -386,6 +386,40 @@ OCL_TEST_P(Threshold, Mat) } } +struct Threshold_Dryrun : + public Imgproc...
Dryrun in naming too.