Raspberry PI에서 The Imaging Source USB 2.0 카메라를 사용할 수 있습니다.
USB 2.0 카메라를 사용하기 위해 Firmware Update 등의 작업을 수행해야 하며, 자세한 내용은 아래의 링크를 참조하세요.
https://github.com/TheImagingSource/tiscamera/wiki/Getting-Started-with-USB-Cameras
USB 2.0 카메라를 guvcview에서 연결하여 영상을 확인하면 컬러 카메라를 연결하였더라도 gray scale로만 출력됩니다.
The Imaging Source 카메라는 bayer raw data만을 전송하기 때문에, 컬러로 영상을 확인하기 위해서는 gstreamer pipeline 모듈을 추가해야 합니다.
컴파일을 위해서는 gcc 4.8이 먼저 설치되어야 합니다.
sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 10
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 30
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 30
설치된 gcc 버전이 4.8인지 확인
gcc -version
추가적으로 다음의 패키지 설치가 필요합니다.
sudo apt-get install autoconf libglib2.0 libudev-dev libgstreamer0.10 gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-tools
패키지를 설치 완료 한 후, github로 부터 다운받은 디렉토리의 "src" 디렉토리를 아래와 같이 수정.
Once in there, call
./bootstraph.sh
./configure
Error가 발생하지 않을 경우 , call make.
추가 정보는 https://github.com/TheImagingSource/tiscamera/tree/master/src 의 "Read Me" 내용에서 확인 가능합니다.
Gstreamer는 새롭게 빌드된 pipeline 모듈을 찾을 것이며, 새로운 환경변수를 아래와 같이 추가 시켜야 합니다.
GST_PLUGIN_PATH=:/home/pi/tiscamera/src
For doing this permanently in in the bash, change your ~/.bashrc:
Add the line at the bottom of the file:
export GST_PLUGIN_PATH="$GST_PLUGIN_PATH:/home/pi/tiscamera/src:$HOME/.gst_plugins:$E_GST_0_10"
and save.
Now you can try some pipelines as shown at https://github.com/TheImagingSource/tiscamera/wiki/First-Steps at the bottom.
DFK 72AUC02 카메라를 640x480, 15 FPS로 사용할때에는 아래의 샘플과 같이 사용.
gst-launch-0.10 v4l2src ! video/x-raw-gray,width=640,height=480,framerate=15/1 !videorate ! video/x-raw-gray,framerate=3/2 ! tis_auto_exposure ! tiscolorize ! tiswhitebalance ! bayer2rgb ! ffmpegcolorspace ! ximagesink
카메라의 컬러 및 노출 시간등은 현재 조명 상태에 맞춰 자동으로 설정됩니다.
Raspberry PI는 낮은 하드웨어 사양이므로 카메라의 전체 해상도 및 최대 FPS를 사용하는데 문제가 있을 수 있습니다.
Raspberry의 CPU 로드가 높지 않게 사용을 위해서는 카메라 FPS를 3 이하로 설정하는 것이 좋습니다.