OpenCV3.3.0 + clion + CMake configuration (Mac size invincible version)

Source: Internet
Author: User

Directory

    • Begin
      • Completed the

Reference Links:
1,cmake compiling
http://blog.csdn.net/baidu_36316735/article/details/53168438
2,clion Import OpenCV
http://blog.csdn.net/xiangxianghehe/article/details/71438789

In addition, configuring Opencv3 in VS can refer to my blog post:
OPENCV3.2.0+VS2017 environment configuration and frequently asked questions (Size Pit Daddy Edition)
In addition: Mac + Pycharm can refer to my blog:
Mac + OpenCV3.3.0 + pycharm (very simple configuration process)

Download Clion, CMake, OpenCV3.3.0 I will not say, Jetbeans Use the student mailbox can apply for free family barrels.

The following main talk about configuration

Begin

1. Create a build folder in download/opencv-3.3.0/to save the compiled file

2, open CMake, fill in OpenCV path and build path->configure->done->, etc.->generate

3, open the terminal, use the CD command to enter the build folder directory, and then enter the command
Make
Then, wait for it to compile to 100%, and then enter the command
sudo make install

4, create a project, my name is Opencv3_demo

//打开摄像头样例#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/core/core.hpp>using namespace cv;int main(){    VideoCapture cap(0);    Mat frame;    while(1)    {        cap >> frame;        imshow("调用摄像头", frame);        waitKey(0);    }    return 0;}

Change CMakeLists.txt

cmake_minimum_required(VERSION 3.7)project(opencv3_demo)set(CMAKE_CXX_STANDARD 11)set(SOURCE_FILES main.cpp)add_executable(opencv3_demo ${SOURCE_FILES})find_package(OpenCV REQUIRED)target_link_libraries(opencv3_demo ${OpenCV_LIBS})
Completed the

OpenCV3.3.0 + clion + CMake configuration (Mac size invincible version)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.