9월, 2017의 게시물 표시

macOS의 terminal에서 CMake 등 C/C++ 빌드가 안될 경우 해결 방법 - command line developer tools 설치

최근 macOS High Sierra를 설치 후 CMake를 사용한 C++ 프로그램 빌드가 되지 않았다. 'time.h'가 없다는 빌드 에러가 상당히 당황스러웠다. make [ 11%] Building CXX object CMakeFiles/SmartCamera.dir/src/EnvironmentInfo.cpp.o In file included from /Users/oz/Workspace/git/smurfhome/src/smartcamera/src/EnvironmentInfo.cpp:1: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ ctime:48:10: fatal error: 'time.h' file not found 원인을 찾아 보니, macOS High Sierra로 업그레이드 되면서 Xcode가 새로 설치 되었는데, 기존에 설치된 command line developer tools 가 삭제되어 발생했다. 따라서 이런 빌드가 오류가 나타나면 당황하지 말고 다음과 같이 command line developer tools 을 설치하면 문제가 해결 된다. 먼저 터미널창을 열고, 다음과 같이 입력한다. $xcode-select --install 설치 화면이 표시되면  '툴 설치'를 선택한다. 설치가 완료된 후 다시 빌드를 다시 하면 된다. 참고로 command line developer tools이 설치되지 않더라도, Xcode에서 C++ 프로그램은 개발이 가능하다.

How to build FFmpeg and OpenCV on Ubuntu MATE for Raspberry Pi 3

How to build FFmpeg and OpenCV on Ubuntu MATE for Raspberry Pi 3 OpenCV is often used to handle various computer vision, such as objects, faces, or motion recognition. In OpenCV, there are many ways to get images. Basically, you can easily get images by using the camera attached to the device, but sometimes you need to open the media file or receive the data streaming over the network. OpenCV does not directly support various video codecs or network protocols, so FFmpeg is used in this case. This article describes how to build OpenCV in Raspberry Pi 3 that requires FFmpeg. The build environment is as follows. Raspberry Pi 3 Ubuntu MATE for Raspberry Pi 3 cmake How to build The build order is as follows. FFmpeg OpenCV When you build FFmpeg you have to be careful. If your target board is 32 bits , you must add the --enable-pic option. Build FFmpeg cd ~/git git clone https://github.com/FFmpeg/FFmpeg.git cd FFmpeg ./configure --enable-libfreetype --enable-

Ubuntu MATE for Raspberry Pi 3에서 FFmpeg와 OpenCV 빌드 방법

Ubuntu MATE for Raspberry Pi 3에서 FFmpeg과 OpenCV 빌드 방법  사물, 얼굴 또는 동작 인식 등 다양한 컴퓨터 비전을 처리하기 위해 OpenCV를 많이 사용한다. OpenCV에서는 영상을 얻는 방법이 다양하기 하다. 기본적으로 기기에 장착된 카메라를 이용해서 쉽게 영상을 얻을 수 있지만, 떄로는 미디어 파일을 열거나 네트워크 너머에서 스트리밍으로 데이터를 받을 필요가 있다.  OpenCV는 다양한 비디오 코덱 또는 네트워크 프로토콜은 직접 지원하지 않기 때문에 이런 경우에는 FFmpeg을 사용하게 된다.  이 글에서는 FFmpeg이 필요하는 OpenCV을 Raspberry Pi 3에서 빌드하는 방법을 설명한다. 빌드 환경은 다음과 같다. Raspberry Pi 3 Ubuntu MATE for Raspberry Pi 3 cmake 빌드 순서 빌드 순서는 다음과 같다. FFmpeg OpenCV 빌드시 주의할 점은 만일 타케 보드가 32비트일 경우는 반드시 --enable-pic 옵션을 추가해야 한다. FFmpeg 빌드 cd ~/git git clone https://github.com/FFmpeg/FFmpeg.git cd FFmpeg ./configure --enable-libfreetype --enable-gpl \ --enable-nonfree --enable-libx264 --enable-shared --enable-pic make sudo make install OpenCV 빌드 cd ~/git git clone https://github.com/opencv/opencv.git cd opencv mkdir build cd build cmake .. make sudo make install