Class cv::cuda::GpuMatND#

Collaboration diagram for cv::cuda::GpuMatND:

Member Typedef Documentation#

IndexArray#

typedef std::vector< int > cv::cuda::GpuMatND::IndexArray

SizeArray#

typedef MatShape cv::cuda::GpuMatND::SizeArray

StepArray#

typedef std::vector< size_t > cv::cuda::GpuMatND::StepArray

Constructor & Destructor Documentation#

GpuMatND()#

cv::cuda::GpuMatND::GpuMatND()

default constructor

GpuMatND()#

cv::cuda::GpuMatND::GpuMatND(const GpuMatND &)

GpuMatND()#

cv::cuda::GpuMatND::GpuMatND(
const MatShape & shape,
int type )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  • shape — Array of integers specifying an n-dimensional array shape.

  • type — Array type. Use CV_8UC1, …, CV_16FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.

GpuMatND()#

cv::cuda::GpuMatND::GpuMatND(
const MatShape & shape,
int type,
void * data,
StepArray step = StepArray() )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  • shape — Array of integers specifying an n-dimensional array shape.

  • type — Array type. Use CV_8UC1, …, CV_16FC4 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 — Array of shape.size() or shape.size()-1 steps in case of a multi-dimensional array (if specified, the last step must be equal to the element size, otherwise it will be added as such). If not specified, the matrix is assumed to be continuous.

GpuMatND()#

cv::cuda::GpuMatND::GpuMatND(GpuMatND &&)

~GpuMatND()#

cv::cuda::GpuMatND::~GpuMatND()

destructor

Member Function Documentation#

clone()#

GpuMatND cv::cuda::GpuMatND::clone()

Creates a full copy of the array and the underlying data. The method creates a full copy of the array. It mimics the behavior of Mat::clone(), i.e. the original step is not taken into account. So, the array copy is a continuous array occupying total()*elemSize() bytes.

clone()#

GpuMatND cv::cuda::GpuMatND::clone(Stream & stream)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This overload is non-blocking, so it may return even if the copy operation is not finished.

create()#

void cv::cuda::GpuMatND::create(
const MatShape & shape,
int type )

Allocates GPU memory. Suppose there is some GPU memory already allocated. In that case, this method may choose to reuse that GPU memory under the specific condition: it must be of the same size and type, not externally allocated, the GPU memory is continuous(i.e., isContinuous() is true), and is not a sub-matrix of another GpuMatND (i.e., isSubmatrix() is false). In other words, this method guarantees that the GPU memory allocated by this method is always continuous and is not a sub-region of another GpuMatND.

createGpuMatHeader()#

GpuMat cv::cuda::GpuMatND::createGpuMatHeader()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Creates a GpuMat header if this GpuMatND is effectively 2D.

Note

The returned GpuMat is constructed with the constructor for user-allocated data. That is, It does not perform reference counting.

This function does not increment this GpuMatND’s reference counter.

createGpuMatHeader()#

GpuMat cv::cuda::GpuMatND::createGpuMatHeader(
IndexArray idx,
Range rowRange,
Range colRange )

Creates a GpuMat header for a 2D plane part of an n-dim matrix.

Note

The returned GpuMat is constructed with the constructor for user-allocated data. That is, It does not perform reference counting.

This function does not increment this GpuMatND’s reference counter.

download()#

void cv::cuda::GpuMatND::download(OutputArray dst)

download()#

void cv::cuda::GpuMatND::download(
OutputArray dst,
Stream & stream )

elemSize()#

size_t cv::cuda::GpuMatND::elemSize()

returns element size in bytes

elemSize1()#

size_t cv::cuda::GpuMatND::elemSize1()

returns the size of element channel in bytes

empty()#

bool cv::cuda::GpuMatND::empty()

returns true if data is null

external()#

bool cv::cuda::GpuMatND::external()

returns true if not empty and points to external(user-allocated) gpu memory

fit()#

void cv::cuda::GpuMatND::fit(
const MatShape & shape,
int type )

Allocates or reuses underlying storage to fit the requested n-D size and type.

  • No-op if already compatible (sufficient capacity, continuous, not a submatrix, not external, no ROI).

  • Reallocates otherwise. Mirrors 2D GpuMat::fit semantics for multi-dimensional tensors.

getDevicePtr()#

uchar * cv::cuda::GpuMatND::getDevicePtr()

returns pointer to the first byte of the GPU memory

isContinuous()#

bool cv::cuda::GpuMatND::isContinuous()

returns true iff the GpuMatND data is continuous (i.e. when there are no gaps between successive rows)

isSubmatrix()#

bool cv::cuda::GpuMatND::isSubmatrix()

returns true if the matrix is a sub-matrix of another matrix

operator GpuMat()#

cv::cuda::GpuMatND::operator GpuMat()

Extracts a 2D plane part of an n-dim matrix if this GpuMatND is effectively 2D. It differs from createGpuMatHeader() in that it clones a part of this GpuMatND.

Note

This operator does not increment this GpuMatND’s reference counter;

operator()()#

GpuMatND cv::cuda::GpuMatND::operator()(const std::vector< Range > & ranges)

Extracts a sub-matrix. The operator makes a new header for the specified sub-array of *this. The operator is an O(1) operation, that is, no matrix data is copied.

Parameters

  • ranges — Array of selected ranges along each dimension.

operator()()#

GpuMat cv::cuda::GpuMatND::operator()(
IndexArray idx,
Range rowRange,
Range colRange )

Extracts a 2D plane part of an n-dim matrix. It differs from createGpuMatHeader(IndexArray, Range, Range) in that it clones a part of this GpuMatND to the returned GpuMat.

Note

This operator does not increment this GpuMatND’s reference counter;

operator=()#

GpuMatND & cv::cuda::GpuMatND::operator=(const GpuMatND &)

operator=()#

GpuMatND & cv::cuda::GpuMatND::operator=(GpuMatND &&)

release()#

void cv::cuda::GpuMatND::release()

swap()#

void cv::cuda::GpuMatND::swap(GpuMatND & m)

total()#

size_t cv::cuda::GpuMatND::total()

returns the total number of array elements

totalMemSize()#

size_t cv::cuda::GpuMatND::totalMemSize()

returns the size of underlying memory in bytes

type()#

int cv::cuda::GpuMatND::type()

returns element type

upload()#

void cv::cuda::GpuMatND::upload(InputArray src)

upload()#

void cv::cuda::GpuMatND::upload(
InputArray src,
Stream & stream )

setFields()#

void cv::cuda::GpuMatND::setFields(
MatShape size,
int type,
StepArray step = StepArray() )

internal use

Member Data Documentation#

dims#

int cv::cuda::GpuMatND::dims

matrix dimensionality

flags#

int cv::cuda::GpuMatND::flags

includes several bit-fields:

  • the magic signature

  • continuity flag

  • depth

  • number of channels

size#

MatShape cv::cuda::GpuMatND::size

shape of this array

step#

StepArray cv::cuda::GpuMatND::step

step values Their semantics is identical to the semantics of step for Mat.

data#

uchar * cv::cuda::GpuMatND::data

internal use If this GpuMatND manages memory with reference counting, this value is always equal to data_->data. If this GpuMatND holds external memory, data_ is empty and data points to the external memory.

data_#

std::shared_ptr< GpuData > cv::cuda::GpuMatND::data_

internal use If this GpuMatND holds external memory, this is empty.

offset#

size_t cv::cuda::GpuMatND::offset

internal use If this GpuMatND is a sub-matrix of a larger matrix, this value is the difference of the first byte between the sub-matrix and the whole matrix.

Source file#

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