Struct opencv::core::Mat

source ·
pub struct Mat { /* private fields */ }
Expand description

n-dimensional dense array class \anchor CVMat_Details

The class Mat represents an n-dimensional dense numerical single-channel or multi-channel array. It can be used to store real or complex-valued vectors and matrices, grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms (though, very high-dimensional histograms may be better stored in a SparseMat ). The data layout of the array M is defined by the array M.step[], so that the address of element inline formula, where inline formula, is computed as: block formula In case of a 2-dimensional array, the above formula is reduced to: block formula Note that M.step[i] >= M.step[i+1] (in fact, M.step[i] >= M.step[i+1]*M.size[i+1] ). This means that 2-dimensional matrices are stored row-by-row, 3-dimensional matrices are stored plane-by-plane, and so on. M.step[M.dims-1] is minimal and always equal to the element size M.elemSize() .

So, the data layout in Mat is compatible with the majority of dense array types from the standard toolkits and SDKs, such as Numpy (ndarray), Win32 (independent device bitmaps), and others, that is, with any array that uses steps (or strides) to compute the position of a pixel. Due to this compatibility, it is possible to make a Mat header for user-allocated data and process it in-place using OpenCV functions.

There are many different ways to create a Mat object. The most popular options are listed below:

  • Use the create(nrows, ncols, type) method or the similar Mat(nrows, ncols, type[, fillValue]) constructor. A new array of the specified size and type is allocated. type has the same meaning as in the cvCreateMat method. For example, CV_8UC1 means a 8-bit single-channel array, CV_32FC2 means a 2-channel (complex) floating-point array, and so on.
   // make a 7x7 complex matrix filled with 1+3j.
   Mat M(7,7,CV_32FC2,Scalar(1,3));
   // and now turn M to a 100x60 15-channel 8-bit matrix.
   // The old content will be deallocated
   M.create(100,60,CV_8UC(15));

As noted in the introduction to this chapter, create() allocates only a new array when the shape or type of the current array are different from the specified ones.

  • Create a multi-dimensional array:
   // create a 100x100x100 8-bit array
   int sz[] = {100, 100, 100};
   Mat bigCube(3, sz, CV_8U, Scalar::all(0));

It passes the number of dimensions =1 to the Mat constructor but the created array will be 2-dimensional with the number of columns set to 1. So, Mat::dims is always >= 2 (can also be 0 when the array is empty).

  • Use a copy constructor or assignment operator where there can be an array or expression on the right side (see below). As noted in the introduction, the array assignment is an O(1) operation because it only copies the header and increases the reference counter. The Mat::clone() method can be used to get a full (deep) copy of the array when you need it.

  • Construct a header for a part of another array. It can be a single row, single column, several rows, several columns, rectangular region in the array (called a minor in algebra) or a diagonal. Such operations are also O(1) because the new header references the same data. You can actually modify a part of the array using this feature, for example:

   // add the 5-th row, multiplied by 3 to the 3rd row
   M.row(3) = M.row(3) + M.row(5)*3;
   // now copy the 7-th column to the 1-st column
   // M.col(1) = M.col(7); // this will not work
   Mat M1 = M.col(1);
   M.col(7).copyTo(M1);
   // create a new 320x240 image
   Mat img(Size(320,240),CV_8UC3);
   // select a ROI
   Mat roi(img, Rect(10,10,100,100));
   // fill the ROI with (0,255,0) (which is green in RGB space);
   // the original 320x240 image will be modified
   roi = Scalar(0,255,0);

Due to the additional datastart and dataend members, it is possible to compute a relative sub-array position in the main container array using locateROI():

   Mat A = Mat::eye(10, 10, CV_32S);
   // extracts A columns, 1 (inclusive) to 3 (exclusive).
   Mat B = A(Range::all(), Range(1, 3));
   // extracts B rows, 5 (inclusive) to 9 (exclusive).
   // that is, C \~ A(Range(5, 9), Range(1, 3))
   Mat C = B(Range(5, 9), Range::all());
   Size size; Point ofs;
   C.locateROI(size, ofs);
   // size will be (width=10,height=10) and the ofs will be (x=1, y=5)

As in case of whole matrices, if you need a deep copy, use the clone() method of the extracted sub-matrices.

  • Make a header for user-allocated data. It can be useful to do the following: -# Process “foreign” data using OpenCV (for example, when you implement a DirectShow* filter or a processing module for gstreamer, and so on). For example:

        Mat process_video_frame(const unsigned char* pixels,
                                 int width, int height, int step)
        {
            // wrap input buffer
            Mat img(height, width, CV_8UC3, (unsigned char*)pixels, step);
    
            Mat result;
            GaussianBlur(img, result, Size(7, 7), 1.5, 1.5);
    
            return result;
        }
    

    -# Quickly initialize small matrices and/or get a super-fast element access.

        double m[3][3] = {{a, b, c}, {d, e, f}, {g, h, i}};
        Mat M = Mat(3, 3, CV_64F, m).inv();
    

    .

  • Use MATLAB-style array initializers, zeros(), ones(), eye(), for example:

   // create a double-precision identity matrix and add it to M.
   M += Mat::eye(M.rows, M.cols, CV_64F);
  • Use a comma-separated initializer:
   // create a 3x3 double-precision identity matrix
   Mat M = (Mat_<double>(3,3) << 1, 0, 0, 0, 1, 0, 0, 0, 1);

With this approach, you first call a constructor of the Mat class with the proper parameters, and then you just put << operator followed by comma-separated values that can be constants, variables, expressions, and so on. Also, note the extra parentheses required to avoid compilation errors.

Once the array is created, it is automatically managed via a reference-counting mechanism. If the array header is built on top of user-allocated data, you should handle the data by yourself. The array data is deallocated when no one points to it. If you want to release the data pointed by a array header before the array destructor is called, use Mat::release().

The next important thing to learn about the array class is element access. This manual already described how to compute an address of each array element. Normally, you are not required to use the formula directly in the code. If you know the array element type (which can be retrieved using the method Mat::type() ), you can access the element inline formula of a 2-dimensional array as:

   M.at<double>(i,j) += 1.f;

assuming that M is a double-precision floating-point array. There are several variants of the method at for a different number of dimensions.

If you need to process a whole row of a 2D array, the most efficient way is to get the pointer to the row first, and then just use the plain C operator [] :

   // compute sum of positive matrix elements
   // (assuming that M is a double-precision matrix)
   double sum=0;
   for(int i = 0; i < M.rows; i++)
   {
       const double* Mi = M.ptr<double>(i);
       for(int j = 0; j < M.cols; j++)
           sum += std::max(Mi[j], 0.);
   }

Some operations, like the one above, do not actually depend on the array shape. They just process elements of an array one by one (or elements from multiple arrays that have the same coordinates, for example, array addition). Such operations are called element-wise. It makes sense to check whether all the input/output arrays are continuous, namely, have no gaps at the end of each row. If yes, process them as a long single row:

   // compute the sum of positive matrix elements, optimized variant
   double sum=0;
   int cols = M.cols, rows = M.rows;
   if(M.isContinuous())
   {
       cols *= rows;
       rows = 1;
   }
   for(int i = 0; i < rows; i++)
   {
       const double* Mi = M.ptr<double>(i);
       for(int j = 0; j < cols; j++)
           sum += std::max(Mi[j], 0.);
   }

In case of the continuous matrix, the outer loop body is executed just once. So, the overhead is smaller, which is especially noticeable in case of small matrices.

Finally, there are STL-style iterators that are smart enough to skip gaps between successive rows:

   // compute sum of positive matrix elements, iterator-based variant
   double sum=0;
   MatConstIterator_<double> it = M.begin<double>(), it_end = M.end<double>();
   for(; it != it_end; ++it)
       sum += std::max(*it, 0.);

The matrix iterators are random-access iterators, so they can be passed to any STL algorithm, including std::sort().

Note: Matrix Expressions and arithmetic see MatExpr

Implementations§

source§

impl Mat

source

pub fn from_exact_iter<T: DataType>( s: impl ExactSizeIterator<Item = T> ) -> Result<Self>

Create new Mat from the iterator of known size

source

pub fn from_slice<T: DataType>(s: &[T]) -> Result<BoxedRef<'_, Self>>

Create a new Mat from a single-dimensional slice

source

pub fn from_slice_mut<T: DataType>(s: &mut [T]) -> Result<BoxedRefMut<'_, Self>>

Create a new Mat from a mutable single-dimensional slice

source

pub fn from_slice_2d<T: DataType>(s: &[impl AsRef<[T]>]) -> Result<Self>

Create a new Mat by copying the data from a slice of slices

Every subslice must have the same length, otherwise an error is returned.

source

pub fn new_rows_cols_with_data<T: DataType>( rows: i32, cols: i32, data: &[T] ) -> Result<BoxedRef<'_, Self>>

Create a new Mat that references a single-dimensional slice with custom shape

source

pub fn new_rows_cols_with_data_mut<T: DataType>( rows: i32, cols: i32, data: &mut [T] ) -> Result<BoxedRefMut<'_, Self>>

Create a new Mat that references a single-dimensional slice with custom shape

source

pub fn new_size_with_data<T: DataType>( size: Size, data: &[T] ) -> Result<BoxedRef<'_, Self>>

Create a new Mat that references a single-dimensional slice with custom shape

source

pub fn new_size_with_data_mut<T: DataType>( size: Size, data: &mut [T] ) -> Result<BoxedRefMut<'_, Self>>

Create a new Mat that references a single-dimensional slice with custom shape

source

pub fn new_nd_with_data<'data, T: DataType>( sizes: &[i32], data: &'data [T] ) -> Result<BoxedRef<'data, Self>>

Create a new Mat that references a single-dimensional slice with custom shape

source

pub fn new_nd_with_data_mut<'data, T: DataType>( sizes: &[i32], data: &'data mut [T] ) -> Result<BoxedRefMut<'data, Self>>

Create a new Mat that references a single-dimensional slice with custom shape

source

pub fn roi_2_mut<MAT: MatTrait>( m: &mut MAT, roi1: Rect, roi2: Rect ) -> Result<(BoxedRefMut<'_, Mat>, BoxedRefMut<'_, Mat>)>

Returns 2 mutable ROIs into a single Mat as long as they do not intersect

source§

impl Mat

source

pub fn default() -> Mat

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

source

pub unsafe fn new_rows_cols(rows: i32, cols: i32, typ: i32) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • rows: Number of rows in a 2D array.
  • cols: Number of columns in a 2D array.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
source

pub unsafe fn new_size(size: Size, typ: i32) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • 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.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
source

pub fn new_rows_cols_with_default( rows: i32, cols: i32, typ: i32, s: Scalar ) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • rows: Number of rows in a 2D array.
  • cols: Number of columns in a 2D array.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • s: An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use the assignment operator Mat::operator=(const Scalar& value) .
source

pub fn new_size_with_default(size: Size, typ: i32, s: Scalar) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • 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.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • s: An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use the assignment operator Mat::operator=(const Scalar& value) .
source

pub unsafe fn new_nd(sizes: &[i32], typ: i32) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • ndims: Array dimensionality.
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
source

pub unsafe fn new_nd_vec(sizes: &Vector<i32>, typ: i32) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
source

pub fn new_nd_with_default(sizes: &[i32], typ: i32, s: Scalar) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • ndims: Array dimensionality.
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • s: An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use the assignment operator Mat::operator=(const Scalar& value) .
source

pub fn new_nd_vec_with_default( sizes: &Vector<i32>, typ: i32, s: Scalar ) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • s: An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use the assignment operator Mat::operator=(const Scalar& value) .
source

pub fn copy(m: &impl MatTraitConst) -> Result<BoxedRef<'_, Mat>>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
source

pub fn copy_mut(m: &mut impl MatTrait) -> Result<BoxedRefMut<'_, Mat>>

@overload

§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
source

pub unsafe fn new_rows_cols_with_data_unsafe( rows: i32, cols: i32, typ: i32, data: *mut c_void, step: size_t ) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • rows: Number of rows in a 2D array.
  • cols: Number of columns in a 2D array.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • 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 AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
§C++ default parameters
  • step: AUTO_STEP
source

pub unsafe fn new_rows_cols_with_data_unsafe_def( rows: i32, cols: i32, typ: i32, data: *mut c_void ) -> Result<Mat>

@overload

§Parameters
  • rows: Number of rows in a 2D array.
  • cols: Number of columns in a 2D array.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • 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 AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
§Note

This alternative version of [new_rows_cols_with_data_unsafe] function uses the following default values for its arguments:

  • step: AUTO_STEP
source

pub unsafe fn new_size_with_data_unsafe( size: Size, typ: i32, data: *mut c_void, step: size_t ) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • 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.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • 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 AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
§C++ default parameters
  • step: AUTO_STEP
source

pub unsafe fn new_size_with_data_unsafe_def( size: Size, typ: i32, data: *mut c_void ) -> Result<Mat>

@overload

§Parameters
  • 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.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • 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 AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
§Note

This alternative version of [new_size_with_data_unsafe] function uses the following default values for its arguments:

  • step: AUTO_STEP
source

pub unsafe fn new_nd_with_data_unsafe( sizes: &[i32], typ: i32, data: *mut c_void, steps: Option<&[size_t]> ) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • ndims: Array dimensionality.
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • steps: Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous.
§C++ default parameters
  • steps: 0
source

pub unsafe fn new_nd_with_data_unsafe_def( sizes: &[i32], typ: i32, data: *mut c_void ) -> Result<Mat>

@overload

§Parameters
  • ndims: Array dimensionality.
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • steps: Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous.
§Note

This alternative version of [new_nd_with_data_unsafe] function uses the following default values for its arguments:

  • steps: 0
source

pub unsafe fn new_nd_vec_with_data_unsafe( sizes: &Vector<i32>, typ: i32, data: *mut c_void, steps: Option<&[size_t]> ) -> Result<Mat>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • steps: Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous.
§C++ default parameters
  • steps: 0
source

pub unsafe fn new_nd_vec_with_data_unsafe_def( sizes: &Vector<i32>, typ: i32, data: *mut c_void ) -> Result<Mat>

@overload

§Parameters
  • sizes: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, 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.
  • steps: Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous.
§Note

This alternative version of [new_nd_vec_with_data_unsafe] function uses the following default values for its arguments:

  • steps: 0
source

pub fn rowscols<'boxed>( m: &'boxed impl MatTraitConst, row_range: &impl RangeTraitConst, col_range: &impl RangeTraitConst ) -> Result<BoxedRef<'boxed, Mat>>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • rowRange: Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. Use Range::all() to take all the rows.
  • colRange: Range of the m columns to take. Use Range::all() to take all the columns.
§C++ default parameters
  • col_range: Range::all()
source

pub fn rowscols_def_mut<'boxed>( m: &'boxed mut impl MatTrait, row_range: &impl RangeTraitConst ) -> Result<BoxedRefMut<'boxed, Mat>>

@overload

§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • rowRange: Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. Use Range::all() to take all the rows.
  • colRange: Range of the m columns to take. Use Range::all() to take all the columns.
§Note

This alternative version of [rowscols] function uses the following default values for its arguments:

  • col_range: Range::all()
source

pub fn rowscols_def<'boxed>( m: &'boxed impl MatTraitConst, row_range: &impl RangeTraitConst ) -> Result<BoxedRef<'boxed, Mat>>

@overload

§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • rowRange: Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. Use Range::all() to take all the rows.
  • colRange: Range of the m columns to take. Use Range::all() to take all the columns.
§Note

This alternative version of [rowscols] function uses the following default values for its arguments:

  • col_range: Range::all()
source

pub fn rowscols_mut<'boxed>( m: &'boxed mut impl MatTrait, row_range: &impl RangeTraitConst, col_range: &impl RangeTraitConst ) -> Result<BoxedRefMut<'boxed, Mat>>

@overload

§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • rowRange: Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. Use Range::all() to take all the rows.
  • colRange: Range of the m columns to take. Use Range::all() to take all the columns.
§C++ default parameters
  • col_range: Range::all()
source

pub fn roi(m: &impl MatTraitConst, roi: Rect) -> Result<BoxedRef<'_, Mat>>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • roi: Region of interest.
source

pub fn roi_mut(m: &mut impl MatTrait, roi: Rect) -> Result<BoxedRefMut<'_, Mat>>

@overload

§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • roi: Region of interest.
source

pub fn ranges<'boxed>( m: &'boxed impl MatTraitConst, ranges: &Vector<Range> ) -> Result<BoxedRef<'boxed, Mat>>

These are various constructors that form a matrix. As noted in the AutomaticAllocation, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced.

§Overloaded parameters
§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • ranges: Array of selected ranges of m along each dimensionality.
source

pub fn ranges_mut<'boxed>( m: &'boxed mut impl MatTrait, ranges: &Vector<Range> ) -> Result<BoxedRefMut<'boxed, Mat>>

@overload

§Parameters
  • m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
  • ranges: Array of selected ranges of m along each dimensionality.
source

pub fn from_gpumat(m: &impl GpuMatTraitConst) -> Result<BoxedRef<'_, Mat>>

download data from GpuMat

source

pub fn from_gpumat_mut(m: &mut impl GpuMatTrait) -> Result<BoxedRefMut<'_, Mat>>

download data from GpuMat

source

pub fn diag_mat(d: &impl MatTraitConst) -> Result<Mat>

creates a diagonal matrix

The method creates a square diagonal matrix from specified main diagonal.

§Parameters
  • d: One-dimensional matrix that represents the main diagonal.
source

pub fn zeros(rows: i32, cols: i32, typ: i32) -> Result<MatExpr>

Returns a zero array of the specified size and type.

The method returns a Matlab-style zero array initializer. It can be used to quickly form a constant array as a function parameter, part of a matrix expression, or as a matrix initializer:

   Mat A;
   A = Mat::zeros(3, 3, CV_32F);

In the example above, a new matrix is allocated only if A is not a 3x3 floating-point matrix. Otherwise, the existing matrix A is filled with zeros.

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
source

pub fn zeros_size(size: Size, typ: i32) -> Result<MatExpr>

Returns a zero array of the specified size and type.

The method returns a Matlab-style zero array initializer. It can be used to quickly form a constant array as a function parameter, part of a matrix expression, or as a matrix initializer:

   Mat A;
   A = Mat::zeros(3, 3, CV_32F);

In the example above, a new matrix is allocated only if A is not a 3x3 floating-point matrix. Otherwise, the existing matrix A is filled with zeros.

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
§Overloaded parameters
  • size: Alternative to the matrix size specification Size(cols, rows) .
  • type: Created matrix type.
source

pub fn zeros_nd(sz: &[i32], typ: i32) -> Result<MatExpr>

Returns a zero array of the specified size and type.

The method returns a Matlab-style zero array initializer. It can be used to quickly form a constant array as a function parameter, part of a matrix expression, or as a matrix initializer:

   Mat A;
   A = Mat::zeros(3, 3, CV_32F);

In the example above, a new matrix is allocated only if A is not a 3x3 floating-point matrix. Otherwise, the existing matrix A is filled with zeros.

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
§Overloaded parameters
  • ndims: Array dimensionality.
  • sz: Array of integers specifying the array shape.
  • type: Created matrix type.
source

pub fn ones(rows: i32, cols: i32, typ: i32) -> Result<MatExpr>

Returns an array of all 1’s of the specified size and type.

The method returns a Matlab-style 1’s array initializer, similarly to Mat::zeros. Note that using this method you can initialize an array with an arbitrary value, using the following Matlab idiom:

   Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3.

The above operation does not form a 100x100 matrix of 1’s and then multiply it by 3. Instead, it just remembers the scale factor (3 in this case) and use it when actually invoking the matrix initializer.

Note: In case of multi-channels type, only the first channel will be initialized with 1’s, the others will be set to 0’s.

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
source

pub fn ones_size(size: Size, typ: i32) -> Result<MatExpr>

Returns an array of all 1’s of the specified size and type.

The method returns a Matlab-style 1’s array initializer, similarly to Mat::zeros. Note that using this method you can initialize an array with an arbitrary value, using the following Matlab idiom:

   Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3.

The above operation does not form a 100x100 matrix of 1’s and then multiply it by 3. Instead, it just remembers the scale factor (3 in this case) and use it when actually invoking the matrix initializer.

Note: In case of multi-channels type, only the first channel will be initialized with 1’s, the others will be set to 0’s.

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
§Overloaded parameters
  • size: Alternative to the matrix size specification Size(cols, rows) .
  • type: Created matrix type.
source

pub fn ones_nd(sz: &[i32], typ: i32) -> Result<MatExpr>

Returns an array of all 1’s of the specified size and type.

The method returns a Matlab-style 1’s array initializer, similarly to Mat::zeros. Note that using this method you can initialize an array with an arbitrary value, using the following Matlab idiom:

   Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3.

The above operation does not form a 100x100 matrix of 1’s and then multiply it by 3. Instead, it just remembers the scale factor (3 in this case) and use it when actually invoking the matrix initializer.

Note: In case of multi-channels type, only the first channel will be initialized with 1’s, the others will be set to 0’s.

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
§Overloaded parameters
  • ndims: Array dimensionality.
  • sz: Array of integers specifying the array shape.
  • type: Created matrix type.
source

pub fn eye(rows: i32, cols: i32, typ: i32) -> Result<MatExpr>

Returns an identity matrix of the specified size and type.

The method returns a Matlab-style identity matrix initializer, similarly to Mat::zeros. Similarly to Mat::ones, you can use a scale operation to create a scaled identity matrix efficiently:

   // make a 4x4 diagonal matrix with 0.1's on the diagonal.
   Mat A = Mat::eye(4, 4, CV_32F)*0.1;

Note: In case of multi-channels type, identity matrix will be initialized only for the first channel, the others will be set to 0’s

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
source

pub fn eye_size(size: Size, typ: i32) -> Result<MatExpr>

Returns an identity matrix of the specified size and type.

The method returns a Matlab-style identity matrix initializer, similarly to Mat::zeros. Similarly to Mat::ones, you can use a scale operation to create a scaled identity matrix efficiently:

   // make a 4x4 diagonal matrix with 0.1's on the diagonal.
   Mat A = Mat::eye(4, 4, CV_32F)*0.1;

Note: In case of multi-channels type, identity matrix will be initialized only for the first channel, the others will be set to 0’s

§Parameters
  • rows: Number of rows.
  • cols: Number of columns.
  • type: Created matrix type.
§Overloaded parameters
  • size: Alternative matrix size specification as Size(cols, rows) .
  • type: Created matrix type.

Trait Implementations§

source§

impl Add<&Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for &Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExprResult<&Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for MatExprResult<Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Mat> for Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &MatExpr) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &MatExpr) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&VecN<f64, 4>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Scalar) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&VecN<f64, 4>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Scalar) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for &Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExprResult<&Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for MatExprResult<Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Mat> for Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExpr) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExpr) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<&Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<&Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<&MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<&MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<&VecN<f64, 4>>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<&Scalar>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<&VecN<f64, 4>>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<&Scalar>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<VecN<f64, 4>>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<Scalar>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<MatExprResult<VecN<f64, 4>>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: MatExprResult<Scalar>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<VecN<f64, 4>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Scalar) -> Self::Output

Performs the + operation. Read more
source§

impl Add<VecN<f64, 4>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Scalar) -> Self::Output

Performs the + operation. Read more
source§

impl Add for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Mat) -> Self::Output

Performs the + operation. Read more
source§

impl Boxed for Mat

source§

unsafe fn from_raw(ptr: <Mat as OpenCVType<'_>>::ExternReceive) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> <Mat as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> <Mat as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> <Mat as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
source§

impl Clone for Mat

source§

fn clone(&self) -> Self

Calls try_clone() and panics if that fails

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Mat

source§

fn default() -> Self

Forwards to infallible Self::default()

source§

impl Div<&Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for &f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExprResult<&f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for MatExprResult<f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&Mat> for f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &MatExpr) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &MatExpr) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&f64> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &f64) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&f64> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &f64) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for &f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExprResult<&f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for MatExprResult<f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<Mat> for f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExpr) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExpr) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<&Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<&Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<&MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<&MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<&f64>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<&f64>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<&f64>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<&f64>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<f64>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<f64>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<MatExprResult<f64>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: MatExprResult<f64>) -> Self::Output

Performs the / operation. Read more
source§

impl Div<f64> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
source§

impl Div<f64> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
source§

impl Div for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Mat) -> Self::Output

Performs the / operation. Read more
source§

impl Drop for Mat

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl ElemMul<&Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for Mat

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: &Mat) -> Self::Output

source§

impl ElemMul<&MatExpr> for &Mat

source§

impl ElemMul<&MatExpr> for Mat

source§

impl ElemMul<Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl ElemMul<MatExpr> for &Mat

source§

impl ElemMul<MatExpr> for Mat

source§

impl ElemMul<MatExprResult<&Mat>> for &Mat

source§

impl ElemMul<MatExprResult<&Mat>> for Mat

source§

impl ElemMul<MatExprResult<&MatExpr>> for &Mat

source§

impl ElemMul<MatExprResult<&MatExpr>> for Mat

source§

impl ElemMul<MatExprResult<Mat>> for &Mat

source§

impl ElemMul<MatExprResult<Mat>> for Mat

source§

impl ElemMul<MatExprResult<MatExpr>> for &Mat

source§

impl ElemMul<MatExprResult<MatExpr>> for Mat

source§

impl ElemMul for Mat

§

type Output = MatExprResult<MatExpr>

source§

fn elem_mul(self, rhs: Mat) -> Self::Output

source§

impl<T: DataType> From<Mat_<T>> for Mat

source§

fn from(s: Mat_<T>) -> Self

Converts to this type from the input type.
source§

impl MatTrait for Mat

source§

fn as_raw_mut_Mat(&mut self) -> *mut c_void

source§

fn set_flags(&mut self, val: i32)

! includes several bit-fields: Read more
source§

fn set_dims(&mut self, val: i32)

the matrix dimensionality, >= 2
source§

fn set_rows(&mut self, val: i32)

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
source§

fn set_cols(&mut self, val: i32)

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
source§

fn data_mut(&mut self) -> *mut u8

pointer to the data
source§

unsafe fn set_data(&mut self, val: *const u8)

pointer to the data
source§

fn u(&mut self) -> UMatData

interaction with UMat
source§

fn set_u(&mut self, val: &impl UMatDataTraitConst)

interaction with UMat
source§

fn set_size(&mut self, val: MatSize)

source§

fn set_matexpr(&mut self, expr: &impl MatExprTraitConst) -> Result<()>

assignment operators Read more
source§

fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified matrix row. Read more
source§

fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified matrix column. Read more
source§

fn row_bounds_mut( &mut self, startrow: i32, endrow: i32 ) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified row span. Read more
source§

fn row_range_mut( &mut self, r: &impl RangeTraitConst ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
source§

fn col_bounds_mut( &mut self, startcol: i32, endcol: i32 ) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified column span. Read more
source§

fn col_range_mut( &mut self, r: &impl RangeTraitConst ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
source§

fn diag_def_mut(&mut self) -> Result<BoxedRefMut<'_, Mat>>

Extracts a diagonal from a matrix Read more
source§

fn diag_mut(&mut self, d: i32) -> Result<BoxedRefMut<'_, Mat>>

Extracts a diagonal from a matrix Read more
source§

fn set_scalar(&mut self, s: Scalar) -> Result<()>

Sets all or some of the array elements to the specified value. Read more
source§

fn set_to( &mut self, value: &impl ToInputArray, mask: &impl ToInputArray ) -> Result<Mat>

Sets all or some of the array elements to the specified value. Read more
source§

fn set_to_def(&mut self, value: &impl ToInputArray) -> Result<Mat>

Sets all or some of the array elements to the specified value. Read more
source§

fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
source§

fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
source§

fn reshape_nd_mut( &mut self, cn: i32, newsz: &[i32] ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
source§

fn reshape_nd_vec_mut( &mut self, cn: i32, newshape: &Vector<i32> ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
source§

unsafe fn create_rows_cols( &mut self, rows: i32, cols: i32, typ: i32 ) -> Result<()>

Allocates new array data if needed. Read more
source§

unsafe fn create_size(&mut self, size: Size, typ: i32) -> Result<()>

Allocates new array data if needed. Read more
source§

unsafe fn create_nd(&mut self, sizes: &[i32], typ: i32) -> Result<()>

Allocates new array data if needed. Read more
source§

unsafe fn create_nd_vec(&mut self, sizes: &Vector<i32>, typ: i32) -> Result<()>

Allocates new array data if needed. Read more
source§

unsafe fn addref(&mut self) -> Result<()>

Increments the reference counter. Read more
source§

unsafe fn release(&mut self) -> Result<()>

Decrements the reference counter and deallocates the matrix if needed. Read more
source§

fn deallocate(&mut self) -> Result<()>

internal use function, consider to use ‘release’ method instead; deallocates the matrix data
source§

fn reserve(&mut self, sz: size_t) -> Result<()>

Reserves space for the certain number of rows. Read more
source§

fn reserve_buffer(&mut self, sz: size_t) -> Result<()>

Reserves space for the certain number of bytes. Read more
source§

fn resize(&mut self, sz: size_t) -> Result<()>

Changes the number of matrix rows. Read more
source§

fn resize_with_default(&mut self, sz: size_t, s: Scalar) -> Result<()>

Changes the number of matrix rows. Read more
source§

fn push_back(&mut self, m: &impl MatTraitConst) -> Result<()>

Adds elements to the bottom of the matrix. Read more
source§

fn pop_back(&mut self, nelems: size_t) -> Result<()>

Removes elements from the bottom of the matrix. Read more
source§

fn pop_back_def(&mut self) -> Result<()>

Removes elements from the bottom of the matrix. Read more
source§

fn adjust_roi( &mut self, dtop: i32, dbottom: i32, dleft: i32, dright: i32 ) -> Result<Mat>

Adjusts a submatrix size and position within the parent matrix. Read more
source§

fn rowscols_mut( &mut self, row_range: impl RangeTrait, col_range: impl RangeTrait ) -> Result<BoxedRefMut<'_, Mat>>

Extracts a rectangular submatrix. Read more
source§

fn roi_mut(&mut self, roi: Rect) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
source§

fn ranges_mut(&mut self, ranges: &Vector<Range>) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
source§

fn ptr_mut(&mut self, i0: i32) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_mut_def(&mut self) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_2d_mut(&mut self, row: i32, col: i32) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_3d_mut(&mut self, i0: i32, i1: i32, i2: i32) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_nd_mut(&mut self, idx: &[i32]) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
source§

fn at_mut<T: DataType>(&mut self, i0: i32) -> Result<&mut T>

Returns a reference to the specified array element. Read more
source§

fn at_2d_mut<T: DataType>(&mut self, row: i32, col: i32) -> Result<&mut T>

Returns a reference to the specified array element. Read more
source§

fn at_3d_mut<T: DataType>( &mut self, i0: i32, i1: i32, i2: i32 ) -> Result<&mut T>

Returns a reference to the specified array element. Read more
source§

fn at_nd_mut<T: DataType>(&mut self, idx: &[i32]) -> Result<&mut T>

Returns a reference to the specified array element. Read more
source§

fn at_pt_mut<T: DataType>(&mut self, pt: Point) -> Result<&mut T>

Returns a reference to the specified array element. Read more
source§

fn set(&mut self, m: Mat) -> Result<()>

source§

fn update_continuity_flag(&mut self) -> Result<()>

internal use method: updates the continuity flag
source§

impl MatTraitConst for Mat

source§

fn as_raw_Mat(&self) -> *const c_void

source§

fn flags(&self) -> i32

! includes several bit-fields: Read more
source§

fn dims(&self) -> i32

the matrix dimensionality, >= 2
source§

fn rows(&self) -> i32

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
source§

fn cols(&self) -> i32

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
source§

fn data(&self) -> *const u8

pointer to the data
source§

fn datastart(&self) -> *const u8

helper fields used in locateROI and adjustROI
source§

fn dataend(&self) -> *const u8

source§

fn datalimit(&self) -> *const u8

source§

fn mat_size(&self) -> MatSize

source§

fn mat_step(&self) -> MatStep

source§

fn get_umat( &self, access_flags: AccessFlag, usage_flags: UMatUsageFlags ) -> Result<UMat>

retrieve UMat from Mat Read more
source§

fn get_umat_def(&self, access_flags: AccessFlag) -> Result<UMat>

retrieve UMat from Mat Read more
source§

fn row(&self, y: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified matrix row. Read more
source§

fn col(&self, x: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified matrix column. Read more
source§

fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified row span. Read more
source§

fn row_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified row span. Read more
source§

fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified column span. Read more
source§

fn col_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified column span. Read more
source§

fn diag(&self, d: i32) -> Result<BoxedRef<'_, Mat>>

Extracts a diagonal from a matrix Read more
source§

fn diag_def(&self) -> Result<BoxedRef<'_, Mat>>

Extracts a diagonal from a matrix Read more
source§

fn try_clone(&self) -> Result<Mat>

Creates a full copy of the array and the underlying data. Read more
source§

fn copy_to(&self, m: &mut impl ToOutputArray) -> Result<()>

Copies the matrix to another one. Read more
source§

fn copy_to_masked( &self, m: &mut impl ToOutputArray, mask: &impl ToInputArray ) -> Result<()>

Copies the matrix to another one. Read more
source§

fn convert_to( &self, m: &mut impl ToOutputArray, rtype: i32, alpha: f64, beta: f64 ) -> Result<()>

Converts an array to another data type with optional scaling. Read more
source§

fn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>

Converts an array to another data type with optional scaling. Read more
source§

fn assign_to(&self, m: &mut impl MatTrait, typ: i32) -> Result<()>

Provides a functional form of convertTo. Read more
source§

fn assign_to_def(&self, m: &mut impl MatTrait) -> Result<()>

Provides a functional form of convertTo. Read more
source§

fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
source§

fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
source§

fn reshape_nd(&self, cn: i32, newsz: &[i32]) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
source§

fn reshape_nd_vec( &self, cn: i32, newshape: &Vector<i32> ) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
source§

fn t(&self) -> Result<MatExpr>

Transposes a matrix. Read more
source§

fn inv(&self, method: i32) -> Result<MatExpr>

Inverses a matrix. Read more
source§

fn inv_def(&self) -> Result<MatExpr>

Inverses a matrix. Read more
source§

fn mul(&self, m: &impl ToInputArray, scale: f64) -> Result<MatExpr>

Performs an element-wise multiplication or division of the two matrices. Read more
source§

fn mul_def(&self, m: &impl ToInputArray) -> Result<MatExpr>

Performs an element-wise multiplication or division of the two matrices. Read more
source§

fn cross(&self, m: &impl ToInputArray) -> Result<Mat>

Computes a cross-product of two 3-element vectors. Read more
source§

fn dot(&self, m: &impl ToInputArray) -> Result<f64>

Computes a dot-product of two vectors. Read more
source§

fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>

Locates the matrix header within a parent matrix. Read more
source§

fn rowscols( &self, row_range: impl RangeTrait, col_range: impl RangeTrait ) -> Result<BoxedRef<'_, Mat>>

Extracts a rectangular submatrix. Read more
source§

fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, Mat>>

Extracts a rectangular submatrix. Read more
source§

fn ranges(&self, ranges: &Vector<Range>) -> Result<BoxedRef<'_, Mat>>

Extracts a rectangular submatrix. Read more
source§

fn is_continuous(&self) -> bool

Reports whether the matrix is continuous or not. Read more
source§

fn is_submatrix(&self) -> bool

returns true if the matrix is a submatrix of another matrix
source§

fn elem_size(&self) -> Result<size_t>

Returns the matrix element size in bytes. Read more
source§

fn elem_size1(&self) -> size_t

Returns the size of each matrix element channel in bytes. Read more
source§

fn typ(&self) -> i32

Returns the type of a matrix element. Read more
source§

fn depth(&self) -> i32

Returns the depth of a matrix element. Read more
source§

fn channels(&self) -> i32

Returns the number of matrix channels. Read more
source§

fn step1(&self, i: i32) -> Result<size_t>

Returns a normalized step. Read more
source§

fn step1_def(&self) -> Result<size_t>

Returns a normalized step. Read more
source§

fn empty(&self) -> bool

Returns true if the array has no elements. Read more
source§

fn total(&self) -> size_t

Returns the total number of array elements. Read more
source§

fn total_slice(&self, start_dim: i32, end_dim: i32) -> Result<size_t>

Returns the total number of array elements. Read more
source§

fn total_slice_def(&self, start_dim: i32) -> Result<size_t>

Returns the total number of array elements. Read more
source§

fn check_vector( &self, elem_channels: i32, depth: i32, require_continuous: bool ) -> Result<i32>

Parameters Read more
source§

fn check_vector_def(&self, elem_channels: i32) -> Result<i32>

Parameters Read more
source§

fn ptr(&self, i0: i32) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_def(&self) -> Result<*const u8>

@overload Read more
source§

fn ptr_2d(&self, row: i32, col: i32) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_3d(&self, i0: i32, i1: i32, i2: i32) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
source§

fn ptr_nd(&self, idx: &[i32]) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
source§

fn at<T: DataType>(&self, i0: i32) -> Result<&T>

Returns a reference to the specified array element. Read more
source§

fn at_2d<T: DataType>(&self, row: i32, col: i32) -> Result<&T>

Returns a reference to the specified array element. Read more
source§

fn at_3d<T: DataType>(&self, i0: i32, i1: i32, i2: i32) -> Result<&T>

Returns a reference to the specified array element. Read more
source§

fn at_nd<T: DataType>(&self, idx: &[i32]) -> Result<&T>

Returns a reference to the specified array element. Read more
source§

fn at_pt<T: DataType>(&self, pt: Point) -> Result<&T>

Returns a reference to the specified array element. Read more
source§

fn size(&self) -> Result<Size>

source§

impl Mul<&Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for &f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExprResult<&f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for MatExprResult<f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&Mat> for f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &MatExpr) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &MatExpr) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&f64> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &f64) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&f64> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &f64) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for &f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExprResult<&f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for MatExprResult<f64>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Mat> for f64

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExpr) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExpr) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<&Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<&Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<&MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<&MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<&f64>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<&f64>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<&f64>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<&f64>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<f64>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<f64>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<MatExprResult<f64>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: MatExprResult<f64>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<f64> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<f64> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
source§

impl Mul for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Mat) -> Self::Output

Performs the * operation. Read more
source§

impl Sub<&Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for &Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExprResult<&Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for MatExprResult<Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&Mat> for Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &MatExpr) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &MatExpr) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&VecN<f64, 4>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Scalar) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&VecN<f64, 4>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Scalar) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for &MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for &Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExpr

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExprResult<&Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExprResult<&MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExprResult<&Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExprResult<Mat>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExprResult<MatExpr>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for MatExprResult<Scalar>

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Mat> for Scalar

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExpr> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExpr) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExpr> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExpr) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<&Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<&Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<&Mat>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<&MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<&MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<&MatExpr>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<&VecN<f64, 4>>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<&Scalar>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<&VecN<f64, 4>>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<&Scalar>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<Mat>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<Mat>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<Mat>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<MatExpr>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<MatExpr>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<MatExpr>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<VecN<f64, 4>>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<Scalar>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<MatExprResult<VecN<f64, 4>>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: MatExprResult<Scalar>) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<VecN<f64, 4>> for &Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Scalar) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<VecN<f64, 4>> for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Scalar) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for Mat

§

type Output = MatExprResult<MatExpr>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Mat) -> Self::Output

Performs the - operation. Read more
source§

impl ToInputArray for &Mat

source§

impl ToInputArray for Mat

source§

impl ToInputOutputArray for &mut Mat

source§

impl ToInputOutputArray for Mat

source§

impl ToOutputArray for &mut Mat

source§

impl ToOutputArray for Mat

source§

impl<T: DataType> TryFrom<Mat> for Mat_<T>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(mat: Mat) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Send for Mat

Auto Trait Implementations§

§

impl Freeze for Mat

§

impl RefUnwindSafe for Mat

§

impl !Sync for Mat

§

impl Unpin for Mat

§

impl UnwindSafe for Mat

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> MatTraitConstManual for T
where T: MatTraitConst + ?Sized,

source§

unsafe fn at_unchecked<T: DataType>(&self, i0: i32) -> Result<&T>

Like Mat::at() but performs no bounds or type checks Read more
source§

unsafe fn at_2d_unchecked<T: DataType>(&self, row: i32, col: i32) -> Result<&T>

Like Mat::at_2d() but performs no bounds or type checks Read more
source§

unsafe fn at_pt_unchecked<T: DataType>(&self, pt: Point) -> Result<&T>

Like Mat::at_pt() but performs no bounds or type checks Read more
source§

unsafe fn at_3d_unchecked<T: DataType>( &self, i0: i32, i1: i32, i2: i32 ) -> Result<&T>

Like Mat::at_3d() but performs no bounds or type checks Read more
source§

unsafe fn at_nd_unchecked<T: DataType>(&self, idx: &[i32]) -> Result<&T>

Like Mat::at_nd() but performs no bounds or type checks Read more
source§

fn at_row<T: DataType>(&self, row: i32) -> Result<&[T]>

Return a complete read-only row
source§

unsafe fn at_row_unchecked<T: DataType>(&self, row: i32) -> Result<&[T]>

Like Mat::at_row() but performs no bounds or type checks Read more
source§

fn is_allocated(&self) -> bool

source§

fn data_bytes(&self) -> Result<&[u8]>

Returns underlying data array as byte slice, Mat must be continuous.
source§

fn data_typed<T: DataType>(&self) -> Result<&[T]>

source§

unsafe fn data_typed_unchecked<T: DataType>(&self) -> Result<&[T]>

Safety Read more
source§

fn to_vec_2d<T: DataType>(&self) -> Result<Vec<Vec<T>>>

source§

fn iter<T: DataType>(&self) -> Result<MatIter<'_, T>>
where Self: Sized,

Returns an iterator over Mat elements and their positions
source§

fn try_into_typed<T: DataType>(self) -> Result<Mat_<T>>
where Self: Sized, Mat_<T>: TryFrom<Self, Error = Error>,

source§

impl<T> MatTraitManual for T
where T: MatTrait + ?Sized,

source§

unsafe fn at_unchecked_mut<T: DataType>(&mut self, i0: i32) -> Result<&mut T>

Like Mat::at_mut() but performs no bounds or type checks Read more
source§

unsafe fn at_2d_unchecked_mut<T: DataType>( &mut self, row: i32, col: i32 ) -> Result<&mut T>

Like Mat::at_2d_mut() but performs no bounds or type checks Read more
source§

unsafe fn at_pt_unchecked_mut<T: DataType>( &mut self, pt: Point ) -> Result<&mut T>

Like Mat::at_pt_mut() but performs no bounds or type checks Read more
source§

unsafe fn at_3d_unchecked_mut<T: DataType>( &mut self, i0: i32, i1: i32, i2: i32 ) -> Result<&mut T>

Like Mat::at_3d_mut() but performs no bounds or type checks Read more
source§

unsafe fn at_nd_unchecked_mut<T: DataType>( &mut self, idx: &[i32] ) -> Result<&mut T>

Like Mat::at_nd_mut() but performs no bounds or type checks Read more
source§

fn at_row_mut<T: DataType>(&mut self, row: i32) -> Result<&mut [T]>

Return a complete writeable row
source§

unsafe fn at_row_unchecked_mut<T: DataType>( &mut self, row: i32 ) -> Result<&mut [T]>

Like Mat::at_row_mut() but performs no bounds or type checks Read more
source§

fn data_bytes_mut(&mut self) -> Result<&mut [u8]>

Returns underlying data array as mutable byte slice, Mat must be continuous.
source§

fn data_typed_mut<T: DataType>(&mut self) -> Result<&mut [T]>

source§

unsafe fn data_typed_unchecked_mut<T: DataType>(&mut self) -> Result<&mut [T]>

Safety Read more
source§

fn iter_mut<T: DataType>(&mut self) -> Result<MatIterMut<'_, T>>
where Self: Sized,

Returns a mutable iterator over Mat elements and their positions
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.