nareshmlx/opencv-pr huggingface dataset:
**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 = m_strm.getByte();
+                while (len) {
+                    m_strm.skip(len);
+                    len = m_strm.getByte();
                 }
             }
         } else if (!(type ^ 0x2C)) {
```

Review comment:
> > 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)
**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 @@ void GifDecoder::code2pixel(Mat& img, int start, int k){
 bool GifDecoder::lzwDecode() {
```

Review comment:
maybe `const int lzwMaxSize = 1 << 12; // 4096 is the maximum code width`
**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 @@ void GifDecoder::code2pixel(Mat& img, int start, int k){
 bool GifDecoder::lzwDecode() {
```

Review comment:
well actually here i mean the bit width, but i will modify this later to avoid misunderstanding
**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 @@ void GifDecoder::code2pixel(Mat& img, int start, int k){
 bool GifDecoder::lzwDecode() {
```

Review comment:
i suggest (ChatGPT's suggestion) const int lzwMaxSize = 1 << 12; // 4096 is the maximum size of the LZW table (12 bits)
**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_read_info uses longjmp.
+            chunk.p.clear();
+            chunk.p.shrink_to_fit();
+
             png_read_info( png_ptr, info_ptr );
             png_get_IHDR(png_ptr, info_ptr, &wdth, &hght,
```

Review comment:
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 need to `png_read_info`
**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_read_info uses longjmp.
+            chunk.p.clear();
+            chunk.p.shrink_to_fit();
+
             png_read_info( png_ptr, info_ptr );
             png_get_IHDR(png_ptr, info_ptr, &wdth, &hght,
```

Review comment:
indeed, that was not the issue, I reverted
**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
+        const int npoints_input = npoints;
+        const Mat src_input = src.clone();
+        const Mat dst_input = dst.clone();
+
         compressElems( src.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints );
         npoints = compressElems( dst.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints );
         if( npoints > 0 )
@@ -427,6 +432,16 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
```

Review comment:
Why do you need copies here? HomographyEstimatorCallback::computeError() does not modify inputs.
**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
+        const int npoints_input = npoints;
+        const Mat src_input = src.clone();
+        const Mat dst_input = dst.clone();
+
         compressElems( src.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints );
         npoints = compressElems( dst.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints );
         if( npoints > 0 )
@@ -427,6 +432,16 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
```

Review comment:
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 = dst.rowRange(0, npoints); src = src1; dst = dst1; ``` Basically, new src, dst become of size of number of inliers before LMSolver, but the errors must be computed on all original points.
**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.join(root, filename) for filename in fnmatch.filter(filenames, '*.h')]
                hpp_files += [os.path.join(root, filename) for filename in fnmatch.filter(filenames, '*.hpp')]
             srcfiles = h_files + hpp_files
-            srcfiles = [f for f in srcfiles if not re_bad.search(f.replace('\\', '/'))]
+            # Use relative paths to avoid being affected by the name of the parent directory.
+            # See https://github.com/opencv/opencv/issues/26712
+            srcfiles = [f for f in srcfiles if not re_bad.search(os.path.relpath(f, module_location).replace('\\', '/'))]
         logging.info("\nFiles (%d):\n%s", len(srcfiles), pformat(srcfiles))
 
         common_headers_fname = os.path.join(misc_location, 'filelist_common')
```

Review comment:
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.
**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.join(root, filename) for filename in fnmatch.filter(filenames, '*.h')]
                hpp_files += [os.path.join(root, filename) for filename in fnmatch.filter(filenames, '*.hpp')]
             srcfiles = h_files + hpp_files
-            srcfiles = [f for f in srcfiles if not re_bad.search(f.replace('\\', '/'))]
+            # Use relative paths to avoid being affected by the name of the parent directory.
+            # See https://github.com/opencv/opencv/issues/26712
+            srcfiles = [f for f in srcfiles if not re_bad.search(os.path.relpath(f, module_location).replace('\\', '/'))]
         logging.info("\nFiles (%d):\n%s", len(srcfiles), pformat(srcfiles))
 
         common_headers_fname = os.path.join(misc_location, 'filelist_common')
```

Review comment:
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?
**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 QRDetectMulti::checkSets(vector<vector<Point2f> >& true_points_group, vecto
     vector<int> set_size(true_points_group.size());
```

Review comment:
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.
**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;
-    m_info_ptr = m_end_info = 0;
+    m_png_ptr = nullptr;
+    m_info_ptr = m_end_info = nullptr;
     m_f = 0;
     m_buf_supported = true;
```

Review comment:
Extra added line
**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.cols, m_type);
+        Mat mat_cur = Mat::zeros(img.rows, img.cols, m_type);
         uint32_t id = 0;
         uint32_t j = 0;
         uint32_t imagesize = m_width * m_height * mat_cur.channels();
@@ -437,7 +436,7 @@ bool  PngDecoder::readData( Mat& img )
                     if (dop == 2)
```

Review comment:
setting to zeros is necessary ?
**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 rowbytes = src.cols * src.channels();
-
+        png_uint_32 rowbytes = src.depth() == CV_16U ? src.cols * src.channels() * 2 : src.cols * src.channels();
         _width = src.cols;
         _height = src.rows;
         _colorType = src.channels() == 1 ? PNG_COLOR_TYPE_GRAY : src.channels() == 3 ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA;
```

Review comment:
Cool ! Let's fix it first then: https://github.com/opencv/opencv/pull/26704
**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 frames written as multi-page image
+    EXPECT_EQ(expected_frame_count, apng_frames.size());
+
+    // Clean up by removing the temporary file.
+    EXPECT_EQ(0, remove(output.c_str()));
+}
+
```

Review comment:
how about also testing the frames are the same as the input ones ?
**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.cols, m_type);
+        Mat mat_cur = Mat::zeros(img.rows, img.cols, m_type);
         uint32_t id = 0;
         uint32_t j = 0;
         uint32_t imagesize = m_width * m_height * mat_cur.channels();
@@ -437,7 +436,7 @@ bool  PngDecoder::readData( Mat& img )
                     if (dop == 2)
```

Review comment:
![3d2](https://github.com/user-attachments/assets/09619bf8-6787-4294-b4ad-a5b68ae72ed1) this file render garbage memory without Mat::zeros.
**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.cols, m_type);
+        Mat mat_cur = Mat::zeros(img.rows, img.cols, m_type);
         uint32_t id = 0;
         uint32_t j = 0;
         uint32_t imagesize = m_width * m_height * mat_cur.channels();
@@ -437,7 +436,7 @@ bool  PngDecoder::readData( Mat& img )
                     if (dop == 2)
```

Review comment:
like ![3d2t](https://github.com/user-attachments/assets/de4ee889-6f31-4d99-84a2-9c97719b8dfe)
**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 frames written as multi-page image
+    EXPECT_EQ(expected_frame_count, apng_frames.size());
+
+    // Clean up by removing the temporary file.
+    EXPECT_EQ(0, remove(output.c_str()));
+}
+
```

Review comment:
CV_16U Mats converted to CV_8U internally. so i did not do frames comparison. frankly handling CV_16U probably crude and need extra work if needed. i did not find 16U APNGs to test well.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #26714: fix for png durations and memory leak

**Code Changes:**
```diff
@@ -404,7 +404,6 @@ bool  PngDecoder::readData( Mat& img )
                 fseek(m_f, -8, SEEK_CUR);
             else
                 m_buf_pos -= 8;
-
         }
         else
             m_mat_next.copyTo(mat_cur);
@@ -437,9 +436,9 @@ bool  PngDecoder::readData( Mat& img )
                         memcpy(frameNext.getPixels(), frameCur.getPixels(), imagesize);
```

Review comment:
Please cite your source, there are several implementations: https://github.com/davidmz/apng-js/blob/e5272dcd6900cbea2c341ce259c206a162cedec8/src/library/parser.js#L64 https://github.com/FFmpeg/FFmpeg/blob/19c95ecbff84eebca254d200c941ce07868ee707/libavformat/apngdec.c#L259 I believe the spec says differently though: https://wiki.mozilla.org/APNG_Specification#%60fcTL%60:_The_Frame_Control_Chunk There is a difference between storing things in an animation and giving values to delays for display. I think you should simply do: ```cxx if (!delay_den) delay_den = 100; m_animation.durations.push_back(cvRound(1000.*delay_num/delay_den));
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #26714: fix for png durations and memory leak

**Code Changes:**
```diff
@@ -404,7 +404,6 @@ bool  PngDecoder::readData( Mat& img )
                 fseek(m_f, -8, SEEK_CUR);
             else
                 m_buf_pos -= 8;
-
         }
         else
             m_mat_next.copyTo(mat_cur);
@@ -437,9 +436,9 @@ bool  PngDecoder::readData( Mat& img )
                         memcpy(frameNext.getPixels(), frameCur.getPixels(), imagesize);
```

Review comment:
for example delaynum 1 delayden 24 it means 1000 / 24 40 ms for example delaynum 4 delayden 100 it means 1000 / 100 * 4 40 ms
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #26714: fix for png durations and memory leak

**Code Changes:**
```diff
@@ -404,7 +404,6 @@ bool  PngDecoder::readData( Mat& img )
                 fseek(m_f, -8, SEEK_CUR);
             else
                 m_buf_pos -= 8;
-
         }
         else
             m_mat_next.copyTo(mat_cur);
@@ -437,9 +436,9 @@ bool  PngDecoder::readData( Mat& img )
                         memcpy(frameNext.getPixels(), frameCur.getPixels(), imagesize);
```

Review comment:
when saving for example 80 ms delay num 80 delayden 1000 it means 1000 / 1000 * 80 80 ms
**File:** modules/videoio/src/cap_android_mediandk.cpp
**Change Type:** modified
**Context:** PR #26656: AndroidMediaNdkCapture pixel format enhancement
**Review Line:** 65

**Code Changes:**
```diff
         sawInputEOS(false), sawOutputEOS(false),
-        frameStride(0), frameWidth(0), frameHeight(0), colorFormat(0),
-        videoWidth(0), videoHeight(0),
-        videoFrameCount(0),
+        frameStride(0), frameWidth(0), frameHeight(0),
+        colorFormat(COLOR_FormatUnknown), fourCC(FOURCC_BGR),
+        videoWidth(0), videoHeight(0), videoFrameCount(0),
         videoRotation(0), videoRotationCode(-1),
         videoOrientationAuto(false) {}
 
@@ -65,6 +75,7 @@ class AndroidMediaNdkCapture : public IVideoCapture
```

Review comment:
Attention: default output become BGR for Android too.
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -120,7 +120,7 @@ static void
 HoughLinesStandard( InputArray src, OutputArray lines, int type,
                     float rho, float theta,
                     int threshold, int linesMax,
-                    double min_theta, double max_theta )
+                    double min_theta, double max_theta, bool use_edgeval = false )
 {
     CV_CheckType(type, type == CV_32FC2 || type == CV_32FC3, "Internal error");
 
@@ -184,17 +184,31 @@ HoughLinesStandard( InputArray src, OutputArray lines, int type,
```

Review comment:
`if` in inner loops is slow.
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -2165,11 +2165,13 @@ Must fall between 0 and max_theta.
 @param max_theta For standard and multi-scale Hough transform, an upper bound for the angle.
 Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
 less than max_theta, depending on the parameters min_theta and theta.
+@param use_edgeval True if you want to use weighted Hough transform.
  */
 CV_EXPORTS_W void HoughLines( InputArray image, OutputArray lines,
                               double rho, double theta, int threshold,
                               double srn = 0, double stn = 0,
-                              double min_theta = 0, double max_theta = CV_PI );
```

Review comment:
No such params.
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -120,7 +120,7 @@ static void
 HoughLinesStandard( InputArray src, OutputArray lines, int type,
                     float rho, float theta,
                     int threshold, int linesMax,
-                    double min_theta, double max_theta )
+                    double min_theta, double max_theta, bool use_edgeval = false )
 {
     CV_CheckType(type, type == CV_32FC2 || type == CV_32FC3, "Internal error");
 
@@ -184,17 +184,31 @@ HoughLinesStandard( InputArray src, OutputArray lines, int type,
```

Review comment:
I moved if(use_edgeval) to outside of for loop. But I still remain to use this bool; use_edgeval to avoid code duplication, instead of defining another Hough function.
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -2165,11 +2165,13 @@ Must fall between 0 and max_theta.
 @param max_theta For standard and multi-scale Hough transform, an upper bound for the angle.
 Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
 less than max_theta, depending on the parameters min_theta and theta.
+@param use_edgeval True if you want to use weighted Hough transform.
  */
 CV_EXPORTS_W void HoughLines( InputArray image, OutputArray lines,
                               double rho, double theta, int threshold,
                               double srn = 0, double stn = 0,
-                              double min_theta = 0, double max_theta = CV_PI );
```

Review comment:
I'm sorry, it was my mistake. I updated it.
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -15,22 +15,27 @@ using namespace std;
 /// Global variables
 
 /** General variables */
-Mat src, edges;
+Mat src, canny_edge, sobel_edge;
 Mat src_gray;
-Mat standard_hough, probabilistic_hough;
+Mat standard_hough, probabilistic_hough, weighted_hough;
 int min_threshold = 50;
```

Review comment:
No need to use sprintf here.
**File:** doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.markdown
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -83,7 +83,7 @@ Arranging the terms: \f$r = x \cos \theta + y \sin \theta\f$
 
 ### Standard and Probabilistic Hough Line Transform
 
-OpenCV implements two kind of Hough Line Transforms:
+OpenCV implements three kind of Hough Line Transforms:
 
 a.  **The Standard Hough Transform**
 
@@ -97,6 +97,12 @@ b.  **The Probabilistic Hough Line Transform**
```

Review comment:
Better wording: ``` - Uses edge intensity instead binary 0 or 1 values in standard Hough transform. ```
**File:** doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.markdown
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough
**Review Line:** 100

**Code Changes:**
```diff
 
@@ -97,6 +97,12 @@ b.  **The Probabilistic Hough Line Transform**
     of the detected lines \f$(x_{0}, y_{0}, x_{1}, y_{1})\f$
 -   In OpenCV it is implemented with the function **HoughLinesP()**
 
+c.  **The Weighted Hough Transform**
+
+-   Uses edge intensity instead binary 0 or 1 values in standard Hough transform.
+-   In OpenCV it is implemented with the function **HoughLines()** with use_edgeval=true.
+-   See the example in samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp.
+
```

Review comment:
Line 86 should be "OpenCV implements three kind of Hough Line Transforms:"
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -15,22 +15,27 @@ using namespace std;
 /// Global variables
 
 /** General variables */
-Mat src, edges;
+Mat src, canny_edge, sobel_edge;
 Mat src_gray;
-Mat standard_hough, probabilistic_hough;
+Mat standard_hough, probabilistic_hough, weighted_hough;
 int min_threshold = 50;
```

Review comment:
I want to add Edge threshold slider as this figure ( ![image](https://user-images.githubusercontent.com/13181036/208776678-94512916-044d-41b4-b8aa-81c52d06ddb9.png) ), because weighted Hough depends on edge amount.
**File:** modules/imgproc/test/test_houghlines.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -340,6 +340,53 @@ TEST(HoughLines, regression_21983)
     EXPECT_NEAR(lines[0][1], 1.57179642, 1e-4);
 }
 
+TEST(WeightedHoughLines, horizontal)
+{
+    Mat img(25, 25, CV_8UC1, Scalar(0));
+    // draw lines. from top to bottom, stronger to weaker.
+    line(img, Point(0, 6), Point(25, 6), Scalar(240));
+    line(img, Point(0, 12), Point(25, 12), Scalar(255));
```

Review comment:
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_expression, const char* actual_expression, const std::string& expected_value, const std::string& actual_value, bool ignoring_case); ```