#include <opencv2/gapi/own/mat.hpp>
|
| | Mat ()=default |
| |
| | Mat (const std::vector< int > &_dims, int _type, void *_data) |
| |
| | Mat (int _rows, int _cols, int _type, void *_data, size_t _step=AUTO_STEP) |
| |
| | Mat (Mat &&)=default |
| |
| | Mat (Mat const &)=default |
| |
| | Mat (Mat const &src, const Rect &roi) |
| |
| | Mat (std::vector< int > &&_dims, int _type, void *_data) |
| |
| int | channels () const |
| | 返回矩陣通道數。
|
| |
| Mat | clone () const |
| | 建立矩陣及其底層資料的完整副本。
|
| |
| void | copyTo (Mat &dst) const |
| | 將矩陣複製到另一個矩陣。
|
| |
| void | create (const std::vector< int > &_dims, int _type) |
| |
| void | create (int _rows, int _cols, int _type) |
| |
| void | create (Size _size, int _type) |
| |
| int | depth () const |
| | 返回矩陣元素的深度。
|
| |
| size_t | elemSize () const |
| | 返回矩陣元素大小(位元組)。
|
| |
| bool | empty () const |
| | double getTickFrequency()
|
| |
| Mat | operator() (const Rect &roi) const |
| |
| Mat & | operator= (const Scalar &s) |
| | 將所有或部分陣列元素設定為指定值。
|
| |
| Mat & | operator= (Mat &&)=default |
| |
| Mat & | operator= (Mat const &)=default |
| |
| uchar * | ptr (int row, int col=0) |
| | 返回指向指定矩陣行的指標。
|
| |
| const uchar * | ptr (int row, int col=0) const |
| |
| size_t | total () const |
| | 返回陣列元素的總數。
|
| |
| int | type () const |
| | 返回矩陣元素的型別。
|
| |
◆ Mat() [1/7]
| cv::gapi::own::Mat::Mat |
( |
| ) |
|
|
default |
◆ Mat() [2/7]
| cv::gapi::own::Mat::Mat |
( |
int | _rows, |
|
|
int | _cols, |
|
|
int | _type, |
|
|
void * | _data, |
|
|
size_t | _step = AUTO_STEP ) |
|
inline |
這是一個過載成員函式,為方便起見提供。它與上述函式的唯一區別在於它接受的引數。
- 引數
-
| _rows | 二維陣列中的行數。 |
| _cols | 二維陣列中的列數。 |
| _type | 陣列型別。使用 CV_8UC1, ..., CV_64FC4 建立 1-4 通道矩陣,或使用 CV_8UC(n), ..., CV_64FC(n) 建立多通道(最多 CV_CN_MAX 通道)矩陣。 |
| _data | 指向使用者資料的指標。接受資料和步長引數的矩陣建構函式不分配矩陣資料。相反,它們只是初始化指向指定資料的矩陣頭,這意味著不復制任何資料。此操作非常高效,可用於使用 OpenCV 函式處理外部資料。外部資料不會自動釋放,因此您應該自行處理。 |
| _step | 矩陣每行佔用的位元組數。該值應包括每行末尾的填充位元組(如果有)。如果引數缺失(設定為 AUTO_STEP),則不假定填充,實際步長計算為 cols*elemSize()。請參閱 Mat::elemSize。 |
◆ Mat() [3/7]
| cv::gapi::own::Mat::Mat |
( |
const std::vector< int > & | _dims, |
|
|
int | _type, |
|
|
void * | _data ) |
|
inline |
◆ Mat() [4/7]
| cv::gapi::own::Mat::Mat |
( |
std::vector< int > && | _dims, |
|
|
int | _type, |
|
|
void * | _data ) |
|
inline |
◆ Mat() [5/7]
| cv::gapi::own::Mat::Mat |
( |
Mat const & | src, |
|
|
const Rect & | roi ) |
|
inline |
◆ Mat() [6/7]
| cv::gapi::own::Mat::Mat |
( |
Mat const & | | ) |
|
|
default |
◆ Mat() [7/7]
| cv::gapi::own::Mat::Mat |
( |
Mat && | | ) |
|
|
default |
◆ channels()
| int cv::gapi::own::Mat::channels |
( |
| ) |
const |
|
inline |
返回矩陣通道數。
該方法返回矩陣的通道數。如果矩陣是 N 維的,則返回 -1。
◆ clone()
| Mat cv::gapi::own::Mat::clone |
( |
| ) |
const |
|
inline |
建立矩陣及其底層資料的完整副本。
該方法建立矩陣的完整副本。不考慮原始的 step[]。因此,副本具有一個連續緩衝區,佔用 total() * elemSize() 位元組。
◆ copyTo()
| void cv::gapi::own::Mat::copyTo |
( |
Mat & | dst | ) |
const |
|
inline |
將矩陣複製到另一個矩陣。
該方法將矩陣資料複製到另一個矩陣。在複製資料之前,該方法呼叫
m.create(this->size(), this->
type());
int type() const
返回矩陣元素的型別。
定義 mat.hpp:195
以便在需要時重新分配目標矩陣。儘管 m.copyTo(m); 完美執行,但該函式不處理源矩陣和目標矩陣之間部分重疊的情況。
◆ create() [1/3]
| void cv::gapi::own::Mat::create |
( |
const std::vector< int > & | _dims, |
|
|
int | _type ) |
|
inline |
◆ create() [2/3]
| void cv::gapi::own::Mat::create |
( |
int | _rows, |
|
|
int | _cols, |
|
|
int | _type ) |
|
inline |
- 引數
-
| _rows | 新行數。 |
| _cols | 新列數。 |
| _type | 新矩陣型別。 |
◆ create() [3/3]
| void cv::gapi::own::Mat::create |
( |
Size | _size, |
|
|
int | _type ) |
|
inline |
這是一個過載成員函式,為方便起見提供。它與上述函式的唯一區別在於它接受的引數。
- 引數
-
◆ depth()
| int cv::gapi::own::Mat::depth |
( |
| ) |
const |
|
inline |
返回矩陣元素的深度。
該方法返回矩陣元素深度(每個獨立通道的型別)的識別符號。例如,對於 16 位有符號元素陣列,該方法返回 CV_16S。完整的矩陣型別列表包含以下值
- CV_8U - 8 位無符號整數 (0..255)
- CV_8S - 8 位有符號整數 (-128..127)
- CV_16U - 16 位無符號整數 (0..65535)
- CV_16S - 16 位有符號整數 (-32768..32767)
- CV_32S - 32 位有符號整數 (-2147483648..2147483647)
- CV_32F - 32 位浮點數 ( -FLT_MAX..FLT_MAX, INF, NAN )
- CV_64F - 64 位浮點數 ( -DBL_MAX..DBL_MAX, INF, NAN )
◆ elemSize()
| size_t cv::gapi::own::Mat::elemSize |
( |
| ) |
const |
|
inline |
返回矩陣元素大小(位元組)。
該方法返回矩陣元素的位元組大小。例如,如果矩陣型別為 CV_16SC3,該方法返回 3*sizeof(short) 或 6。
◆ empty()
| bool cv::gapi::own::Mat::empty |
( |
| ) |
const |
|
inline |
◆ operator()()
| Mat cv::gapi::own::Mat::operator() |
( |
const Rect & | roi | ) |
const |
|
inline |
這是一個過載成員函式,為方便起見提供。它與上述函式的唯一區別在於它接受的引數。
- 引數
-
◆ operator=() [1/3]
| Mat & cv::gapi::own::Mat::operator= |
( |
const Scalar & | s | ) |
|
|
inline |
◆ operator=() [2/3]
| Mat & cv::gapi::own::Mat::operator= |
( |
Mat && | | ) |
|
|
default |
◆ operator=() [3/3]
| Mat & cv::gapi::own::Mat::operator= |
( |
Mat const & | | ) |
|
|
default |
◆ ptr() [1/2]
| uchar * cv::gapi::own::Mat::ptr |
( |
int | row, |
|
|
int | col = 0 ) |
|
inline |
返回指向指定矩陣行的指標。
這些方法返回 uchar* 或指向指定矩陣行的型別化指標。請參閱 Mat::isContinuous 中的示例以瞭解如何使用這些方法。
- 引數
-
| row | 沿維度 0 的索引 |
| col | 沿維度 1 的索引 |
◆ ptr() [2/2]
| const uchar * cv::gapi::own::Mat::ptr |
( |
int | row, |
|
|
int | col = 0 ) const |
|
inline |
這是一個過載成員函式,為方便起見提供。它與上述函式的唯一區別在於它接受的引數。
◆ total()
| size_t cv::gapi::own::Mat::total |
( |
| ) |
const |
|
inline |
返回陣列元素的總數。
該方法返回陣列元素的數量(如果陣列表示影像,則為畫素數)。
◆ type()
| int cv::gapi::own::Mat::type |
( |
| ) |
const |
|
inline |
返回矩陣元素的型別。
該方法返回矩陣元素型別。這是一個與 CvMat 型別系統相容的識別符號,例如 CV_16SC3 或 16 位有符號三通道陣列等。
此類的文件由以下檔案生成