learning OpenCV3 - data type

三類

  • basic data typesc++

    • 一般是已經從c++中繼承的
    • int, float, etc
    • vectors,matrices,simple geometric concepts like points, rectangles,sizes
  • helper objects算法

    • 表明一些更抽象的概念
    • garbage-collecting pointer class
    • range objects used for slicing
    • abstractions such as termination criteria
  • large array types數組

    • contain arrays or other assemblies of primitives or, more often, the basic data types
  • cv::Mat classide

    • 表示任意維數組
    • 包含其餘對象,如 稀疏矩陣 cv::SparseMat class
  • 模板類 cv::Vec<>ui

    • 表明 fixed vector classes
    • 用於一些編譯時就已知維度的小向量
  • fixed matrix classesspa

    • associated with the template cv::Matx<>.
    • certain specific small matrix operations
    • the dimensionality of the fixed matrix classes must be known at compile time
  • point classes3d

    • their members are accessed by named variables (mypoint.x, mypoint.y, etc.) rather than by a vector index (myvec[0],myvec[1], etc.)
  • cv::Scalarcode

    • four-dimensional point
    • generate an arbitrary four-component vector
  • cv::Size and cv::Rectcomponent

    • cv::Size -- having data members width and height rather than x and y
    • cv::Rect -- all four
    • cv::RotatedRect not axis-aligned 非抽對稱

point classes

  • 能夠是任意類型的
  • 有兩個模板對象

    • 2-D
    • 3-D
    • cv::Point2i or cv::Point3f (第一個數-維度, 第二個數-精度)
    • b is an unsigned character, s is a short integer, i is a 32-bit integer, f is a 32-bit floating-point number, and d is a 64- bit floating-point number

<font color=red size =22>Example</font>

Operation Example
Default constructors cv::Point2i p;
cv::Point3f p;
Copy constructor cv::Point3f p2( p1 );
Value constructors cv::Point2i p( x0, x1 );
cv::Point3d p( x0, x1, x2 );
Cast to the fixed vector classes (cv::Vec3f) p;
Member access p.x; p.y;
// and for three-dimensional
// point classes: p.z
Dot product float x = p1.dot( p2 )
Double-precision dot product double x = p1.ddot( p2 )
Cross product p1.cross( p2 )
// (for three-dimensional point
// classes only)
Query if point p is inside rectangle r p.inside( r )
// (for two-dimensional point
// classes only)

cv::Scalar class

捕獲.PNG

size classes

TIM圖片20200113015747.jpg

cv::Rect class

捕獲.PNG
捕獲.PNG

cv::RotatedRect class

捕獲.PNG

fixed matrix classes

TIM圖片20200113015747.jpg

fixed vector classes

捕獲.PNG

complex number classes

associated with the STL complex number class template complex<>
捕獲.PNG

Helper Objects

cv::TermCriteria class

Many algorithms require a stopping condition to know when to quit

  • COUNT or MAX_ITER

    • 中止條件一般是有限的迭代數或出現錯誤參數

cv::TermCriteria
封裝一個或兩個中止條件,直接傳遞給OpenCV算法
有三個成員變量type, maxCount, epsilon

相關文章
相關標籤/搜索