오, 그건 깊은 소스 트리입니다. 어쨌든, opencv/modules/core/include/opencv2/core/types.hpp가 있습니다
/*!
The 2D size class
The class represents the size of a 2D rectangle, image size, matrix size etc.
Normally, cv::Size ~ cv::Size_<int> is used.
*/
template<typename _Tp> class Size_
{
//! various constructors
Size_();
Size_(_Tp _width, _Tp _height);
Size_(const Size_& sz);
Size_(const Point_<_Tp>& pt);
Size_& operator = (const Size_& sz);
//! the area (width*height)
_Tp area() const;
//! conversion of another data type.
template<typename _Tp2> operator Size_<_Tp2>() const;
_Tp width, height; // the width and the height
};
/*!
\typedef
*/
typedef Size_<int> Size2i;
typedef Size_<float> Size2f;
typedef Size_<double> Size2d;
typedef Size2i Size;
그래서, Size
는 Size_<int>
의 별칭입니다 Size2i
의 별칭이다.
크기에 대한 너비 객체가 정의 된 곳을 물어봐 주셔서 대단히 감사합니다. 크기는 (_ Tp _width, _Tp _height)입니다. –
@ user3411335 당신이별로 익숙하지 않은 것 같습니다. 템플릿. 당신이 인용 한 코드는'Size _()'생성자가 템플릿 타입 인'_Tp' 타입의 두 개의 인자를 취한다는 것을 의미합니다. '_width'와'_height'는 단순히 생성자의 인수의 이름입니다. – unwind
'Size sz = (Size (640, 480)'를 호출하고'cout << sz.width; '를 호출하면 CV 객체를 정의하는 것처럼 정의 할 수있다. 예를 들어 행 객체가 정의되어있다. .. –