OpenCV453
公開型 | 公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
cv::_OutputArray クラス

This type is very similar to InputArray except that it is used for input/output and output function parameters. [詳解]

#include <mat.hpp>

cv::_InputArrayを継承しています。

cv::_InputOutputArrayに継承されています。

公開型

enum  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 に属する継承公開型
enum  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 (int _flags, void *_obj)
 
 _OutputArray (Mat &m)
 
 _OutputArray (std::vector< Mat > &vec)
 
 _OutputArray (cuda::GpuMat &d_mat)
 
 _OutputArray (std::vector< cuda::GpuMat > &d_mat)
 
 _OutputArray (ogl::Buffer &buf)
 
 _OutputArray (cuda::HostMem &cuda_mem)
 
template<typename _Tp >
 _OutputArray (cudev::GpuMat_< _Tp > &m)
 
template<typename _Tp >
 _OutputArray (std::vector< _Tp > &vec)
 
 _OutputArray (std::vector< bool > &vec)=delete
 
template<typename _Tp >
 _OutputArray (std::vector< std::vector< _Tp > > &vec)
 
 _OutputArray (std::vector< std::vector< bool > > &)=delete
 
template<typename _Tp >
 _OutputArray (std::vector< Mat_< _Tp > > &vec)
 
template<typename _Tp >
 _OutputArray (Mat_< _Tp > &m)
 
template<typename _Tp >
 _OutputArray (_Tp *vec, int n)
 
template<typename _Tp , int m, int n>
 _OutputArray (Matx< _Tp, m, n > &matx)
 
 _OutputArray (UMat &m)
 
 _OutputArray (std::vector< UMat > &vec)
 
 _OutputArray (const Mat &m)
 
 _OutputArray (const std::vector< Mat > &vec)
 
 _OutputArray (const cuda::GpuMat &d_mat)
 
 _OutputArray (const std::vector< cuda::GpuMat > &d_mat)
 
 _OutputArray (const ogl::Buffer &buf)
 
 _OutputArray (const cuda::HostMem &cuda_mem)
 
template<typename _Tp >
 _OutputArray (const cudev::GpuMat_< _Tp > &m)
 
template<typename _Tp >
 _OutputArray (const std::vector< _Tp > &vec)
 
template<typename _Tp >
 _OutputArray (const std::vector< std::vector< _Tp > > &vec)
 
template<typename _Tp >
 _OutputArray (const std::vector< Mat_< _Tp > > &vec)
 
template<typename _Tp >
 _OutputArray (const Mat_< _Tp > &m)
 
template<typename _Tp >
 _OutputArray (const _Tp *vec, int n)
 
template<typename _Tp , int m, int n>
 _OutputArray (const Matx< _Tp, m, n > &matx)
 
 _OutputArray (const UMat &m)
 
 _OutputArray (const std::vector< UMat > &vec)
 
template<typename _Tp , std::size_t _Nm>
 _OutputArray (std::array< _Tp, _Nm > &arr)
 
template<typename _Tp , std::size_t _Nm>
 _OutputArray (const std::array< _Tp, _Nm > &arr)
 
template<std::size_t _Nm>
 _OutputArray (std::array< Mat, _Nm > &arr)
 
template<std::size_t _Nm>
 _OutputArray (const std::array< Mat, _Nm > &arr)
 
bool fixedSize () const
 
bool fixedType () const
 
bool needed () const
 
MatgetMatRef (int i=-1) const
 
UMatgetUMatRef (int i=-1) const
 
cuda::GpuMatgetGpuMatRef () const
 
std::vector< cuda::GpuMat > & getGpuMatVecRef () const
 
ogl::BuffergetOGlBufferRef () const
 
cuda::HostMemgetHostMemRef () const
 
void create (Size sz, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast< _OutputArray::DepthMask >(0)) const
 
void create (int rows, int cols, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast< _OutputArray::DepthMask >(0)) 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
 
void createSameSize (const _InputArray &arr, int mtype) const
 
void release () const
 
void clear () const
 
void setTo (const _InputArray &value, const _InputArray &mask=_InputArray()) const
 
void assign (const UMat &u) const
 
void assign (const Mat &m) const
 
void assign (const std::vector< UMat > &v) const
 
void assign (const std::vector< Mat > &v) const
 
void move (UMat &u) const
 
void move (Mat &m) const
 
- 基底クラス cv::_InputArray に属する継承公開メンバ関数
 _InputArray (int _flags, void *_obj)
 
 _InputArray (const Mat &m)
 
 _InputArray (const MatExpr &expr)
 
 _InputArray (const std::vector< Mat > &vec)
 
template<typename _Tp >
 _InputArray (const Mat_< _Tp > &m)
 
template<typename _Tp >
 _InputArray (const std::vector< _Tp > &vec)
 
 _InputArray (const std::vector< bool > &vec)
 
template<typename _Tp >
 _InputArray (const std::vector< std::vector< _Tp > > &vec)
 
 _InputArray (const std::vector< std::vector< bool > > &)=delete
 
template<typename _Tp >
 _InputArray (const std::vector< Mat_< _Tp > > &vec)
 
template<typename _Tp >
 _InputArray (const _Tp *vec, int n)
 
template<typename _Tp , int m, int n>
 _InputArray (const Matx< _Tp, m, n > &matx)
 
 _InputArray (const double &val)
 
 _InputArray (const cuda::GpuMat &d_mat)
 
 _InputArray (const std::vector< cuda::GpuMat > &d_mat_array)
 
 _InputArray (const ogl::Buffer &buf)
 
 _InputArray (const cuda::HostMem &cuda_mem)
 
template<typename _Tp >
 _InputArray (const cudev::GpuMat_< _Tp > &m)
 
 _InputArray (const UMat &um)
 
 _InputArray (const std::vector< UMat > &umv)
 
template<typename _Tp , std::size_t _Nm>
 _InputArray (const std::array< _Tp, _Nm > &arr)
 
template<std::size_t _Nm>
 _InputArray (const std::array< Mat, _Nm > &arr)
 
Mat getMat (int idx=-1) const
 
Mat getMat_ (int idx=-1) const
 
UMat getUMat (int idx=-1) const
 
void getMatVector (std::vector< Mat > &mv) const
 
void getUMatVector (std::vector< UMat > &umv) const
 
void getGpuMatVector (std::vector< cuda::GpuMat > &gpumv) const
 
cuda::GpuMat getGpuMat () const
 
ogl::Buffer getOGlBuffer () const
 
int getFlags () const
 
void * getObj () const
 
Size getSz () const
 
_InputArray::KindFlag kind () const
 
int dims (int i=-1) const
 
int cols (int i=-1) const
 
int rows (int i=-1) const
 
Size size (int i=-1) const
 
int sizend (int *sz, int i=-1) const
 
bool sameSize (const _InputArray &arr) const
 
size_t total (int i=-1) const
 
int type (int i=-1) const
 
int depth (int i=-1) const
 
int channels (int i=-1) const
 
bool isContinuous (int i=-1) const
 
bool isSubmatrix (int i=-1) const
 
bool empty () const
 
void copyTo (const _OutputArray &arr) const
 
void copyTo (const _OutputArray &arr, const _InputArray &mask) const
 
size_t offset (int i=-1) const
 
size_t step (int i=-1) const
 
bool isMat () const
 
bool isUMat () const
 
bool isMatVector () const
 
bool isUMatVector () const
 
bool isMatx () const
 
bool isVector () const
 
bool isGpuMat () const
 
bool isGpuMatVector () const
 

静的公開メンバ関数

template<typename _Tp >
static _OutputArray rawOut (std::vector< _Tp > &vec)
 
template<typename _Tp , std::size_t _Nm>
static _OutputArray rawOut (std::array< _Tp, _Nm > &arr)
 
- 基底クラス cv::_InputArray に属する継承静的公開メンバ関数
template<typename _Tp >
static _InputArray rawIn (const std::vector< _Tp > &vec)
 
template<typename _Tp , std::size_t _Nm>
static _InputArray rawIn (const std::array< _Tp, _Nm > &arr)
 

その他の継承メンバ

- 基底クラス cv::_InputArray に属する継承限定公開メンバ関数
void init (int _flags, const void *_obj)
 
void init (int _flags, const void *_obj, Size _sz)
 
- 基底クラス cv::_InputArray に属する継承限定公開変数類
int flags
 
void * obj
 
Size sz
 

詳解

This type is very similar to InputArray except that it is used for input/output and output function parameters.

Just like with InputArray, OpenCV users should not care about OutputArray, they just pass Mat, vector<T> etc. to the functions. The same limitation as for InputArray: Do not explicitly create OutputArray instances applies here too.

If you want to make your function polymorphic (i.e. accept different arrays as output parameters), it is also not very difficult. Take the sample above as the reference. Note that _OutputArray::create() needs to be called before _OutputArray::getMat(). This way you guarantee that the output array is properly allocated.

Optional output parameters. If you do not need certain output array to be computed and returned to you, pass cv::noArray(), just like you would in the case of optional input array. At the implementation level, use _OutputArray::needed() to check if certain output array needs to be computed or not.

There are several synonyms for OutputArray that are used to assist automatic Python/Java/... wrapper generators:

typedef OutputArray OutputArrayOfArrays;
typedef OutputArray InputOutputArray;
typedef OutputArray InputOutputArrayOfArrays;

このクラス詳解は次のファイルから抽出されました: