블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday

Category

2010. 3. 13. 01:16 Computer Vision


// Test: video capturing from a camera

#include <OpenCV/OpenCV.h> // matrix operations

int main()
{
    IplImage* image = 0;
    // initialize capture from a camera
    CvCapture* capture = cvCaptureFromCAM(0); // capture from video device #0
    cvNamedWindow("camera");
   
    while(1) {
        if ( !cvGrabFrame(capture) ){
            printf("Could not grab a frame\n\7");
            exit(0);
        }
        else {
        cvGrabFrame( capture ); // capture a frame
        image = cvRetrieveFrame(capture); // retrieve the caputred frame
       
        cvShowImage( "camera", image );
       
        if( cvWaitKey(10) >= 0 )
            break;
        }
    }
   
    cvReleaseCapture( &capture ); // release the capture source
    cvDestroyWindow( "camera" );

    return 0;
}


posted by maetel
2009. 8. 17. 20:15 Computer Vision
Oxford 대학  Active Vision Group에서 개발한
PTAM (Parallel Tracking and Mapping for Small AR Workspaces)
Questions? E-mail ptam@robots.ox.ac.uk
README

맥미니에서의 설치를 끝내고 (test log on mac) 테스트해 보면 성능이 좋지 않아 그대로 쓸 수는 없는 상태이다.


0. Video Input
The software requires a video camera with a wide-angle lens, capable of 640x480x30Hz video capture and an appropriate driver installation (which is supported by libCVD.)




1. Camera Parameters
 
CameraCalibrator를 실행시키면 calibrator_settings.cfg 파일을 읽어 온다.
여기에 gvars (PTAM 라이브러리를 지원하는 Gvars3 라이브러리) settings이 설정되어 있...어야 하는데 빈 채로 주어졌다.

CameraCalibrator를 실행시킨 결과로 연산된 카메라 파라미터는 camera.cfg 파일에 저장된다.
실행 후 열어 보면,
Camera.Parameters=[ 3.02629 6.17916 0.524049 0.291111 2.1234 ]
라는 식으로 CameraCalibrator 실행창에서 나타나는 그대로 되어 있다. save 버튼을 눌렀을 때 저장되는 것.

PTAM을 실행시키면 settings.cfg 파일을 읽어 온다. 파일을 열어 보면, 여기에도 gvars setting을 첨가할 수 있다는 주석이 있고, 다음 명령문으로 위에서 저장한 camera.cfg 파일을 불러서 실행한다.
exec camera.cfg
즉, Camera.Parameters 변수에 값이 assign되는 것.

정리하면,
calibrator_settings.cfg -> CameraCalibrator -> camera.cfg -> settings.cfg -> PTAM







fast feature detection
http://mi.eng.cam.ac.uk/~er258/work/fast.html

ref.
http://en.wikipedia.org/wiki/Feature_detection_%28computer_vision%29



main.cc
1) settings.cfg 파일 로드 GUI.LoadFile("settings.cfg");

2) 사용자 입력 parsing GUI.StartParserThread();

3) 클래스 system (system.h) 실행 s.Run();

atexit
Set function to be executed on exit
The function pointed by the function pointer argument is called when the program terminates normally.

try-if 구문
1) Deitel 823p "catch handler"
2) theuhm@naver: "에러가 발생한 객체는 예외를 발생시킴과 동시에 try블럭 안의 모든 객체는 스코프를 벗어나 참조할 수 없게 되므로 예외를 처리하는 동안 try블럭 안에서 예외를 발생시켰을 수 있는 객체의 참조를 원천적으로 막아 더 안전하고 깔끔한 예외처리를 할 수 있는 환경을 만들어줍니다. 그리고 예외를 던질 때에 예외 객체의 클래스를 적절히 구성하면, 예외 객체에 예외를 처리하는 방법을 담아서 던질 수도 있습니다. 그렇게 구성하면 굉장히 깔끔한 코드를 얻을 수 있죠.

set
Sets are a kind of associative containers that stores unique elements, and in which the elements themselves are the keys. Sets are typically implemented as binary search trees.

namespace

system.h
1) PTAM에서 핵심적 기능을 하는 클래스들과 클래스 "System"을 선언
// Defines the System class
// This stores the main functional classes of the system
class ATANCamera;
class Map;
class MapMaker;
class Tracker;
class ARDriver;
class MapViewer;
class System;



system.cc



ATANCamera.h
FOV distortion model of Deverneay and Faugeras

Duvernay and Faugeras


'Computer Vision' 카테고리의 다른 글

Five-Point algorithm  (0) 2009.08.18
UNIX references  (0) 2009.08.17
PTAM test log on Mac OS X  (7) 2009.08.05
SLAM related generally  (0) 2009.08.04
Kalman Filter  (0) 2009.07.30
posted by maetel
2008. 5. 21. 09:46 Computation/Algorithm
http://ref.daum.net/item/928715
국제통신컨퍼런스99: A Multi-Resolution Video Scheme for Multimedia Information Servers in Mobile Computing Environment

A nonlinear interpolation scheme for still color image resolution enhancement introduced. It is based on the use of a Self-Creating and Organizing Neural Network, which extracts feature of local pixel distribution and presents optimal interpolation coefficient. Interpolation order is restricted to one and proposed algorithm is compared to one linear and two nonlinear first order interpolation algorithms. Experimental results indicated that proposed algorithm produce better quantitative results than other techniques.


'Computation > Algorithm' 카테고리의 다른 글

[Gonzalez & Woods] Digital Image Processing  (0) 2008.07.08
Natural Computing Series  (0) 2008.07.06
sorting algorithms  (0) 2008.03.24
fractal flame  (0) 2007.12.29
steering vector  (0) 2007.06.25
posted by maetel
2007. 8. 11. 12:35 Hardware/network
library for p5:
1) JMyron: http://webcamxtra.sourceforge.net
    -> library (for intel mac): http://www.jibberia.com/projects
2) LibCV - alternative video capture for Processing: http://toxi.co.uk/p5/libcv  (mac에서는 안 되는 것으로 보임. JMF)

http://processing.org/reference/libraries/video/index.html

1) Ken Perlin's Physical Media (Graduate), Spring 2006: VIDEO TRACKING WORKING IN PROCESSING

2) Dan O'Sullivan's Physical Computing: ProcVid: Video Tracking in Processing


vdig for QT on windows:
http://www.abstractplane.com/products/vdig.jsp
http://blog.maxray.net/index.php?pl=183
http://a.parsons.edu/~getFrame/students/jacqueline/src/WinVDIG.exe

macam on mac:
http://webcam-osx.sourceforge.net
http://www.vimicro.com/english/product/pc003.htm
Damian at appleforum: "UVC라는 표준규격을 만족하는 웹캠은 별도의 드라이버 없이 Mac OS X 10.4.3 이후 버젼에서 바로 인식한다고 하는 군요. macam 홈페이지에서도 해당 모델을 확인할 수 있습니다. 다만, 이런 모델들은 10만원 대에서 가격이 형성되어 있어 iSight와 큰 차이가 없습니다."

USB 연장선
http://en.wikipedia.org/wiki/USB#Version_history
http://www.icoda.co.kr/i_product/pro_view.html?it_num=67368
리피터 (5m 이상일 경우): http://www.icoda.co.kr/i_product/pro_view.html?it_num=80036


related projects:
http://itp.nyu.edu/%7Edbo3/proj/index.htm#webcam


* (informed by 오동훈)
USB 연장선으로 노이즈가 발생할 정도로 긴 거리에서라면 1394용 카메라를 써야 한다. (약 50만원 안팎)
http://www.cylod.com/



'Hardware > network' 카테고리의 다른 글

RS232 data communication - MT9  (0) 2008.08.16
UART (범용 비동기화 송수신기)  (0) 2008.07.02
bluetooth on Mac  (0) 2008.06.17
posted by maetel