OpenCV 4.12.0
開源計算機視覺
載入中...
搜尋中...
無匹配項
cv::cuda::GpuMat 類參考

具有引用計數的 GPU 記憶體基儲存類。 更多...

#include <opencv2/core/cuda.hpp>

cv::cuda::GpuMat 協作圖

類  分配器
 

公有成員函式

 GpuMat (const GpuMat &m)
 複製建構函式
 
 GpuMat (const GpuMat &m, Range rowRange, Range colRange)
 為更大矩陣的一部分建立 GpuMat
 
 GpuMat (const GpuMat &m, Rect roi)
 
 GpuMat (GpuMat::Allocator *allocator=GpuMat::defaultAllocator())
 預設建構函式
 
 GpuMat (InputArray arr, GpuMat::Allocator *allocator=GpuMat::defaultAllocator())
 從主機記憶體構建 GpuMat(阻塞呼叫)
 
 GpuMat (int rows, int cols, int type, GpuMat::Allocator *allocator=GpuMat::defaultAllocator())
 構造指定大小和型別的 GpuMat
 
 GpuMat (int rows, int cols, int type, Scalar s, GpuMat::Allocator *allocator=GpuMat::defaultAllocator())
 構造 GpuMat 並用指定值 _s 填充
 
 GpuMat (int rows, int cols, int type, void *data, size_t step=Mat::AUTO_STEP)
 指向使用者分配資料的 GpuMat 頭的建構函式
 
 GpuMat (Size size, int type, GpuMat::Allocator *allocator=GpuMat::defaultAllocator())
 
 GpuMat (Size size, int type, Scalar s, GpuMat::Allocator *allocator=GpuMat::defaultAllocator())
 
 GpuMat (Size size, int type, void *data, size_t step=Mat::AUTO_STEP)
 
 ~GpuMat ()
 解構函式 - 呼叫 release()
 
GpuMatadjustROI (int dtop, int dbottom, int dleft, int dright)
 移動/調整當前 GpuMat ROI 在父 GpuMat 中的大小
 
void assignTo (GpuMat &m, int type=-1) const
 
int channels () const
 返回通道數
 
GpuMat clone () const
 返回 GpuMat 的深複製,即資料被複制
 
GpuMat col (int x) const
 為指定列返回新的 GpuMat
 
GpuMat colRange (int startcol, int endcol) const
 ... for the specified column span
 
GpuMat colRange (Range r) const
 
void convertTo (GpuMat &dst, int rtype) const
 GpuMat 轉換為另一種資料型別的繫結過載(阻塞呼叫)
 
void convertTo (GpuMat &dst, int rtype, double alpha, double beta, Stream &stream) const
 GpuMat 轉換為另一種資料型別並進行縮放的繫結過載(非阻塞呼叫)
 
void convertTo (GpuMat &dst, int rtype, Stream &stream) const
 GpuMat 轉換為另一種資料型別的繫結過載(非阻塞呼叫)
 
void convertTo (OutputArray dst, int rtype) const
 GpuMat 轉換為另一種資料型別(阻塞呼叫)
 
void convertTo (OutputArray dst, int rtype, double alpha, double beta, Stream &stream) const
 GpuMat 轉換為另一種資料型別並進行縮放(非阻塞呼叫)
 
void convertTo (OutputArray dst, int rtype, double alpha, double beta=0.0) const
 GpuMat 轉換為另一種資料型別並進行縮放(阻塞呼叫)
 
void convertTo (OutputArray dst, int rtype, double alpha, Stream &stream) const
 GpuMat 轉換為另一種資料型別並進行縮放的繫結過載(阻塞呼叫)
 
void convertTo (OutputArray dst, int rtype, Stream &stream) const
 GpuMat 轉換為另一種資料型別(非阻塞呼叫)
 
void copyTo (GpuMat &dst) const
 GpuMat 內容複製到裝置記憶體的繫結過載(阻塞呼叫)
 
void copyTo (GpuMat &dst, GpuMat &mask) const
 GpuMat 中標記為非零掩碼元素的那些元素複製到 "m" 的繫結過載(阻塞呼叫)
 
void copyTo (GpuMat &dst, GpuMat &mask, Stream &stream) const
 GpuMat 中標記為非零掩碼元素的那些元素複製到 "m" 的繫結過載(非阻塞呼叫)
 
void copyTo (GpuMat &dst, Stream &stream) const
 GpuMat 內容複製到裝置記憶體的繫結過載(非阻塞呼叫)
 
void copyTo (OutputArray dst) const
 GpuMat 內容複製到裝置記憶體(阻塞呼叫)
 
void copyTo (OutputArray dst, InputArray mask) const
 GpuMat 中標記為非零掩碼元素的那些元素複製到 "m"(阻塞呼叫)
 
void copyTo (OutputArray dst, InputArray mask, Stream &stream) const
 GpuMat 中標記為非零掩碼元素的那些元素複製到 "m"(非阻塞呼叫)
 
void copyTo (OutputArray dst, Stream &stream) const
 GpuMat 內容複製到裝置記憶體(非阻塞呼叫)
 
void create (int rows, int cols, int type)
 分配新的 GpuMat 資料,除非 GpuMat 已具有指定的大小和型別
 
void create (Size size, int type)
 
void * cudaPtr () const
 
int depth () const
 返回元素型別
 
void download (OutputArray dst) const
 GpuMat 執行資料下載(阻塞呼叫)
 
void download (OutputArray dst, Stream &stream) const
 GpuMat 執行資料下載(非阻塞呼叫)
 
size_t elemSize () const
 返回元素的位元組大小
 
size_t elemSize1 () const
 返回元素通道的位元組大小
 
bool empty () const
 如果 GpuMat 資料為 NULL,則返回 true
 
bool isContinuous () const
 
void locateROI (Size &wholeSize, Point &ofs) const
 在父 GpuMat 中定位 GpuMat
 
template<typename _Tp >
 operator PtrStep< _Tp > () const
 
template<typename _Tp >
 operator PtrStepSz< _Tp > () const
 
GpuMat operator() (Range rowRange, Range colRange) const
 提取矩形子 GpuMat(這是 row、rowRange 等的通用形式)
 
GpuMat operator() (Rect roi) const
 
GpuMatoperator= (const GpuMat &m)
 賦值運算子
 
ucharptr (int y=0)
 returns pointer to y-th row
 
template<typename _Tp >
_Tpptr (int y=0)
 template version of the above method
 
const ucharptr (int y=0) const
 
template<typename _Tp >
const _Tpptr (int y=0) const
 
void release ()
 引用計數遞減,當引用計數達到 0 時釋放資料
 
GpuMat reshape (int cn, int rows=0) const
 
GpuMat row (int y) const
 為指定行返回新的 GpuMat
 
GpuMat rowRange (int startrow, int endrow) const
 ... for the specified row span
 
GpuMat rowRange (Range r) const
 
GpuMatsetTo (Scalar s)
 GpuMat 的某些元素設定為 s(阻塞呼叫)
 
GpuMatsetTo (Scalar s, InputArray mask)
 根據掩碼將 GpuMat 的某些元素設定為 s(阻塞呼叫)
 
GpuMatsetTo (Scalar s, InputArray mask, Stream &stream)
 根據掩碼將 GpuMat 的某些元素設定為 s(非阻塞呼叫)
 
GpuMatsetTo (Scalar s, Stream &stream)
 GpuMat 的某些元素設定為 s(非阻塞呼叫)
 
Size size () const
 返回 GpuMat 大小:寬度 == 列數,高度 == 行數
 
size_t step1 () const
 返回 step/elemSize1()
 
void swap (GpuMat &mat)
 與其它智慧指標交換
 
int type () const
 返回元素型別
 
void updateContinuityFlag ()
 內部使用方法:更新連續性標誌
 
void upload (InputArray arr)
 執行資料上傳到 GpuMat(阻塞呼叫)
 
void upload (InputArray arr, Stream &stream)
 執行資料上傳到 GpuMat(非阻塞呼叫)
 

靜態公有成員函式

static GpuMat::AllocatordefaultAllocator ()
 default allocator
 
static GpuMat::AllocatorgetStdAllocator ()
 
static void setDefaultAllocator (GpuMat::Allocator *allocator)
 

公共屬性

Allocator分配器
 分配器
 
int cols
 
uchardata
 指向資料的指標
 
const uchardataend
 
uchardatastart
 用於 locateROI 和 adjustROI 的輔助欄位
 
int flags
 
int * refcount
 
int rows
 行數和列數
 
size_t step
 連續行之間的位元組距離;如果存在間隙,則包括間隙
 

詳細描述

帶引用計數的 GPU 記憶體的基本儲存類。

其介面與 Mat 介面匹配,但有以下限制

  • 不支援任意維度(僅限 2D)
  • 沒有返回對其資料引用的函式(因為 GPU 上的引用對於 CPU 無效)
  • 不支援表示式模板技術

請注意,後一個限制可能導致過載的矩陣運算子引起記憶體分配。 GpuMat 類可轉換為 cuda::PtrStepSz 和 cuda::PtrStep,因此可以直接傳遞給核心。

注意
Mat 不同,在大多數情況下 GpuMat::isContinuous() == false。這意味著行會根據硬體對齊到某個大小。單行 GpuMat 始終是連續矩陣。
不建議保留靜態或全域性 GpuMat 變數已分配(即依賴其解構函式)。這些變數和 CUDA 上下文的銷燬順序是未定義的。如果 CUDA 上下文在此之前已被銷燬,GPU 記憶體釋放函式將返回錯誤。

某些成員函式被描述為“阻塞呼叫”,而另一些則被描述為“非阻塞呼叫”。阻塞函式與主機同步。保證在函式返回時 GPU 操作已完成。然而,非阻塞函式與主機非同步。即使 GPU 操作尚未完成,這些函式也可能返回。

與其阻塞對應項相比,非阻塞函式接受 Stream 作為附加引數。如果傳入非預設流,GPU 操作可能與其他流中的操作重疊。

另請參見
Mat

建構函式 & 解構函式文件

◆ GpuMat() [1/11]

cv::cuda::GpuMat::GpuMat ( GpuMat::Allocator * allocator = GpuMat::defaultAllocator())
顯式
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

預設建構函式

◆ GpuMat() [2/11]

cv::cuda::GpuMat::GpuMat ( int rows,
int cols,
int type,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator() )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

構造指定大小和型別的 GpuMat

◆ GpuMat() [3/11]

cv::cuda::GpuMat::GpuMat ( Size size,
int type,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator() )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

◆ GpuMat() [4/11]

cv::cuda::GpuMat::GpuMat ( int rows,
int cols,
int type,
Scalar s,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator() )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

構造 GpuMat 並用指定值 _s 填充

◆ GpuMat() [5/11]

cv::cuda::GpuMat::GpuMat ( Size size,
int type,
Scalar s,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator() )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

◆ GpuMat() [6/11]

cv::cuda::GpuMat::GpuMat ( const GpuMat & m)
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

複製建構函式

◆ GpuMat() [7/11]

cv::cuda::GpuMat::GpuMat ( int rows,
int cols,
int type,
void * data,
size_t step = Mat::AUTO_STEP )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

指向使用者分配資料的 GpuMat 頭的建構函式

◆ GpuMat() [8/11]

cv::cuda::GpuMat::GpuMat ( Size size,
int type,
void * data,
size_t step = Mat::AUTO_STEP )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

◆ GpuMat() [9/11]

cv::cuda::GpuMat::GpuMat ( const GpuMat & m,
Range rowRange,
Range colRange )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

為更大矩陣的一部分建立 GpuMat

◆ GpuMat() [10/11]

cv::cuda::GpuMat::GpuMat ( const GpuMat & m,
Rect roi )
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

◆ GpuMat() [11/11]

cv::cuda::GpuMat::GpuMat ( InputArray arr,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator() )
顯式
Python
cv.cuda.GpuMat([, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(rows, cols, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(size, type, s[, allocator]) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, rowRange, colRange) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(m, roi) -> <cuda_GpuMat 物件>
cv.cuda.GpuMat(arr[, allocator]) -> <cuda_GpuMat 物件>

從主機記憶體構建 GpuMat(阻塞呼叫)

◆ ~GpuMat()

cv::cuda::GpuMat::~GpuMat ( )

解構函式 - 呼叫 release()

成員函式文件

◆ adjustROI()

GpuMat & cv::cuda::GpuMat::adjustROI ( int dtop,
int dbottom,
int dleft,
int dright )
Python
cv.cuda.GpuMat.adjustROI(dtop, dbottom, dleft, dright) -> retval

移動/調整當前 GpuMat ROI 在父 GpuMat 中的大小

◆ assignTo()

void cv::cuda::GpuMat::assignTo ( GpuMat & m,
int type = -1 ) const
Python
cv.cuda.GpuMat.assignTo(m[, type]) ->

◆ channels()

int cv::cuda::GpuMat::channels ( ) const
Python
cv.cuda.GpuMat.channels() -> retval

返回通道數

◆ clone()

GpuMat cv::cuda::GpuMat::clone ( ) const
Python
cv.cuda.GpuMat.clone() -> retval

返回 GpuMat 的深複製,即資料被複制

◆ col()

GpuMat cv::cuda::GpuMat::col ( int x) const
Python
cv.cuda.GpuMat.col(x) -> retval

為指定列返回新的 GpuMat

◆ colRange() [1/2]

GpuMat cv::cuda::GpuMat::colRange ( int startcol,
int endcol ) const
Python
cv.cuda.GpuMat.colRange(startcol, endcol) -> retval
cv.cuda.GpuMat.colRange(r) -> retval

... for the specified column span

◆ colRange() [2/2]

GpuMat cv::cuda::GpuMat::colRange ( Range r) const
Python
cv.cuda.GpuMat.colRange(startcol, endcol) -> retval
cv.cuda.GpuMat.colRange(r) -> retval

◆ convertTo() [1/8]

void cv::cuda::GpuMat::convertTo ( GpuMat & dst,
int rtype ) const
inline
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別的繫結過載(阻塞呼叫)

◆ convertTo() [2/8]

void cv::cuda::GpuMat::convertTo ( GpuMat & dst,
int rtype,
double alpha,
double beta,
Stream & stream ) const
inline
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別並進行縮放的繫結過載(非阻塞呼叫)

◆ convertTo() [3/8]

void cv::cuda::GpuMat::convertTo ( GpuMat & dst,
int rtype,
Stream & stream ) const
inline
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別的繫結過載(非阻塞呼叫)

◆ convertTo() [4/8]

void cv::cuda::GpuMat::convertTo ( OutputArray dst,
int rtype ) const
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別(阻塞呼叫)

◆ convertTo() [5/8]

void cv::cuda::GpuMat::convertTo ( OutputArray dst,
int rtype,
double alpha,
double beta,
Stream & stream ) const
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別並進行縮放(非阻塞呼叫)

◆ convertTo() [6/8]

void cv::cuda::GpuMat::convertTo ( OutputArray dst,
int rtype,
double alpha,
double beta = 0.0 ) const
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別並進行縮放(阻塞呼叫)

◆ convertTo() [7/8]

void cv::cuda::GpuMat::convertTo ( OutputArray dst,
int rtype,
double alpha,
Stream & stream ) const
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別並進行縮放的繫結過載(阻塞呼叫)

GpuMat 轉換為另一種資料型別並進行縮放(非阻塞呼叫)

◆ convertTo() [8/8]

void cv::cuda::GpuMat::convertTo ( OutputArray dst,
int rtype,
Stream & stream ) const
Python
cv.cuda.GpuMat.convertTo(rtype[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype, stream[, dst]) -> dst
cv.cuda.GpuMat.convertTo(rtype[, dst[, alpha[, beta]]]) -> dst
cv.cuda.GpuMat.convertTo(rtype, alpha, beta, stream[, dst]) -> dst

GpuMat 轉換為另一種資料型別(非阻塞呼叫)

◆ copyTo() [1/8]

void cv::cuda::GpuMat::copyTo ( GpuMat & dst) const
inline
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 內容複製到裝置記憶體的繫結過載(阻塞呼叫)

此函式的呼叫圖如下

◆ copyTo() [2/8]

void cv::cuda::GpuMat::copyTo ( GpuMat & dst,
GpuMat & mask ) const
inline
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 中標記為非零掩碼元素的那些元素複製到 "m" 的繫結過載(阻塞呼叫)

此函式的呼叫圖如下

◆ copyTo() [3/8]

void cv::cuda::GpuMat::copyTo ( GpuMat & dst,
GpuMat & mask,
Stream & stream ) const
inline
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 中標記為非零掩碼元素的那些元素複製到 "m" 的繫結過載(非阻塞呼叫)

此函式的呼叫圖如下

◆ copyTo() [4/8]

void cv::cuda::GpuMat::copyTo ( GpuMat & dst,
Stream & stream ) const
inline
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 內容複製到裝置記憶體的繫結過載(非阻塞呼叫)

此函式的呼叫圖如下

◆ copyTo() [5/8]

void cv::cuda::GpuMat::copyTo ( OutputArray dst) const
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 內容複製到裝置記憶體(阻塞呼叫)

◆ copyTo() [6/8]

void cv::cuda::GpuMat::copyTo ( OutputArray dst,
InputArray mask ) const
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 中標記為非零掩碼元素的那些元素複製到 "m"(阻塞呼叫)

◆ copyTo() [7/8]

void cv::cuda::GpuMat::copyTo ( OutputArray dst,
InputArray mask,
Stream & stream ) const
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 中標記為非零掩碼元素的那些元素複製到 "m"(非阻塞呼叫)

◆ copyTo() [8/8]

void cv::cuda::GpuMat::copyTo ( OutputArray dst,
Stream & stream ) const
Python
cv.cuda.GpuMat.copyTo([, dst]) -> dst
cv.cuda.GpuMat.copyTo(stream[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask[, dst]) -> dst
cv.cuda.GpuMat.copyTo(mask, stream[, dst]) -> dst

GpuMat 內容複製到裝置記憶體(非阻塞呼叫)

◆ create() [1/2]

void cv::cuda::GpuMat::create ( int rows,
int cols,
int type )
Python
cv.cuda.GpuMat.create(rows, cols, type) ->
cv.cuda.GpuMat.create(size, type) ->

分配新的 GpuMat 資料,除非 GpuMat 已具有指定的大小和型別

◆ create() [2/2]

void cv::cuda::GpuMat::create ( Size size,
int type )
Python
cv.cuda.GpuMat.create(rows, cols, type) ->
cv.cuda.GpuMat.create(size, type) ->

◆ cudaPtr()

void * cv::cuda::GpuMat::cudaPtr ( ) const
Python
cv.cuda.GpuMat.cudaPtr() -> retval

◆ defaultAllocator()

static GpuMat::Allocator * cv::cuda::GpuMat::defaultAllocator ( )
static
Python
cv.cuda.GpuMat.defaultAllocator() -> retval
cv.cuda.GpuMat_defaultAllocator() -> retval

default allocator

◆ depth()

int cv::cuda::GpuMat::depth ( ) const
Python
cv.cuda.GpuMat.depth() -> retval

返回元素型別

◆ download() [1/2]

void cv::cuda::GpuMat::download ( OutputArray dst) const
Python
cv.cuda.GpuMat.download([, dst]) -> dst
cv.cuda.GpuMat.download(stream[, dst]) -> dst

GpuMat 執行資料下載(阻塞呼叫)

此函式將資料從裝置記憶體複製到主機記憶體。作為一個阻塞呼叫,它保證在函式返回時複製操作已完成。

◆ download() [2/2]

void cv::cuda::GpuMat::download ( OutputArray dst,
Stream & stream ) const
Python
cv.cuda.GpuMat.download([, dst]) -> dst
cv.cuda.GpuMat.download(stream[, dst]) -> dst

GpuMat 執行資料下載(非阻塞呼叫)

此函式將資料從裝置記憶體複製到主機記憶體。作為一個非阻塞呼叫,即使複製操作尚未完成,此函式也可能返回。

如果 stream 不是預設流且 dst 是使用 HostMem::PAGE_LOCKED 選項分配的 HostMem,則複製操作可能與其它非預設流中的操作重疊。

◆ elemSize()

size_t cv::cuda::GpuMat::elemSize ( ) const
Python
cv.cuda.GpuMat.elemSize() -> retval

返回元素的位元組大小

◆ elemSize1()

size_t cv::cuda::GpuMat::elemSize1 ( ) const
Python
cv.cuda.GpuMat.elemSize1() -> retval

返回元素通道的位元組大小

◆ empty()

bool cv::cuda::GpuMat::empty ( ) const
Python
cv.cuda.GpuMat.empty() -> retval

如果 GpuMat 資料為 NULL,則返回 true

◆ getStdAllocator()

static GpuMat::Allocator * cv::cuda::GpuMat::getStdAllocator ( )
static
Python
cv.cuda.GpuMat.getStdAllocator() -> retval
cv.cuda.GpuMat_getStdAllocator() -> retval

◆ isContinuous()

bool cv::cuda::GpuMat::isContinuous ( ) const
Python
cv.cuda.GpuMat.isContinuous() -> retval

GpuMat 資料連續時(即連續行之間沒有間隙)返回 true

◆ locateROI()

void cv::cuda::GpuMat::locateROI ( Size & wholeSize,
Point & ofs ) const
Python
cv.cuda.GpuMat.locateROI(wholeSize, ofs) ->

在父 GpuMat 中定位 GpuMat

◆ operator PtrStep< _Tp >()

template<typename _Tp >
cv::cuda::GpuMat::operator PtrStep< _Tp > ( ) const

◆ operator PtrStepSz< _Tp >()

template<typename _Tp >
cv::cuda::GpuMat::operator PtrStepSz< _Tp > ( ) const

◆ operator()() [1/2]

GpuMat cv::cuda::GpuMat::operator() ( Range rowRange,
Range colRange ) const

提取矩形子 GpuMat(這是 row、rowRange 等的通用形式)

◆ operator()() [2/2]

GpuMat cv::cuda::GpuMat::operator() ( Rect roi) const

◆ operator=()

GpuMat & cv::cuda::GpuMat::operator= ( const GpuMat & m)

賦值運算子

◆ ptr() [1/4]

uchar * cv::cuda::GpuMat::ptr ( int y = 0)

returns pointer to y-th row

◆ ptr() [2/4]

template<typename _Tp >
_Tp * cv::cuda::GpuMat::ptr ( int y = 0)

template version of the above method

◆ ptr() [3/4]

const uchar * cv::cuda::GpuMat::ptr ( int y = 0) const

◆ ptr() [4/4]

template<typename _Tp >
const _Tp * cv::cuda::GpuMat::ptr ( int y = 0) const

◆ release()

void cv::cuda::GpuMat::release ( )
Python
cv.cuda.GpuMat.release() ->

引用計數遞減,當引用計數達到 0 時釋放資料

◆ reshape()

GpuMat cv::cuda::GpuMat::reshape ( int cn,
int rows = 0 ) const
Python
cv.cuda.GpuMat.reshape(cn[, rows]) -> retval

為相同資料建立替代 GpuMat 頭,具有不同的通道數和/或不同的行數

◆ row()

GpuMat cv::cuda::GpuMat::row ( int y) const
Python
cv.cuda.GpuMat.row(y) -> retval

為指定行返回新的 GpuMat

◆ rowRange() [1/2]

GpuMat cv::cuda::GpuMat::rowRange ( int startrow,
int endrow ) const
Python
cv.cuda.GpuMat.rowRange(startrow, endrow) -> retval
cv.cuda.GpuMat.rowRange(r) -> retval

... for the specified row span

◆ rowRange() [2/2]

GpuMat cv::cuda::GpuMat::rowRange ( Range r) const
Python
cv.cuda.GpuMat.rowRange(startrow, endrow) -> retval
cv.cuda.GpuMat.rowRange(r) -> retval

◆ setDefaultAllocator()

static void cv::cuda::GpuMat::setDefaultAllocator ( GpuMat::Allocator * 分配器)
static
Python
cv.cuda.GpuMat.setDefaultAllocator(分配器) ->
cv.cuda.GpuMat_setDefaultAllocator(分配器) ->

◆ setTo() [1/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s)
Python
cv.cuda.GpuMat.setTo(s) -> retval
cv.cuda.GpuMat.setTo(s, stream) -> retval
cv.cuda.GpuMat.setTo(s, mask) -> retval
cv.cuda.GpuMat.setTo(s, mask, stream) -> retval

GpuMat 的某些元素設定為 s(阻塞呼叫)

◆ setTo() [2/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s,
InputArray mask )
Python
cv.cuda.GpuMat.setTo(s) -> retval
cv.cuda.GpuMat.setTo(s, stream) -> retval
cv.cuda.GpuMat.setTo(s, mask) -> retval
cv.cuda.GpuMat.setTo(s, mask, stream) -> retval

根據掩碼將 GpuMat 的某些元素設定為 s(阻塞呼叫)

◆ setTo() [3/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s,
InputArray mask,
Stream & stream )
Python
cv.cuda.GpuMat.setTo(s) -> retval
cv.cuda.GpuMat.setTo(s, stream) -> retval
cv.cuda.GpuMat.setTo(s, mask) -> retval
cv.cuda.GpuMat.setTo(s, mask, stream) -> retval

根據掩碼將 GpuMat 的某些元素設定為 s(非阻塞呼叫)

◆ setTo() [4/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s,
Stream & stream )
Python
cv.cuda.GpuMat.setTo(s) -> retval
cv.cuda.GpuMat.setTo(s, stream) -> retval
cv.cuda.GpuMat.setTo(s, mask) -> retval
cv.cuda.GpuMat.setTo(s, mask, stream) -> retval

GpuMat 的某些元素設定為 s(非阻塞呼叫)

◆ size()

Size cv::cuda::GpuMat::size ( ) const
Python
cv.cuda.GpuMat.size() -> retval

返回 GpuMat 大小:寬度 == 列數,高度 == 行數

◆ step1()

size_t cv::cuda::GpuMat::step1 ( ) const
Python
cv.cuda.GpuMat.step1() -> retval

返回 step/elemSize1()

◆ swap()

void cv::cuda::GpuMat::swap ( GpuMat & mat)
Python
cv.cuda.GpuMat.swap(mat) ->

與其它智慧指標交換

◆ type()

int cv::cuda::GpuMat::type ( ) const
Python
cv.cuda.GpuMat.type() -> retval

返回元素型別

◆ updateContinuityFlag()

void cv::cuda::GpuMat::updateContinuityFlag ( )
Python
cv.cuda.GpuMat.updateContinuityFlag() ->

內部使用方法:更新連續性標誌

◆ upload() [1/2]

void cv::cuda::GpuMat::upload ( InputArray arr)
Python
cv.cuda.GpuMat.upload(arr) ->
cv.cuda.GpuMat.upload(arr, stream) ->

執行資料上傳到 GpuMat(阻塞呼叫)

此函式將資料從主機記憶體複製到裝置記憶體。作為一個阻塞呼叫,它保證在函式返回時複製操作已完成。

◆ upload() [2/2]

void cv::cuda::GpuMat::upload ( InputArray arr,
Stream & stream )
Python
cv.cuda.GpuMat.upload(arr) ->
cv.cuda.GpuMat.upload(arr, stream) ->

執行資料上傳到 GpuMat(非阻塞呼叫)

此函式將資料從主機記憶體複製到裝置記憶體。作為一個非阻塞呼叫,即使複製操作尚未完成,此函式也可能返回。

如果 stream 不是預設流且 dst 是使用 HostMem::PAGE_LOCKED 選項分配的 HostMem,則複製操作可能與其它非預設流中的操作重疊。

成員資料文件

◆ allocator

Allocator* cv::cuda::GpuMat::allocator

分配器

◆ cols

int cv::cuda::GpuMat::cols

◆ data

uchar* cv::cuda::GpuMat::data

指向資料的指標

◆ dataend

const uchar* cv::cuda::GpuMat::dataend

◆ datastart

uchar* cv::cuda::GpuMat::datastart

用於 locateROI 和 adjustROI 的輔助欄位

◆ flags

int cv::cuda::GpuMat::flags

包含多個位欄位

  • 魔術簽名
  • 連續性標誌
  • 深度
  • 通道數

◆ refcount

int* cv::cuda::GpuMat::refcount

指向引用計數器的指標;當 GpuMat 指向使用者分配的資料時,該指標為 NULL

◆ rows

int cv::cuda::GpuMat::rows

行數和列數

◆ step

size_t cv::cuda::GpuMat::step

連續行之間的位元組距離;如果存在間隙,則包括間隙


此類的文件是從以下檔案生成的