Search Results for

    Show / Hide Table of Contents

    Class Mat

    Represents a multi-channel matrix.

    Inheritance
    Object
    CVHandle
    Arr
    Mat
    Inherited Members
    Arr.ElementType
    Arr.Size
    Arr.GetSubRect(Rect)
    Arr.GetRow(Int32)
    Arr.GetRows(Int32, Int32, Int32)
    Arr.GetCol(Int32)
    Arr.GetCols(Int32, Int32)
    Arr.GetDiag(Int32)
    Arr.GetDims(Int32[])
    Arr.GetDimSize(Int32)
    Arr.Ptr(Int32)
    Arr.Ptr(Int32, Int32)
    Arr.Ptr(Int32, Int32)
    Arr.Ptr(Int32, Int32, Int32)
    Arr.Ptr(Int32, Int32, Int32)
    Arr.Ptr(Int32, Int32, Int32, Int32)
    Arr.Ptr(Int32[])
    Arr.Ptr(Int32[], Int32, Boolean)
    Arr.Item[Int32]
    Arr.Item[Int32, Int32]
    Arr.Item[Int32, Int32, Int32]
    Arr.Item[Int32[]]
    Arr.GetReal(Int32)
    Arr.GetReal(Int32, Int32)
    Arr.GetReal(Int32, Int32, Int32)
    Arr.GetReal(Int32[])
    Arr.SetReal(Int32, Double)
    Arr.SetReal(Int32, Int32, Double)
    Arr.SetReal(Int32, Int32, Int32, Double)
    Arr.SetReal(Int32[], Double)
    Arr.ClearND(Int32[])
    Arr.GetMat(Boolean)
    Arr.GetImage()
    Arr.Reshape(Int32, Int32)
    Arr.SetData(IntPtr, Int32)
    Arr.GetRawData(IntPtr)
    Arr.GetRawData(IntPtr, Int32)
    Arr.GetRawData(IntPtr, Int32, Size)
    Arr.Set(Scalar, Arr)
    Arr.SetZero()
    Arr.CheckRange(CheckArrayFlags, Double, Double)
    Namespace: OpenCV.Net
    Assembly: OpenCV.Net.dll
    Syntax
    public class Mat : Arr

    Constructors

    | Improve this Doc View Source

    Mat(Size, Depth, Int32)

    Initializes a new instance of the Mat class with the specified size, element bit depth and channels per element.

    Declaration
    public Mat(Size size, Depth depth, int channels)
    Parameters
    Type Name Description
    Size size

    The pixel-accurate size of the Mat.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per element.

    | Improve this Doc View Source

    Mat(Size, Depth, Int32, IntPtr, Int32)

    Initializes a new instance of the Mat class with the specified size, element bit depth and channels per element. A pointer to the matrix raw data is provided as well as the optional full row length step size in bytes.

    Declaration
    public Mat(Size size, Depth depth, int channels, IntPtr data, int step = null)
    Parameters
    Type Name Description
    Size size

    The pixel-accurate size of the Mat.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    IntPtr data

    A pointer to the matrix raw element data.

    Int32 step

    The full row length in bytes.

    | Improve this Doc View Source

    Mat(Int32, Int32, Depth, Int32)

    Initializes a new instance of the Mat class with the specified number of rows and cols, element bit depth and channels per element.

    Declaration
    public Mat(int rows, int cols, Depth depth, int channels)
    Parameters
    Type Name Description
    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per element.

    | Improve this Doc View Source

    Mat(Int32, Int32, Depth, Int32, IntPtr, Int32)

    Initializes a new instance of the Mat class with the specified number of rows and cols, element bit depth and channels per element. A pointer to the matrix raw data is provided as well as the optional full row length step size in bytes.

    Declaration
    public Mat(int rows, int cols, Depth depth, int channels, IntPtr data, int step = null)
    Parameters
    Type Name Description
    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    IntPtr data

    A pointer to the matrix raw element data.

    Int32 step

    The full row length in bytes.

    Fields

    | Improve this Doc View Source

    AutoStep

    A constant passed to the Mat constructor which specifies that no padding exists between subsequent rows of the matrix.

    Declaration
    public const int AutoStep = null
    Field Value
    Type Description
    Int32

    Properties

    | Improve this Doc View Source

    Channels

    Gets the number of channels per matrix element.

    Declaration
    public int Channels { get; }
    Property Value
    Type Description
    Int32
    | Improve this Doc View Source

    Cols

    Gets the number of columns in the matrix.

    Declaration
    public int Cols { get; }
    Property Value
    Type Description
    Int32
    | Improve this Doc View Source

    Data

    Gets a pointer to the aligned matrix data.

    Declaration
    public IntPtr Data { get; }
    Property Value
    Type Description
    IntPtr
    | Improve this Doc View Source

    Depth

    Gets the bit depth of matrix elements.

    Declaration
    public Depth Depth { get; }
    Property Value
    Type Description
    Depth
    | Improve this Doc View Source

    ElementSize

    Gets the size of each matrix element in bytes.

    Declaration
    public int ElementSize { get; }
    Property Value
    Type Description
    Int32
    | Improve this Doc View Source

    Rows

    Gets the number of rows in the matrix.

    Declaration
    public int Rows { get; }
    Property Value
    Type Description
    Int32
    | Improve this Doc View Source

    Step

    Gets the full row length in bytes.

    Declaration
    public int Step { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    Clone()

    Creates a new Mat that is a copy of the current instance.

    Declaration
    public Mat Clone()
    Returns
    Type Description
    Mat

    A new Mat that is a copy of this instance. Step may differ.

    | Improve this Doc View Source

    CreateMatHeader(Byte[])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(byte[] data)
    Parameters
    Type Name Description
    Byte[] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Byte[,])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(byte[, ] data)
    Parameters
    Type Name Description
    Byte[,] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Double[])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(double[] data)
    Parameters
    Type Name Description
    Double[] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Double[,])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(double[, ] data)
    Parameters
    Type Name Description
    Double[,] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Int16[])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(short[] data)
    Parameters
    Type Name Description
    Int16[] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Int16[,])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(short[, ] data)
    Parameters
    Type Name Description
    Int16[,] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Int32[])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(int[] data)
    Parameters
    Type Name Description
    Int32[] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Int32[,])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(int[, ] data)
    Parameters
    Type Name Description
    Int32[,] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Single[])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(float[] data)
    Parameters
    Type Name Description
    Single[] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(Single[,])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(float[, ] data)
    Parameters
    Type Name Description
    Single[,] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(UInt16[])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(ushort[] data)
    Parameters
    Type Name Description
    UInt16[] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader(UInt16[,])

    Initializes a new instance of the Mat class that is a wrapper header for the specified data. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader(ushort[, ] data)
    Parameters
    Type Name Description
    UInt16[,] data

    The array to be wrapped.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data.

    | Improve this Doc View Source

    CreateMatHeader<TData>(TData[], Int32, Int32, Depth, Int32)

    Initializes a new instance of the Mat class that is a wrapper header around data with the specified number of rows and cols, element bit depth and channels per element. The reference to data will be pinned in the garbage collector until the matrix header is released.

    Declaration
    public static Mat CreateMatHeader<TData>(TData[] data, int rows, int cols, Depth depth, int channels)
        where TData : struct
    Parameters
    Type Name Description
    TData[] data

    The array to be wrapped.

    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per element.

    Returns
    Type Description
    Mat

    A new Mat instance that is a wrapper header around data with the specified number of rows and cols, element bit depth and channels per element.

    Type Parameters
    Name Description
    TData

    The type of elements in the data array.

    | Improve this Doc View Source

    Eye(Size, Depth, Int32)

    Initializes a new Mat with ones on the main diagonal and zeros elsewhere. The matrix will have the specified size, element bit depth and channels per element.

    Declaration
    public static Mat Eye(Size size, Depth depth, int channels)
    Parameters
    Type Name Description
    Size size

    The pixel-accurate size of the Mat.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    Returns
    Type Description
    Mat

    A new Mat instance with ones on the main diagonal and zeros elsewhere.

    | Improve this Doc View Source

    Eye(Int32, Int32, Depth, Int32)

    Initializes a new Mat with ones on the main diagonal and zeros elsewhere. The matrix will have the specified number of rows and cols, element bit depth and channels per element.

    Declaration
    public static Mat Eye(int rows, int cols, Depth depth, int channels)
    Parameters
    Type Name Description
    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    Returns
    Type Description
    Mat

    A new Mat instance with ones on the main diagonal and zeros elsewhere.

    | Improve this Doc View Source

    FromArray(Byte[])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(byte[] data)
    Parameters
    Type Name Description
    Byte[] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Byte[,])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(byte[, ] data)
    Parameters
    Type Name Description
    Byte[,] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Double[])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(double[] data)
    Parameters
    Type Name Description
    Double[] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Double[,])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(double[, ] data)
    Parameters
    Type Name Description
    Double[,] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Int16[])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(short[] data)
    Parameters
    Type Name Description
    Int16[] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Int16[,])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(short[, ] data)
    Parameters
    Type Name Description
    Int16[,] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Int32[])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(int[] data)
    Parameters
    Type Name Description
    Int32[] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Int32[,])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(int[, ] data)
    Parameters
    Type Name Description
    Int32[,] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Single[])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(float[] data)
    Parameters
    Type Name Description
    Single[] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(Single[,])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(float[, ] data)
    Parameters
    Type Name Description
    Single[,] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(UInt16[])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(ushort[] data)
    Parameters
    Type Name Description
    UInt16[] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray(UInt16[,])

    Initializes a new instance of the Mat class that is a copy of the specified managed array data.

    Declaration
    public static Mat FromArray(ushort[, ] data)
    Parameters
    Type Name Description
    UInt16[,] data

    The array that is to be converted to a Mat.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array.

    | Improve this Doc View Source

    FromArray<TData>(TData[], Int32, Int32, Depth, Int32)

    Initializes a new instance of the Mat class that is a copy of the data array with the specified number of rows and cols, element bit depth and channels per element.

    Declaration
    public static Mat FromArray<TData>(TData[] data, int rows, int cols, Depth depth, int channels)
        where TData : struct
    Parameters
    Type Name Description
    TData[] data

    The array to be wrapped.

    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per element.

    Returns
    Type Description
    Mat

    A new Mat instance that is a copy of the data array with the specified number of rows and cols, element bit depth and channels per element.

    Type Parameters
    Name Description
    TData

    The type of elements in the data array.

    | Improve this Doc View Source

    Ones(Size, Depth, Int32)

    Initializes a new Mat with all elements set to one and the specified size, element bit depth and channels per element.

    Declaration
    public static Mat Ones(Size size, Depth depth, int channels)
    Parameters
    Type Name Description
    Size size

    The pixel-accurate size of the Mat.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    Returns
    Type Description
    Mat

    A new Mat instance with all its elements set to one.

    | Improve this Doc View Source

    Ones(Int32, Int32, Depth, Int32)

    Initializes a new Mat with all elements set to one and the specified number of rows and cols, element bit depth and channels per element.

    Declaration
    public static Mat Ones(int rows, int cols, Depth depth, int channels)
    Parameters
    Type Name Description
    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    Returns
    Type Description
    Mat

    A new Mat instance with all its elements set to one.

    | Improve this Doc View Source

    ReleaseHandle()

    Executes the code required to free the native Mat handle.

    Declaration
    protected override bool ReleaseHandle()
    Returns
    Type Description
    Boolean

    true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false.

    | Improve this Doc View Source

    ToString()

    Creates a representation of this Mat instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A containing the rows, columns, depth and number of channels of this Mat instance.

    | Improve this Doc View Source

    Zeros(Size, Depth, Int32)

    Initializes a new Mat with all elements set to zero and the specified size, element bit depth and channels per element.

    Declaration
    public static Mat Zeros(Size size, Depth depth, int channels)
    Parameters
    Type Name Description
    Size size

    The pixel-accurate size of the Mat.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    Returns
    Type Description
    Mat

    A new Mat instance with all its elements set to zero.

    | Improve this Doc View Source

    Zeros(Int32, Int32, Depth, Int32)

    Initializes a new Mat with all elements set to zero and the specified number of rows and cols, element bit depth and channels per element.

    Declaration
    public static Mat Zeros(int rows, int cols, Depth depth, int channels)
    Parameters
    Type Name Description
    Int32 rows

    The number of rows in the matrix.

    Int32 cols

    The number of columns in the matrix.

    Depth depth

    The bit depth of matrix elements.

    Int32 channels

    The number of channels per matrix element.

    Returns
    Type Description
    Mat

    A new Mat instance with all its elements set to zero.

    Operators

    | Improve this Doc View Source

    Addition(Mat, Mat)

    Calculates the per-element sum of two Mat values.

    Declaration
    public static Mat operator +(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The first value to add.

    Mat right

    The second value to add.

    Returns
    Type Description
    Mat

    The result of adding left and right.

    | Improve this Doc View Source

    Addition(Mat, Scalar)

    Calculates the per-element sum of a Mat and a Scalar.

    Declaration
    public static Mat operator +(Mat left, Scalar right)
    Parameters
    Type Name Description
    Mat left

    The matrix to add.

    Scalar right

    The scalar to add.

    Returns
    Type Description
    Mat

    The result of adding left and right.

    | Improve this Doc View Source

    Addition(Mat, Double)

    Calculates the per-element sum of a Mat and a value.

    Declaration
    public static Mat operator +(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix to add.

    Double right

    The scalar value to add.

    Returns
    Type Description
    Mat

    The result of adding left and right.

    | Improve this Doc View Source

    Addition(Scalar, Mat)

    Calculates the per-element sum of a Scalar and a Mat.

    Declaration
    public static Mat operator +(Scalar left, Mat right)
    Parameters
    Type Name Description
    Scalar left

    The scalar to add.

    Mat right

    The matrix to add.

    Returns
    Type Description
    Mat

    The result of adding left and right.

    | Improve this Doc View Source

    Addition(Double, Mat)

    Calculates the per-element sum of a value and a Mat.

    Declaration
    public static Mat operator +(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar value to add.

    Mat right

    The matrix to add.

    Returns
    Type Description
    Mat

    The result of adding left and right.

    | Improve this Doc View Source

    BitwiseAnd(Mat, Mat)

    Performs per-element bit-wise conjunction of two Mat values.

    Declaration
    public static Mat operator &(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The first matrix value.

    Mat right

    The second matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise conjunction of left and right.

    | Improve this Doc View Source

    BitwiseAnd(Mat, Scalar)

    Performs per-element bit-wise conjunction of a Mat and a Scalar.

    Declaration
    public static Mat operator &(Mat left, Scalar right)
    Parameters
    Type Name Description
    Mat left

    The matrix value.

    Scalar right

    The scalar value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise conjunction of left and right.

    | Improve this Doc View Source

    BitwiseAnd(Mat, Double)

    Performs per-element bit-wise conjunction of a Mat and a value.

    Declaration
    public static Mat operator &(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix value.

    Double right

    The scalar value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise conjunction of left and right.

    | Improve this Doc View Source

    BitwiseAnd(Scalar, Mat)

    Performs per-element bit-wise conjunction of a Scalar and a Mat.

    Declaration
    public static Mat operator &(Scalar left, Mat right)
    Parameters
    Type Name Description
    Scalar left

    The scalar value.

    Mat right

    The matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise conjunction of left and right.

    | Improve this Doc View Source

    BitwiseAnd(Double, Mat)

    Performs per-element bit-wise conjunction of a value and a Mat.

    Declaration
    public static Mat operator &(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar value.

    Mat right

    The matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise conjunction of left and right.

    | Improve this Doc View Source

    BitwiseOr(Mat, Mat)

    Performs per-element bit-wise disjunction of two Mat values.

    Declaration
    public static Mat operator |(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The first matrix value.

    Mat right

    The second matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise disjunction of left and right.

    | Improve this Doc View Source

    BitwiseOr(Mat, Scalar)

    Performs per-element bit-wise disjunction of a Mat and a Scalar.

    Declaration
    public static Mat operator |(Mat left, Scalar right)
    Parameters
    Type Name Description
    Mat left

    The matrix value.

    Scalar right

    The scalar value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise disjunction of left and right.

    | Improve this Doc View Source

    BitwiseOr(Mat, Double)

    Performs per-element bit-wise disjunction of a Mat and a value.

    Declaration
    public static Mat operator |(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix value.

    Double right

    The scalar value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise disjunction of left and right.

    | Improve this Doc View Source

    BitwiseOr(Scalar, Mat)

    Performs per-element bit-wise disjunction of a Scalar and a Mat.

    Declaration
    public static Mat operator |(Scalar left, Mat right)
    Parameters
    Type Name Description
    Scalar left

    The scalar value.

    Mat right

    The matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise disjunction of left and right.

    | Improve this Doc View Source

    BitwiseOr(Double, Mat)

    Performs per-element bit-wise disjunction of a value and a Mat.

    Declaration
    public static Mat operator |(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar value.

    Mat right

    The matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise disjunction of left and right.

    | Improve this Doc View Source

    Division(Mat, Mat)

    Calculates the per-element division of two Mat values.

    Declaration
    public static Mat operator /(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The dividend.

    Mat right

    The divisor.

    Returns
    Type Description
    Mat

    The result of dividing left by right.

    | Improve this Doc View Source

    Division(Mat, Double)

    Calculates the per-element division of a Mat by a scalar value.

    Declaration
    public static Mat operator /(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix dividend.

    Double right

    The scalar divisor.

    Returns
    Type Description
    Mat

    The result of dividing left by right.

    | Improve this Doc View Source

    Division(Double, Mat)

    Calculates the per-element division of a scalar value by a Mat.

    Declaration
    public static Mat operator /(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar dividend.

    Mat right

    The matrix divisor.

    Returns
    Type Description
    Mat

    The result of dividing left by right.

    | Improve this Doc View Source

    ExclusiveOr(Mat, Mat)

    Performs per-element bit-wise "exclusive or" operation on two Mat values.

    Declaration
    public static Mat operator ^(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The first matrix value.

    Mat right

    The second matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise "exclusive or" operation of left and right.

    | Improve this Doc View Source

    ExclusiveOr(Mat, Scalar)

    Performs per-element bit-wise "exclusive or" operation of a Mat and a Scalar.

    Declaration
    public static Mat operator ^(Mat left, Scalar right)
    Parameters
    Type Name Description
    Mat left

    The matrix value.

    Scalar right

    The scalar value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise "exclusive or" operation of left and right.

    | Improve this Doc View Source

    ExclusiveOr(Mat, Double)

    Performs per-element bit-wise "exclusive or" operation of a Mat and a value.

    Declaration
    public static Mat operator ^(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix value.

    Double right

    The scalar value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise "exclusive or" operation of left and right.

    | Improve this Doc View Source

    ExclusiveOr(Scalar, Mat)

    Performs per-element bit-wise "exclusive or" operation of a Scalar and a Mat.

    Declaration
    public static Mat operator ^(Scalar left, Mat right)
    Parameters
    Type Name Description
    Scalar left

    The scalar value.

    Mat right

    The matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise "exclusive or" operation of left and right.

    | Improve this Doc View Source

    ExclusiveOr(Double, Mat)

    Performs per-element bit-wise "exclusive or" operation of a value and a Mat.

    Declaration
    public static Mat operator ^(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar value.

    Mat right

    The matrix value.

    Returns
    Type Description
    Mat

    The result of performing the bit-wise "exclusive or" operation of left and right.

    | Improve this Doc View Source

    Explicit(Mat to IplImage)

    Converts a Mat value to a IplImage.

    Declaration
    public static explicit operator IplImage(Mat mat)
    Parameters
    Type Name Description
    Mat mat

    The matrix to convert.

    Returns
    Type Description
    IplImage

    A IplImage value of the same size and element type.

    | Improve this Doc View Source

    Multiply(Mat, Mat)

    Calculates the per-element product of two Mat values.

    Declaration
    public static Mat operator *(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The first value to multiply.

    Mat right

    The second value to multiply.

    Returns
    Type Description
    Mat

    The result of multiplying left by right.

    | Improve this Doc View Source

    Multiply(Mat, Double)

    Calculates the per-element product of a Mat by a scalar value.

    Declaration
    public static Mat operator *(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix to multiply.

    Double right

    The scalar value to multiply.

    Returns
    Type Description
    Mat

    The result of multiplying left by right.

    | Improve this Doc View Source

    Multiply(Double, Mat)

    Calculates the per-element product of a scalar value by a Mat.

    Declaration
    public static Mat operator *(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar value to multiply.

    Mat right

    The matrix to multiply.

    Returns
    Type Description
    Mat

    The result of multiplying left by right.

    | Improve this Doc View Source

    OnesComplement(Mat)

    Performs per-element bit-wise inversion of the specified Mat value.

    Declaration
    public static Mat operator ~(Mat mat)
    Parameters
    Type Name Description
    Mat mat

    The matrix to invert.

    Returns
    Type Description
    Mat

    The result of bitwise inverting mat.

    | Improve this Doc View Source

    Subtraction(Mat, Mat)

    Calculates the per-element difference between two Mat values.

    Declaration
    public static Mat operator -(Mat left, Mat right)
    Parameters
    Type Name Description
    Mat left

    The minuend.

    Mat right

    The subtrahend.

    Returns
    Type Description
    Mat

    The result of subtracting right from left.

    | Improve this Doc View Source

    Subtraction(Mat, Scalar)

    Calculates the per-element difference between a Mat and a Scalar.

    Declaration
    public static Mat operator -(Mat left, Scalar right)
    Parameters
    Type Name Description
    Mat left

    The matrix minuend.

    Scalar right

    The scalar subtrahend.

    Returns
    Type Description
    Mat

    The result of subtracting right from left.

    | Improve this Doc View Source

    Subtraction(Mat, Double)

    Calculates the per-element difference between a Mat and a value.

    Declaration
    public static Mat operator -(Mat left, double right)
    Parameters
    Type Name Description
    Mat left

    The matrix minuend.

    Double right

    The scalar subtrahend.

    Returns
    Type Description
    Mat

    The result of subtracting right from left.

    | Improve this Doc View Source

    Subtraction(Scalar, Mat)

    Subtracts every element of the specified Mat value from a Scalar.

    Declaration
    public static Mat operator -(Scalar left, Mat right)
    Parameters
    Type Name Description
    Scalar left

    The scalar minuend.

    Mat right

    The matrix subtrahend.

    Returns
    Type Description
    Mat

    The result of subtracting right from left.

    | Improve this Doc View Source

    Subtraction(Double, Mat)

    Subtracts every element of the specified Mat value from a value.

    Declaration
    public static Mat operator -(double left, Mat right)
    Parameters
    Type Name Description
    Double left

    The scalar minuend.

    Mat right

    The matrix subtrahend.

    Returns
    Type Description
    Mat

    The result of subtracting right from left.

    | Improve this Doc View Source

    UnaryNegation(Mat)

    Negates the specified Mat value.

    Declaration
    public static Mat operator -(Mat mat)
    Parameters
    Type Name Description
    Mat mat

    The matrix to negate.

    Returns
    Type Description
    Mat

    The result of mat multiplied by negative one (-1).

    | Improve this Doc View Source

    UnaryPlus(Mat)

    Returns the Mat value (the sign is unchanged).

    Declaration
    public static Mat operator +(Mat mat)
    Parameters
    Type Name Description
    Mat mat

    The matrix to return.

    Returns
    Type Description
    Mat

    The matrix mat.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX