nareshmlx/opencv-pr huggingface dataset:
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...

**Code Changes:**
```diff
@@ -179,6 +179,27 @@ template<> struct TypeToEnum<vx_bool>     { static const vx_enum value = VX_TYPE
 //template<> struct TypeToEnum<vx_size>     { static const vx_enum val = VX_TYPE_SIZE; };
 //template<> struct TypeToEnum<vx_df_image> { static const vx_enum val = VX_TYPE_DF_IMAGE; };
 
+#ifdef IVX_USE_OPENCV
+inline int enumToCVType(vx_enum type)
+{
+    switch (type)
+    {
+    case VX_TYPE_CHAR: return CV_8UC1;//While OpenCV support 8S as well, 8U is supported wider
```

Review comment:
`;` forgotten, compilation fails
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...
**Review Line:** 1659

**Code Changes:**
```diff
+        VX_MEMORY_TYPE_HOST    = VX_IMPORT_TYPE_HOST,
+        VX_CONVOLUTION_ROWS    = VX_CONVOLUTION_ATTRIBUTE_ROWS,
+        VX_CONVOLUTION_COLUMNS = VX_CONVOLUTION_ATTRIBUTE_COLUMNS,
+        VX_CONVOLUTION_SCALE   = VX_CONVOLUTION_ATTRIBUTE_SCALE,
+        VX_CONVOLUTION_SIZE    = VX_CONVOLUTION_ATTRIBUTE_SIZE;
+#endif
+
+    template<typename T>
+    void query(vx_enum att, T& value) const
+    { IVX_CHECK_STATUS( vxQueryConvolution(ref, att, &value, sizeof(value)) ); }
+
```

Review comment:
Why not moving all these definitions to beginning of the file to make them available to user whatever OVX version is installed?
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...
**Review Line:** 1808

**Code Changes:**
```diff
+        VX_MEMORY_TYPE_HOST = VX_IMPORT_TYPE_HOST,
+        VX_MATRIX_TYPE      = VX_MATRIX_ATTRIBUTE_TYPE,
+        VX_MATRIX_ROWS      = VX_MATRIX_ATTRIBUTE_ROWS,
+        VX_MATRIX_COLUMNS   = VX_MATRIX_ATTRIBUTE_COLUMNS,
+        VX_MATRIX_SIZE      = VX_MATRIX_ATTRIBUTE_SIZE;
+#endif
+
+    template<typename T>
+    void query(vx_enum att, T& value) const
+    { IVX_CHECK_STATUS( vxQueryMatrix(ref, att, &value, sizeof(value)) ); }
+
```

Review comment:
the same thing: Why not moving all these definitions to beginning of the file to make them available to user whatever OVX version is installed?
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...
**Review Line:** 1692

**Code Changes:**
```diff
+    {
+        vx_size v;
+        query(VX_CONVOLUTION_SIZE, v);
+        return v;
+    }
+
+    vx_enum dataType()
+    {
+        return VX_TYPE_INT16;
+    }
+
```

Review comment:
This looks a bit ugly and will likely be fixed in future OpenVX versions, so I suggest you put element type or size in a single place and use it via that place in the rest of code
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...
**Review Line:** 1659

**Code Changes:**
```diff
+        VX_MEMORY_TYPE_HOST    = VX_IMPORT_TYPE_HOST,
+        VX_CONVOLUTION_ROWS    = VX_CONVOLUTION_ATTRIBUTE_ROWS,
+        VX_CONVOLUTION_COLUMNS = VX_CONVOLUTION_ATTRIBUTE_COLUMNS,
+        VX_CONVOLUTION_SCALE   = VX_CONVOLUTION_ATTRIBUTE_SCALE,
+        VX_CONVOLUTION_SIZE    = VX_CONVOLUTION_ATTRIBUTE_SIZE;
+#endif
+
+    template<typename T>
+    void query(vx_enum att, T& value) const
+    { IVX_CHECK_STATUS( vxQueryConvolution(ref, att, &value, sizeof(value)) ); }
+
```

Review comment:
unclear proposal...
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...

**Code Changes:**
```diff
@@ -179,6 +179,27 @@ template<> struct TypeToEnum<vx_bool>     { static const vx_enum value = VX_TYPE
 //template<> struct TypeToEnum<vx_size>     { static const vx_enum val = VX_TYPE_SIZE; };
 //template<> struct TypeToEnum<vx_df_image> { static const vx_enum val = VX_TYPE_DF_IMAGE; };
 
+#ifdef IVX_USE_OPENCV
+inline int enumToCVType(vx_enum type)
+{
+    switch (type)
+    {
+    case VX_TYPE_CHAR: return CV_8UC1;//While OpenCV support 8S as well, 8U is supported wider
```

Review comment:
Looks like you missed `throw` and `;`.
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...

**Code Changes:**
```diff
@@ -179,6 +179,27 @@ template<> struct TypeToEnum<vx_bool>     { static const vx_enum value = VX_TYPE
 //template<> struct TypeToEnum<vx_size>     { static const vx_enum val = VX_TYPE_SIZE; };
 //template<> struct TypeToEnum<vx_df_image> { static const vx_enum val = VX_TYPE_DF_IMAGE; };
 
+#ifdef IVX_USE_OPENCV
+inline int enumToCVType(vx_enum type)
+{
+    switch (type)
+    {
+    case VX_TYPE_CHAR: return CV_8UC1;//While OpenCV support 8S as well, 8U is supported wider
```

Review comment:
Missing `throw`.
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...
**Review Line:** 1659

**Code Changes:**
```diff
+        VX_MEMORY_TYPE_HOST    = VX_IMPORT_TYPE_HOST,
+        VX_CONVOLUTION_ROWS    = VX_CONVOLUTION_ATTRIBUTE_ROWS,
+        VX_CONVOLUTION_COLUMNS = VX_CONVOLUTION_ATTRIBUTE_COLUMNS,
+        VX_CONVOLUTION_SCALE   = VX_CONVOLUTION_ATTRIBUTE_SCALE,
+        VX_CONVOLUTION_SIZE    = VX_CONVOLUTION_ATTRIBUTE_SIZE;
+#endif
+
+    template<typename T>
+    void query(vx_enum att, T& value) const
+    { IVX_CHECK_STATUS( vxQueryConvolution(ref, att, &value, sizeof(value)) ); }
+
```

Review comment:
I mean to move the definitions of these constants outside the class? In that case a user can use these constanstants regardless of OVX version installed.
**File:** 3rdparty/openvx/include/ivx.hpp
**Change Type:** modified
**Context:** PR #7651: Added wrappers for vx_matrix and vx_convolution - ### This pullrequest changes Added wrappers for vx_matrix and vx_convolution to ivx wrappe...
**Review Line:** 1659

**Code Changes:**
```diff
+        VX_MEMORY_TYPE_HOST    = VX_IMPORT_TYPE_HOST,
+        VX_CONVOLUTION_ROWS    = VX_CONVOLUTION_ATTRIBUTE_ROWS,
+        VX_CONVOLUTION_COLUMNS = VX_CONVOLUTION_ATTRIBUTE_COLUMNS,
+        VX_CONVOLUTION_SCALE   = VX_CONVOLUTION_ATTRIBUTE_SCALE,
+        VX_CONVOLUTION_SIZE    = VX_CONVOLUTION_ATTRIBUTE_SIZE;
+#endif
+
+    template<typename T>
+    void query(vx_enum att, T& value) const
+    { IVX_CHECK_STATUS( vxQueryConvolution(ref, att, &value, sizeof(value)) ); }
+
```

Review comment:
IMO this wrappers intended to minimize and simplify user interaction with plain OpenVX. These constants are used for already wrapped attribute queries only so one shouldn't normally use them at all. So I think such constants doesn't make sense outside of the class.
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7556: OpenVX 1.0.1 compliance update - ### This pullrequest changes Updated OpenVX1.0.1 guards and wrappers to enable functionality available both...

**Code Changes:**
```diff
@@ -21,6 +21,12 @@
 #define VX_INTERPOLATION_BILINEAR VX_INTERPOLATION_TYPE_BILINEAR
 #define VX_INTERPOLATION_AREA VX_INTERPOLATION_TYPE_AREA
 #define VX_INTERPOLATION_NEAREST_NEIGHBOR VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR
+#define VX_IMAGE_RANGE VX_IMAGE_ATTRIBUTE_RANGE
+#define VX_IMAGE_SPACE VX_IMAGE_ATTRIBUTE_SPACE
+#define vx_border_t vx_border_mode_t
+#define VX_BORDER_CONSTANT VX_BORDER_MODE_CONSTANT
+#define VX_BORDER_REPLICATE VX_BORDER_MODE_REPLICATE
+#define VX_CONTEXT_IMMEDIATE_BORDER VX_CONTEXT_ATTRIBUTE_IMMEDIATE_BORDER_MODE
```

Review comment:
this is absolutely the same code repeated in several places; can we add a helper inline function to set the constant border value?
**File:** modules/core/src/persistence.cpp
**Change Type:** modified
**Context:** PR #7595: Skip UTF-8 BOM in FileStorage

**Code Changes:**
```diff
@@ -96,6 +96,15 @@ static inline bool cv_isspace(char c)
     return (9 <= c && c <= 13) || c == ' ';
 }
 
+static inline char* cv_skip_BOM(char* ptr)
+{
+    if((uchar)ptr[0] == 0xef && (uchar)ptr[1] == 0xbb && (uchar)ptr[2] == 0xbf) //UTF-8 BOM
+    {
+      return ptr + 3;
+    }
```

Review comment:
`>= 3` (in case of "empty" document)?
**File:** modules/imgproc/src/imgwarp.cpp
**Change Type:** modified
**Context:** PR #7601: Add assertion to prevent processing of large images in remap - A temporary solution to prevent cases like in #7544
**Review Line:** 4859

**Code Changes:**
```diff
@@ -4856,6 +4856,8 @@ void cv::remap( InputArray _src, OutputArray _dst,
     Mat src = _src.getMat(), map1 = _map1.getMat(), map2 = _map2.getMat();
     _dst.create( map1.size(), src.type() );
     Mat dst = _dst.getMat();
+    CV_Assert( dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX );
+
     if( dst.data == src.data )
         src = src.clone();
 
```

Review comment:
should it be `<` or `<=`?
**File:** modules/imgproc/src/imgwarp.cpp
**Change Type:** modified
**Context:** PR #7601: Add assertion to prevent processing of large images in remap - A temporary solution to prevent cases like in #7544
**Review Line:** 4859

**Code Changes:**
```diff
@@ -4856,6 +4856,8 @@ void cv::remap( InputArray _src, OutputArray _dst,
     Mat src = _src.getMat(), map1 = _map1.getMat(), map2 = _map2.getMat();
     _dst.create( map1.size(), src.type() );
     Mat dst = _dst.getMat();
+    CV_Assert( dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX );
+
     if( dst.data == src.data )
         src = src.clone();
 
```

Review comment:
`<`. If equals to `SHRT_MAX` the problem persists.
**File:** samples/cpp/dbt_face_detection.cpp
**Change Type:** modified
**Context:** PR #7552: fixed detection_based_tracker.cpp on visual studio 2013 and later -  ### This pullrequest removes the shared unique_lock<mutex> in cv::Detec...

**Code Changes:**
```diff
@@ -1,4 +1,4 @@
-#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
+#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) || (defined(_MSC_VER) && _MSC_VER>=1800)
 
 #include <opencv2/imgproc.hpp>  // Gaussian Blur
 #include <opencv2/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
@@ -54,9 +54,19 @@ int main(int , char** )
     std::string cascadeFrontalfilename = "../../data/lbpcascades/lbpcascade_frontalface.xml";
     cv::Ptr<cv::CascadeClassifier> cascade = makePtr<cv::CascadeClassifier>(cascadeFrontalfilename);
     cv::Ptr<DetectionBasedTracker::IDetector> MainDetector = makePtr<CascadeDetectorAdapter>(cascade);
```

Review comment:
`>1770` -> `>=1700`
**File:** samples/cpp/dbt_face_detection.cpp
**Change Type:** modified
**Context:** PR #7552: fixed detection_based_tracker.cpp on visual studio 2013 and later -  ### This pullrequest removes the shared unique_lock<mutex> in cv::Detec...

**Code Changes:**
```diff
@@ -1,4 +1,4 @@
-#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
+#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) || (defined(_MSC_VER) && _MSC_VER>=1800)
 
 #include <opencv2/imgproc.hpp>  // Gaussian Blur
 #include <opencv2/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
@@ -54,9 +54,19 @@ int main(int , char** )
     std::string cascadeFrontalfilename = "../../data/lbpcascades/lbpcascade_frontalface.xml";
     cv::Ptr<cv::CascadeClassifier> cascade = makePtr<cv::CascadeClassifier>(cascadeFrontalfilename);
     cv::Ptr<DetectionBasedTracker::IDetector> MainDetector = makePtr<CascadeDetectorAdapter>(cascade);
```

Review comment:
actually, >1700 was right, unless there is a release between VS2012 and VS2013. VS2013 is 1800. So now it's clearer.
**File:** samples/cpp/dbt_face_detection.cpp
**Change Type:** modified
**Context:** PR #7552: fixed detection_based_tracker.cpp on visual studio 2013 and later -  ### This pullrequest removes the shared unique_lock<mutex> in cv::Detec...

**Code Changes:**
```diff
@@ -1,4 +1,4 @@
-#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
+#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) || (defined(_MSC_VER) && _MSC_VER>=1800)
 
 #include <opencv2/imgproc.hpp>  // Gaussian Blur
 #include <opencv2/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
@@ -54,9 +54,19 @@ int main(int , char** )
     std::string cascadeFrontalfilename = "../../data/lbpcascades/lbpcascade_frontalface.xml";
     cv::Ptr<cv::CascadeClassifier> cascade = makePtr<cv::CascadeClassifier>(cascadeFrontalfilename);
     cv::Ptr<DetectionBasedTracker::IDetector> MainDetector = makePtr<CascadeDetectorAdapter>(cascade);
```

Review comment:
BTW, Header file has check for >=1700. What VS2013 feature is required in sample?
**File:** samples/cpp/dbt_face_detection.cpp
**Change Type:** modified
**Context:** PR #7552: fixed detection_based_tracker.cpp on visual studio 2013 and later -  ### This pullrequest removes the shared unique_lock<mutex> in cv::Detec...

**Code Changes:**
```diff
@@ -1,4 +1,4 @@
-#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
+#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) || (defined(_MSC_VER) && _MSC_VER>=1800)
 
 #include <opencv2/imgproc.hpp>  // Gaussian Blur
 #include <opencv2/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
@@ -54,9 +54,19 @@ int main(int , char** )
     std::string cascadeFrontalfilename = "../../data/lbpcascades/lbpcascade_frontalface.xml";
     cv::Ptr<cv::CascadeClassifier> cascade = makePtr<cv::CascadeClassifier>(cascadeFrontalfilename);
     cv::Ptr<DetectionBasedTracker::IDetector> MainDetector = makePtr<CascadeDetectorAdapter>(cascade);
```

Review comment:
I tried to dig this out ( https://msdn.microsoft.com/en-us/library/hh567368.aspx#concurrencytable ) but can't find anything certain. TBH, the code was running on 2013 with minor modifications, but on 2015 it was throwing system_error according to standard. So I have no idea how it'd work on 2012. I don't have 2012 available so cannot confirm neither compilation nor functionality.
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #7467: core: add universal hardware support check function - ### This pullrequest changes - use checkHalSimdSupport rather than calling checkHardwa...
**Review Line:** 1225

**Code Changes:**
```diff
 #endif
 
+//! @name Check SIMD support
+//! @{
+//! @brief Check CPU capability of SIMD operation
+static inline bool hasSIMD128()
+{
+    return checkHardwareSupport(CV_CPU_NEON);
+}
+
+//! @}
```

Review comment:
shall we also use predefined macros like `__ARM_NEON__` e.g. like: <pre> #ifdef __ARM_NEON__ return true; #else return checkHardwareSupport(CV_CPU_NEON); #endif </pre>
**File:** modules/core/include/opencv2/core/hal/intrin_sse.hpp
**Change Type:** modified
**Context:** PR #7467: core: add universal hardware support check function - ### This pullrequest changes - use checkHalSimdSupport rather than calling checkHardwa...
**Review Line:** 1735

**Code Changes:**
```diff
+//! @name Check SIMD support
+//! @{
+//! @brief Check CPU capability of SIMD operation
+static inline bool hasSIMD128()
+{
+    return checkHardwareSupport(CV_CPU_SSE2);
+}
+
+//! @}
+
 //! @endcond
```

Review comment:
same comment. Shall we use predefined macro?
**File:** modules/core/include/opencv2/core/hal/intrin_neon.hpp
**Change Type:** modified
**Context:** PR #7467: core: add universal hardware support check function - ### This pullrequest changes - use checkHalSimdSupport rather than calling checkHardwa...
**Review Line:** 1225

**Code Changes:**
```diff
 #endif
 
+//! @name Check SIMD support
+//! @{
+//! @brief Check CPU capability of SIMD operation
+static inline bool hasSIMD128()
+{
+    return checkHardwareSupport(CV_CPU_NEON);
+}
+
+//! @}
```

Review comment:
I don't get the point. NEON is not a part of instruction. It's an extention, so checking the hardware support has a meaning. Why do we need to return `true` using macro?
**File:** modules/core/include/opencv2/core.hpp
**Change Type:** modified
**Context:** PR #7596: Clarify documentation for cv::Algorithm::read

**Code Changes:**
```diff
@@ -3027,7 +3027,8 @@ class CV_EXPORTS_W Algorithm
 
      This is static template method of Algorithm. It's usage is following (in the case of SVM):
      @code
-     Ptr<SVM> svm = Algorithm::read<SVM>(fn);
+     cv::FileStorage fsRead("example.xml", FileStorage::READ);
+     Ptr<SVM> svm = Algorithm::read<SVM>(fsRead.root());
      @endcode
      In order to make this method work, the derived class must overwrite Algorithm::read(const
      FileNode& fn) and also have static create() method without parameters
```

Review comment:
FORMAT_XML is not necessary here
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 #define OPENCV_OPENVX_HAL_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #include "VX/vx.h"
 #include "VX/vxu.h"
@@ -10,7 +11,18 @@
 #include <vector>
```

Review comment:
Unfortunately not. Actually I've started with 0x1.010102p-8 constant from OpenVX1.1 spec but MSVC complains about p character. May be it could be replaced with (0x1.010102 / 256.0)?
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 #define OPENCV_OPENVX_HAL_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #include "VX/vx.h"
 #include "VX/vxu.h"
@@ -10,7 +11,18 @@
 #include <vector>
```

Review comment:
I believe `#ifdef _MSC_VER` should resolve this problem
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 #define OPENCV_OPENVX_HAL_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #include "VX/vx.h"
 #include "VX/vxu.h"
@@ -10,7 +11,18 @@
 #include <vector>
```

Review comment:
What about `1/255.f`?
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 #define OPENCV_OPENVX_HAL_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #include "VX/vx.h"
 #include "VX/vxu.h"
@@ -10,7 +11,18 @@
 #include <vector>
```

Review comment:
OpenVX standard uses 0x1.010102p-8, so my suggestion is to force calculations to this exact number: ``` float fscale = (float)scale; if (fabs(scale - 1/255.0f) < FLT_EPSILON) fscale = 0x1.010102p-8; ... use fscale only ... ```
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...
**Review Line:** 5

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 #define OPENCV_OPENVX_HAL_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #include "VX/vx.h"
 #include "VX/vxu.h"
@@ -10,7 +11,18 @@
 #include <vector>
```

Review comment:
Try to build OpenCV with disabled imgproc module: ``` cmake -DBUILD_opencv_imgproc=OFF . ``` => include dirs from imgproc module will not be added => this include statement will fail
**File:** cmake/FindOpenVX.cmake
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...

**Code Changes:**
```diff
@@ -1,20 +1,32 @@
-ocv_clear_vars(HAVE_OPENVX OPENVX_LIBS)
+ocv_clear_vars(HAVE_OPENVX)
 
 set(OPENVX_ROOT "" CACHE PATH "OpenVX install directory")
+set(OPENVX_LIB_CANDIDATES "openvx;vxu" CACHE STRING "OpenVX library candidates list")
+
+function(find_openvx_libs _found)
+  foreach(one ${OPENVX_LIB_CANDIDATES})
+    find_library(OPENVX_${one}_LIBRARY ${one} PATHS "${OPENVX_ROOT}/lib" "${OPENVX_ROOT}/bin")
```

Review comment:
I believe this way is more reliable: ``` if (NOT DEFINED OPENVX_LIBRARIES) find_openvx_libs(found) if(found) set(OPENVX_LIBRARIES "${found}" CACHE STRING "OpenVX libraries") endif() endif() ```
**File:** 3rdparty/openvx/include/openvx_hal.hpp
**Change Type:** modified
**Context:** PR #7356: Added HAVE_OPENVX macro -  ### This pullrequest changes - Support OpenVX 1.0 libraries - Updated library search function - Added HAVE_OPENVX...
**Review Line:** 5

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 #define OPENCV_OPENVX_HAL_HPP_INCLUDED
 
 #include "opencv2/core/hal/interface.h"
+#include "opencv2/imgproc/hal/interface.h"
 
 #include "VX/vx.h"
 #include "VX/vxu.h"
@@ -10,7 +11,18 @@
 #include <vector>
```

Review comment:
OK, Added here: https://github.com/opencv/opencv/pull/7356/files#diff-165220b7f5e974a2e6dddcc35fb209afR5
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #6961: improve RGB5x52Gray()

**Code Changes:**
```diff
@@ -1107,12 +1107,13 @@ struct RGB5x52Gray
         v_fc = vdupq_n_u16(0xfc);
         #elif CV_SSE2
         haveSIMD = checkHardwareSupport(CV_CPU_SSE2);
-        v_b2y = _mm_set1_epi16(B2Y);
-        v_g2y = _mm_set1_epi16(G2Y);
-        v_r2y = _mm_set1_epi16(R2Y);
-        v_delta = _mm_set1_epi32(1 << (yuv_shift - 1));
-        v_f8 = _mm_set1_epi16(0xf8);
-        v_fc = _mm_set1_epi16(0xfc);
```

Review comment:
can you use `_mm_set1_epi16` here and above?
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #6961: improve RGB5x52Gray()
**Review Line:** 1207

**Code Changes:**
```diff
-
-                    __m128i v_dst = _mm_packs_epi32(v_dst0, v_dst1);
-                    _mm_storel_epi64((__m128i *)(dst + i), _mm_packus_epi16(v_dst, v_zero));
+                    __m128i v_b = _mm_srli_epi16(_mm_slli_epi16(v_src, 11), 8),
+                            v_g = _mm_srli_epi16(_mm_slli_epi16(_mm_srli_epi16(v_src, 5), 11),8),
+                            v_r = _mm_srli_epi16(_mm_slli_epi16(_mm_srli_epi16(v_src, 10), 11),8);
+
+                    __m128i v_bg_lo = _mm_unpacklo_epi16(v_b, v_g);
+                    __m128i v_rd_lo = _mm_unpacklo_epi16(v_r, v_delta);
+                    __m128i v_bg_hi = _mm_unpackhi_epi16(v_b, v_g);
+                    __m128i v_rd_hi = _mm_unpackhi_epi16(v_r, v_delta);
```

Review comment:
is it really necessary to use 3 shifts? I thought, 2 shifts could be enough