nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -1999,6 +1999,38 @@ CV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,
                                      InputArray mask, int blockSize,
                                      int gradientSize, bool useHarrisDetector = false,
                                      double k = 0.04 );
+
+/** @brief Same as above, but returns also quality measure of the detected corners.
+
+@param image Input 8-bit or floating-point 32-bit, single-channel image.
+@param corners Output vector of detected corners.
+@param maxCorners Maximum number of corners to return. If there are more corners than are found,
```

Review comment:
> corners_values "values" are too abstract. All parameters are "values". `corners_response`
**File:** modules/imgproc/perf/perf_goodFeaturesToTrack.cpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -41,4 +41,37 @@ PERF_TEST_P(Image_MaxCorners_QualityLevel_MinDistance_BlockSize_gradientSize_Use
     SANITY_CHECK(corners);
 }
 
+PERF_TEST_P(Image_MaxCorners_QualityLevel_MinDistance_BlockSize_gradientSize_UseHarris, goodFeaturesToTrackWithQuality,
+            testing::Combine(
+                    testing::Values( "stitching/a1.png", "cv/shared/pic5.png"),
+                    testing::Values( 50 ),
+                    testing::Values( 0.01 ),
+                    testing::Values( 3 ),
```

Review comment:
This change drops testing of old function. You should create new one instead.
**File:** modules/imgproc/src/featureselect.cpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -74,8 +74,8 @@ struct Corner
 
 static bool ocl_goodFeaturesToTrack( InputArray _image, OutputArray _corners,
                                      int maxCorners, double qualityLevel, double minDistance,
-                                     InputArray _mask, int blockSize, int gradientSize,
-                                     bool useHarrisDetector, double harrisK )
+                                     InputArray _mask, OutputArray _cornersQuality, int blockSize, int gradientSize,
+                                     bool useHarrisDetector, double harrisK)
 {
     UMat eig, maxEigenValue;
```

Review comment:
> .getMat(ACCESS_READ) `.getMat()` / `.getUMat()` in a loop is not a good idea --- Did you run perf tests locally?
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -1999,6 +1999,38 @@ CV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,
                                      InputArray mask, int blockSize,
                                      int gradientSize, bool useHarrisDetector = false,
                                      double k = 0.04 );
+
+/** @brief Same as above, but returns also quality measure of the detected corners.
+
+@param image Input 8-bit or floating-point 32-bit, single-channel image.
+@param corners Output vector of detected corners.
+@param maxCorners Maximum number of corners to return. If there are more corners than are found,
```

Review comment:
I think that this overload is redundant. The same functionality can be achieved with the next overload. The previous overload with and without `gradientSize` was added for backward compatibility. New functions does not require it.
**File:** modules/features2d/src/gftt.cpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -87,6 +87,7 @@ class GFTTDetector_Impl CV_FINAL : public GFTTDetector
         }
 
         std::vector<Point2f> corners;
+        std::vector<float> cornersQuality;
 
         if (_image.isUMat())
         {
@@ -97,7 +98,7 @@ class GFTTDetector_Impl CV_FINAL : public GFTTDetector
                 ugrayImage = _image.getUMat();
```

Review comment:
This part of code looks strange (it was strange before this patch too). What should we do with "left" uninitialized items when `keypoint_it != keypoints.end() && quality_it != cornersQuality.end()` is triggered instead of `corner_it != corners.end()`? Perhaps it makes sense to put after this loop consistency check: ``` CV_Assert(corner_it == corners.end()); ```
**File:** modules/imgproc/test/test_goodfeaturetotrack.cpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -88,14 +88,13 @@ test_cornerEigenValsVecs( const Mat& src, Mat& eigenv, int block_size,
     cvtest::filter2D( src, dy2, ftype, kernel*kernel_scale, anchor, 0, borderType,borderValue );
 
     double denom = (1 << (aperture_size-1))*block_size;
-    denom = denom * denom;
 
     if( _aperture_size < 0 )
-        denom *= 4;
+        denom *= 2.;
     if(type != ftype )
```

Review comment:
Prefer to use GTest's `EXPECT_LE(e, eps);` instead of legacy "ts->printf()". It would should failed line at least.
**File:** modules/imgproc/test/test_goodfeaturetotrack.cpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -88,14 +88,13 @@ test_cornerEigenValsVecs( const Mat& src, Mat& eigenv, int block_size,
     cvtest::filter2D( src, dy2, ftype, kernel*kernel_scale, anchor, 0, borderType,borderValue );
 
     double denom = (1 << (aperture_size-1))*block_size;
-    denom = denom * denom;
 
     if( _aperture_size < 0 )
-        denom *= 4;
+        denom *= 2.;
     if(type != ftype )
```

Review comment:
Fixed, but unfortunately the test itself does not extend GTest so semantics of EXPECT_LE looks oddly.
**File:** modules/features2d/src/gftt.cpp
**Change Type:** modified
**Context:** PR #19392: goodFeaturesToTrack returns also corner value

**Code Changes:**
```diff
@@ -87,6 +87,7 @@ class GFTTDetector_Impl CV_FINAL : public GFTTDetector
         }
 
         std::vector<Point2f> corners;
+        std::vector<float> cornersQuality;
 
         if (_image.isUMat())
         {
@@ -97,7 +98,7 @@ class GFTTDetector_Impl CV_FINAL : public GFTTDetector
                 ugrayImage = _image.getUMat();
```

Review comment:
`.reserve()` is necessary to avoid multiple re-allocations.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
> CV_SIMD128_64F In general, `64F` should be used with the `double` type. Why does `#ifdef __aarch64__` not work here? (or other condition)
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
in `intrin_neon.hpp`, `CV_SIMD128_64F` is equivalent to `__aarch64__` so wipe out the old implementation. The `else` part will never be referred.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
Please mind the indent
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
It's misleading, but `vmlal_high_s16` is only available for `aarch64` [ref](https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vmlal_high_s16) The macro might be misleading, but it's doing the right thing.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
My proposal is: ``` -#if CV_SIMD128_64F +#ifdef __aarch64__ ```
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
Right. My review was missing the view of Visual Studio. In that case, I vote for re-using `CV_SIMD128_64F` `CV_SIMD128_64F` is used in many places, and I don't like renaming it as `CV_NEON_ADVSIMD` (Though, I like the idea). My suggestion is to use just `CV_SIMD128_64F` and remove `__aarch64__`. That'll make things more simple.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
`CV_SIMD128_64F` macro is a part of external SIMD API, so we should not change its meaning. What is about `CV_NEON_AARCH64` new macro (just because of MSVS)? (it is more clear than ADVSIMD) Anyway it makes sense to add comment near this definition with corresponding link at the page with ARM Advanced SIMD documentation.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

**Code Changes:**
```diff
@@ -62,6 +62,22 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
 #define CV_SIMD128_64F 0
 #endif
 
+// The following macro checks if the code is being compiled for the
+// AArch64 execution state of Armv8, to enable the 128-bit
+// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by
+// the Arm C Language Extension (ACLE) specifications [1] to check the
+// availability of 128-bit intrinsics, and it is supporrted by clang
+// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft
```

Review comment:
`CV_NEON_AARCH64` is fine. I'll update the patch and use that. I'll add the comment to the documentation.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #19486: [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.
**Review Line:** 79

**Code Changes:**
```diff
+// [2] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
+#if defined(__ARM_64BIT_STATE) || defined(_M_ARM64)
+#define CV_NEON_AARCH64 1
+#else
+#define CV_NEON_AARCH64 0
+#endif
+
 // TODO
 #define CV_NEON_DOT 0
 
@@ -726,41 +742,61 @@ inline v_float64x2 v_dotprod_expand(const v_int32x4& a,   const v_int32x4& b,
```

Review comment:
Please add this to avoid warnings: ``` #else #define CV_NEON_AARCH64 0 #endif ```
**File:** modules/imgcodecs/src/grfmt_base.hpp
**Change Type:** modified
**Context:** PR #19439: Added Exif parsing for PNG Issue 16579

**Code Changes:**
```diff
@@ -45,6 +45,7 @@
 
 #include "utils.hpp"
 #include "bitstrm.hpp"
+#include "exif.hpp"
 
 namespace cv
 {
@@ -65,6 +66,7 @@ class BaseImageDecoder
     int height() const { return m_height; }
```

Review comment:
> ExifReader reference: `ExifReader&`?
**File:** modules/imgcodecs/test/test_png.cpp
**Change Type:** modified
**Context:** PR #19439: Added Exif parsing for PNG Issue 16579
**Review Line:** 162

**Code Changes:**
```diff
+
+    //Checking the first quadrant (with supposed red)
+    vec = m_img.at<Vec3b>(2, 2); //some point inside the square
+    EXPECT_LE(vec.val[0], colorThresholdLow);
+    EXPECT_LE(vec.val[1], colorThresholdLow);
+    EXPECT_GE(vec.val[2], colorThresholdHigh);
+
+    //Checking the second quadrant (with supposed green)
+    vec = m_img.at<Vec3b>(2, 7);  //some point inside the square
+    EXPECT_LE(vec.val[0], colorThresholdLow);
+    EXPECT_GE(vec.val[1], colorThresholdHigh);
```

Review comment:
BTW, Do you observe some issues with exact checks (`_EQ`)? AFAIK, PNG format is lossless in general (colorspace may introduce some inaccuracy).
**File:** modules/imgcodecs/test/test_png.cpp
**Change Type:** modified
**Context:** PR #19439: Added Exif parsing for PNG Issue 16579
**Review Line:** 162

**Code Changes:**
```diff
+
+    //Checking the first quadrant (with supposed red)
+    vec = m_img.at<Vec3b>(2, 2); //some point inside the square
+    EXPECT_LE(vec.val[0], colorThresholdLow);
+    EXPECT_LE(vec.val[1], colorThresholdLow);
+    EXPECT_GE(vec.val[2], colorThresholdHigh);
+
+    //Checking the second quadrant (with supposed green)
+    vec = m_img.at<Vec3b>(2, 7);  //some point inside the square
+    EXPECT_LE(vec.val[0], colorThresholdLow);
+    EXPECT_GE(vec.val[1], colorThresholdHigh);
```

Review comment:
Great question. I converted/adapated the png exif test images from the pre-existing jpeg exif test images. Whether due to previous jpeg compression or colorspace inaccuracy, the png image color values vary by a +/- 2 margin of error.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
The condition duplicates previous `CV_Accert`.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
You can use CV_Assert too.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
OpenGL support does not mean support of all required extensions. I propose not to thow exception, if the extension is not available in software or not implemented in GPU. It's better to return -1 as result of the function to user and it can handle it in safe way.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
absolutely! I'll keep the CV_Error and remove the assertion, unless you'd prefer assertions
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
should I convert only that part to returning -1, or every exception? I don't see how that call differs from the others. if any of them fail, the function can't succeed, and I think that should constitute an exception.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
I've now given that a more helpful "window doesn't exist" message
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
I think that it's relevant for all calls to OpenGL extensions in "get" call.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19408: highgui: expose VSYNC window property for OpenGL on W32

**Code Changes:**
```diff
@@ -596,6 +596,89 @@ void cvSetPropTopmost_W32(const char* name, const bool topmost)
     }
 }
 
+double cvGetPropVsync_W32(const char* name)
+{
+#ifndef HAVE_OPENGL
+    CV_UNUSED(name);
+    CV_Error(Error::OpenGlNotSupported, "Library was built without OpenGL support");
+#else
```

Review comment:
ok, I'll change them all to returning -1 in the get call
**File:** modules/highgui/src/window_winrt.cpp
**Change Type:** modified
**Context:** PR #19411: pollKey implementation for w32 backend of highgui

**Code Changes:**
```diff
@@ -205,6 +205,14 @@ CV_IMPL int cvGetTrackbarPos(const char* trackbar_name, const char* window_name)
 
 /********************************** Not YET implemented API ****************************************************/
 
+int cv::pollKey()
+{
+    CV_TRACE_FUNCTION();
+    CV_WINRT_NO_GUI_ERROR("cvPollKey");
+
+    // TODO: implement appropriate logic here
```

Review comment:
It's obviously dead code.
**File:** modules/highgui/src/window_winrt.cpp
**Change Type:** modified
**Context:** PR #19411: pollKey implementation for w32 backend of highgui

**Code Changes:**
```diff
@@ -205,6 +205,14 @@ CV_IMPL int cvGetTrackbarPos(const char* trackbar_name, const char* window_name)
 
 /********************************** Not YET implemented API ****************************************************/
 
+int cv::pollKey()
+{
+    CV_TRACE_FUNCTION();
+    CV_WINRT_NO_GUI_ERROR("cvPollKey");
+
+    // TODO: implement appropriate logic here
```

Review comment:
loop removed, comment remains as in adjacent functions.
**File:** modules/highgui/include/opencv2/highgui.hpp
**Change Type:** modified
**Context:** PR #19411: pollKey implementation for w32 backend of highgui

**Code Changes:**
```diff
@@ -347,23 +347,34 @@ The function waitKey waits for a key event infinitely (when \f$\texttt{delay}\le
 milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the
 function will not wait exactly delay ms, it will wait at least delay ms, depending on what else is
 running on your computer at that time. It returns the code of the pressed key or -1 if no key was
-pressed before the specified time had elapsed.
+pressed before the specified time had elapsed. To check for a key press but not wait for it, use
+#pollKey.
 
-@note
-
```

Review comment:
This note is [malformed](http://pullrequest.opencv.org/buildbot/export/pr/19411/docs/d7/dfc/group__highgui.html#ga6d20fbd3100ec3badc1eaa653aff99d7). Need to remove new lines.
**File:** modules/highgui/src/window_w32.cpp
**Change Type:** modified
**Context:** PR #19411: pollKey implementation for w32 backend of highgui

**Code Changes:**
```diff
@@ -1981,6 +1981,97 @@ static void showSaveDialog(CvWindow* window)
     }
 }
 
+/*
+ * message received. check if it belongs to our windows (frame, hwnd).
+ * returns true (and value in keyCode) if a key was pressed.
+ * otherwise returns false (indication to continue event loop).
+ */
+static bool handleMessage(MSG& message, int& keyCode)
```

Review comment:
> result `keyCode`