블로그 이미지
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

2009. 8. 5. 14:36 Computer Vision
Oxford 대학  Active Vision Group에서 개발한
PTAM (Parallel Tracking and Mapping for Small AR Workspaces)
http://www.robots.ox.ac.uk/~gk/PTAM/

Questions? E-mail ptam@robots.ox.ac.uk


0. requirements 확인

readme 파일에서 언급하는 대로 프로세서와 그래픽카드를 확인하니

내가 설치할 컴퓨터 사양:
Model Name:    Mac mini
  Model Identifier:    Macmini3,1
  Processor Name:    Intel Core 2 Duo
  Processor Speed:    2 GHz
  Number Of Processors:    1
  Total Number Of Cores:    2
  L2 Cache:    3 MB
  Memory:    1 GB
  Bus Speed:    1.07 GHz
  Boot ROM Version:    MM31.0081.B00

그래픽 카드:
NVIDIA GeForce 9400

"Intel Core 2 Duo processors 2.4GHz+ are fine."이라고 했는데, 2.0이면 되지 않을까? 그래픽 카드는 동일한 것이니 문제 없고.


1. library dependency 확인

1. TooN - a header library for linear algebra
2. libCVD - a library for image handling, video capture and computer vision
3. Gvars3 - a run-time configuration/scripting library, this is a sub-project of libCVD.
셋 다 없으므로,

1-1. TooN 다운로드

TooN (Tom's object oriented Numerics)선형대수 (벡터, 매트릭스 연산)를 위해 Cambridge Machine Intelligence lab에서 개발한 C++ 라이브러리라고 한다.

ref. TooN Documentation (<- 공식 홈보다 정리가 잘 되어 있군.)

다음과 같은 명령으로 다운로드를 받는다.
%% cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/toon co TooN

실행 결과:

생성된 TooN 폴더에 들어가서
%%% ./configure

실행 결과:


1-1-1. 더 안정적인(?) 버전을 받으려면

%% cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/toon co -D "Mon May 11 16:29:26 BST 2009" TooN

실행 결과:


1-2. libCVD 다운로드

libCVD (Cambridge Video Dynamics)같은 연구실에서 만든 컴퓨터 비전 관련 이미지 처리를 위한 C++ 라이브러리

ref. CVD documentation

%% cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/libcvd co -D "Mon May 11 16:29:26 BST 2009" libcvd

실행 결과:



1-3. Gvars3 다운로드

Gvars3 (configuration system library)
 
%% cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/libcvd co -D "Mon May 11 16:29:26 BST 2009" gvars3

실행 결과:


2. 다운로드한 기반 라이브러리 설치

2-1. TooN 설치

2-1-1. configure file 실행

configure scripts는 source code를 compile하고 실행시킬 수 있게 만들어 주는 것.

생성된 TooN 폴더에 들어가서
%%% ./configure

실행 결과:

2-1-2. 설치

(TooN은 헤더파일들의 모음이므로 compile이 필요없다.)

%%% sudo make install

실행 결과:
mkdir -p //usr/local/include/TooN
cp *.h //usr/local/include/TooN
cp -r optimization //usr/local/include/TooN/
cp -r internal //usr/local/include/TooN/


2-2. libCVD 설치

2-2-1. configure 파일 실행

생성된 libCVD 폴더에 들어가서
%%% export CXXFLAGS=-D_REENTRANT
%%% ./configure --without-ffmpeg

실행 결과:

2-2-2. documents 생성 (생략해도 되는 듯)

다시 시도했더니
%%% make docs

make: *** No rule to make target `docs'.  Stop.
여전히 안 되는 듯... 아! doxygen을 맥포트로 설치해서 그런가 보다. (데이터베이스가 서로 다르다고 한다.)_M#]


2-2-3. compile 컴파일하기

%%% make

실행 결과:


2-2-4. install 설치하기

%%% sudo make install

실행 결과:


2-3. Gvars3  설치

2-3-1. configure 파일 실행

Gvars3 폴더에 들어가서
%%% ./configure --disable-widgets

실행 결과:


2-3-2. compile 컴파일하기

%%% make

실행 결과:


2-3-3. install 설치하기

%%% sudo make install

mkdir -p //usr/local/lib
cp libGVars3.a libGVars3_headless.a //usr/local/lib
mkdir -p //usr/local/lib
cp libGVars3-0.6.dylib //usr/local/lib
ln -fs  //usr/local/lib/libGVars3-0.6.dylib //usr/local/lib/libGVars3-0.dylib
ln -fs  //usr/local/lib/libGVars3-0.dylib //usr/local/lib/libGVars3.dylib
mkdir -p //usr/local/lib
cp libGVars3_headless-0.6.dylib //usr/local/lib
ln -fs  //usr/local/lib/libGVars3_headless-0.6.dylib //usr/local/lib/libGVars3_headless-0.dylib
ln -fs  //usr/local/lib/libGVars3_headless-0.dylib //usr/local/lib/libGVars3_headless.dylib
mkdir -p //usr/local/include
cp -r gvars3 //usr/local/include


2-4. OS X에서의 컴파일링과 관련하여

ref. UNIX에서 컴파일하기
Porting UNIX/Linux Applications to Mac OS X: Compiling Your Code in Mac OS X



3. PTAM 컴파일

3-1. 해당 플랫폼의 빌드 파일을 PTAM source 디렉토리로 복사

내 (OS X의) 경우, PTAM/Build/OS X에 있는 모든 (두 개의) 파일 Makefile과 VideoSource_OSX.cc를 PTAM 폴더에 옮겼다.

3-2. video source 셋업

카메라에 맞는 video input file을 컴파일하도록 Makefile을 수정해 주어야 한다.
맥의 경우, (아마도 Logitech Quickcam Pro 5000 을 기준으로 하는) 하나의 소스 파일만이 존재하므로 그대로 두면 될 듯.

3-3. video source 추가

다른 비디오 소스들은 libCVD에 클래스로 만들어져 있다고 한다. 여기에 포함되어 있지 않은 경우에는 VideoSource_XYZ.cc 라는 식의 이름을 갖는 파일을 만들어서 넣어 주어야 한다.

3-4. compile

PTAM 폴더에 들어가서
%% make

실행 결과:
g++ -g -O3 main.cc -o main.o -c -I /MY_CUSTOM_INCLUDE_PATH/ -D_OSX -D_REENTRANT
g++ -g -O3 VideoSource_OSX.cc -o VideoSource_OSX.o -c -I /MY_CUSTOM_INCLUDE_PATH/ -D_OSX -D_REENTRANT
g++ -g -O3 GLWindow2.cc -o GLWindow2.o -c -I /MY_CUSTOM_INCLUDE_PATH/ -D_OSX -D_REENTRANT
In file included from OpenGL.h:20,
                 from GLWindow2.cc:1:
/usr/local/include/cvd/gl_helpers.h:38:19: error: GL/gl.h: No such file or directory
/usr/local/include/cvd/gl_helpers.h:39:20: error: GL/glu.h: No such file or directory
/usr/local/include/cvd/gl_helpers.h: In function 'void CVD::glPrintErrors()':
/usr/local/include/cvd/gl_helpers.h:569: error: 'gluGetString' was not declared in this scope
make: *** [GLWindow2.o] Error 1

이 에러 메시지는 다음 링크에서 논의되고 있는 문제와 비슷한 상황인 것 같다.
http://en.allexperts.com/q/Unix-Linux-OS-1064/Compiling-OpenGL-unix-linux.htm


3-4-1. OpenGL on UNIX

PTAM이 OpenGL을 사용하고 있는데, OpenGL이 Mac에 기본으로 설치되어 있으므로 신경쓰지 않았던 부분이다. 물론 system의 public framework으로 들어가 있음을 확인할 수 있다. 그런데 UNIX 프로그램에서 접근할 수는 없는가? (인터넷에서 검색해 보아도 따로 설치할 수 있는 다운로드 링크나 방법을 찾을 수 없다.)

에러 메시지에 대한 정확한 진단 ->
philphys: 일단 OpenGL은 분명히 있을 건데 그 헤더파일과 라이브러리가 있는 곳을 지정해 주지 않아서 에러가 나는 것 같아. 보통 Makefile에 이게 지정되어 있어야 하는데 실행결과를 보니까 전혀 지정되어 있지 않네. 중간에 보면 -I /MY_CUSTOM_INCLUDE_PATH/ 라는 부분이 헤더 파일의 위치를 지정해 주는 부분이고 또 라이브러리는 뒤에 링크할 때 지정해 주게 되어 있는데 거기까지는 가지도 못 했네.
즉, "링커가 문제가 아니라, 컴파일러 옵션에 OpenGL의 헤더파일이 있는 디렉토리를 지정해 주어야 할 것 같다"고 한다.

문제의 Makefile을 들여다보고

Makefile을 다음과 같이 수정하고 (보라색 부분 추가)
COMPILEFLAGS = -I /MY_CUSTOM_INCLUDE_PATH/ -D_OSX -D_REENTRANT -I/usr/X11R6/include/

philphys: /usr/X11R6/include 밑에 GL 폴더가 있고 거기에 필요한 헤더파일들이 모두 들어 있다. 그래서 코드에선 "GL/gl.h" 하는 식으로 explicit하게 GL 폴더를 찾게 된다.

그러고 보면 아래와 같은 설명이 있었던 것이다.
Since the Linux code compiles directly against the nVidia driver's GL headers, use of a different GL driver may require some modifications to the code.

다시 컴파일 하니,
실행 결과:

설치 완료!
두 실행파일 PTAM과 CameraCalibrator이 생성되었다.


3-5. X11R6에 대하여

X11R6 = Xwindow Verion 11 Release 6

Xwindow
X.org



4. camera calibration

CameraCalibrator 파일을 실행시켜 카메라 캘리브레이션을 시도했더니 GUI 창이 뜨는데 연결된 웹캠(Logitech QuickCam Pro 4000)으로부터 입력을 받지 못 한다.

4-0. 증상

CameraCalibrator 실행파일을 열면, 다음과 같은 터미널 창이 새로 열린다.
Last login: Fri Aug  7 01:14:05 on ttys001
%% /Users/lym/PTAM/CameraCalibrator ; exit;
  Welcome to CameraCalibrator
  --------------------------------------
  Parallel tracking and mapping for Small AR workspaces
  Copyright (C) Isis Innovation Limited 2008

  Parsing calibrator_settings.cfg ....
! GUI_impl::Loadfile: Failed to load script file "calibrator_settings.cfg".
  VideoSource_OSX: Creating QTBuffer....
  IMPORTANT
  This will open a quicktime settings planel.
  You should use this settings dialog to turn the camera's
  sharpness to a minimum, or at least so small that no sharpening
  artefacts appear! In-camera sharpening will seriously degrade the
  performance of both the camera calibrator and the tracking system.

그리고 Video란 이름의 GUI 창이 열리는데, 이때 아무런 설정을 바꾸지 않고 그대로 OK를 누르면 위의 터미널 창에 다음과 같은 메시지가 이어지면서 자동 종료된다.
  .. created QTBuffer of size [640 480]
2009-08-07 01:20:57.231 CameraCalibrator[40836:10b] ***_NSAutoreleaseNoPool(): Object 0xf70e2c0 of class NSThread autoreleasedwith no pool in place - just leaking
Stack: (0x96827f0f 0x96734442 0x9673a1b4 0xbc2db7 0xbc7e9a 0xbc69d30xbcacbd 0xbca130 0x964879c9 0x90f8dfb8 0x90e69618 0x90e699840x964879c9 0x90f9037c 0x90e7249c 0x90e69984 0x964879c9 0x90f8ec800x90e55e05 0x90e5acd5 0x90e5530f 0x964879c9 0x94179eb9 0x282b48 0xd9f40xd6a6 0x2f16b 0x2fea4 0x26b6)
! Code for converting from format "Raw RGB data"
  not implemented yet, check VideoSource_OSX.cc.

logout

[Process completed]

그러므로 3-3의 문제 -- set up video source (비디오 소스 셋업) --로 돌아가야 한다.
즉, VideoSource_OSX.cc 파일을 수정해서 다시 컴파일한 후 실행해야 한다.

Other video source classes are available with libCVD. Finally, if a custom video source not supported by libCVD is required, the code for it will have to be put into some VideoSource_XYZ.cc file (the interface for this file is very simple.)

삽질...



4-1. VideoSource_OSX.cc 파일 수정



수정한 VideoSource 파일

터미널 창:
Welcome to CameraCalibrator
  --------------------------------------
  Parallel tracking and mapping for Small AR workspaces
  Copyright (C) Isis Innovation Limited 2008

  Parsing calibrator_settings.cfg ....
  VideoSource_OSX: Creating QTBuffer....
  IMPORTANT
  This will open a quicktime settings planel.
  You should use this settings dialog to turn the camera's
  sharpness to a minimum, or at least so small that no sharpening
  artefacts appear! In-camera sharpening will seriously degrade the
  performance of both the camera calibrator and the tracking system.
>   .. created QTBuffer of size [640 480]
2009-08-13 04:02:50.464 CameraCalibrator[6251:10b] *** _NSAutoreleaseNoPool(): Object 0x9df180 of class NSThread autoreleased with no pool in place - just leaking
Stack: (0x96670f4f 0x9657d432 0x965831a4 0xbc2db7 0xbc7e9a 0xbc69d3 0xbcacbd 0xbca130 0x924b09c9 0x958e8fb8 0x957c4618 0x957c4984 0x924b09c9 0x958eb37c 0x957cd49c 0x957c4984 0x924b09c9 0x958e9c80 0x957b0e05 0x957b5cd5 0x957b030f 0x924b09c9 0x90bd4eb9 0x282b48 0xd414 0xcfd6 0x2f06b 0x2fda4)



4-2. Camera Calibrator 실행


Camera calib is [ 1.51994 2.03006 0.499577 0.536311 -0.0005 ]
  Saving camera calib to camera.cfg...
  .. saved.



5. PTAM 실행


  Welcome to PTAM
  ---------------
  Parallel tracking and mapping for Small AR workspaces
  Copyright (C) Isis Innovation Limited 2008

  Parsing settings.cfg ....
  VideoSource_OSX: Creating QTBuffer....
  IMPORTANT
  This will open a quicktime settings planel.
  You should use this settings dialog to turn the camera's
  sharpness to a minimum, or at least so small that no sharpening
  artefacts appear! In-camera sharpening will seriously degrade the
  performance of both the camera calibrator and the tracking system.
>   .. created QTBuffer of size [640 480]
2009-08-13 20:17:54.162 ptam[1374:10b] *** _NSAutoreleaseNoPool(): Object 0x8f5850 of class NSThread autoreleased with no pool in place - just leaking
Stack: (0x96670f4f 0x9657d432 0x965831a4 0xbb9db7 0xbbee9a 0xbbd9d3 0xbc1cbd 0xbc1130 0x924b09c9 0x958e8fb8 0x957c4618 0x957c4984 0x924b09c9 0x958eb37c 0x957cd49c 0x957c4984 0x924b09c9 0x958e9c80 0x957b0e05 0x957b5cd5 0x957b030f 0x924b09c9 0x90bd4eb9 0x282b48 0x6504 0x60a6 0x11af2 0x28da 0x2766)
  ARDriver: Creating FBO...  .. created FBO.
  MapMaker: made initial map with 135 points.
  MapMaker: made initial map with 227 points.


The software was developed with a Unibrain Fire-i colour camera, using a 2.1mm M12 (board-mount) wide-angle lens. It also runs well with a Logitech Quickcam Pro 5000 camera, modified to use the same 2.1mm M12 lens.

iSight를 Netmate 1394B 9P Bilingual to 6P 케이블로  MacMini에 연결하여 해 보니 더 잘 된다.



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

UNIX references  (0) 2009.08.17
PTAM to be dissected on OS X  (0) 2009.08.17
SLAM related generally  (0) 2009.08.04
Kalman Filter  (0) 2009.07.30
OpenCV 1.0 설치 on Mac OS X  (0) 2009.07.27
posted by maetel
2009. 8. 4. 23:07 Computer Vision
SLAM 전반/기본에 관한 자료

Durrant-Whyte & Bailey "Simultaneous localization and mapping"
http://leeway.tistory.com/667


Søren Riisgaard and Morten Rufus Blas
SLAM for Dummies: A Tutorial Approach to Simultaneous Localization and Mapping
http://leeway.tistory.com/688


Joan Solà Ortega (de l’Institut National Polytechnique de Toulouse, 2007)
Towards visual localization, mapping and moving objects tracking by a mobile robot: A geometric and probabilistic approach
ch3@ http://leeway.tistory.com/628


SLAM summer school
2009 Australian Centre for Field Robotics, University of Sydney
http://www.acfr.usyd.edu.au/education/summerschool.shtml
2006 Department of Engineering Science and Robotics Research Group, Oxford
http://www.robots.ox.ac.uk/~SSS06/Website/index.html
2004 Laboratory for Analysis and Architecture of Systems  (LAAS-CNRS) located in Toulouse
http://www.laas.fr/SLAM/
2002 Centre for Autonomous Systems
Numerical Analysis and Computer Science
Royal Institute of Technology
, Stockholm
http://www.cas.kth.se/SLAM/


http://www.doc.ic.ac.uk/%7Eajd/Scene/Release/monoslamtutorial.pdf
Oxford 대학 Active Vision LabVisual Information Processing (VIP) Research Group에서 개발한 SceneLib tutorial인데, Monocular Single Camera를 사용한 SLAM의 기본 개념을 정리해 놓았다.

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

PTAM to be dissected on OS X  (0) 2009.08.17
PTAM test log on Mac OS X  (7) 2009.08.05
Kalman Filter  (0) 2009.07.30
OpenCV 1.0 설치 on Mac OS X  (0) 2009.07.27
cameras on mac os x  (0) 2009.07.27
posted by maetel
2009. 7. 30. 21:12 Computer Vision
Dan Simon 
http://academic.csuohio.edu/simond/
- Kalman Filetering, 72-79p, Embedded Systems Programming f e a tur e, JUNE 2001
http://leeway.tistory.com/728 : 가장 쉽고 간략한 설명 (매트랩 예제와 C로 구현한 칼만 필터 소스 포함)
- Kalman Filtering with State Constraints: A Survey of Linear and Nonlinear Algorithms
http://academic.csuohio.edu/simond/ConstrKF/
- Kalman Filtering
http://www.innovatia.com/software/papers/kalman.htm
- book: Optimal state estimation: Kalman, H [infinity] and nonlinear approaches
http://academic.csuohio.edu/simond/estimation/


Greg Welch and Gary Bishop
Kalman filter
http://www.cs.unc.edu/~welch/kalman/index.html
- SIGGRAPH 2001 Courses Course 8 - An Introduction to the Kalman Filter
http://www.cs.unc.edu/~tracker/ref/s2001/kalman/index.html


Kalman Filters in the MRPT
http://babel.isa.uma.es/mrpt/index.php/Kalman_Filters


Taygeta Scientific
Kalman filter information
http://www.taygeta.com/kalman.html


http://en.wikipedia.org/wiki/Kalman_filter

A New Approach to Linear Filtering and Prediction Problems, by R. E. Kalman, 1960


Rudy Negenborn
Robot Localization and Kalman Filters: On finding your position in a noisy world
http://leeway.tistory.com/696


용가리@네이버: 칼만 필터 - part 1 & part 2


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

PTAM test log on Mac OS X  (7) 2009.08.05
SLAM related generally  (0) 2009.08.04
OpenCV 1.0 설치 on Mac OS X  (0) 2009.07.27
cameras on mac os x  (0) 2009.07.27
Brian Williams, Georg Klein and Ian Reid <Real-Time SLAM Relocalisation>  (0) 2009.07.23
posted by maetel
2009. 7. 27. 20:50 Computer Vision
http://opencv.willowgarage.com/wiki/InstallGuide

http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port

Installing OpenCV on OS/X with Python - Princess Polymath


0. MacPorts 설치 -> 참조

1. SubVersion 설치

%% sudo port install subversion
Password:




2. OpenCV 다운로드

%% svn co http://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/trunk opencv



3. 다운로드 받은 OpenCV 확인

%% port search opencv

opencv @1.0.0 (graphics, science)
    Intel(R) Open Source Computer Vision Library


3-1. 좀 더 자세한 정보 보기

%% port info opencv

opencv @1.0.0 (graphics, science)
Variants:    universal

opencv is a library that is mainly aimed at real time computer
vision. Some example areas would be Human-Computer Interaction
(HCI), Object Identification, Segmentation and Recognition, Face
Recognition, Gesture Recognition, Motion Tracking, Ego Motion,
Motion Understanding, Structure From Motion (SFM), and Mobile
Robotics.
Homepage:    http://www.intel.com/technology/computing/opencv/

Library Dependencies: gtk2, zlib, jpeg, libpng, tiff
Platforms:            darwin
Maintainers:          stante@gmail.com



4. OpenCV 설치하기

OpenCV 공식 위키의 설명대로 하면 안 되어서,
( cf. http://en.wikipedia.org/wiki/CMake
http://www.cmake.org/ )

예전에 Freeimage를 설치했던 과정을 참고로 MacPorts를 사용하자.
ref. http://opencv.darwinports.com/


%% sudo port install opencv



4-1. Python 2.5를 (OpenCV의 무엇에 대해서란 말인지는 모르겠으나;;;) 기본으로 설정하기

(맥에 파이썬이 기본으로 설치되어 있음은 나도 알고 있다. 여기에서는 버전을 지정/설정해 주라는 뜻인 것 같은데... 확실치 않다...)
To fully complete your installation and make python 2.5 the default, please run

    sudo port install python_select 
    sudo python_select python25

위와 같은 메시지가 있기에, 그대로..
%% sudo port install python_select 

실행 결과:
--->  Fetching python_select
--->  Attempting to fetch select-0.2.1.tar.gz from http://svn.macports.org/repository/macports/contrib/select/
--->  Verifying checksum(s) for python_select
--->  Extracting python_select
--->  Configuring python_select
--->  Building python_select
--->  Staging python_select into destroot
--->  Installing python_select @0.2.1_0+darwin_9
--->  Activating python_select @0.2.1_0+darwin_9
--->  Cleaning python_select

그리고...
%% sudo python_select python25

Selecting version "python25" for python


4-2. Python에 대하여

그냥 한 번 보기 (버전 업그레이드해야 하는 지도 모르고 하니...)
%% port info python25

python25 @2.5.4, Revision 6 (lang)
Variants:    darwin_10, darwin_7, darwin_8, darwin_9, macosx,
             puredarwin, universal

Python is an interpreted, interactive, object-oriented programming
language.
Homepage:    http://www.python.org/

Library Dependencies: gettext, zlib, openssl, tk, sqlite3, db46,
                      bzip2, gdbm, readline, ncurses
Platforms:            darwin
Maintainers:          mww@macports.org


cf.
http://wiki.python.org/moin/MacPython/Leopard
(상위 버전이 나왔으나 지금은 OpenCV를 위해서라면 그대로 2.5가 괜찮을 듯.)

ref.
Installing OpenCV on OS/X with Python - Princess Polymath


4-3. Mac에서 Unix application을  porting하는 문제에 대하여

http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/



4-4. private framework

공식 위키의 안내대로 OpenCV를 Xcode에서 부를 수 있도록 Mac OS X용 frameworks를 만들기 위해,
생성된 opencv 폴더 아래에서 make_frameworks.sh가  opencv 폴더에 있음을 확인하고 실행을 시켰다.

%% ./make_frameworks.sh

실패. 빌딩 준비만 하다가 끝난 것이라고 한다.



5. Xcode에서 OpenCV frameworks 추가하기

frameworks에는 public과 private이 있는데, OpenCV는 private framework이다.
(Mac의 public frameworks들은 /System/Library/Framework 에 있다.)


5-1. OpenCV  프레임웍 추가

4-4의 시도가 실패했으므로 (이를 바로잡기보다 우선은 편하게),
아래 링크에서 미리 built된 맥용 OpenCV frameworks를 다운로드 한다. (또는 두번째 링크에서 1.2버전 바로 받기 )
Institut für Nachrichtentechnik – OpenCV - Universal Binary Frameworks for MacOS X

.dmg 파일을 실행시켜 마운트된 이미지에서 OpenCV.framework 폴더를
/Library/Frameworks 에 넣는다.

5-2. Xcode 프로젝트에 프레임웍 삽입 (Xcode 3.1 기준)

Xcode를 열고 새 프로젝트 Command Line Utility / C++ Tool 을 만들고,
(자동으로 프로젝트와 동일명의 target 이 생성됨)
왼쪽 바 Groups & Files에서 프로젝트를 오른쪽 마우스 클릭하여 Add > Existing Frameworks 선택한다.
탐색창이 뜨면 /Library/Frameworks/OpenCV.framework 를 찾아 추가한다.

5-3. 테스트

아래 링크들의 예제 파일들을 실행시켜 본다.

ref.
http://stefanix.net/opencv-in-xcode
Wonwoo's Life DB :: OpenCV를 MAC OS X의 XCODE 에서 사용하기
Phillip Whisenhunt - Using openCV for Mac OS in XCode
Installing OpenCV on Mac OS X - NUI Group Community Wiki


5-4. Mac에서의 frameworks에 대하여
 
http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port 를 보고도 헤매여야 했던 이유를
http://opencv.willowgarage.com/wiki/PrivateFramework 에서 알 수 있었다.

ADC: Framework Programming Guide: Creating a Framework
A framework is a hierarchical directory that encapsulates shared resources, such as a dynamic shared library, nib files, image files, localized strings, header files, and reference documentation in a single package.

A framework is also a bundle and its contents can be accessed using Core Foundation Bundle Services or the Cocoa NSBundle class.

Frameworks can include a wider variety of resource types than libraries.

http://en.wikipedia.org/wiki/Framework

http://en.wikipedia.org/wiki/Software_framework


OpenCV is a Private Framework
(2007-06-10, Mark Asbach)

posted by maetel
2009. 7. 27. 17:04 Computer Vision
software

macam : USB webcam support for Mac OS X
http://webcam-osx.sourceforge.net/cameras/index.php

webcam + opencv - SWiK
http://swik.net/webcam+opencv

Video device drivers - IOXperts is a leading provider of drivers for USB and FireWire cameras
http://www.ioxperts.com/devices/supportedvideo.html


cameras

Logitech QuickCam® Communicate STX™

Logitech QuickCam Pro 4000

iSight
http://en.wikipedia.org/wiki/ISight

MacOS X Compatible Cameras




Macintosh computers


Mac mini 맥미니 (Firewire 800)

Mac mini 맥미니 (Firewire 800)





cables

Mac mini 맥미니 (Firewire 800) - 1394 (Firewire 400) 카메라 케이블:
6-pin to 9-pin FireWire Adapter

Sonnet - FireWire 400 to 800 Adapter
Netmate 1394B 9P Bilingual to 6P 케이블 2M



posted by maetel
2009. 7. 23. 18:53 Computer Vision
Brian Williams, Georg Klein and Ian Reid
(Department of Engineering Science, University of Oxford, UK)
Real-Time SLAM Relocalisation
In Proceedings of the International Conference on Computer Vision, Rio de Janeiro, Brazil, 2007
demo 1
demo 2


• real-time, high-accuracy localisation and mapping during tracking
• real-time (re-)localisation when when tracking fails
• on-line learning of image patch appearance so that no prior training or map structure is required and features are added and removed during operation.


Lepetit's image patch classifier (feature appearance learning)
=> integrating the classifier more closely into the process of map-building
(by using classification results to aid in the selection of new points to add to the map)


> recovery from tracking failure: local vs. global
local -  particle filter -> rich feature descriptor
global - proximity using previous key frames


- based on SceneLib (Extended Kalman Filter)
- rotational (and a degree of perspective) invariance via local patch warping
- assuming the patch is fronto-parallel when first seen
http://freshmeat.net/projects/scenelib/

active search

innovation covariance

joint compatibility test

randomized lists key-point recognition algorithm
1. randomized: (2^D  - 1) tests -> D tests
2. independent treatment of classes
3. binary leaf scores (2^D * C * N bits for all scores)
4. intensity offset
5. explicit noise handing

training the classifier

The RANSAC (Random Sample Consensus) Algorithm




ref.
Davison, A. J. and Molton, N. D. 2007.
MonoSLAM: Real-Time Single Camera SLAM. IEEE Trans. Pattern Anal. Mach. Intell. 29, 6 (Jun. 2007), 1052-1067. DOI= http://dx.doi.org/10.1109/TPAMI.2007.1049

Vision-based global localization and mapping for mobile robots
Se, S.   Lowe, D.G.   Little, J.J.   (MD Robotics, Brampton, Ont., Canada)

Lepetit, V. 2006.
Keypoint Recognition Using Randomized Trees. IEEE Trans. Pattern Anal. Mach. Intell. 28, 9 (Sep. 2006), 1465-1479. DOI= http://dx.doi.org/10.1109/TPAMI.2006.188

Lepetit, V., Lagger, P., and Fua, P. 2005.
Randomized Trees for Real-Time Keypoint Recognition. In Proceedings of the 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (Cvpr'05) - Volume 2 - Volume 02 (June 20 - 26, 2005). CVPR. IEEE Computer Society, Washington, DC, 775-781. DOI= http://dx.doi.org/10.1109/CVPR.2005.288

Fischler, M. A. and Bolles, R. C. 1981.
Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Commun. ACM 24, 6 (Jun. 1981), 381-395. DOI= http://doi.acm.org/10.1145/358669.358692
posted by maetel
2009. 7. 22. 16:55 Computer Vision
Durrant-Whyte, H.Bailey, T.
(Australian Centre for Field Robotics, Sydney Univ., NSW)
Simultaneous localization and mapping
Robotics & Automation Magazine, 2006

Simultaneous localization and mapping: part I
Robotics & Automation Magazine, IEEE, Volume: 13,  Issue: 2 (June 2006)

Simultaneous localization and mapping (SLAM): part II
Robotics & Automation Magazine, IEEE, Volume: 13,  Issue: 3
(Sept. 2006)


Table 1. Open-source SLAM software.
Kai Arras
The CAS Robot Navigation Toolbox, a MATLAB simulation toolbox for robot localization and mapping
http://www.cas.kth.se/toolbox/index.html

Tim Bailey
MATLAB simulators for EKF-SLAM, UKF-SLAM, and FastSLAM 1.0 and 2.0. http://www.acfr.usyd.edu.au/homepages/academic/tbailey/software/index.html

Mark Paskin
Java library with several SLAM variants, including Kalman filter, information filter, and thin junction tree forms. Includes a MATLAB interface.
http://www.stanford.edu/~paskin/slam/

Andrew Davison
Scene, a C++ library for map-building and localization. Facilitates real-time single camera SLAM.
http://www.doc.ic.ac.uk/~ajd/Scene/ index.html

José Neira
MATLAB EKF-SLAM simulator that demonstrates joint compatibility branch-and-bound data association.
http://webdiis.unizar.es/~neira/software/slam/slamsim.htm

Dirk Hähnel
C language grid-based version of FastSLAM.
http://www.informatik.uni-freiburg.de/~haehnel/old/download.html

Various
MATLAB code from the 2002 SLAM summer school.
http://www.cas.kth.se/slam/toc.html

Table 2. Online datasets.
Eduardo Nebot
Numerous large-scale outdoor datasets, notably the popular Victoria Park data.
http://www.acfr.usyd.edu.au/homepages/academic/enebot/dataset.htm

Chieh-Chih Wang
Three large-scale outdoor datasets collected by the Navlab11 testbed.
http://www.cs.cmu.edu/~bobwang/datasets.html

Radish (The Robotics Many and varied indoor datasets, including large-area Data Set Repository) data from the CSU Stanislaus Library, the Intel Research Lab in Seattle, the Edmonton Convention Centre, and more.
http://radish.sourceforge.net/

IJRR (The International Journal of Robotics Research)
IJRR maintains a Web page for each article, often containing data and video of results. A good paper example is by Bosse et al. [3], which has data from Killian Court at MIT.
http://www.ijrr.org/contents/23\_12/abstract/1113.html


IEEE Robotics and Automation Society http://www.ieee-ras.org/
IEEE ICRA (International Conference on Robotics and Automation) http://www.icra2009.org/
http://icra2010.grasp.upenn.edu/

International Foundation of Robotics Research http://www.ifrr.org/
ISRR 2009 - 14th International Symposium on Robotics Research http://www.isrr2009.ethz.ch/

IROS 2009: The 2009 IEEE/RSJ International Conference on Intelligent RObots and Systems www.iros09.mtu.edu/
http://www.iros2010.org.tw/

ICARCV 2010 - The 11th International Conference on Control, Automation, Robotics and Vision
http://www.icarcv.org/2010/



History

- 1986, probabilistic SLAM problem (IEEE Robotics and Automation Conference)
Peter Cheeseman, Jim Crowley, and Hugh Durrant-Whyte, Raja Chatila, Oliver Faugeras, Randal Smith
> estimation-theoretic methods, consistent mapping

- consistent probabilistic mapping
Smith and Cheesman [39] and Durrant-Whyte [17]
> statistical basis
"There must be a high degree of correlation between estimates of the location of different landmarks in a map"

- visual navigation & sonar-based navigation
Ayache and Faugeras [1],  Crowley [9] and Chatila and Laumond [6]
> Kalman filter-type algorithms

Smith et al. [40] "The estimations of the landmarks are all necessarily correlated with each other because of the common error in estimated vehicle location."

> joint state (of the vehicle pose and every landmark position) to be updated following each landmark observation & estimator (state vector)

- random-walk behavior with unbounded error growth (without knowledge of the convergence behavior of the map)

> single estimation problem: "The combined mapping and localization problem is convergent."
"The more the correlations between landmarks grew, the better the solution."

- 1995, coining of SLAM (a paper at the International Symposium on Robotics Research) or called CLM (concurrent mapping and localization)
Csorba [10], [11]. the Massachusetts Institute of Technology [29], Zaragoza [4], [5], the ACFR at Sydney [20], [45], and others [7], [13]
> computational efficiency, addressing in data association, loop closure

- 1999 ISRR, convergence between the Kalman-filter-based SLAM methods and the probabilistic localisation and mapping methods introduced by Thrun

- 2000 IEEE ICRA
> algorithmic complexity, data association, implementation



Formulation

SLAM = process by which a mobile robot can build a map of an environment and at the same time use this map to deduce its location
(In SLAM, both the trajectory of the platform and the location of all landmarks are estimated online without the need for any a priori knowledge of location.)

Probabilistic SLAM
The SLAM probability distribution = the joint posterior density of the landmark locations and vehicle state (at time k) given the recorded observations and control inputs up to and including time k together with the initial state of the vehicle

recursive solution
: observation model + motion (state transition) model == Bayes theorem ==> estimate of SLAM distribution

   observation model -> prediction (; measurement update)
+ motion model -> correction (; time update)
+ Markov process
=> map building problem + localization problem
: joint posterior density of the landmark locations and vehicle state

As the map is built, the location accuracy of the robot measured relative to the map is bounded only by the quality of the map and relative measurement sensor.
: Robot relative location accuracy becomes equal to the localization accuracy achievable with a given map.


Solutions

1)
state-space model + additive Gaussian noise
EKF = extended Kalman filter

2)
a set of samples of a more general non-Gaussian probability distribution to describe vehicle motion
Rao-Blackwellized particle filter or FastSLAM algorithm

3)
information-state form

ref. Sebastian Thrun, Yufeng Liu, Daphne Koller, Andrew Y. Ng, Zoubin Ghahramani, Hugh Durrant-Whyte
Simultaneous Localization and Mapping With Sparse Extended Information Filters



1) EKF-SLAM



2) Rao-Blackwellized filter




posted by maetel
2009. 7. 21. 16:16 Computer Vision
임현, 이영삼 (인하대 전기공학부)
이동로봇의 동시간 위치인식 및 지도작성(SLAM)
제어 로봇 시스템 학회지 제15권 제2호 (2009년 6월)
from kyu


> definition
mapping: 환경을 인식가능한 정보로 변환하고
localization: 이로부터 자기 위치를 추정하는 것

> issues
- uncertainty <= sensor
- data association (데이터 조합): 차원이 높은 센서 정보로부터 2-3차원 정도의 정보를 추려내어 이를 지속적으로 - 대응시키는 것
- 관찰된 특징점 자료들을 효율적으로 관리하는 방법


> localization (위치인식)
: 그 위치가 미리 알려진 랜드마크를 관찰한 정보를 토대로 자신의 위치를 추정하는 것
: 초기치 x0와 k-1시점까지의 제어 입력, 관측벡터와 사전에 위치가 알려진 랜드마크를 통하여 매 k시점마다 로봇의 위치를 추정하는 것
- 로봇의 위치추정의 불확실성은 센서의 오차로부터 기인함.

> mapping (지도작성)
: 기준점과 상대좌표로 관찰된 결과를 누적하여 로봇이 위치한 환경을 모델링하는 것
: 위치와 관측정보 그리고 제어입력으로부터 랜드마크 집합을 추정하는 것
- 지도의 부정확성은 센서의 오차로부터 기인함.

> Simultaneous Localization and Mapping (SLAM, 동시간 위치인식 및 지도작성)
: 위치한 환경 내에서 로봇의 위치를 추정하는 것
: 랜드마크 관측벡터와 초기값 그리고 적용된 모든 제어입력이 주어진 상태에서 랜드마크의 위치와 k시점에서의 로봇 상태벡터 xk의 결합확률
- 재귀적 방법 + Bayes 정리
- observation model (관측 모델) + motion model (상태 공간 모델, 로봇의 움직임 모델)
- motion model은 상태 천이가 Markov 과정임을 의미함. (현재 상태는 오직 이전 상태와 입력 벡터로서 기술되고, 랜드마크 집합과 관측에 독립임.)
- prediction (time-update) + correction (measurement-update)
- 불확실성은 로봇 주행거리계와 센서 오차로부터 유발됨.


conditional Bayes rule
http://en.wikipedia.org/wiki/Bayes%27_theorem
 P(A|B \cap C) = \frac{P(A \cap B \cap C)}{P(B \cap C)} = \frac{P(B|A \cap C) \, P(A|C) \, P(C)}{P(C) \, P(B|C)} = \frac{P(B|A \cap C) \, P(A|C)}{P(B|C)}\,.

Markov process

total probability theorem: "law of alternatives"
http://en.wikipedia.org/wiki/Total_probability_theorem
\Pr(A)=\sum_{n} \Pr(A\cap B_n)\,
\Pr(A)=\sum_{n} \Pr(A\mid B_n)\Pr(B_n).\,

> Extended Kalman filter (EKF, 확장 칼만 필터)


http://en.wikipedia.org/wiki/Ground_truth

posted by maetel
2009. 7. 15. 16:49 Computer Vision
Klein, G. and Murray, D. 2007.
Parallel Tracking and Mapping for Small AR Workspaces
In Proceedings of the 2007 6th IEEE and ACM international Symposium on Mixed and Augmented Reality - Volume 00 (November 13 - 16, 2007). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 1-10. DOI= http://dx.doi.org/10.1109/ISMAR.2007.4538852

Georg Klein
David Murray
Active Vision Laboratory, Department of Engineering Science, University of Oxford

Source CodeUsage Example


1. parallel threads of tracking and mapping
2. mapping from smaller keyframes: batch techniques (Bundle Adjustment)
3. Initializing the map from 5-point Algorithm
4. Initializing new points with epipolar search
5. mapping thousands of points


Joint Compatibility Branch and Bound (JCBB)
http://en.wikipedia.org/wiki/JCBB

RANdom SAmple Consensus (RANSAC)
http://en.wikipedia.org/wiki/RANSAC

coarse-to-fine approach

batch method
bundle adjustment
http://en.wikipedia.org/wiki/Bundle_adjustment

Structure-from-Motion (SfM)

five-point stereo
http://en.wikipedia.org/wiki/Eight-point_algorithm

5-point algorithm
http://portal.acm.org/citation.cfm?id=987623

Henrik Stew´enius, Christopher Engels, David Nist´er
Recent Developments on Direct Relative Orientation


epipolar feature search

intensity-patch descriptor

(feature-to-feature or camera-to-feature) correlation-based search

NCC (normalized cross correlation) search
http://en.wikipedia.org/wiki/Cross-correlation#Normalized_cross-correlation


Unibrain Fire-i digital camera

http://en.wikipedia.org/wiki/YUV411

FAST-10 corner detection
http://wapedia.mobi/en/Corner_detection
http://en.wikipedia.org/wiki/Corner_detection

decaying velocity model

barrel radial distortion
http://en.wikipedia.org/wiki/Distortion_(optics)

lie group SE(3)

affine warp
warping matrix <- (1) back-projecting unit pixel displacements in the source keyframe pyramid level onto the patch's plane and then (2) projecting these into the current (target) frame

inverse compositional image alignment 

Tukey biweight objective function

M-estimator
http://en.wikipedia.org/wiki/M-estimator
Zhengyou Zhang, M-estimators

Shi-Tomasi corner detector

http://en.wikipedia.org/wiki/Levenberg-Marquardt

cubic-cost matrix factorization
http://en.wikipedia.org/wiki/Cubic_function



posted by maetel
2009. 7. 14. 21:23 Computer Vision
ISMAR 2008
7th IEEE/ACM International Symposium on Mixed and Augmented Reality, 2008


Proceedings
State of the Art Report

Trends in Augmented Reality Tracking, Interaction and Display
: A Review of Ten Years of ISMAR
Feng Zhou (Center for Human Factors and Ergonomics, Nanyang Technological University, Singapore)
Henry Been-Lirn Duh (Department of Electrical and Computer Engineering/Interactive and Digital Media Institute, National University of Singapore)
Mark Billinghurst (The HIT Lab NZ, University of Canterbury, New Zealand)


Tracking

1. Sensor-based tracking -> ubiquitous tracking and dynamic data fusion

2. Vision-based tracking: feature-based and model-based
1) feature-based tracking techniques:
- To find a correspondence between 2D image features and their 3D world frame coordinates.
- Then to find the camera pose from projecting the 3D coordinates of the feature into the observed 3D image coordinates and minimizing the distance to their corresponding 3D features.

2) model-based tracking techniques:
- To explicitly use a model of the features of tracked objects such as a CAD model or 2D template of the object based on the distinguishable features.
- A visual serving approach adapted from robotics to calculate camera pose from a range of model features (line, circles, cylinders and spheres)
- knowledge about the scene by predicting hidden movement of the object and reducing the effects of outlier data

3. Hybrid tracking
- closed-loop-type tracking based on computer vision techonologies
- motion prediction
- SFM (structure from motion)
- SLAM (simultaneous localization and mapping)


Interaction and User Interfaces

1. Tangible
2. Collaborative
3. Hybrid


Display

1. See-through HMDs
1) OST = optical see-through
: the user to see the real world with virtual objects superimposed on it by optical or video technologies
2) VST = video see-through
: to display graphical infromation directly on real objects or even daily surfaces in everyday life
2. Projection-based Displays
3. Handheld Displays


Limitations of AR

> tracking
1) complexity of the scene and the motion of target objects, including the degrees of freedom of individual objects and their represenation
=> correspondence analysis: Kalman filters, particle filters.
2) how to find distinguishable objects for "markers" outdoors

> interaction
ergonomics, human factors, usability, cognition, HCI (human-computer interaction)

> AR displays
- HMDs - limited FOV, image distortions,
- projector-based displays - lack mobility, self-occlusion
- handheld displays - tracking with markers to limit the work range

Trends and Future Directions

1. Tracking
1) RBPF (Rao-Blackwellized particle filters) -> automatic recognition systems
2) SLAM, ubiquitous tracking, sensor network -> free from prior knowledge
3) pervasive middleware <- information fusion algorithms

2. Interaction and User Interfaces
"Historically, human knowledge, experience and emotion are expressed and communicated in words and pictures. Given the advances in interface and data capturing technology, knowledge, experience and emotion might now be presented in the form of AR content."

3. AR Displays





Studierstube Augmented Reality Project
: software framework for the development of Augmented Reality (AR) and Virtual Reality applications
Graz University of Technology (TU Graz)

Sharedspace project
The Human Interface Technology Laboratory (HITLab) at the University ofWashington and ATR Media Integration & Communication in Kyoto,Japan join forces at SIGGRAPH 99

The Invisible Train - A Handheld Augmented Reality Game

AR Tennis
camera based tracking on mobile phones in face-to-face collaborative Augmented Reality

Emmie - Environment Management for Multi-User Information Environments

VITA: visual interaction tool for archaeology

HMD = head-mounted displays

OST = optical see-through

VST = video see-through

ELMO: an Enhanced optical see-through display using an LCD panel for Mutual Occlusion

FOV
http://en.wikipedia.org/wiki/Field_of_view_(image_processing)

HMPD = head-mounted projective displays

The Touring Machine

MARS - Mobile Augmented Reality Systems
    
Klimt - the Open Source 3D Graphics Library for Mobile Devices

AR Kanji - The Kanji Teaching application


references  
Ronald T. Azuma  http://www.cs.unc.edu/~azuma/
A Survey of Augmented Reality. Presence: Teleoperators and Virtual Environments 6, 4 (August 1997), 355 - 385. Earlier version appeared in Course Notes #9: Developing Advanced Virtual Reality Applications, ACM SIGGRAPH '95 (Los Angeles, CA, 6-11 August 1995), 20-1 to 20-38.

Ronald Azuma, Yohan Baillot, Reinhold Behringer, Steven Feiner,Simon Julier, Blair MacIntyre
Recent Advances in Augmented Reality.IEEE Computer Graphics and Applications 21, 6 (Nov/Dec 2001),34-47.

Ivan E. Sutherland
The Ultimate Display, IFIP `65, pp. 506-508, 1965

Kato, H.   Billinghurst, M.   Poupyrev, I.   Imamoto, K.   Tachibana, K.   Hiroshima City Univ.
Virtual object manipulation on a table-top AR environment

Sandor, C., Olwal, A., Bell, B., and Feiner, S. 2005.
Immersive Mixed-Reality Configuration of Hybrid User Interfaces.
In Proceedings of the 4th IEEE/ACM international Symposium on Mixed and Augmented Reality(October 05 - 08, 2005). Symposium on Mixed and Augmented Reality. IEEEComputer Society, Washington, DC, 110-113. DOI=http://dx.doi.org/10.1109/ISMAR.2005.37

An optical see-through display for mutual occlusion with a real-time stereovision system
Kiyoshi Kiyokawa, Yoshinori Kurata and Hiroyuki Ohno
Computers & Graphics Volume 25, Issue 5, October 2001, Pages 765-779

Bimber, O., Fröhlich, B., Schmalstieg, D., and Encarnação, L. M. 2005.
The virtual showcase. In ACM SIGGRAPH 2005 Courses (Los Angeles, California, July 31 - August 04, 2005). J. Fujii, Ed. SIGGRAPH '05. ACM, New York, NY, 3. DOI= http://doi.acm.org/10.1145/1198555.1198713

Bimber, O., Wetzstein, G., Emmerling, A., and Nitschke, C. 2005.
Enabling View-Dependent Stereoscopic Projection in Real Environments. In Proceedings of the 4th IEEE/ACM international Symposium on Mixed and Augmented Reality (October 05 - 08, 2005). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 14-23. DOI= http://dx.doi.org/10.1109/ISMAR.2005.27

Cotting, D., Naef, M., Gross, M., and Fuchs, H. 2004.
Embedding Imperceptible Patterns into Projected Images for Simultaneous Acquisition and Display. In Proceedings of the 3rd IEEE/ACM international Symposium on Mixed and Augmented Reality (November 02 - 05, 2004). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 100-109. DOI= http://dx.doi.org/10.1109/ISMAR.2004.30

Ehnes, J., Hirota, K., and Hirose, M. 2004.
Projected Augmentation - Augmented Reality using Rotatable Video Projectors. In Proceedings of the 3rd IEEE/ACM international Symposium on Mixed and Augmented Reality (November 02 - 05, 2004). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 26-35. DOI= http://dx.doi.org/10.1109/ISMAR.2004.47

Arango, M., Bahler, L., Bates, P., Cochinwala, M., Cohrs, D., Fish, R., Gopal, G., Griffeth, N., Herman, G. E., Hickey, T., Lee, K. C., Leland, W. E., Lowery, C., Mak, V., Patterson, J., Ruston, L., Segal, M., Sekar, R. C., Vecchi, M. P., Weinrib, A., and Wuu, S. 1993.
The Touring Machine system. Commun. ACM 36, 1 (Jan. 1993), 69-77. DOI= http://doi.acm.org/10.1145/151233.151239

Gupta, S. and Jaynes, C. 2006.
The universal media book: tracking and augmenting moving surfaces with projected information. In Proceedings of the 2006 Fifth IEEE and ACM international Symposium on Mixed and Augmented Reality (Ismar'06) - Volume 00 (October 22 - 25, 2006). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 177-180. DOI= http://dx.doi.org/10.1109/ISMAR.2006.297811


Klein, G. and Murray, D. 2007.
Parallel Tracking and Mapping for Small AR Workspaces. In Proceedings of the 2007 6th IEEE and ACM international Symposium on Mixed and Augmented Reality - Volume 00 (November 13 - 16, 2007). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 1-10. DOI= http://dx.doi.org/10.1109/ISMAR.2007.4538852

Neubert, J., Pretlove, J., and Drummond, T. 2007.
Semi-Autonomous Generation of Appearance-based Edge Models from Image Sequences. In Proceedings of the 2007 6th IEEE and ACM international Symposium on Mixed and Augmented Reality - Volume 00 (November 13 - 16, 2007). Symposium on Mixed and Augmented Reality. IEEE Computer Society, Washington, DC, 1-9. DOI= http://dx.doi.org/10.1109/ISMAR.2007.4538830

posted by maetel
2009. 7. 8. 21:56 Computer Vision
0. Freeimage 설치 실패
http://freeimage.sourceforge.net/ 에서
FreeImage3.12.0 을 다운로드하여 풀어 보니 FreeImage라는 이름의 폴더가 생성된다.
(.frameworks가 아니라서 당황하였으나, FreeImage가 library라 하였기에 frameworks라고 굳게 믿어 버렸고 경험도 있다고 자부하며, Xcode에서  프로젝트를 만들어  C++로 코딩할 때 어떻게 삽입해야 하는지를 놓고 엉뚱한 정보의 홍수에서 허우적대다가...)

다시 겸허한 마음으로
README.osx 파일을 TextEdit으로 열고, 다음 설명에 따라
Building the Library
--------------------
Makefile detects the environment by calling 'uname'. Assuming this reports 'Darwin' on your system, Makefile will automatically
defer commands to Makefile.osx. If this doesn't work, type 'make -f Makefile.osx' in place of just 'make'

The build process is as simple as this:
1) Enter the FreeImage directory
2) Build the distribution:
make
3) The libraries and header will be in the Dist directory when the build is finished

To install FreeImage in the /usr/local/lib and /usr/local/include directories (not recommended):
make install

To clean all files produced during the build process:
make clean


Additional notes
----------------

Building on Mac OS X Leopard :

Install the xcode dev tools from the Leopard disk.
When installing the dev tools make sure to have installed 10.3.9 SDK (it's not selected by default).

Terminal에서 freeimage 폴더로 들어가서 make 명령을 치면 다음과 같이 무수한 에러가 나온다.

ga07087:freeimage lym$ make
make -f Makefile.osx
g++-4.0 -Wno-ctor-dtor-privacy -Os -fexceptions -fvisibility=hidden -arch ppc -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibMNG -ISource/LibPNG -ISource/LibTIFF -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath  -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -c Source/FreeImage/BitmapAccess.cpp -o Source/FreeImage/BitmapAccess.o-ppc
Source/FreeImage/BitmapAccess.cpp:30:20: error: stdlib.h: No such file or directory
In file included from Source/FreeImage/BitmapAccess.cpp:35:
Source/FreeImage.h:55:51: error: wchar.h: No such file or directory
Source/FreeImage.h:152:22: error: inttypes.h: No such file or directory
In file included from Source/FreeImage/BitmapAccess.cpp:37:
Source/Utilities.h:31:18: error: math.h: No such file or directory
Source/Utilities.h:33:20: error: memory.h: No such file or directory
Source/Utilities.h:34:19: error: stdio.h: No such file or directory
Source/Utilities.h:35:20: error: string.h: No such file or directory
Source/Utilities.h:36:20: error: stdarg.h: No such file or directory
Source/Utilities.h:37:19: error: ctype.h: No such file or directory
Source/Utilities.h:38:20: error: assert.h: No such file or directory
Source/Utilities.h:40:18: error: string: No such file or directory

...(중략)


여기서 첫번째 에러 "error: stdlib.h: No such file or directory"는 Kernel error라고 하여 Linux 등의 kernel에서 바로 standard library에 접근할 수 없어 나타난다고 한다. (이를 해결하기 위한 Linux 사용자들의 "sudo apt-get install 어쩌구"와 같은 명령어도 통하지 않고 있다.)

등등등 사흘 간의 초삽질 끝에...
source codes을 mac에서 직접 compile하는 것은 내 능력으로 어렵다고 보고, MacPorts라는 것을 이용해 보기로 한다.


1. Macports 설치 성공
MacPorts (구 Darwin Ports)의 공식사이트: http://www.macports.org
MacPorts는 Apple 사가 진행하는 OpenDarwin 프로젝트의 일부이며, 오픈 소스 소프트웨어의 컴파일, 설치, 업그레이드를 쉽게 할 수 있게 해 주는 오픈 소스 '패키지 관리 시스템'이라고 하는데 자세히는 모르겠다. (참고: http://en.wikipedia.org/wiki/Macports)

(Mac 용 Freeimage가 frameworks 형식으로 제공되는 것이 아니라서 내게 생소했던 것이다. 그냥 소스코드와 헤더파일, 다큐먼트 등을 몽땅 모아 놓은 것을 package라 부른다.)

MacPorts를 설치하기 전에 먼저 Xcode와 X11이 설치되어 있어야 한다.

웹페이지(Installing MacPorts)의 안내에 따라 MacPorts-1.7.1-10.5-Leopard.dmg를 받아서 (클릭들만으로) 설치한 후,  착실하게 MacPorts “selfupdate” command라는 것을 따라해 보니 (웬일인지) 잘된다.

Last login: Wed Jul  8 21:17:08 on ttys000
%% sudo port -v selfupdate
Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
receiving file list ... done

sent 36 bytes  received 384171 bytes  109773.43 bytes/sec
total size is 23568484  speedup is 61.34
receiving file list ... done

sent 36 bytes  received 6909 bytes  2778.00 bytes/sec
total size is 4061730  speedup is 584.84

MacPorts base version 1.710 installed
Downloaded MacPorts base version 1.710

The MacPorts installation is not outdated so it was not updated
%%

Macports가 업데잇될 때마다 자동으로 업그레이드해 주겠다는 뜻이겠지.


2. MacPorts로 Freeimage 설치
http://guide.macports.org/ (상세한 설명)
http://trac.macports.org/wiki/UsingMacPortsQuickStart (간략한 설명)

특정 포트 검색 명령어를 써서 freeimage가 있음을 확인했다.
%% port search freeimage
freeimage @3.12.0 (graphics)
    Library for FreeImage, a dependency-less graphics library

특정 포트에 대한 정보를 보기 위한 명령어는 "port info"
%% port info freeimage
freeimage @3.12.0 (graphics)
Variants:    universal

FreeImage is a library for developers who would like to support most popular
graphics image formats. Some highlights are: extremely simple in use, not
limited to the local PC (unique FreeImageIO) and Plugin driven!
Homepage:    http://freeimage.sourceforge.net/

Platforms:            macosx
Maintainers:          toby@macports.org

이외 port command 몇 가지를 Freeimage에 대해 실행해 보면,
%% port deps freeimage
freeimage has no dependencies
%% port variants freeimage
freeimage has the variants:
    universal: Build for multiple architectures


포트를 설치하라는 명령어: "sudo port install (포트 이름)"
참고: MacPorts Guide 3.1.8. install
%% sudo port install freeimage
Password:
--->  Fetching freeimage
--->  Attempting to fetch FreeImage3120.zip from http://nchc.dl.sourceforge.net/freeimage
--->  Verifying checksum(s) for freeimage
--->  Extracting freeimage
--->  Applying patches to freeimage
--->  Configuring freeimage
--->  Building freeimage
--->  Staging freeimage into destroot
--->  Installing freeimage @3.12.0_0
--->  Activating freeimage @3.12.0_0
--->  Cleaning freeimage

무슨 파일들이 설치되었는지 확인해 보면,
%% port contents freeimage
Port freeimage contains:
  /opt/local/include/FreeImage.h
  /opt/local/lib/libfreeimage.3.12.0.dylib
  /opt/local/lib/libfreeimage.3.dylib
  /opt/local/lib/libfreeimage.a
  /opt/local/lib/libfreeimage.dylib


MacPorts.org 사이트의 포트 검색에서 Freeimage를 찾을 수 있다.
freeimage 3.12.0
    Library for FreeImage, a dependency-less graphics library
    Maintained by: toby
    Categories: graphics
    Platforms: macosx
    Variants: universal




3.


posted by maetel
2009. 7. 6. 21:31 Computer Vision
To do:
1. transition .NET(Visual Studio 2008) to Xcode(3.1.2)
2. to load image files with freeimage(3.12.0)
3. to calculate surface normals (using Linear Least Squares) without matrix operations


1.
Xcode에서 C++ 프로젝트 만들기
File > New Project > Command Line Utility > C++ Tool

cf.
gcc compiler (백창우)
ADC > Xcode Workspace Guide


2.
http://freeimage.sourceforge.net/

cf.
Xcode에 라이브러리 추가하기: ADC > Installing Your Framework
Xcode에서 외부 라이브러리 사용하기 (나이누)
MacPorts란? http://www.macports.org/
http://en.wikipedia.org/wiki/MacPorts  DarwinPorts였잖아...ㅜㅜ

posted by maetel
2009. 7. 3. 15:18 Computer Vision
[1] R. Woodham, “Photometric method for determining surface orientation
from multiple images,” Optical Engineering, vol. 19, no. 1,
pp. 139–144, 1980.
[2] S. Shafer, “Using color to separate reflection components,” Color
Research and Applicatios, vol. 10, no. 4, pp. 210–218, 1985.
[3] G. Klinker, S. Shafer, and T. Kanade, “The measurement of highlights
in color images,” International Journal of Computer Vision,
vol. 2, no. 1, pp. 7–32, 1988.
[4] Y. Sato, M. Wheeler, and K. Ikeuchi, “Object shape and reflectance
modeling from observation,” in SIGGRAPH, 1997.
[5] S. Mallick, T. Zickler, D. Kriegman, and P. Bellhumeur, “Beyond
Lambert: Reconstructing specular surfaces using color,” in Proc.
IEEE Conf. Computer Vision and Pattern Recognition, 2005.
[6] Y. Sato and K. Ikeuchi, “Temporal-color space analysis of reflection,”
CMU, Tech. Rep. CMU-CS-92-207, 1992.
[7] M. Chandraker, S. Agarwal, and D. Kriegman, “Shadowcuts:
Photometric stereo with shadows,” in Proc. IEEE Conf. Computer
Vision and Pattern Recognition, 2007.
[8] W. Silver, “Determining shape and reflectance using multiple
images,” Master’s thesis, MIT, 1980.
[9] A. Hertzmann and S. Seitz, “Shape and materials by example: A
photometric stereo approach,” in Proc. IEEE Conf. Computer Vision
and Pattern Recognition, 2003.
[10] D. Goldman, “Shape and spatially-varying BRDFs from photometric
stereo,” in Proc. Int. Conf. on Computer Vision, 2005.
[11] H.-S. Chung and J. Jia, “Efficient photometric stereo on glossy
surfaces with wide specular lobes,” in Computer Vision and Pattern
Recognition, IEEE Computer Society Conference on, 2008.
[12] T. Zickler, P. Belhumeur, and D. Kriegman, “Helmholtz stereopsis:
Exploiting reciprocity for surface reconstruction,” in Proc. European
Conf. on Computer Vision, 2002.
[13] N. G. Alldrin and D. J. Kriegman, “Toward reconstructing surfaces
with arbitrary isotropic reflectance : A stratified photometric
stereo approach,” in Proc. Int. Conf. on Computer Vision, 2007.
[14] N. G. Alldrin, T. Zickler, and D. J. Kriegman, “Photometric stereo
with non-parametric and spatially-varying reflectance,” in Proc.
IEEE Conf. Computer Vision and Pattern Recognition, 2008.
[15] R. Fletcher, Practical Methods of Optimization. John WIley & Sons,
1987.
[16] S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge
Press, 2004.
[17] R. I. Hartley and F. Kahl, “Global optimization through rotation
space search,” Int. J. Computer Vision, vol. 82, pp. 64–79, 2009.
[18] W. Press, S. Teukolsky, W. Vetterling, and B. Flannery, Numerical
Recipes in C: The Art of Scientiic Computing. Cambridge University
Press, 1992.
[19] S. Seitz, “Computer vision project: Photometric stereo,” 2005,
http://www.cs.washington.edu/education/courses/csep576/
05wi/projects/project3/project3.htm.

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

to install Freeimage on mac  (0) 2009.07.08
photometric stereo 09-07-03  (0) 2009.07.06
branch and bound algorithm  (0) 2009.07.03
Linear Least Squares  (0) 2009.07.03
Reinhard Diestel <Graph Theory>  (0) 2009.06.16
posted by maetel
2009. 7. 3. 10:44 Computer Vision

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

photometric stereo 09-07-03  (0) 2009.07.06
GO MC PS references  (0) 2009.07.03
Linear Least Squares  (0) 2009.07.03
Reinhard Diestel <Graph Theory>  (0) 2009.06.16
photometric stereo 2009-06-10  (0) 2009.06.10
posted by maetel
2009. 7. 3. 01:30 Computer Vision

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

GO MC PS references  (0) 2009.07.03
branch and bound algorithm  (0) 2009.07.03
Reinhard Diestel <Graph Theory>  (0) 2009.06.16
photometric stereo 2009-06-10  (0) 2009.06.10
Photometric stereo 2009-06-07  (0) 2009.06.08
posted by maetel
2009. 6. 16. 16:15 Computer Vision
Reinhard Diestel
Graph Theory
Third Edition
--------------------------------------------------------------------------------
Springer-Verlag, Heidelberg
Graduate Texts in Mathematics, Volume 173
Hardcover US$89.95, EUR69,95
ISBN 3-540-26182-6
Softcover US$49.95, EUR39,95
ISBN 3-540-26183-4
July 2005 (2000, 1997)
431 pages; 146 figures

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

branch and bound algorithm  (0) 2009.07.03
Linear Least Squares  (0) 2009.07.03
photometric stereo 2009-06-10  (0) 2009.06.10
Photometric stereo 2009-06-07  (0) 2009.06.08
Photometric stereo 2009-06-05  (0) 2009.06.05
posted by maetel
2009. 6. 10. 17:07 Computer Vision

To do: to calculate depths for the surface reconstruction

ref.
P. D. Kovesi.   MATLAB and Octave Functions for Computer Vision and Image Processing.
School of Computer Science & Software Engineering,
The University of Western Australia.   Available from:
<http://www.csse.uwa.edu.au/~pk/research/matlabfns/>.

 

 

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

Linear Least Squares  (0) 2009.07.03
Reinhard Diestel <Graph Theory>  (0) 2009.06.16
Photometric stereo 2009-06-07  (0) 2009.06.08
Photometric stereo 2009-06-05  (0) 2009.06.05
photometric stereo 2009-05-15  (0) 2009.05.15
posted by maetel
2009. 6. 8. 15:17 Computer Vision
To do: Surface shape reconstruction
: Least squares surface fitting




- path integration
- least squares optimization
- Lucas-Kanade algorithm

http://mathworld.wolfram.com/LeastSquaresFitting.html


 /* We want to solve Mz = v in a least squares sense.  The
    solution is M^T M z = M^T v.  We denote M^T M as A and
    M^T v as b, so A z = b. */

 CMatrixSparse<double> A(M.mTm());
    assert(A.isSymmetric());
    CVector<double> r = A*z;  /* r is the "residual error" */
    CVector<double> b(v*M);

 // solve the equation A z = b
    solveQuadratic<double>(A,b,z,300,CGEPSILON);

 // copy the depths back from the vector z into the image depths
    copyDepths(z,zind,depths);


 

template <class T>
double solveQuadratic(const CMatrixSparse<T> & A, const CVector<T> & b,
       CVector<T> & x,int i_max, double epsilon)
{
  //my conjugate gradient solver for .5*x'*A*x -b'*x, based on the
  // tutorial by Jonathan Shewchuk  (or is it +b'*x?)
 
  printf("Performing conjugate gradient optimization\n");

  int numvars = x.Length();
  assert(b.Length() == numvars && A.rows() == numvars &&
  A.columns() == numvars);

  int i =0;

  CVector<T> r = b-A*x;
  CVector<T> d= r;
  double delta_new = r.dot(r);
  double delta_0 = delta_new;

  int numrecompute = (int)floor(sqrt(float(numvars)));
  //int numrecompute = 1;
  printf("numrecompute = %d\n",numrecompute);

  printf("delta_new = %f\n", delta_new);
  while (i < i_max && delta_new > epsilon)//epsilon*epsilon*delta_0)
    {
      printf("Step %d, delta_new = %f      \r",i,delta_new);
     
      CVector<T> q = A*d;
      double alpha = delta_new/d.dot(q);
      x.daxpy(d,alpha); //      x += d*alpha;
      if (i % numrecompute == 0)
 {
   //   printf(" ** recompute\n");
   r = b-A*x;
 }
      else
 r.daxpy(q,-alpha); //  r = r-q*alpha;
      double delta_old = delta_new;
      delta_new = r.dot(r);
      double beta = delta_new/delta_old;
      d = r+d*beta;
      i++;
    }

  return delta_new;
  //  return delta_new <= epsilon;
  //  return !(delta_new > epsilon*epsilon*delta_0);
}










 

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

Reinhard Diestel <Graph Theory>  (0) 2009.06.16
photometric stereo 2009-06-10  (0) 2009.06.10
Photometric stereo 2009-06-05  (0) 2009.06.05
photometric stereo 2009-05-15  (0) 2009.05.15
Criminisi, Reid, Zisserman <Single View Metrology>  (0) 2009.05.06
posted by maetel
2009. 6. 5. 15:49 Computer Vision

To do: draw a needle map

ref. Washington University's source code:  


http://opencv.willowgarage.com/wiki/CxCore#CurvesandShapes

Line

Draws a line segment connecting two points

void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color,
             int thickness=1, int line_type=8, int shift=0 );
img
The image.
pt1
First point of the line segment.
pt2
Second point of the line segment.
color
Line color.
thickness
Line thickness.
line_type
Type of the line:
  • 8 (or omitted) - 8-connected line.

  • 4 - 4-connected line.

  • CV_AA - antialiased line.

shift
Number of fractional bits in the point coordinates.

The function cvLine draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image or ROI rectangle. For non-antialiased lines with integer coordinates the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering. To specify the line color, the user may use the macro CV_RGB( r, g, b ).



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

photometric stereo 2009-06-10  (0) 2009.06.10
Photometric stereo 2009-06-07  (0) 2009.06.08
photometric stereo 2009-05-15  (0) 2009.05.15
Criminisi, Reid, Zisserman <Single View Metrology>  (0) 2009.05.06
Photometric stereo 2009-05-01  (0) 2009.05.01
posted by maetel
2009. 5. 15. 21:10 Computer Vision
to do: compute surface normal vectors

TGA file format
Targa = Truevision Advanced Raster Graphics Adapter
http://en.wikipedia.org/wiki/Truevision_TGA

http://www.fileformat.info/format/tga/egff.htm

http://people.sc.fsu.edu/~burkardt/cpp_src/tga_io/tga_io.html


RLE = Run-length encoding
http://en.wikipedia.org/wiki/Run-length_encoding


openCV
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html
lecture note
http://dasan.sejong.ac.kr/~sipark/class2008/mm/



Albedo
http://en.wikipedia.org/wiki/Albedo
In general, the albedo depends on the direction and directional distribution of incoming radiation. Exceptions are Lambertian surfaces, which scatter radiation in all directions in a cosine function, so their albedo does not depend on the incoming distribution.


typedef struct _IplImage
{
    int  nSize;             /* sizeof(IplImage) */
    int  ID;                /* version (=0)*/
    int  nChannels;         /* Most of OpenCV functions support 1,2,3 or 4 channels */
    int  alphaChannel;      /* Ignored by OpenCV */
    int  depth;             /* Pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S,
                               IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported.  */
    char colorModel[4];     /* Ignored by OpenCV */
    char channelSeq[4];     /* ditto */
    int  dataOrder;         /* 0 - interleaved color channels, 1 - separate color channels.
                               cvCreateImage can only create interleaved images */
    int  origin;            /* 0 - top-left origin,
                               1 - bottom-left origin (Windows bitmaps style).  */
    int  align;             /* Alignment of image rows (4 or 8).
                               OpenCV ignores it and uses widthStep instead.    */
    int  width;             /* Image width in pixels.                           */
    int  height;            /* Image height in pixels.                          */
    struct _IplROI *roi;    /* Image ROI. If NULL, the whole image is selected. */
    struct _IplImage *maskROI;      /* Must be NULL. */
    void  *imageId;                 /* "           " */
    struct _IplTileInfo *tileInfo;  /* "           " */
    int  imageSize;         /* Image data size in bytes
                               (==image->height*image->widthStep
                               in case of interleaved data)*/
    char *imageData;        /* Pointer to aligned image data.         */
    int  widthStep;         /* Size of aligned image row in bytes.    */
    int  BorderMode[4];     /* Ignored by OpenCV.                     */
    int  BorderConst[4];    /* Ditto.                                 */
    char *imageDataOrigin;  /* Pointer to very origin of image data
                               (not necessarily aligned) -
                               needed for correct deallocation */
}
IplImage;







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

Photometric stereo 2009-06-07  (0) 2009.06.08
Photometric stereo 2009-06-05  (0) 2009.06.05
Criminisi, Reid, Zisserman <Single View Metrology>  (0) 2009.05.06
Photometric stereo 2009-05-01  (0) 2009.05.01
camera calibration 09-04-24  (0) 2009.04.24
posted by maetel
2009. 5. 6. 19:47 Computer Vision
Criminisi, A., Reid, I., and Zisserman, A. 2000. Single View Metrology. Int. J. Comput. Vision 40, 2 (Nov. 2000), 123-148. DOI= http://dx.doi.org/10.1023/A:1026598000963


ref.
Constructing 3D Models from a Single View
3D Models from a Single View

Antonio Criminisi
http://research.microsoft.com/en-us/people/antcrim/
http://www.robots.ox.ac.uk/~criminis/

 


3D affine measurements
single perspective view
minimal geometric information - the vanishing line  & a vanishing point 
affine scene structure

first order error propagation analysis

(i) compute the distance between planes parellel to the reference plane (up to a common scale factor)
(ii) compute area and length ratios on any plane parallel to the reference plane
(iii) determine the camera's location


1. Introduction

perspective projection

reference plane
reference direction

three canonical types of measurement
(i) measurements of the distance between any of the planes which are parallel to the reference plane
(ii) measurements on these planes (and comparision of these measurements to those obtained on any parallel plane)
(iii) determining the camera's position in terms of the reference plane and direction

: independent of the camera's internal parammeters: focal length, aspect ratio, principal point, skew



http://en.wikipedia.org/wiki/Leon_Battista_Alberti


Maximum Likelihood estimates or measurements (when more than the minimum number of references are available)

1) planar homology to transfer measurements from one reference plane to another
2) analysing the uncertainty of the computted distances
3) statistical tests to validate the analytical uncertainty predictions


1) introduction
2) geometric derivations
3) algebraic representation
4) confidence intervals = a quantitative assessment of accuracy
5) applications


2. Geometry

central projection

vanishing point = projection of a point at infinity
: defined by any set of parallel lines on the plane
: Any parallel lines have the same vanishing point.

radial distortion

parallel projection

The vanishing line partitions all points in scene space. Any scene point which projects onto the vanishing line is at the same distance from the plane as the camera center; if it lies above the line it is farther from the plane, and if below the vanishing line, then it is closer to the plane than the camera center.


http://en.wikipedia.org/wiki/Projective_plane


2.1 Measurements Between Parallel Planes


Definition 1.
Two points X, X0 on separate planes (parallel to the reference plane) correspond if the line joining them is parallel to the reference direction.


The images of corresponding points and the vanishing point are collinear.

Theorem 1.
Given the vanishing line of a reference plane and the vanishing point for a reference direction; then distances from the reference plane parallel to the reference direction can be computed from their imaged end points up to a common scale factor. The scale factor can be determined from one known reference length.


cross-ratio
http://en.wikipedia.org/wiki/Cross-ratio
http://www.geom.uiuc.edu/docs/forum/photo/
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT13/node5.html
http://www.lems.brown.edu/vision/people/leymarie/Refs/Maths/Perspective.html
http://www.mathpages.com/home/kmath543/kmath543.htm

Cross ratio

Although distances and ratios of distances are not preserved under projection, the cross ratio, defined as AC/BC ∙ BD/AD, is preserved. That is, AC/BC ∙ BD/AD = A′C′/B′C′ ∙ B′D′/A′D′. Encyclopædia Britannica, Inc.




Geometry and Analysis of Projective Spaces
line-to-line homography

eqn(2)

1) Given a known reference distance
2) Compute the distance of the camera
3) Apply to a new pair of end points and compute and compute the distance


Definition 2.
A set of parallel planes are linked if it is possible to go from one plane to any other plane in the set through a chain of pairs of corresponding points (see also Definition 1).


Theorem 2.
Given a set of linked parallel planes; the distance between any pair of planes is sufficient to determine the absolute distance between any other pair; the link being provided by a chain of point correspondences between the set of planes.



2.2 Measurements on Parallel Planes

affine calibrated plane : vanishing line known

pencil of planes
http://en.wikipedia.org/wiki/Pencil_(mathematics)


The vanishing line is shared by the pencil of planes parallel to the reference plane.

http://en.wikipedia.org/wiki/Projective_map


planar homology

A map in the world between parallel planes induces a projective map in the image between images of points on the two planes. This imagemapis a planar homology (Springer, 1964), which is a plane projective transformation with five degrees of freedom, having a line of fixed points called the axis, and a distinct fixed point not on the axis known as the vertex. Planar homologies arise naturally in an image when two planes related by a perspectivity in three-dimensional space are imaged (Van Gool et al., 1998).

Viéville, T. and Lingrand, D. 1999. Using Specific Displacements to Analyze Motion without Calibration. Int. J. Comput. Vision 31, 1 (Feb. 1999), 5-29. DOI= http://dx.doi.org/10.1023/A:1008082308694

homology mapping


2.3 Determining the Camera Position

back-projection

homography


3. Algebraic Representation


affine coordinate system

projection matrix P
http://en.wikipedia.org/wiki/Projection_matrix

http://en.wikipedia.org/wiki/Homogeneous_coordinates

Columns 1, 2 and 4 of the projection matrix are the three columns of the reference plane to image homogrphy.

The vanishing line determines two of the eight d.o.f. of the homography.


Coordinate measurements within the planes depend on the first two and the fourth columns of P.

Affine measurements (e.g. area ratios) depend only on the fourth column of P.


3.1. Measurements Between Parallel Planes


Metric Calibration from Multiple Reference
error minimization algorithm


3.2. Measurements on Parallel Planes

homology


3.3. Determining Camera Position

http://en.wikipedia.org/wiki/Cramer%27s_rule



4. Uncertainty Analysis

4.1. Uncertainty on the P Matrix

The uncertainty in P is modeled as a 6-by-6 homogeneous covariance matrix.


4.2. Uncertainty on Measurements Between Planes

Maximum Likelihood Estimates
minimizing the sum of the Mahalanobis distances

constrained minimization problem
Lagrange multiplier method

http://en.wikipedia.org/wiki/Levenberg-Marquardt


4.3. Uncertainty on Camera Position


4.4. Example - Uncertainty on Measurements Between Planes


4.5. Monte Carlo Test

 






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

Photometric stereo 2009-06-05  (0) 2009.06.05
photometric stereo 2009-05-15  (0) 2009.05.15
Photometric stereo 2009-05-01  (0) 2009.05.01
camera calibration 09-04-24  (0) 2009.04.24
[Ortega] Chapter 3. Filtering  (0) 2009.04.12
posted by maetel
2009. 5. 1. 19:55 Computer Vision

To do: know what to do

Computer Vision (CSEP 576), Winter 2005
Project 3: Photometric Stereo
Computer Science & Engineering, University of Washington


plenoptic function
http://en.wikipedia.org/wiki/Light_field

Parameterizing a ray in 3D space by position (x,y,z) and direction (θ,φ).




camera response function
: the mapping f from radiance to pixels





FLTK = Fast Light Toolkit
http://www.fltk.org


weighted average
http://en.wikipedia.org/wiki/Weighted_mean


path integration
http://en.wikipedia.org/wiki/Line_integral
The value of the line integral is the sum of values of the field at all points on the curve, weighted by some scalar function on the curve (commonly arc length or, for a vector field, the scalar product of the vector field with a differential vector in the curve).


height map
http://en.wikipedia.org/wiki/Height_map


NaN
http://en.wikipedia.org/wiki/NaN





inline function
http://cplusplus.com/doc/tutorial/functions2/


http://cplusplus.com/doc/tutorial/templates/


ref.

http://pages.cs.wisc.edu/~lizhang/courses/cs766-2008f/syllabus/syllabus.htm


http://www.cs.cmu.edu/afs/cs/academic/class/15385-s06/lectures/ppts/


Photometric method for determining surface orientation from multiple images
RJ Woodham - Optical engineering, 1980 - umiacs.umd.edu




posted by maetel
2009. 4. 24. 12:44 Computer Vision
Camera Calibration Toolbox for Matlab

read this


1. "calib_gui.m" 실행
standard 선택
image names (5장씩)
command window에서 파일명 "Z_000_F_2200_(숫자)" 입력
b (bmp) 선택

2. extract grid corners 선택
command window에서 엔터 4번
figure가 뜨면 corner 4군데를 찍어서 클릭
command window에서 "70" (7cm) 입력
코너 찍기 반복 -> command window에서 엔터

3. calibration 선택

4. export calib data 선택
command window에서 "1" (Zhang format) 선택
"3D_Z_000_F_2200"
"2D_Z_000_F_2200" 입력
txt로 저장된 파일 출력 확인

5. lhj_save_intrinsic_param.m을 툴박스 폴더에 저장하고 실행
함수의 첫번째 인자에 (마지막 숫자 index를 제외한) 파일명 입력
txt 파일 출력 결과 확인

6. exit




posted by maetel
2009. 4. 12. 22:02 Computer Vision
Filtering is refining the knowledge we have about the state of a system from the information provided by the measurements we make on it.


Filtering problem --> Systems' dynamics + Measurements of the system's current state
--> evolution equation (process noise) + measurement equation (measurement noise)
: deterministic or certain & stochastic or uncertain



Perturbations

Perturbation theory, mathematical methods that give approximate solutions to problems that cannot be solved exactly


evolution equation
> discrete-time, state-space formalism


Markovian evolution

http://en.wikipedia.org/wiki/Markov_process
a mathematical model for the random evolution of a memoryless system, that is, one for which the likelihood of a given future state, at any given moment, depends only on its present state, and not on any past states.
In a common description, a stochastic process with the Markov property, or memorylessness, is one for which conditional on the present state of the system, its future and past are independent[citation needed].
Often, the term Markov chain is used to mean a Markov process which has a discrete (finite or countable) state-space. Usually a Markov chain would be defined for a discrete set of times (i.e. a discrete-time Markov Chain)

http://en.wikipedia.org/wiki/Markov_chain
A Markov chain is a sequence of random variables X1, X2, X3, ... with the Markov property, namely that, given the present state, the future and past states are independent. Formally,
\Pr(X_{n+1}=x|X_n=x_n, \ldots, X_1=x_1) = \Pr(X_{n+1}=x|X_n=x_n).\,

The possible values of Xi form a countable set S called the state space of the chain.


http://en.wikipedia.org/wiki/State_space
In computer science, a state space is a description of a configuration of discrete states used as a simple model of machines.
The state space is what state space search searches in. Graph theory is helpful in understanding and reasoning about state spaces.

http://en.wikipedia.org/wiki/State_space_(controls)
In control engineering, a state space representation is a mathematical model of a physical system as a set of input, output and state variables related by first-order differential equations. To abstract from the number of inputs, outputs and states, the variables are expressed as vectors and the differential and algebraic equations are written in matrix form (the last one can be done when the dynamical system is linear and time invariant). The state space representation (also known as the "time-domain approach") provides a convenient and compact way to model and analyze systems with multiple inputs and outputs.

http://en.wikipedia.org/wiki/Probability_space
A probability space, in probability theory, is the conventional mathematical model of randomness. This mathematical object, sometimes called also probability triple, formalizes three interrelated ideas by three mathematical notions. First, a sample point (called also elementary event), --- something to be chosen at random (outcome of experiment, state of nature, possibility etc.) Second, an event, --- something that will occur or not, depending on the chosen elementary event. Third, the probability of this event. The definition (see below) was introduced by Kolmogorov in the 1930s.


uncertain control action
: known control actions & random perturbations


measurement equation

process noise
: nature of the perturbations entering our system

measurement noise

initial prior
: our previous knowledge about the initial state 


The filtering problem:
Find at each time k the 'best' estimate of the state of the system conditioned to the whole historic of measurements (from initial time up to current time k).

The solution:
Compute the posterior density of the system's state conditioned to the set of measurements.

> estimator
i) a-posteriori maximum of likelihood
ii) minimum of variance = conditioned mean


data mining
post-processing


incremental filtering
: processing at each time a bounded amount of information
--> recursive formulations (prediction step + correction step)


1) prediction step (time update)
: to propagate the posterior density at time k-1 into a prior density at time k by using the knowledge on the system dynamics and the perturbations

Chapman-Kolmogorov equation

http://en.wikipedia.org/wiki/Chapman-Kolmogorov_equation
an identity relating the joint probability distributions of different sets of coordinates on a stochastic process

transition density

"The prediction is a convolution of pdfs of the posterior at previous time and the perturbation on the dynamics."

linear-Gaussian --> Kalman filter

http://en.wikipedia.org/wiki/Gaussian_process



2) correction step (measurement update)
: to refine the predicted prior onto a corrected posterior by using the evidence provided by the measurements

Bayes rule
http://en.wikipedia.org/wiki/Bayes_rule

"The correction is a product of pdfs of the prior from the prediction step and the observed evidence."

additive observation noise




the Kalman filter

linear Gaussian system



http://en.wikipedia.org/wiki/Kalman_filter

The Kalman filter exploits the dynamics of the target, which govern its time evolution, to remove the effects of the noise and get a good estimate of the location of the target at the present time (filtering), at a future time (prediction), or at a time in the past (interpolation or smoothing).

Kalman filters are based on linear dynamical systems discretised in the time domain. They are modelled on a Markov chain built on linear operators perturbed by Gaussian noise. The state of the system is represented as a vector of real numbers. At each discrete time increment, a linear operator is applied to the state to generate the new state, with some noise mixed in, and optionally some information from the controls on the system if they are known. Then, another linear operator mixed with more noise generates the visible outputs from the hidden state. The Kalman filter may be regarded as analogous to the hidden Markov model, with the key difference that the hidden state variables take values in a continuous space (as opposed to a discrete state space as in the hidden Markov model). Additionally, the hidden Markov model can represent an arbitrary distribution for the next value of the state variables, in contrast to the Gaussian noise model that is used for the Kalman filter. There is a strong duality between the equations of the Kalman Filter and those of the hidden Markov model.


 \textbf{x}_{k} = \textbf{F}_{k} \textbf{x}_{k-1} + \textbf{B}_{k} \textbf{u}_{k} + \textbf{w}_{k}

where

  • Fk is the state transition model which is applied to the previous state xk−1;
  • Bk is the control-input model which is applied to the control vector uk;
  • wk is the process noise which is assumed to be drawn from a zero mean multivariate normal distribution with covariance Qk.
\textbf{w}_{k} \sim N(0, \textbf{Q}_k)

At time k an observation (or measurement) zk of the true state xk is made according to

\textbf{z}_{k} = \textbf{H}_{k} \textbf{x}_{k} + \textbf{v}_{k}

where Hk is the observation model which maps the true state space into the observed space and vk is the observation noise which is assumed to be zero mean Gaussian white noise with covariance Rk.

\textbf{v}_{k} \sim N(0, \textbf{R}_k)
The initial state, and the noise vectors at each step {x0, w1, ..., wk, v1 ... vk} are all assumed to be mutually independent.


Model underlying the Kalman filter. Circles are vectors, squares are matrices, and stars represent Gaussian noise with the associated covariance matrix at the lower right.






http://en.wikipedia.org/wiki/Linear_dynamical_system

In a linear dynamical system, the variation of a state vector (an N-dimensional vector denoted \mathbf{x}) equals a constant matrix (denoted \mathbf{A}) multiplied by \mathbf{x}.


\frac{d}{dt} \mathbf{x}(t) = \mathbf{A} \cdot \mathbf{x}(t)

 


\mathbf{x}_{m+1} = \mathbf{A} \cdot \mathbf{x}_{m}






http://en.wikipedia.org/wiki/Extended_Kalman_filter

 

Gaussian Sum Filter (GSF)



Particle Filter = sequential Monte Carlo methods (SMC)

http://en.wikipedia.org/wiki/Particle_filter



http://en.wikipedia.org/wiki/Markov_chain_Monte_Carlo



http://en.wikipedia.org/wiki/Convolution




 

posted by maetel
2009. 4. 9. 21:24 Computer Vision
M. Montemerlo, S. Thrun, D. Koller, and B. Wegbreit.
FastSLAM: A factored solution to the simultaneous localization and mapping problem.
In Proceedings of the AAAI National Conference on Artificial Intelligence, Edmonton, Canada, 2002. AAAI.



posted by maetel