opencv3学习之Point类

来源:互联网 发布:garageband知乎 编辑:程序博客网 时间:2024/06/12 19:44

//13.Point

#include <opencv2/opencv.hpp>

using namespacecv;

using namespacestd;

int main(){

    Point2f p1(6,2);//二维点的定义和输出

    cout<<"p1="<<p1<<endl;

    

    Point3f p2(1,2,3);//三维点的定义和输出

    cout<<"p2="<<p2<<endl;

    

    vector<float> v;

    v.push_back(4);

    v.push_back(5);

    v.push_back(6);

    cout<<"vector="<<Mat(v);//因为vector是基于Mat

    cout<<endl;

    

    

    vector<Point2f> points(20);

    for(size_t i=0;i<points.size();++i)

        points[i]=Point2f(float(i*5),float(i%7));

    

        cout<<points<<";";

    

    return0;

}

原创粉丝点击