Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 258a160

Browse files
committed
Bundle 4.8.0-1 (2023-09-24)
1 parent 703a4f1 commit 258a160

File tree

406 files changed

+35166
-49156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

406 files changed

+35166
-49156
lines changed

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
# opencv 4.7.0-1
1+
# opencv 4.8.0-1
22

3-
- mingw-w64-i686-intel-tbb-1~2020.2-2-any.pkg.tar.xz
43
- mingw-w64-i686-libjpeg-turbo-2.0.5-9000-any.pkg.tar.xz
54
- mingw-w64-i686-zlib-1.2.11-9100-any.pkg.tar.xz
65
- mingw-w64-i686-libpng-1.6.37-9100-any.pkg.tar.xz
7-
- mingw-w64-i686-libtiff-4.2.0-9600-any.pkg.tar.xz
6+
- mingw-w64-i686-libtiff-4.5.1-9600-any.pkg.tar.xz
87
- mingw-w64-i686-giflib-5.1.4-1-any.pkg.tar.xz
9-
- mingw-w64-i686-libwebp-1.1.0-1-any.pkg.tar.xz
10-
- mingw-w64-i686-opencv-4.7.0-1-any.pkg.tar.xz
11-
- mingw-w64-x86_64-intel-tbb-1~2020.2-2-any.pkg.tar.xz
8+
- mingw-w64-i686-libwebp-1.3.2-1-any.pkg.tar.xz
9+
- mingw-w64-i686-opencv-4.8.0-1-any.pkg.tar.xz
1210
- mingw-w64-x86_64-libjpeg-turbo-2.0.5-9000-any.pkg.tar.xz
1311
- mingw-w64-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
1412
- mingw-w64-x86_64-libpng-1.6.37-9100-any.pkg.tar.xz
15-
- mingw-w64-x86_64-libtiff-4.2.0-9600-any.pkg.tar.xz
13+
- mingw-w64-x86_64-libtiff-4.5.1-9600-any.pkg.tar.xz
1614
- mingw-w64-x86_64-giflib-5.1.4-1-any.pkg.tar.xz
17-
- mingw-w64-x86_64-libwebp-1.1.0-1-any.pkg.tar.xz
18-
- mingw-w64-x86_64-opencv-4.7.0-1-any.pkg.tar.xz
19-
- mingw-w64-ucrt-x86_64-intel-tbb-1~2020.2-2-any.pkg.tar.xz
15+
- mingw-w64-x86_64-libwebp-1.3.2-1-any.pkg.tar.xz
16+
- mingw-w64-x86_64-opencv-4.8.0-1-any.pkg.tar.xz
2017
- mingw-w64-ucrt-x86_64-libjpeg-turbo-2.0.5-9000-any.pkg.tar.xz
2118
- mingw-w64-ucrt-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
2219
- mingw-w64-ucrt-x86_64-libpng-1.6.37-9100-any.pkg.tar.xz
23-
- mingw-w64-ucrt-x86_64-libtiff-4.2.0-9600-any.pkg.tar.xz
20+
- mingw-w64-ucrt-x86_64-libtiff-4.5.1-9600-any.pkg.tar.xz
2421
- mingw-w64-ucrt-x86_64-giflib-5.1.4-1-any.pkg.tar.xz
25-
- mingw-w64-ucrt-x86_64-libwebp-1.1.0-1-any.pkg.tar.xz
26-
- mingw-w64-ucrt-x86_64-opencv-4.7.0-1-any.pkg.tar.xz
22+
- mingw-w64-ucrt-x86_64-libwebp-1.3.2-1-any.pkg.tar.xz
23+
- mingw-w64-ucrt-x86_64-opencv-4.8.0-1-any.pkg.tar.xz

include/opencv4/opencv2/aruco/aruco_calib.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum PatternPositionType {
2626
* (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0).
2727
*
2828
* These pattern points define this coordinate system:
29-
* ![Image with axes drawn](tutorials/images/singlemarkersaxes.jpg)
29+
* ![Image with axes drawn](tutorials/images/singlemarkersaxes2.jpg)
3030
*/
3131
ARUCO_CCW_CENTER,
3232
/** @brief The marker coordinate system is centered on the top-left corner of the marker.
@@ -36,7 +36,7 @@ enum PatternPositionType {
3636
* (markerLength, markerLength, 0), (0, markerLength, 0).
3737
*
3838
* These pattern points define this coordinate system:
39-
* ![Image with axes drawn](tutorials/images/singlemarkersaxes2.jpg)
39+
* ![Image with axes drawn](tutorials/images/singlemarkersaxes.jpg)
4040
*
4141
* These pattern dots are convenient to use with a chessboard/ChArUco board.
4242
*/

include/opencv4/opencv2/calib3d.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,13 @@ enum RobotWorldHandEyeCalibrationMethod
548548
CALIB_ROBOT_WORLD_HAND_EYE_LI = 1 //!< Simultaneous robot-world and hand-eye calibration using dual-quaternions and kronecker product @cite Li2010SimultaneousRA
549549
};
550550

551-
enum SamplingMethod { SAMPLING_UNIFORM, SAMPLING_PROGRESSIVE_NAPSAC, SAMPLING_NAPSAC,
552-
SAMPLING_PROSAC };
553-
enum LocalOptimMethod {LOCAL_OPTIM_NULL, LOCAL_OPTIM_INNER_LO, LOCAL_OPTIM_INNER_AND_ITER_LO,
554-
LOCAL_OPTIM_GC, LOCAL_OPTIM_SIGMA};
555-
enum ScoreMethod {SCORE_METHOD_RANSAC, SCORE_METHOD_MSAC, SCORE_METHOD_MAGSAC, SCORE_METHOD_LMEDS};
556-
enum NeighborSearchMethod { NEIGH_FLANN_KNN, NEIGH_GRID, NEIGH_FLANN_RADIUS };
551+
enum SamplingMethod { SAMPLING_UNIFORM=0, SAMPLING_PROGRESSIVE_NAPSAC=1, SAMPLING_NAPSAC=2,
552+
SAMPLING_PROSAC=3 };
553+
enum LocalOptimMethod {LOCAL_OPTIM_NULL=0, LOCAL_OPTIM_INNER_LO=1, LOCAL_OPTIM_INNER_AND_ITER_LO=2,
554+
LOCAL_OPTIM_GC=3, LOCAL_OPTIM_SIGMA=4};
555+
enum ScoreMethod {SCORE_METHOD_RANSAC=0, SCORE_METHOD_MSAC=1, SCORE_METHOD_MAGSAC=2, SCORE_METHOD_LMEDS=3};
556+
enum NeighborSearchMethod { NEIGH_FLANN_KNN=0, NEIGH_GRID=1, NEIGH_FLANN_RADIUS=2 };
557+
enum PolishingMethod { NONE_POLISHER=0, LSQ_POLISHER=1, MAGSAC=2, COV_POLISHER=3 };
557558

558559
struct CV_EXPORTS_W_SIMPLE UsacParams
559560
{ // in alphabetical order
@@ -569,6 +570,8 @@ struct CV_EXPORTS_W_SIMPLE UsacParams
569570
CV_PROP_RW SamplingMethod sampler;
570571
CV_PROP_RW ScoreMethod score;
571572
CV_PROP_RW double threshold;
573+
CV_PROP_RW PolishingMethod final_polisher;
574+
CV_PROP_RW int final_polisher_iterations;
572575
};
573576

574577
/** @brief Converts a rotation matrix to a rotation vector or vice versa.

include/opencv4/opencv2/core.hpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ enum KmeansFlags {
230230
enum ReduceTypes { REDUCE_SUM = 0, //!< the output is the sum of all rows/columns of the matrix.
231231
REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix.
232232
REDUCE_MAX = 2, //!< the output is the maximum (column/row-wise) of all rows/columns of the matrix.
233-
REDUCE_MIN = 3 //!< the output is the minimum (column/row-wise) of all rows/columns of the matrix.
233+
REDUCE_MIN = 3, //!< the output is the minimum (column/row-wise) of all rows/columns of the matrix.
234+
REDUCE_SUM2 = 4 //!< the output is the sum of all squared rows/columns of the matrix.
234235
};
235236

236237
//! @} core_array
@@ -571,6 +572,14 @@ independently for each channel.
571572
*/
572573
CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);
573574

575+
/** @brief Checks for the presence of at least one non-zero array element.
576+
577+
The function returns whether there are non-zero elements in src
578+
@param src single-channel array.
579+
@sa mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix
580+
*/
581+
CV_EXPORTS_W bool hasNonZero( InputArray src );
582+
574583
/** @brief Counts non-zero array elements.
575584
576585
The function returns the number of non-zero elements in src :
@@ -903,7 +912,7 @@ The function #reduce reduces the matrix to a vector by treating the matrix rows/
903912
1D vectors and performing the specified operation on the vectors until a single row/column is
904913
obtained. For example, the function can be used to compute horizontal and vertical projections of a
905914
raster image. In case of #REDUCE_MAX and #REDUCE_MIN , the output image should have the same type as the source one.
906-
In case of #REDUCE_SUM and #REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.
915+
In case of #REDUCE_SUM, #REDUCE_SUM2 and #REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.
907916
And multi-channel arrays are also supported in these two reduction modes.
908917
909918
The following code demonstrates its usage for a single channel matrix.

include/opencv4/opencv2/core/bindings_utils.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,33 @@ struct CV_EXPORTS_W_SIMPLE ClassWithKeywordProperties {
243243
}
244244
};
245245

246+
struct CV_EXPORTS_W_PARAMS FunctionParams
247+
{
248+
CV_PROP_RW int lambda = -1;
249+
CV_PROP_RW float sigma = 0.0f;
250+
251+
FunctionParams& setLambda(int value) CV_NOEXCEPT
252+
{
253+
lambda = value;
254+
return *this;
255+
}
256+
257+
FunctionParams& setSigma(float value) CV_NOEXCEPT
258+
{
259+
sigma = value;
260+
return *this;
261+
}
262+
};
263+
264+
CV_WRAP static inline String
265+
copyMatAndDumpNamedArguments(InputArray src, OutputArray dst,
266+
const FunctionParams& params = FunctionParams())
267+
{
268+
src.copyTo(dst);
269+
return format("lambda=%d, sigma=%.1f", params.lambda,
270+
params.sigma);
271+
}
272+
246273
namespace nested {
247274
CV_WRAP static inline bool testEchoBooleanFunction(bool flag) {
248275
return flag;

include/opencv4/opencv2/core/cuda.hpp

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,29 @@ The function does not reallocate memory if the matrix has proper attributes alre
567567
*/
568568
CV_EXPORTS_W void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr);
569569

570+
/** @brief Bindings overload to create a GpuMat from existing GPU memory.
571+
@param rows Row count.
572+
@param cols Column count.
573+
@param type Type of the matrix.
574+
@param cudaMemoryAddress Address of the allocated GPU memory on the device. This does not allocate matrix data. Instead, it just initializes the matrix header that points to the specified \a cudaMemoryAddress, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
575+
@param step Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to Mat::AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See GpuMat::elemSize.
576+
@note Overload for generation of bindings only, not exported or intended for use internally from C++.
577+
*/
578+
CV_EXPORTS_W GpuMat inline createGpuMatFromCudaMemory(int rows, int cols, int type, size_t cudaMemoryAddress, size_t step = Mat::AUTO_STEP) {
579+
return GpuMat(rows, cols, type, reinterpret_cast<void*>(cudaMemoryAddress), step);
580+
};
581+
582+
/** @overload
583+
@param size 2D array size: Size(cols, rows). In the Size() constructor, the number of rows and the number of columns go in the reverse order.
584+
@param type Type of the matrix.
585+
@param cudaMemoryAddress Address of the allocated GPU memory on the device. This does not allocate matrix data. Instead, it just initializes the matrix header that points to the specified \a cudaMemoryAddress, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
586+
@param step Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to Mat::AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See GpuMat::elemSize.
587+
@note Overload for generation of bindings only, not exported or intended for use internally from C++.
588+
*/
589+
CV_EXPORTS_W inline GpuMat createGpuMatFromCudaMemory(Size size, int type, size_t cudaMemoryAddress, size_t step = Mat::AUTO_STEP) {
590+
return GpuMat(size, type, reinterpret_cast<void*>(cudaMemoryAddress), step);
591+
};
592+
570593
/** @brief BufferPool for use with CUDA streams
571594
572595
BufferPool utilizes Stream's allocator to create new buffers for GpuMat's. It is
@@ -609,8 +632,8 @@ Below is an example that utilizes BufferPool with StackAllocator:
609632
GpuMat d_src2 = pool2.getBuffer(1024, 1024, CV_8UC1); // 1MB
610633
GpuMat d_dst2 = pool2.getBuffer(1024, 1024, CV_8UC3); // 3MB
611634
612-
cvtColor(d_src1, d_dst1, CV_GRAY2BGR, 0, stream1);
613-
cvtColor(d_src2, d_dst2, CV_GRAY2BGR, 0, stream2);
635+
cvtColor(d_src1, d_dst1, cv::COLOR_GRAY2BGR, 0, stream1);
636+
cvtColor(d_src2, d_dst2, cv::COLOR_GRAY2BGR, 0, stream2);
614637
}
615638
@endcode
616639
@@ -675,8 +698,8 @@ and the corresponding memory is automatically returned to the pool for later usa
675698
d_src1.setTo(Scalar(i), stream1);
676699
d_src2.setTo(Scalar(i), stream2);
677700
678-
cvtColor(d_src1, d_dst1, CV_GRAY2BGR, 0, stream1);
679-
cvtColor(d_src2, d_dst2, CV_GRAY2BGR, 0, stream2);
701+
cvtColor(d_src1, d_dst1, cv::COLOR_GRAY2BGR, 0, stream1);
702+
cvtColor(d_src2, d_dst2, cv::COLOR_GRAY2BGR, 0, stream2);
680703
// The order of destruction of the local variables is:
681704
// d_dst2 => d_src2 => d_dst1 => d_src1
682705
// LIFO rule is satisfied, this code runs without error
@@ -921,6 +944,13 @@ class CV_EXPORTS_W Stream
921944
friend class DefaultDeviceInitializer;
922945
};
923946

947+
948+
/** @brief Bindings overload to create a Stream object from the address stored in an existing CUDA Runtime API stream pointer (cudaStream_t).
949+
@param cudaStreamMemoryAddress Memory address stored in a CUDA Runtime API stream pointer (cudaStream_t). The created Stream object does not perform any allocation or deallocation and simply wraps existing raw CUDA Runtime API stream pointer.
950+
@note Overload for generation of bindings only, not exported or intended for use internally from C++.
951+
*/
952+
CV_EXPORTS_W Stream wrapStream(size_t cudaStreamMemoryAddress);
953+
924954
class CV_EXPORTS_W Event
925955
{
926956
public:

include/opencv4/opencv2/core/cvdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ Cv64suf;
459459
#define CV_EXPORTS_W_SIMPLE CV_EXPORTS
460460
#define CV_EXPORTS_AS(synonym) CV_EXPORTS
461461
#define CV_EXPORTS_W_MAP CV_EXPORTS
462+
#define CV_EXPORTS_W_PARAMS CV_EXPORTS
462463
#define CV_IN_OUT
463464
#define CV_OUT
464465
#define CV_PROP

include/opencv4/opencv2/core/eigen.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
#include "opencv2/core.hpp"
5353

5454
#if defined _MSC_VER && _MSC_VER >= 1200
55+
#ifndef NOMINMAX
5556
#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548
57+
#endif
5658
#pragma warning( disable: 4714 ) //__forceinline is not inlined
5759
#pragma warning( disable: 4127 ) //conditional expression is constant
5860
#pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data

include/opencv4/opencv2/core/fast_math.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ CV_INLINE int cvIsInf( double value )
306306
#elif defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) || defined(__PPC64__) || defined(__loongarch64)
307307
Cv64suf ieee754;
308308
ieee754.f = value;
309-
return (ieee754.u & 0x7fffffff00000000) ==
309+
return (ieee754.u & 0x7fffffffffffffff) ==
310310
0x7ff0000000000000;
311311
#else
312312
Cv64suf ieee754;

0 commit comments

Comments
 (0)