OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Static Public Member Functions | List of all members
OpenCVForUnity.UnityUtils.MatUtils Class Reference

Static Public Member Functions

static void copyFromMat (Mat mat, IntPtr intPtr)
 
static void copyToMat (IntPtr intPtr, Mat mat)
 
static void copyFromMat< T > (Mat mat, T[] array)
 
static void copyToMat< T > (T[] array, Mat mat)
 
static void copyFromMat< T > (Mat mat, NativeArray< T > array)
 
static void copyToMat< T > (NativeArray< T > array, Mat mat)
 
static void copyFromMat< T > (Mat mat, Span< T > array)
 
static void copyToMat< T > (Span< T > array, Mat mat)
 

Member Function Documentation

◆ copyFromMat()

static void OpenCVForUnity.UnityUtils.MatUtils.copyFromMat ( Mat  mat,
IntPtr  intPtr 
)
static

Copies OpenCV Mat data to Pixel Data IntPtr.


This method copies the OpenCV Mat data to the pixel data IntPtr.
The pixel data must have the same byte size as the Mat data ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.get().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
mata Mat object.
intPtrthe pixel data must have the same byte size as the Mat data ([total() * elemSize()] byte).

◆ copyFromMat< T >() [1/3]

static void OpenCVForUnity.UnityUtils.MatUtils.copyFromMat< T > ( Mat  mat,
T []  array 
)
static

Copies OpenCV Mat data to Pixel Data Array.


This method copies the OpenCV Mat data to the pixel data Array.
The pixel data Array must have the same byte size as the Mat data ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.get().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
mata Mat object.
arraythe pixel data Array must have the same byte size as the Mat data ([total() * elemSize()] byte).
Type Constraints
T :unmanaged 

◆ copyFromMat< T >() [2/3]

static void OpenCVForUnity.UnityUtils.MatUtils.copyFromMat< T > ( Mat  mat,
NativeArray< T >  array 
)
static

Copies OpenCV Mat data to Pixel Data NativeArray.


This method copies the OpenCV Mat data to the pixel data NativeArray.
The pixel data Array must have the same byte size as the Mat data ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.get().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
mata Mat object.
arraythe pixel data Array must have the same byte size as the Mat data ([total() * elemSize()] byte).
Type Constraints
T :unmanaged 

◆ copyFromMat< T >() [3/3]

static void OpenCVForUnity.UnityUtils.MatUtils.copyFromMat< T > ( Mat  mat,
Span< T >  array 
)
static
  • Copies OpenCV Mat data to Pixel Data NativeArray.

  • This method copies the OpenCV Mat data to the pixel data NativeArray.

  • The pixel data Array must have the same byte size as the Mat data ([total() * elemSize()] byte).

  • Because this method doesn't check bounds, is faster than Mat.get().

  • This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.
  • Parameters
    mata Mat object.
  • Parameters
    arraythe pixel data Array must have the same byte size as the Mat data ([total() * elemSize()] byte).
Type Constraints
T :unmanaged 

◆ copyToMat()

static void OpenCVForUnity.UnityUtils.MatUtils.copyToMat ( IntPtr  intPtr,
Mat  mat 
)
static

Copies Pixel Data IntPtr to OpenCV Mat data.


This method copy the pixel data IntPtr to the OpenCV Mat data.
The Mat object must have the same byte size as the pixel data ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.put().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
intPtra pixel data IntPtr.
matthe Mat object must have the same byte size as the pixel data ([total() * elemSize()] byte).

◆ copyToMat< T >() [1/3]

static void OpenCVForUnity.UnityUtils.MatUtils.copyToMat< T > ( T []  array,
Mat  mat 
)
static

Copies Pixel Data Array to OpenCV Mat data.


This method copies the pixel data Array to the OpenCV Mat data.
The Mat object must have the same byte size as the pixel data Array ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.put().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
arraya pixel data Array.
matthe Mat object must have the same byte size as the pixel data Array ([total() * elemSize()] byte).
Type Constraints
T :unmanaged 

◆ copyToMat< T >() [2/3]

static void OpenCVForUnity.UnityUtils.MatUtils.copyToMat< T > ( NativeArray< T >  array,
Mat  mat 
)
static

Copies Pixel Data NativeArray to OpenCV Mat data.


This method copies the pixel data NativeArray to the OpenCV Mat data.
The Mat object must have the same byte size as the pixel data Array ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.put().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
arraya pixel data Array.
matthe Mat object must have the same byte size as the pixel data Array ([total() * elemSize()] byte).
Type Constraints
T :unmanaged 

◆ copyToMat< T >() [3/3]

static void OpenCVForUnity.UnityUtils.MatUtils.copyToMat< T > ( Span< T >  array,
Mat  mat 
)
static

Copies Pixel Data NativeArray to OpenCV Mat data.


This method copies the pixel data NativeArray to the OpenCV Mat data.
The Mat object must have the same byte size as the pixel data Array ([total() * elemSize()] byte).
Because this method doesn't check bounds, is faster than Mat.put().
This method copies only when mat.isContinuous() is false and mat.dims() = 2. When mat.isContinuous() is true, there is no restriction on the number of mat dimensions.

Parameters
arraya pixel data Array.
matthe Mat object must have the same byte size as the pixel data Array ([total() * elemSize()] byte).
Type Constraints
T :unmanaged 

The documentation for this class was generated from the following file: