instruction stringclasses 9
values | input stringlengths 279 5.47k | output stringlengths 6 9.58k |
|---|---|---|
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/calib3d/include/opencv2/calib3d.hpp
**Change Type:** modified
**Context:** PR #26669: solvePnPRansac implementation for Fisheye camera model
**Code Changes:**
```diff
@@ -4075,6 +4075,40 @@ optimization. It is the \f$max(width,height)/\pi\f$ or the provided \f$f_x\f$, \
the provided rvec and tve... | I propose to use the same description as for cv::solvePnpRansac with fisheye model reference and add reference to SOLVEPNP_XXX constants instead of copy. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/opencv.bib
**Change Type:** modified
**Context:** PR #26754: Add direct pdf links in the bibliography
**Review Line:** 1100
**Code Changes:**
```diff
number = {5},
pages = {717-721},
doi = {10.1109/70.326576},
- issn = {1042-296X}
+ issn = {1042-296X},
+ url = {https://drive.google.com/file/d... | This link comes from: https://sites.google.com/robotics.snu.ac.kr/fcp/publications/articles See:  |
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/opencv.bib
**Change Type:** modified
**Context:** PR #26754: Add direct pdf links in the bibliography
**Code Changes:**
```diff
@@ -15,7 +15,7 @@ @article{ANB13
pages = {13.1--13.11},
publisher = {{BMVA} Press},
year = {2013},
- url = {https://doi.org/10.5244/C.27.13},
+ url = {https://projet.... | Lukas and Kanade are names. Capital letters. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/opencv.bib
**Change Type:** modified
**Context:** PR #26754: Add direct pdf links in the bibliography
**Review Line:** 369
**Code Changes:**
```diff
journal = {International Journal of Robotics Research},
year = {1998},
volume = {18},
- pages = {286--298}
+ pages = {286--298},
+ url = {https:... | The link returns 403 |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/opencv.bib
**Change Type:** modified
**Context:** PR #26754: Add direct pdf links in the bibliography
**Review Line:** 369
**Code Changes:**
```diff
journal = {International Journal of Robotics Research},
year = {1998},
volume = {18},
- pages = {286--298}
+ pages = {286--298},
+ url = {https:... | In my location, the link is OK. I don't know how to proceed.  |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/opencv.bib
**Change Type:** modified
**Context:** PR #26754: Add direct pdf links in the bibliography
**Review Line:** 1500
**Code Changes:**
```diff
journal = {Image and Vision Computing},
volume = {8},
number = {1},
- publisher = {Elsevier}
+ publisher = {Elsevier},
+ url = {https://typeset... | Same, the link is ok for me:  |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Code Changes:**
```diff
@@ -94,17 +94,20 @@ FOREACH(SEARCH_PATH ${SEARCH_PATHS})
IF (${contents} MATCHES "#define OPENEXR_VERSION_MINOR ([0-9]+)"... | > `STRLESS` > `"2_3"` Why is not `VERSION_LESS`? > OPENEXR_VERSION=2.3.0 |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 154
**Code Changes:**
```diff
if(NOT OPENEXR_VERSION)
SET(OPENEXR_VERSION "Unknown")
+ else()
+ if(HAVE_CXX17 AND OPENEXR_VERSION V... | This may be a fix for 4.x but definitely not for https://github.com/opencv/opencv/issues/26673 or 5.x. Compile standard of 5.x has been switched to C++17. |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Code Changes:**
```diff
@@ -94,17 +94,20 @@ FOREACH(SEARCH_PATH ${SEARCH_PATHS})
IF (${contents} MATCHES "#define OPENEXR_VERSION_MINOR ([0-9]+)"... | I fixed it. Currently `OPENEXR_VERSION` had been also used to search libraries. So I split it into `OPENEXR_VERSION_MM` to search and `OPENEXR_VERSION` to show and comparing. ``` -- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.43) -- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.5.1) -- JPEG 2000: OpenJPE... |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** cmake/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 154
**Code Changes:**
```diff
if(NOT OPENEXR_VERSION)
SET(OPENEXR_VERSION "Unknown")
+ else()
+ if(HAVE_CXX17 AND OPENEXR_VERSION V... | Yes, and this problem is existed not only 5.x branch but also 4.x branch. I think after accepting pull request for 4.x branch, it will be merged into 5.x branch. https://github.com/opencv/opencv/wiki/How_to_contribute#before-you-start-contributing-you-should > If you are going to fix a bug, check that it still exists. ... |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 154
**Code Changes:**
```diff
if(NOT OPENEXR_VERSION)
SET(OPENEXR_VERSION "Unknown")
+ else()
+ if(HAVE_CXX17 AND OPENEXR_VERSION V... | > I think after accepting pull request for 4.x branch, it will be merged into 5.x branch. Yes, I understand that. But my point is 5.x is now based on C++17 and integrated OpenEXR is 2.3.0 which supports C++17, so solution for 5.x should be: 1. Detect system OpenEXR version. 2. If the system one is below the integrated ... |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 154
**Code Changes:**
```diff
if(NOT OPENEXR_VERSION)
SET(OPENEXR_VERSION "Unknown")
+ else()
+ if(HAVE_CXX17 AND OPENEXR_VERSION V... | I'm sorry but it is diffuclt to agree about this change request for me. Even If system OpenEXR is older than v2.3.0 it doesn't means OpenCV user requests to use bundled OpenEXR(it is slightly old too). If needed, we can set enable with `-DBUILD_OPENEXR=ON` manually. Forcing ‘BUILD_OPENEXR`=`ON` losts user-selectability... |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 99
**Code Changes:**
```diff
IF (${contents} MATCHES "#define OPENEXR_VERSION_MINOR ([0-9]+)")
SET(OPENEXR_VERSIO... | There is something wrong with code indentation. |
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/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 154
**Code Changes:**
```diff
if(NOT OPENEXR_VERSION)
SET(OPENEXR_VERSION "Unknown")
+ else()
+ if(HAVE_CXX17 AND OPENEXR_VERSION V... | > Forcing ‘BUILD_OPENEXR=ON` losts user-selectability and it looks like bug. I am quite open to this. But for your solution, you should add a message saying bundled OpenEXR is available for building 5.x for 5.x branch. |
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback. | **File:** cmake/OpenCVFindOpenEXR.cmake
**Change Type:** modified
**Context:** PR #26678: build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later
**Review Line:** 154
**Code Changes:**
```diff
if(NOT OPENEXR_VERSION)
SET(OPENEXR_VERSION "Unknown")
+ else()
+ if(HAVE_CXX17 AND OPENEXR_VERSION V... | OpenCV members seems do not consider to support/update bundled OpenEXR. I think bundled OpenEXR third party library will be dropped for 5.x branch in the furure. So this is hard to be solution for combination C++ Standard and OpenEXR version. See https://github.com/opencv/opencv/pull/21324#issuecomment-1305925279 |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #26815: Replaced sprintf with snprintf
**Code Changes:**
```diff
@@ -71,8 +71,7 @@ int main( int argc, char** argv )
namedWindow( probabilistic_name, WINDOW_AUTOSIZE );
createTrackbar( thresh_label, proba... | The string does not contain formatting options. It means that sprintf may be thrown away and the string constant used as is here. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #26815: Replaced sprintf with snprintf
**Code Changes:**
```diff
@@ -71,8 +71,7 @@ int main( int argc, char** argv )
namedWindow( probabilistic_name, WINDOW_AUTOSIZE );
createTrackbar( thresh_label, proba... | just `const char* edge_thresh_label = "Edge Thres: input";` should be enough |
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/test/test_orientation.cpp
**Change Type:** modified
**Context:** PR #26800: fix default cap_prop_orientation_auto behaviour
**Code Changes:**
```diff
@@ -8,69 +8,80 @@ using namespace std;
namespace opencv_test { namespace {
-typedef TestWithParam<cv::VideoCaptureAPIs> VideoCaptureAPITes... | This test largely repeats the previous one, can we unify them? |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/test/test_orientation.cpp
**Change Type:** modified
**Context:** PR #26800: fix default cap_prop_orientation_auto behaviour
**Code Changes:**
```diff
@@ -8,69 +8,80 @@ using namespace std;
namespace opencv_test { namespace {
-typedef TestWithParam<cv::VideoCaptureAPIs> VideoCaptureAPITes... | I think this will do. Good night |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/test/test_orientation.cpp
**Change Type:** modified
**Context:** PR #26800: fix default cap_prop_orientation_auto behaviour
**Code Changes:**
```diff
@@ -8,69 +8,80 @@ using namespace std;
namespace opencv_test { namespace {
-typedef TestWithParam<cv::VideoCaptureAPIs> VideoCaptureAPITes... | Maybe it would be better to remove extra stdout prints. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/test/test_orientation.cpp
**Change Type:** modified
**Context:** PR #26800: fix default cap_prop_orientation_auto behaviour
**Review Line:** 68
**Code Changes:**
```diff
- EXPECT_EQ(480, actual.width);
- EXPECT_EQ(270, actual.height);
+TEST_P(VideoCaptureAPITests, mp4_orientation_switch... | We should use `SCOPED_TRACE` to distinguish between failures before and after orientation switch. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/test/test_orientation.cpp
**Change Type:** modified
**Context:** PR #26800: fix default cap_prop_orientation_auto behaviour
**Review Line:** 37
**Code Changes:**
```diff
- EXPECT_TRUE(cap.set(CAP_PROP_ORIENTATION_AUTO, true));
+ void orientationCheck(double angle, int width, int heigh... | Perhaps we can use cv::Size: ``` EXPECT_EQ(expectedSize, Size(cap.get(CAP_PROP_FRAME_WIDTH), cap.get(CAP_PROP_FRAME_HEIGHT))); |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/src/shapedescr.cpp
**Change Type:** modified
**Context:** PR #26773: Improve robustness for ellipse fitting
**Code Changes:**
```diff
@@ -340,9 +340,10 @@ double cv::contourArea( InputArray _contour, bool oriented )
namespace cv
{
-static inline Point2f getOfs(int i, float eps)
+static in... | I propose to use cv::RNG for it to make it manageable outside: - User may set seed to get deterministic behaviour - OpenCV test system fixes cv::RNG seed for each test independently. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/imgproc/src/shapedescr.cpp
**Change Type:** modified
**Context:** PR #26773: Improve robustness for ellipse fitting
**Code Changes:**
```diff
@@ -340,9 +340,10 @@ double cv::contourArea( InputArray _contour, bool oriented )
namespace cv
{
-static inline Point2f getOfs(int i, float eps)
+static in... | Used `cv::RNG` |
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/filter.dispatch.cpp
**Change Type:** modified
**Context:** PR #26806: removal of unused variable `kernalDataUMat`
**Code Changes:**
```diff
@@ -592,7 +592,6 @@ static bool ocl_filter2D( InputArray _src, OutputArray _dst, int ddepth,
// For smaller filter kernels, there is a special... | it seems that the variable is unused. what about removing 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_jpegxl.cpp
**Change Type:** modified
**Context:** PR #26788: imgcodecs: jpegxl: support cv::IMREAD_UNCHANGED and other ImreadFlags
**Code Changes:**
```diff
@@ -12,6 +12,19 @@
namespace cv
{
+// Callback functions for JpegXLDecoder
+static void cbRGBtoBGR_8U(void *opaque, size... | It should be platform specific, right? |
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:** modified
**Context:** PR #26788: imgcodecs: jpegxl: support cv::IMREAD_UNCHANGED and other ImreadFlags
**Code Changes:**
```diff
@@ -12,6 +12,19 @@
namespace cv
{
+// Callback functions for JpegXLDecoder
+static void cbRGBtoBGR_8U(void *opaque, size... | The function behaviour depends on emptiness of the input Mat. For now it's not true, even if user mat is empty and allocated by caller side. IMHO the approach is dangerous and may be broken during refactoring or some redesign. I propose to split the concerns and introduce bool flag. It's almost free and makes the code ... |
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:** modified
**Context:** PR #26788: imgcodecs: jpegxl: support cv::IMREAD_UNCHANGED and other ImreadFlags
**Code Changes:**
```diff
@@ -12,6 +12,19 @@
namespace cv
{
+// Callback functions for JpegXLDecoder
+static void cbRGBtoBGR_8U(void *opaque, size... | Yes, I agree with you. And I refactor to remove argument variable for read() function. There are many changes, but I think it makes easier to fix and to modify. |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/tutorials/introduction/macos_install/macos_install.markdown
**Change Type:** modified
**Context:** PR #26564: Improvement of macOS installation guide in documentation
**Review Line:** 80
**Code Changes:**
```diff
-@code{.bash}
-cd ~/<my_working_directory>
-git clone https://github.com/opencv/opencv.git
-... | Please restore empty line |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/tutorials/introduction/macos_install/macos_install.markdown
**Change Type:** modified
**Context:** PR #26564: Improvement of macOS installation guide in documentation
**Code Changes:**
```diff
@@ -9,41 +9,49 @@ Installation in MacOS {#tutorial_macos_install}
| Original author | `@sajarindider` |
| Comp... | SIFT is included |
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback. | **File:** doc/tutorials/introduction/macos_install/macos_install.markdown
**Change Type:** modified
**Context:** PR #26564: Improvement of macOS installation guide in documentation
**Code Changes:**
```diff
@@ -9,41 +9,49 @@ Installation in MacOS {#tutorial_macos_install}
| Original author | `@sajarindider` |
| Comp... | maybe just mention pip install opencv-contrib-python to use the extra modules |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -719,6 +719,25 @@ enum VideoCaptureOBSensorProperties{
//! @} videoio_flags_others
+/** @brief Read data stream interface
+ */
+class CV_EXPORTS_W... | I would suggest to avoid this simple overload - functionality is advanced initially. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -719,6 +719,25 @@ enum VideoCaptureOBSensorProperties{
//! @} videoio_flags_others
+/** @brief Read data stream interface
+ */
+class CV_EXPORTS_W... | The same, drop simplified overload. |
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/plugin_capture_api.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -13,7 +13,7 @@
/// increased for backward-compatible changes, e.g. add new function
/// Caller API <= Plugin API -> plugin is fully compatible
/// Ca... | Do we really need to handle all 3 parameters for the source in a single method of API? As we keep the previous version of the method, then we don't need to duplicate its functionality. |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/plugin_capture_api.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -13,7 +13,7 @@
/// increased for backward-compatible changes, e.g. add new function
/// Caller API <= Plugin API -> plugin is fully compatible
/// Ca... | Sorry for delay. Changed to a method which accepts only buffer. Wanted to add GStreamer backend but couldn't make it work 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/plugin_capture_api.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -13,7 +13,7 @@
/// increased for backward-compatible changes, e.g. add new function
/// Caller API <= Plugin API -> plugin is fully compatible
/// Ca... | We should not pass C++ objects through low level plugin API. They are not usable in general. Different C++ ABIs are possible for OpenCV and plugin parts: - MSVS vs MinGW - GCC/Clang with different C++ standards - libc++ (GCC) / libstdc++ (Clang) |
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/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -31,4 +31,114 @@ template<> bool pyopencv_to(PyObject* obj, cv::VideoCapture& stream, const ArgIn
return true;
}
+class PythonStreamReader... | Is that ok to have relative import path? I don't want to move `CvStream` to public API |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -31,4 +31,114 @@ template<> bool pyopencv_to(PyObject* obj, cv::VideoCapture& stream, const ArgIn
return true;
}
+class PythonStreamReader... | This approach might not work with [standalone](https://github.com/opencv/opencv/blob/4.x/modules/python/standalone.cmake) python bindings build or some other special configuration. As an alternative you can make it "technically" public by moving class declaration to a `.private.hpp` header like we do with [avi containe... |
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/plugin_capture_api.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -13,7 +13,7 @@
/// increased for backward-compatible changes, e.g. add new function
/// Caller API <= Plugin API -> plugin is fully compatible
/// Ca... | - [x] Update docstring with new arguments |
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/include/opencv2/videoio/utils.private.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -10,6 +10,37 @@
namespace cv {
CV_EXPORTS std::string icvExtractPattern(const std::string& filename, unsigned *offset);
+
+class Plug... | `Cv` is a prefix of legacy C-API. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -31,4 +31,114 @@ template<> bool pyopencv_to(PyObject* obj, cv::VideoCapture& stream, const ArgIn
return true;
}
+class PythonStreamReader... | We don't really want to investigate problems caused by this. It looks like `#define true false` Python generator should be adopted instead. |
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/backend_plugin.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -208,6 +208,7 @@ class PluginBackend: public IBackend
Ptr<IVideoCapture> createCapture(int camera, const VideoCaptureParameters& params) const CV_OVERR... | No need to use `std::streambuf` anywhere in API. We need to use internally just simplified class which provides seek/read **interface**. Public API should have simple converter from this. |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -74,6 +74,11 @@ class CvCapture_FFMPEG_proxy CV_FINAL : public cv::VideoCaptureBase
{
open(filename, params);
}
+ CvCapture_FFMPEG_proxy(c... | Where do we seek to zero after this check? |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/videoio_registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -14,6 +14,7 @@ namespace cv
enum BackendMode {
MODE_CAPTURE_BY_INDEX = 1 << 0, //!< device index
MODE_CAPTURE_BY_FILENAME = 1 << 1... | `BY_STREAM` |
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_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -74,6 +74,11 @@ class CvCapture_FFMPEG_proxy CV_FINAL : public cv::VideoCaptureBase
{
open(filename, params);
}
+ CvCapture_FFMPEG_proxy(c... | `sgetc` does not modify sequence position. I also worried about that but checked again |
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_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -74,6 +74,11 @@ class CvCapture_FFMPEG_proxy CV_FINAL : public cv::VideoCaptureBase
{
open(filename, params);
}
+ CvCapture_FFMPEG_proxy(c... | Removed completely |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -31,4 +31,114 @@ template<> bool pyopencv_to(PyObject* obj, cv::VideoCapture& stream, const ArgIn
return true;
}
+class PythonStreamReader... | Added an alias like done for std::string in python generator. However std:: prefix is still missed somewhere |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -35,6 +35,9 @@ CV_EXPORTS_W std::vector<VideoCaptureAPIs> getCameraBackends();
/** @brief Returns list of available backends which works via ... | Buffer => Stream |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -35,6 +35,9 @@ CV_EXPORTS_W std::vector<VideoCaptureAPIs> getCameraBackends();
/** @brief Returns list of available backends which works via ... | Buffer => Stream |
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_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -74,6 +74,11 @@ class CvCapture_FFMPEG_proxy CV_FINAL : public cv::VideoCaptureBase
{
open(filename, params);
}
+ CvCapture_FFMPEG_proxy(c... | > `Ptr<IReadStream>(new ...` `makePtr` / `std::make_shared` |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -719,6 +719,25 @@ enum VideoCaptureOBSensorProperties{
//! @} videoio_flags_others
+/** @brief Read data stream interface
+ */
+class CV_EXPORTS_W... | > in memory buffer Opens a video using data stream. |
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/include/opencv2/videoio/utils.private.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -10,6 +10,37 @@
namespace cv {
CV_EXPORTS std::string icvExtractPattern(const std::string& filename, unsigned *offset);
+
+class Plug... | `ReadStreamPluginProvider` Usually `Callback` means abstract interface description. We already have the `IReadStream` for that. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -31,4 +31,114 @@ template<> bool pyopencv_to(PyObject* obj, cv::VideoCapture& stream, const ArgIn
return true;
}
+class PythonStreamReader... | Check `len < n` |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Review Line:** 116
**Code Changes:**
```diff
+ CV_Error(cv::Error::StsError, "Python .seek() result => long long conversion error");
+ return pos;
+ }
+... | Who calls `Py_DECREF` ? |
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.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -65,6 +65,10 @@ static bool param_VIDEOWRITER_DEBUG = utils::getConfigurationParameterBool("OPEN
void DefaultDeleter<CvCapture>::operator ()(CvCapture* obj) const { c... | Who performs `seek(0, 0)` between trials? Perhaps we should not allow `CAP_ANY` in this API. |
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/include/opencv2/videoio/utils.private.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -10,6 +10,37 @@
namespace cv {
CV_EXPORTS std::string icvExtractPattern(const std::string& filename, unsigned *offset);
+
+class Plug... | There is no guarantee for lifetime of this. Perhaps we need to pass `std::shared_ptr<std::streambuf>` in public API. |
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/include/opencv2/videoio/utils.private.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -10,6 +10,37 @@
namespace cv {
CV_EXPORTS std::string icvExtractPattern(const std::string& filename, unsigned *offset);
+
+class Plug... | Looks useless because it could not (and should not) create independent objects (at least seek pointer is shared). See below comment about lifetime. |
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/videoio_registry.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -47,7 +47,12 @@ namespace {
#define DECLARE_STATIC_BACKEND(cap, name, mode, createCaptureFile, createCaptureCamera, createWriter) \
{ \
- cap, (Bac... | Please add new macro instead of massive refactoring: `DECLARE_STATIC_BACKEND_WITH_STREAM_SUPPORT` |
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/videoio_registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -14,6 +14,7 @@ namespace cv
enum BackendMode {
MODE_CAPTURE_BY_INDEX = 1 << 0, //!< device index
MODE_CAPTURE_BY_FILENAME = 1 << 1... | need to update comment too. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/videoio_registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -14,6 +14,7 @@ namespace cv
enum BackendMode {
MODE_CAPTURE_BY_INDEX = 1 << 0, //!< device index
MODE_CAPTURE_BY_FILENAME = 1 << 1... | `getAvailableBackends_CaptureByStream` |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -35,6 +35,9 @@ CV_EXPORTS_W std::vector<VideoCaptureAPIs> getCameraBackends();
/** @brief Returns list of available backends which works via ... | Oh, seems like `getStreamBackends` is busy (see above) |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/utils.private.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -10,6 +10,37 @@
namespace cv {
CV_EXPORTS std::string icvExtractPattern(const std::string& filename, unsigned *offset);
+
+class Plug... | Removed `clone` method completely in last commit. As I understand, `struct CvCapture_FFMPEG` cannot hold a copy of `Ptr<IReadStream>` because there is no default constructor to allocate it: https://github.com/opencv/opencv/blob/b42075f3e2c7eca4a12e55b32cfc95fa90982a21/modules/videoio/src/cap_ffmpeg_impl.hpp#L3296 So I ... |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Review Line:** 116
**Code Changes:**
```diff
+ CV_Error(cv::Error::StsError, "Python .seek() result => long long conversion error");
+ return pos;
+ }
+... | Added `Py_INCREF` as well |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/utils.private.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -10,6 +10,37 @@
namespace cv {
CV_EXPORTS std::string icvExtractPattern(const std::string& filename, unsigned *offset);
+
+class Plug... | Agree, I think it can simplify other bindings addition in future. |
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.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -65,6 +65,10 @@ static bool param_VIDEOWRITER_DEBUG = utils::getConfigurationParameterBool("OPEN
void DefaultDeleter<CvCapture>::operator ()(CvCapture* obj) const { c... | Good point, there is no explicit seek. Added a check that `apiPref != CAP_ANY` |
You are an expert OpenCV code reviewer specializing in memory management. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -35,6 +35,9 @@ CV_EXPORTS_W std::vector<VideoCaptureAPIs> getCameraBackends();
/** @brief Returns list of available backends which works via ... | `getStreamBufferedBackends` ? |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -719,6 +719,25 @@ enum VideoCaptureOBSensorProperties{
//! @} videoio_flags_others
+/** @brief Read data stream interface
+ */
+class CV_EXPORTS_W... | `const reference` here and below (or we should use `std::move()` massively) |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/misc/python/pyopencv_videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -31,4 +31,114 @@ template<> bool pyopencv_to(PyObject* obj, cv::VideoCapture& stream, const ArgIn
return true;
}
+class PythonStreamReader... | `CV_Error` doesn't call cleanup (release GIL and release `type`). ``` if (...) has_error = true; ... cleanup ... if (has_error) CV_Error(...); ``` |
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/src/cap_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -74,6 +74,11 @@ class CvCapture_FFMPEG_proxy CV_FINAL : public cv::VideoCaptureBase
{
open(filename, params);
}
+ CvCapture_FFMPEG_proxy(c... | > `makePtr<ReadStreamPluginProvider>(opaque, read, seek)` Released right after this call because it is not saved anywhere. |
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_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -74,6 +74,11 @@ class CvCapture_FFMPEG_proxy CV_FINAL : public cv::VideoCaptureBase
{
open(filename, params);
}
+ CvCapture_FFMPEG_proxy(c... | As a workaround, `readStream = stream` for now |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio/registry.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -35,6 +35,9 @@ CV_EXPORTS_W std::vector<VideoCaptureAPIs> getCameraBackends();
/** @brief Returns list of available backends which works via ... | Changed locally, can commit with https://github.com/opencv/opencv/pull/25584#discussion_r1896904920 if actual |
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/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -719,6 +719,25 @@ enum VideoCaptureOBSensorProperties{
//! @} videoio_flags_others
+/** @brief Read data stream interface
+ */
+class CV_EXPORTS_W... | Do we really need methods with `std::streambuf`? Maybe it would be better to make `StreambufReadStream` or similar class or just its factory public instead? For example: ```.cpp shared_ptr<IStreamReader> source = createStdStream(filename); // can accept filename or &&filebuf or &&istream or &&ifstream VideoCapture cap(... |
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/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Code Changes:**
```diff
@@ -719,6 +719,25 @@ enum VideoCaptureOBSensorProperties{
//! @} videoio_flags_others
+/** @brief Read data stream interface
+ */
+class CV_EXPORTS_W... | Good point. But I think we can even remove it completely. `std::streambuf` might introduce more limitations than just seek/read interface. So I can move `class StreambufReadStream : public IStreamReader` example to the tests for now and remove option from public API. |
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/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Review Line:** 735
**Code Changes:**
```diff
+ virtual long long read(char* buffer, long long size) = 0;
+
+ /** @brief Sets the stream position
+ *
+ * @param offs... | Wouldn't it be better to completely avoid C/C++ constants in public interface and introduce our own? |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Review Line:** 735
**Code Changes:**
```diff
+ virtual long long read(char* buffer, long long size) = 0;
+
+ /** @brief Sets the stream position
+ *
+ * @param offs... | FFmpeg (basically) and Python use them too (with same values). IMHO, it is not necessary to introduce extra conversions to/from own values. |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Review Line:** 735
**Code Changes:**
```diff
+ virtual long long read(char* buffer, long long size) = 0;
+
+ /** @brief Sets the stream position
+ *
+ * @param offs... | Agree, we can add such enum but potential user will still cast to integer or introduce long if/else/switch |
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #25584: Open VideoCapture from data stream
**Review Line:** 735
**Code Changes:**
```diff
+ virtual long long read(char* buffer, long long size) = 0;
+
+ /** @brief Sets the stream position
+ *
+ * @param offs... | My concern was that user would be required to include `<stdio.h>`/`<cstdio>` in order to use this seemingly unrelated class. Though perhaps it'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/imgcodecs/src/grfmt_gif.cpp
**Change Type:** modified
**Context:** PR #26738: fix bugs in GIF decoding
**Review Line:** 438
**Code Changes:**
```diff
+ CV_LOG_WARNING(NULL, "found Unknown Extension Type: " + std::to_string(extension));
+ }
+ int len = ... | I propose to print info/warning message about skipped extensions with CV_LOG_INFO/CV_LOG_WARNING. It helps to highlight unexpected behaviour in some cases. |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | I propose to use local len variable here and in the else branch like `int len = m_strm.getByte();`. It allows to get rid of "uninitialized varible" warnings by compiler and some tools like valgrind/asan, etc. |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | Why not `lzwTableSize`? |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | because (1<<12) is the maximum size of lzwtable, thus i use (1<<12)+1 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_gif.cpp
**Change Type:** modified
**Context:** PR #26738: fix bugs in GIF decoding
**Review Line:** 438
**Code Changes:**
```diff
+ CV_LOG_WARNING(NULL, "found Unknown Extension Type: " + std::to_string(extension));
+ }
+ int len = ... | > I propose to print info/warning message about skipped extensions with CV_LOG_INFO/CV_LOG_WARNING. It helps to highlight unexpected behaviour in some cases. i think no need. ( probably we see lots of warning ) |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | Not variable, but constant. |
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 #26738: fix bugs in GIF decoding
**Review Line:** 438
**Code Changes:**
```diff
+ CV_LOG_WARNING(NULL, "found Unknown Extension Type: " + std::to_string(extension));
+ }
+ int len = ... | > > I propose to print info/warning message about skipped extensions with CV_LOG_INFO/CV_LOG_WARNING. It helps to highlight unexpected behaviour in some cases. > > i think no need. ( probably we see lots of warning ) i just pick those not mentioned in GIF spec, which may not occur in normal cases (but actually allowed) |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | maybe `const int lzwMaxSize = 1 << 12; // 4096 is the maximum code width` |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | well actually here i mean the bit width, but i will modify this later to avoid misunderstanding |
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 #26738: fix bugs in GIF decoding
**Code Changes:**
```diff
@@ -4,6 +4,7 @@
#include "precomp.hpp"
#include "grfmt_gif.hpp"
+#include "opencv2/core/utils/logger.hpp"
#ifdef HAVE_IMGCODEC_GIF
namespace cv
@@ -293,11 +294,12 @... | i suggest (ChatGPT's suggestion) const int lzwMaxSize = 1 << 12; // 4096 is the maximum size of the LZW table (12 bits) |
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 #26748: Fix remaining bugs in PNG reader
**Code Changes:**
```diff
@@ -339,6 +339,10 @@ bool PngDecoder::readHeader()
png_bytep trans;
png_color_16p trans_values;
+ // Free chunk in case png_... | When the png_read_info( png_ptr, info_ptr ); function is called, if there are acTL and fcTL chunks, they will be skipped. For the ongoing manual chunk reading, it is necessary to get the file position back. btw i am not sure this change is necessary. old code returns false if there were a problem. if so there is no nee... |
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 #26748: Fix remaining bugs in PNG reader
**Code Changes:**
```diff
@@ -339,6 +339,10 @@ bool PngDecoder::readHeader()
png_bytep trans;
png_color_16p trans_values;
+ // Free chunk in case png_... | indeed, that was not the issue, I reverted |
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/fundam.cpp
**Change Type:** modified
**Context:** PR #26742: Bug fix for #25546 - Updating inliers for homography estimation
**Review Line:** 420
**Code Changes:**
```diff
if( result && npoints > 4 && method != RHO)
{
+ // save the original points before compressing
+ ... | Why do you need copies here? HomographyEstimatorCallback::computeError() does not modify inputs. |
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/fundam.cpp
**Change Type:** modified
**Context:** PR #26742: Bug fix for #25546 - Updating inliers for homography estimation
**Review Line:** 420
**Code Changes:**
```diff
if( result && npoints > 4 && method != RHO)
{
+ // save the original points before compressing
+ ... | The copies are needed, because src and dst points are first compressed here: ``` compressElems( src.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints ); npoints = compressElems( dst.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints ); ``` and then are overwritten here: ``` Mat src1 = src.rowRange(0, npoints); Mat dst1 ... |
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/objc/generator/gen_objc.py
**Change Type:** modified
**Context:** PR #26713: Ensure Obj-C header files are generated correctly if under /private/var
**Review Line:** 1665
**Code Changes:**
```diff
@@ -1662,7 +1662,9 @@ def sanitize_documentation_string(doc, type):
h_files += [os.path.... | Could you add comment to the source code with the reason why you use relative path instead of absolute. Reference to the original Bazel issue will be useful too. |
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/objc/generator/gen_objc.py
**Change Type:** modified
**Context:** PR #26713: Ensure Obj-C header files are generated correctly if under /private/var
**Review Line:** 1665
**Code Changes:**
```diff
@@ -1662,7 +1662,9 @@ def sanitize_documentation_string(doc, type):
h_files += [os.path.... | I've added a comment. https://github.com/opencv/opencv/pull/26713/commits/ee7b9481461f6f23e9be61e35b1330601d114e0c Is it okay if I don't squash it into a single commit and force push? |
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback. | **File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #26650: Use size_t when calculating size of all_points
**Code Changes:**
```diff
@@ -19,7 +19,6 @@
#include <limits>
#include <cmath>
#include <queue>
-#include <limits>
#include <map>
namespace cv
@@ -3709,7 +3708,11 @@ bool Q... | 3 asserts are overkill here. We have expression like (x-2)*(x-1)*x / 6. It means that single check `CV_Assert(x < limit)` or `CV_Assert(expr < std::numeric_limits<int>::max())` is enough. |
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 #26715: Fixed some memory leaks in PNG/APNG implementation
**Code Changes:**
```diff
@@ -181,8 +181,8 @@ PngDecoder::PngDecoder()
{
m_signature = "\x89\x50\x4e\x47\xd\xa\x1a\xa";
m_color_type = 0;
- m_png_ptr = 0;
- ... | Extra added line |
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 #26688: Animated GIF APNG WEBP AVIF revisions
**Review Line:** 391
**Code Changes:**
```diff
@@ -389,7 +388,7 @@ bool PngDecoder::readData( Mat& img )
{
if (m_frame_count > 1)
{
- Mat mat_cur = Mat(img.rows, img.... | setting to zeros is necessary ? |
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 #26688: Animated GIF APNG WEBP AVIF revisions
**Code Changes:**
```diff
@@ -152,8 +152,7 @@ bool APNGFrame::setMat(const cv::Mat& src, unsigned delayNum, unsigned delayDen)
if (!src.empty())
{
- png_uint_32 rowby... | Cool ! Let's fix it first then: https://github.com/opencv/opencv/pull/26704 |
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_animation.cpp
**Change Type:** modified
**Context:** PR #26688: Animated GIF APNG WEBP AVIF revisions
**Review Line:** 402
**Code Changes:**
```diff
+
+ // Read back the still images into a vector of Mats.
+ EXPECT_TRUE(imreadmulti(output, apng_frames));
+
+ // Expect all... | how about also testing the frames are the same as the input ones ? |
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_png.cpp
**Change Type:** modified
**Context:** PR #26688: Animated GIF APNG WEBP AVIF revisions
**Review Line:** 391
**Code Changes:**
```diff
@@ -389,7 +388,7 @@ bool PngDecoder::readData( Mat& img )
{
if (m_frame_count > 1)
{
- Mat mat_cur = Mat(img.rows, img.... |  this file render garbage memory without Mat::zeros. |
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 #26688: Animated GIF APNG WEBP AVIF revisions
**Review Line:** 391
**Code Changes:**
```diff
@@ -389,7 +388,7 @@ bool PngDecoder::readData( Mat& img )
{
if (m_frame_count > 1)
{
- Mat mat_cur = Mat(img.rows, img.... | like  |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.