OpenCV 3.4와 opencv_contrib(extra modules)를 컴파일하여 Raspberry Pi 3에 설치하는 방법을 다룹니다.


2017년 11월 29일에 릴리즈된 Raspbian 이미지를 사용했습니다.

OpenCV를 컴파일하기 위해서는 최소 16G Micro SD 카드를 사용해야 합니다.


제가 라즈비안 초기 이미지부터 진행해서 검증하기 때문에 상황이 다른 경우에는 모두  대처하기가 힘든 점을 감안해주세요.


최종 업데이트 2017.12. 30




1. OpenCV 2.4 버전 제거

2. 기존 설치된 패키지 업그레이드

3. OpenCV 컴파일 전 필요한 패키지 설치

4. OpenCV 설정과 컴파일 및 설치

5. OpenCV 설치 결과 확인

   5.1. C/C++

   5.2. Python



1. OpenCV 2.4 버전 제거

OpenCV 2.4대 버전이 설치되어 있으면 새로 설치하는 OpenCV 3.4 버전이 제대로 동작하지 않기 때문에 제거해주어야 합니다.



아래처럼 보이면 OpenCV 2.4대 버전이 설치안되어 있는 상태입니다.

다음 단계로 넘어가도  됩니다.


pi@raspberrypi:~ $ pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found



OpenCV 2.4대 버전이 설치되어 있는 경우에는 OpenCV  2.4 버전이 출력됩니다.

pi@raspberrypi:~ $  pkg-config --modversion opencv
2.4.9.1




다음 명령으로 OpenCV 라이브러리 설정 파일을 포함해서 기존에 설치된 OpenCV 패키지를 삭제하고 진행해야 합니다.

pi@raspberrypi:~ $ sudo apt-get purge  libopencv* python-opencv
pi@raspberrypi:~ $ sudo apt-get autoremove



2. 기존 설치된 패키지 업그레이드

OpenCV 3.3.1을 설치해주기 전에 기존에 설치된 패키지들을 업그레이드 해주기 위한 작업입니다.

오래 걸리더라도 해주는 것이 좋습니다.


Raspbian 저장소(repository)로부터 패키지 리스트를 업데이트합니다.

기존에 설치된 패키지들의 새로운 버전이 저장소에 있다면 리스트를 업데이트 하기위해 실행합니다.


pi@raspberrypi:~ $ sudo apt-get update




기존에 설치된 패키지의 새로운 버전이 있으면 업그레이드합니다.


pi@raspberrypi:~ $ sudo apt-get upgrade




3. OpenCV 컴파일 전 필요한 패키지 설치

일부 패키지는 배포된 Raspbian 이미지에 이미 포함되어 있는 경우도 있습니다.

또는 다른 패키지 설치시 같이 설치되기도 하지만 필요한 패키지들이라 언급하도록 하겠습니다.


OpenCV를 컴파일하는데 사용하는 것들이 포함된 패키지들을 설치합니다.


build-essential 패키지에는 C/C++ 컴파일러와 관련 라이브러리, make 같은 도구들이 포함되어 있습니다.

cmake는 컴파일 옵션이나 빌드된 라이브러리에 포함시킬 OpenCV 모듈 설정등을 위해 필요합니다.


$ sudo apt-get install build-essential cmake




pkg-config는 프로그램 컴파일 및 링크시 필요한 라이브러리에 대한 정보를 메타파일(확장자가 .pc 인 파일)로부터 가져오는데 사용됩니다.


터미널에서 특정 라이브러리를 사용한 소스코드를 컴파일시 필요한 컴파일러 및 링커 플래그를 추가하는데 도움이 됩니다.  

$ sudo apt-get install pkg-config




특정 포맷의 이미지 파일을 불러오거나 기록하기 위해 필요한 패키지들입니다.

$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev




특정 코덱의 비디오 파일을 읽어오거나 기록하기 위해 필요한 패키지들입니다.

$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libxvidcore-dev libx264-dev libxine2-dev




Video4Linux 패키지는 리눅스에서 실시간 비디오 캡처를 지원하기 위한 디바이스 드라이버와 API를 포함하고 있습니다.

$ sudo apt-get install libv4l-dev v4l-utils




GStreamer는 비디오 스트리밍을 위한 라이브러리입니다.

$ sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev




OpenCV에서는 highgui 모듈을 사용하여 자체적으로 윈도우 생성하여 이미지나 비디오들을 보여줄 수 있습니다.

윈도우 생성 등의 GUI를 위해 gtk 또는 qt를 선택해서 사용가능합니다.  

여기서는 qt4를 지정해주었습니다. QImage와 Mat 간의 변환에는 영향을 주지 않습니다.

$ sudo apt-get install libqt4-dev



그외 선택 가능한 패키지는 다음과 같습니다.

libgtk2.0-dev
libgtk-3-dev

libqt5-dev




OpenGL 지원하기 위해 필요한 라이브러리입니다.

$ sudo apt-get install mesa-utils libgl1-mesa-dri libqt4-opengl-dev




OpenCV 최적화를 위해 사용되는 라이브러리들입니다.

$ sudo apt-get install libatlas-base-dev gfortran libeigen3-dev




python2.7-dev와 python3-dev 패키지는 OpenCV-Python 바인딩을 위해 필요한 패키지들입니다.

Numpy는 매트릭스 연산등을 빠르게 처리할 수 있어서 OpenCV에서 사용됩니다.

$ sudo apt-get install python2.7-dev python3-dev python-numpy python3-numpy




4. OpenCV 설정과 컴파일 및 설치

소스 코드를 저장할 임시 디렉토리를 생성하여 이동 후.. 진행합니다


pi@raspberrypi:~ $ mkdir opencv
pi@raspberrypi:~ $ cd opencv
pi@raspberrypi:~/opencv $




OpenCV 3.4.0 소스코드를 다운로드 받아 압축을 풀어줍니다.

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




opencv_contrib(extra modules) 소스코드를 다운로드 받아 압축을 풀어줍니다.

SIFT, SURF 등을 사용하기 위해 필요합니다.

$ wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.4.0.zip
$ unzip opencv_contrib.zip




다음처럼 두 개의 디렉토리가 생성됩니다.


pi@raspberrypi:~/opencv $  ls -d */

opencv-3.4.0  opencv_contrib-3.4.0




opencv-3.4.0 디렉토리로 이동하여 build 디렉토리를 생성하고 build 디렉토리로 이동합니다.

컴파일은 build 디렉토리에서 이루어집니다.


pi@raspberrypi:~/opencv $  cd opencv-3.4.0

pi@raspberrypi:~/opencv/opencv-3.4.0 $  mkdir build

pi@raspberrypi:~/opencv/opencv-3.4.0 $  cd build

pi@raspberrypi:~/opencv/opencv-3.4.0/build $  




cmake를 사용하여 OpenCV 컴파일 설정을 해줍니다.  복사해서 터미널에 붙여넣기 해주면 됩니다.


cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=OFF \
-D WITH_IPP=OFF \
-D WITH_1394=OFF \
-D BUILD_WITH_DEBUG_INFO=OFF \
-D BUILD_DOCS=OFF \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D ENABLE_NEON=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \
-D WITH_V4L=ON  \
-D WITH_FFMPEG=ON \
-D WITH_XINE=ON \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
../




다음 처럼 cmake 실행 중에  추가적인 다운로드도 있으므로 라즈베리파이에 인터넷이 연결된 상태에서 진행하세요..



tiny-dnn: Download: v1.0.0a3.tar.gz

-- xfeatures2d/boostdesc: Download: boostdesc_bgm.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
-- xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
-- xfeatures2d/vgg: Download: vgg_generated_48.i
-- xfeatures2d/vgg: Download: vgg_generated_64.i
-- xfeatures2d/vgg: Download: vgg_generated_80.i
-- xfeatures2d/vgg: Download: vgg_generated_120.i




다음과 같은 메시지가 보이면 정상적으로 된 것입니다.


-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/opencv/opencv-3.4.0/build





설정한 결과입니다.


-- General configuration for OpenCV 3.4.0 =====================================
--   Version control:               unknown
--
--   Extra modules:
--     Location (extra):            /home/pi/opencv/opencv_contrib-3.4.0/modules
--     Version control (extra):     unknown
--
--   Platform:
--     Timestamp:                   2017-12-30T12:28:43Z
--     Host:                        Linux 4.9.59-v7+ armv7l
--     CMake:                       3.7.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               RELEASE
--
--   CPU/HW features:
--     Baseline:                    NEON
--       requested:                 DETECT
--       required:                  NEON
--       disabled:                  VFPV3
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                /usr/bin/c++  (ver 6.3.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):
--     Linker flags (Debug):
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          dl m pthread rt /usr/lib/arm-linux-gnueabihf/libGLU.so /usr/lib/arm-linux-gnueabihf/libGL.so
--     3rdparty dependencies:
--
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dpm face features2d flann fuzzy highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python2 python3 python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    js world
--     Disabled by dependency:      -
--     Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv dnn_modern freetype hdf java matlab ovis sfm ts viz
--     Applications:                apps
--     Documentation:               NO
--     Non-free algorithms:         NO
--
--   GUI:
--     QT:                          YES (ver 4.8.7 EDITION = OpenSource)
--       QT OpenGL support:         YES (/usr/lib/arm-linux-gnueabihf/libQtOpenGL.so)
--     GTK+:                        NO
--     OpenGL support:              YES (/usr/lib/arm-linux-gnueabihf/libGLU.so /usr/lib/arm-linux-gnueabihf/libGL.so)
--     VTK support:                 NO
--
--   Media I/O:
--     ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver )
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.2.54)
--     TIFF:                        /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.8)
--     JPEG 2000:                   /usr/lib/arm-linux-gnueabihf/libjasper.so (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--
--   Video I/O:
--     FFMPEG:                      YES
--       avcodec:                   YES (ver 57.64.101)
--       avformat:                  YES (ver 57.56.101)
--       avutil:                    YES (ver 55.34.101)
--       swscale:                   YES (ver 4.2.100)
--       avresample:                NO
--     GStreamer:
--       base:                      YES (ver 1.10.4)
--       video:                     YES (ver 1.10.4)
--       app:                       YES (ver 1.10.4)
--       riff:                      YES (ver 1.10.4)
--       pbutils:                   YES (ver 1.10.4)
--     libv4l/libv4l2:              NO
--     v4l/v4l2:                    linux/videodev2.h
--     Xine:                        YES (ver 1.2.6)
--     gPhoto2:                     NO
--
--   Parallel framework:            pthreads
--
--   Trace:                         YES (built-in)
--
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.2)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--
--   NVIDIA CUDA:                   NO
--
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/pi/opencv/opencv-3.4.0/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
--
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.13)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.13)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python2.7/dist-packages
--
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.5.3)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python3.5/dist-packages
--
--   Python (for build):            /usr/bin/python2.7
--
--   Java:
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
--
--   Matlab:                        NO
--
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/opencv/opencv-3.4.0/build




다음처럼 Python 2 또는 Python 3 라이브러리 항목이 보이지 않는 경우에는


--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.13)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.13)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python2.7/dist-packages
--
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.5.3)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python3.5/dist-packages
--
--   Python (for build):            /usr/bin/python2.7




다음 붉은색 줄처럼 해당 경로들을 직접 적어줘야 합니다.


$ cmake -D CMAKE_BUILD_TYPE=RELEASE \

-D CMAKE_INSTALL_PREFIX=/usr/local \

-D WITH_TBB=OFF \

-D WITH_IPP=OFF \

-D WITH_1394=OFF \

-D BUILD_WITH_DEBUG_INFO=OFF \

-D BUILD_DOCS=OFF \

-D INSTALL_C_EXAMPLES=ON \

-D INSTALL_PYTHON_EXAMPLES=ON \

-D BUILD_EXAMPLES=OFF \

-D BUILD_TESTS=OFF \

-D BUILD_PERF_TESTS=OFF \

-D ENABLE_NEON=ON \

-D WITH_QT=ON \

-D WITH_OPENGL=ON \

-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \

-D WITH_V4L=ON  \

-D WITH_FFMPEG=ON \

-D WITH_XINE=ON \

-D BUILD_NEW_PYTHON_SUPPORT=ON \

-D PYTHON2_INCLUDE_DIR=/usr/include/python2.7 \

-D PYTHON2_NUMPY_INCLUDE_DIRS=/usr/lib/python2.7/dist-packages/numpy/core/include/ \

-D PYTHON2_PACKAGES_PATH=/usr/lib/python2.7/dist-packages \

-D PYTHON2_LIBRARY= /usr/lib/arm-linux-gnueabihf/libpython2.7.so \

-D PYTHON3_INCLUDE_DIR=/usr/include/python3.5m \

-D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include/ \

-D PYTHON3_PACKAGES_PATH=/usr/lib/python3.5/dist-packages \

-D PYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \

../




make 명령을 사용하여 컴파일을 시작합니다.

-j4 옵션은 사용하면 에러가 날 가능성이 있기 때문에 사용하지 않는게 좋습니다.


pi@raspberrypi:~/opencv/opencv-3.4.0/build $ time make




time 명령으로 측정된 컴파일하는데 걸린 시간입니다.  2시간 40분정도 걸렸습니다.





이제 컴파일 결과를 설치합니다.


pi@raspberrypi:~/opencv/opencv-3.4.0/build $ sudo make install




샘플 코드들은 /usr/local/share/OpenCV/samples/ 위치에 복사됩니다.





/etc/ld.so.conf.d/ 디렉토리에 /usr/local/lib를 포함하는 설정파일이 있는지 확인합니다.

pi@raspberrypi:~/opencv/opencv-3.4.0/build $ cat /etc/ld.so.conf.d/*
/opt/vc/lib
# Multiarch support
/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf/libfakeroot
# libc default configuration
/usr/local/lib




/usr/local/lib이 출력되지 않았다면 다음 명령을 수행합니다.

pi@raspberrypi:~/opencv/opencv-3.4.0/build $ sudo sh -c 'echo '/usr/local/lib' > /etc/ld.so.conf.d/opencv.conf'




/usr/local/lib을 찾은 경우나 못찾아서 추가한 작업을 한 경우 모두 컴파일시 opencv  라이브러리를 찾을 수 있도록 다음 명령을 실행합니다.

pi@raspberrypi:~/opencv/opencv-3.4.0/build $ sudo ldconfig




5. OpenCV 설치 결과 확인

5.1. C/C++

C/C++를 위해 OpenCV 라이브러리 사용가능 여부를 확인합니다.

문제 없으면 설치된 OpenCV 라이브러리의 버전이 출력됩니다.


pi@raspberrypi:~/opencv/opencv-3.4.0/build $  pkg-config --modversion opencv
3.4.0



아래처럼 opencv를 찾을 수 없다고 나오면  추가 작업이 필요합니다.


pi@raspberrypi:~/opencv/opencv-3.4.0/build $  pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found




pkg-config 명령이 /usr/local/lib/pkgconfig 경로에 있는 opencv.pc 파일을 찾을 수 있도록 해줘야 합니다.


$ sudo sh -c 'echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig >> /etc/bash.bashrc'
$ sudo sh -c 'echo export PKG_CONFIG_PATH >> /etc/bash.bashrc'



로그아웃했다가 로그인하면 적용이됩니다.



다시 확인했을 때,  OpenCV 버전이 나와야 합니다.


pi@raspberrypi:~/opencv/opencv-3.4.0/build $ pkg-config --modversion opencv
3.4.0




pkg-config --libs --cflags opencv 명령을 실행했을 때 다음처럼 나오면 문제없이 설치가 완료된 것입니다.


.


예제 코드를 하나 가져와서 컴파일 해보겠습니다.


$ cp /usr/local/share/OpenCV/samples/cpp/facedetect.cpp ./




테스트를 하기 위해  필요한 웹캠을 Raspberry Pi에 먼저 연결합니다.


대부분의 웹캠은 연결후 dmesg | tail 명령어로 해당 웹캠을 확인시 다음처럼 문제 없이 인식이 됩니다.

인식이 안되면 해당 웹캠을 위한 디바이스 드라이버를 설치해줘야 합니다.





/dev/video0 디바이스 파일이 생성되었는지 확인해봅니다.





이제 컴파일 후, 실행시켜 봅니다.


$ g++ -o facedetect facedetect.cpp $(pkg-config --libs --cflags opencv)  

$ ./facedetect --cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml " --scale=1.3




터미널 프로그램으로 MobaXterm을 사용하면 SSH 접속 후, 바로 실행 결과를 확인 가능합니다.

(속도는 느립니다..)


https://mobaxterm.mobatek.net/




검출시간이 표시되면서 카메라 영상에 얼굴이 검출된 결과를 얻을 수 있습니다.




5.2. Python

python 2.x와 python 3x에서 opencv 라이브러리를 사용가능한지는 다음처럼 확인합니다.

각각 OpenCV 버전이 출력되어야 합니다.

pi@raspberrypi:~/opencv/opencv-3.4.0/build $ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.4.0'
>>>
pi@raspberrypi:~/opencv/opencv-3.4.0/build $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.4.0'
>>>




예제 코드를 실행해봅니다.


$ python /usr/local/share/OpenCV/samples/python/facedetect.py --cascade "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade "/usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml" /dev/video0


$ python3 /usr/local/share/OpenCV/samples/python/facedetect.py --cascade "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade "/usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml" /dev/video0




카메라 영상에 얼굴이 검출된 결과를 얻을 수 있습니다.



이제 필요 없어진 컴파일에 사용했던 opencv 소스코드 디렉토리를 삭제합니다.


pi@raspberrypi:~/opencv/opencv-3.4.0/build $ cd
pi@raspberrypi:~ $ rm -rf opencv





  1. 이전 댓글 더보기
  2. dl 2018.03.05 04:57 신고

    >>> import cv2
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.5/dist-packages/cv2/__init__.py", line 9, in <module>
    from .cv2 import *
    ImportError: libImath-2_2.so.12: cannot open shared object file: No such file or directory

    이러한 오류 발생시 어떻게 해야할까요?

  3. KSG 2018.03.08 06:56 신고

    안녕하세요! 늘 도움 얻는 학생입니다.
    여러번 다 설치 성공했었는데 오늘은 잘 안되네요 ㅜ
    cmake 시에 이런 메시지가 뜹니다

    CMake Warning at cmake/OpenCVUtils.cmake:1025(add_library):
    Cannot generate a safe runtime search path for target opencv_imgcodecs
    because files in some directories may conflict with libraries in implicit directories:

    runtime library [libpng12.so.0] in /usr/lib/arm-linux-gnueabihf may be hidden by files in:
    /usr/local/lib

    Some of these libraries may not be found correctly.
    Call Stack (most recenct call first):
    cmake/OpenCVModule.cmake:850 (ocv_add_library)
    cmake/OpenCVModule.cmake:784 (_ocv_create_module)
    modules/imgcodecs/CMakeLists.txt:115 (ocv_create_module)

    -- Generating done
    -- Build files have been written to: /home/pi/opencv/opencv-3.4.0/build

    이것때문에 중간에 make 로 컴파일시에 PNG12_0 오류 (libpng12-dev 를 찾을수 없다는 메시지) 가 뜨면서 컴파일이 안되네요 ㅜ
    구글에 아무리 영어,한국어,독어 다 찾아봐도 유사한 상황이 없어요 ㅜ
    괜히 qt5 깔아보라 그래서 깔아보면 이번엔 충돌문제가 생깁니다.

    혹시 원인을 좀 알 수 있을까요...? 벌써 4일째 설치만 붙들고 있네요...
    감사합니다

  4. lee 2018.03.12 20:03 신고

    안녕하십니까 작성자님! 라즈베리파이를 공부하고있는학생입니다!
    포스팅보면서 make 파일을 만드는중인데요!
    [ 34%] Building CXX object modules/flann/CMakeFiles/opencv_flann.dir/src/flann.cpp.o

    c++: internal compiler error: 세그멘테이션 오류 (program cc1plus)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
    modules/flann/CMakeFiles/opencv_flann.dir/build.make:62: 'modules/flann/CMakeFiles/opencv_flann.dir/src/flann.cpp.o' 타겟에 대한 명령이 실패했습니다
    make[2]: *** [modules/flann/CMakeFiles/opencv_flann.dir/src/flann.cpp.o] 오류 4
    CMakeFiles/Makefile2:2427: 'modules/flann/CMakeFiles/opencv_flann.dir/all' 타겟에 대한 명령이 실패했습니다
    make[1]: *** [modules/flann/CMakeFiles/opencv_flann.dir/all] 오류 2
    Makefile:160: 'all' 타겟에 대한 명령이 실패했습니다
    make: *** [all] 오류 2

    real 0m6.311s
    user 0m2.770s
    sys 0m0.790s

    지금과 같이 이러한 오류들이 뜨는데 어떻게 해결해야하나요?
    새로 해봐두 자꾸 여기서 오류가 뜨네요

    • webnautes webnautes 2018.03.12 20:10 신고

      지금 확인해보니 opencv 3.4외에 opencv 3.4.1이 올라왔던데 어느 버전으로 진행했나요?

      제 경우에는 opencv 3.4로 했습니다.

  5. HWE 2018.03.20 17:09 신고

    항상 감사합니다. 배움에 도움이 많이 되었습니다.

  6. So 2018.03.25 18:17 신고

    아래쪽에 {{/dev/video0 디바이스 파일이 생성되었는지 확인해봅니다.}} 이 부분에서
    pi@raspberrypi:~/opencv/opencv-3..0/build $ ls /dev/video*
    ls : cannot access '/dev/video*' : No such file or directory
    라고 뜨는건 어디가 문제인지 할 수 있을까용?

    • webnautes webnautes 2018.03.25 18:20 신고

      라즈베리파이에서 카메라를 인식못해서(아마도 해당 카메라의 디바이스 드라이버를 지원하지 않아서) 카메라에 접근시 사용되는 장치 파일인 /dev/vidoe0파일이 생성되지 않은 듯싶습니다.

  7. 어으 2018.03.27 01:28 신고

    /usr/local/share/OpenCV/samples/ 위치에 샘플코드들이 복사된다고 하셨는데 저 경로로 들어가면 디렉터리가 없다고 뜹니다..어떻게 해야할까요

    • webnautes webnautes 2018.03.27 08:15 신고

      OpenCV 소스코드에 있는 것을 사용하세요.opencv 디렉토리에 samples라는 디렉토리가 있습니다.

  8. So 2018.03.27 20:39 신고

    바로 위에위에 글에서 답변에 카메라 드라이버를 설치해야 한다고 하셨는데 어떻게 받는지 알 수 있을까용??ㅠㅠㅠ
    저는 그냥 일반 라즈베리파이 카메라3을 사용합니다

    • webnautes webnautes 2018.03.27 21:06 신고

      Raspberry Pi camera 같은데 맞나요?
      USB포트가 아닌 라즈베리파이 본체에 흰선으로 연결하는...

      그렇다면

      다음 명령으로 파이 설정을 실행한 다음.
      sudo raspi-config


      Enable camera 옵션을 YES로 변경하세요.. 아마 인터페이스 하위 항목에 있었던듯 해요.

      그리고 나서 설정을 저장하고.. 파이를 재부팅하세요..

      재부팅후..
      다음 명령을 하세요.
      sudo modprobe bcm2835-v4l2


      그리고 나서 다음 명령을 하면
      ls /dev | grep vid

      video0가 보일겁니다.

  9. So 2018.03.27 21:49 신고

    정말정말 죄송한데영 위에알려주신데로 해두 안되면 답이 없는거졍?
    ls/dev|grep vid 치면 아무것도 뜨지 않아용 ㅠㅠ

  10. hmshim 2018.03.29 20:11 신고

    cmake 시 에러 잡고 있습니다.

    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.3.1/modules \
    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \
    으로 변경

    -- Looking for ccache - not found
    -- FP16 is not supported by C++ compiler
    이 에러는 상관 없어 보이기도 하고요

    libqt5 관련 라이버러리 에러가 있는데 설치하고 싶은데 라이버러리 이름이 ??
    sudo apt-get install libqt5-default ??

    Could not find a package configuration file provided by "Qt5Core" with any
    of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

    관련 에러가 많이 있어서......
    운영자님 리플 부탁드려요

  11. hmshim 2018.03.30 08:12 신고

    pi@raspberrypi:~/opencv/opencv-3.4.0/build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \
    > -D CMAKE_INSTALL_PREFIX=/usr/local \
    > -D WITH_TBB=OFF \
    > -D WITH_IPP=OFF \
    > -D WITH_1394=OFF \
    > -D BUILD_WITH_DEBUG_INFO=OFF \
    > -D BUILD_DOCS=OFF \
    > -D INSTALL_C_EXAMPLES=ON \
    > -D INSTALL_PYTHON_EXAMPLES=ON \
    > -D BUILD_EXAMPLES=OFF \
    > -D BUILD_TESTS=OFF \
    > -D BUILD_PERF_TESTS=OFF \
    > -D WITH_OPENGL=ON \
    > -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \
    > -D WITH_V4L=ON \
    > -D WITH_FFMPEG=ON \
    > -D WITH_XINE=ON \
    > -D BUILD_NEW_PYTHON_SUPPORT=ON \
    > -D PYTHON2_INCLUDE_DIR=/usr/include/python2.7 \
    > -D PYTHON2_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python2.7 \
    > -D PYTHON2_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython2.7.so \
    > -D PYTHON3_INCLUDE_DIR=/usr/include/python3.5m \
    > -D PYTHON3_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python3.5m \
    > -D PYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \
    > ../
    -- Looking for ccache - not found
    -- FP16 is not supported by C++ compiler
    CMake Error at cmake/OpenCVCompilerOptimizations.cmake:412 (message):
    Required baseline optimization is not supported: NEON
    (CPU_BASELINE_REQUIRE=;NEON)
    Call Stack (most recent call first):
    cmake/OpenCVCompilerOptions.cmake:259 (include)
    CMakeLists.txt:526 (include)


    -- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
    -- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.8")
    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
    By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "Qt5Core", but
    CMake did not find one.

    Could not find a package configuration file provided by "Qt5Core" with any
    of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

    Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
    "Qt5Core_DIR" to a directory containing one of the above files. If
    "Qt5Core" provides a separate development package or SDK, be sure it has
    been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
    By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "Qt5Gui", but
    CMake did not find one.

    Could not find a package configuration file provided by "Qt5Gui" with any
    of the following names:

    Qt5GuiConfig.cmake
    qt5gui-config.cmake

    Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
    "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui"
    provides a separate development package or SDK, be sure it has been
    installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
    By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
    has asked CMake to find a package configuration file provided by
    "Qt5Widgets", but CMake did not find one.

    Could not find a package configuration file provided by "Qt5Widgets" with
    any of the following names:

    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake

    Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
    "Qt5Widgets_DIR" to a directory containing one of the above files. If
    "Qt5Widgets" provides a separate development package or SDK, be sure it has
    been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
    By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "Qt5Test", but
    CMake did not find one.

    Could not find a package configuration file provided by "Qt5Test" with any
    of the following names:

    Qt5TestConfig.cmake
    qt5test-config.cmake

    Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set
    "Qt5Test_DIR" to a directory containing one of the above files. If
    "Qt5Test" provides a separate development package or SDK, be sure it has
    been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
    By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this
    project has asked CMake to find a package configuration file provided by
    "Qt5Concurrent", but CMake did not find one.

    Could not find a package configuration file provided by "Qt5Concurrent"
    with any of the following names:

    Qt5ConcurrentConfig.cmake
    qt5concurrent-config.cmake

    Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set
    "Qt5Concurrent_DIR" to a directory containing one of the above files. If
    "Qt5Concurrent" provides a separate development package or SDK, be sure it
    has been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    -- Looking for linux/videodev.h
    -- Looking for linux/videodev.h - not found
    -- Looking for linux/videodev2.h
    -- Looking for linux/videodev2.h - found
    -- Looking for sys/videoio.h
    -- Looking for sys/videoio.h - not found
    -- Checking for module 'libavresample'
    -- No package 'libavresample' found
    -- Checking for module 'libgphoto2'
    -- No package 'libgphoto2' found
    -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
    -- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR)
    -- A library with BLAS API found.
    -- A library with LAPACK API found.
    -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
    -- Could NOT find Pylint (missing: PYLINT_EXECUTABLE)
    -- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
    -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
    -- Caffe: NO
    -- Protobuf: NO
    -- Glog: NO
    -- Looking for tiny_dnn.h
    -- Looking for tiny_dnn.h - found
    -- Found tiny-dnn in: /home/pi/opencv/opencv-3.4.0/build/3rdparty/tinydnn/tiny-dnn-1.0.0a3
    -- The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE='')
    -- freetype2: YES
    -- harfbuzz: YES
    -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
    -- Module opencv_ovis disabled because OGRE3D was not found
    -- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
    -- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
    -- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
    -- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
    -- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
    -- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/core/src/convert.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/core/src/convert.fp16.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/core/src/convert.sse4_1.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/mathfuncs_core.sse2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/mathfuncs_core.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/mathfuncs_core.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/stat.sse4_2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/stat.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/corner.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/filter.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/imgwarp.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/imgwarp.sse4_1.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/resize.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/resize.sse4_1.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/undistort.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/imgproc/accum.sse2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/imgproc/accum.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/imgproc/accum.neon.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/objdetect/src/haar.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/dnn/layers/layers_common.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/dnn/layers/layers_common.avx2.cpp
    -- freetype2: YES
    -- harfbuzz: YES
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/features2d/src/fast.avx2.cpp
    -- Checking for modules 'tesseract;lept'
    -- No package 'tesseract' found
    -- No package 'lept' found
    -- Tesseract: NO
    --
    -- General configuration for OpenCV 3.4.0 =====================================
    -- Version control: unknown
    --
    -- Extra modules:
    -- Location (extra): /home/pi/opencv/opencv_contrib-3.4.0/modules
    -- Version control (extra): unknown
    --
    -- Platform:
    -- Timestamp: 2018-03-20T11:39:06Z
    -- Host: Linux 4.9.80-v7+ armv7l
    -- CMake: 3.7.2
    -- CMake generator: Unix Makefiles
    -- CMake build tool: /usr/bin/make
    -- Configuration: RELEASE
    --
    -- CPU/HW features:
    -- Baseline:
    -- requested: DETECT
    -- required: NEON
    -- disabled: VFPV3 NEON
    --
    -- C/C++:
    -- Built as dynamic libs?: YES
    -- C++11: YES
    -- C++ Compiler: /usr/bin/c++ (ver 6.3.0)
    -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
    -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
    -- C Compiler: /usr/bin/cc
    -- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
    -- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
    -- Linker flags (Release):
    -- Linker flags (Debug):
    -- ccache: NO
    -- Precompiled headers: YES
    -- Extra dependencies: dl m pthread rt /usr/lib/arm-linux-gnueabihf/libGLU.so /usr/lib/arm-linux-gnueabihf/libGL.so
    -- 3rdparty dependencies:
    --
    -- OpenCV modules:
    -- To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dpm face features2d flann freetype fuzzy highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python2 python3 python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
    -- Disabled: js world
    -- Disabled by dependency: -
    -- Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv dnn_modern hdf java matlab ovis sfm viz
    -- Applications: apps
    -- Documentation: NO
    -- Non-free algorithms: NO
    --
    -- GUI:
    -- QT: YES (ver 4.8.7 EDITION = OpenSource)
    -- QT OpenGL support: YES (/usr/lib/arm-linux-gnueabihf/libQtOpenGL.so)
    -- GTK+: NO
    -- OpenGL support: YES (/usr/lib/arm-linux-gnueabihf/libGLU.so /usr/lib/arm-linux-gnueabihf/libGL.so)
    -- VTK support: NO
    --
    -- Media I/O:
    -- ZLib: /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
    -- JPEG: /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver )
    -- WEBP: build (ver encoder: 0x020e)
    -- PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.28)
    -- TIFF: /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.8)
    -- JPEG 2000: /usr/lib/arm-linux-gnueabihf/libjasper.so (ver 1.900.1)
    -- OpenEXR: build (ver 1.7.1)
    --
    -- Video I/O:
    -- FFMPEG: YES
    -- avcodec: YES (ver 57.64.101)
    -- avformat: YES (ver 57.56.101)
    -- avutil: YES (ver 55.34.101)
    -- swscale: YES (ver 4.2.100)
    -- avresample: NO
    -- GStreamer:
    -- base: YES (ver 1.10.4)
    -- video: YES (ver 1.10.4)
    -- app: YES (ver 1.10.4)
    -- riff: YES (ver 1.10.4)
    -- pbutils: YES (ver 1.10.4)
    -- libv4l/libv4l2: NO
    -- v4l/v4l2: linux/videodev2.h
    -- Xine: YES (ver 1.2.6)
    -- gPhoto2: NO
    --
    -- Parallel framework: pthreads
    --
    -- Trace: YES (built-in)
    --
    -- Other third-party libraries:
    -- Lapack: NO
    -- Eigen: YES (ver 3.3.2)
    -- Custom HAL: YES (carotene (ver 0.0.1))
    --
    -- NVIDIA CUDA: NO
    --
    -- OpenCL: YES (no extra features)
    -- Include path: /home/pi/opencv/opencv-3.4.0/3rdparty/include/opencl/1.2
    -- Link libraries: Dynamic load
    --
    -- Python 2:
    -- Interpreter: /usr/bin/python2.7 (ver 2.7.13)
    -- Libraries: /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.13)
    -- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include/ (ver 1.12.1)
    -- packages path: /usr/lib/python2.7/dist-packages
    --
    -- Python 3:
    -- Interpreter: /usr/bin/python3 (ver 3.5.3)
    -- Libraries: /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
    -- numpy: /usr/lib/python3/dist-packages/numpy/core/include/ (ver 1.12.1)
    -- packages path: /usr/lib/python3.5/dist-packages
    --
    -- Python (for build): /usr/bin/python2.7
    --
    -- Java:
    -- ant: NO
    -- JNI: NO
    -- Java wrappers: NO
    -- Java tests: NO
    --
    -- Matlab: NO
    --
    -- Install to: /usr/local
    -- -----------------------------------------------------------------
    --
    -- Configuring incomplete, errors occurred!
    See also "/home/pi/opencv/opencv-3.4.0/build/CMakeFiles/CMakeOutput.log".
    See also "/home/pi/opencv/opencv-3.4.0/build/CMakeFiles/CMakeError.log".

  12. hmshim 2018.03.30 08:14 신고

    위쪽 전체 결과입니다.

  13. hmshim 2018.03.30 10:15 신고

    Success........
    build folder delete......... remake...

    pi@raspberrypi:~/opencv/opencv-3.4.0/build $ cd ..
    pi@raspberrypi:~/opencv/opencv-3.4.0 $ rm -r build
    pi@raspberrypi:~/opencv/opencv-3.4.0 $ ls
    3rdparty CONTRIBUTING.md README.md cmake doc modules samples
    CMakeLists.txt LICENSE apps data include platforms
    pi@raspberrypi:~/opencv/opencv-3.4.0 $ cd build
    bash: cd: build: 그런 파일이나 디렉터리가 없습니다
    pi@raspberrypi:~/opencv/opencv-3.4.0 $ mkdir build
    pi@raspberrypi:~/opencv/opencv-3.4.0 $ cd build
    pi@raspberrypi:~/opencv/opencv-3.4.0/build $
    pi@raspberrypi:~/opencv/opencv-3.4.0/build $
    pi@raspberrypi:~/opencv/opencv-3.4.0/build $
    pi@raspberrypi:~/opencv/opencv-3.4.0/build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \
    > -D CMAKE_INSTALL_PREFIX=/usr/local \
    > -D WITH_TBB=OFF \
    > -D WITH_IPP=OFF \
    > -D WITH_1394=OFF \
    > -D BUILD_WITH_DEBUG_INFO=OFF \
    > -D BUILD_DOCS=OFF \
    > -D INSTALL_C_EXAMPLES=ON \
    > -D INSTALL_PYTHON_EXAMPLES=ON \
    > -D BUILD_EXAMPLES=OFF \
    > -D BUILD_TESTS=OFF \
    > -D BUILD_PERF_TESTS=OFF \
    > -D ENABLE_NEON=ON \
    > -D WITH_QT=ON \
    > -D WITH_OPENGL=ON \
    > -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \
    > -D WITH_V4L=ON \
    > -D WITH_FFMPEG=ON \
    > -D WITH_XINE=ON \
    > -D BUILD_NEW_PYTHON_SUPPORT=ON \
    > -D PYTHON2_INCLUDE_DIR=/usr/include/python2.7 \
    > -D PYTHON2_NUMPY_INCLUDE_DIRS=/usr/lib/python2.7/dist-packages/numpy/core/include/ \
    > -D PYTHON2_PACKAGES_PATH=/usr/lib/python2.7/dist-packages \
    > -D PYTHON2_LIBRARY= /usr/lib/arm-linux-gnueabihf/libpython2.7.so \
    > -D PYTHON3_INCLUDE_DIR=/usr/include/python3.5m \
    > -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include/ \
    > -D PYTHON3_PACKAGES_PATH=/usr/lib/python3.5/dist-packages \
    > -D PYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \
    > ../
    -- The CXX compiler identification is GNU 6.3.0
    -- The C compiler identification is GNU 6.3.0
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Performing Test HAVE_CXX11 (check file: cmake/checks/cxx11.cpp)
    -- Performing Test HAVE_CXX11 - Success
    -- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.13", minimum required is "2.7")
    -- Found PythonLibs: /usr/lib/arm-linux-gnueabihf/libpython2.7.so (found suitable exact version "2.7.13")
    -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.3", minimum required is "3.4")
    -- Found PythonLibs: /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (found suitable exact version "3.5.3")
    -- Looking for ccache - not found
    -- Performing Test HAVE_CXX_FSIGNED_CHAR
    -- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
    -- Performing Test HAVE_C_FSIGNED_CHAR
    -- Performing Test HAVE_C_FSIGNED_CHAR - Success
    -- Performing Test HAVE_CXX_W
    -- Performing Test HAVE_CXX_W - Success
    -- Performing Test HAVE_C_W
    -- Performing Test HAVE_C_W - Success
    -- Performing Test HAVE_CXX_WALL
    -- Performing Test HAVE_CXX_WALL - Success
    -- Performing Test HAVE_C_WALL
    -- Performing Test HAVE_C_WALL - Success
    -- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
    -- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
    -- Performing Test HAVE_C_WERROR_RETURN_TYPE
    -- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
    -- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success
    -- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Success
    -- Performing Test HAVE_CXX_WERROR_ADDRESS
    -- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
    -- Performing Test HAVE_C_WERROR_ADDRESS
    -- Performing Test HAVE_C_WERROR_ADDRESS - Success
    -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
    -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
    -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
    -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
    -- Performing Test HAVE_CXX_WFORMAT
    -- Performing Test HAVE_CXX_WFORMAT - Success
    -- Performing Test HAVE_C_WFORMAT
    -- Performing Test HAVE_C_WFORMAT - Success
    -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
    -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
    -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
    -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
    -- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
    -- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
    -- Performing Test HAVE_C_WMISSING_DECLARATIONS
    -- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
    -- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
    -- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
    -- Performing Test HAVE_C_WMISSING_PROTOTYPES
    -- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
    -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
    -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
    -- Performing Test HAVE_C_WSTRICT_PROTOTYPES
    -- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
    -- Performing Test HAVE_CXX_WUNDEF
    -- Performing Test HAVE_CXX_WUNDEF - Success
    -- Performing Test HAVE_C_WUNDEF
    -- Performing Test HAVE_C_WUNDEF - Success
    -- Performing Test HAVE_CXX_WINIT_SELF
    -- Performing Test HAVE_CXX_WINIT_SELF - Success
    -- Performing Test HAVE_C_WINIT_SELF
    -- Performing Test HAVE_C_WINIT_SELF - Success
    -- Performing Test HAVE_CXX_WPOINTER_ARITH
    -- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
    -- Performing Test HAVE_C_WPOINTER_ARITH
    -- Performing Test HAVE_C_WPOINTER_ARITH - Success
    -- Performing Test HAVE_CXX_WSHADOW
    -- Performing Test HAVE_CXX_WSHADOW - Success
    -- Performing Test HAVE_C_WSHADOW
    -- Performing Test HAVE_C_WSHADOW - Success
    -- Performing Test HAVE_CXX_WSIGN_PROMO
    -- Performing Test HAVE_CXX_WSIGN_PROMO - Success
    -- Performing Test HAVE_C_WSIGN_PROMO
    -- Performing Test HAVE_C_WSIGN_PROMO - Failed
    -- Performing Test HAVE_CXX_WUNINITIALIZED
    -- Performing Test HAVE_CXX_WUNINITIALIZED - Success
    -- Performing Test HAVE_C_WUNINITIALIZED
    -- Performing Test HAVE_C_WUNINITIALIZED - Success
    -- Performing Test HAVE_CXX_WNO_NARROWING
    -- Performing Test HAVE_CXX_WNO_NARROWING - Success
    -- Performing Test HAVE_C_WNO_NARROWING
    -- Performing Test HAVE_C_WNO_NARROWING - Success
    -- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
    -- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
    -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
    -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
    -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
    -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
    -- Performing Test HAVE_CXX_WNO_COMMENT
    -- Performing Test HAVE_CXX_WNO_COMMENT - Success
    -- Performing Test HAVE_C_WNO_COMMENT
    -- Performing Test HAVE_C_WNO_COMMENT - Success
    -- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
    -- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Failed
    -- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH
    -- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Failed
    -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
    -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
    -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
    -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
    -- Performing Test HAVE_CXX_PTHREAD
    -- Performing Test HAVE_CXX_PTHREAD - Success
    -- Performing Test HAVE_C_PTHREAD
    -- Performing Test HAVE_C_PTHREAD - Success
    -- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
    -- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
    -- Performing Test HAVE_C_FOMIT_FRAME_POINTER
    -- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
    -- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
    -- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
    -- Performing Test HAVE_C_FFUNCTION_SECTIONS
    -- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
    -- Performing Test HAVE_CXX_FDATA_SECTIONS
    -- Performing Test HAVE_CXX_FDATA_SECTIONS - Success
    -- Performing Test HAVE_C_FDATA_SECTIONS
    -- Performing Test HAVE_C_FDATA_SECTIONS - Success
    -- Performing Test HAVE_CXX_MFPU_VFPV3
    -- Performing Test HAVE_CXX_MFPU_VFPV3 - Success
    -- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp)
    -- Performing Test HAVE_CPU_NEON_SUPPORT - Failed
    -- Performing Test HAVE_CXX_MFPU_NEON (check file: cmake/checks/cpu_neon.cpp)
    -- Performing Test HAVE_CXX_MFPU_NEON - Success
    -- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp)
    -- Performing Test HAVE_CPU_FP16_SUPPORT - Failed
    -- Performing Test HAVE_CXX_MFPU_NEON_FP16 (check file: cmake/checks/cpu_fp16.cpp)
    -- Performing Test HAVE_CXX_MFPU_NEON_FP16 - Failed
    -- FP16 is not supported by C++ compiler
    -- Performing Test HAVE_CPU_BASELINE_FLAGS
    -- Performing Test HAVE_CPU_BASELINE_FLAGS - Success
    -- Performing Test HAVE_CXX_MFP16_FORMAT_IEEE
    -- Performing Test HAVE_CXX_MFP16_FORMAT_IEEE - Success
    -- Performing Test HAVE_C_MFP16_FORMAT_IEEE
    -- Performing Test HAVE_C_MFP16_FORMAT_IEEE - Success
    -- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
    -- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
    -- Performing Test HAVE_C_FVISIBILITY_HIDDEN
    -- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
    -- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
    -- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
    -- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
    -- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Failed
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for posix_memalign
    -- Looking for posix_memalign - found
    -- Looking for malloc.h
    -- Looking for malloc.h - found
    -- Looking for memalign
    -- Looking for memalign - found
    -- Check if the system is big endian
    -- Searching 16 bit integer
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of unsigned short
    -- Check size of unsigned short - done
    -- Using unsigned short
    -- Check if the system is big endian - little endian
    -- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
    -- Found JPEG: /usr/lib/arm-linux-gnueabihf/libjpeg.so
    -- Found TIFF: /usr/lib/arm-linux-gnueabihf/libtiff.so (found version "4.0.8")
    -- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
    -- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
    -- Performing Test HAVE_C_WNO_UNUSED_FUNCTION
    -- Performing Test HAVE_C_WNO_UNUSED_FUNCTION - Success
    -- Performing Test HAVE_C_WNO_SHADOW
    -- Performing Test HAVE_C_WNO_SHADOW - Success
    -- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED
    -- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Success
    -- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES
    -- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success
    -- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS
    -- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success
    -- Found Jasper: /usr/lib/arm-linux-gnueabihf/libjasper.so (found version "1.900.1")
    -- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.8")
    -- Found PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (found version "1.6.28")
    -- Looking for /usr/include/libpng/png.h
    -- Looking for /usr/include/libpng/png.h - found
    -- Looking for semaphore.h
    -- Looking for semaphore.h - found
    -- Performing Test HAVE_CXX_WNO_SHADOW
    -- Performing Test HAVE_CXX_WNO_SHADOW - Success
    -- Performing Test HAVE_CXX_WNO_UNUSED
    -- Performing Test HAVE_CXX_WNO_UNUSED - Success
    -- Performing Test HAVE_CXX_WNO_SIGN_COMPARE
    -- Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
    -- Performing Test HAVE_CXX_WNO_UNDEF
    -- Performing Test HAVE_CXX_WNO_UNDEF - Success
    -- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
    -- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
    -- Performing Test HAVE_CXX_WNO_UNINITIALIZED
    -- Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success
    -- Performing Test HAVE_CXX_WNO_SWITCH
    -- Performing Test HAVE_CXX_WNO_SWITCH - Success
    -- Performing Test HAVE_CXX_WNO_PARENTHESES
    -- Performing Test HAVE_CXX_WNO_PARENTHESES - Success
    -- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
    -- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
    -- Performing Test HAVE_CXX_WNO_EXTRA
    -- Performing Test HAVE_CXX_WNO_EXTRA - Success
    -- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
    -- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
    -- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION
    -- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION - Success
    -- Performing Test HAVE_CXX_WNO_DEPRECATED
    -- Performing Test HAVE_CXX_WNO_DEPRECATED - Success
    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
    By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "Qt5Core", but
    CMake did not find one.

    Could not find a package configuration file provided by "Qt5Core" with any
    of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

    Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
    "Qt5Core_DIR" to a directory containing one of the above files. If
    "Qt5Core" provides a separate development package or SDK, be sure it has
    been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
    By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "Qt5Gui", but
    CMake did not find one.

    Could not find a package configuration file provided by "Qt5Gui" with any
    of the following names:

    Qt5GuiConfig.cmake
    qt5gui-config.cmake

    Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
    "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui"
    provides a separate development package or SDK, be sure it has been
    installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
    By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
    has asked CMake to find a package configuration file provided by
    "Qt5Widgets", but CMake did not find one.

    Could not find a package configuration file provided by "Qt5Widgets" with
    any of the following names:

    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake

    Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
    "Qt5Widgets_DIR" to a directory containing one of the above files. If
    "Qt5Widgets" provides a separate development package or SDK, be sure it has
    been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
    By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "Qt5Test", but
    CMake did not find one.

    Could not find a package configuration file provided by "Qt5Test" with any
    of the following names:

    Qt5TestConfig.cmake
    qt5test-config.cmake

    Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set
    "Qt5Test_DIR" to a directory containing one of the above files. If
    "Qt5Test" provides a separate development package or SDK, be sure it has
    been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
    By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this
    project has asked CMake to find a package configuration file provided by
    "Qt5Concurrent", but CMake did not find one.

    Could not find a package configuration file provided by "Qt5Concurrent"
    with any of the following names:

    Qt5ConcurrentConfig.cmake
    qt5concurrent-config.cmake

    Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set
    "Qt5Concurrent_DIR" to a directory containing one of the above files. If
    "Qt5Concurrent" provides a separate development package or SDK, be sure it
    has been installed.
    Call Stack (most recent call first):
    CMakeLists.txt:601 (include)


    -- Looking for Q_WS_X11
    -- Looking for Q_WS_X11 - found
    -- Looking for Q_WS_WIN
    -- Looking for Q_WS_WIN - not found
    -- Looking for Q_WS_QWS
    -- Looking for Q_WS_QWS - not found
    -- Looking for Q_WS_MAC
    -- Looking for Q_WS_MAC - not found
    -- Found Qt4: /usr/bin/qmake (found version "4.8.7")
    -- Checking for module 'gstreamer-base-1.0'
    -- Found gstreamer-base-1.0, version 1.10.4
    -- Checking for module 'gstreamer-video-1.0'
    -- Found gstreamer-video-1.0, version 1.10.4
    -- Checking for module 'gstreamer-app-1.0'
    -- Found gstreamer-app-1.0, version 1.10.4
    -- Checking for module 'gstreamer-riff-1.0'
    -- Found gstreamer-riff-1.0, version 1.10.4
    -- Checking for module 'gstreamer-pbutils-1.0'
    -- Found gstreamer-pbutils-1.0, version 1.10.4
    -- Checking for module 'libxine'
    -- Found libxine, version 1.2.6
    -- Looking for linux/videodev.h
    -- Looking for linux/videodev.h - not found
    -- Looking for linux/videodev2.h
    -- Looking for linux/videodev2.h - found
    -- Looking for sys/videoio.h
    -- Looking for sys/videoio.h - not found
    -- Checking for modules 'libavcodec;libavformat;libavutil;libswscale'
    -- Found libavcodec, version 57.64.101
    -- Found libavformat, version 57.56.101
    -- Found libavutil, version 55.34.101
    -- Found libswscale, version 4.2.100
    -- Checking for module 'libavresample'
    -- No package 'libavresample' found
    -- Checking for module 'libgphoto2'
    -- No package 'libgphoto2' found
    -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
    -- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR)
    -- Looking for dgemm_
    -- Looking for dgemm_ - found
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - found
    -- Found Threads: TRUE
    -- A library with BLAS API found.
    -- Looking for cheev_
    -- Looking for cheev_ - found
    -- A library with LAPACK API found.
    -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
    -- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
    -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
    -- Performing Test CXX_HAS_MFPU_NEON
    -- Performing Test CXX_HAS_MFPU_NEON - Success
    -- Performing Test C_HAS_MFPU_NEON
    -- Performing Test C_HAS_MFPU_NEON - Success
    -- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES
    -- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Failed
    -- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
    -- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
    -- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS
    -- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS - Success
    -- Performing Test HAVE_CXX_WNO_SIGN_PROMO
    -- Performing Test HAVE_CXX_WNO_SIGN_PROMO - Success
    -- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE
    -- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Failed
    -- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS
    -- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS - Success
    -- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION
    -- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION - Success
    -- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE
    -- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE - Success
    -- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32
    -- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Failed
    -- Caffe: NO
    -- Protobuf: NO
    -- Glog: NO
    -- tiny-dnn: Download: v1.0.0a3.tar.gz
    -- Looking for tiny_dnn.h
    -- Looking for tiny_dnn.h - found
    -- Found tiny-dnn in: /home/pi/opencv/opencv-3.4.0/build/3rdparty/tinydnn/tiny-dnn-1.0.0a3
    -- Performing Test COMPILER_SUPPORTS_CXX11
    -- Performing Test COMPILER_SUPPORTS_CXX11 - Success
    -- The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE='')
    -- Checking for one of the modules 'freetype2'
    -- Checking for one of the modules 'harfbuzz'
    -- freetype2: YES
    -- harfbuzz: YES
    -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
    -- Module opencv_ovis disabled because OGRE3D was not found
    -- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
    -- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
    -- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
    -- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
    -- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
    -- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/core/src/convert.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/core/src/convert.fp16.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/core/src/convert.sse4_1.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/mathfuncs_core.sse2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/mathfuncs_core.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/mathfuncs_core.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/stat.sse4_2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/core/stat.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/corner.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/filter.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/imgwarp.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/imgwarp.sse4_1.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/resize.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/resize.sse4_1.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/imgproc/src/undistort.avx2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/imgproc/accum.sse2.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/imgproc/accum.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/objdetect/src/haar.avx.cpp
    -- Performing Test HAVE_CXX_WNO_MAYBE_UNINITIALIZED
    -- Performing Test HAVE_CXX_WNO_MAYBE_UNINITIALIZED - Success
    -- Performing Test HAVE_CXX_WNO_ENUM_COMPARE
    -- Performing Test HAVE_CXX_WNO_ENUM_COMPARE - Success
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/dnn/layers/layers_common.avx.cpp
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/build/modules/dnn/layers/layers_common.avx2.cpp
    -- freetype2: YES
    -- harfbuzz: YES
    -- Excluding from source files list: /home/pi/opencv/opencv-3.4.0/modules/features2d/src/fast.avx2.cpp
    -- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL
    -- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL - Success
    -- Checking for modules 'tesseract;lept'
    -- No package 'tesseract' found
    -- No package 'lept' found
    -- Tesseract: NO
    -- xfeatures2d/boostdesc: Download: boostdesc_bgm.i
    -- xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
    -- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
    -- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
    -- xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
    -- xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
    -- xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
    -- xfeatures2d/vgg: Download: vgg_generated_48.i
    -- xfeatures2d/vgg: Download: vgg_generated_64.i
    -- xfeatures2d/vgg: Download: vgg_generated_80.i
    -- xfeatures2d/vgg: Download: vgg_generated_120.i
    -- data: Download: face_landmark_model.dat
    -- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD
    -- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Failed
    --
    -- General configuration for OpenCV 3.4.0 =====================================
    -- Version control: unknown
    --
    -- Extra modules:
    -- Location (extra): /home/pi/opencv/opencv_contrib-3.4.0/modules
    -- Version control (extra): unknown
    --
    -- Platform:
    -- Timestamp: 2018-03-30T01:13:19Z
    -- Host: Linux 4.14.30-v7+ armv7l
    -- CMake: 3.7.2
    -- CMake generator: Unix Makefiles
    -- CMake build tool: /usr/bin/make
    -- Configuration: RELEASE
    --
    -- CPU/HW features:
    -- Baseline: NEON
    -- requested: DETECT
    -- required: NEON
    -- disabled: VFPV3
    --
    -- C/C++:
    -- Built as dynamic libs?: YES
    -- C++11: YES
    -- C++ Compiler: /usr/bin/c++ (ver 6.3.0)
    -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
    -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
    -- C Compiler: /usr/bin/cc
    -- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
    -- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
    -- Linker flags (Release):
    -- Linker flags (Debug):
    -- ccache: NO
    -- Precompiled headers: YES
    -- Extra dependencies: dl m pthread rt /usr/lib/arm-linux-gnueabihf/libGLU.so /usr/lib/arm-linux-gnueabihf/libGL.so
    -- 3rdparty dependencies:
    --
    -- OpenCV modules:
    -- To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dpm face features2d flann freetype fuzzy highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python2 python3 python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
    -- Disabled: js world
    -- Disabled by dependency: -
    -- Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv dnn_modern hdf java matlab ovis sfm ts viz
    -- Applications: apps
    -- Documentation: NO
    -- Non-free algorithms: NO
    --
    -- GUI:
    -- QT: YES (ver 4.8.7 EDITION = OpenSource)
    -- QT OpenGL support: YES (/usr/lib/arm-linux-gnueabihf/libQtOpenGL.so)
    -- GTK+: NO
    -- OpenGL support: YES (/usr/lib/arm-linux-gnueabihf/libGLU.so /usr/lib/arm-linux-gnueabihf/libGL.so)
    -- VTK support: NO
    --
    -- Media I/O:
    -- ZLib: /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
    -- JPEG: /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver )
    -- WEBP: build (ver encoder: 0x020e)
    -- PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.28)
    -- TIFF: /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.8)
    -- JPEG 2000: /usr/lib/arm-linux-gnueabihf/libjasper.so (ver 1.900.1)
    -- OpenEXR: build (ver 1.7.1)
    --
    -- Video I/O:
    -- FFMPEG: YES
    -- avcodec: YES (ver 57.64.101)
    -- avformat: YES (ver 57.56.101)
    -- avutil: YES (ver 55.34.101)
    -- swscale: YES (ver 4.2.100)
    -- avresample: NO
    -- GStreamer:
    -- base: YES (ver 1.10.4)
    -- video: YES (ver 1.10.4)
    -- app: YES (ver 1.10.4)
    -- riff: YES (ver 1.10.4)
    -- pbutils: YES (ver 1.10.4)
    -- libv4l/libv4l2: NO
    -- v4l/v4l2: linux/videodev2.h
    -- Xine: YES (ver 1.2.6)
    -- gPhoto2: NO
    --
    -- Parallel framework: pthreads
    --
    -- Trace: YES (built-in)
    --
    -- Other third-party libraries:
    -- Lapack: NO
    -- Eigen: YES (ver 3.3.2)
    -- Custom HAL: YES (carotene (ver 0.0.1))
    --
    -- NVIDIA CUDA: NO
    --
    -- OpenCL: YES (no extra features)
    -- Include path: /home/pi/opencv/opencv-3.4.0/3rdparty/include/opencl/1.2
    -- Link libraries: Dynamic load
    --
    -- Python 2:
    -- Interpreter: /usr/bin/python2.7 (ver 2.7.13)
    -- Libraries: /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.13)
    -- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
    -- packages path: /usr/lib/python2.7/dist-packages
    --
    -- Python 3:
    -- Interpreter: /usr/bin/python3 (ver 3.5.3)
    -- Libraries: /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
    -- numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.12.1)
    -- packages path: /usr/lib/python3.5/dist-packages
    --
    -- Python (for build): /usr/bin/python2.7
    --
    -- Java:
    -- ant: NO
    -- JNI: NO
    -- Java wrappers: NO
    -- Java tests: NO
    --
    -- Matlab: NO
    --
    -- Install to: /usr/local
    -- -----------------------------------------------------------------
    --
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/pi/opencv/opencv-3.4.0/build

  14. 학생 2018.04.06 18:44 신고

    안녕하세요. 잘보고있습니다. 따라하고 있는 도중...4시간을 기다려 make time을 완료하고 sudo make install 한 뒤 /usr/local/share/OpenCV/samples/
    을 확인을 해보았으나 python 폴더 한개뿐이더군요ㅠ ㅠ 뭐잘못한건가요...

    • webnautes webnautes 2018.04.06 19:45 신고

      C++ 코드가 복사되지 않는 경우도 있습니다.. 그럴 경우 다운로드 받은 소스 코드에 있는 것을 사용하세요~

      opencv/samples/ 위치에 있습니다.

  15. He 2018.04.08 18:30 신고

    저 얼굴인식하는부분에서코드를
    camera.resolution = (128, 128)
    camera.framerate = 32
    rawCapture = PiRGBArray(camera,size=(128, 128))

    time.sleep(0.1)

    motorStop()

    for frame in camera.capture_continuous(rawCapture, format="bgr",
    use_video_port=True):
    image = frame.array
    gray= cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
    face_cascade = cv2.CascadeClassifier('/usr/share/OpenCV/haarcascades/haarcascade_front$

    rawCapture.truncate(0)

    faces = face_cascade.detectMultiScale(gray,1.1,5)
    if(len(faces) == 0):
    motorStop()
    else:
    for (x,y,w,h) in faces:
    cv2.rectangle(image,(x,y),(x+w,y+h),(255,255,0),2)
    print(x,y,w,h)
    idx = 0
    if( w < distance[0]):
    for dist in distance:
    if(w < dist):
    idx = distance.index(dist)
    else:
    break
    else:
    backward()

    deg_turn = x + (w / 2)
    deg_turn = deg_turn - 60.0
    deg_turn = deg_turn * 0.08
    turn(deg_turn)
    print(deg_turn)
    print(idx)
    forward(idx)
    key = cv2.waitKey(1) & 0xFF

    영상처리하면서 DC모터 제어하려는 코드 일부인데

    여기서
    File "op31.py", line 86, in <module>
    faces = face_cascade.detectMultiScale(gray,1.1,5)
    cv2.error: /home/pi/opencv/opencv-3.4.0/modules/objdetect/src/cascadedetect.cpp:1698: error: (-215) !empty() in function detectMultiScale
    이런 오류가나는데 왜 그런지아시나요???

    • webnautes webnautes 2018.04.10 08:05 신고

      찾아보니 xml 파일 위치가 틀리면 발생할 수 있다는데.. 혹시 그전에 동작하는 코드를 기반으로 수정한건가요?

  16. He 2018.04.10 23:22 신고

    네네 그 인터넷에 올라와있던 코드를 그냥 복사붙여넣기해서 해보느냐고...

    • webnautes webnautes 2018.04.11 03:14 신고

      카메라에서 캡처한 영상 크기가 128x128사이즈 인거 같은데..
      너무 작아서 발생하는게 아닌가 싶네요

      화면에 캡처된 이미지를 출력해보세요

  17. Yong 2018.05.03 04:00 신고

    [ 96%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
    c++: internal compiler error: Killed (program cc1plus)
    Please submit a full bug report,
    See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
    modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/_/src2/cv2.cpp.o' failed
    make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/_/src2/cv2.cpp.o] Error 4
    CMakeFiles/Makefile2:7863: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
    make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
    Makefile:160: recipe for target 'all' failed
    make: *** [all] Error 2

    96%에서 이렇게 나와서 막혔는데 뭐가 문제일까요? ㅠㅠ

  18. asddds 2018.05.12 03:10 신고

    안녕하세요 저는 PKG_CONFIG 명령어가 opencv.pc를 읽지 못하고 있는데 저장 위치가 잘못된건가요?

  19. 규규 2018.05.21 19:19 신고

    죄송한데 제가 cmake를 사용하여 OpenCV 컴파일 설정을 해줍니다. 복사해서 터미널에 붙여넣기 해주면 됩니다. 이거 뭔말인지 잘몰라서 일단 cmake 파일을 복사해서 터미널에 붙여넣기를 했는데 아무것도 안나오는데 어떻게해야하나요?

    • webnautes webnautes 2018.05.22 18:12 신고

      라즈베리파이로 연결시 어떤 프로그램을 사용하나요?

      아래 내용을 복사하여
      접속한 프로그램 창 위에서 마우스 오른쪽 버튼을 누르면 터미널에 복사한 내용이 보입니다.

  20. 인형가방 2018.06.03 19:11 신고

    항상 많이 배우고 갑니다. 감사합니다.

  21. hmshim@daum.net 2018.06.05 17:14 신고

    hmshim@daum.net 으로 티스토리 초대장좀 보내주세요

+ Recent posts

티스토리 툴바