cv::Size_< _Tp > Class Template Reference 核心功能 » 基本结构


Template class for specifying the size of an image or rectangle. 更多...

#include <opencv2/core/types.hpp>

公共类型

typedef _Tp  value_type
 

Public Member Functions

  Size_ ()
  default constructor 更多...
 
  Size_ (_Tp _width, _Tp _height)
 
  Size_ (const Size_ &sz)
 
  Size_ ( Size_ &&sz) CV_NOEXCEPT
 
  Size_ (const Point_ < _Tp > &pt)
 
_Tp  area () const
  the area (width*height) 更多...
 
double  aspectRatio () const
  aspect ratio (width/height) 更多...
 
bool  empty () const
  true if empty 更多...
 
template<typename _Tp2 >
  operator Size_< _Tp2 > () const
  conversion of another data type. 更多...
 
Size_ operator= (const Size_ &sz)
 
Size_ operator= ( Size_ &&sz) CV_NOEXCEPT
 

Public Attributes

_Tp  height
  the height 更多...
 
_Tp  width
  the width 更多...
 

详细描述

template<typename _Tp>
class cv::Size_< _Tp >

Template class for specifying the size of an image or rectangle.

The class includes two members called width and height. The structure can be converted to and from the old OpenCV structures CvSize and CvSize2D32f . The same set of arithmetic and comparison operations as for Point_ is available.

OpenCV defines the following Size_ <> aliases:

typedef Size_<int> Size2i ;
typedef Size2i Size ;
typedef Size_<float> Size2f ;
范例:
modules/shape/samples/shape_example.cpp , samples/cpp/fitellipse.cpp , samples/cpp/lkdemo.cpp , samples/cpp/stitching_detailed.cpp , samples/cpp/train_HOG.cpp , samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp , samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp , samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp , samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_2.cpp , samples/cpp/tutorial_code/videoio/video-write/video-write.cpp , samples/cpp/warpPerspective_demo.cpp , samples/dnn/colorization.cpp , samples/dnn/object_detection.cpp ,和 samples/tapi/hog.cpp .

Member Typedef Documentation

◆  value_type

template<typename _Tp>
typedef _Tp cv::Size_ < _Tp >:: value_type

Constructor & Destructor Documentation

◆  Size_() [1/5]

template<typename _Tp>
cv::Size_ < _Tp >:: Size_ ( )

default constructor

◆  Size_() [2/5]

template<typename _Tp>
cv::Size_ < _Tp >:: Size_ ( _Tp  _width ,
_Tp  _height  
)

◆  Size_() [3/5]

template<typename _Tp>
cv::Size_ < _Tp >:: Size_ ( const Size_ < _Tp > &  sz )

◆  Size_() [4/5]

template<typename _Tp>
cv::Size_ < _Tp >:: Size_ ( Size_ < _Tp > &&  sz )

◆  Size_() [5/5]

template<typename _Tp>
cv::Size_ < _Tp >:: Size_ ( const Point_ < _Tp > &  pt )

成员函数文档编制

◆  area()

template<typename _Tp>
_Tp cv::Size_ < _Tp >::area ( ) const

the area (width*height)

范例:
samples/cpp/stitching_detailed.cpp .

◆  aspectRatio()

template<typename _Tp>
double cv::Size_ < _Tp >::aspectRatio ( ) const

aspect ratio (width/height)

◆  empty()

template<typename _Tp>
bool cv::Size_ < _Tp >::empty ( ) const

true if empty

◆  operator Size_ < _Tp2 > ()

template<typename _Tp>
template<typename _Tp2 >
cv::Size_ < _Tp >::operator Size_ < _Tp2 > ( ) const

conversion of another data type.

◆  operator=() [1/2]

template<typename _Tp>
Size_ & cv::Size_ < _Tp >::operator= ( const Size_ < _Tp > &  sz )

◆  operator=() [2/2]

template<typename _Tp>
Size_ & cv::Size_ < _Tp >::operator= ( Size_ < _Tp > &&  sz )

Member Data Documentation

◆  height

◆  width


The documentation for this class was generated from the following file: