使用opencv中点的类型来定义vector容器

#include 
#include 

using namespace std;
using namespace cv;

int main()
{
    vector vp2f;
    vp2f.push_back(Point2f(2, 3));
    cout << "【二维点向量】" << endl << vp2f << endl;

    vector vp3f(10);
    for (size_t i = 0; i < vp3f.size(); i++)
    {
        vp3f[i] = Point3f((float)(i + i), (float)(i * i), (float)(i + 1));
    }
    cout << "【三维点向量】" << endl << vp3f << endl;

    cv::waitKey(0);
    return 0;
}
cmake_minimum_required(VERSION 3.14)
project(opencv01)

set(CMAKE_CXX_STANDARD 11)

# OpenCV
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_DIRS} )

add_executable(opencv01 main.cpp)
target_link_libraries(opencv01 ${OpenCV_LIBS})

使用opencv中点的类型来定义vector容器_第1张图片

你可能感兴趣的:(OpenCV,C++)