OpenCV
4.5.4
Open Source Computer Vision
|
#include <opencv2/core/cuda.hpp>
Public Types | |
using | IndexArray = std::vector< int > |
using | SizeArray = std::vector< int > |
using | StepArray = std::vector< size_t > |
Public Member Functions | |
GpuMatND () | |
default constructor More... | |
GpuMatND (SizeArray size, int type) | |
GpuMatND (SizeArray size, int type, void *data, StepArray step=StepArray()) | |
GpuMatND (const GpuMatND &)=default | |
GpuMatND (GpuMatND &&) noexcept=default | |
~GpuMatND () | |
destructor More... | |
GpuMatND | clone () const |
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. More... | |
GpuMatND | clone (Stream &stream) const |
void | create (SizeArray size, 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. More... | |
GpuMat | createGpuMatHeader (IndexArray idx, Range rowRange, Range colRange) const |
Creates a GpuMat header for a 2D plane part of an n-dim matrix. More... | |
GpuMat | createGpuMatHeader () const |
void | download (OutputArray dst) const |
void | download (OutputArray dst, Stream &stream) const |
size_t | elemSize () const |
returns element size in bytes More... | |
size_t | elemSize1 () const |
returns the size of element channel in bytes More... | |
bool | empty () const |
returns true if data is null More... | |
bool | external () const |
returns true if not empty and points to external(user-allocated) gpu memory More... | |
uchar * | getDevicePtr () const |
returns pointer to the first byte of the GPU memory More... | |
bool | isContinuous () const |
bool | isSubmatrix () const |
returns true if the matrix is a sub-matrix of another matrix More... | |
operator GpuMat () const | |
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. More... | |
GpuMatND | operator() (const std::vector< Range > &ranges) const |
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. More... | |
GpuMat | operator() (IndexArray idx, Range rowRange, Range colRange) const |
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. More... | |
GpuMatND & | operator= (const GpuMatND &)=default |
GpuMatND & | operator= (GpuMatND &&) noexcept=default |
void | release () |
void | swap (GpuMatND &m) noexcept |
size_t | total () const |
returns the total number of array elements More... | |
size_t | totalMemSize () const |
returns the size of underlying memory in bytes More... | |
int | type () const |
returns element type More... | |
void | upload (InputArray src) |
void | upload (InputArray src, Stream &stream) |
Public Attributes | |
int | dims |
matrix dimensionality More... | |
int | flags |
SizeArray | size |
shape of this array More... | |
StepArray | step |
using cv::cuda::GpuMatND::IndexArray = std::vector<int> |
using cv::cuda::GpuMatND::SizeArray = std::vector<int> |
using cv::cuda::GpuMatND::StepArray = std::vector<size_t> |
cv::cuda::GpuMatND::~GpuMatND | ( | ) |
destructor
cv::cuda::GpuMatND::GpuMatND | ( | ) |
default constructor
cv::cuda::GpuMatND::GpuMatND | ( | SizeArray | size, |
int | type | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
size | 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. |
cv::cuda::GpuMatND::GpuMatND | ( | SizeArray | size, |
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.
size | 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 _size.size()-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. |
|
default |
|
defaultnoexcept |
GpuMatND cv::cuda::GpuMatND::clone | ( | ) | const |
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.
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.
void cv::cuda::GpuMatND::create | ( | SizeArray | size, |
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.
GpuMat cv::cuda::GpuMatND::createGpuMatHeader | ( | IndexArray | idx, |
Range | rowRange, | ||
Range | colRange | ||
) | const |
GpuMat cv::cuda::GpuMatND::createGpuMatHeader | ( | ) | const |
void cv::cuda::GpuMatND::download | ( | OutputArray | dst | ) | const |
void cv::cuda::GpuMatND::download | ( | OutputArray | dst, |
Stream & | stream | ||
) | const |
size_t cv::cuda::GpuMatND::elemSize | ( | ) | const |
returns element size in bytes
size_t cv::cuda::GpuMatND::elemSize1 | ( | ) | const |
returns the size of element channel in bytes
bool cv::cuda::GpuMatND::empty | ( | ) | const |
returns true if data is null
bool cv::cuda::GpuMatND::external | ( | ) | const |
returns true if not empty and points to external(user-allocated) gpu memory
uchar* cv::cuda::GpuMatND::getDevicePtr | ( | ) | const |
returns pointer to the first byte of the GPU memory
bool cv::cuda::GpuMatND::isContinuous | ( | ) | const |
returns true iff the GpuMatND data is continuous (i.e. when there are no gaps between successive rows)
bool cv::cuda::GpuMatND::isSubmatrix | ( | ) | const |
returns true if the matrix is a sub-matrix of another matrix
cv::cuda::GpuMatND::operator GpuMat | ( | ) | const |
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.
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.
ranges | Array of selected ranges along each dimension. |
GpuMat cv::cuda::GpuMatND::operator() | ( | IndexArray | idx, |
Range | rowRange, | ||
Range | colRange | ||
) | const |
void cv::cuda::GpuMatND::release | ( | ) |
|
noexcept |
size_t cv::cuda::GpuMatND::total | ( | ) | const |
returns the total number of array elements
size_t cv::cuda::GpuMatND::totalMemSize | ( | ) | const |
returns the size of underlying memory in bytes
int cv::cuda::GpuMatND::type | ( | ) | const |
returns element type
void cv::cuda::GpuMatND::upload | ( | InputArray | src | ) |
void cv::cuda::GpuMatND::upload | ( | InputArray | src, |
Stream & | stream | ||
) |
int cv::cuda::GpuMatND::dims |
matrix dimensionality
int cv::cuda::GpuMatND::flags |
includes several bit-fields:
SizeArray cv::cuda::GpuMatND::size |
shape of this array
StepArray cv::cuda::GpuMatND::step |
step values Their semantics is identical to the semantics of step for Mat.