diff --git a/.gitignore b/.gitignore index 63b4339d67..ed9bc83395 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,8 @@ SerialPrograms/*.lib Resources/* Packages/ SerialPrograms/CMakeLists.txt.user -opencv_world4110d.dll +opencv_world4120.dll +opencv_world4120d.dll # Python cache __pycache__ diff --git a/3rdParty/opencv-4.11.0/opencv2/calib3d.hpp b/3rdParty/opencv-4.12.0/opencv2/calib3d.hpp similarity index 92% rename from 3rdParty/opencv-4.11.0/opencv2/calib3d.hpp rename to 3rdParty/opencv-4.12.0/opencv2/calib3d.hpp index a0245b81b1..e750c80676 100644 --- a/3rdParty/opencv-4.11.0/opencv2/calib3d.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/calib3d.hpp @@ -383,6 +383,110 @@ R & t \\ 0 & 1 \end{bmatrix} P_{h_0}.\f] + Homogeneous Transformations, Object frame / Camera frame
+Change of basis or computing the 3D coordinates from one frame to another frame can be achieved easily using +the following notation: + +\f[ +\mathbf{X}_c = \hspace{0.2em} +{}^{c}\mathbf{T}_o \hspace{0.2em} \mathbf{X}_o +\f] + +\f[ +\begin{bmatrix} +X_c \\ +Y_c \\ +Z_c \\ +1 +\end{bmatrix} = +\begin{bmatrix} +{}^{c}\mathbf{R}_o & {}^{c}\mathbf{t}_o \\ +0_{1 \times 3} & 1 +\end{bmatrix} +\begin{bmatrix} +X_o \\ +Y_o \\ +Z_o \\ +1 +\end{bmatrix} +\f] + +For a 3D points (\f$ \mathbf{X}_o \f$) expressed in the object frame, the homogeneous transformation matrix +\f$ {}^{c}\mathbf{T}_o \f$ allows computing the corresponding coordinate (\f$ \mathbf{X}_c \f$) in the camera frame. +This transformation matrix is composed of a 3x3 rotation matrix \f$ {}^{c}\mathbf{R}_o \f$ and a 3x1 translation vector +\f$ {}^{c}\mathbf{t}_o \f$. +The 3x1 translation vector \f$ {}^{c}\mathbf{t}_o \f$ is the position of the object frame in the camera frame and the +3x3 rotation matrix \f$ {}^{c}\mathbf{R}_o \f$ the orientation of the object frame in the camera frame. + +With this simple notation, it is easy to chain the transformations. For instance, to compute the 3D coordinates of a point +expressed in the object frame in the world frame can be done with: + +\f[ +\mathbf{X}_w = \hspace{0.2em} +{}^{w}\mathbf{T}_c \hspace{0.2em} {}^{c}\mathbf{T}_o \hspace{0.2em} +\mathbf{X}_o = +{}^{w}\mathbf{T}_o \hspace{0.2em} \mathbf{X}_o +\f] + +Similarly, computing the inverse transformation can be done with: + +\f[ +\mathbf{X}_o = \hspace{0.2em} +{}^{o}\mathbf{T}_c \hspace{0.2em} \mathbf{X}_c = +\left( {}^{c}\mathbf{T}_o \right)^{-1} \hspace{0.2em} \mathbf{X}_c +\f] + +The inverse of an homogeneous transformation matrix is then: + +\f[ +{}^{o}\mathbf{T}_c = \left( {}^{c}\mathbf{T}_o \right)^{-1} = +\begin{bmatrix} +{}^{c}\mathbf{R}^{\top}_o & - \hspace{0.2em} {}^{c}\mathbf{R}^{\top}_o \hspace{0.2em} {}^{c}\mathbf{t}_o \\ +0_{1 \times 3} & 1 +\end{bmatrix} +\f] + +One can note that the inverse of a 3x3 rotation matrix is directly its matrix transpose. + +![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png) + +This figure summarizes the whole process. The object pose returned for instance by the @ref solvePnP function +or pose from fiducial marker detection is this \f$ {}^{c}\mathbf{T}_o \f$ transformation. + +The camera intrinsic matrix \f$ \mathbf{K} \f$ allows projecting the 3D point expressed in the camera frame onto the image plane +assuming a perspective projection model (pinhole camera model). Image coordinates extracted from classical image processing functions +assume a (u,v) top-left coordinates frame. + +\note +- for an online video course on this topic, see for instance: + - ["3.3.1. Homogeneous Transformation Matrices", Modern Robotics, Kevin M. Lynch and Frank C. Park](https://modernrobotics.northwestern.edu/nu-gm-book-resource/3-3-1-homogeneous-transformation-matrices/) +- the 3x3 rotation matrix is composed of 9 values but describes a 3 dof transformation +- some additional properties of the 3x3 rotation matrix are: + - \f$ \mathrm{det} \left( \mathbf{R} \right) = 1 \f$ + - \f$ \mathbf{R} \mathbf{R}^{\top} = \mathbf{R}^{\top} \mathbf{R} = \mathrm{I}_{3 \times 3} \f$ + - interpolating rotation can be done using the [Slerp (spherical linear interpolation)](https://en.wikipedia.org/wiki/Slerp) method +- quick conversions between the different rotation formalisms can be done using this [online tool](https://www.andre-gaschler.com/rotationconverter/) + + Intrinsic parameters from camera lens specifications
+When dealing with industrial cameras, the camera intrinsic matrix or more precisely \f$ \left(f_x, f_y \right) \f$ +can be deduced, approximated from the camera specifications: + +\f[ +f_x = \frac{f_{\text{mm}}}{\text{pixel_size_in_mm}} = \frac{f_{\text{mm}}}{\text{sensor_size_in_mm} / \text{nb_pixels}} +\f] + +In a same way, the physical focal length can be deduced from the angular field of view: + +\f[ +f_{\text{mm}} = \frac{\text{sensor_size_in_mm}}{2 \times \tan{\frac{\text{fov}}{2}}} +\f] + +This latter conversion can be useful when using a rendering software to mimic a physical camera device. + +@note + - See also #calibrationMatrixValues + + Additional references, notes
@note - Many functions in this module take a camera intrinsic matrix as an input parameter. Although all functions assume the same structure of this parameter, they may name it differently. The @@ -898,7 +1002,9 @@ An example program about homography from the camera displacement Check @ref tutorial_homography "the corresponding tutorial" for more details */ -/** @brief Finds an object pose from 3D-2D point correspondences. +/** @brief Finds an object pose \f$ {}^{c}\mathbf{T}_o \f$ from 3D-2D point correspondences: + +![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } @see @ref calib3d_solvePnP @@ -961,14 +1067,16 @@ More information about Perspective-n-Points is described in @ref calib3d_solvePn - point 1: [ squareLength / 2, squareLength / 2, 0] - point 2: [ squareLength / 2, -squareLength / 2, 0] - point 3: [-squareLength / 2, -squareLength / 2, 0] - - With @ref SOLVEPNP_SQPNP input points must be >= 3 + - With @ref SOLVEPNP_SQPNP input points must be >= 3 */ CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE ); -/** @brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme. +/** @brief Finds an object pose \f$ {}^{c}\mathbf{T}_o \f$ from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. + +![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } @see @ref calib3d_solvePnP @@ -1001,8 +1109,8 @@ projections imagePoints and the projected (using @ref projectPoints ) objectPoin makes the function resistant to outliers. @note - - An example of how to use solvePNPRansac for object detection can be found at - opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/ + - An example of how to use solvePnPRansac for object detection can be found at + @ref tutorial_real_time_pose - The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are: - if you choose #SOLVEPNP_P3P or #SOLVEPNP_AP3P, these methods will be used. @@ -1028,7 +1136,9 @@ CV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoint OutputArray rvec, OutputArray tvec, OutputArray inliers, const UsacParams ¶ms=UsacParams()); -/** @brief Finds an object pose from 3 3D-2D point correspondences. +/** @brief Finds an object pose \f$ {}^{c}\mathbf{T}_o \f$ from **3** 3D-2D point correspondences. + +![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } @see @ref calib3d_solvePnP @@ -1121,7 +1231,9 @@ CV_EXPORTS_W void solvePnPRefineVVS( InputArray objectPoints, InputArray imagePo TermCriteria criteria = TermCriteria(TermCriteria::EPS + TermCriteria::COUNT, 20, FLT_EPSILON), double VVSlambda = 1); -/** @brief Finds an object pose from 3D-2D point correspondences. +/** @brief Finds an object pose \f$ {}^{c}\mathbf{T}_o \f$ from 3D-2D point correspondences. + +![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } @see @ref calib3d_solvePnP @@ -1192,6 +1304,7 @@ More information is described in @ref calib3d_solvePnP - point 1: [ squareLength / 2, squareLength / 2, 0] - point 2: [ squareLength / 2, -squareLength / 2, 0] - point 3: [-squareLength / 2, -squareLength / 2, 0] + - With @ref SOLVEPNP_SQPNP input points must be >= 3 */ CV_EXPORTS_W int solvePnPGeneric( InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, @@ -1272,7 +1385,8 @@ the board to make the detection more robust in various environments. Otherwise, border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails. -Use gen_pattern.py (@ref tutorial_camera_calibration_pattern) to create checkerboard. +Use the `gen_pattern.py` Python script (@ref tutorial_camera_calibration_pattern) +to create the desired checkerboard pattern. */ CV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize, OutputArray corners, int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE ); @@ -1330,8 +1444,9 @@ which are located on the outside of the board. The following figure illustrates a sample checkerboard optimized for the detection. However, any other checkerboard can be used as well. -Use gen_pattern.py (@ref tutorial_camera_calibration_pattern) to create checkerboard. -![Checkerboard](pics/checkerboard_radon.png) +Use the `gen_pattern.py` Python script (@ref tutorial_camera_calibration_pattern) +to create the corresponding checkerboard pattern: +\image html pics/checkerboard_radon.png width=60% */ CV_EXPORTS_AS(findChessboardCornersSBWithMeta) bool findChessboardCornersSB(InputArray image,Size patternSize, OutputArray corners, @@ -3346,52 +3461,136 @@ class CV_EXPORTS_W StereoMatcher : public Algorithm }; -/** @brief Class for computing stereo correspondence using the block matching algorithm, introduced and -contributed to OpenCV by K. Konolige. +/** + * @brief Class for computing stereo correspondence using the block matching algorithm, introduced and contributed to OpenCV by K. Konolige. + * @details This class implements a block matching algorithm for stereo correspondence, which is used to compute disparity maps from stereo image pairs. It provides methods to fine-tune parameters such as pre-filtering, texture thresholds, uniqueness ratios, and regions of interest (ROIs) to optimize performance and accuracy. */ class CV_EXPORTS_W StereoBM : public StereoMatcher { public: - enum { PREFILTER_NORMALIZED_RESPONSE = 0, - PREFILTER_XSOBEL = 1 - }; + /** + * @brief Pre-filter types for the stereo matching algorithm. + * @details These constants define the type of pre-filtering applied to the images before computing the disparity map. + * - PREFILTER_NORMALIZED_RESPONSE: Uses normalized response for pre-filtering. + * - PREFILTER_XSOBEL: Uses the X-Sobel operator for pre-filtering. + */ + enum { + PREFILTER_NORMALIZED_RESPONSE = 0, ///< Normalized response pre-filter + PREFILTER_XSOBEL = 1 ///< X-Sobel pre-filter + }; + /** + * @brief Gets the type of pre-filtering currently used in the algorithm. + * @return The current pre-filter type: 0 for PREFILTER_NORMALIZED_RESPONSE or 1 for PREFILTER_XSOBEL. + */ CV_WRAP virtual int getPreFilterType() const = 0; + + /** + * @brief Sets the type of pre-filtering used in the algorithm. + * @param preFilterType The type of pre-filter to use. Possible values are: + * - PREFILTER_NORMALIZED_RESPONSE (0): Uses normalized response for pre-filtering. + * - PREFILTER_XSOBEL (1): Uses the X-Sobel operator for pre-filtering. + * @details The pre-filter type affects how the images are prepared before computing the disparity map. Different pre-filtering methods can enhance specific image features or reduce noise, influencing the quality of the disparity map. + */ CV_WRAP virtual void setPreFilterType(int preFilterType) = 0; + /** + * @brief Gets the current size of the pre-filter kernel. + * @return The current pre-filter size. + */ CV_WRAP virtual int getPreFilterSize() const = 0; + + /** + * @brief Sets the size of the pre-filter kernel. + * @param preFilterSize The size of the pre-filter kernel. Must be an odd integer, typically between 5 and 255. + * @details The pre-filter size determines the spatial extent of the pre-filtering operation, which prepares the images for disparity computation by normalizing brightness and enhancing texture. Larger sizes reduce noise but may blur details, while smaller sizes preserve details but are more susceptible to noise. + */ CV_WRAP virtual void setPreFilterSize(int preFilterSize) = 0; + /** + * @brief Gets the current truncation value for prefiltered pixels. + * @return The current pre-filter cap value. + */ CV_WRAP virtual int getPreFilterCap() const = 0; + + /** + * @brief Sets the truncation value for prefiltered pixels. + * @param preFilterCap The truncation value. Typically in the range [1, 63]. + * @details This value caps the output of the pre-filter to [-preFilterCap, preFilterCap], helping to reduce the impact of noise and outliers in the pre-filtered image. + */ CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0; + /** + * @brief Gets the current texture threshold value. + * @return The current texture threshold. + */ CV_WRAP virtual int getTextureThreshold() const = 0; + + /** + * @brief Sets the threshold for filtering low-texture regions. + * @param textureThreshold The threshold value. Must be non-negative. + * @details This parameter filters out regions with low texture, where establishing correspondences is difficult, thus reducing noise in the disparity map. Higher values filter more aggressively but may discard valid information. + */ CV_WRAP virtual void setTextureThreshold(int textureThreshold) = 0; + /** + * @brief Gets the current uniqueness ratio value. + * @return The current uniqueness ratio. + */ CV_WRAP virtual int getUniquenessRatio() const = 0; + + /** + * @brief Sets the uniqueness ratio for filtering ambiguous matches. + * @param uniquenessRatio The uniqueness ratio value. Typically in the range [5, 15], but can be from 0 to 100. + * @details This parameter ensures that the best match is sufficiently better than the next best match, reducing false positives. Higher values are stricter but may filter out valid matches in difficult regions. + */ CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0; + /** + * @brief Gets the current size of the smaller block used for texture check. + * @return The current smaller block size. + */ CV_WRAP virtual int getSmallerBlockSize() const = 0; + + /** + * @brief Sets the size of the smaller block used for texture check. + * @param blockSize The size of the smaller block. Must be an odd integer between 5 and 255. + * @details This parameter determines the size of the block used to compute texture variance. Smaller blocks capture finer details but are more sensitive to noise, while larger blocks are more robust but may miss fine details. + */ CV_WRAP virtual void setSmallerBlockSize(int blockSize) = 0; + /** + * @brief Gets the current Region of Interest (ROI) for the left image. + * @return The current ROI for the left image. + */ CV_WRAP virtual Rect getROI1() const = 0; + + /** + * @brief Sets the Region of Interest (ROI) for the left image. + * @param roi1 The ROI rectangle for the left image. + * @details By setting the ROI, the stereo matching computation is limited to the specified region, improving performance and potentially accuracy by focusing on relevant parts of the image. + */ CV_WRAP virtual void setROI1(Rect roi1) = 0; + /** + * @brief Gets the current Region of Interest (ROI) for the right image. + * @return The current ROI for the right image. + */ CV_WRAP virtual Rect getROI2() const = 0; - CV_WRAP virtual void setROI2(Rect roi2) = 0; - /** @brief Creates StereoBM object - - @param numDisparities the disparity search range. For each pixel algorithm will find the best - disparity from 0 (default minimum disparity) to numDisparities. The search range can then be - shifted by changing the minimum disparity. - @param blockSize the linear size of the blocks compared by the algorithm. The size should be odd - (as the block is centered at the current pixel). Larger block size implies smoother, though less - accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher - chance for algorithm to find a wrong correspondence. + /** + * @brief Sets the Region of Interest (ROI) for the right image. + * @param roi2 The ROI rectangle for the right image. + * @details Similar to setROI1, this limits the computation to the specified region in the right image. + */ + CV_WRAP virtual void setROI2(Rect roi2) = 0; - The function create StereoBM object. You can then call StereoBM::compute() to compute disparity for - a specific stereo pair. + /** + * @brief Creates StereoBM object + * @param numDisparities The disparity search range. For each pixel, the algorithm will find the best disparity from 0 (default minimum disparity) to numDisparities. The search range can be shifted by changing the minimum disparity. + * @param blockSize The linear size of the blocks compared by the algorithm. The size should be odd (as the block is centered at the current pixel). Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is a higher chance for the algorithm to find a wrong correspondence. + * @return A pointer to the created StereoBM object. + * @details The function creates a StereoBM object. You can then call StereoBM::compute() to compute disparity for a specific stereo pair. */ CV_WRAP static Ptr create(int numDisparities = 0, int blockSize = 21); }; @@ -4062,6 +4261,34 @@ optimization. It is the \f$max(width,height)/\pi\f$ or the provided \f$f_x\f$, \ /** @brief Finds an object pose from 3D-2D point correspondences for fisheye camera moodel. + @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or + 1xN/Nx1 3-channel, where N is the number of points. vector\ can also be passed here. + @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, + where N is the number of points. vector\ can also be passed here. + @param cameraMatrix Input camera intrinsic matrix \f$\cameramatrix{A}\f$ . + @param distCoeffs Input vector of distortion coefficients (4x1/1x4). + @param rvec Output rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from + the model coordinate system to the camera coordinate system. + @param tvec Output translation vector. + @param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses + the provided rvec and tvec values as initial approximations of the rotation and translation + vectors, respectively, and further optimizes them. + @param flags Method for solving a PnP problem: see @ref calib3d_solvePnP_flags + @param criteria Termination criteria for internal undistortPoints call. + The function interally undistorts points with @ref undistortPoints and call @ref cv::solvePnP, + thus the input are very similar. More information about Perspective-n-Points is described in @ref calib3d_solvePnP + for more information. + */ + CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints, + InputArray cameraMatrix, InputArray distCoeffs, + OutputArray rvec, OutputArray tvec, + bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE, + TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 10, 1e-8) + ); + + /** + @brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel. + @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. vector\ can be also passed here. @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, @@ -4074,6 +4301,12 @@ optimization. It is the \f$max(width,height)/\pi\f$ or the provided \f$f_x\f$, \ @param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. + @param iterationsCount Number of iterations. + @param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value + is the maximum allowed distance between the observed and computed point projections to consider it + an inlier. + @param confidence The probability that the algorithm produces a useful result. + @param inliers Output vector that contains indices of inliers in objectPoints and imagePoints . @param flags Method for solving a PnP problem: see @ref calib3d_solvePnP_flags This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods: @@ -4091,12 +4324,14 @@ optimization. It is the \f$max(width,height)/\pi\f$ or the provided \f$f_x\f$, \ thus the input are very similar. More information about Perspective-n-Points is described in @ref calib3d_solvePnP for more information. */ - CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints, - InputArray cameraMatrix, InputArray distCoeffs, - OutputArray rvec, OutputArray tvec, - bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE, - TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 10, 1e-8) - ); + CV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints, + InputArray cameraMatrix, InputArray distCoeffs, + OutputArray rvec, OutputArray tvec, + bool useExtrinsicGuess = false, int iterationsCount = 100, + float reprojectionError = 8.0, double confidence = 0.99, + OutputArray inliers = noArray(), int flags = SOLVEPNP_ITERATIVE, + TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 10, 1e-8) + ); //! @} calib3d_fisheye } // end namespace fisheye diff --git a/3rdParty/opencv-4.11.0/opencv2/calib3d/calib3d.hpp b/3rdParty/opencv-4.12.0/opencv2/calib3d/calib3d.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/calib3d/calib3d.hpp rename to 3rdParty/opencv-4.12.0/opencv2/calib3d/calib3d.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/calib3d/calib3d_c.h b/3rdParty/opencv-4.12.0/opencv2/calib3d/calib3d_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/calib3d/calib3d_c.h rename to 3rdParty/opencv-4.12.0/opencv2/calib3d/calib3d_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/core.hpp b/3rdParty/opencv-4.12.0/opencv2/core.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core.hpp index cafa7bda27..41938b0d75 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core.hpp @@ -805,6 +805,11 @@ Possible usage with some positive example data: normalize(positiveData, normalizedData_minmax, 1.0, 0.0, NORM_MINMAX); @endcode +@note Due to rounding issues, min-max normalization can result in values outside provided boundaries. +If exact range conformity is needed, following workarounds can be used: +- use double floating point precision (dtype = CV_64F) +- manually clip values (`cv::max(res, left_bound, res)`, `cv::min(res, right_bound, res)` or `np.clip`) + @param src input array. @param dst output array of the same size as src . @param alpha norm value to normalize to or the lower range boundary in case of the range @@ -2004,8 +2009,8 @@ The function solveCubic finds the real roots of a cubic equation: The roots are stored in the roots array. @param coeffs equation coefficients, an array of 3 or 4 elements. -@param roots output array of real roots that has 1 or 3 elements. -@return number of real roots. It can be 0, 1 or 2. +@param roots output array of real roots that has 0, 1, 2 or 3 elements. +@return number of real roots. It can be -1 (all real numbers), 0, 1, 2 or 3. */ CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots); diff --git a/3rdParty/opencv-4.11.0/opencv2/core/affine.hpp b/3rdParty/opencv-4.12.0/opencv2/core/affine.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/affine.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/affine.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/async.hpp b/3rdParty/opencv-4.12.0/opencv2/core/async.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/async.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/async.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/base.hpp b/3rdParty/opencv-4.12.0/opencv2/core/base.hpp similarity index 90% rename from 3rdParty/opencv-4.11.0/opencv2/core/base.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/base.hpp index 4e810931cb..bebc02edd4 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/base.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/base.hpp @@ -263,8 +263,72 @@ enum DftFlags { DCT_ROWS = DFT_ROWS }; -//! Various border types, image boundaries are denoted with `|` -//! @see borderInterpolate, copyMakeBorder +/*! Various border types, image boundaries are denoted with the `|` character in the table below, when describing each method. + +The following examples show the result of the @ref copyMakeBorder call according to different methods. +Input image is `6x4` (width x height) size and the @ref copyMakeBorder function is used with a border size of 2 pixels +in each direction, giving a resulting image of `10x8` resolution. + +@code +Input image: +[[ 0 1 2 3 4 5] + [ 6 7 8 9 10 11] + [12 13 14 15 16 17] + [18 19 20 21 22 23]] + +Border type: BORDER_CONSTANT (a constant value of 255 is used) +[[255 255 255 255 255 255 255 255 255 255] + [255 255 255 255 255 255 255 255 255 255] + [255 255 0 1 2 3 4 5 255 255] + [255 255 6 7 8 9 10 11 255 255] + [255 255 12 13 14 15 16 17 255 255] + [255 255 18 19 20 21 22 23 255 255] + [255 255 255 255 255 255 255 255 255 255] + [255 255 255 255 255 255 255 255 255 255]] + +Border type: BORDER_REPLICATE +[[ 0 0 0 1 2 3 4 5 5 5] + [ 0 0 0 1 2 3 4 5 5 5] + [ 0 0 0 1 2 3 4 5 5 5] + [ 6 6 6 7 8 9 10 11 11 11] + [12 12 12 13 14 15 16 17 17 17] + [18 18 18 19 20 21 22 23 23 23] + [18 18 18 19 20 21 22 23 23 23] + [18 18 18 19 20 21 22 23 23 23]] + +Border type: BORDER_REFLECT +[[ 7 6 6 7 8 9 10 11 11 10] + [ 1 0 0 1 2 3 4 5 5 4] + [ 1 0 0 1 2 3 4 5 5 4] + [ 7 6 6 7 8 9 10 11 11 10] + [13 12 12 13 14 15 16 17 17 16] + [19 18 18 19 20 21 22 23 23 22] + [19 18 18 19 20 21 22 23 23 22] + [13 12 12 13 14 15 16 17 17 16]] + +Border type: BORDER_WRAP +[[16 17 12 13 14 15 16 17 12 13] + [22 23 18 19 20 21 22 23 18 19] + [ 4 5 0 1 2 3 4 5 0 1] + [10 11 6 7 8 9 10 11 6 7] + [16 17 12 13 14 15 16 17 12 13] + [22 23 18 19 20 21 22 23 18 19] + [ 4 5 0 1 2 3 4 5 0 1] + [10 11 6 7 8 9 10 11 6 7]] + +Border type: BORDER_REFLECT_101 +[[14 13 12 13 14 15 16 17 16 15] + [ 8 7 6 7 8 9 10 11 10 9] + [ 2 1 0 1 2 3 4 5 4 3] + [ 8 7 6 7 8 9 10 11 10 9] + [14 13 12 13 14 15 16 17 16 15] + [20 19 18 19 20 21 22 23 22 21] + [14 13 12 13 14 15 16 17 16 15] + [ 8 7 6 7 8 9 10 11 10 9]] +@endcode + +@see borderInterpolate, copyMakeBorder + */ enum BorderTypes { BORDER_CONSTANT = 0, //!< `iiiiii|abcdefgh|iiiiiii` with some specified `i` BORDER_REPLICATE = 1, //!< `aaaaaa|abcdefgh|hhhhhhh` @@ -386,7 +450,7 @@ It does not throw exception, but terminates the application. //! @endcond -#if defined _DEBUG || defined CV_STATIC_ANALYSIS +#if !defined(NDEBUG) || defined(CV_STATIC_ANALYSIS) # define CV_DbgAssert(expr) CV_Assert(expr) #else /** replaced with CV_Assert(expr) in Debug configuration */ diff --git a/3rdParty/opencv-4.11.0/opencv2/core/bindings_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/core/bindings_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/bindings_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/bindings_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/bufferpool.hpp b/3rdParty/opencv-4.12.0/opencv2/core/bufferpool.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/bufferpool.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/bufferpool.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/check.hpp b/3rdParty/opencv-4.12.0/opencv2/core/check.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/check.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/check.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/core.hpp b/3rdParty/opencv-4.12.0/opencv2/core/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/core_c.h b/3rdParty/opencv-4.12.0/opencv2/core/core_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/core_c.h rename to 3rdParty/opencv-4.12.0/opencv2/core/core_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda.hpp index 53898171f2..ab4bb2417a 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/cuda.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/cuda.hpp @@ -240,6 +240,10 @@ class CV_EXPORTS_W GpuMat //! converts GpuMat to another datatype (Blocking call) void convertTo(OutputArray dst, int rtype) const; + //! bindings overload which converts GpuMat to another datatype (Blocking call) + CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype) const { + convertTo(static_cast(dst), rtype); + } //! converts GpuMat to another datatype (Non-Blocking call) void convertTo(OutputArray dst, int rtype, Stream& stream) const; @@ -250,10 +254,13 @@ class CV_EXPORTS_W GpuMat //! converts GpuMat to another datatype with scaling (Blocking call) void convertTo(OutputArray dst, int rtype, double alpha, double beta = 0.0) const; + //! bindings overload which converts GpuMat to another datatype with scaling(Blocking call) - CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype, double alpha = 1.0, double beta = 0.0) const { +#ifdef OPENCV_BINDINGS_PARSER + CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype, double alpha=1.0, double beta = 0.0) const { convertTo(static_cast(dst), rtype, alpha, beta); } +#endif //! converts GpuMat to another datatype with scaling (Non-Blocking call) void convertTo(OutputArray dst, int rtype, double alpha, Stream& stream) const; diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/block.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/block.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/block.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/block.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/border_interpolate.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/border_interpolate.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/border_interpolate.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/border_interpolate.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/color.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/color.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/color.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/color.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/common.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/common.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/common.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/common.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/datamov_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/datamov_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/datamov_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/datamov_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/color_detail.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/color_detail.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/color_detail.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/color_detail.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/reduce.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/reduce.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/reduce.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/reduce.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/reduce_key_val.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/reduce_key_val.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/reduce_key_val.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/reduce_key_val.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/transform_detail.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/transform_detail.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/transform_detail.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/transform_detail.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/type_traits_detail.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/type_traits_detail.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/type_traits_detail.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/type_traits_detail.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/vec_distance_detail.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/vec_distance_detail.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/detail/vec_distance_detail.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/detail/vec_distance_detail.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/dynamic_smem.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/dynamic_smem.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/dynamic_smem.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/dynamic_smem.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/emulation.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/emulation.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/emulation.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/emulation.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/filters.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/filters.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/filters.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/filters.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/funcattrib.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/funcattrib.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/funcattrib.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/funcattrib.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/functional.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/functional.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/functional.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/functional.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/limits.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/limits.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/limits.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/limits.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/reduce.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/reduce.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/reduce.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/reduce.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/saturate_cast.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/saturate_cast.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/saturate_cast.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/saturate_cast.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/scan.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/scan.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/scan.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/scan.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/simd_functions.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/simd_functions.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/simd_functions.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/simd_functions.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/transform.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/transform.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/transform.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/transform.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/type_traits.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/type_traits.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/type_traits.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/type_traits.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/utility.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/utility.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/utility.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/utility.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/vec_distance.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/vec_distance.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/vec_distance.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/vec_distance.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/vec_math.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/vec_math.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/vec_math.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/vec_math.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/vec_traits.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/vec_traits.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/vec_traits.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/vec_traits.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/warp.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/warp.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/warp.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/warp.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/warp_reduce.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/warp_reduce.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/warp_reduce.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/warp_reduce.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda/warp_shuffle.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda/warp_shuffle.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda/warp_shuffle.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda/warp_shuffle.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda_stream_accessor.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda_stream_accessor.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda_stream_accessor.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda_stream_accessor.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cuda_types.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cuda_types.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cuda_types.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cuda_types.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cv_cpu_dispatch.h b/3rdParty/opencv-4.12.0/opencv2/core/cv_cpu_dispatch.h similarity index 92% rename from 3rdParty/opencv-4.11.0/opencv2/core/cv_cpu_dispatch.h rename to 3rdParty/opencv-4.12.0/opencv2/core/cv_cpu_dispatch.h index fb4f4a133b..5fbe656dc7 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/cv_cpu_dispatch.h +++ b/3rdParty/opencv-4.12.0/opencv2/core/cv_cpu_dispatch.h @@ -72,7 +72,7 @@ # define CV_AVX 1 #endif #ifdef CV_CPU_COMPILE_FP16 -# if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) +# if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) # include # else # include @@ -137,7 +137,7 @@ # define CV_FMA3 1 #endif -#if defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER)) +#if defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER)) # include # include # define CV_NEON 1 @@ -230,7 +230,7 @@ struct VZeroUpperGuard { # define CV_MMX 1 # define CV_SSE 1 # define CV_SSE2 1 -#elif defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER)) +#elif defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER)) # include # include # define CV_NEON 1 diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cv_cpu_helper.h b/3rdParty/opencv-4.12.0/opencv2/core/cv_cpu_helper.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cv_cpu_helper.h rename to 3rdParty/opencv-4.12.0/opencv2/core/cv_cpu_helper.h diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cvdef.h b/3rdParty/opencv-4.12.0/opencv2/core/cvdef.h similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/core/cvdef.h rename to 3rdParty/opencv-4.12.0/opencv2/core/cvdef.h index 002a60f4d2..60e5cd5775 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/cvdef.h +++ b/3rdParty/opencv-4.12.0/opencv2/core/cvdef.h @@ -368,7 +368,7 @@ enum CpuFeatures { #include "cv_cpu_dispatch.h" -#if !defined(CV_STRONG_ALIGNMENT) && defined(__arm__) && !(defined(__aarch64__) || defined(_M_ARM64)) +#if !defined(CV_STRONG_ALIGNMENT) && defined(__arm__) && !(defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)) // int*, int64* should be propertly aligned pointers on ARMv7 #define CV_STRONG_ALIGNMENT 1 #endif @@ -697,7 +697,7 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType) #ifdef CV_XADD // allow to use user-defined macro #elif defined __GNUC__ || defined __clang__ -# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) && !defined __INTEL_COMPILER +# if defined __clang__ && __clang_major__ >= 3 && !defined __EMSCRIPTEN__ && !defined __INTEL_COMPILER # ifdef __ATOMIC_ACQ_REL # define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL) # else diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cvstd.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cvstd.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cvstd.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cvstd.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cvstd.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cvstd.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cvstd.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cvstd.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/cvstd_wrapper.hpp b/3rdParty/opencv-4.12.0/opencv2/core/cvstd_wrapper.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/cvstd_wrapper.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/cvstd_wrapper.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/detail/async_promise.hpp b/3rdParty/opencv-4.12.0/opencv2/core/detail/async_promise.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/detail/async_promise.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/detail/async_promise.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/detail/dispatch_helper.impl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/detail/dispatch_helper.impl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/detail/dispatch_helper.impl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/detail/dispatch_helper.impl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/detail/exception_ptr.hpp b/3rdParty/opencv-4.12.0/opencv2/core/detail/exception_ptr.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/detail/exception_ptr.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/detail/exception_ptr.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/directx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/directx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/directx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/directx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/dualquaternion.hpp b/3rdParty/opencv-4.12.0/opencv2/core/dualquaternion.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/dualquaternion.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/dualquaternion.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/dualquaternion.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/dualquaternion.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/dualquaternion.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/dualquaternion.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/eigen.hpp b/3rdParty/opencv-4.12.0/opencv2/core/eigen.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/eigen.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/eigen.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/fast_math.hpp b/3rdParty/opencv-4.12.0/opencv2/core/fast_math.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/core/fast_math.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/fast_math.hpp index 3a6f8163fe..5e659b0155 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/fast_math.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/fast_math.hpp @@ -303,7 +303,7 @@ CV_INLINE int cvIsInf( double value ) { #if defined CV_INLINE_ISINF_DBL CV_INLINE_ISINF_DBL(value); -#elif defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) || defined(__PPC64__) || defined(__loongarch64) +#elif defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(__PPC64__) || defined(__loongarch64) Cv64suf ieee754; ieee754.f = value; return (ieee754.u & 0x7fffffffffffffff) == diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/hal.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/hal.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/hal.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/hal.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/interface.h b/3rdParty/opencv-4.12.0/opencv2/core/hal/interface.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/interface.h rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/interface.h diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_avx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_avx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_avx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_avx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_avx512.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_avx512.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_avx512.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_avx512.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_cpp.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_cpp.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_cpp.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_cpp.hpp index 1b2462c642..88ed596a4b 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_cpp.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_cpp.hpp @@ -225,32 +225,30 @@ These operations allow to reorder or recombine elements in one or multiple vecto Element-wise binary and unary operations. - Arithmetics: -@ref v_add(const v_reg &a, const v_reg &b) "+", -@ref v_sub(const v_reg &a, const v_reg &b) "-", -@ref v_mul(const v_reg &a, const v_reg &b) "*", -@ref v_div(const v_reg &a, const v_reg &b) "/", +@ref v_add, +@ref v_sub, +@ref v_mul, +@ref v_div, @ref v_mul_expand - Non-saturating arithmetics: @ref v_add_wrap, @ref v_sub_wrap - Bitwise shifts: -@ref v_shl(const v_reg &a, int s) "<<", -@ref v_shr(const v_reg &a, int s) ">>", @ref v_shl, @ref v_shr - Bitwise logic: -@ref v_and(const v_reg &a, const v_reg &b) "&", -@ref v_or(const v_reg &a, const v_reg &b) "|", -@ref v_xor(const v_reg &a, const v_reg &b) "^", -@ref v_not(const v_reg &a) "~" +@ref v_and, +@ref v_or, +@ref v_xor, +@ref v_not - Comparison: -@ref v_gt(const v_reg &a, const v_reg &b) ">", -@ref v_ge(const v_reg &a, const v_reg &b) ">=", -@ref v_lt(const v_reg &a, const v_reg &b) "<", -@ref v_le(const v_reg &a, const v_reg &b) "<=", -@ref v_eq(const v_reg &a, const v_reg &b) "==", -@ref v_ne(const v_reg &a, const v_reg &b) "!=" +@ref v_gt, +@ref v_ge, +@ref v_lt, +@ref v_le, +@ref v_eq, +@ref v_ne - min/max: @ref v_min, @ref v_max diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_forward.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_forward.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_forward.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_forward.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_lasx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_lasx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_lasx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_lasx.hpp diff --git a/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_legacy_ops.h b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_legacy_ops.h new file mode 100644 index 0000000000..397228a64e --- /dev/null +++ b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_legacy_ops.h @@ -0,0 +1,111 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html + +// This file has been created for compatibility with older versions of Universal Intrinscs +// Binary operators for vector types has been removed since version 4.11 +// Include this file manually after OpenCV headers if you need these operators + +#ifndef OPENCV_HAL_INTRIN_LEGACY_OPS_HPP +#define OPENCV_HAL_INTRIN_LEGACY_OPS_HPP + +#ifdef __OPENCV_BUILD +#error "Universal Intrinsics operators are deprecated and should not be used in OpenCV library" +#endif + +#ifdef __riscv +#warning "Operators might conflict with built-in functions on RISC-V platform" +#endif + +#if defined(CV_VERSION) && CV_VERSION_MAJOR == 4 && CV_VERSION_MINOR < 9 +#warning "Older versions of OpenCV (<4.9) already have Universal Intrinscs operators" +#endif + + +namespace cv { namespace hal { + +#define BIN_OP(OP, FUN) \ +template R operator OP (const R & lhs, const R & rhs) { return FUN(lhs, rhs); } + +#define BIN_A_OP(OP, FUN) \ +template R & operator OP (R & res, const R & val) { res = FUN(res, val); return res; } + +#define UN_OP(OP, FUN) \ +template R operator OP (const R & val) { return FUN(val); } + +BIN_OP(+, v_add) +BIN_OP(-, v_sub) +BIN_OP(*, v_mul) +BIN_OP(/, v_div) +BIN_OP(&, v_and) +BIN_OP(|, v_or) +BIN_OP(^, v_xor) + +BIN_OP(==, v_eq) +BIN_OP(!=, v_ne) +BIN_OP(<, v_lt) +BIN_OP(>, v_gt) +BIN_OP(<=, v_le) +BIN_OP(>=, v_ge) + +BIN_A_OP(+=, v_add) +BIN_A_OP(-=, v_sub) +BIN_A_OP(*=, v_mul) +BIN_A_OP(/=, v_div) +BIN_A_OP(&=, v_and) +BIN_A_OP(|=, v_or) +BIN_A_OP(^=, v_xor) + +UN_OP(~, v_not) + +// TODO: shift operators? + +}} // cv::hal:: + +//============================================================================== + +#ifdef OPENCV_ENABLE_INLINE_INTRIN_OPERATOR_TEST + +namespace cv { namespace hal { + +inline static void opencv_operator_compile_test() +{ + using namespace cv; + v_float32 a, b, c; + uint8_t shift = 1; + a = b + c; + a = b - c; + a = b * c; + a = b / c; + a = b & c; + a = b | c; + a = b ^ c; + // a = b >> shift; + // a = b << shift; + + a = (b == c); + a = (b != c); + a = (b < c);}} + a = (b > c); + a = (b <= c); + a = (b >= c); + + a += b; + a -= b; + a *= b; + a /= b; + a &= b; + a |= b; + a ^= b; + // a <<= shift; + // a >>= shift; + + a = ~b; +} + +}} // cv::hal:: + +#endif + + +#endif // OPENCV_HAL_INTRIN_LEGACY_OPS_HPP diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_lsx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_lsx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_lsx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_lsx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_math.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_math.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_math.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_math.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_msa.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_msa.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_msa.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_msa.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_neon.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_neon.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_neon.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_neon.hpp index eb10edfc44..cf10e932a7 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_neon.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_neon.hpp @@ -56,7 +56,7 @@ namespace cv CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN #define CV_SIMD128 1 -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) #define CV_SIMD128_64F 1 #else #define CV_SIMD128_64F 0 @@ -72,7 +72,7 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN // // [1] https://developer.arm.com/documentation/101028/0012/13--Advanced-SIMD--Neon--intrinsics // [2] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros -#if defined(__ARM_64BIT_STATE) || defined(_M_ARM64) +#if defined(__ARM_64BIT_STATE) || defined(_M_ARM64) || defined(_M_ARM64EC) #define CV_NEON_AARCH64 1 #else #define CV_NEON_AARCH64 0 @@ -1080,7 +1080,7 @@ OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int16x8, vreinterpretq_s16_u16, s16, u16) OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint32x4, OPENCV_HAL_NOP, u32, u32) OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int32x4, vreinterpretq_s32_u32, s32, u32) OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_float32x4, vreinterpretq_f32_u32, f32, u32) -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) static inline uint64x2_t vmvnq_u64(uint64x2_t a) { uint64x2_t vx = vreinterpretq_u64_u32(vdupq_n_u32(0xFFFFFFFF)); @@ -1822,7 +1822,7 @@ inline v_int32x4 v_load_expand_q(const schar* ptr) return v_int32x4(vmovl_s16(v1)); } -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) #define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \ inline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \ { \ diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_rvv071.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_rvv071.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_rvv071.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_rvv071.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_rvv_scalable.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_rvv_scalable.hpp similarity index 94% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_rvv_scalable.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_rvv_scalable.hpp index b97b041d44..16edd6e9a4 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_rvv_scalable.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_rvv_scalable.hpp @@ -8,6 +8,7 @@ #ifndef OPENCV_HAL_INTRIN_RVV_SCALABLE_HPP #define OPENCV_HAL_INTRIN_RVV_SCALABLE_HPP +#include #include #if defined(__GNUC__) && !defined(__clang__) @@ -62,8 +63,9 @@ struct VTraits \ { \ static inline int vlanes() { return __riscv_vsetvlmax_##SUF(); } \ using lane_type = TYP; \ - static const int max_nlanes = CV_RVV_MAX_VLEN/SZ; \ + static const int max_nlanes = CV_RVV_MAX_VLEN/SZ*2; \ }; +// `max_nlanes` is multiplied by 2 because of using LMUL=2 (m2) OPENCV_HAL_IMPL_RVV_TRAITS(vint8m1_t, int8_t, e8m1, 8) OPENCV_HAL_IMPL_RVV_TRAITS(vint8m2_t, int8_t, e8m2, 8) @@ -507,6 +509,28 @@ inline v_float64 v_lut(const double* tab, const v_int32& vidx) \ #endif +// Strangely, __riscv_vluxseg2ei32 is slower (tested on Muse-Pi and CanMV K230) +#define OPENCV_HAL_IMPL_RVV_LUT_DEINTERLEAVE(_Tpvec, _Tp, suffix) \ +inline void v_lut_deinterleave(const _Tp* tab, const v_int32& vidx, _Tpvec& vx, _Tpvec& vy) \ +{ \ + v_uint32 vidx_ = __riscv_vmul(__riscv_vreinterpret_u32m2(vidx), sizeof(_Tp), VTraits::vlanes()); \ + vx = __riscv_vluxei32(tab, vidx_, VTraits<_Tpvec>::vlanes()); \ + vy = __riscv_vluxei32(tab, __riscv_vadd(vidx_, sizeof(_Tp), VTraits::vlanes()), VTraits<_Tpvec>::vlanes()); \ +} +OPENCV_HAL_IMPL_RVV_LUT_DEINTERLEAVE(v_float32, float, f32) +OPENCV_HAL_IMPL_RVV_LUT_DEINTERLEAVE(v_int32, int, i32) +OPENCV_HAL_IMPL_RVV_LUT_DEINTERLEAVE(v_uint32, unsigned, u32) + +#if CV_SIMD_SCALABLE_64F +inline void v_lut_deinterleave(const double* tab, const v_int32& vidx, v_float64& vx, v_float64& vy) \ +{ \ + vuint32m1_t vidx_ = __riscv_vmul(__riscv_vlmul_trunc_u32m1(__riscv_vreinterpret_u32m2(vidx)), sizeof(double), VTraits::vlanes()); \ + vx = __riscv_vluxei32(tab, vidx_, VTraits::vlanes()); \ + vy = __riscv_vluxei32(tab, __riscv_vadd(vidx_, sizeof(double), VTraits::vlanes()), VTraits::vlanes()); \ +} +#endif + + inline v_uint8 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((schar*)tab, idx)); } inline v_uint8 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((schar*)tab, idx)); } inline v_uint8 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((schar*)tab, idx)); } @@ -1590,23 +1614,31 @@ OPENCV_HAL_IMPL_RVV_INTERLEAVED(int64, int64, i64, 64, 32, VTraits::vla OPENCV_HAL_IMPL_RVV_INTERLEAVED(float64, double, f64, 64, 32, VTraits::vlanes()) #endif -static uint64_t idx_interleave_pairs[] = { \ +static std::array idx_interleave_pairs = { \ 0x0705060403010200, 0x0f0d0e0c0b090a08, 0x1715161413111210, 0x1f1d1e1c1b191a18, \ 0x2725262423212220, 0x2f2d2e2c2b292a28, 0x3735363433313230, 0x3f3d3e3c3b393a38, \ 0x4745464443414240, 0x4f4d4e4c4b494a48, 0x5755565453515250, 0x5f5d5e5c5b595a58, \ - 0x6765666463616260, 0x6f6d6e6c6b696a68, 0x7775767473717270, 0x7f7d7e7c7b797a78}; + 0x6765666463616260, 0x6f6d6e6c6b696a68, 0x7775767473717270, 0x7f7d7e7c7b797a78, \ + 0x8785868483818280, 0x8f8d8e8c8b898a88, 0x9795969493919290, 0x9f9d9e9c9b999a98, \ + 0xa7a5a6a4a3a1a2a0, 0xafadaeacaba9aaa8, 0xb7b5b6b4b3b1b2b0, 0xbfbdbebcbbb9bab8, \ + 0xc7c5c6c4c3c1c2c0, 0xcfcdcecccbc9cac8, 0xd7d5d6d4d3d1d2d0, 0xdfdddedcdbd9dad8, \ + 0xe7e5e6e4e3e1e2e0, 0xefedeeecebe9eae8, 0xf7f5f6f4f3f1f2f0, 0xfffdfefcfbf9faf8}; -static uint64_t idx_interleave_quads[] = { \ +static std::array idx_interleave_quads = { \ 0x0703060205010400, 0x0f0b0e0a0d090c08, 0x1713161215111410, 0x1f1b1e1a1d191c18, \ 0x2723262225212420, 0x2f2b2e2a2d292c28, 0x3733363235313430, 0x3f3b3e3a3d393c38, \ 0x4743464245414440, 0x4f4b4e4a4d494c48, 0x5753565255515450, 0x5f5b5e5a5d595c58, \ - 0x6763666265616460, 0x6f6b6e6a6d696c68, 0x7773767275717470, 0x7f7b7e7a7d797c78}; + 0x6763666265616460, 0x6f6b6e6a6d696c68, 0x7773767275717470, 0x7f7b7e7a7d797c78, \ + 0x8783868285818480, 0x8f8b8e8a8d898c88, 0x9793969295919490, 0x9f9b9e9a9d999c98, \ + 0xa7a3a6a2a5a1a4a0, 0xafabaeaaada9aca8, 0xb7b3b6b2b5b1b4b0, 0xbfbbbebabdb9bcb8, \ + 0xc7c3c6c2c5c1c4c0, 0xcfcbcecacdc9ccc8, 0xd7d3d6d2d5d1d4d0, 0xdfdbdedaddd9dcd8, \ + 0xe7e3e6e2e5e1e4e0, 0xefebeeeaede9ece8, 0xf7f3f6f2f5f1f4f0, 0xfffbfefafdf9fcf8}; #define OPENCV_HAL_IMPL_RVV_INTERLEAVED_PQ_NOEXPEND(_Tpvec, func) \ inline _Tpvec v_interleave_##func(const _Tpvec& vec) { \ CV_CheckLE(VTraits<_Tpvec>::vlanes(), VTraits<_Tpvec>::max_nlanes, "RVV implementation only supports VLEN in the range [128, 1024]"); \ vuint8m2_t vidx = __riscv_vundefined_u8m2();\ - vidx = __riscv_vreinterpret_u8m2(__riscv_vle64_v_u64m2(idx_interleave_##func, 16)); \ + vidx = __riscv_vreinterpret_u8m2(__riscv_vle64_v_u64m2(idx_interleave_##func.data(), idx_interleave_##func.size())); \ return __riscv_vrgather(vec, vidx, VTraits::vlanes()); \ } OPENCV_HAL_IMPL_RVV_INTERLEAVED_PQ_NOEXPEND(v_uint8, pairs) @@ -1618,7 +1650,7 @@ OPENCV_HAL_IMPL_RVV_INTERLEAVED_PQ_NOEXPEND(v_int8, quads) inline _Tpvec v_interleave_##func(const _Tpvec& vec) { \ CV_CheckLE(VTraits<_Tpvec>::vlanes(), VTraits<_Tpvec>::max_nlanes, "RVV implementation only supports VLEN in the range [128, 1024]"); \ vuint##width##m2_t vidx = __riscv_vundefined_u##width##m2();\ - vidx = __riscv_vget_u##width##m2(vzext_vfx(__riscv_vreinterpret_u8m2(__riscv_vle64_v_u64m2(idx_interleave_##func, 16)), VTraits::vlanes()), 0); \ + vidx = __riscv_vget_u##width##m2(vzext_vfx(__riscv_vreinterpret_u8m2(__riscv_vle64_v_u64m2(idx_interleave_##func.data(), idx_interleave_##func.size())), VTraits::vlanes()), 0); \ return __riscv_vrgather(vec, vidx, VTraits<_Tpvec>::vlanes()); \ } @@ -1690,20 +1722,19 @@ inline v_uint64 v_popcount(const v_uint64& a) inline v_uint8 v_popcount(const v_int8& a) { - return v_popcount(v_abs(a));\ + return v_popcount(__riscv_vreinterpret_u8m2(a));\ } inline v_uint16 v_popcount(const v_int16& a) { - return v_popcount(v_abs(a));\ + return v_popcount(__riscv_vreinterpret_u16m2(a));\ } inline v_uint32 v_popcount(const v_int32& a) { - return v_popcount(v_abs(a));\ + return v_popcount(__riscv_vreinterpret_u32m2(a));\ } inline v_uint64 v_popcount(const v_int64& a) { - // max(0 - a) is used, since v_abs does not support 64-bit integers. - return v_popcount(v_reinterpret_as_u64(__riscv_vmax(a, v_sub(v_setzero_s64(), a), VTraits::vlanes()))); + return v_popcount(__riscv_vreinterpret_u64m2(a)); } @@ -1797,14 +1828,14 @@ inline void v_pack_store(hfloat* ptr, const v_float32& v) #else inline v_float32 v_load_expand(const hfloat* ptr) { - float buf[32]; + float buf[VTraits::max_nlanes]; for( int i = 0; i < VTraits::vlanes(); i++ ) buf[i] = (float)ptr[i]; return v_load(buf); } inline void v_pack_store(hfloat* ptr, const v_float32& v) { - float buf[32]; + float buf[VTraits::max_nlanes]; v_store(buf, v); for( int i = 0; i < VTraits::vlanes(); i++ ) ptr[i] = hfloat(buf[i]); } @@ -2099,7 +2130,17 @@ inline v_int64 v_dotprod_expand_fast(const v_int16& a, const v_int16& b, const v // 32 >> 64f #if CV_SIMD_SCALABLE_64F inline v_float64 v_dotprod_expand_fast(const v_int32& a, const v_int32& b) -{ return v_cvt_f64(v_dotprod_fast(a, b)); } +{ + vfloat64m1_t zero = __riscv_vfmv_v_f_f64m1(0, VTraits::vlanes()); + auto prod_i64 = __riscv_vwmul(a, b, VTraits::vlanes()); + // Convert to f64 before reduction to avoid overflow: #27003 + auto prod_f64 = __riscv_vfcvt_f(prod_i64, VTraits::vlanes()); + return __riscv_vset( // Needs v_float64 (vfloat64m2_t) here. + v_setall_f64(0.0f), // zero_f64m2 + 0, + __riscv_vfredusum_tu(zero, prod_f64, zero, VTraits::vlanes()) + ); +} inline v_float64 v_dotprod_expand_fast(const v_int32& a, const v_int32& b, const v_float64& c) { return v_add(v_dotprod_expand_fast(a, b) , c); } #endif diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_sse.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_sse.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_sse.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_sse.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_sse_em.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_sse_em.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_sse_em.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_sse_em.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_vsx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_vsx.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_vsx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_vsx.hpp index b0e2a3472b..c4c2058ffd 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_vsx.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_vsx.hpp @@ -262,7 +262,7 @@ OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_float64x2, double) inline _Tpvec v_setzero_##suffix() { return _Tpvec(vec_splats((_Tp)0)); } \ inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(vec_splats((_Tp)v));} \ template <> inline _Tpvec v_setzero_() { return v_setzero_##suffix(); } \ -template <> inline _Tpvec v_setall_(_Tp v) { return v_setall_##suffix(_Tp v); } \ +template <> inline _Tpvec v_setall_(_Tp v) { return v_setall_##suffix(v); } \ template inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0 &a) \ { return _Tpvec((cast)a.val); } @@ -650,11 +650,11 @@ OPENCV_HAL_IMPL_VSX_SELECT(v_float64x2, vec_bdword2_c) #define OPENCV_HAL_IMPL_VSX_INT_CMP_OP(_Tpvec) \ inline _Tpvec v_eq(const _Tpvec& a, const _Tpvec& b) \ { return _Tpvec(vec_cmpeq(a.val, b.val)); } \ -inline _Tpvec V_ne(const _Tpvec& a, const _Tpvec& b) \ +inline _Tpvec v_ne(const _Tpvec& a, const _Tpvec& b) \ { return _Tpvec(vec_cmpne(a.val, b.val)); } \ inline _Tpvec v_lt(const _Tpvec& a, const _Tpvec& b) \ { return _Tpvec(vec_cmplt(a.val, b.val)); } \ -inline _Tpvec V_gt(const _Tpvec& a, const _Tpvec& b) \ +inline _Tpvec v_gt(const _Tpvec& a, const _Tpvec& b) \ { return _Tpvec(vec_cmpgt(a.val, b.val)); } \ inline _Tpvec v_le(const _Tpvec& a, const _Tpvec& b) \ { return _Tpvec(vec_cmple(a.val, b.val)); } \ @@ -1507,7 +1507,7 @@ inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, cons inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) { return v_dotprod(a, b); } inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) -{ return v_int32x4(vec_msum(a.val, b.val, vec_int4_z)) + c; } +{ return v_add(v_int32x4(vec_msum(a.val, b.val, vec_int4_z)), c); } // 32 >> 64 inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) { return v_dotprod(a, b); } @@ -1518,7 +1518,7 @@ inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_ inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) { return v_dotprod_expand(a, b); } inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) -{ return v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)) + c; } +{ return v_add(v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)), c); } inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) { diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_wasm.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_wasm.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/intrin_wasm.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/intrin_wasm.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/msa_macros.h b/3rdParty/opencv-4.12.0/opencv2/core/hal/msa_macros.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/msa_macros.h rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/msa_macros.h diff --git a/3rdParty/opencv-4.11.0/opencv2/core/hal/simd_utils.impl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/hal/simd_utils.impl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/hal/simd_utils.impl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/hal/simd_utils.impl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/mat.hpp b/3rdParty/opencv-4.12.0/opencv2/core/mat.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/core/mat.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/mat.hpp index be1b8faecb..af05a707d6 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/mat.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/mat.hpp @@ -372,6 +372,7 @@ class CV_EXPORTS _OutputArray : public _InputArray void release() const; void clear() const; void setTo(const _InputArray& value, const _InputArray & mask = _InputArray()) const; + Mat reinterpret( int type ) const; void assign(const UMat& u) const; void assign(const Mat& m) const; @@ -1339,6 +1340,15 @@ class CV_EXPORTS Mat */ Mat reshape(int cn, const std::vector& newshape) const; + /** @brief Reset the type of matrix. + + The methods reset the data type of matrix. If the new type and the old type of the matrix + have the same element size, the current buffer can be reused. The method needs to consider whether the + current mat is a submatrix or has any references. + @param type New data type. + */ + Mat reinterpret( int type ) const; + /** @brief Transposes a matrix. The method performs matrix transposition by means of matrix expressions. It does not perform the @@ -2472,8 +2482,8 @@ class CV_EXPORTS UMat UMat(const UMat& m, const Range* ranges); UMat(const UMat& m, const std::vector& ranges); - // FIXIT copyData=false is not implemented, drop this in favor of cv::Mat (OpenCV 5.0) - //! builds matrix from std::vector with or without copying the data + //! builds matrix from std::vector. The data is always copied. The copyData + //! parameter is deprecated and will be removed in OpenCV 5.0. template explicit UMat(const std::vector<_Tp>& vec, bool copyData=false); //! destructor - calls release() @@ -3556,7 +3566,7 @@ class CV_EXPORTS MatOp /** @brief Matrix expression representation @anchor MatrixExpressions This is a list of implemented matrix operations that can be combined in arbitrary complex -expressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a +expressions (here A, B stand for matrices ( cv::Mat ), s for a cv::Scalar, alpha for a real-valued scalar ( double )): - Addition, subtraction, negation: `A+B`, `A-B`, `A+s`, `A-s`, `s+A`, `s-A`, `-A` - Scaling: `A*alpha` @@ -3571,13 +3581,13 @@ real-valued scalar ( double )): 0. - Bitwise logical operations: `A logicop B`, `A logicop s`, `s logicop A`, `~A`, where *logicop* is one of `&`, `|`, `^`. -- Element-wise minimum and maximum: `min(A, B)`, `min(A, alpha)`, `max(A, B)`, `max(A, alpha)` -- Element-wise absolute value: `abs(A)` +- Element-wise minimum and maximum: cv::min(A, B), cv::min(A, alpha), cv::max(A, B), cv::max(A, alpha) +- Element-wise absolute value: cv::abs(A) - Cross-product, dot-product: `A.cross(B)`, `A.dot(B)` -- Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm, - mean, sum, countNonZero, trace, determinant, repeat, and others. +- Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as cv::norm, + cv::mean, cv::sum, cv::countNonZero, cv::trace, cv::determinant, cv::repeat, and others. - Matrix initializers ( Mat::eye(), Mat::zeros(), Mat::ones() ), matrix comma-separated - initializers, matrix constructors and operators that extract sub-matrices (see Mat description). + initializers, matrix constructors and operators that extract sub-matrices (see cv::Mat description). - Mat_() constructors to cast the result to the proper type. @note Comma-separated initializers and probably some other operations may require additional explicit Mat() or Mat_() constructor calls to resolve a possible ambiguity. diff --git a/3rdParty/opencv-4.11.0/opencv2/core/mat.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/mat.inl.hpp similarity index 95% rename from 3rdParty/opencv-4.11.0/opencv2/core/mat.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/mat.inl.hpp index 0d9c557bce..da1c796a0d 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/mat.inl.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/mat.inl.hpp @@ -3024,6 +3024,12 @@ Mat_<_Tp>& Mat_<_Tp>::operator = (const MatExpr& e) return *this; } +template inline +MatExpr Mat_<_Tp>::zeros(int _ndims, const int* _sizes) +{ + return Mat::zeros(_ndims, _sizes, traits::Type<_Tp>::value); +} + template inline MatExpr Mat_<_Tp>::zeros(int rows, int cols) { @@ -3248,18 +3254,13 @@ const Mat_<_Tp>& operator /= (const Mat_<_Tp>& a, const MatExpr& b) template inline UMat::UMat(const std::vector<_Tp>& vec, bool copyData) -: flags(+MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()), -cols(1), allocator(0), usageFlags(USAGE_DEFAULT), u(0), offset(0), size(&rows) + : flags(+MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()), + cols(1), allocator(0), usageFlags(USAGE_DEFAULT), u(0), offset(0), size(&rows) { + CV_UNUSED(copyData); // parameter kept for backward compatibility if(vec.empty()) return; - if( !copyData ) - { - // !!!TODO!!! - CV_Error(Error::StsNotImplemented, ""); - } - else - Mat((int)vec.size(), 1, traits::Type<_Tp>::value, (uchar*)&vec[0]).copyTo(*this); + Mat((int)vec.size(), 1, traits::Type<_Tp>::value, (uchar*)&vec[0]).copyTo(*this); } inline diff --git a/3rdParty/opencv-4.11.0/opencv2/core/matx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/matx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/matx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/matx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/matx.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/matx.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/matx.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/matx.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/neon_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/core/neon_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/neon_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/neon_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/ocl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/ocl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/ocl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/ocl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/ocl_genbase.hpp b/3rdParty/opencv-4.12.0/opencv2/core/ocl_genbase.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/ocl_genbase.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/ocl_genbase.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/ocl_defs.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/ocl_defs.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/ocl_defs.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/ocl_defs.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/opencl_info.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/opencl_info.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/opencl_info.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/opencl_info.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/opencl_svm.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/opencl_svm.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/opencl_svm.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/opencl_svm.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_clblas.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_clblas.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_clblas.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_clblas.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_clfft.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_clfft.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_clfft.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_clfft.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_core.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_gl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_gl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_gl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_gl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_svm_20.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_svm_20.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_svm_20.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_svm_20.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/opengl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/opengl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/opengl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/opengl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/operations.hpp b/3rdParty/opencv-4.12.0/opencv2/core/operations.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/operations.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/operations.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/optim.hpp b/3rdParty/opencv-4.12.0/opencv2/core/optim.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/optim.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/optim.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/ovx.hpp b/3rdParty/opencv-4.12.0/opencv2/core/ovx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/ovx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/ovx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/parallel/backend/parallel_for.openmp.hpp b/3rdParty/opencv-4.12.0/opencv2/core/parallel/backend/parallel_for.openmp.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/parallel/backend/parallel_for.openmp.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/parallel/backend/parallel_for.openmp.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/parallel/backend/parallel_for.tbb.hpp b/3rdParty/opencv-4.12.0/opencv2/core/parallel/backend/parallel_for.tbb.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/parallel/backend/parallel_for.tbb.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/parallel/backend/parallel_for.tbb.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/parallel/parallel_backend.hpp b/3rdParty/opencv-4.12.0/opencv2/core/parallel/parallel_backend.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/parallel/parallel_backend.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/parallel/parallel_backend.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/persistence.hpp b/3rdParty/opencv-4.12.0/opencv2/core/persistence.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/persistence.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/persistence.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/quaternion.hpp b/3rdParty/opencv-4.12.0/opencv2/core/quaternion.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/quaternion.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/quaternion.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/quaternion.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/quaternion.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/quaternion.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/quaternion.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/saturate.hpp b/3rdParty/opencv-4.12.0/opencv2/core/saturate.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/saturate.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/saturate.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/simd_intrinsics.hpp b/3rdParty/opencv-4.12.0/opencv2/core/simd_intrinsics.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/simd_intrinsics.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/simd_intrinsics.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/softfloat.hpp b/3rdParty/opencv-4.12.0/opencv2/core/softfloat.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/softfloat.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/softfloat.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/sse_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/core/sse_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/sse_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/sse_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/traits.hpp b/3rdParty/opencv-4.12.0/opencv2/core/traits.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/traits.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/traits.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/types.hpp b/3rdParty/opencv-4.12.0/opencv2/core/types.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/core/types.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/types.hpp index f69e499f36..fc9ed18820 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/types.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/types.hpp @@ -1851,10 +1851,8 @@ template inline _Tp Rect_<_Tp>::area() const { const _Tp result = width * height; - if constexpr (std::numeric_limits<_Tp>::is_integer) - { - CV_DbgAssert(width == 0 || result / width == height); // make sure the result fits in the return value - } + CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer + || width == 0 || result / width == height); // make sure the result fits in the return value return result; } diff --git a/3rdParty/opencv-4.11.0/opencv2/core/types_c.h b/3rdParty/opencv-4.12.0/opencv2/core/types_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/types_c.h rename to 3rdParty/opencv-4.12.0/opencv2/core/types_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utility.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utility.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utility.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utility.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/allocator_stats.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/allocator_stats.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/allocator_stats.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/allocator_stats.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/allocator_stats.impl.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/allocator_stats.impl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/allocator_stats.impl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/allocator_stats.impl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/filesystem.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/filesystem.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/filesystem.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/filesystem.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/fp_control_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/fp_control_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/fp_control_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/fp_control_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/instrumentation.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/instrumentation.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/instrumentation.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/instrumentation.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/logger.defines.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/logger.defines.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/logger.defines.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/logger.defines.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/logger.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/logger.hpp similarity index 79% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/logger.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/logger.hpp index 5fc5fb74ae..f1f98fb2cc 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/utils/logger.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/utils/logger.hpp @@ -43,6 +43,44 @@ CV_EXPORTS void writeLogMessage(LogLevel logLevel, const char* message); /** Write log message */ CV_EXPORTS void writeLogMessageEx(LogLevel logLevel, const char* tag, const char* file, int line, const char* func, const char* message); +/** + * @brief Function pointer type for writeLogMessage. Used by replaceWriteLogMessage. + */ +typedef void (*WriteLogMessageFuncType)(LogLevel, const char*); + +/** + * @brief Function pointer type for writeLogMessageEx. Used by replaceWriteLogMessageEx. + */ +typedef void (*WriteLogMessageExFuncType)(LogLevel, const char*, const char*, int, const char*, const char*); + +/** + * @brief Replaces the OpenCV writeLogMessage function with a user-defined function. + * @note The user-defined function must have the same signature as writeLogMessage. + * @note The user-defined function must accept arguments that can be potentially null. + * @note The user-defined function must be thread-safe, as OpenCV logging may be called + * from multiple threads. + * @note The user-defined function must not perform any action that can trigger + * deadlocks or infinite loop. Many OpenCV functions are not re-entrant. + * @note Once replaced, logs will not go through the OpenCV writeLogMessage function. + * @note To restore, call this function with a nullptr. + */ +CV_EXPORTS void replaceWriteLogMessage(WriteLogMessageFuncType f); + +/** + * @brief Replaces the OpenCV writeLogMessageEx function with a user-defined function. + * @note The user-defined function must have the same signature as writeLogMessage. + * @note The user-defined function must accept arguments that can be potentially null. + * @note The user-defined function must be thread-safe, as OpenCV logging may be called + * from multiple threads. + * @note The user-defined function must not perform any action that can trigger + * deadlocks or infinite loop. Many OpenCV functions are not re-entrant. + * @note Once replaced, logs will not go through any of the OpenCV logging functions + * such as writeLogMessage or writeLogMessageEx, until their respective restore + * methods are called. + * @note To restore, call this function with a nullptr. + */ +CV_EXPORTS void replaceWriteLogMessageEx(WriteLogMessageExFuncType f); + } // namespace struct LogTagAuto diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/logtag.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/logtag.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/logtag.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/logtag.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/tls.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/tls.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/tls.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/tls.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/utils/trace.hpp b/3rdParty/opencv-4.12.0/opencv2/core/utils/trace.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/utils/trace.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/utils/trace.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/va_intel.hpp b/3rdParty/opencv-4.12.0/opencv2/core/va_intel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/core/va_intel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/va_intel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/core/version.hpp b/3rdParty/opencv-4.12.0/opencv2/core/version.hpp similarity index 93% rename from 3rdParty/opencv-4.11.0/opencv2/core/version.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/version.hpp index 8a9621f68b..9bb91f9ea5 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/version.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/version.hpp @@ -6,7 +6,7 @@ #define OPENCV_VERSION_HPP #define CV_VERSION_MAJOR 4 -#define CV_VERSION_MINOR 11 +#define CV_VERSION_MINOR 12 #define CV_VERSION_REVISION 0 #define CV_VERSION_STATUS "" diff --git a/3rdParty/opencv-4.11.0/opencv2/core/vsx_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/core/vsx_utils.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/core/vsx_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/core/vsx_utils.hpp index c285c7edf2..f801bc20cb 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/vsx_utils.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/core/vsx_utils.hpp @@ -257,8 +257,8 @@ VSX_IMPL_1VRG(vec_udword2, vec_udword2, vpopcntd, vec_popcntu) VSX_IMPL_1VRG(vec_udword2, vec_dword2, vpopcntd, vec_popcntu) // converts between single and double-precision -VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, __builtin_vsx_xvcvdpsp) -VSX_REDIRECT_1RG(vec_double2, vec_float4, vec_cvfo, __builtin_vsx_xvcvspdp) +VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, vec_floate) +VSX_REDIRECT_1RG(vec_double2, vec_float4, vec_cvfo, vec_doubleo) // converts word and doubleword to double-precision #undef vec_ctd @@ -399,10 +399,6 @@ VSX_REDIRECT_1RG(vec_ushort8, vec_ushort8, vec_popcntu, vec_popcnt) VSX_REDIRECT_1RG(vec_uint4, vec_uint4, vec_popcntu, vec_popcnt) VSX_REDIRECT_1RG(vec_udword2, vec_udword2, vec_popcntu, vec_popcnt) -// converts between single and double precision -VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, __builtin_vsx_xvcvdpsp) -VSX_REDIRECT_1RG(vec_double2, vec_float4, vec_cvfo, __builtin_vsx_xvcvspdp) - // converts word and doubleword to double-precision #ifdef vec_ctd # undef vec_ctd diff --git a/3rdParty/opencv-4.11.0/opencv2/cvconfig.h b/3rdParty/opencv-4.12.0/opencv2/cvconfig.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/cvconfig.h rename to 3rdParty/opencv-4.12.0/opencv2/cvconfig.h diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/all_layers.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/all_layers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/all_layers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/all_layers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/dict.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/dict.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/dict.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/dict.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/dnn.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/dnn.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/dnn.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/dnn.hpp index 105e973193..3e9427f589 100644 --- a/3rdParty/opencv-4.11.0/opencv2/dnn/dnn.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/dnn/dnn.hpp @@ -72,7 +72,7 @@ CV__DNN_INLINE_NS_BEGIN //! DNN_BACKEND_DEFAULT equals to OPENCV_DNN_BACKEND_DEFAULT, which can be defined using CMake or a configuration parameter DNN_BACKEND_DEFAULT = 0, DNN_BACKEND_HALIDE, - DNN_BACKEND_INFERENCE_ENGINE, //!< Intel OpenVINO computational backend + DNN_BACKEND_INFERENCE_ENGINE, //!< Intel OpenVINO computational backend, supported targets: CPU, OPENCL, OPENCL_FP16, MYRIAD, HDDL, NPU //!< @note Tutorial how to build OpenCV with OpenVINO: @ref tutorial_dnn_openvino DNN_BACKEND_OPENCV, DNN_BACKEND_VKCOM, @@ -606,7 +606,7 @@ CV__DNN_INLINE_NS_BEGIN * * @returns index of bound layer (the same as layerId or newly created) */ - int registerOutput(const std::string& outputName, int layerId, int outputPort); + CV_WRAP int registerOutput(const std::string& outputName, int layerId, int outputPort); /** @brief Sets outputs names of the network input pseudo layer. * @@ -1219,16 +1219,16 @@ CV__DNN_INLINE_NS_BEGIN { CV_WRAP Image2BlobParams(); CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(), - bool swapRB = false, int ddepth = CV_32F, DataLayout datalayout = DNN_LAYOUT_NCHW, - ImagePaddingMode mode = DNN_PMODE_NULL, Scalar borderValue = 0.0); + bool swapRB = false, int ddepth = CV_32F, dnn::DataLayout datalayout = DNN_LAYOUT_NCHW, + ImagePaddingMode mode = dnn::DNN_PMODE_NULL, Scalar borderValue = 0.0); CV_PROP_RW Scalar scalefactor; //!< scalefactor multiplier for input image values. CV_PROP_RW Size size; //!< Spatial size for output image. CV_PROP_RW Scalar mean; //!< Scalar with mean values which are subtracted from channels. CV_PROP_RW bool swapRB; //!< Flag which indicates that swap first and last channels CV_PROP_RW int ddepth; //!< Depth of output blob. Choose CV_32F or CV_8U. - CV_PROP_RW DataLayout datalayout; //!< Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC. - CV_PROP_RW ImagePaddingMode paddingmode; //!< Image padding mode. @see ImagePaddingMode. + CV_PROP_RW dnn::DataLayout datalayout; //!< Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC. + CV_PROP_RW dnn::ImagePaddingMode paddingmode; //!< Image padding mode. @see ImagePaddingMode. CV_PROP_RW Scalar borderValue; //!< Value used in padding mode for padding. /** @brief Get rectangle coordinates in original image system from rectangle in blob coordinates. diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/dnn.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/dnn.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/dnn.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/dnn.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/layer.details.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/layer.details.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/layer.details.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/layer.details.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/layer.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/layer.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/layer.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/layer.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/shape_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/shape_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/shape_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/shape_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/utils/debug_utils.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/utils/debug_utils.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/utils/debug_utils.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/utils/debug_utils.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/utils/inference_engine.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/utils/inference_engine.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/utils/inference_engine.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/utils/inference_engine.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/dnn/version.hpp b/3rdParty/opencv-4.12.0/opencv2/dnn/version.hpp similarity index 92% rename from 3rdParty/opencv-4.11.0/opencv2/dnn/version.hpp rename to 3rdParty/opencv-4.12.0/opencv2/dnn/version.hpp index a651e05826..2a6b496bc6 100644 --- a/3rdParty/opencv-4.11.0/opencv2/dnn/version.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/dnn/version.hpp @@ -6,7 +6,7 @@ #define OPENCV_DNN_VERSION_HPP /// Use with major OpenCV version only. -#define OPENCV_DNN_API_VERSION 20241223 +#define OPENCV_DNN_API_VERSION 20250619 #if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_INLINE_NS #define CV__DNN_INLINE_NS __CV_CAT(dnn4_v, OPENCV_DNN_API_VERSION) diff --git a/3rdParty/opencv-4.11.0/opencv2/features2d.hpp b/3rdParty/opencv-4.12.0/opencv2/features2d.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/features2d.hpp rename to 3rdParty/opencv-4.12.0/opencv2/features2d.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/features2d/features2d.hpp b/3rdParty/opencv-4.12.0/opencv2/features2d/features2d.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/features2d/features2d.hpp rename to 3rdParty/opencv-4.12.0/opencv2/features2d/features2d.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/features2d/hal/interface.h b/3rdParty/opencv-4.12.0/opencv2/features2d/hal/interface.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/features2d/hal/interface.h rename to 3rdParty/opencv-4.12.0/opencv2/features2d/hal/interface.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann.hpp b/3rdParty/opencv-4.12.0/opencv2/flann.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann.hpp rename to 3rdParty/opencv-4.12.0/opencv2/flann.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/all_indices.h b/3rdParty/opencv-4.12.0/opencv2/flann/all_indices.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/all_indices.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/all_indices.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/allocator.h b/3rdParty/opencv-4.12.0/opencv2/flann/allocator.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/allocator.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/allocator.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/any.h b/3rdParty/opencv-4.12.0/opencv2/flann/any.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/any.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/any.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/autotuned_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/autotuned_index.h similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/flann/autotuned_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/autotuned_index.h index 32a0ab0852..1457a90beb 100644 --- a/3rdParty/opencv-4.11.0/opencv2/flann/autotuned_index.h +++ b/3rdParty/opencv-4.12.0/opencv2/flann/autotuned_index.h @@ -54,7 +54,7 @@ NNIndex* create_index_by_type(const Matrix #endif diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/dummy.h b/3rdParty/opencv-4.12.0/opencv2/flann/dummy.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/dummy.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/dummy.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/dynamic_bitset.h b/3rdParty/opencv-4.12.0/opencv2/flann/dynamic_bitset.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/dynamic_bitset.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/dynamic_bitset.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/flann.hpp b/3rdParty/opencv-4.12.0/opencv2/flann/flann.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/flann.hpp rename to 3rdParty/opencv-4.12.0/opencv2/flann/flann.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/flann_base.hpp b/3rdParty/opencv-4.12.0/opencv2/flann/flann_base.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/flann_base.hpp rename to 3rdParty/opencv-4.12.0/opencv2/flann/flann_base.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/general.h b/3rdParty/opencv-4.12.0/opencv2/flann/general.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/general.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/general.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/ground_truth.h b/3rdParty/opencv-4.12.0/opencv2/flann/ground_truth.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/ground_truth.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/ground_truth.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/heap.h b/3rdParty/opencv-4.12.0/opencv2/flann/heap.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/heap.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/heap.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/hierarchical_clustering_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/hierarchical_clustering_index.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/hierarchical_clustering_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/hierarchical_clustering_index.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/index_testing.h b/3rdParty/opencv-4.12.0/opencv2/flann/index_testing.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/index_testing.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/index_testing.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/kdtree_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/kdtree_index.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/kdtree_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/kdtree_index.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/kdtree_single_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/kdtree_single_index.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/kdtree_single_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/kdtree_single_index.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/kmeans_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/kmeans_index.h similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/flann/kmeans_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/kmeans_index.h index 77aa7c2564..121885ad07 100644 --- a/3rdParty/opencv-4.11.0/opencv2/flann/kmeans_index.h +++ b/3rdParty/opencv-4.12.0/opencv2/flann/kmeans_index.h @@ -62,7 +62,7 @@ struct KMeansIndexParams : public IndexParams { KMeansIndexParams(int branching = 32, int iterations = 11, flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, - float cb_index = 0.2, int trees = 1 ) + float cb_index = 0.2f, int trees = 1 ) { (*this)["algorithm"] = FLANN_INDEX_KMEANS; // branching factor diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/linear_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/linear_index.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/linear_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/linear_index.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/logger.h b/3rdParty/opencv-4.12.0/opencv2/flann/logger.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/logger.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/logger.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/lsh_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/lsh_index.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/lsh_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/lsh_index.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/lsh_table.h b/3rdParty/opencv-4.12.0/opencv2/flann/lsh_table.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/lsh_table.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/lsh_table.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/matrix.h b/3rdParty/opencv-4.12.0/opencv2/flann/matrix.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/matrix.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/matrix.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/miniflann.hpp b/3rdParty/opencv-4.12.0/opencv2/flann/miniflann.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/miniflann.hpp rename to 3rdParty/opencv-4.12.0/opencv2/flann/miniflann.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/nn_index.h b/3rdParty/opencv-4.12.0/opencv2/flann/nn_index.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/nn_index.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/nn_index.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/object_factory.h b/3rdParty/opencv-4.12.0/opencv2/flann/object_factory.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/object_factory.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/object_factory.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/params.h b/3rdParty/opencv-4.12.0/opencv2/flann/params.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/params.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/params.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/random.h b/3rdParty/opencv-4.12.0/opencv2/flann/random.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/random.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/random.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/result_set.h b/3rdParty/opencv-4.12.0/opencv2/flann/result_set.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/result_set.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/result_set.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/sampling.h b/3rdParty/opencv-4.12.0/opencv2/flann/sampling.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/sampling.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/sampling.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/saving.h b/3rdParty/opencv-4.12.0/opencv2/flann/saving.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/saving.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/saving.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/simplex_downhill.h b/3rdParty/opencv-4.12.0/opencv2/flann/simplex_downhill.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/simplex_downhill.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/simplex_downhill.h diff --git a/3rdParty/opencv-4.11.0/opencv2/flann/timer.h b/3rdParty/opencv-4.12.0/opencv2/flann/timer.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/flann/timer.h rename to 3rdParty/opencv-4.12.0/opencv2/flann/timer.h diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/core.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/cpu/core.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/cpu/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/cpu/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/cpu/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/cpu/gcpukernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/cpu/gcpukernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/cpu/gcpukernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/cpu/gcpukernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/cpu/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/cpu/imgproc.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/cpu/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/cpu/imgproc.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/cpu/ot.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/cpu/ot.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/cpu/ot.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/cpu/ot.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/cpu/stereo.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/cpu/stereo.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/cpu/stereo.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/cpu/stereo.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/cpu/video.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/cpu/video.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/cpu/video.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/cpu/video.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/fluid/core.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/fluid/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/fluid/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/fluid/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/fluid/gfluidbuffer.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/fluid/gfluidbuffer.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/fluid/gfluidbuffer.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/fluid/gfluidbuffer.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/fluid/gfluidkernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/fluid/gfluidkernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/fluid/gfluidkernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/fluid/gfluidkernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/fluid/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/fluid/imgproc.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/fluid/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/fluid/imgproc.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/garg.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/garg.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/garg.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/garg.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/garray.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/garray.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/garray.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/garray.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gasync_context.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gasync_context.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gasync_context.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gasync_context.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcall.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcall.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcall.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcall.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcommon.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcommon.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcommon.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcommon.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcompiled.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcompiled.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcompiled.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcompiled.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcompiled_async.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcompiled_async.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcompiled_async.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcompiled_async.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcompoundkernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcompoundkernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcompoundkernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcompoundkernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcomputation.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcomputation.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcomputation.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcomputation.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gcomputation_async.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gcomputation_async.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gcomputation_async.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gcomputation_async.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gframe.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gframe.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gframe.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gframe.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gkernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gkernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gkernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gkernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gmat.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gmat.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gmat.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gmat.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gmetaarg.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gmetaarg.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gmetaarg.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gmetaarg.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gopaque.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gopaque.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gopaque.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gopaque.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gproto.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gproto.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gproto.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gproto.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gpu/core.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gpu/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gpu/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gpu/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gpu/ggpukernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gpu/ggpukernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gpu/ggpukernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gpu/ggpukernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gpu/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gpu/imgproc.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gpu/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gpu/imgproc.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gscalar.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gscalar.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gscalar.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gscalar.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gstreaming.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gstreaming.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gstreaming.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gstreaming.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gtransform.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gtransform.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gtransform.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gtransform.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gtype_traits.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gtype_traits.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gtype_traits.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gtype_traits.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/gtyped.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/gtyped.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/gtyped.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/gtyped.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/imgproc.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/imgproc.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/bindings_ie.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/bindings_ie.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/bindings_ie.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/bindings_ie.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/bindings_onnx.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/bindings_onnx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/bindings_onnx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/bindings_onnx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/bindings_ov.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/bindings_ov.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/bindings_ov.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/bindings_ov.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/ie.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/ie.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/ie.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/ie.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/onnx.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/onnx.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/onnx.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/onnx.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/ov.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/ov.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/ov.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/ov.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/infer/parsers.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/infer/parsers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/infer/parsers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/infer/parsers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/media.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/media.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/media.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/media.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/oak/infer.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/oak/infer.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/oak/infer.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/oak/infer.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/oak/oak.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/oak/oak.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/oak/oak.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/oak/oak.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/ocl/core.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/ocl/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/ocl/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/ocl/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/ocl/goclkernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/ocl/goclkernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/ocl/goclkernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/ocl/goclkernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/ocl/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/ocl/imgproc.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/ocl/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/ocl/imgproc.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/opencv_includes.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/opencv_includes.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/opencv_includes.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/opencv_includes.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/operators.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/operators.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/operators.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/operators.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/ot.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/ot.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/ot.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/ot.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/assert.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/assert.hpp similarity index 93% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/assert.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/assert.hpp index 9e8be33272..bc8d52cbfe 100644 --- a/3rdParty/opencv-4.11.0/opencv2/gapi/own/assert.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/gapi/own/assert.hpp @@ -19,7 +19,7 @@ #include #define GAPI_Assert CV_Assert -#if defined _DEBUG || defined CV_STATIC_ANALYSIS +#if !defined(NDEBUG) || defined(CV_STATIC_ANALYSIS) # define GAPI_DbgAssert CV_DbgAssert #else # define GAPI_DbgAssert(expr) GAPI_DbgAssertNoOp(expr) diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/convert.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/convert.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/convert.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/convert.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/cvdefs.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/cvdefs.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/cvdefs.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/cvdefs.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/exports.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/exports.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/exports.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/exports.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/mat.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/mat.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/mat.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/mat.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/saturate.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/saturate.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/saturate.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/saturate.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/scalar.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/scalar.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/scalar.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/scalar.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/own/types.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/own/types.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/own/types.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/own/types.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/plaidml/core.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/plaidml/core.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/plaidml/core.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/plaidml/core.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/plaidml/gplaidmlkernel.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/plaidml/gplaidmlkernel.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/plaidml/gplaidmlkernel.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/plaidml/gplaidmlkernel.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/plaidml/plaidml.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/plaidml/plaidml.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/plaidml/plaidml.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/plaidml/plaidml.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/python/python.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/python/python.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/python/python.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/python/python.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/render.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/render.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/render.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/render.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/render/render.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/render/render.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/render/render.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/render/render.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/render/render_types.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/render/render_types.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/render/render_types.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/render/render_types.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/rmat.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/rmat.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/rmat.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/rmat.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/s11n.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/s11n.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/s11n.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/s11n.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/s11n/base.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/s11n/base.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/s11n/base.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/s11n/base.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/stereo.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/stereo.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/stereo.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/stereo.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/cap.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/cap.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/cap.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/cap.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/desync.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/desync.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/desync.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/desync.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/format.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/format.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/format.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/format.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/gstreamer/gstreamerpipeline.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/gstreamer/gstreamerpipeline.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/gstreamer/gstreamerpipeline.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/gstreamer/gstreamerpipeline.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/gstreamer/gstreamersource.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/gstreamer/gstreamersource.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/gstreamer/gstreamersource.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/gstreamer/gstreamersource.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/meta.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/meta.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/meta.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/meta.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/accel_types.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/accel_types.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/accel_types.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/accel_types.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/cfg_params.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/cfg_params.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/cfg_params.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/cfg_params.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/data_provider_interface.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/data_provider_interface.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/data_provider_interface.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/data_provider_interface.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/default.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/default.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/default.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/default.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/device_selector_interface.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/device_selector_interface.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/device_selector_interface.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/device_selector_interface.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/source.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/source.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/onevpl/source.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/onevpl/source.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/queue_source.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/queue_source.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/queue_source.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/queue_source.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/source.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/source.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/source.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/source.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/streaming/sync.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/streaming/sync.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/streaming/sync.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/streaming/sync.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/any.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/any.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/any.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/any.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/compiler_hints.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/compiler_hints.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/compiler_hints.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/compiler_hints.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/copy_through_move.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/copy_through_move.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/copy_through_move.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/copy_through_move.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/optional.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/optional.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/optional.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/optional.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/throw.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/throw.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/throw.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/throw.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/type_traits.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/type_traits.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/type_traits.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/type_traits.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/util.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/util.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/util.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/util.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/util/variant.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/util/variant.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/util/variant.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/util/variant.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/gapi/video.hpp b/3rdParty/opencv-4.12.0/opencv2/gapi/video.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/gapi/video.hpp rename to 3rdParty/opencv-4.12.0/opencv2/gapi/video.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/highgui.hpp b/3rdParty/opencv-4.12.0/opencv2/highgui.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/highgui.hpp rename to 3rdParty/opencv-4.12.0/opencv2/highgui.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/highgui/highgui.hpp b/3rdParty/opencv-4.12.0/opencv2/highgui/highgui.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/highgui/highgui.hpp rename to 3rdParty/opencv-4.12.0/opencv2/highgui/highgui.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/highgui/highgui_c.h b/3rdParty/opencv-4.12.0/opencv2/highgui/highgui_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/highgui/highgui_c.h rename to 3rdParty/opencv-4.12.0/opencv2/highgui/highgui_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgcodecs.hpp b/3rdParty/opencv-4.12.0/opencv2/imgcodecs.hpp similarity index 76% rename from 3rdParty/opencv-4.11.0/opencv2/imgcodecs.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgcodecs.hpp index 4f12c18173..36cda34bcf 100644 --- a/3rdParty/opencv-4.11.0/opencv2/imgcodecs.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/imgcodecs.hpp @@ -65,6 +65,7 @@ namespace cv //! @{ //! Imread flags +//! @note IMREAD_COLOR_BGR (IMREAD_COLOR) and IMREAD_COLOR_RGB can not be set at the same time. enum ImreadModes { IMREAD_UNCHANGED = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). Ignore EXIF orientation. IMREAD_GRAYSCALE = 0, //!< If set, always convert image to the single channel grayscale image (codec internal conversion). @@ -95,6 +96,7 @@ enum ImwriteFlags { IMWRITE_PNG_COMPRESSION = 16, //!< For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. If specified, strategy is changed to IMWRITE_PNG_STRATEGY_DEFAULT (Z_DEFAULT_STRATEGY). Default value is 1 (best speed setting). IMWRITE_PNG_STRATEGY = 17, //!< One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE. IMWRITE_PNG_BILEVEL = 18, //!< Binary level PNG, 0 or 1, default is 0. + IMWRITE_PNG_FILTER = 19, //!< One of cv::ImwritePNGFilterFlags, default is IMWRITE_PNG_FILTER_SUB. IMWRITE_PXM_BINARY = 32, //!< For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1. IMWRITE_EXR_TYPE = (3 << 4) + 0 /* 48 */, //!< override EXR storage type (FLOAT (FP32) is default) IMWRITE_EXR_COMPRESSION = (3 << 4) + 1 /* 49 */, //!< override EXR compression type (ZIP_COMPRESSION = 3 is default) @@ -116,8 +118,8 @@ enum ImwriteFlags { IMWRITE_JPEGXL_EFFORT = 641,//!< For JPEG XL, encoder effort/speed level without affecting decoding speed; it is between 1 (fastest) and 10 (slowest). Default is 7. IMWRITE_JPEGXL_DISTANCE = 642,//!< For JPEG XL, distance level for lossy compression: target max butteraugli distance, lower = higher quality, 0 = lossless; range: 0 .. 25. Default is 1. IMWRITE_JPEGXL_DECODING_SPEED = 643,//!< For JPEG XL, decoding speed tier for the provided options; minimum is 0 (slowest to decode, best quality/density), and maximum is 4 (fastest to decode, at the cost of some quality/density). Default is 0. - IMWRITE_GIF_LOOP = 1024,//!< For GIF, it can be a loop flag from 0 to 65535. Default is 0 - loop forever. - IMWRITE_GIF_SPEED = 1025,//!< For GIF, it is between 1 (slowest) and 100 (fastest). Default is 96. + IMWRITE_GIF_LOOP = 1024, //!< Not functional since 4.12.0. Replaced by cv::Animation::loop_count. + IMWRITE_GIF_SPEED = 1025, //!< Not functional since 4.12.0. Replaced by cv::Animation::durations. IMWRITE_GIF_QUALITY = 1026, //!< For GIF, it can be a quality from 1 to 8. Default is 2. See cv::ImwriteGifCompressionFlags. IMWRITE_GIF_DITHER = 1027, //!< For GIF, it can be a quality from -1(most dither) to 3(no dither). Default is 0. IMWRITE_GIF_TRANSPARENCY = 1028, //!< For GIF, the alpha channel lower than this will be set to transparent. Default is 1. @@ -210,6 +212,17 @@ enum ImwritePNGFlags { IMWRITE_PNG_STRATEGY_FIXED = 4 //!< Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. }; +//! Imwrite PNG specific values for IMWRITE_PNG_FILTER parameter key +enum ImwritePNGFilterFlags { + IMWRITE_PNG_FILTER_NONE = 8, //!< Applies no filter to the PNG image (useful when you want to save the raw pixel data without any compression filter). + IMWRITE_PNG_FILTER_SUB = 16, //!< Applies the "sub" filter, which calculates the difference between the current byte and the previous byte in the row. + IMWRITE_PNG_FILTER_UP = 32, //!< applies the "up" filter, which calculates the difference between the current byte and the corresponding byte directly above it. + IMWRITE_PNG_FILTER_AVG = 64, //!< applies the "average" filter, which calculates the average of the byte to the left and the byte above. + IMWRITE_PNG_FILTER_PAETH = 128, //!< applies the "Paeth" filter, a more complex filter that predicts the next pixel value based on neighboring pixels. + IMWRITE_PNG_FAST_FILTERS = (IMWRITE_PNG_FILTER_NONE | IMWRITE_PNG_FILTER_SUB | IMWRITE_PNG_FILTER_UP), //!< This is a combination of IMWRITE_PNG_FILTER_NONE, IMWRITE_PNG_FILTER_SUB, and IMWRITE_PNG_FILTER_UP, typically used for faster compression. + IMWRITE_PNG_ALL_FILTERS = (IMWRITE_PNG_FAST_FILTERS | IMWRITE_PNG_FILTER_AVG | IMWRITE_PNG_FILTER_PAETH) //!< This combines all available filters (NONE, SUB, UP, AVG, and PAETH), which will attempt to apply all of them for the best possible compression. + }; + //! Imwrite PAM specific tupletype flags used to define the 'TUPLETYPE' field of a PAM file. enum ImwritePAMFlags { IMWRITE_PAM_FORMAT_NULL = 0, @@ -238,6 +251,15 @@ enum ImwriteGIFCompressionFlags { IMWRITE_GIF_COLORTABLE_SIZE_256 = 8 }; +enum ImageMetadataType +{ + IMAGE_METADATA_UNKNOWN = -1, + IMAGE_METADATA_EXIF = 0, + IMAGE_METADATA_XMP = 1, + IMAGE_METADATA_ICCP = 2, + IMAGE_METADATA_MAX = 2 +}; + //! @} imgcodecs_flags /** @brief Represents an animation with multiple frames. @@ -247,13 +269,25 @@ It provides support for looping, background color settings, frame timing, and fr struct CV_EXPORTS_W_SIMPLE Animation { //! Number of times the animation should loop. 0 means infinite looping. + /*! @note At some file format, when N is set, whether it is displayed N or N+1 times depends on the implementation of the user application. This loop times behaviour has not been documented clearly. + * - (GIF) See https://issues.chromium.org/issues/40459899 + * And animated GIF with loop is extended with the Netscape Application Block(NAB), which it not a part of GIF89a specification. See https://en.wikipedia.org/wiki/GIF#Animated_GIF . + * - (WebP) See https://issues.chromium.org/issues/41276895 + */ CV_PROP_RW int loop_count; //! Background color of the animation in BGRA format. CV_PROP_RW Scalar bgcolor; //! Duration for each frame in milliseconds. + /*! @note (GIF) Due to file format limitation + * - Durations must be multiples of 10 milliseconds. Any provided value will be rounded down to the nearest 10ms (e.g., 88ms → 80ms). + * - 0ms(or smaller than expected in user application) duration may cause undefined behavior, e.g. it is handled with default duration. + * - Over 65535 * 10 milliseconds duration is not supported. + */ CV_PROP_RW std::vector durations; //! Vector of frames, where each Mat represents a single frame. CV_PROP_RW std::vector frames; + //! image that can be used for the format in addition to the animation or if animation is not supported in the reader (like in PNG). + CV_PROP_RW Mat still_image; /** @brief Constructs an Animation object with optional loop count and background color. @@ -263,11 +297,11 @@ struct CV_EXPORTS_W_SIMPLE Animation - If a negative value or a value beyond the maximum of `0xffff` (65535) is provided, it is reset to `0` (infinite looping) to maintain valid bounds. - @param bgColor A `Scalar` object representing the background color in BGRA format: + @param bgColor A `Scalar` object representing the background color in BGR format: - Defaults to `Scalar()`, indicating an empty color (usually transparent if supported). - This background color provides a solid fill behind frames that have transparency, ensuring a consistent display appearance. */ - Animation(int loopCount = 0, Scalar bgColor = Scalar()); + CV_WRAP Animation(int loopCount = 0, Scalar bgColor = Scalar()); }; /** @brief Loads an image from a file. @@ -335,6 +369,17 @@ The image passing through the img parameter can be pre-allocated. The memory is */ CV_EXPORTS_W void imread( const String& filename, OutputArray dst, int flags = IMREAD_COLOR_BGR ); +/** @brief Reads an image from a file together with associated metadata. + +The function imreadWithMetadata reads image from the specified file. It does the same thing as imread, but additionally reads metadata if the corresponding file contains any. +@param filename Name of the file to be loaded. +@param metadataTypes Output vector with types of metadata chucks returned in metadata, see ImageMetadataType. +@param metadata Output vector of vectors or vector of matrices to store the retrieved metadata +@param flags Flag that can take values of cv::ImreadModes +*/ +CV_EXPORTS_W Mat imreadWithMetadata( const String& filename, CV_OUT std::vector& metadataTypes, + OutputArrayOfArrays metadata, int flags = IMREAD_ANYCOLOR); + /** @brief Loads a multi-page image from a file. The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects. @@ -375,6 +420,19 @@ The function imreadanimation loads frames from an animated image file (e.g., GIF */ CV_EXPORTS_W bool imreadanimation(const String& filename, CV_OUT Animation& animation, int start = 0, int count = INT16_MAX); +/** @brief Loads frames from an animated image buffer into an Animation structure. + +The function imdecodeanimation loads frames from an animated image buffer (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct. + +@param buf A reference to an InputArray containing the image buffer. +@param animation A reference to an Animation structure where the loaded frames will be stored. It should be initialized before the function is called. +@param start The index of the first frame to load. This is optional and defaults to 0. +@param count The number of frames to load. This is optional and defaults to 32767. + +@return Returns true if the buffer was successfully loaded and frames were extracted; returns false otherwise. +*/ +CV_EXPORTS_W bool imdecodeanimation(InputArray buf, CV_OUT Animation& animation, int start = 0, int count = INT16_MAX); + /** @brief Saves an Animation to a specified file. The function imwriteanimation saves the provided Animation data to the specified file in an animated format. @@ -389,6 +447,26 @@ These parameters are used to specify additional options for the encoding process */ CV_EXPORTS_W bool imwriteanimation(const String& filename, const Animation& animation, const std::vector& params = std::vector()); +/** @brief Encodes an Animation to a memory buffer. + +The function imencodeanimation encodes the provided Animation data into a memory +buffer in an animated format. Supported formats depend on the implementation and +may include formats like GIF, AVIF, APNG, or WEBP. + +@param ext The file extension that determines the format of the encoded data. +@param animation A constant reference to an Animation struct containing the +frames and metadata to be encoded. +@param buf A reference to a vector of unsigned chars where the encoded data will +be stored. +@param params Optional format-specific parameters encoded as pairs (paramId_1, +paramValue_1, paramId_2, paramValue_2, ...). These parameters are used to +specify additional options for the encoding process. Refer to `cv::ImwriteFlags` +for details on possible parameters. + +@return Returns true if the animation was successfully encoded; returns false otherwise. +*/ +CV_EXPORTS_W bool imencodeanimation(const String& ext, const Animation& animation, CV_OUT std::vector& buf, const std::vector& params = std::vector()); + /** @brief Returns the number of images inside the given file The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise. @@ -413,13 +491,13 @@ can be saved using this function, with these exceptions: - With JPEG 2000 encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved. - With JPEG XL encoder, 8-bit unsigned (CV_8U), 16-bit unsigned (CV_16U) and 32-bit float(CV_32F) images can be saved. - JPEG XL images with an alpha channel can be saved using this function. - To do this, create 8-bit (or 16-bit, 32-bit float) 4-channel image BGRA, where the alpha channel goes last. - Fully transparent pixels should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535/1.0. + To achieve this, create an 8-bit 4-channel (CV_8UC4) / 16-bit 4-channel (CV_16UC4) / 32-bit float 4-channel (CV_32FC4) BGRA image, ensuring the alpha channel is the last component. + Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255/65535/1.0. - With PAM encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved. - With PNG encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved. - - PNG images with an alpha channel can be saved using this function. To do this, create - 8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels - should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535 (see the code sample below). + - PNG images with an alpha channel can be saved using this function. + To achieve this, create an 8-bit 4-channel (CV_8UC4) / 16-bit 4-channel (CV_16UC4) BGRA image, ensuring the alpha channel is the last component. + Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255/65535(see the code sample below). - With PGM/PPM encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved. - With TIFF encoder, 8-bit unsigned (CV_8U), 8-bit signed (CV_8S), 16-bit unsigned (CV_16U), 16-bit signed (CV_16S), @@ -428,6 +506,11 @@ can be saved using this function, with these exceptions: - Multiple images (vector of Mat) can be saved in TIFF format (see the code sample below). - 32-bit float 3-channel (CV_32FC3) TIFF images will be saved using the LogLuv high dynamic range encoding (4 bytes per pixel) +- With GIF encoder, 8-bit unsigned (CV_8U) images can be saved. + - GIF images with an alpha channel can be saved using this function. + To achieve this, create an 8-bit 4-channel (CV_8UC4) BGRA image, ensuring the alpha channel is the last component. + Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255. + - 8-bit single-channel images (CV_8UC1) are not supported due to GIF's limitation to indexed color formats. If the image format is not supported, the image will be converted to 8-bit unsigned (CV_8U) and saved that way. @@ -445,6 +528,20 @@ It also demonstrates how to save multiple images in a TIFF file: CV_EXPORTS_W bool imwrite( const String& filename, InputArray img, const std::vector& params = std::vector()); +/** @brief Saves an image to a specified file with metadata + +The function imwriteWithMetadata saves the image to the specified file. It does the same thing as imwrite, but additionally writes metadata if the corresponding format supports it. +@param filename Name of the file. As with imwrite, image format is determined by the file extension. +@param img (Mat or vector of Mat) Image or Images to be saved. +@param metadataTypes Vector with types of metadata chucks stored in metadata to write, see ImageMetadataType. +@param metadata Vector of vectors or vector of matrices with chunks of metadata to store into the file +@param params Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags +*/ +CV_EXPORTS_W bool imwriteWithMetadata( const String& filename, InputArray img, + const std::vector& metadataTypes, + InputArrayOfArrays& metadata, + const std::vector& params = std::vector()); + //! @brief multi-image overload for bindings CV_WRAP static inline bool imwritemulti(const String& filename, InputArrayOfArrays img, @@ -466,6 +563,22 @@ See cv::imread for the list of supported formats and flags description. */ CV_EXPORTS_W Mat imdecode( InputArray buf, int flags ); +/** @brief Reads an image from a buffer in memory together with associated metadata. + +The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or +contains invalid data, the function returns an empty matrix ( Mat::data==NULL ). + +See cv::imread for the list of supported formats and flags description. + +@note In the case of color images, the decoded images will have the channels stored in **B G R** order. +@param buf Input array or vector of bytes. +@param metadataTypes Output vector with types of metadata chucks returned in metadata, see ImageMetadataType. +@param metadata Output vector of vectors or vector of matrices to store the retrieved metadata +@param flags The same flags as in cv::imread, see cv::ImreadModes. +*/ +CV_EXPORTS_W Mat imdecodeWithMetadata( InputArray buf, CV_OUT std::vector& metadataTypes, + OutputArrayOfArrays metadata, int flags = IMREAD_ANYCOLOR ); + /** @overload @param buf Input array or vector of bytes. @param flags The same flags as in cv::imread, see cv::ImreadModes. @@ -504,6 +617,24 @@ CV_EXPORTS_W bool imencode( const String& ext, InputArray img, CV_OUT std::vector& buf, const std::vector& params = std::vector()); +/** @brief Encodes an image into a memory buffer. + +The function imencode compresses the image and stores it in the memory buffer that is resized to fit the +result. See cv::imwrite for the list of supported formats and flags description. + +@param ext File extension that defines the output format. Must include a leading period. +@param img Image to be compressed. +@param metadataTypes Vector with types of metadata chucks stored in metadata to write, see ImageMetadataType. +@param metadata Vector of vectors or vector of matrices with chunks of metadata to store into the file +@param buf Output buffer resized to fit the compressed image. +@param params Format-specific parameters. See cv::imwrite and cv::ImwriteFlags. +*/ +CV_EXPORTS_W bool imencodeWithMetadata( const String& ext, InputArray img, + const std::vector& metadataTypes, + InputArrayOfArrays metadata, + CV_OUT std::vector& buf, + const std::vector& params = std::vector()); + /** @brief Encodes array of images into a memory buffer. The function is analog to cv::imencode for in-memory multi-page image compression. @@ -527,7 +658,7 @@ This can be useful for verifying support for a given image format before attempt @return true if an image reader for the specified file is available and the file can be opened, false otherwise. @note The function checks the availability of image codecs that are either built into OpenCV or dynamically loaded. -It does not check for the actual existence of the file but rather the ability to read the specified file type. +It does not load the image codec implementation and decode data, but uses signature check. If the file cannot be opened or the format is unsupported, the function will return false. @sa cv::haveImageWriter, cv::imread, cv::imdecode diff --git a/3rdParty/opencv-4.11.0/opencv2/imgcodecs/imgcodecs.hpp b/3rdParty/opencv-4.12.0/opencv2/imgcodecs/imgcodecs.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgcodecs/imgcodecs.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgcodecs/imgcodecs.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/imgcodecs/imgcodecs_c.h b/3rdParty/opencv-4.12.0/opencv2/imgcodecs/imgcodecs_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgcodecs/imgcodecs_c.h rename to 3rdParty/opencv-4.12.0/opencv2/imgcodecs/imgcodecs_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgcodecs/ios.h b/3rdParty/opencv-4.12.0/opencv2/imgcodecs/ios.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgcodecs/ios.h rename to 3rdParty/opencv-4.12.0/opencv2/imgcodecs/ios.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgcodecs/legacy/constants_c.h b/3rdParty/opencv-4.12.0/opencv2/imgcodecs/legacy/constants_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgcodecs/legacy/constants_c.h rename to 3rdParty/opencv-4.12.0/opencv2/imgcodecs/legacy/constants_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgcodecs/macosx.h b/3rdParty/opencv-4.12.0/opencv2/imgcodecs/macosx.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgcodecs/macosx.h rename to 3rdParty/opencv-4.12.0/opencv2/imgcodecs/macosx.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc.hpp index 4f8fe77d26..52f671341f 100644 --- a/3rdParty/opencv-4.11.0/opencv2/imgproc.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/imgproc.hpp @@ -118,7 +118,7 @@ This module offers a comprehensive suite of image processing functions, enabling coordinates needs to be retrieved. In the simplest case, the coordinates can be just rounded to the nearest integer coordinates and the corresponding pixel can be used. This is called a nearest-neighbor interpolation. However, a better result can be achieved by using more - sophisticated [interpolation methods](http://en.wikipedia.org/wiki/Multivariate_interpolation) , + sophisticated [interpolation methods](https://en.wikipedia.org/wiki/Multivariate_interpolation) , where a polynomial function is fit into some neighborhood of the computed pixel \f$(f_x(x,y), f_y(x,y))\f$, and then the value of the polynomial at \f$(f_x(x,y), f_y(x,y))\f$ is taken as the interpolated pixel value. In OpenCV, you can choose between several interpolation methods. See @@ -235,8 +235,9 @@ enum MorphShapes { MORPH_RECT = 0, //!< a rectangular structuring element: \f[E_{ij}=1\f] MORPH_CROSS = 1, //!< a cross-shaped structuring element: //!< \f[E_{ij} = \begin{cases} 1 & \texttt{if } {i=\texttt{anchor.y } {or } {j=\texttt{anchor.x}}} \\0 & \texttt{otherwise} \end{cases}\f] - MORPH_ELLIPSE = 2 //!< an elliptic structuring element, that is, a filled ellipse inscribed + MORPH_ELLIPSE = 2, //!< an elliptic structuring element, that is, a filled ellipse inscribed //!< into the rectangle Rect(0, 0, esize.width, esize.height) + MORPH_DIAMOND = 3 //!< a diamond structuring element defined by Manhattan distance }; //! @} imgproc_filter @@ -329,7 +330,8 @@ enum ThresholdTypes { THRESH_TOZERO_INV = 4, //!< \f[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\f] THRESH_MASK = 7, THRESH_OTSU = 8, //!< flag, use Otsu algorithm to choose the optimal threshold value - THRESH_TRIANGLE = 16 //!< flag, use Triangle algorithm to choose the optimal threshold value + THRESH_TRIANGLE = 16, //!< flag, use Triangle algorithm to choose the optimal threshold value + THRESH_DRYRUN = 128 //!< flag, compute threshold only (useful for OTSU/TRIANGLE) but does not actually run thresholding }; //! adaptive threshold algorithm @@ -1466,7 +1468,7 @@ CV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky, /** @brief Returns Gabor filter coefficients. For more details about gabor filter equations and parameters, see: [Gabor -Filter](http://en.wikipedia.org/wiki/Gabor_filter). +Filter](https://en.wikipedia.org/wiki/Gabor_filter). @param ksize Size of the filter returned. @param sigma Standard deviation of the gaussian envelope. @@ -1548,7 +1550,7 @@ CV_EXPORTS_W void GaussianBlur( InputArray src, OutputArray dst, Size ksize, /** @brief Applies the bilateral filter to an image. The function applies bilateral filtering to the input image, as described in -http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html +https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters. @@ -1658,7 +1660,7 @@ stackBlur can generate similar results as Gaussian blur, and the time consumptio It creates a kind of moving stack of colors whilst scanning through the image. Thereby it just has to add one new block of color to the right side of the stack and remove the leftmost color. The remaining colors on the topmost layer of the stack are either added on or reduced by one, depending on if they are on the right or on the left side of the stack. The only supported borderType is BORDER_REPLICATE. -Original paper was proposed by Mario Klingemann, which can be found http://underdestruction.com/2004/02/25/stackblur-2004. +Original paper was proposed by Mario Klingemann, which can be found https://underdestruction.com/2004/02/25/stackblur-2004. @param src input image. The number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S or CV_32F. @@ -1873,7 +1875,7 @@ Check @ref tutorial_canny_detector "the corresponding tutorial" for more details The function finds edges in the input image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See - + @param image 8-bit input image. @param edges output edge map; single channels 8-bit image, which has the same size as image . @@ -2142,7 +2144,7 @@ An example using the Hough line detector /** @brief Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line -detection. See for a good explanation of Hough +detection. See for a good explanation of Hough transform. @param image 8-bit, single-channel binary source image. The image may be modified by the function. @@ -2985,15 +2987,15 @@ CV_EXPORTS_W void accumulateWeighted( InputArray src, InputOutputArray dst, The operation takes advantage of the Fourier shift theorem for detecting the translational shift in the frequency domain. It can be used for fast image registration as well as motion estimation. For -more information please see +more information please see Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed with getOptimalDFTSize. The function performs the following equations: -- First it applies a Hanning window (see ) to each -image to remove possible edge effects. This window is cached until the array size changes to speed -up processing time. +- First it applies a Hanning window to each image to remove possible edge effects, if it's provided +by user. See @ref createHanningWindow and . This window may +be cached until the array size changes to speed up processing time. - Next it computes the forward DFTs of each source array: \f[\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}\f] where \f$\mathcal{F}\f$ is the forward DFT. @@ -3021,7 +3023,7 @@ CV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2, /** @brief This function computes a Hanning window coefficients in two dimensions. -See (http://en.wikipedia.org/wiki/Hann_function) and (http://en.wikipedia.org/wiki/Window_function) +See (https://en.wikipedia.org/wiki/Hann_function) and (https://en.wikipedia.org/wiki/Window_function) for more information. An example is shown below: @@ -3069,9 +3071,10 @@ Also, the special values #THRESH_OTSU or #THRESH_TRIANGLE may be combined with o above values. In these cases, the function determines the optimal threshold value using the Otsu's or Triangle algorithm and uses it instead of the specified thresh. -@note Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images. +@note Currently, the Otsu's method is implemented only for CV_8UC1 and CV_16UC1 images, +and the Triangle's method is implemented only for CV_8UC1 images. -@param src input array (multiple-channel, 8-bit or 32-bit floating point). +@param src input array (multiple-channel, CV_8U, CV_16S, CV_16U, CV_32F or CV_64F). @param dst output array of the same size and type and the same number of channels as src. @param thresh threshold value. @param maxval maximum value to use with the #THRESH_BINARY and #THRESH_BINARY_INV thresholding @@ -3079,11 +3082,30 @@ types. @param type thresholding type (see #ThresholdTypes). @return the computed threshold value if Otsu's or Triangle methods used. -@sa adaptiveThreshold, findContours, compare, min, max +@sa thresholdWithMask, adaptiveThreshold, findContours, compare, min, max */ CV_EXPORTS_W double threshold( InputArray src, OutputArray dst, double thresh, double maxval, int type ); +/** @brief Same as #threshold, but with an optional mask + +@note If the mask is empty, #thresholdWithMask is equivalent to #threshold. +If the mask is not empty, dst *must* be of the same size and type as src, so that +outliers pixels are left as-is + +@param src input array (multiple-channel, 8-bit or 32-bit floating point). +@param dst output array of the same size and type and the same number of channels as src. +@param mask optional mask (same size as src, 8-bit). +@param thresh threshold value. +@param maxval maximum value to use with the #THRESH_BINARY and #THRESH_BINARY_INV thresholding +types. +@param type thresholding type (see #ThresholdTypes). +@return the computed threshold value if Otsu's or Triangle methods used. + +@sa threshold, adaptiveThreshold, findContours, compare, min, max +*/ +CV_EXPORTS_W double thresholdWithMask( InputArray src, InputOutputArray dst, InputArray mask, + double thresh, double maxval, int type ); /** @brief Applies an adaptive threshold to an array. @@ -3486,7 +3508,7 @@ An example using the GrabCut algorithm /** @brief Runs the GrabCut algorithm. -The function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut). +The function implements the [GrabCut image segmentation algorithm](https://en.wikipedia.org/wiki/GrabCut). @param img Input 8-bit 3-channel image. @param mask Input/output 8-bit single-channel mask. The mask is initialized by the function when @@ -3813,7 +3835,7 @@ CV_EXPORTS_W Moments moments( InputArray array, bool binaryImage = false ); /** @brief Calculates seven Hu invariants. The function calculates seven Hu invariants (introduced in @cite Hu62; see also -) defined as: +) defined as: \f[\begin{array}{l} hu[0]= \eta _{20}+ \eta _{02} \\ hu[1]=( \eta _{20}- \eta _{02})^{2}+4 \eta _{11}^{2} \\ hu[2]=( \eta _{30}-3 \eta _{12})^{2}+ (3 \eta _{21}- \eta _{03})^{2} \\ hu[3]=( \eta _{30}+ \eta _{12})^{2}+ ( \eta _{21}+ \eta _{03})^{2} \\ hu[4]=( \eta _{30}-3 \eta _{12})( \eta _{30}+ \eta _{12})[( \eta _{30}+ \eta _{12})^{2}-3( \eta _{21}+ \eta _{03})^{2}]+(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ hu[5]=( \eta _{20}- \eta _{02})[( \eta _{30}+ \eta _{12})^{2}- ( \eta _{21}+ \eta _{03})^{2}]+4 \eta _{11}( \eta _{30}+ \eta _{12})( \eta _{21}+ \eta _{03}) \\ hu[6]=(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}]-( \eta _{30}-3 \eta _{12})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ \end{array}\f] @@ -3909,7 +3931,7 @@ is \f$W \times H\f$ and templ is \f$w \times h\f$ , then result is \f$(W-w+1) \t of channels as template or only one channel, which is then used for all template and image channels. If the data type is #CV_8U, the mask is interpreted as a binary mask, meaning only elements where mask is nonzero are used and are kept unchanged independent - of the actual mask value (weight equals 1). For data tpye #CV_32F, the mask values are + of the actual mask value (weight equals 1). For data type #CV_32F, the mask values are used as weights. The exact formulas are documented in #TemplateMatchModes. */ CV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ, @@ -4051,7 +4073,7 @@ CV_EXPORTS_W void findContoursLinkRuns(InputArray image, OutputArrayOfArrays con The function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less vertices so that the distance between them is less or equal to the specified precision. It uses the -Douglas-Peucker algorithm +Douglas-Peucker algorithm @param curve Input vector of a 2D point stored in std::vector or Mat @param approxCurve Result of the approximation. The type should match the type of the input curve. @@ -4139,7 +4161,11 @@ CV_EXPORTS_W double contourArea( InputArray contour, bool oriented = false ); /** @brief Finds a rotated rectangle of the minimum area enclosing the input 2D point set. The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a -specified point set. Developer should keep in mind that the returned RotatedRect can contain negative +specified point set. The angle of rotation represents the angle between the line connecting the starting +and ending points (based on the clockwise order with greatest index for the corner with greatest \f$y\f$) +and the horizontal axis. This angle always falls between \f$[-90, 0)\f$ because, if the object +rotates more than a rect angle, the next edge is used to measure the angle. The starting and ending points change +as the object rotates.Developer should keep in mind that the returned RotatedRect can contain negative indices when data is close to the containing Mat element boundary. @param points Input vector of 2D points, stored in std::vector\<\> or Mat @@ -4148,7 +4174,9 @@ CV_EXPORTS_W RotatedRect minAreaRect( InputArray points ); /** @brief Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle. -The function finds the four vertices of a rotated rectangle. This function is useful to draw the +The function finds the four vertices of a rotated rectangle. The four vertices are returned +in clockwise order starting from the point with greatest \f$y\f$. If two points have the +same \f$y\f$ coordinate the rightmost is the starting point. This function is useful to draw the rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please visit the @ref tutorial_bounding_rotated_ellipses "tutorial on Creating Bounding rotated boxes and ellipses for contours" for more information. @@ -4299,6 +4327,9 @@ ellipse/rotatedRect data contains negative indices, due to the data points being border of the containing Mat element. @param points Input 2D point set, stored in std::vector\<\> or Mat + +@note Input point types are @ref Point2i or @ref Point2f and at least 5 points are required. +@note @ref getClosestEllipsePoints function can be used to compute the ellipse fitting error. */ CV_EXPORTS_W RotatedRect fitEllipse( InputArray points ); @@ -4336,6 +4367,9 @@ CV_EXPORTS_W RotatedRect fitEllipse( InputArray points ); \f} @param points Input 2D point set, stored in std::vector\<\> or Mat + + @note Input point types are @ref Point2i or @ref Point2f and at least 5 points are required. + @note @ref getClosestEllipsePoints function can be used to compute the ellipse fitting error. */ CV_EXPORTS_W RotatedRect fitEllipseAMS( InputArray points ); @@ -4381,9 +4415,26 @@ CV_EXPORTS_W RotatedRect fitEllipseAMS( InputArray points ); The scaling factor guarantees that \f$A^T C A =1\f$. @param points Input 2D point set, stored in std::vector\<\> or Mat + + @note Input point types are @ref Point2i or @ref Point2f and at least 5 points are required. + @note @ref getClosestEllipsePoints function can be used to compute the ellipse fitting error. */ CV_EXPORTS_W RotatedRect fitEllipseDirect( InputArray points ); +/** @brief Compute for each 2d point the nearest 2d point located on a given ellipse. + + The function computes the nearest 2d location on a given ellipse for a vector of 2d points and is based on @cite Chatfield2017 code. + This function can be used to compute for instance the ellipse fitting error. + + @param ellipse_params Ellipse parameters + @param points Input 2d points + @param closest_pts For each 2d point, their corresponding closest 2d point located on a given ellipse + + @note Input point types are @ref Point2i or @ref Point2f + @see fitEllipse, fitEllipseAMS, fitEllipseDirect + */ +CV_EXPORTS_W void getClosestEllipsePoints( const RotatedRect& ellipse_params, InputArray points, OutputArray closest_pts ); + /** @brief Fits a line to a 2D or 3D point set. The function fitLine fits a line to a 2D or 3D point set by minimizing \f$\sum_i \rho(r_i)\f$ where @@ -4402,7 +4453,7 @@ of the following: - DIST_HUBER \f[\rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345\f] -The algorithm is based on the M-estimator ( ) technique +The algorithm is based on the M-estimator ( ) technique that iteratively fits the line using the weighted least-squares algorithm. After each iteration the weights \f$w_i\f$ are adjusted to be inversely proportional to \f$\rho(r_i)\f$ . @@ -4850,6 +4901,11 @@ The function cv::putText renders the specified text string in the image. Symbols using the specified font are replaced by question marks. See #getTextSize for a text rendering code example. +The `fontScale` parameter is a scale factor that is multiplied by the base font size: +- When scale > 1, the text is magnified. +- When 0 < scale < 1, the text is minimized. +- When scale < 0, the text is mirrored or reversed. + @param img Image. @param text Text string to be drawn. @param org Bottom-left corner of the text string in the image. diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/bindings.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc/bindings.hpp similarity index 53% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/bindings.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/bindings.hpp index b0dd395112..fff9807792 100644 --- a/3rdParty/opencv-4.11.0/opencv2/imgproc/bindings.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/imgproc/bindings.hpp @@ -21,14 +21,34 @@ void HoughLinesWithAccumulator( 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 + double min_theta = 0, double max_theta = CV_PI, + bool use_edgeval = false ) { std::vector lines_acc; - HoughLines(image, lines_acc, rho, theta, threshold, srn, stn, min_theta, max_theta); + HoughLines(image, lines_acc, rho, theta, threshold, srn, stn, min_theta, max_theta, use_edgeval); Mat(lines_acc).copyTo(lines); } +/** @brief Finds circles in a grayscale image using the Hough transform and get accumulator. + * + * @note This function is for bindings use only. Use original function in C++ code + * + * @sa HoughCircles + */ +CV_WRAP static inline +void HoughCirclesWithAccumulator( + InputArray image, OutputArray circles, + int method, double dp, double minDist, + double param1 = 100, double param2 = 100, + int minRadius = 0, int maxRadius = 0 +) +{ + std::vector circles_acc; + HoughCircles(image, circles_acc, method, dp, minDist, param1, param2, minRadius, maxRadius); + Mat(1, static_cast(circles_acc.size()), CV_32FC4, &circles_acc.front()).copyTo(circles); +} + } // namespace #endif // OPENCV_IMGPROC_BINDINGS_HPP diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/detail/gcgraph.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc/detail/gcgraph.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/detail/gcgraph.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/detail/gcgraph.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/detail/legacy.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc/detail/legacy.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/detail/legacy.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/detail/legacy.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/hal/hal.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc/hal/hal.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/hal/hal.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/hal/hal.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/hal/interface.h b/3rdParty/opencv-4.12.0/opencv2/imgproc/hal/interface.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/hal/interface.h rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/hal/interface.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/imgproc.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc/imgproc.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/imgproc.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/imgproc.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/imgproc_c.h b/3rdParty/opencv-4.12.0/opencv2/imgproc/imgproc_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/imgproc_c.h rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/imgproc_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/segmentation.hpp b/3rdParty/opencv-4.12.0/opencv2/imgproc/segmentation.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/segmentation.hpp rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/segmentation.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/imgproc/types_c.h b/3rdParty/opencv-4.12.0/opencv2/imgproc/types_c.h similarity index 95% rename from 3rdParty/opencv-4.11.0/opencv2/imgproc/types_c.h rename to 3rdParty/opencv-4.12.0/opencv2/imgproc/types_c.h index af25ac1c1b..873f4b1d24 100644 --- a/3rdParty/opencv-4.11.0/opencv2/imgproc/types_c.h +++ b/3rdParty/opencv-4.12.0/opencv2/imgproc/types_c.h @@ -389,6 +389,7 @@ enum MorphShapes_c CV_SHAPE_RECT =0, CV_SHAPE_CROSS =1, CV_SHAPE_ELLIPSE =2, + CV_SHAPE_DIAMOND =3, CV_SHAPE_CUSTOM =100 //!< custom structuring element }; @@ -610,9 +611,11 @@ enum CV_THRESH_MASK =7, CV_THRESH_OTSU =8, /**< use Otsu algorithm to choose the optimal threshold value; combine the flag with one of the above CV_THRESH_* values */ - CV_THRESH_TRIANGLE =16 /**< use Triangle algorithm to choose the optimal threshold value; + CV_THRESH_TRIANGLE =16, /**< use Triangle algorithm to choose the optimal threshold value; combine the flag with one of the above CV_THRESH_* values, but not with CV_THRESH_OTSU */ + CV_THRESH_DRYRUN =128 /**< compute threshold only (useful for OTSU/TRIANGLE) but does not + actually run thresholding */ }; /** Adaptive threshold methods */ diff --git a/3rdParty/opencv-4.11.0/opencv2/ml.hpp b/3rdParty/opencv-4.12.0/opencv2/ml.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/ml.hpp rename to 3rdParty/opencv-4.12.0/opencv2/ml.hpp index 4e62c98dcc..e7a339809a 100644 --- a/3rdParty/opencv-4.11.0/opencv2/ml.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/ml.hpp @@ -256,7 +256,7 @@ class CV_EXPORTS_W TrainData @param filename The input file name @param headerLineCount The number of lines in the beginning to skip; besides the header, the - function also skips empty lines and lines staring with `#` + function also skips empty lines and lines starting with `#` @param responseStartIdx Index of the first output variable. If -1, the function considers the last variable as the response @param responseEndIdx Index of the last output variable + 1. If -1, then there is single diff --git a/3rdParty/opencv-4.11.0/opencv2/ml/ml.hpp b/3rdParty/opencv-4.12.0/opencv2/ml/ml.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/ml/ml.hpp rename to 3rdParty/opencv-4.12.0/opencv2/ml/ml.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/ml/ml.inl.hpp b/3rdParty/opencv-4.12.0/opencv2/ml/ml.inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/ml/ml.inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/ml/ml.inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect.hpp index 15364fc88b..4081ffa5a9 100644 --- a/3rdParty/opencv-4.11.0/opencv2/objdetect.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/objdetect.hpp @@ -729,7 +729,8 @@ class CV_EXPORTS_W QRCodeEncoder { }; enum ECIEncodings { - ECI_UTF8 = 26 + ECI_SHIFT_JIS = 20, + ECI_UTF8 = 26, }; /** @brief QR code encoder parameters. */ @@ -741,10 +742,10 @@ class CV_EXPORTS_W QRCodeEncoder { CV_PROP_RW int version; //! The optional level of error correction (by default - the lowest). - CV_PROP_RW CorrectionLevel correction_level; + CV_PROP_RW QRCodeEncoder::CorrectionLevel correction_level; //! The optional encoding mode - Numeric, Alphanumeric, Byte, Kanji, ECI or Structured Append. - CV_PROP_RW EncodeMode mode; + CV_PROP_RW QRCodeEncoder::EncodeMode mode; //! The optional number of QR codes to generate in Structured Append mode. CV_PROP_RW int structure_number; @@ -808,6 +809,13 @@ class CV_EXPORTS_W_SIMPLE QRCodeDetector : public GraphicalCodeDetector */ CV_WRAP std::string detectAndDecodeCurved(InputArray img, OutputArray points=noArray(), OutputArray straight_qrcode = noArray()); + + /** @brief Returns a kind of encoding for the decoded info from the latest @ref decode or @ref detectAndDecode call + @param codeIdx an index of the previously decoded QR code. + When @ref decode or @ref detectAndDecode is used, valid value is zero. + For @ref decodeMulti or @ref detectAndDecodeMulti use indices corresponding to the output order. + */ + CV_WRAP QRCodeEncoder::ECIEncodings getEncoding(int codeIdx = 0); }; class CV_EXPORTS_W_SIMPLE QRCodeDetectorAruco : public GraphicalCodeDetector { diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_board.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_board.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_board.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_board.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_detector.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_detector.hpp similarity index 81% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_detector.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_detector.hpp index 2eac6e419d..ad27e7921d 100644 --- a/3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_detector.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_detector.hpp @@ -285,6 +285,16 @@ class CV_EXPORTS_W ArucoDetector : public Algorithm const DetectorParameters &detectorParams = DetectorParameters(), const RefineParameters& refineParams = RefineParameters()); + /** @brief ArucoDetector constructor for multiple dictionaries + * + * @param dictionaries indicates the type of markers that will be searched. Empty dictionaries will throw an error. + * @param detectorParams marker detection parameters + * @param refineParams marker refine detection parameters + */ + CV_WRAP ArucoDetector(const std::vector &dictionaries, + const DetectorParameters &detectorParams = DetectorParameters(), + const RefineParameters& refineParams = RefineParameters()); + /** @brief Basic marker detection * * @param image input image @@ -297,7 +307,7 @@ class CV_EXPORTS_W ArucoDetector : public Algorithm * @param rejectedImgPoints contains the imgPoints of those squares whose inner code has not a * correct codification. Useful for debugging purposes. * - * Performs marker detection in the input image. Only markers included in the specific dictionary + * Performs marker detection in the input image. Only markers included in the first specified dictionary * are searched. For each detected marker, it returns the 2D position of its corner in the image * and its corresponding identifier. * Note that this function does not perform pose estimation. @@ -329,6 +339,8 @@ class CV_EXPORTS_W ArucoDetector : public Algorithm * If camera parameters and distortion coefficients are provided, missing markers are reprojected * using projectPoint function. If not, missing marker projections are interpolated using global * homography, and all the marker corners in the board must have the same Z coordinate. + * @note This function assumes that the board only contains markers from one dictionary, so only the + * first configured dictionary is used. It has to match the dictionary of the board to work properly. */ CV_WRAP void refineDetectedMarkers(InputArray image, const Board &board, InputOutputArrayOfArrays detectedCorners, @@ -336,9 +348,59 @@ class CV_EXPORTS_W ArucoDetector : public Algorithm InputArray cameraMatrix = noArray(), InputArray distCoeffs = noArray(), OutputArray recoveredIdxs = noArray()) const; + /** @brief Basic marker detection + * + * @param image input image + * @param corners vector of detected marker corners. For each marker, its four corners + * are provided, (e.g std::vector > ). For N detected markers, + * the dimensions of this array is Nx4. The order of the corners is clockwise. + * @param ids vector of identifiers of the detected markers. The identifier is of type int + * (e.g. std::vector). For N detected markers, the size of ids is also N. + * The identifiers have the same order than the markers in the imgPoints array. + * @param rejectedImgPoints contains the imgPoints of those squares whose inner code has not a + * correct codification. Useful for debugging purposes. + * @param dictIndices vector of dictionary indices for each detected marker. Use getDictionaries() to get the + * list of corresponding dictionaries. + * + * Performs marker detection in the input image. Only markers included in the specific dictionaries + * are searched. For each detected marker, it returns the 2D position of its corner in the image + * and its corresponding identifier. + * Note that this function does not perform pose estimation. + * @note The function does not correct lens distortion or takes it into account. It's recommended to undistort + * input image with corresponding camera model, if camera parameters are known + * @sa undistort, estimatePoseSingleMarkers, estimatePoseBoard + */ + CV_WRAP void detectMarkersMultiDict(InputArray image, OutputArrayOfArrays corners, OutputArray ids, + OutputArrayOfArrays rejectedImgPoints = noArray(), OutputArray dictIndices = noArray()) const; + + /** @brief Returns first dictionary from internal list used for marker detection. + * + * @return The first dictionary from the configured ArucoDetector. + */ CV_WRAP const Dictionary& getDictionary() const; + + /** @brief Sets and replaces the first dictionary in internal list to be used for marker detection. + * + * @param dictionary The new dictionary that will replace the first dictionary in the internal list. + */ CV_WRAP void setDictionary(const Dictionary& dictionary); + /** @brief Returns all dictionaries currently used for marker detection as a vector. + * + * @return A std::vector containing all dictionaries used by the ArucoDetector. + */ + CV_WRAP std::vector getDictionaries() const; + + /** @brief Sets the entire collection of dictionaries to be used for marker detection, replacing any existing dictionaries. + * + * @param dictionaries A std::vector containing the new set of dictionaries to be used. + * + * Configures the ArucoDetector to use the provided vector of dictionaries for marker detection. + * This method replaces any dictionaries that were previously set. + * @note Setting an empty vector of dictionaries will throw an error. + */ + CV_WRAP void setDictionaries(const std::vector& dictionaries); + CV_WRAP const DetectorParameters& getDetectorParameters() const; CV_WRAP void setDetectorParameters(const DetectorParameters& detectorParameters); diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_dictionary.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_dictionary.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/aruco_dictionary.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/aruco_dictionary.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/barcode.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/barcode.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/barcode.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/barcode.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/charuco_detector.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/charuco_detector.hpp similarity index 96% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/charuco_detector.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/charuco_detector.hpp index 5adfe2931c..969ae65bbb 100644 --- a/3rdParty/opencv-4.11.0/opencv2/objdetect/charuco_detector.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/objdetect/charuco_detector.hpp @@ -16,6 +16,7 @@ struct CV_EXPORTS_W_SIMPLE CharucoParameters { CV_WRAP CharucoParameters() { minMarkers = 2; tryRefineMarkers = false; + checkMarkers = true; } /// cameraMatrix optional 3x3 floating-point camera matrix CV_PROP_RW Mat cameraMatrix; @@ -28,6 +29,9 @@ struct CV_EXPORTS_W_SIMPLE CharucoParameters { /// try to use refine board, default false CV_PROP_RW bool tryRefineMarkers; + + /// run check to verify that markers belong to the same board, default true + CV_PROP_RW bool checkMarkers; }; class CV_EXPORTS_W CharucoDetector : public Algorithm { diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/detection_based_tracker.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/detection_based_tracker.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/detection_based_tracker.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/detection_based_tracker.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/face.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/face.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/face.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/face.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/graphical_code_detector.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/graphical_code_detector.hpp similarity index 81% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/graphical_code_detector.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/graphical_code_detector.hpp index e4200a4204..f2a683cf7d 100644 --- a/3rdParty/opencv-4.11.0/opencv2/objdetect/graphical_code_detector.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/objdetect/graphical_code_detector.hpp @@ -73,6 +73,17 @@ class CV_EXPORTS_W_SIMPLE GraphicalCodeDetector { */ CV_WRAP bool detectAndDecodeMulti(InputArray img, CV_OUT std::vector& decoded_info, OutputArray points = noArray(), OutputArrayOfArrays straight_code = noArray()) const; + +#ifdef OPENCV_BINDINGS_PARSER + CV_WRAP_AS(detectAndDecodeBytes) NativeByteArray detectAndDecode(InputArray img, OutputArray points = noArray(), + OutputArray straight_code = noArray()) const; + CV_WRAP_AS(decodeBytes) NativeByteArray decode(InputArray img, InputArray points, OutputArray straight_code = noArray()) const; + CV_WRAP_AS(decodeBytesMulti) bool decodeMulti(InputArray img, InputArray points, CV_OUT std::vector& decoded_info, + OutputArrayOfArrays straight_code = noArray()) const; + CV_WRAP_AS(detectAndDecodeBytesMulti) bool detectAndDecodeMulti(InputArray img, CV_OUT std::vector& decoded_info, OutputArray points = noArray(), + OutputArrayOfArrays straight_code = noArray()) const; +#endif + struct Impl; protected: Ptr p; diff --git a/3rdParty/opencv-4.11.0/opencv2/objdetect/objdetect.hpp b/3rdParty/opencv-4.12.0/opencv2/objdetect/objdetect.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/objdetect/objdetect.hpp rename to 3rdParty/opencv-4.12.0/opencv2/objdetect/objdetect.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/opencv.hpp b/3rdParty/opencv-4.12.0/opencv2/opencv.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/opencv.hpp rename to 3rdParty/opencv-4.12.0/opencv2/opencv.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/opencv_modules.hpp b/3rdParty/opencv-4.12.0/opencv2/opencv_modules.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/opencv_modules.hpp rename to 3rdParty/opencv-4.12.0/opencv2/opencv_modules.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/photo.hpp b/3rdParty/opencv-4.12.0/opencv2/photo.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/photo.hpp rename to 3rdParty/opencv-4.12.0/opencv2/photo.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/photo/cuda.hpp b/3rdParty/opencv-4.12.0/opencv2/photo/cuda.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/photo/cuda.hpp rename to 3rdParty/opencv-4.12.0/opencv2/photo/cuda.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/photo/legacy/constants_c.h b/3rdParty/opencv-4.12.0/opencv2/photo/legacy/constants_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/photo/legacy/constants_c.h rename to 3rdParty/opencv-4.12.0/opencv2/photo/legacy/constants_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/photo/photo.hpp b/3rdParty/opencv-4.12.0/opencv2/photo/photo.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/photo/photo.hpp rename to 3rdParty/opencv-4.12.0/opencv2/photo/photo.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/autocalib.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/autocalib.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/autocalib.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/autocalib.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/blenders.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/blenders.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/blenders.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/blenders.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/camera.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/camera.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/camera.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/camera.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/exposure_compensate.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/exposure_compensate.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/exposure_compensate.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/exposure_compensate.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/matchers.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/matchers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/matchers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/matchers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/motion_estimators.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/motion_estimators.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/motion_estimators.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/motion_estimators.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/seam_finders.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/seam_finders.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/seam_finders.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/seam_finders.hpp index 1c13cce101..291b801ead 100644 --- a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/seam_finders.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/seam_finders.hpp @@ -235,7 +235,7 @@ class CV_EXPORTS GraphCutSeamFinderBase enum CostType { COST_COLOR, COST_COLOR_GRAD }; }; -/** @brief Minimum graph cut-based seam estimator. See details in @cite V03 . +/** @brief Minimum graph cut-based seam estimator. See details in @cite Kwatra03 . */ class CV_EXPORTS_W GraphCutSeamFinder : public GraphCutSeamFinderBase, public SeamFinder { diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/timelapsers.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/timelapsers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/timelapsers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/timelapsers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/util.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/util.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/util.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/util.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/util_inl.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/util_inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/util_inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/util_inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/warpers.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/warpers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/warpers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/warpers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/detail/warpers_inl.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/detail/warpers_inl.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/detail/warpers_inl.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/detail/warpers_inl.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/stitching/warpers.hpp b/3rdParty/opencv-4.12.0/opencv2/stitching/warpers.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/stitching/warpers.hpp rename to 3rdParty/opencv-4.12.0/opencv2/stitching/warpers.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/video.hpp b/3rdParty/opencv-4.12.0/opencv2/video.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/video.hpp rename to 3rdParty/opencv-4.12.0/opencv2/video.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/video/background_segm.hpp b/3rdParty/opencv-4.12.0/opencv2/video/background_segm.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/video/background_segm.hpp rename to 3rdParty/opencv-4.12.0/opencv2/video/background_segm.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/video/detail/tracking.detail.hpp b/3rdParty/opencv-4.12.0/opencv2/video/detail/tracking.detail.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/video/detail/tracking.detail.hpp rename to 3rdParty/opencv-4.12.0/opencv2/video/detail/tracking.detail.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/video/legacy/constants_c.h b/3rdParty/opencv-4.12.0/opencv2/video/legacy/constants_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/video/legacy/constants_c.h rename to 3rdParty/opencv-4.12.0/opencv2/video/legacy/constants_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/video/tracking.hpp b/3rdParty/opencv-4.12.0/opencv2/video/tracking.hpp similarity index 94% rename from 3rdParty/opencv-4.11.0/opencv2/video/tracking.hpp rename to 3rdParty/opencv-4.12.0/opencv2/video/tracking.hpp index 130bf1bcc0..e832fcfbf5 100644 --- a/3rdParty/opencv-4.11.0/opencv2/video/tracking.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/video/tracking.hpp @@ -46,6 +46,9 @@ #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" +#ifdef HAVE_OPENCV_DNN +# include "opencv2/dnn.hpp" +#endif namespace cv { @@ -826,6 +829,13 @@ class CV_EXPORTS_W TrackerGOTURN : public Tracker static CV_WRAP Ptr create(const TrackerGOTURN::Params& parameters = TrackerGOTURN::Params()); +#ifdef HAVE_OPENCV_DNN + /** @brief Constructor + @param model pre-loaded GOTURN model + */ + static CV_WRAP Ptr create(const dnn::Net& model); +#endif + //void init(InputArray image, const Rect& boundingBox) CV_OVERRIDE; //bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE; }; @@ -853,6 +863,16 @@ class CV_EXPORTS_W TrackerDaSiamRPN : public Tracker static CV_WRAP Ptr create(const TrackerDaSiamRPN::Params& parameters = TrackerDaSiamRPN::Params()); +#ifdef HAVE_OPENCV_DNN + /** @brief Constructor + * @param siam_rpn pre-loaded SiamRPN model + * @param kernel_cls1 pre-loaded CLS model + * @param kernel_r1 pre-loaded R1 model + */ + static CV_WRAP + Ptr create(const dnn::Net& siam_rpn, const dnn::Net& kernel_cls1, const dnn::Net& kernel_r1); +#endif + /** @brief Return tracking score */ CV_WRAP virtual float getTrackingScore() = 0; @@ -891,6 +911,15 @@ class CV_EXPORTS_W TrackerNano : public Tracker static CV_WRAP Ptr create(const TrackerNano::Params& parameters = TrackerNano::Params()); +#ifdef HAVE_OPENCV_DNN + /** @brief Constructor + * @param backbone pre-loaded backbone model + * @param neckhead pre-loaded neckhead model + */ + static CV_WRAP + Ptr create(const dnn::Net& backbone, const dnn::Net& neckhead); +#endif + /** @brief Return tracking score */ CV_WRAP virtual float getTrackingScore() = 0; @@ -929,6 +958,18 @@ class CV_EXPORTS_W TrackerVit : public Tracker static CV_WRAP Ptr create(const TrackerVit::Params& parameters = TrackerVit::Params()); +#ifdef HAVE_OPENCV_DNN + /** @brief Constructor + * @param model pre-loaded DNN model + * @param meanvalue mean value for image preprocessing + * @param stdvalue std value for image preprocessing + * @param tracking_score_threshold threshold for tracking score + */ + static CV_WRAP + Ptr create(const dnn::Net& model, Scalar meanvalue = Scalar(0.485, 0.456, 0.406), + Scalar stdvalue = Scalar(0.229, 0.224, 0.225), float tracking_score_threshold = 0.20f); +#endif + /** @brief Return tracking score */ CV_WRAP virtual float getTrackingScore() = 0; diff --git a/3rdParty/opencv-4.11.0/opencv2/video/video.hpp b/3rdParty/opencv-4.12.0/opencv2/video/video.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/video/video.hpp rename to 3rdParty/opencv-4.12.0/opencv2/video/video.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/videoio.hpp b/3rdParty/opencv-4.12.0/opencv2/videoio.hpp similarity index 97% rename from 3rdParty/opencv-4.11.0/opencv2/videoio.hpp rename to 3rdParty/opencv-4.12.0/opencv2/videoio.hpp index 9fc080c4cf..e2e617ed51 100644 --- a/3rdParty/opencv-4.11.0/opencv2/videoio.hpp +++ b/3rdParty/opencv-4.12.0/opencv2/videoio.hpp @@ -128,7 +128,7 @@ enum VideoCaptureAPIs { CAP_INTEL_MFX = 2300, //!< Intel MediaSDK CAP_XINE = 2400, //!< XINE engine (Linux) CAP_UEYE = 2500, //!< uEye Camera API - CAP_OBSENSOR = 2600, //!< For Orbbec 3D-Sensor device/module (Astra+, Femto, Astra2, Gemini2, Gemini2L, Gemini2XL, Femto Mega) attention: Astra2 cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions. + CAP_OBSENSOR = 2600, //!< For Orbbec 3D-Sensor device/module (Astra+, Femto, Astra2, Gemini2, Gemini2L, Gemini2XL, Gemini330, Femto Mega) attention: Astra2 cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions. }; @@ -168,7 +168,7 @@ enum VideoCaptureProperties { CAP_PROP_TRIGGER =24, CAP_PROP_TRIGGER_DELAY =25, CAP_PROP_WHITE_BALANCE_RED_V =26, - CAP_PROP_ZOOM =27, + CAP_PROP_ZOOM =27, //!< Android: May switch physical cameras/lenses. Factor and range are hardware-dependent. CAP_PROP_FOCUS =28, CAP_PROP_GUID =29, CAP_PROP_ISO_SPEED =30, @@ -726,8 +726,14 @@ class CV_EXPORTS_W IStreamReader public: virtual ~IStreamReader(); - /** @brief Read bytes from stream */ - virtual long long read(char* buffer, long long size) = 0; + /** @brief Read bytes from stream + * + * @param buffer already allocated buffer of at least @p size bytes + * @param size maximum number of bytes to read + * + * @return actual number of read bytes + */ + CV_WRAP virtual long long read(char* buffer, long long size) = 0; /** @brief Sets the stream position * @@ -736,7 +742,7 @@ class CV_EXPORTS_W IStreamReader * * @see fseek */ - virtual long long seek(long long offset, int origin) = 0; + CV_WRAP virtual long long seek(long long offset, int origin) = 0; }; class IVideoCapture; diff --git a/3rdParty/opencv-4.11.0/opencv2/videoio/legacy/constants_c.h b/3rdParty/opencv-4.12.0/opencv2/videoio/legacy/constants_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/videoio/legacy/constants_c.h rename to 3rdParty/opencv-4.12.0/opencv2/videoio/legacy/constants_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/videoio/registry.hpp b/3rdParty/opencv-4.12.0/opencv2/videoio/registry.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/videoio/registry.hpp rename to 3rdParty/opencv-4.12.0/opencv2/videoio/registry.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/videoio/videoio.hpp b/3rdParty/opencv-4.12.0/opencv2/videoio/videoio.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/videoio/videoio.hpp rename to 3rdParty/opencv-4.12.0/opencv2/videoio/videoio.hpp diff --git a/3rdParty/opencv-4.11.0/opencv2/videoio/videoio_c.h b/3rdParty/opencv-4.12.0/opencv2/videoio/videoio_c.h similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/videoio/videoio_c.h rename to 3rdParty/opencv-4.12.0/opencv2/videoio/videoio_c.h diff --git a/3rdParty/opencv-4.11.0/opencv2/world.hpp b/3rdParty/opencv-4.12.0/opencv2/world.hpp similarity index 100% rename from 3rdParty/opencv-4.11.0/opencv2/world.hpp rename to 3rdParty/opencv-4.12.0/opencv2/world.hpp diff --git a/3rdPartyBinaries/opencv_world4110.dll b/3rdPartyBinaries/opencv_world4110.dll deleted file mode 100644 index 122c350f87..0000000000 Binary files a/3rdPartyBinaries/opencv_world4110.dll and /dev/null differ diff --git a/3rdPartyBinaries/opencv_world4110.lib b/3rdPartyBinaries/opencv_world4110.lib deleted file mode 100644 index 468311ef53..0000000000 Binary files a/3rdPartyBinaries/opencv_world4110.lib and /dev/null differ diff --git a/3rdPartyBinaries/opencv_world4110d.lib b/3rdPartyBinaries/opencv_world4110d.lib deleted file mode 100644 index bcb3c4ae6f..0000000000 Binary files a/3rdPartyBinaries/opencv_world4110d.lib and /dev/null differ diff --git a/3rdPartyBinaries/opencv_world4120.lib b/3rdPartyBinaries/opencv_world4120.lib new file mode 100644 index 0000000000..a30738b3db Binary files /dev/null and b/3rdPartyBinaries/opencv_world4120.lib differ diff --git a/3rdPartyBinaries/opencv_world4120.zip b/3rdPartyBinaries/opencv_world4120.zip new file mode 100644 index 0000000000..8cebd7aaed Binary files /dev/null and b/3rdPartyBinaries/opencv_world4120.zip differ diff --git a/3rdPartyBinaries/opencv_world4120d.lib b/3rdPartyBinaries/opencv_world4120d.lib new file mode 100644 index 0000000000..7894b2a691 Binary files /dev/null and b/3rdPartyBinaries/opencv_world4120d.lib differ diff --git a/3rdPartyBinaries/opencv_world4110d.zip b/3rdPartyBinaries/opencv_world4120d.zip similarity index 71% rename from 3rdPartyBinaries/opencv_world4110d.zip rename to 3rdPartyBinaries/opencv_world4120d.zip index a2df06ec3a..09edc243d7 100644 Binary files a/3rdPartyBinaries/opencv_world4110d.zip and b/3rdPartyBinaries/opencv_world4120d.zip differ diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index f9968bc3c4..48bdf9da27 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -238,10 +238,10 @@ endif() if (WIN32) add_library(OpenCV_lib IMPORTED UNKNOWN) - target_include_directories(SerialProgramsLib SYSTEM PRIVATE ../3rdParty/opencv-4.11.0/) + target_include_directories(SerialProgramsLib SYSTEM PRIVATE ../3rdParty/opencv-4.12.0/) set_target_properties(OpenCV_lib PROPERTIES - IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4110.lib - IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4110d.lib + IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4120.lib + IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4120d.lib MAP_IMPORTED_CONFIG_DEBUG DEBUG MAP_IMPORTED_CONFIG_RELEASE RELEASE MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE @@ -578,8 +578,10 @@ SET_SOURCE_FILES_PROPERTIES( endif() if (WIN32) - set(OPENCV_DEBUG_ZIP "${REPO_ROOT_DIR}/3rdPartyBinaries/opencv_world4110d.zip") - set(OPENCV_DEBUG_DLL "${REPO_ROOT_DIR}/3rdPartyBinaries/opencv_world4110d.dll") + set(OPENCV_DEBUG_ZIP "${REPO_ROOT_DIR}/3rdPartyBinaries/opencv_world4120d.zip") + set(OPENCV_DEBUG_DLL "${REPO_ROOT_DIR}/3rdPartyBinaries/opencv_world4120d.dll") + set(OPENCV_RELEASE_ZIP "${REPO_ROOT_DIR}/3rdPartyBinaries/opencv_world4120.zip") + set(OPENCV_RELEASE_DLL "${REPO_ROOT_DIR}/3rdPartyBinaries/opencv_world4120.dll") set(DISCORD_ZIP "${REPO_ROOT_DIR}/3rdPartyBinaries/discord_social_sdk_win.zip") set(DISCORD_DIR "${REPO_ROOT_DIR}/3rdPartyBinaries/discord_social_sdk_win") @@ -648,6 +650,15 @@ if (WIN32) ) endif() + # Extract OpenCV release DLL if missing + if (NOT EXISTS "${OPENCV_RELEASE_DLL}") + message(STATUS "OpenCV release DLL not found, extracting from zip...") + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xf "${OPENCV_RELEASE_ZIP}" + WORKING_DIRECTORY "${REPO_ROOT_DIR}/3rdPartyBinaries" + ) + endif() + # Final target that depends on all deployment steps add_custom_target(DeployRuntime ALL DEPENDS SerialPrograms clone_packages run_windeployqt