프로그램 사용/gcc2012. 2. 12. 11:19
gcc 도움말에 의하면 아래의 경로에서 기본적으로 include 파일을 찾게 된다는데

2.3 Search Path

GCC looks in several different places for headers. On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with #include <file> in:

     /usr/local/include
     libdir/gcc/target/version/include
     /usr/target/include
     /usr/include

[링크 : http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html]  

음.. 저 긴 옵션을 다 줘야 하는 이유는 먼지 모르겠지만,
아무튼 확인해보면 /usr/local/include가 /usr/include 보다 우선적으로 검색하게 된다.
그런 이유로 opencv가 /usr/local/include에 설치되는 듯하다.
$ g++ -v -x c -E -
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=i486'
 /usr/lib/gcc/i486-linux-gnu/4.4.3/cc1 -E -quiet -v - -D_FORTIFY_SOURCE=2 -mtune=generic -march=i486 -fstack-protector
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.4.3/include
 /usr/lib/gcc/i486-linux-gnu/4.4.3/include-fixed
 /usr/include
End of search list.

[링크 : http://gcc.gnu.org/ml/gcc-help/2007-09/msg00216.html]   

'프로그램 사용 > gcc' 카테고리의 다른 글

ubuntu gcc가 바보  (2) 2013.09.19
gcc 64bit 확장  (0) 2013.01.13
gcc의 2진수 표기법  (0) 2011.12.28
c++ 컴파일 오류 - error: extra qualification  (0) 2011.10.12
gcc 컴파일 단계별 옵션  (0) 2010.03.04
Posted by 구차니
Programming2012. 2. 12. 09:59
병렬처리등에 꽤나 이름이 많이 알려진 녀석인듯 한데, 아무튼 둘다 Intel꺼군!
TBB는 open source로 진행되는데 반해 IPP는 유료로 제공되는 것으로 보인다.

Intel® Threading Building Blocks (Intel TBB)
Intel® Integrated Performance Primitives (Intel® IPP)

[링크 : http://threadingbuildingblocks.org/]
[링크 : http://software.intel.com/en-us/articles/intel-ipp/]  

'Programming' 카테고리의 다른 글

ARToolKit / openVRML  (0) 2012.12.25
윤년 계산하기  (2) 2012.05.21
프로그래밍 언어에 대한 생각  (2) 2012.01.25
S language  (0) 2011.07.01
SRS Template  (0) 2011.06.19
Posted by 구차니
Programming/openCV2012. 2. 12. 09:53
2.3.1의 opencv_tutorials.pdf 파일에 들어있는 예제이다.

$ cat opencv_font.c 
#include "opencv/cv.h"
#include "opencv/highgui.h"
int main ( int argc, char **argv )
{
        cvNamedWindow( "My Window", 1 );
        IplImage *img = cvCreateImage( cvSize( 640, 480 ), IPL_DEPTH_8U, 1 );
        CvFont font;
        double hScale = 1.0;
        double vScale = 1.0;
        int lineWidth = 1;

        cvInitFont( &font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC, hScale, vScale, 0, lineWidth );
        cvPutText( img, "Hello World!", cvPoint( 200, 400 ), &font, cvScalar( 255, 255, 0 ) );
 
        cvShowImage( "My Window", img );
        cvWaitKey();

        return 0;
}

$ gcc -lhighgui -lcv opencv_font.c 
opencv_font.c: In function ‘main’:
opencv_font.c:12: error: too few arguments to function ‘cvInitFont’
opencv_font.c:14: error: too few arguments to function ‘cvScalar’
opencv_font.c:16: error: too few arguments to function ‘cvWaitKey’ 

gcc로 하면 에러가 나니 g++로 바꾸어서 컴파일 해준다.
$ g++ -lhighgui -lcv opencv_font.c 
$ ./a.out 


좌표계는 좌측 상단이 (0,0)인듯 하다.

'Programming > openCV' 카테고리의 다른 글

opencv2 on ubuntu  (2) 2013.11.10
openCV Mat / iplImage  (0) 2012.02.21
Cmake로 openCV 컴파일 설정 및 설치하기  (0) 2012.02.12
ubuntu opencv 패키지 버전 정보  (0) 2012.02.12
우분투에서 openCV 카메라 영상받기 예제  (0) 2012.02.04
Posted by 구차니
Programming/openCV2012. 2. 12. 09:48
cmake를 설치 해야 하므로 아래의 패키지이름을 사용하고
$ 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

아무래도 so가 복사되었으니 ldconfig도 실행
$ 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 구차니
Programming/openCV2012. 2. 12. 09:34
2.0.0 으로 추측된다.
$ vi /usr/include/opencv/cvvar.h
#ifndef _CVVERSION_H_
#define _CVVERSION_H_

#define CV_MAJOR_VERSION    2
#define CV_MINOR_VERSION    0
#define CV_SUBMINOR_VERSION 0

#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 /*_CVVERSION_H_*/ 

2012년 2 12일 현재 openCV의 최신 버전은 2.3.1 이며 2011년 9월 12일에 업로드 되었다.
[링크: http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/]

'Programming > openCV' 카테고리의 다른 글

openCV 글씨 쓰기 예제  (2) 2012.02.12
Cmake로 openCV 컴파일 설정 및 설치하기  (0) 2012.02.12
우분투에서 openCV 카메라 영상받기 예제  (0) 2012.02.04
우분투에서 openCV 설치하기  (0) 2012.02.04
openCV  (0) 2012.02.04
Posted by 구차니
Linux/Ubuntu2012. 2. 10. 21:56
로컬에서 접속하면 putty로 접속을 하면 10.0 이 뜨는데
혹시나 해서 ssh에서 동일하게 설정을 하면 서버측의 X로 출력을 보낼수 있다.
 $ export DISPLAY=:0.0

localhost:0.0 으로 하면 안되고, :0.0 으로 해야만 되서 왜 그러나 해서 찾아봤는데
가장 효율적인 접속을 할 수 있는 경로로 접속한다고 한다.
추가내용을 보니, hostname을 비워두면 local로 접속하는데 TCP 소켓이 아닌 로컬 소켓등으로 접속을 하는 것으로 보인다.

Display Names

From the user's perspective, every X server has a display name of the form:

hostname:displaynumber.screennumber

This information is used by the application to determine how it should connect to the server and which screen it should use by default (on displays with multiple monitors):

hostname
The hostname specifies the name of the machine to which the display is physically connected. If the hostname is not given, the most efficient way of communicating to a server on the same machine will be used.

X servers listen for connections on a variety of different communications channels (network byte streams, shared memory, etc.). Since there can be more than one way of contacting a given server, The hostname part of the display name is used to determine the type of channel (also called a transport layer) to be used. X servers generally support the following types of connections: 

local

The
hostname part of the display name should be the empty string. For example: :0:1, and :0.1. The most efficient local transport will be chosen.
TCP/IP

The hostname part of the display name should be the server machine's IP address name. Full Internet names, abbreviated names, and IP addresses are all allowed. For example: x.org:0expo:0198.112.45.11:0bigmachine:1, and hydra:0.1.

[링크 : http://linux.die.net/man/7/x
[링크 : http://www.linuxquestions.org/questions/linux-newbie-8/export-display%3D-0-0-a-682926/

따.. 딱히 귀찮아서 찾은건 아니야!
Posted by 구차니
문득 우리 나라가 왜 "동해"를 국제표기로 밀어야 하나 고민을 하다보니
국제적으로 인정할 만한 이유가 아닌 감정적인 부분으로 밀고 있는게 아닐까 라는 생각이 들었다.


만약 한국에서 동해라고 표기하자고 할게 아니라
한일해 이런식으로 가자고 하면 좀 씨알이 먹히지 않으려나?

독도영유권 문제도 있지만 하나의 국가로서
영토분쟁으로 인해 국경을 마주하고 있으므로 "일본해" 는 적합하지 않으므로
중립적인 용어로서의 동해를 하자 라고 하면 조금 솔깃솔깃? ㅋㅋ




아무튼 지중해가 아니라 이탈리아 해 / 그리스 해 이렇게 싸워대는 거라면
다른 나라들도 싸워댈테니 그냥 지중해 해라~ 이렇게 하지 않았을까? 이런 생각이 든다.



솔찍히 우리땅이야! 라고 하는것 보다는 이게 설득력이 있어 보이지 않음? 

'개소리 왈왈 > 정치관련 신세한탄' 카테고리의 다른 글

아오 히밤  (2) 2012.04.12
KTvs삼성은 무승부?  (0) 2012.02.14
KT랑 스마트 티비랑 싸우면...?  (0) 2012.02.09
방통위, '조립PC 전파인증 받아야'  (2) 2012.02.08
한나라당 -> 새누리당  (4) 2012.02.02
Posted by 구차니
Linux/Ubuntu2012. 2. 10. 14:15

 $ sudo service gdm stop
은 ubuntu 10.04 까지이고
ubuntu 11.10 부터는

 $ sudo service lightdm stop
으로 종료해야 한다고 한다.

[링크 : http://ubuntu.or.kr/~ubuntu/viewtopic.php?p=93957]
2010/08/23 - [Linux/Ubuntu] - ubuntu 에서 X window 종료시키기

Posted by 구차니
개소리 왈왈2012. 2. 9. 22:34
예전에 지어지고 있는 빌라를 보면서 돌로 된 동굴을 연상했었는데
우리가 물을 마시는 머그컵 혹은 유리컵을 보면서
인간은 참으로 땅에서 나서 땅과 함께 살아가는 구나 라는 생각이 들었다. 

엄밀하게는
유리컵의 유리도 돌이고
집을짓는 콘크리트도 돌이고
밥공기를 만드는 도자기에는 흙(돌가루)인데
형태가 다를뿐 결국에는 돌로 둘러쌓인게 지금의 문명이 아닐까?
 


갈수록 흙은 더럽다고 하고
매장도 못하고 태워서 하늘로 보내고
땅에서는 썩지도 못하는 세상이 되는걸 보면...
사람이 땅에서 나서 땅을 버리려 하기 때문에 생기는 문제가 아닐까는 생각이 든다.
 


그러고 보니 아주 옛날에는
임금들은 돌을 세공해서 만든 돌컵으로 물을 마시며 권위를 떨치진 않았을까? 라는 망상 ㅋ

'개소리 왈왈' 카테고리의 다른 글

아 컴퓨터 사고 싶어 ㅠ.ㅠ  (2) 2012.02.18
모든 사람들이 모든걸 다 알고 살아야 할까?  (2) 2012.02.13
미래의 돈줄!  (0) 2012.02.08
왜 게임에 빠져드는 걸까?  (2) 2012.02.05
급 피곤  (4) 2012.02.03
Posted by 구차니
리플들을 보면 삼성이 네트워크 사업자 하라는데 그게 더 우울할꺼같은데?
앞으로 어떻게 될지 무엇을 상상하던 그 이상 안 좋은 결과만 나올 듯한 문제이다.


솔찍히 사용자로서 그 대역폭을 다 쓸수도 없고
쓰는 사람은 극히 드문데 초기 투자비용을 다 회수하고 장비에 투자하지 않고
이윤을 추구하는 네트워크 업체쪽에 손을 들어주기도 싫고
그렇다고 해서 삼성에 손들어주는건 더더욱 싫고..

일부사람들은 종량제를 이야기 하는데
솔찍히 현재 우리나라에서 종량제를 이야기 할때
말도 안되는 가격으로 올려받지 않는다는 전제가 없음에도 그걸 찬성하는건 어떻게 봐야할까?
과거(그리고 현재의 스마트 폰이 아닌 사용자의) 데이터 요금의 종량제 처럼
유선 인터넷도 과금이 된다면 어후... -_- 상상도 하기 싫네

[링크 : http://m.media.daum.net/media/digital/newsview/20120209164303355]
Posted by 구차니