@@ -794,6 +794,13 @@ class CV_EXPORTS Mat
794
794
*/
795
795
Mat (int ndims, const int * sizes, int type);
796
796
797
+ /* * @overload
798
+ @param sizes Array of integers specifying an n-dimensional array shape.
799
+ @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
800
+ CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
801
+ */
802
+ Mat (const std::vector<int >& sizes, int type);
803
+
797
804
/* * @overload
798
805
@param ndims Array dimensionality.
799
806
@param sizes Array of integers specifying an n-dimensional array shape.
@@ -805,6 +812,17 @@ class CV_EXPORTS Mat
805
812
*/
806
813
Mat (int ndims, const int * sizes, int type, const Scalar& s);
807
814
815
+ /* * @overload
816
+ @param sizes Array of integers specifying an n-dimensional array shape.
817
+ @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
818
+ CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
819
+ @param s An optional value to initialize each matrix element with. To set all the matrix elements to
820
+ the particular value after the construction, use the assignment operator
821
+ Mat::operator=(const Scalar& value) .
822
+ */
823
+ Mat (const std::vector<int >& sizes, int type, const Scalar& s);
824
+
825
+
808
826
/* * @overload
809
827
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
810
828
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
@@ -861,6 +879,20 @@ class CV_EXPORTS Mat
861
879
*/
862
880
Mat (int ndims, const int * sizes, int type, void * data, const size_t * steps=0 );
863
881
882
+ /* * @overload
883
+ @param sizes Array of integers specifying an n-dimensional array shape.
884
+ @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
885
+ CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
886
+ @param data Pointer to the user data. Matrix constructors that take data and step parameters do not
887
+ allocate matrix data. Instead, they just initialize the matrix header that points to the specified
888
+ data, which means that no data is copied. This operation is very efficient and can be used to
889
+ process external data using OpenCV functions. The external data is not automatically deallocated, so
890
+ you should take care of it.
891
+ @param steps Array of ndims-1 steps in case of a multi-dimensional array (the last step is always
892
+ set to the element size). If not specified, the matrix is assumed to be continuous.
893
+ */
894
+ Mat (const std::vector<int >& sizes, int type, void * data, const size_t * steps=0 );
895
+
864
896
/* * @overload
865
897
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
866
898
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
@@ -1328,6 +1360,12 @@ class CV_EXPORTS Mat
1328
1360
*/
1329
1361
void create (int ndims, const int * sizes, int type);
1330
1362
1363
+ /* * @overload
1364
+ @param sizes Array of integers specifying a new array shape.
1365
+ @param type New matrix type.
1366
+ */
1367
+ void create (const std::vector<int >& sizes, int type);
1368
+
1331
1369
/* * @brief Increments the reference counter.
1332
1370
1333
1371
The method increments the reference counter associated with the matrix data. If the matrix header
@@ -2273,6 +2311,7 @@ class CV_EXPORTS UMat
2273
2311
void create (int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
2274
2312
void create (Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
2275
2313
void create (int ndims, const int * sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
2314
+ void create (const std::vector<int >& sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
2276
2315
2277
2316
// ! increases the reference counter; use with care to avoid memleaks
2278
2317
void addref ();
0 commit comments