Ubuntu(우분투) 16.04에 Opencv3 설치하기.
이번 포스팅은 Ubuntu(우분투) 16.04에 Opencv3 설치하기 입니다.
https://www.youtube.com/watch?v=MyAOtvwTkT0&t=464s
https://github.com/tekkies/cvdrone
저는 딥러닝을 이용하여 Object_detection 과
Ardrone을 사용하여 위와 같은 예제를 해보기 위해 opencv를 설치합니다.
(위 내용은 다음 순서에 포스팅 하겠습니다.)
opencv의 설치 목적은 달라도 설치과정은 동일합니다.
1. 우선 Qt를 설치합니다.
$ sudo apt-get install g++
$ sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
$ sudo apt-get install build-essential
$ sudo apt-get install libfontconfig1
$ sudo apt-get install mesa-common-dev
$ sudo apt-get install libglu1-mesa-dev -y
아래 링크로 이동후 리눅스 x64 다운
http://download.qt.io/archive/qt/5.5/5.5.0/
$ cd 다운로드/
~/다운로드$ chmod +x qt-opensource-linux-x64-5.5.0-2.run
~/다운로드$ ./qt-opensource-linux-x64-5.5.0-2.run
$ sudo nano ~/.bashrc
bashrc파일 끝에 아래 내용을 추가.
export PATH=/opt/Qt5.5.0/5.5/gcc_64/bin/:$PATH
패스 환경 추가한 것을 적용시키고
source ~/.bashrc
새로운 터미널을 열고
$ qmake --version
QMake version 3.0
Using Qt version 5.5.0 in /opt/Qt5.5.0/5.5/gcc_64/lib
위와 같이 나오면 설치가 완료!
2. 이제 Opencv3을 설치합니다.
ffmpeg를 따로 설치 해줍니다.
$ sudo add-apt-repository ppa:jonathonf/ffmpeg-3
$ sudo apt update
$ sudo apt install ffmpeg libav-tools x264 x265
(1) OpenCV 소스코드 다운로드
$ mkdir tmp
$ cd tmp
$ git clone https://github.com/Itseez/opencv.git
$ git clone https://github.com/Itseez/opencv_contrib.git
(2) OpenCV 설정
$ cd opencv
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr \-D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON \-D WITH_TBB=ON -D WITH_IPP=OFF \-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ../
(3) OpenCV 컴파일 후 설치
$ make -j8 <-- CUP 코어수 6세대 기준 i5=4 i7=8 (그냥 make 해줘도 상관 없습니다.!)
$ sudo make install
$ sudo ldconfig
(4) opencv 버전 확인
$ pkg-config --modversion opencv
3.1.0
Future
Information Network Architecture Lab.
Korea University
댓글
댓글 쓰기