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_avif.cpp
**Change Type:** modified
**Context:** PR #25608: Animated WebP and AVIF Support
**Code Changes:**
```diff
@@ -11,6 +11,7 @@
#include <memory>
#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.hpp>
#include "opencv2/imgproc.... | Looks like timestamps are used differently in writemulti and writeanimation. If I got correctly, timestamps contains frame duration rather then timestamp. In this case, `timestamp` should not be incremented, but set equal to 10 once outside the loop. Also I recommends something like 33ms (fps). |
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_avif.cpp
**Change Type:** modified
**Context:** PR #25608: Animated WebP and AVIF Support
**Code Changes:**
```diff
@@ -11,6 +11,7 @@
#include <memory>
#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.hpp>
#include "opencv2/imgproc.... | i removed the line `timestamp += 10;` |
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 #25608: Animated WebP and AVIF Support
**Code Changes:**
```diff
@@ -218,6 +218,36 @@ enum ImwriteHDRCompressionFlags {
//! @} imgcodecs_flags
+/** @brief Represents an animation with multiple frames.
+The `Animati... | Let it be BGRA as everywhere in OpenCV. |
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 #25608: Animated WebP and AVIF Support
**Code Changes:**
```diff
@@ -218,6 +218,36 @@ enum ImwriteHDRCompressionFlags {
//! @} imgcodecs_flags
+/** @brief Represents an animation with multiple frames.
+The `Animati... | Also you can use cv::Scalar. |
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_base.hpp
**Change Type:** modified
**Context:** PR #25608: Animated WebP and AVIF Support
**Code Changes:**
```diff
@@ -133,6 +133,8 @@ class BaseImageDecoder {
*/
virtual bool checkSignature(const String& signature) const;
+ const Animation& animation() const { re... | That should be a `Animation&`. Maybe a `const Animation&` if it compiles. |
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_avif.cpp
**Change Type:** modified
**Context:** PR #25608: Animated WebP and AVIF Support
**Code Changes:**
```diff
@@ -11,6 +11,7 @@
#include <memory>
#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.hpp>
#include "opencv2/imgproc.... | move this line to above avifEncoderAddImage because avifEncoderAddImage expects a duration, not a timestamp. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/opengl.cpp
**Change Type:** modified
**Context:** PR #26281: Rewrote OpenCL-OpenGL-interop device discovery routine without extensions and with Apple support
**Review Line:** 1671
**Code Changes:**
```diff
- {
- // query platform extension: presence of "cl_khr_gl_sharing" extension... | Let's use `std::vector<>` or `cv::AutoBuffer` for locals to prevent leaks. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/core/src/opengl.cpp
**Change Type:** modified
**Context:** PR #26281: Rewrote OpenCL-OpenGL-interop device discovery routine without extensions and with Apple support
**Review Line:** 1688
**Code Changes:**
```diff
+ if(extensionSize > 0)
+ {
+ char* e... | The same on memory management. |
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/opengl.cpp
**Change Type:** modified
**Context:** PR #26281: Rewrote OpenCL-OpenGL-interop device discovery routine without extensions and with Apple support
**Review Line:** 1724
**Code Changes:**
```diff
+ oldPos = spacePos + 1;
+ space... | Let's extract extension search as dedicated static function. It should make the code more readable. |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -0,0 +1,420 @@
+// 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 di... | please use modern copyright header like in https://github.com/opencv/opencv/blob/4.x/modules/dnn/src/backend.cpp |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -0,0 +1,420 @@
+// 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 di... | OpenCV supports IMREAD_COLOR_RGB flag to get RGB without conversion. |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -0,0 +1,420 @@
+// 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 di... | I propose to use `num_worker_threads = cv::getNumThreads()` to make it manageable outside. See https://docs.opencv.org/4.x/db/de0/group__core__utils.html#ga2db334ec41d98da3129ef4a2342fc4d4 |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -0,0 +1,420 @@
+// 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 di... | OpenCV's `imread` is exception safe. Please use CV_LOG_WARNING and analogs and return satus instead of exception. |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -0,0 +1,420 @@
+// 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 di... | cv::getNumThreads(). |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -0,0 +1,420 @@
+// 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 di... | Can you pls elaborate? An example? |
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/OpenCVFindJPEGXL.cmake
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Review Line:** 52
**Code Changes:**
```diff
+#]=======================================================================]
+
+if(NOT OPENCV_SKIP_JPEGXL_FIND_PACKAGE)
+find_package(PkgConfig QUIET)
+if (... | I tried building standalone libjxl and it uses `libjxl` name for pkg-config, so this line fails to find it. I understand that this file is taken from another project, but perhaps we could tune it slightly for our needs. Another thing in my opinion is that it mixes pkg-config and separate `find_*` calls, it could result... |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Code Changes:**
```diff
@@ -306,6 +306,9 @@ OCV_OPTION(WITH_OPENJPEG "Include JPEG2K support (OpenJPEG)" ON
OCV_OPTION(WITH_JPEG "Include JPEG support" ON
VISIBLE_IF TRUE
VERIFY HAVE_JPEG)
+OCV_OPTION(WI... | Maybe we should turn it OFF by default for some time to stabilize this integration. |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Review Line:** 214
**Code Changes:**
```diff
+ }
+ if (!pimg)
+ return true;
+ break;
+ }
+ case JXL_DE... | Is it possible that this event will occure before `JXL_DEC_BASIC_INFO`? I didn't find this guarantee in the libjxl documentation. |
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/OpenCVFindJPEGXL.cmake
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Review Line:** 50
**Code Changes:**
```diff
+ this should be passed to target_compile_options(), if the
+ target is not used for linking
+#]=========================================================... | There is the same call in the root cmake-file: https://github.com/opencv/opencv/blob/6873bdee70528ba6101bd5f4091b5f5302ee70c9/CMakeLists.txt#L710 We don't need to repeat it here. |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Review Line:** 118
**Code Changes:**
```diff
+
+ // Create image if needed
+ if (m_type != -1 && pimg) {
+ pimg->create(m_height, m_width, m_type);
+ if (!pimg->isContin... | Log warning at least. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgcodecs/test/test_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Review Line:** 37
**Code Changes:**
```diff
+ break;
+ default:
+ case CV_8U:
+ col = cv::Scalar(124, 76, 42, 192);
+ th = 3; // = 255 / 100 (... | Add assert to default branch. |
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_jpegxl.cpp
**Change Type:** added
**Context:** PR #26379: Add jxl (JPEG XL) codec support
**Review Line:** 85
**Code Changes:**
```diff
+ break;
+ default:
+ case CV_8U:
+ col = cv::Scalar(124, 76, 42, 192);
+ th = 3; // = 255 / 100 (... | Add assert to default branch. |
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 #26254: Added extra tests for reshape
**Review Line:** 2687
**Code Changes:**
```diff
+ EXPECT_EQ(m.total(), v.size());
+
+ int sz[] = {(int)v.size()};
+ Mat m1 = m.reshape(0, 1, sz);
+ EXPECT_EQ(m1.dims, 1);
+ EXPECT_EQ(... | Signature for `_EQ` is `ASSERT_EQ(expected_reference, actual_result);`. Correct order of parameters are required to emit valid error messages. Reference: https://github.com/opencv/opencv/blob/4.0.0/modules/ts/include/opencv2/ts/ts_gtest.h#L8196-L8200 ``` GTEST_API_ AssertionResult EqFailure(const char* expected_express... |
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 #26254: Added extra tests for reshape
**Code Changes:**
```diff
@@ -2669,4 +2669,219 @@ TEST(Mat, regression_26322)
EXPECT_EQ(0, (int)mat3.total());
}
+TEST(Mat, reshape_1d)
+{
+ std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, ... | It should be just 2, but not `newrows`. They are not correlated. |
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 #26254: Added extra tests for reshape
**Code Changes:**
```diff
@@ -2669,4 +2669,219 @@ TEST(Mat, regression_26322)
EXPECT_EQ(0, (int)mat3.total());
}
+TEST(Mat, reshape_1d)
+{
+ std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, ... | The same newrows -> 2. |
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/umatrix.cpp
**Change Type:** modified
**Context:** PR #26254: Added extra tests for reshape
**Code Changes:**
```diff
@@ -1063,9 +1063,6 @@ UMat UMat::reshape(int new_cn, int new_rows) const
CV_Error( cv::Error::BadStep,
"The matrix is not continuous, thus its numbe... | should it be a part of dst.create()? |
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/matrix.cpp
**Change Type:** modified
**Context:** PR #26254: Added extra tests for reshape
**Review Line:** 1743
**Code Changes:**
```diff
- if( new_rows > 0 )
- {
- int sz[] = { new_rows, (int)(total()*cn/new_rows) };
- return reshape(new_cn, 2, sz);
- ... | Looks like the assert is redundant here. if (new_rows == 0) leads to return. |
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 #26254: Added extra tests for reshape
**Review Line:** 1743
**Code Changes:**
```diff
- if( new_rows > 0 )
- {
- int sz[] = { new_rows, (int)(total()*cn/new_rows) };
- return reshape(new_cn, 2, sz);
- ... | what about `new_rows < 0` case? we should handle 'bad args' somehow |
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/umatrix.cpp
**Change Type:** modified
**Context:** PR #26254: Added extra tests for reshape
**Code Changes:**
```diff
@@ -1063,9 +1063,6 @@ UMat UMat::reshape(int new_cn, int new_rows) const
CV_Error( cv::Error::BadStep,
"The matrix is not continuous, thus its numbe... | please, look more carefully. This is called _after_ release(), not after create(). I found that empty matrix is not copied correctly, type is replaced with 'CV_8U', which is wrong in general. This code fixes 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_io.cpp
**Change Type:** modified
**Context:** PR #26446: Empty Mat in FileStorage
**Code Changes:**
```diff
@@ -2018,7 +2018,25 @@ T fsWriteRead(const T& expectedValue, const char* ext)
return value;
}
+void testExactMat(const Mat& src, const char* ext)
+{
+ bool srcIsEmpty ... | We do not have 1d Mat support in 4.x. 2+d only. |
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/base.hpp
**Change Type:** modified
**Context:** PR #26101: C-API cleanup: moved cvErrorStr to new interface, minor ts changes - Merge with opencv/opencv_contrib#3786 **Note:** `toString` might be to...
**Code Changes:**
```diff
@@ -60,72 +60,6 @@
namespace cv
{
-//! @add... | `int` -> `Code` at least to enable C++ ADL without explicit namespace. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/ts/src/ts.cpp
**Change Type:** modified
**Context:** PR #26101: C-API cleanup: moved cvErrorStr to new interface, minor ts changes - Merge with opencv/opencv_contrib#3786 **Note:** `toString` might be to...
**Review Line:** 545
**Code Changes:**
```diff
@@ -544,7 +542,7 @@ static int tsErrorCallback(... | Note: used numeric code here instead of string |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/dnn_utils.cpp
**Change Type:** modified
**Context:** PR #26127: Faster implementation of blobFromImages for cpu nchw output
**Code Changes:**
```diff
@@ -126,6 +126,111 @@ Mat blobFromImagesWithParams(InputArrayOfArrays images, const Image2BlobParams&
return blob;
}
+template<typename... | ```CV_BadDepth``` -> ```Error::BadDepth``` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/dnn/src/dnn_utils.cpp
**Change Type:** modified
**Context:** PR #26127: Faster implementation of blobFromImages for cpu nchw output
**Code Changes:**
```diff
@@ -126,6 +126,111 @@ Mat blobFromImagesWithParams(InputArrayOfArrays images, const Image2BlobParams&
return blob;
}
+template<typename... | ```CV_StsNotImplemented ``` -> ```Error::StsNotImplemented``` |
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_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder
**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
else if (pad_num <= 4)
{
int payload_size = (int)payload.s... | Error should be raise instead of providing of wrong result. Need to modify check on the line 1328 with current `CV_Assert(idx < data.size());` |
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_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder
**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
else if (pad_num <= 4)
{
int payload_size = (int)payload.s... | I propose assert here instead of condition. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/qrcode_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder
**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
else if (pad_num <= 4)
{
int payload_size = (int)payload.s... | Just here is nit enough. `while` loop above has the same issue with buffer access. |
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_encoder.cpp
**Change Type:** modified
**Context:** PR #26532: objdetect: fix invalid vector access in QR de/encoder
**Code Changes:**
```diff
@@ -711,17 +711,17 @@ void QRCodeEncoderImpl::padBitStream()
else if (pad_num <= 4)
{
int payload_size = (int)payload.s... | If we add assertion here, our tests will fail because there are cases where more bits are being read. We need to fix these cases first. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #25500: V4l default image size
**Review Line:** 1010
**Code Changes:**
```diff
CV_LOG_DEBUG(NULL, "VIDEOIO(V4L2:" << _deviceName << "): opening...");
FirstCapture = true;
- width = DEFAULT_V4L_WIDTH;
- height = DEFAULT_... | What is about `const VideoCaptureParameters& params` approach? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #25500: V4l default image size
**Review Line:** 1010
**Code Changes:**
```diff
CV_LOG_DEBUG(NULL, "VIDEOIO(V4L2:" << _deviceName << "): opening...");
FirstCapture = true;
- width = DEFAULT_V4L_WIDTH;
- height = DEFAULT_... | Unfortunately it won't work. The VideoCaptureParameters parameter is applied only after the fn_createCaptureCamera_ call. Here is the sequence: - The `createCapture` is called with the `VideoCaptureParameters` - The `createCapture` calls the configured `fn_createCaptureCamera_` function of the capture backend (which is... |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/js/generator/embindgen.py
**Change Type:** modified
**Context:** PR #26147: js: fix enum generation issues
**Review Line:** 942
**Code Changes:**
```diff
if ns_name.split('.')[0] != 'cv':
continue
+ # TODO CALIB_FIX_FOCAL_LENGTH is defined both in ... | What if use `namespace_prefix_override` solution like for the functions? Namespace is already appended to the function names, if it's not overridden by config. It's less hacky and more obvious. |
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/js/generator/embindgen.py
**Change Type:** modified
**Context:** PR #26147: js: fix enum generation issues
**Review Line:** 942
**Code Changes:**
```diff
if ns_name.split('.')[0] != 'cv':
continue
+ # TODO CALIB_FIX_FOCAL_LENGTH is defined both in ... | I guess that would work but I don't know how to use it. Should all the enums be added to https://github.com/opencv/opencv/blob/450e741f8d53ff12b4e194c7762adaefb952555a/modules/js/generator/embindgen.py#L989 ? |
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/highgui/src/window_cocoa.mm
**Change Type:** modified
**Context:** PR #26625: Cocoa/highgui: fix leak in cvGetWindowRect_COCOA
**Code Changes:**
```diff
@@ -662,14 +662,16 @@ CvRect cvGetWindowRect_COCOA( const char* name )
{
CV_ERROR( CV_StsNullPtr, "NULL window" );
} else {
- ... | The reason I use autorelease pools directly is to maintain consistent coding style. In this file, all 12 instances of autorelease pool is called directly: https://github.com/opencv/opencv/blob/645fd3dffaa50e0b5dd011720048441986640d7e/modules/highgui/src/window_cocoa.mm#L194 https://github.com/opencv/opencv/blob/645fd3d... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26621: FastCV-based HAL for OpenCV acceleration 2ndpost-3
**Code Changes:**
```diff
@@ -992,4 +992,59 @@ int fastcv_hal_cvtBGRtoYUVApprox(
fcvStatus status = FASTCV_SUCCESS;
CV_HAL_RETURN(status, hal_BGRtoYUVApp... | 1. Looks like lowThresh and highThresh are redundant. 2. What if, lowThresh=12.999999999? I propose to use check with epsilon. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538
**Code Changes:**
```diff
- return status == ACAMERA_OK;
+ return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SEN... | There are complains about Samsung devices support here: https://stackoverflow.com/questions/23336907/what-is-the-difference-between-flash-mode-torch-and-flash-mode-on. Could you take a look? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 777
**Code Changes:**
```diff
+ {
+ ACaptureRequest *request = captureRequest.get();
+
+ return request &&
+ setFn(request, tag, 1, ... | Why do we need it for every ACaptureRequest_setEntryXXX call? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 603
**Code Changes:**
```diff
@@ -561,7 +600,7 @@ class AndroidCameraCapture : public IVideoCapture
return false;
}
std::shared_ptr<... | The change does nothing. Default constructor was called in old version 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/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538
**Code Changes:**
```diff
- return status == ACAMERA_OK;
+ return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SEN... | Hmm, I don't know. My primary test device is a SONY. I will try, if FLASH_MODE_ON will work as well. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 777
**Code Changes:**
```diff
+ {
+ ACaptureRequest *request = captureRequest.get();
+
+ return request &&
+ setFn(request, tag, 1, ... | Yes. It is not sufficient to update the metadata only. Re-submitting the capture request will make the change effective after the current request has finished. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 603
**Code Changes:**
```diff
@@ -561,7 +600,7 @@ class AndroidCameraCapture : public IVideoCapture
return false;
}
std::shared_ptr<... | ACameraMetadata_const_entry is a POD and doesn't have a user-declared constructor. So it's uninitialized unless we specify the braces. In this particular case the result of the following call to ACameraMetadata_getConstEntry() is not explicitly checked. Instead we rely on the fact, that the member 'count' is zero in ca... |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538
**Code Changes:**
```diff
- return status == ACAMERA_OK;
+ return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SEN... | Just tested torch with Xiaomi Mi 10 and Samsung Galaxy S10. Both works well. Let's ignore it 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/videoio/src/cap_android_camera.cpp
**Change Type:** modified
**Context:** PR #26627: Android camera feature enhancements
**Review Line:** 538
**Code Changes:**
```diff
- return status == ACAMERA_OK;
+ return submitRequest(ACaptureRequest_setEntry_i32, ACAMERA_SEN... | According to https://developer.android.com/reference/android/hardware/Camera.Parameters FLASH_MODE_ON is part of the old API. Camera2 has FLASH_MODE_OFF, FLASH_MODE_SINGLE and FLASH_MODE_TORCH only. |
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/seamless_cloning_impl.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Review Line:** 332
**Code Changes:**
```diff
@@ -332,11 +332,13 @@ void Cloning::normalClone(const Mat &destination, const Mat &patch, Mat &binaryM
switch(flag)
{
... | The condition is a bit hacky and depends on enum values. I propose to extend "case:" sentences and/or add explicit conditions to make _ALT branch obvious from the code for reader. |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | The `p` parameter does not have default value like `Point p = Point()`. It means that the point is user provided value. I do not think that we sound handle `Point()`, a.k.a. (0,0) as special case. |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | Let's enumerate flag values here to make obvious for core readers. |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | what about using Point(-1,-1) to centralize as special case ? |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | Why do we need special cases in code? User should provide location, shouldn't he/she? |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | "In issue #15928, the user reports: >>I had: ``` src.shape = 500,500 src_mask = 500,500 dest.shape = 500,500 h, w = src_mask.shape[:2] ``` >>At this point, I didn't see the need for the required argument `p`, as I expected the function to automatically match the mask. However, since `p` is a required argument, I provid... |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | also in the issue the user commented >>I got the expected behaviour by using a rect of thickness 2 ``` h, w = src_mask.shape[:2] # rect of thickness > 1 cv2.rectangle(src_mask,(0,0), (w, h) ,255, 2) # the clone will now aligns from the centre out=cv2.seamlessClone(src, dest, src_mask,(w//2, h//2),flags= cv2.NORMAL_CLON... |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | i will revert this idea if you want. |
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/seamless_cloning.cpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -47,18 +47,17 @@
using namespace std;
using namespace cv;
-static Mat checkMask(InputArray _mask, Size size)
+static Mat checkMask(InputArray mask, S... | there is related issues on some repos like https://github.com/OpenTalker/SadTalker/issues/542 let me investigate if ``` { p.x = dest.size().width / 2; p.y = dest.size().height / 2; } ``` works perfectly fine for different dimensions |
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.hpp
**Change Type:** modified
**Context:** PR #26511: Add *_WIDE flags to cv::seamlessClone
**Code Changes:**
```diff
@@ -708,33 +708,74 @@ CV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray co
//! @{
-//! seamlessClone algorithm flags
-enum... | I propose to name it not _ALT, but _WIDE to have some meaning in the option name here and in all other places. |
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_png.cpp
**Change Type:** modified
**Context:** PR #26181: Enable PNG exif orientation test
**Code Changes:**
```diff
@@ -109,100 +109,6 @@ TEST(Imgcodecs_Png, read_color_palette_with_alpha)
EXPECT_EQ(img.at<Vec3b>(0, 1), Vec3b(255, 0, 0));
}
-/**
- * Test for check whether... | The test itself is still disabled. |
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/loadsave.cpp
**Change Type:** modified
**Context:** PR #26181: Enable PNG exif orientation test
**Code Changes:**
```diff
@@ -83,6 +83,9 @@ static Size validateInputImageSize(const Size& size)
static inline int calcType(int type, int flags)
{
+ if ( (flags & (IMREAD_COLOR | IMREA... | There is [cv::IMREAD_ANYCOLOR](https://docs.opencv.org/4.x/d8/d6a/group__imgcodecs__flags.html#gga61d9b0126a3e57d9277ac48327799c80ab6573b69300c092b61800222fe555953) option. It should presume alpha channel, if it's present in the original image. |
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/loadsave.cpp
**Change Type:** modified
**Context:** PR #26181: Enable PNG exif orientation test
**Code Changes:**
```diff
@@ -83,6 +83,9 @@ static Size validateInputImageSize(const Size& size)
static inline int calcType(int type, int flags)
{
+ if ( (flags & (IMREAD_COLOR | IMREA... | see the issues #22090 #21695 related cv::IMREAD_ANYCOLOR |
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_png.cpp
**Change Type:** modified
**Context:** PR #26181: Enable PNG exif orientation test
**Code Changes:**
```diff
@@ -109,100 +109,6 @@ TEST(Imgcodecs_Png, read_color_palette_with_alpha)
EXPECT_EQ(img.at<Vec3b>(0, 1), Vec3b(255, 0, 0));
}
-/**
- * Test for check whether... | when ``` m_img = imread(filename, IMREAD_ANYCOLOR); ASSERT_FALSE(m_img.empty()); EXPECT_EQ(4, m_img.channels()); ``` **the test fails ** [----------] 8 tests from ExifFiles/Imgcodecs_PNG_Exif [ RUN ] ExifFiles/Imgcodecs_PNG_Exif.exif_orientation/0, where GetParam() = "readwrite/testExifOrientation_1.png" C:\build\preco... |
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/test/test_exif.cpp
**Change Type:** added
**Context:** PR #26181: Enable PNG exif orientation test
**Review Line:** 52
**Code Changes:**
```diff
+ *
+ * Note:
+ * The flags parameter of the imread function is set as IMREAD_COLOR | IMREAD_ANYCOLOR | IMREAD_ANYDEPTH.
+ * Using this combinatio... | I propose to add it to documentation. |
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26623: Update KleidiCV to version 0.3
**Review Line:** 9
**Code Changes:**
```diff
option(KLEIDICV_ENABLE_SME2 "" OFF) # not compatible with some CLang versions in NDK
include("${KLEIDICV_SOURCE_PATH}/adapters/opencv/CMakeLists... | Need to include through `-isystem` to avoid warnings from these external headers. https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html Example: https://github.com/opencv/opencv/blob/4.10.0/3rdparty/protobuf/CMakeLists.txt#L154 |
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/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26623: Update KleidiCV to version 0.3
**Review Line:** 9
**Code Changes:**
```diff
option(KLEIDICV_ENABLE_SME2 "" OFF) # not compatible with some CLang versions in NDK
include("${KLEIDICV_SOURCE_PATH}/adapters/opencv/CMakeLists... | The issue happens inside cpp file, not header. So the `-isystem` flag is not applicable here. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26623: Update KleidiCV to version 0.3
**Review Line:** 9
**Code Changes:**
```diff
option(KLEIDICV_ENABLE_SME2 "" OFF) # not compatible with some CLang versions in NDK
include("${KLEIDICV_SOURCE_PATH}/adapters/opencv/CMakeLists... | Why does this widely used approach not work? https://github.com/opencv/opencv/blob/4.10.0/3rdparty/libjpeg-turbo/CMakeLists.txt#L11 |
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/kleidicv/CMakeLists.txt
**Change Type:** modified
**Context:** PR #26623: Update KleidiCV to version 0.3
**Review Line:** 9
**Code Changes:**
```diff
option(KLEIDICV_ENABLE_SME2 "" OFF) # not compatible with some CLang versions in NDK
include("${KLEIDICV_SOURCE_PATH}/adapters/opencv/CMakeLists... | I tried it. Most probably the issue is that the ocv_disable_warning works well inside the cmake "project" scope, but does not outside. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | I propose to add at least CV_Assert here. Just for the case, if invoker code will be changed incorrectly in future. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | I propose to add at least CV_Assert here. Just for the case, if invoker code will be changed incorrectly in future. |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | which param do you think we should add assert? or I can return CV_HAL_ERROR_NOT_IMPLEMENTED |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | which param do you think we should add assert? or I can raise some error messages as it already in parallel we can't return CV_HAL_ERROR_NOT_IMPLEMENTED |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | You can use just `CV_Error()` statement then. The branch should not be reachable in normal configuration. |
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/fastcv/include/fastcv_hal_imgproc.hpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Review Line:** 117
**Code Changes:**
```diff
@@ -20,7 +20,12 @@
#define cv_hal_gaussianBlurBinomial fastcv_hal_gaussianBlurBinomial
#undef cv_hal_warpPerspe... | Why is it removed? M.b. rebase issue? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | I propose to use local variable on stack. new is redundant here. Also it's not deleted afterwards. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | I propose to use local variable on stack. new is redundant here. Also it's not deleted afterwards. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Review Line:** 907
**Code Changes:**
```diff
+ int scn,
+ bool swapBlue,
+ bool isFullRange,
+ bool isHSV)... | Are you sure in sign? Does it work for small sizes only? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | `!isHSV || !isFullRange`? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | `!swapBlue` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | The same for bools. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Code Changes:**
```diff
@@ -743,4 +743,253 @@ int fastcv_hal_warpPerspective(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Src type:%s is not supported", cv:... | > The same for bools. Added the suggested fixes |
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/fastcv/include/fastcv_hal_imgproc.hpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Review Line:** 117
**Code Changes:**
```diff
@@ -20,7 +20,12 @@
#define cv_hal_gaussianBlurBinomial fastcv_hal_gaussianBlurBinomial
#undef cv_hal_warpPerspe... | > Why is it removed? M.b. rebase issue? It was added here by mistake, will be added in 3rd PR [opencv/opencv#26621](https://github.com/opencv/opencv/pull/26621) |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26619: FastCV-based HAL for OpenCV acceleration 2ndpost-2
**Review Line:** 907
**Code Changes:**
```diff
+ int scn,
+ bool swapBlue,
+ bool isFullRange,
+ bool isHSV)... | > Are you sure in sign? Does it work for small sizes only? Currently yes, we will add more resolutions later on. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26617: FastCV-based HAL for OpenCV acceleration 2ndpost-1
**Code Changes:**
```diff
@@ -34,7 +34,7 @@ int fastcv_hal_medianBlur(
INITIALIZATION_CHECK;
- fcvStatus status;
+ fcvStatus status = FASTCV_SUCCESS;
... | Can you get rid of memcopy? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26617: FastCV-based HAL for OpenCV acceleration 2ndpost-1
**Code Changes:**
```diff
@@ -34,7 +34,7 @@ int fastcv_hal_medianBlur(
INITIALIZATION_CHECK;
- fcvStatus status;
+ fcvStatus status = FASTCV_SUCCESS;
... | The same question on copy. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26617: FastCV-based HAL for OpenCV acceleration 2ndpost-1
**Code Changes:**
```diff
@@ -34,7 +34,7 @@ int fastcv_hal_medianBlur(
INITIALIZATION_CHECK;
- fcvStatus status;
+ fcvStatus status = FASTCV_SUCCESS;
... | OK, I got why you need extra buffer and memcpy. Please add comment why you did it into the code. it's not obvious for readers. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26617: FastCV-based HAL for OpenCV acceleration 2ndpost-1
**Code Changes:**
```diff
@@ -34,7 +34,7 @@ int fastcv_hal_medianBlur(
INITIALIZATION_CHECK;
- fcvStatus status;
+ fcvStatus status = FASTCV_SUCCESS;
... | The same proposal. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** 3rdparty/fastcv/src/fastcv_hal_imgproc.cpp
**Change Type:** modified
**Context:** PR #26617: FastCV-based HAL for OpenCV acceleration 2ndpost-1
**Code Changes:**
```diff
@@ -34,7 +34,7 @@ int fastcv_hal_medianBlur(
INITIALIZATION_CHECK;
- fcvStatus status;
+ fcvStatus status = FASTCV_SUCCESS;
... | when the input is ROI, we need additional lines to on top and bottom to be border, for example ksize is 3, we need 1 more line at top and 1 more line at bottom, the input height for fastcv function will become range.end-range.start+2, we use a tmp var to store this result and use memcpy to copy it back to dst. But now ... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/calibration.cpp
**Change Type:** modified
**Context:** PR #26490: Switch calibration.cpp to C++
**Code Changes:**
```diff
@@ -58,8 +58,6 @@
namespace cv {
-static const char* cvDistCoeffErr = "Distortion coefficients must be 1x4, 4x1, 1x5, 5x1, 1x8, 8x1, 1x12, 12x1, 1x14 or 14x1 floa... | most probably is not needed. |
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/calibration.cpp
**Change Type:** modified
**Context:** PR #26490: Switch calibration.cpp to C++
**Code Changes:**
```diff
@@ -58,8 +58,6 @@
namespace cv {
-static const char* cvDistCoeffErr = "Distortion coefficients must be 1x4, 4x1, 1x5, 5x1, 1x8, 8x1, 1x12, 12x1, 1x14 or 14x1 floa... | Indeed: I just wanted to staty close to the 5.x version. I also removed the commented out `cout` code |
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/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | I believe it is a little bit more complex. When 3D points are not planar, `cvFindExtrinsicCameraParams2` uses DLT algorithm which indeed requires at least 6 points. But with coplanar 3D points, `cvFindExtrinsicCameraParams2` should work with at least 4 points. --- BTW, see here: https://github.com/opencv/opencv/issues/... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | Ok, then `cvFindExtrinsicCameraParams2` may get good result with 4 points, but may throw Exception with 5 points. I think CV_CheckGE in [`cvFindExtrinsicCameraParams2`](https://github.com/opencv/opencv/blob/863ecded30dcaedff0ece893277411f39bb3c1c6/modules/calib3d/src/calibration.cpp#L1099) is not a good idea. But since... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | > Ok, then `cvFindExtrinsicCameraParams2` may get good result with 4 points, but may throw Exception with 5 points. Not sure to follow correctly. In `cvFindExtrinsicCameraParams2` it checks first if the 3D points are coplanar. For coplanar case, it should never throw exception, except theoretically for degenerate cases... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | `cvFindExtrinsicCameraParams2` does check if the 3D points are coplanar. And if not, it may throw exception. When someone calls `cvFindExtrinsicCameraParams2` directly, he can make sure the input points are more than 4. If he knows that the points may not be coplanar, he can make sure the points are more than 6. In thi... |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/src/solvepnp.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -311,18 +311,42 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
opoints_inliers.resize(npoints1);
ipoints_... | Is it needed since it is used in `CV_LOG_DEBUG`? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF),... | > 4. / 460.0 Reprojection error is in pixel unit (default value is 8). Wondering if it explains why you only have a consensus set of 5 points? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/test/test_solvepnp_ransac.cpp
**Change Type:** modified
**Context:** PR #19253: Unexpected exception in solvePnPRansac caused by input points
**Code Changes:**
```diff
@@ -837,6 +837,43 @@ TEST(Calib3d_SolvePnPRansac, double_support)
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF),... | See the buildbot (https://pullrequest.opencv.org/#/summary/opencv) errors. This requires C++11 features. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.