Notice
Recent Posts
250x250
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
관리 메뉴

일상 코딩

[링크] ubuntu 20.04 LTS OpenCV 4.5.0 설치법 본문

OpenCV/ubuntu opencv 4.5.0 설치법

[링크] ubuntu 20.04 LTS OpenCV 4.5.0 설치법

polarcompass 2021. 12. 24. 12:18
728x90

https://www.samontab.com/web/2020/11/installing-opencv-4-5-0-in-ubuntu-20-04-lts/

 

Installing OpenCV 4.5.0 in Ubuntu 20.04 LTS – Sebastian Montabone

OpenCV was initially released about 20 years ago. It’s one of the most well established computer vision libraries in the world, with thousands of algorithm implementations ready to be used in commercial and research applications. In this guide I’ll sho

www.samontab.com

 

update & upgrade
$ sudo apt-get update
$ sudo apt-get upgrade
# 한줄로 만들기
sudo apt-get update && sudo apt-get upgrade
필요한 파일 설치
$ sudo apt-get install build-essential cmake python3-numpy python3-dev python3-tk libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev libdc1394-dev libeigen3-dev libgtk-3-dev libvtk7-qt-dev

 

OpenCV 4.5.0 다운로드 및 cmake
$ wget https://github.com/opencv/opencv/archive/4.5.0.tar.gz
$ tar -xvzf 4.5.0.tar.gz
$ rm 4.5.0.tar.gz
$ cd opencv-4.5.0
$ mkdir build;cd build
$ cmake -DBUILD_EXAMPLES=ON ..

 

컴파일
$ make -j4
$ sudo make install
$ echo '/usr/local/lib' | sudo tee --append /etc/ld.so.conf.d/opencv.conf
$ sudo ldconfig
$ echo 'PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig' | sudo tee --append ~/.bashrc
$ echo 'export PKG_CONFIG_PATH' | sudo tee --append ~/.bashrc
$ source ~/.bashrc

 

설치 확인
$ python3
$ import cv2
$ cv2.__version__

 

728x90