标签:pen cimage logs min mes enc 配置 str 运行
按照mac10.12.6系统使用cmake安装opencv3.3.0+opencv_contrib-3.3.0下载编译安装好了文件以后,装好clion编译器,新建C++可执行工程,编写代码
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main() {
Mat srcImage = imread("1.png");
if (!srcImage.data) {
std::cout << "Image not loaded";
return -1;
}
imshow("[img]", srcImage);
waitKey(0);
return 0;
}
cmake_minimum_required(VERSION 3.12)
project(OpenCVGrad)
set(CMAKE_CXX_STANDARD 11)
#
FIND_PACKAGE(OpenCV REQUIRED)
#
add_executable(OpenCVGrad main.cpp)
#
target_link_libraries(OpenCVGrad ${OpenCV_LIBS})
#
mac10.12.6系统配置clion编写CMakeLists文件运行opencv3
标签:pen cimage logs min mes enc 配置 str 运行
原文地址:https://www.cnblogs.com/GeekHuman/p/9819958.html