cmakelists:
cmake_minimum_required(VERSION 3.7)
project(size_function)
set(CMAKE_CXX_STANDARD 11)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_DIRS})
set(SOURCE_FILES main.cpp)
add_executable(size_function ${SOURCE_FILES})
target_link_libraries(size_function ${OpenCV_LIBS})
程序:
#include <iostream>
#include <opencv2/core/core.hpp