[Ubuntu] OpenCV 설치 방법

dada·2022년 6월 20일
0

Computer Vision

목록 보기
5/7
post-thumbnail

Build core modules

Install minimal prerequisites (Ubuntu 18.04 as reference)

$ sudo apt update && sudo apt install -y cmake g++ wget unzip

Download and unpack sources

$ wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
$ unzip opencv.zip

Create build directory

$ mkdir -p build && cd build

Configure

$ cmake ../opencv-4.x

Build

$ cmake --build .

Compile and install

find out the number of CPU cores in your machine

$ nproc

substitute 2 after -j by the output of nproc

$ make -j8 2>&1 | tee build_messages.txt
$ sudo make install
$ sudo ldconfig

If the output of next command is '3.4.0' then it's ok!

$ pkg-config --modversion opencv

profile
CV, Vision AI 등을 공부합니다

0개의 댓글