Struct opencv::core::Mat [] [src]

pub struct Mat {
    pub ptr: *mut c_void,
}

Fields

ptr

Methods

impl Mat

fn as_raw_Mat(&self) -> *mut c_void

impl Mat

fn new() -> Result<Mat, String>

default constructor

fn new_rows_cols(rows: i32, cols: i32, _type: i32) -> Result<Mat, String>

constructs 2D matrix of the specified size and type

fn new_size(size: Size, _type: i32) -> Result<Mat, String>

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

constucts 2D matrix and fills it with the specified value _s.

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

fn copy(m: &Mat) -> Result<Mat, String>

copy constructor

fn rowscols(m: &Mat, rowRange: &Range, colRange: &Range) -> Result<Mat, String>

creates a matrix header for a part of the bigger matrix

default value for arguments: - colRange: default Range::all()

fn rect(m: &Mat, roi: Rect) -> Result<Mat, String>

fn ranges(m: &Mat, ranges: &Range) -> Result<Mat, String>

fn row(&self, y: i32) -> Result<Mat, String>

returns a new matrix header for the specified row

fn col(&self, x: i32) -> Result<Mat, String>

returns a new matrix header for the specified column

fn rowbounds(&self, startrow: i32, endrow: i32) -> Result<Mat, String>

... for the specified row span

fn rowRange(&self, r: &Range) -> Result<Mat, String>

fn colbounds(&self, startcol: i32, endcol: i32) -> Result<Mat, String>

... for the specified column span

fn colrange(&self, r: &Range) -> Result<Mat, String>

fn diag(&self, d: i32) -> Result<Mat, String>

... for the specified diagonal

default value for arguments: - d: default 0

fn diag_new_mat(&mut self, d: &Mat) -> Result<Mat, String>

constructs a square diagonal matrix which main diagonal is vector "d"

fn clone(&self) -> Result<Mat, String>

returns deep copy of the matrix, i.e. the data is copied

fn copy_to(&self, m: &Mat) -> Result<(), String>

copies the matrix content to "m".

fn copy_to_masked(&self, m: &Mat, mask: &Mat) -> Result<(), String>

copies those matrix elements to "m" that are marked with non-zero mask elements.

fn convert_to(&self, m: &Mat, rtype: i32, alpha: f64, beta: f64) -> Result<(), String>

converts matrix to another datatype with optional scalng. See cvConvertScale.

default value for arguments: - alpha: default 1 - beta: default 0

fn assign_to(&self, m: &Mat, _type: i32) -> Result<(), String>

fault value for arguments: - _type: default -1

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

sets some of the matrix elements to s, according to the mask

default value for arguments: - mask: default noArray()

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

creates alternative matrix header for the same data, with different

default value for arguments: - rows: default 0

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

computes cross-product of 2 3D vectors

fn dot(&self, m: &Mat) -> Result<f64, String>

computes dot-product

fn addref(&mut self) -> Result<(), String>

increases the reference counter; use with care to avoid memleaks

fn release(&mut self) -> Result<(), String>

decreases reference counter;

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

deallocates the matrix data

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

internal use function; properly re-allocates _size, _step arrays

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

reserves enough space to fit sz hyper-planes

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

resizes matrix to the specified number of hyper-planes

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

resizes matrix to the specified number of hyper-planes; initializes the newly added elements

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

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

removes several hyper-planes from bottom of the matrix

default value for arguments: - nelems: default 1

fn locate_roi(&self, wholeSize: Size, ofs: Point) -> Result<(), String>

locates matrix header within a parent matrix. See below

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

moves/resizes the current matrix ROI inside the parent matrix.

fn is_continuous(&self) -> Result<bool, String>

returns true iff the matrix data is continuous

fn is_submatrix(&self) -> Result<bool, String>

returns true if the matrix is a submatrix of another matrix

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

returns element size in bytes,

fn elem_size1(&self) -> Result<size_t, String>

returns the size of element channel in bytes.

fn typ(&self) -> Result<i32, String>

returns element type, similar to CV_MAT_TYPE(cvmat->type)

fn depth(&self) -> Result<i32, String>

returns element type, similar to CV_MAT_DEPTH(cvmat->type)

fn channels(&self) -> Result<i32, String>

returns element type, similar to CV_MAT_CN(cvmat->type)

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

returns step/elemSize1()

default value for arguments: - i: default 0

fn empty(&self) -> Result<bool, String>

returns true if matrix data is NULL

fn total(&self) -> Result<size_t, String>

returns the total number of matrix elements

fn check_vector(&self, elemChannels: i32, depth: i32, requireContinuous: bool) -> Result<i32, String>

returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise

default value for arguments: - depth: default -1 - requireContinuous: default true

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

returns pointer to i0-th submatrix along the dimension #0

default value for arguments: - i0: default 0

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

returns pointer to (i0,i1) submatrix along the dimensions #0 and #1

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

returns pointer to (i0,i1,i3) submatrix along the dimensions #0, #1, #2

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

Trait Implementations

impl Drop for Mat

fn drop(&mut self)