© 2018 marearts.com All rights reserved  

Never Miss a Post. Subscribe Now!
May 20, 2018

Chapter 0. OpenCV Build - option#1 hardest way


Edited: Mar 16



0. Video

Youtube :

1) preparation: https://youtu.be/mCso6cwb2Ng

2) cmake & build: https://youtu.be/HEEUeUgb7ks

3) set up & test : https://youtu.be/PhEzgRmk0xM



1. Environment

  • Window

  • Visual Studio 

  • OpenCV 3.2

  • Cuda Toolkit 8.0

  • CMake 3.8.0

  • TBB 2017


2. Preparation

① Preparations : Install and download

  • cmake, cuda, tbb, opencv

② Run cmake

  • Set configuration

  • Code Generation

③ Build by Visual Studio

  • Build All

  • Make dll, lib

④ OpenCV DLL test

  • VS Setting

  • Sample Test


4. CMake Setting

TBB Setting

  • TBB_ENV_INCLUDE : /tbb2017_20170226oss_win/tbb2017_20170226oss/include/

  • TBB_ENV_LIB: /tbb2017_20170226oss_win/tbb2017_20170226oss/lib/intel64/vc14/tbb.lib

  • TBB_ENV_LIB_DEBUG : /tbb2017_20170226oss_win/tbb2017_20170226oss/lib/intel64/vc14/tbb_debug.lib

  • TBB_VER_FILE : /tbb2017_20170226oss_win/tbb2017_20170226oss/include/tbb_stddef.h

OpenCV Cotrib Setting

  • OPENCV_EXTRA_MODUKES_PATH : /opencv_contrib-master/opencv_contrib-master/modules













refer to this site, you will be install opencv easy : https://chocolatey.org/packages/OpenCV




Sep 16, 2018

안녕하세요, 박사님

강의 감사히 공부하고 있습니다.


제 블로그에 OpenCV 빌드 가이드를 작성하고 있는데요,(나중에 다시 빌드할 때를 위한 저장용)

박사님께서 작성하신 글의 링크를 걸고 싶습니다.

답장 기다리고 있겠습니다.



Sep 16, 2018

네 제 글을 참고 하셔도 됩니다. 링크도 달아주시면 고맙고요. 감사합니다.

Oct 18, 2018





I hope you speak English :D ! Your tutorial are very good, helped a lot.

I'm getting these error on the opencv_tracking and I'm really trying to figure it but I don't know, do you have any ideas ?



Oct 19, 2018

I am not sure, but how about to try that

find precomp.h location and go to cpp files that have error, and correct include path of precomp.h.

for example #include ../abc/def/precomp.h


I hope that you have solved.

And if you solve, could you mention the method for others in here?


Thank you.

New Posts
  • Video Youtube : https://youtu.be/3BYyKDJId0w https://youtu.be/mSfkdCEwk1s cvlecture : Install Python & OpenCV (1/2) Install IDE and test OpenCV (2/2) 1. Install Python Window & Mac Download Python installer file :  https://www.python.org/downloads/release/python-373/ download python installer run installer and check Path Make sure where python will be installed check python version pip upgrade >pip install --upgrade pip Refer to other person tutorial :  https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/python.html 2. Install Python OpenCV opencv-python installation >pip install opencv-contrib-python check OpenCV version 3. Install IDE Download Visual Studio Code https://code.visualstudio.com/Download install run VS code -> Set python interpreter -> run simple code Find python in "extensions:marketplace" and install type in command window "python: select interpreter" select python execute which we have installed before run code 4. Test OpenCV Simple OpenCV Code : https://gist.github.com/MareArts/9034e7e638a30551d9ef370c4a364618 import numpy as np import cv2 cap = cv2.VideoCapture(0) ret, frame = cap.read() while(True): # Capture frame-by-frame ret, frame = cap.read() # Our operations on the frame come here gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Display the resulting frame cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break # When everything done, release the capture cap.release() cv2.destroyAllWindows() Thank you! ☕️
  • Youtube : https://youtu.be/IUrZGsw9Hb8 (1/5) : Background Subtraction https://youtu.be/AOvnl08kspw (2/5) : Noise remove, Decision moving area https://youtu.be/mqJZIAwxfUE (3/5) : Morphology https://youtu.be/vRKIrhtnSrg (4/5) : Moving Average for update BG image https://youtu.be/hPeZM_6oly0 (5/5) : Multi thread, upload image to google drive 1. Moving Object Dtection Simple Background Subtraction code : http://study.marearts.com/2017/02/cvlecture-example-code-video-subtraction.html 2. Background Subtraction -> remove noise -> Binarization source code : http:// study.marearts.com /2019/04/ opencv -simple-background- subtraction.html 3. Find Contour -> Draw Rectangle & save image :Refer to here for find contour : Youtube: https://www.youtube.com/watch?v=-qE-evo_QvI Material : https://www.cvlecture.marearts.com/forum/opencv-lecture/chapter-3-drawing-mouse-and-control 4. Morphology Source code : http://study.marearts.com/2013/08/opencv-morphologyex-getstructuringeleme.html 5. Moving Average soruce code: http://study.marearts.com/2019/04/moving-average-background-subtraction.html 6. Upload image to google drive Description: https://www.cvlecture.marearts.com/forum/computer-vision-forum/upload-file-to-google-drive-using-python Youtube: https://youtu.be/ZL_9gqxAdok pyInstaller : https://www.pyinstaller.org 7. Multi Thread Thank you. 🙇🏻‍♂️
  • Video Youtube : https://youtu.be/9T0c6gvHiwg (1/2) https://youtu.be/J5TUipRipj4 (2/2) CV Lecture Video (1/2) Video (2/2) Preparation : Download Visual studio IDE : https://visualstudio.microsoft.com/downloads/ Download OpenCV Library : https://opencv.org/releases.html Window Environment Setting: Window bin file path setting Advanced system settings -> Environment Variables -> Edit System variables -> add opencv bin path Add new path variable Advanced system settings -> Environment Variables -> Add new opencv path in User variables for user VS studio setting: select x64 mode project -> properties VC++ Directories -> Include Directories Add $(OPENCV_LIB)include VC++ Directories -> Library Directories Add $(OPENCV_LIB)x64\cv15\lib CODE test #include <iostream> #include <opencv2/opencv.hpp> #ifdef _DEBUG #pragma comment(lib, "opencv_world401d.lib") #else #pragma comment(lib, "opencv_world401.lib") #endif using namespace cv; using namespace std; int main() { VideoCapture stream1(0); //0 is the id of video device.0 if you have only one camera if (!stream1.isOpened()) { //check if video device has been initialised cout << "cannot open camera"; } namedWindow("Processing"); namedWindow("Origin"); //unconditional loop while (true) { Mat cameraFrame; stream1.read(cameraFrame); //get one frame form video imshow("Origin", cameraFrame); Sobel(cameraFrame, cameraFrame, CV_8U, 1, 0); //sobel processing imshow("Processing", cameraFrame); if (waitKey(30) >= 0) break; } destroyAllWindows(); return 0; } Thank you!