cmake를 설치 해야 하므로 아래의 패키지이름을 사용하고
소스는 ${HOME}/download/OpenCV-2.3.1 에 다운로드 받아서 압축해제 되어 있으며
그리고는 source 경로를 지정해주고
build 하여 나온 binary를 넣을 경로를 relase로 정해주고 나서 Configure를 누른후 Generate를 누르면 makefile이 생성된다.
그리고 콘솔에서 make 치면 빌드가 시작된다.
make install 은 sudo를 붙여서 해야 함! 안하면 에러에러에러~
다시 sudo를 붙여서 쿡!
$ sudo apt-get install cmake cmake-qt-gui |
소스는 ${HOME}/download/OpenCV-2.3.1 에 다운로드 받아서 압축해제 되어 있으며
release 디렉토리는 추가적으로 mkdir을 통해 만들어 주었다.
$ wget "http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencvlibrary%2Ffiles%2Fopencv-unix%2F2.3.1%2F&ts=1329007542&use_mirror=cdnetworks-kr-2" $ mv OpenCV-2.3.1a.tar.bz2* OpenCV-2.3.1a.tar.bz2 $ tar -xvf OpenCV-2.3.1a.tar.bz2 $ cd OpenCV-2.3.1 $ mkdir release $ cmake-gui |
그리고는 source 경로를 지정해주고
build 하여 나온 binary를 넣을 경로를 relase로 정해주고 나서 Configure를 누른후 Generate를 누르면 makefile이 생성된다.
그리고 콘솔에서 make 치면 빌드가 시작된다.
make install 은 sudo를 붙여서 해야 함! 안하면 에러에러에러~
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:36 (FILE):
file cannot create directory: /usr/local/share/OpenCV. Maybe need
administrative privileges.
make: *** [install] 오류 1
|
다시 sudo를 붙여서 쿡!
$ sudo make install $ sudo make install[ 0%] Built target opencv_core_pch_dephelp
[ 1%] Built target pch_Generate_opencv_core
[ 5%] Built target opencv_core
[ 6%] Built target opencv_imgproc_pch_dephelp
[ 7%] Built target pch_Generate_opencv_imgproc
[ 15%] Built target opencv_imgproc
[ 15%] Built target opencv_flann_pch_dephelp
[ 16%] Built target pch_Generate_opencv_flann
[ 17%] Built target opencv_flann
[ 18%] Built target opencv_calib3d_pch_dephelp
[ 18%] Built target pch_Generate_opencv_calib3d
[ 18%] Built target opencv_features2d_pch_dephelp
[ 18%] Built target pch_Generate_opencv_features2d
[ 19%] Built target opencv_highgui_pch_dephelp
[ 19%] Built target pch_Generate_opencv_highgui
[ 23%] Built target opencv_highgui
[ 28%] Built target opencv_features2d
[ 30%] Built target opencv_calib3d
[ 31%] Built target opencv_test_calib3d_pch_dephelp
[ 31%] Built target pch_Generate_opencv_test_calib3d
[ 31%] Built target opencv_ts_pch_dephelp
[ 31%] Built target pch_Generate_opencv_ts
[ 32%] Built target opencv_ts
[ 35%] Built target opencv_test_calib3d
[ 35%] Built target opencv_test_core_pch_dephelp
[ 36%] Built target pch_Generate_opencv_test_core
[ 38%] Built target opencv_test_core
[ 38%] Built target opencv_test_features2d_pch_dephelp
[ 38%] Built target pch_Generate_opencv_test_features2d
[ 40%] Built target opencv_test_features2d
[ 41%] Built target opencv_test_highgui_pch_dephelp
[ 41%] Built target pch_Generate_opencv_test_highgui
[ 42%] Built target opencv_test_highgui
[ 42%] Built target opencv_test_imgproc_pch_dephelp
[ 42%] Built target pch_Generate_opencv_test_imgproc
[ 46%] Built target opencv_test_imgproc
[ 46%] Built target opencv_legacy_pch_dephelp
[ 46%] Built target pch_Generate_opencv_legacy
[ 47%] Built target opencv_video_pch_dephelp
[ 48%] Built target pch_Generate_opencv_video
[ 51%] Built target opencv_video
[ 65%] Built target opencv_legacy
[ 66%] Built target opencv_ml_pch_dephelp
[ 67%] Built target pch_Generate_opencv_ml
[ 70%] Built target opencv_ml
[ 71%] Built target opencv_contrib_pch_dephelp
[ 71%] Built target pch_Generate_opencv_contrib
[ 71%] Built target opencv_objdetect_pch_dephelp
[ 71%] Built target pch_Generate_opencv_objdetect
[ 74%] Built target opencv_objdetect
[ 77%] Built target opencv_contrib
[ 77%] Built target opencv_test_ml_pch_dephelp
[ 78%] Built target pch_Generate_opencv_test_ml
[ 80%] Built target opencv_test_ml
[ 80%] Built target opencv_test_objdetect_pch_dephelp
[ 80%] Built target pch_Generate_opencv_test_objdetect
[ 81%] Built target opencv_test_objdetect
[ 81%] Built target opencv_test_video_pch_dephelp
[ 82%] Built target pch_Generate_opencv_test_video
[ 84%] Built target opencv_test_video
[ 85%] Built target opencv_haartraining_engine
[ 87%] Built target opencv_traincascade
[ 87%] Built target opencv_createsamples
[ 87%] Built target opencv_haartraining
[ 88%] Built target opencv_performance
[ 89%] Built target opencv_gpu_pch_dephelp
[ 89%] Built target pch_Generate_opencv_gpu
[ 94%] Built target opencv_gpu
[ 94%] Built target opencv_test_gpu_pch_dephelp
[ 95%] Built target pch_Generate_opencv_test_gpu
[ 98%] Built target opencv_test_gpu
[100%] Built target opencv_stitching
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/OpenCV/OpenCVConfig.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVConfig-version.cmake
-- Installing: /usr/local/lib/pkgconfig/opencv.pc
-- Installing: /usr/local/include/opencv/cvaux.h
-- Installing: /usr/local/include/opencv/cvwimage.h
-- Installing: /usr/local/include/opencv/cv.hpp
-- Installing: /usr/local/include/opencv/highgui.h
-- Installing: /usr/local/include/opencv/cvaux.hpp
-- Installing: /usr/local/include/opencv/ml.h
-- Installing: /usr/local/include/opencv/cxcore.hpp
-- Installing: /usr/local/include/opencv/cxcore.h
-- Installing: /usr/local/include/opencv/cxeigen.hpp
-- Installing: /usr/local/include/opencv/cxmisc.h
-- Installing: /usr/local/include/opencv/cv.h
-- Installing: /usr/local/include/opencv2/opencv.hpp
-- Installing: /usr/local/lib/libopencv_calib3d.so.2.3.1
-- Installing: /usr/local/lib/libopencv_calib3d.so.2.3
-- Installing: /usr/local/lib/libopencv_calib3d.so
-- Set runtime path of "/usr/local/lib/libopencv_calib3d.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/calib3d/calib3d.hpp
-- Installing: /usr/local/lib/libopencv_core.so.2.3.1
-- Installing: /usr/local/lib/libopencv_core.so.2.3
-- Installing: /usr/local/lib/libopencv_core.so
-- Set runtime path of "/usr/local/lib/libopencv_core.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/core/core_c.h
-- Installing: /usr/local/include/opencv2/core/internal.hpp
-- Installing: /usr/local/include/opencv2/core/wimage.hpp
-- Installing: /usr/local/include/opencv2/core/eigen.hpp
-- Installing: /usr/local/include/opencv2/core/operations.hpp
-- Installing: /usr/local/include/opencv2/core/mat.hpp
-- Installing: /usr/local/include/opencv2/core/version.hpp
-- Installing: /usr/local/include/opencv2/core/core.hpp
-- Installing: /usr/local/include/opencv2/core/types_c.h
-- Installing: /usr/local/lib/libopencv_features2d.so.2.3.1
-- Installing: /usr/local/lib/libopencv_features2d.so.2.3
-- Installing: /usr/local/lib/libopencv_features2d.so
-- Set runtime path of "/usr/local/lib/libopencv_features2d.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/features2d/features2d.hpp
-- Installing: /usr/local/lib/libopencv_flann.so.2.3.1
-- Installing: /usr/local/lib/libopencv_flann.so.2.3
-- Installing: /usr/local/lib/libopencv_flann.so
-- Set runtime path of "/usr/local/lib/libopencv_flann.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/flann/dynamic_bitset.h
-- Installing: /usr/local/include/opencv2/flann/autotuned_index.h
-- Installing: /usr/local/include/opencv2/flann/all_indices.h
-- Installing: /usr/local/include/opencv2/flann/heap.h
-- Installing: /usr/local/include/opencv2/flann/lsh_table.h
-- Installing: /usr/local/include/opencv2/flann/allocator.h
-- Installing: /usr/local/include/opencv2/flann/dummy.h
-- Installing: /usr/local/include/opencv2/flann/miniflann.hpp
-- Installing: /usr/local/include/opencv2/flann/dist.h
-- Installing: /usr/local/include/opencv2/flann/linear_index.h
-- Installing: /usr/local/include/opencv2/flann/flann_base.hpp
-- Installing: /usr/local/include/opencv2/flann/random.h
-- Installing: /usr/local/include/opencv2/flann/hdf5.h
-- Installing: /usr/local/include/opencv2/flann/saving.h
-- Installing: /usr/local/include/opencv2/flann/result_set.h
-- Installing: /usr/local/include/opencv2/flann/composite_index.h
-- Installing: /usr/local/include/opencv2/flann/index_testing.h
-- Installing: /usr/local/include/opencv2/flann/object_factory.h
-- Installing: /usr/local/include/opencv2/flann/kmeans_index.h
-- Installing: /usr/local/include/opencv2/flann/general.h
-- Installing: /usr/local/include/opencv2/flann/ground_truth.h
-- Installing: /usr/local/include/opencv2/flann/timer.h
-- Installing: /usr/local/include/opencv2/flann/kdtree_index.h
-- Installing: /usr/local/include/opencv2/flann/params.h
-- Installing: /usr/local/include/opencv2/flann/nn_index.h
-- Installing: /usr/local/include/opencv2/flann/config.h
-- Installing: /usr/local/include/opencv2/flann/hierarchical_clustering_index.h
-- Installing: /usr/local/include/opencv2/flann/logger.h
-- Installing: /usr/local/include/opencv2/flann/lsh_index.h
-- Installing: /usr/local/include/opencv2/flann/defines.h
-- Installing: /usr/local/include/opencv2/flann/kdtree_single_index.h
-- Installing: /usr/local/include/opencv2/flann/any.h
-- Installing: /usr/local/include/opencv2/flann/simplex_downhill.h
-- Installing: /usr/local/include/opencv2/flann/flann.hpp
-- Installing: /usr/local/include/opencv2/flann/sampling.h
-- Installing: /usr/local/include/opencv2/flann/matrix.h
-- Installing: /usr/local/lib/libopencv_ts.so.2.3.1
-- Installing: /usr/local/lib/libopencv_ts.so.2.3
-- Installing: /usr/local/lib/libopencv_ts.so
-- Set runtime path of "/usr/local/lib/libopencv_ts.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/ts/ts.hpp
-- Installing: /usr/local/include/opencv2/ts/ts_gtest.h
-- Installing: /usr/local/lib/libopencv_highgui.so.2.3.1
-- Installing: /usr/local/lib/libopencv_highgui.so.2.3
-- Installing: /usr/local/lib/libopencv_highgui.so
-- Set runtime path of "/usr/local/lib/libopencv_highgui.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/highgui/highgui_c.h
-- Installing: /usr/local/include/opencv2/highgui/highgui.hpp
-- Installing: /usr/local/lib/libopencv_imgproc.so.2.3.1
-- Installing: /usr/local/lib/libopencv_imgproc.so.2.3
-- Installing: /usr/local/lib/libopencv_imgproc.so
-- Set runtime path of "/usr/local/lib/libopencv_imgproc.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/imgproc/imgproc.hpp
-- Installing: /usr/local/include/opencv2/imgproc/imgproc_c.h
-- Installing: /usr/local/include/opencv2/imgproc/types_c.h
-- Installing: /usr/local/lib/libopencv_legacy.so.2.3.1
-- Installing: /usr/local/lib/libopencv_legacy.so.2.3
-- Installing: /usr/local/lib/libopencv_legacy.so
-- Set runtime path of "/usr/local/lib/libopencv_legacy.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/legacy/compat.hpp
-- Installing: /usr/local/include/opencv2/legacy/legacy.hpp
-- Installing: /usr/local/include/opencv2/legacy/streams.hpp
-- Installing: /usr/local/include/opencv2/legacy/blobtrack.hpp
-- Installing: /usr/local/lib/libopencv_contrib.so.2.3.1
-- Installing: /usr/local/lib/libopencv_contrib.so.2.3
-- Installing: /usr/local/lib/libopencv_contrib.so
-- Set runtime path of "/usr/local/lib/libopencv_contrib.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/contrib/contrib.hpp
-- Installing: /usr/local/include/opencv2/contrib/retina.hpp
-- Installing: /usr/local/lib/libopencv_ml.so.2.3.1
-- Installing: /usr/local/lib/libopencv_ml.so.2.3
-- Installing: /usr/local/lib/libopencv_ml.so
-- Set runtime path of "/usr/local/lib/libopencv_ml.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/ml/ml.hpp
-- Installing: /usr/local/lib/libopencv_objdetect.so.2.3.1
-- Installing: /usr/local/lib/libopencv_objdetect.so.2.3
-- Installing: /usr/local/lib/libopencv_objdetect.so
-- Set runtime path of "/usr/local/lib/libopencv_objdetect.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/objdetect/objdetect.hpp
-- Installing: /usr/local/lib/libopencv_video.so.2.3.1
-- Installing: /usr/local/lib/libopencv_video.so.2.3
-- Installing: /usr/local/lib/libopencv_video.so
-- Set runtime path of "/usr/local/lib/libopencv_video.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/video/tracking.hpp
-- Installing: /usr/local/include/opencv2/video/background_segm.hpp
-- Installing: /usr/local/include/opencv2/video/video.hpp
-- Installing: /usr/local/bin/opencv_traincascade
-- Set runtime path of "/usr/local/bin/opencv_traincascade" to "/usr/local/lib"
-- Installing: /usr/local/bin/opencv_haartraining
-- Set runtime path of "/usr/local/bin/opencv_haartraining" to "/usr/local/lib"
-- Installing: /usr/local/bin/opencv_createsamples
-- Set runtime path of "/usr/local/bin/opencv_createsamples" to "/usr/local/lib"
-- Installing: /usr/local/bin/opencv_performance
-- Set runtime path of "/usr/local/bin/opencv_performance" to "/usr/local/lib"
-- Installing: /usr/local/lib/libopencv_gpu.so.2.3.1
-- Installing: /usr/local/lib/libopencv_gpu.so.2.3
-- Installing: /usr/local/lib/libopencv_gpu.so
-- Set runtime path of "/usr/local/lib/libopencv_gpu.so.2.3.1" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/gpu/gpumat.hpp
-- Installing: /usr/local/include/opencv2/gpu/devmem2d.hpp
-- Installing: /usr/local/include/opencv2/gpu/gpu.hpp
-- Installing: /usr/local/include/opencv2/gpu/matrix_operations.hpp
-- Installing: /usr/local/include/opencv2/gpu/stream_accessor.hpp
-- Installing: /usr/local/include/opencv2/gpu/NPP_staging.hpp
-- Installing: /usr/local/include/opencv2/gpu/NCV.hpp
-- Installing: /usr/local/bin/opencv_stitching
-- Set runtime path of "/usr/local/bin/opencv_stitching" to "/usr/local/lib"
-- Installing: /usr/local/share/OpenCV/doc/haartraining.htm
-- Installing: /usr/local/share/OpenCV/doc/CMakeLists.txt
-- Installing: /usr/local/share/OpenCV/doc/check_docs_whitelist.txt
-- Installing: /usr/local/share/OpenCV/doc/packaging.txt
-- Installing: /usr/local/share/OpenCV/doc/license.txt
-- Installing: /usr/local/share/OpenCV/doc/opencv.jpg
-- Installing: /usr/local/share/OpenCV/doc/acircles_pattern.png
-- Installing: /usr/local/share/OpenCV/doc/opencv-logo2.png
-- Installing: /usr/local/share/OpenCV/doc/pattern.png
-- Installing: /usr/local/share/OpenCV/doc/opencv-logo.png
-- Installing: /usr/local/share/OpenCV/doc/opencv_cheatsheet.pdf
-- Installing: /usr/local/share/OpenCV/doc/opencv2refman.pdf
-- Installing: /usr/local/share/OpenCV/doc/opencv_user.pdf
-- Installing: /usr/local/share/OpenCV/doc/opencv_tutorials.pdf
-- Installing: /usr/local/share/OpenCV/doc/vidsurv/TestSeq.doc
-- Installing: /usr/local/share/OpenCV/doc/vidsurv/Blob_Tracking_Tests.doc
-- Installing: /usr/local/share/OpenCV/doc/vidsurv/Blob_Tracking_Modules.doc
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_lowerbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_mouth.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_upperbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt_tree.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_righteye_2splits.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_rightear.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_profileface.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_lefteye_2splits.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_eye.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_eyepair_small.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_nose.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_righteye.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_upperbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_leftear.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_fullbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_eyepair_big.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_mcs_lefteye.xml
-- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml
|
아무래도 so가 복사되었으니 ldconfig도 실행
버전확인은 아래의 경로에서!
[링크 : http://opencv.willowgarage.com/wiki/InstallGuide]
$ sudo ldconfig |
버전확인은 아래의 경로에서!
$ vi /usr/local/include/opencv2/core/version.hpp
#ifndef __OPENCV_VERSION_HPP__
#define __OPENCV_VERSION_HPP__
#define CV_MAJOR_VERSION 2
#define CV_MINOR_VERSION 3
#define CV_SUBMINOR_VERSION 1
#define CVAUX_STR_EXP(__A) #__A
#define CVAUX_STR(__A) CVAUX_STR_EXP(__A)
#define CV_VERSION CVAUX_STR(CV_MAJOR_VERSION) "." CVAUX_STR(CV_MINOR_VERSION) "." CVAUX_STR(CV_SUBMINOR_VERSION)
#endif
|
[링크 : http://opencv.willowgarage.com/wiki/InstallGuide]
'Programming > openCV' 카테고리의 다른 글
openCV Mat / iplImage (0) | 2012.02.21 |
---|---|
openCV 글씨 쓰기 예제 (2) | 2012.02.12 |
ubuntu opencv 패키지 버전 정보 (0) | 2012.02.12 |
우분투에서 openCV 카메라 영상받기 예제 (0) | 2012.02.04 |
우분투에서 openCV 설치하기 (0) | 2012.02.04 |
Posted by 구차니