learning OpenCV3 - data type

三类

  • basic data types

    • 通常是已经从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 class

    • 表示任意维数组
    • 包含其他对象,如 稀疏矩阵 cv::SparseMat class
  • 模板类 cv::Vec<>

    • 代表 fixed vector classes
    • 用于一些编译时就已知维度的小向量
  • fixed matrix classes

    • 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 classes

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

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

    • 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

Example

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

learning OpenCV3 - data type_第1张图片

size classes

learning OpenCV3 - data type_第2张图片

cv::Rect class

learning OpenCV3 - data type_第3张图片

cv::RotatedRect class

learning OpenCV3 - data type_第4张图片

fixed matrix classes

learning OpenCV3 - data type_第5张图片

fixed vector classes

learning OpenCV3 - data type_第6张图片

complex number classes

associated with the STL complex number class template complex<>
learning OpenCV3 - data type_第7张图片

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

你可能感兴趣的:(opencv,ubuntu,c++)