OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项
cv::_OutputArray 类参考

此类型与 InputArray 非常相似,不同之处在于它用于输入/输出和输出函数参数。 更多...

#include <opencv2/core/mat.hpp>

cv::_OutputArray 的协作图

公共类型

枚举  DepthMask {
  DEPTH_MASK_8U = 1 << CV_8U ,
  DEPTH_MASK_8S = 1 << CV_8S ,
  DEPTH_MASK_16U = 1 << CV_16U ,
  DEPTH_MASK_16S = 1 << CV_16S ,
  DEPTH_MASK_32S = 1 << CV_32S ,
  DEPTH_MASK_32F = 1 << CV_32F ,
  DEPTH_MASK_64F = 1 << CV_64F ,
  DEPTH_MASK_16F = 1 << CV_16F ,
  DEPTH_MASK_ALL = (DEPTH_MASK_64F<<1)-1 ,
  DEPTH_MASK_ALL_BUT_8S = DEPTH_MASK_ALL & ~DEPTH_MASK_8S ,
  DEPTH_MASK_ALL_16F = (DEPTH_MASK_16F<<1)-1 ,
  DEPTH_MASK_FLT = DEPTH_MASK_32F + DEPTH_MASK_64F
}
 
- 继承自 cv::_InputArray 的公共类型
枚举  KindFlag {
  KIND_SHIFT = 16 ,
  FIXED_TYPE = 0x8000 << KIND_SHIFT ,
  FIXED_SIZE = 0x4000 << KIND_SHIFT ,
  KIND_MASK = 31 << KIND_SHIFT ,
  NONE = 0 << KIND_SHIFT ,
  MAT = 1 << KIND_SHIFT ,
  MATX = 2 << KIND_SHIFT ,
  STD_VECTOR = 3 << KIND_SHIFT ,
  STD_VECTOR_VECTOR = 4 << KIND_SHIFT ,
  STD_VECTOR_MAT = 5 << KIND_SHIFT ,
  EXPR = 6 << KIND_SHIFT ,
  OPENGL_BUFFER = 7 << KIND_SHIFT ,
  CUDA_HOST_MEM = 8 << KIND_SHIFT ,
  CUDA_GPU_MAT = 9 << KIND_SHIFT ,
  UMAT =10 << KIND_SHIFT ,
  STD_VECTOR_UMAT =11 << KIND_SHIFT ,
  STD_BOOL_VECTOR =12 << KIND_SHIFT ,
  STD_VECTOR_CUDA_GPU_MAT = 13 << KIND_SHIFT ,
  STD_ARRAY =14 << KIND_SHIFT ,
  STD_ARRAY_MAT =15 << KIND_SHIFT
}
 

公共成员函数

 _OutputArray ()
 
template<typename _Tp >
 _OutputArray (_Tp *vec, int n)
 
template<typename _Tp >
 _OutputArray (const _Tp *vec, int n)
 
 _OutputArray (const cuda::GpuMat &d_mat)
 
 _OutputArray (const cuda::HostMem &cuda_mem)
 
template<typename _Tp >
 _OutputArray (const cudev::GpuMat_< _Tp > &m)
 
 _OutputArray (const Mat &m)
 
template<typename _Tp >
 _OutputArray (const Mat_< _Tp > &m)
 
template<typename _Tp , int m, int n>
 _OutputArray (const Matx< _Tp, m, n > &matx)
 
 _OutputArray (const ogl::Buffer &buf)
 
template<typename _Tp , std::size_t _Nm>
 _OutputArray (const std::array< _Tp, _Nm > &arr)
 
template<std::size_t _Nm>
 _OutputArray (const std::array< Mat, _Nm > &arr)
 
template<typename _Tp >
 _OutputArray (const std::vector< _Tp > &vec)
 
 _OutputArray (const std::vector< cuda::GpuMat > &d_mat)
 
 _OutputArray (const std::vector< Mat > &vec)
 
template<typename _Tp >
 _OutputArray (const std::vector< Mat_< _Tp > > &vec)
 
template<typename _Tp >
 _OutputArray (const std::vector< std::vector< _Tp > > &vec)
 
 _OutputArray (const std::vector< UMat > &vec)
 
 _OutputArray (const UMat &m)
 
 _OutputArray (cuda::GpuMat &d_mat)
 
 _OutputArray (cuda::HostMem &cuda_mem)
 
template<typename _Tp >
 _OutputArray (cudev::GpuMat_< _Tp > &m)
 
 _OutputArray (int _flags, void *_obj)
 
 _OutputArray (Mat &m)
 
template<typename _Tp >
 _OutputArray (Mat_< _Tp > &m)
 
template<typename _Tp , int m, int n>
 template<typename _Tp , int m, int n>
 
 _OutputArray (Matx< _Tp, m, n > &matx)
 
template<typename _Tp , std::size_t _Nm>
 _OutputArray (ogl::Buffer &buf)
 
template<std::size_t _Nm>
 template<typename _Tp , std::size_t _Nm>
 
template<typename _Tp >
 _OutputArray (std::array< _Tp, _Nm > &arr)
 
 template<std::size_t _Nm>
 
 _OutputArray (std::array< Mat, _Nm > &arr)
 
 _OutputArray (std::vector< _Tp > &vec)
 
template<typename _Tp >
 _OutputArray (std::vector< bool > &vec)=delete
 
template<typename _Tp >
 _OutputArray (std::vector< cuda::GpuMat > &d_mat)
 
 _OutputArray (std::vector< Mat > &vec)
 
 _OutputArray (std::vector< Mat_< _Tp > > &vec)
 
 _OutputArray (std::vector< std::vector< _Tp > > &vec)
 
void _OutputArray (std::vector< std::vector< bool > > &)=delete
 
void _OutputArray (std::vector< UMat > &vec)
 
void _OutputArray (UMat &m)
 
void assign (const Mat &m) const
 
void assign (const std::vector< Mat > &v) const
 
void assign (const std::vector< UMat > &v) const
 
void assign (const UMat &u) const
 
void clear () const
 
void create (int dims, const int *size, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast< _OutputArray::DepthMask >(0)) const
 
bool create (int rows, int cols, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast< _OutputArray::DepthMask >(0)) const
 
bool create (Size sz, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast< _OutputArray::DepthMask >(0)) const
 
createSameSize (const _InputArray &arr, int mtype) constfixedSize () const
 
fixedType () constcuda::GpuMat
 
getGpuMatRef () conststd::vector< cuda::GpuMat > & 
 
getGpuMatVecRef () constcuda::HostMem
 
getHostMemRef () constMat
 
getMatRef (int i=-1) constogl::Buffer
 
void getOGlBufferRef () const
 
void UMat
 
bool getUMatRef (int i=-1) const
 
move (Mat &m) constmove (UMat &u) const
 
void needed () const
 
void Mat 
 
reinterpret (int type) const
 _InputArray ()
 
template<typename _Tp >
 release () const
 
 setTo (const _InputArray &value, const _InputArray &mask=_InputArray()) const
 
 - 继承自 cv::_InputArray 的公共成员函数
 
template<typename _Tp >
 _InputArray (const _Tp *vec, int n)
 
 _InputArray (const cuda::GpuMat &d_mat)
 
 _InputArray (const cuda::HostMem &cuda_mem)
 
template<typename _Tp >
 _InputArray (const cudev::GpuMat_< _Tp > &m)
 
 _InputArray (const double &val)
 
template<typename _Tp , int m, int n>
 _InputArray (const Mat &m)
 
 _InputArray (const Mat_< _Tp > &m)
 
template<typename _Tp , std::size_t _Nm>
 _InputArray (const MatExpr &expr)
 
template<std::size_t _Nm>
 _InputArray (const Matx< _Tp, m, n > &matx)
 
template<typename _Tp >
 _InputArray (const ogl::Buffer &buf)
 
 _InputArray (const std::array< _Tp, _Nm > &arr)
 
 _InputArray (const std::array< Mat, _Nm > &arr)
 
 _InputArray (const std::vector< _Tp > &vec)
 
template<typename _Tp >
 _InputArray (const std::vector< bool > &vec)
 
template<typename _Tp >
 _InputArray (const std::vector< cuda::GpuMat > &d_mat_array)
 
 _InputArray (const std::vector< Mat > &vec)
 
 _InputArray (const std::vector< Mat_< _Tp > > &vec)
 
 _InputArray (const std::vector< std::vector< _Tp > > &vec)
 
 _InputArray (const std::vector< std::vector< bool > > &)=delete
 
 ~_InputArray ()
 
int _InputArray (const std::vector< UMat > &umv)
 
int _InputArray (const UMat &um)
 
void _InputArray (int _flags, void *_obj)
 
void channels (int i=-1) const
 
int cols (int i=-1) const
 
int copyTo (const _OutputArray &arr) const
 
bool copyTo (const _OutputArray &arr, const _InputArray &mask) const
 
int depth (int i=-1) const
 
dims (int i=-1) constempty () const
 
void getFlags () const
 
move (Mat &m) constcuda::GpuMat 
 
move (Mat &m) constgetGpuMat () const
 
void getGpuMatVector (std::vector< cuda::GpuMat > &gpumv) const
 
void * getMat (int idx=-1) const
 
getMat_ (int idx=-1) constgetMatVector (std::vector< Mat > &mv) const
 
getObj () constogl::Buffer 
 
getOGlBuffer () constSize 
 
void getSz () const
 
bool UMat 
 
bool getUMat (int idx=-1) const
 
bool getUMatVector (std::vector< UMat > &umv) const
 
bool isContinuous (int i=-1) const
 
bool isGpuMat () const
 
bool isGpuMatVector () const
 
bool isMat () const
 
bool isMatVector () const
 
bool isMatx () const
 
bool isSubmatrix (int i=-1) const
 
isUMat () constisUMatVector () const
 
size_t isVector () const
 
int _InputArray::KindFlag 
 
bool kind () const
 
getObj () constoffset (int i=-1) const
 
int rows (int i=-1) const
 
size_t sameSize (const _InputArray &arr) const
 
size_t size (int i=-1) const
 
int sizend (int *sz, int i=-1) const
 

step (int i=-1) const

template<typename _Tp , std::size_t _Nm>
total (int i=-1) consttype (int i=-1) const
 
template<typename _Tp >
total (int i=-1) const 静态公共成员函数
 
static _OutputArray 
template<typename _Tp , std::size_t _Nm>
rawOut (std::array< _Tp, _Nm > &arr)rawOut (std::vector< _Tp > &vec)
 
template<typename _Tp >
rawOut (std::array< _Tp, _Nm > &arr)- 继承自 cv::_InputArray 的静态公共成员函数
 

static _InputArray 

rawIn (const std::array< _Tp, _Nm > &arr)
void rawIn (const std::vector< _Tp > &vec)
 
void  其他继承成员
 
- 继承自 cv::_InputArray 的保护成员函数
int flags
 
void * obj
 
getObj () constsz
 

详细描述

init (int _flags, const void *_obj)

init (int _flags, const void *_obj, Size _sz)

- 继承自 cv::_InputArray 的保护属性

此类型与 InputArray 非常相似,不同之处在于它用于输入/输出和输出函数参数。

与 InputArray 类似,OpenCV 用户无需关心 OutputArray,他们只需将 Matvector<T> 等传递给函数。与 InputArray 相同的限制:不要显式创建 OutputArray 实例,也适用于此处。

如果您想让您的函数具有多态性(即接受不同的数组作为输出参数),这也不是很困难。请以上面的示例作为参考。请注意,_OutputArray::create() 必须在 _OutputArray::getMat() 之前调用。这样可以确保输出数组得到正确分配。
可选输出参数。如果您不需要计算并返回某个输出数组,请传递 cv::noArray(),就像您处理可选输入数组一样。在实现层面,使用 _OutputArray::needed() 来检查某个输出数组是否需要计算。
OutputArray 有几个同义词,用于辅助自动 Python/Java/... 包装器生成器
此类型与 InputArray 非常相似,不同之处在于它用于输入/输出和输出函数参数...
InputOutputArray InputOutputArrayOfArrays
定义 mat.hpp:449
OutputArray OutputArrayOfArrays

成员枚举文档

定义 mat.hpp:447

const _InputOutputArray & InputOutputArray
枚举器
定义 mat.hpp:448
◆ DepthMask
enum cv::_OutputArray::DepthMask
DEPTH_MASK_8U 
DEPTH_MASK_8S 
DEPTH_MASK_16U 
DEPTH_MASK_16S 
DEPTH_MASK_32S 
DEPTH_MASK_32F 
DEPTH_MASK_64F 
DEPTH_MASK_16F 
DEPTH_MASK_ALL 

构造函数 & 析构函数文档

DEPTH_MASK_ALL_BUT_8S 

DEPTH_MASK_ALL_16F  ( )

DEPTH_MASK_FLT 

DEPTH_MASK_ALL_16F  ( int _flags,
void * ◆ _OutputArray() [1/38]

cv::_OutputArray::_OutputArray

DEPTH_MASK_ALL_16F  ( Mat & m)

◆ _OutputArray() [2/38]

DEPTH_MASK_ALL_16F  ( _obj ) vec)

◆ _OutputArray() [3/38]

DEPTH_MASK_ALL_16F  ( cuda::GpuMat & ◆ _OutputArray() [4/38])

std::vector< Mat > &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [5/38] ◆ _OutputArray() [4/38])

d_mat

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [6/38] & buf)

std::vector< cuda::GpuMat > &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [7/38] & ogl::Buffer)

◆ _OutputArray() [8/38]

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( cuda::HostMem m)

cuda_mem

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [9/38] vec)

cudev::GpuMat_< _Tp > &

DEPTH_MASK_ALL_16F  ( std::vector< bool > & vec)
delete

◆ _OutputArray() [10/38]

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( std::vector< _Tp > & vec)

◆ _OutputArray() [11/38]

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [12/38] )
delete

std::vector< std::vector< _Tp > > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [13/38] vec)

std::vector< std::vector< bool > > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [14/38] m)

std::vector< Mat_< _Tp > > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( 包装自定义类型的辅助函数。 * vec,
int n )

◆ _OutputArray() [15/38]

template<typename _Tp , int m, int n>
DEPTH_MASK_ALL_16F  ( Mat_< _Tp > & ◆ _OutputArray() [16/38])

◆ _OutputArray() [17/38]

DEPTH_MASK_ALL_16F  ( UMat & m)

Matx< _Tp, m, n > &

DEPTH_MASK_ALL_16F  ( matx vec)

◆ _OutputArray() [18/38]

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [19/38] m)

std::vector< UMat > &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [20/38] vec)

const Mat &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [21/38] ◆ _OutputArray() [4/38])

const std::vector< Mat > &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [22/38] ◆ _OutputArray() [4/38])

const cuda::GpuMat &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [23/38] buf)

const std::vector< cuda::GpuMat > &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [24/38] ogl::Buffer)

const ogl::Buffer &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [25/38] m)

const cuda::HostMem &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [26/38] vec)

const cudev::GpuMat_< _Tp > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [27/38] vec)

const std::vector< _Tp > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [28/38] vec)

const std::vector< std::vector< _Tp > > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [29/38] m)

const std::vector< Mat_< _Tp > > &

template<typename _Tp >
DEPTH_MASK_ALL_16F  ( const _Tp * vec,
int n )

◆ _OutputArray() [30/38]

template<typename _Tp , int m, int n>
DEPTH_MASK_ALL_16F  ( const Mat_< _Tp > & ◆ _OutputArray() [16/38])

◆ _OutputArray() [31/38]

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [32/38] m)

const Matx< _Tp, m, n > &

DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [33/38] vec)

const UMat &

template<typename _Tp , std::size_t _Nm>
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [34/38] arr)

const std::vector< UMat > &

template<typename _Tp , std::size_t _Nm>
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [35/38] arr)

std::array< _Tp, _Nm > &

template<std::size_t _Nm>
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [36/38] arr)

const std::array< _Tp, _Nm > &

template<std::size_t _Nm>
DEPTH_MASK_ALL_16F  ( ◆ _OutputArray() [37/38] arr)

成员函数文档

std::array< Mat, _Nm > &

◆ _OutputArray() [38/38] ( ◆ _OutputArray() [19/38] m) const

const std::array< Mat, _Nm > &

◆ _OutputArray() [38/38] ( ◆ _OutputArray() [20/38] v) const

◆ assign() [1/4]

◆ _OutputArray() [38/38] ( ◆ _OutputArray() [33/38] v) const

void cv::_OutputArray::assign

◆ _OutputArray() [38/38] ( ◆ _OutputArray() [32/38] u) const

◆ assign() [2/4]

◆ assign() [3/4] ( ) const

◆ assign() [4/4]

◆ clear() ( int dims,
const int * size,
int type,
int void cv::_OutputArray::clear
bool ◆ create() [1/3]
void cv::_OutputArray::create i = -1,

allowTransposed = false,

◆ clear() ( int rows,
int cols,
int type,
int void cv::_OutputArray::clear
bool ◆ create() [1/3]
void cv::_OutputArray::create i = -1,

_OutputArray::DepthMask

◆ clear() ( Size sz,
int type,
int void cv::_OutputArray::clear
bool ◆ create() [1/3]
void cv::_OutputArray::create i = -1,

fixedDepthMask = static_cast< _OutputArray::DepthMask >(0) ) const

◆ create() [2/3] ( ◆ create() [3/3] arr,
int ◆ createSameSize()

void cv::_OutputArray::createSameSize

const _InputArray & ( ) const

mtype ) const

◆ fixedSize() ( ) const

bool cv::_OutputArray::fixedSize

◆ fixedType() ( ) const

bool cv::_OutputArray::fixedType

◆ getGpuMatRef() ( ) const

cuda::GpuMat & cv::_OutputArray::getGpuMatRef

◆ getGpuMatVecRef() ( ) const

std::vector< cuda::GpuMat > & cv::_OutputArray::getGpuMatVecRef

◆ getHostMemRef() ( int cuda::HostMem & cv::_OutputArray::getHostMemRef) const

◆ getMatRef()

Mat & cv::_OutputArray::getMatRef ( ) const

i = -1

◆ getOGlBufferRef() ( int cuda::HostMem & cv::_OutputArray::getHostMemRef) const

ogl::Buffer & cv::_OutputArray::getOGlBufferRef

◆ getUMatRef() ( Mat & m) const

UMat & cv::_OutputArray::getUMatRef

◆ getUMatRef() ( UMat & u) const

◆ move() [1/2]

void cv::_OutputArray::move ( ) const

◆ move() [2/2]

template<typename _Tp , std::size_t _Nm>
◆ needed() ( ◆ _OutputArray() [34/38] arr)
static

bool cv::_OutputArray::needed

template<typename _Tp >
◆ needed() ( ◆ _OutputArray() [9/38] vec)
static

◆ rawOut() [1/2]

static _OutputArray cv::_OutputArray::rawOut ( int type) const

◆ rawOut() [2/2]

◆ reinterpret() ( ) const

Mat cv::_OutputArray::reinterpret

◆ release() ( ◆ create() [3/3] ,
◆ create() [3/3] void cv::_OutputArray::release

◆ setTo()