nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/include/opencv2/imgproc/hal/hal.hpp
**Change Type:** modified
**Context:** PR #9970: MediaSDK: fixed Linux build, improved BGR<->NV12 conversions - ### This pullrequest changes - fixed compilation on Linux - use `cv::hal::` f...
**Review Line:** 196

**Code Changes:**
```diff
@@ -192,6 +192,12 @@ CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
                                     int dst_width, int dst_height,
                                     int dcn, bool swapBlue, int uIdx);
 
+//! Separate Y and UV planes
+CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src_step,
+                                    uchar * dst_data, size_t dst_step,
+                                    int dst_width, int dst_height,
+                                    int dcn, bool swapBlue, int uIdx);
+
 CV_EXPORTS void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
```

Review comment:
In IPP they use convention like cvtYUVtoBGR_P2. Probably, we should use it as well.
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9970: MediaSDK: fixed Linux build, improved BGR<->NV12 conversions - ### This pullrequest changes - fixed compilation on Linux - use `cv::hal::` f...
**Review Line:** 9147

**Code Changes:**
```diff
+        else
+            operator()(Range(0, src_height/2));
     }
 
 private:
     RGB888toYUV420pInvoker& operator=(const RGB888toYUV420pInvoker&);
 
     const uchar * src_data;
     size_t src_step;
-    uchar * dst_data;
+    uchar *y_data, *uv_data;
```

Review comment:
do we need hidden = operator? probably, "const int scn" can be changed to "int scn". Since `operator()(const Range& r)` is `const` method, all the class members are automatically treated as constants
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9970: MediaSDK: fixed Linux build, improved BGR<->NV12 conversions - ### This pullrequest changes - fixed compilation on Linux - use `cv::hal::` f...
**Review Line:** 9155

**Code Changes:**
```diff
-    uchar * dst_data;
+    uchar *y_data, *uv_data;
     size_t dst_step;
     int src_width;
     int src_height;
     const int scn;
+    bool swapBlue;
+    bool swapUV;
+    bool interleaved;
 };
 
```

Review comment:
as mentioned above, `const` is unnecessary here
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9970: MediaSDK: fixed Linux build, improved BGR<->NV12 conversions - ### This pullrequest changes - fixed compilation on Linux - use `cv::hal::` f...
**Review Line:** 10821

**Code Changes:**
```diff
-    case 321: cvtYUV420sp2RGB<2, 1> (dst_data, dst_step, dst_width, dst_height, src_step, src_data, uv); break;
-    case 400: cvtYUV420sp2RGBA<0, 0>(dst_data, dst_step, dst_width, dst_height, src_step, src_data, uv); break;
-    case 401: cvtYUV420sp2RGBA<0, 1>(dst_data, dst_step, dst_width, dst_height, src_step, src_data, uv); break;
-    case 420: cvtYUV420sp2RGBA<2, 0>(dst_data, dst_step, dst_width, dst_height, src_step, src_data, uv); break;
-    case 421: cvtYUV420sp2RGBA<2, 1>(dst_data, dst_step, dst_width, dst_height, src_step, src_data, uv); break;
+    case 300: cvtYUV420sp2RGB<0, 0> (dst_data, dst_step, dst_width, dst_height, src_step, y_data, uv_data); break;
+    case 301: cvtYUV420sp2RGB<0, 1> (dst_data, dst_step, dst_width, dst_height, src_step, y_data, uv_data); break;
+    case 320: cvtYUV420sp2RGB<2, 0> (dst_data, dst_step, dst_width, dst_height, src_step, y_data, uv_data); break;
+    case 321: cvtYUV420sp2RGB<2, 1> (dst_data, dst_step, dst_width, dst_height, src_step, y_data, uv_data); break;
+    case 400: cvtYUV420sp2RGBA<0, 0>(dst_data, dst_step, dst_width, dst_height, src_step, y_data, uv_data); break;
+    case 401: cvtYUV420sp2RGBA<0, 1>(dst_data, dst_step, dst_width, dst_height, src_step, y_data, uv_data); break;
```

Review comment:
as we are trying to make OpenCV smaller, perhaps using real function parameters instead of template parameters is probably preferable.
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9970: MediaSDK: fixed Linux build, improved BGR<->NV12 conversions - ### This pullrequest changes - fixed compilation on Linux - use `cv::hal::` f...
**Review Line:** 9147

**Code Changes:**
```diff
+        else
+            operator()(Range(0, src_height/2));
     }
 
 private:
     RGB888toYUV420pInvoker& operator=(const RGB888toYUV420pInvoker&);
 
     const uchar * src_data;
     size_t src_step;
-    uchar * dst_data;
+    uchar *y_data, *uv_data;
```

Review comment:
This is for static code analyzers. There is no implementation. This is just a BKM. In C++11 this should look like this: ``` RGB888toYUV420pInvoker& operator=(const RGB888toYUV420pInvoker&) = delete; ``` The same for copy constructor. Without this compiler would generate default operator (with invalid imlementation), which may be used by mistake.
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9931: Reduce cvtColor memory footprint - ### This pullrequest changes - several static tables have been moved from .bss section to heap - fixed er...

**Code Changes:**
```diff
@@ -140,57 +140,35 @@ const int CB2GI = -5636;
 const int CR2GI = -11698;
 const int CR2RI = 22987;
 
-// computes cubic spline coefficients for a function: (xi=i, yi=f[i]), i=0..n
-template<typename _Tp> static void splineBuild(const _Tp* f, int n, _Tp* tab)
-{
-    _Tp cn = 0;
-    int i;
-    tab[0] = tab[1] = (_Tp)0;
```

Review comment:
Please apply this pattern: https://en.wikipedia.org/wiki/Double-checked_locking
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9931: Reduce cvtColor memory footprint - ### This pullrequest changes - several static tables have been moved from .bss section to heap - fixed er...

**Code Changes:**
```diff
@@ -140,57 +140,35 @@ const int CB2GI = -5636;
 const int CR2GI = -11698;
 const int CR2RI = 22987;
 
-// computes cubic spline coefficients for a function: (xi=i, yi=f[i]), i=0..n
-template<typename _Tp> static void splineBuild(const _Tp* f, int n, _Tp* tab)
-{
-    _Tp cn = 0;
-    int i;
-    tab[0] = tab[1] = (_Tp)0;
```

Review comment:
It is not safe to use global static variable with constructor in general. Refer to 'static initialization order fiasco' problem. The most dangerous issues are: - use before object constructor call - use after object destroying
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9931: Reduce cvtColor memory footprint - ### This pullrequest changes - several static tables have been moved from .bss section to heap - fixed er...

**Code Changes:**
```diff
@@ -140,57 +140,35 @@ const int CB2GI = -5636;
 const int CR2GI = -11698;
 const int CR2RI = 22987;
 
-// computes cubic spline coefficients for a function: (xi=i, yi=f[i]), i=0..n
-template<typename _Tp> static void splineBuild(const _Tp* f, int n, _Tp* tab)
-{
-    _Tp cn = 0;
-    int i;
-    tab[0] = tab[1] = (_Tp)0;
```

Review comment:
1. `const` 2. `= NULL` ``` static const float* LabCbrtTab = NULL; ``` 3. alignment requirements? 4. we need to make valgrind happy (suppress these hits). To make it easier, probably we should create new function for memory allocation for such "singleton" objects/buffers. ``` float* LabCbrtTab_ = cv::allocSingleton<float>(LAB_CBRT_TAB_SIZE * 4); splineBuild(f, LAB_CBRT_TAB_SIZE, LabCbrtTab_); // without static_cast<float*> LabCbrtTab = LabCbrtTab_; ```
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9931: Reduce cvtColor memory footprint - ### This pullrequest changes - several static tables have been moved from .bss section to heap - fixed er...

**Code Changes:**
```diff
@@ -140,57 +140,35 @@ const int CB2GI = -5636;
 const int CR2GI = -11698;
 const int CR2RI = 22987;
 
-// computes cubic spline coefficients for a function: (xi=i, yi=f[i]), i=0..n
-template<typename _Tp> static void splineBuild(const _Tp* f, int n, _Tp* tab)
-{
-    _Tp cn = 0;
-    int i;
-    tab[0] = tab[1] = (_Tp)0;
```

Review comment:
"<= n" ? (this doesn't look similar to line 150)
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9931: Reduce cvtColor memory footprint - ### This pullrequest changes - several static tables have been moved from .bss section to heap - fixed er...

**Code Changes:**
```diff
@@ -140,57 +140,35 @@ const int CB2GI = -5636;
 const int CR2GI = -11698;
 const int CR2RI = 22987;
 
-// computes cubic spline coefficients for a function: (xi=i, yi=f[i]), i=0..n
-template<typename _Tp> static void splineBuild(const _Tp* f, int n, _Tp* tab)
-{
-    _Tp cn = 0;
-    int i;
-    tab[0] = tab[1] = (_Tp)0;
```

Review comment:
This is a fix of an uninitialized memory access due to an error in the _splineBuild_ function. It was not visible when initialization was static, but it is detected by valgrind when initialization is dynamic.
**File:** modules/core/include/opencv2/core/private.hpp
**Change Type:** modified
**Context:** PR #9931: Reduce cvtColor memory footprint - ### This pullrequest changes - several static tables have been moved from .bss section to heap - fixed er...
**Review Line:** 165

**Code Changes:**
```diff
 {
 CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int unroll_to = 0);
+
+//! Allocate all memory buffers which will not be freed, ease filtering memcheck issues
+template <typename T>
+CV_EXPORTS T* allocSingleton(size_t count) { return static_cast<T*>(fastMalloc(sizeof(T) * count)); }
 }
 
 // property implementation macros
```

Review comment:
It would be nice to add entry into vallgrind.supp file too.
**File:** cmake/OpenCVModule.cmake
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -852,7 +852,6 @@ macro(_ocv_create_module)
     ${${the_module}_pch}
     ${_VS_VERSION_FILE}
   )
-
   set_target_properties(${the_module} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
   set_source_files_properties(${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} ${${the_module}_pch}
     PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
@@ -879,8 +878,13 @@ macro(_ocv_create_module)
     COMPILE_PDB_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
```

Review comment:
"PIC" is needed for Python/Java bindings only. For using OpenCV with applications it is not required at all.
**File:** cmake/OpenCVModule.cmake
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -852,7 +852,6 @@ macro(_ocv_create_module)
     ${${the_module}_pch}
     ${_VS_VERSION_FILE}
   )
-
   set_target_properties(${the_module} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
   set_source_files_properties(${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} ${${the_module}_pch}
     PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
@@ -879,8 +878,13 @@ macro(_ocv_create_module)
     COMPILE_PDB_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
```

Review comment:
Need to revert this change.
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -248,12 +248,22 @@ Cv64suf;
 #  define DISABLE_OPENCV_24_COMPATIBILITY
 #endif
 
-#if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
-#  define CV_EXPORTS __declspec(dllexport)
-#elif defined __GNUC__ && __GNUC__ >= 4
-#  define CV_EXPORTS __attribute__ ((visibility ("default")))
+#ifdef CVAPI_EXPORTS
+# if (defined _WIN32 || defined WINCE || defined __CYGWIN__)
```

Review comment:
Comment is not consistent with following code. Android application native library should not export OpenCV API
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -248,12 +248,22 @@ Cv64suf;
 #  define DISABLE_OPENCV_24_COMPATIBILITY
 #endif
 
-#if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
-#  define CV_EXPORTS __declspec(dllexport)
-#elif defined __GNUC__ && __GNUC__ >= 4
-#  define CV_EXPORTS __attribute__ ((visibility ("default")))
+#ifdef CVAPI_EXPORTS
+# if (defined _WIN32 || defined WINCE || defined __CYGWIN__)
```

Review comment:
`CV_EXPORTS_TEMPLATE` is not expected by bindings parser.
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -248,12 +248,22 @@ Cv64suf;
 #  define DISABLE_OPENCV_24_COMPATIBILITY
 #endif
 
-#if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
-#  define CV_EXPORTS __declspec(dllexport)
-#elif defined __GNUC__ && __GNUC__ >= 4
-#  define CV_EXPORTS __attribute__ ((visibility ("default")))
+#ifdef CVAPI_EXPORTS
+# if (defined _WIN32 || defined WINCE || defined __CYGWIN__)
```

Review comment:
Currently bindings generators do not support templates, so we don't need it for now. We can easily add `CV_EXPORTS_TEMPLATE_W` macro if such functionality will be implemented.
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -248,12 +248,22 @@ Cv64suf;
 #  define DISABLE_OPENCV_24_COMPATIBILITY
 #endif
 
-#if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
-#  define CV_EXPORTS __declspec(dllexport)
-#elif defined __GNUC__ && __GNUC__ >= 4
-#  define CV_EXPORTS __attribute__ ((visibility ("default")))
+#ifdef CVAPI_EXPORTS
+# if (defined _WIN32 || defined WINCE || defined __CYGWIN__)
```

Review comment:
We build native static libraries and "fat Java lib" for Android in one build (`-DBUILD_SHARED_LIBS=OFF -DBUILD_FAT_JAVA_LIB=ON`). We need to export all symbols for the second artifact. Currently all symbols are exported in static builds on all platforms, this PR changes this behavior for all platforms except Android. I can only suggest reworking "fat Java lib" artifact, so that it will be produced same way as _opencv_world_ module (`-DBUILD_SHARED_LIBS=ON -DBUILD_opencv_world=ON -DBUILD_FAT_JAVA_LIB=ON`), but it cat take more time to investigate.
**File:** cmake/OpenCVModule.cmake
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -852,7 +852,6 @@ macro(_ocv_create_module)
     ${${the_module}_pch}
     ${_VS_VERSION_FILE}
   )
-
   set_target_properties(${the_module} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
   set_source_files_properties(${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} ${${the_module}_pch}
     PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
@@ -879,8 +878,13 @@ macro(_ocv_create_module)
     COMPILE_PDB_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
```

Review comment:
This is a port of block removed from _OpenCVCompilerOptions.cmake_. We always enable PIC because static libraries can be used to build some shared libraries, I wanted to preserve this ability.
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #8198: Updated library exports - replaces #8073 build with opencv/opencv_contrib#996 ### This pullrequest changes - use GenerateExportHeader - fixe...

**Code Changes:**
```diff
@@ -248,12 +248,22 @@ Cv64suf;
 #  define DISABLE_OPENCV_24_COMPATIBILITY
 #endif
 
-#if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
-#  define CV_EXPORTS __declspec(dllexport)
-#elif defined __GNUC__ && __GNUC__ >= 4
-#  define CV_EXPORTS __attribute__ ((visibility ("default")))
+#ifdef CVAPI_EXPORTS
+# if (defined _WIN32 || defined WINCE || defined __CYGWIN__)
```

Review comment:
Fat Java library is artifact for Android manager which is deprecated. If application doesn't use Java API (doesn't require libopencv_java.so), so there is no reason to bundle whole OpenCV code into Android application. More accurate way is no link with application JNI library with static OpenCV libraries - libopencv_core.a/etc. So we need to drop global exported symbols from these OpenCV static libraries. So, there are 2 different builds: - static libopencv_<>.a with global exported symbols => libopencv_java.so - static libopencv_<>.a without global exported symbols and without any libopencv_java.so. Useful for using OpenCV API from native C++ code only (without any OpenCV Java bindings).
**File:** modules/ts/misc/run_utils.py
**Change Type:** modified
**Context:** PR #10619: run.py improvements - ### This pullrequest changes - fixed run.py execution when Java has been disabled during build - removed complex func...
**Review Line:** 83

**Code Changes:**
```diff
-    {'name': "cuda_library",             'default': None,       'pattern': re.compile(r"^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$")},
-    {'name': "cuda_version",             'default': None,       'pattern': re.compile(r"^CUDA_VERSION:STRING=(.+)$")},
-    {'name': "core_dependencies",        'default': None,       'pattern': re.compile(r"^opencv_core_LIB_DEPENDS:STATIC=(.+)$")},
-    {'name': "python2",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python2:BOOL=(.*)$")},
-    {'name': "python3",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python3:BOOL=(.*)$")},
+    {'name': "is_x64",                   'default': "OFF",      'pattern': re.compile(r"^CUDA_64_BIT_DEVICE_CODE:\w+=(ON)$")},
+    {'name': "cmake_generator",          'default': None,       'pattern': re.compile(r"^CMAKE_GENERATOR:\w+=(.+)$")},
+    {'name': "python2",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python2:\w+=(.*)$")},
+    {'name': "python3",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python3:\w+=(.*)$")},
 )
 
```

Review comment:
"is_x64" is not used, especially with CUDA value.
**File:** modules/ts/misc/run_utils.py
**Change Type:** modified
**Context:** PR #10619: run.py improvements - ### This pullrequest changes - fixed run.py execution when Java has been disabled during build - removed complex func...
**Review Line:** 83

**Code Changes:**
```diff
-    {'name': "cuda_library",             'default': None,       'pattern': re.compile(r"^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$")},
-    {'name': "cuda_version",             'default': None,       'pattern': re.compile(r"^CUDA_VERSION:STRING=(.+)$")},
-    {'name': "core_dependencies",        'default': None,       'pattern': re.compile(r"^opencv_core_LIB_DEPENDS:STATIC=(.+)$")},
-    {'name': "python2",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python2:BOOL=(.*)$")},
-    {'name': "python3",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python3:BOOL=(.*)$")},
+    {'name': "is_x64",                   'default': "OFF",      'pattern': re.compile(r"^CUDA_64_BIT_DEVICE_CODE:\w+=(ON)$")},
+    {'name': "cmake_generator",          'default': None,       'pattern': re.compile(r"^CMAKE_GENERATOR:\w+=(.+)$")},
+    {'name': "python2",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python2:\w+=(.*)$")},
+    {'name': "python3",                  'default': None,       'pattern': re.compile(r"^BUILD_opencv_python3:\w+=(.*)$")},
 )
 
```

Review comment:
I'll remove it in next refactoring iteration.
**File:** modules/features2d/src/fast.cpp
**Change Type:** modified
**Context:** PR #10362: add HAL for FAST -  ### This pullrequest changes Add HAL interface for FAST algorithm for corner detection. Call only for FAST_9_16 and thr...

**Code Changes:**
```diff
@@ -45,6 +45,7 @@ The references are:
 #include "fast.hpp"
 #include "fast_score.hpp"
 #include "opencl_kernels_features2d.hpp"
+#include "hal_replacement.hpp"
 #include "opencv2/core/hal/intrin.hpp"
 
 #include "opencv2/core/openvx/ovx_defs.hpp"
@@ -414,6 +415,62 @@ static bool openvx_FAST(InputArray _img, std::vector<KeyPoint>& keypoints,
 
```

Review comment:
It will be better to remove this function from the `hal::` namespace, we use it for HAL public interface (defined in [hal.hpp](https://github.com/opencv/opencv/blob/master/modules/imgproc/include/opencv2/imgproc/hal/hal.hpp)). You can mark it `static` and rename to something like `hal_FAST`.
**File:** modules/features2d/src/fast.cpp
**Change Type:** modified
**Context:** PR #10362: add HAL for FAST -  ### This pullrequest changes Add HAL interface for FAST algorithm for corner detection. Call only for FAST_9_16 and thr...

**Code Changes:**
```diff
@@ -45,6 +45,7 @@ The references are:
 #include "fast.hpp"
 #include "fast_score.hpp"
 #include "opencl_kernels_features2d.hpp"
+#include "hal_replacement.hpp"
 #include "opencv2/core/hal/intrin.hpp"
 
 #include "opencv2/core/openvx/ovx_defs.hpp"
@@ -414,6 +415,62 @@ static bool openvx_FAST(InputArray _img, std::vector<KeyPoint>& keypoints,
 
```

Review comment:
Is it possible to integrate [carotene implementation](https://github.com/opencv/opencv/blob/dcdd6af5a856826fe62c95322145731e702e54c5/3rdparty/carotene/include/carotene/functions.hpp#L1913-L1916) using this interface?
**File:** modules/viz/src/widget.cpp
**Change Type:** modified
**Context:** PR #10329: remove VTK legacy functions - ### This pullrequest changes Recently VTK removes some legacy functions that causes OpenCV to stop compiling....

**Code Changes:**
```diff
@@ -91,7 +91,9 @@ cv::viz::Widget cv::viz::Widget::fromPlyFile(const String &file_name)
 
     vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
     mapper->SetInputConnection( reader->GetOutputPort() );
+#if VTK_MAJOR_VERSION < 8
     mapper->ImmediateModeRenderingOff();
+#endif
 
     vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
     actor->GetProperty()->SetInterpolationToFlat();
```

Review comment:
Please use appropriate message (probably on "stderr") here that this property has no effect. Silent removal cause old app got broken on this line: ``` CV_Assert("setPointCloudRenderingProperties: Unknown property"); ```
**File:** samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp
**Change Type:** modified
**Context:** PR #10333: Update samples - resolves #10332 some small improvements on samples

**Code Changes:**
```diff
@@ -5,8 +5,8 @@
  */
 
 #include "opencv2/imgproc.hpp"
-#include "opencv2/imgcodecs.hpp"
 #include "opencv2/highgui.hpp"
+#include <iostream>
 
 using namespace cv;
 
```

Review comment:
Please remove this line to avoid this error on Apple Mac: ``` /build/precommit_macosx/opencv/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp:39:71: error: reference to 'ratio' is ambiguous Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); ^ /build/precommit_macosx/opencv/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp:21:5: note: candidate found by name lookup is 'ratio' int ratio = 3; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio:234:29: note: candidate found by name lookup is 'std::__1::ratio' class _LIBCPP_TYPE_VIS_ONLY ratio ^ 1 error generated. ```