OpenVINO study notes (4): using OpenCV

OpenVINO study notes (4): using OpenCV

  • This section focuses on how to use OpenVINO record of OpenCV library.

1. Create a new project

  • Open VS2017, click File, then click New, and finally click on the project, create an empty project.Here Insert Picture Description

2. Configure the directory that contains

  • Open Debug | x64 property page in the directory that contains the VC ++ add the following

    C:\IntelSWTools\openvino_2020.1.033\opencv\include
    

    set_include_path

3. Configure library directory

  • Add the following VC ++ library directory
    C:\IntelSWTools\openvino_2020.1.033\opencv\lib
    
    set_lib_path

4. Configuration linker input

  • Add the following input> - the linker:
    opencv_calib3d420d.lib
    opencv_core420d.lib
    opencv_dnn420d.lib
    opencv_features2d420d.lib
    opencv_flann420d.lib
    opencv_gapi420d.lib
    opencv_highgui420d.lib
    opencv_imgcodecs420d.lib
    opencv_imgproc420d.lib
    opencv_ml420d.lib
    opencv_objdetect420d.lib
    opencv_photo420d.lib
    opencv_stitching420d.lib
    opencv_video420d.lib
    opencv_videoio420d.lib
    

5. Set Environment Variables

  • Add the following environment variables:

    C:\IntelSWTools\openvino_2020.1.033\opencv\include
    

6. Run the test code

  • Add new entries in the source file, named: main.cpp. Add the following code in it:

    #include <opencv2/opencv.hpp>
    #include <iostream>
    
    using namespace cv;
    
    int main(int argc, char** argv) {
      Mat src = imread("./lenacolor.png");  //读取图片
      imshow("input", src); //显示图片
      waitKey(0); //等待用户按键
      destroyAllWindows(); //摧毁所有显示图片的窗口
      return 0;
    }
    
  • If it is successful, the following results:
    run_opencv_result

7. Conclusion

  • If there is something wrong place, or areas for improvement, please correct me.
  • Contact email: [email protected]
  • This article to an end.
Published 17 original articles · won praise 0 · Views 1150

Guess you like

Origin blog.csdn.net/u011385476/article/details/104827592