opencv 4.5.0 ์„ค์น˜

2022. 10. 7. 11:21

1. ํ•„์š”ํ•œ ์ข…์†์„ฑ ์„ค์น˜

$ sudo apt-get update
$ sudo apt-get install build-essential cmake gcc g++ git unzip pkg-config
$ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libgtk2.0-

 

2. opencv ์™€ opencv_contrib ๋นŒ๋“œ

$ cd ~
$ wget -O opencv.zip https://github.com/opencv/opencv/archive/4.5.0.zip
$ wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.5.0.zip

$ unzip opencv.zip
$ unzip opencv_contrib.zip

$ mv opencv-4.5.0 opencv
$ mv opencv_contrib-4.5.0 opencv_contrib

 

3. ์ปดํŒŒ์ผ์„ ์œ„ํ•œ ์ž„์‹œ ํด๋” build ๋งŒ๋“ค๊ธฐ

$ cd opencv
$ mkdir build

 

4. cmake

$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_WITH_DEBUG_INFO=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_opencv_python3=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB=ON \
-D WITH_FFMPEG=ON \
-D WITH_XINE=ON \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF ..

 

5. ์ปดํŒŒ์ผ

$ cd ~/opencv/build
$ make -j2
$ sudo make install

$ sudo ldconfig
$ make clean

$ sudo apt-get update
how many core?
$ grep ^processor /proc/cpuinfo | wc -l

 

6. ์ถ”๊ฐ€์ ์ธ ์ข…์†์„ฑ ์„ค์น˜

$ sudo apt install ros-noetic-image-transport ros-noetic-image-transport-plugins ros-noetic-cv-bridge ros-noetic-vision-opencv python3-opencv libopencv-dev ros-noetic-image-proc ros-noetic-cv-camera ros-noetic-camera-calibration

'๐Ÿข turtleobot3 @ubuntu 20.04' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

catkin workspace ๋งŒ๋“ค๊ธฐ  (0) 2022.10.07
ROS Noetic ์„ค์น˜  (0) 2022.10.07

BELATED ARTICLES

more