블로그 이미지
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
  • total
  • today
  • yesterday

Category

'augmented Reality'에 해당되는 글 26건

  1. 2011.05.01 2011 증강현실 디자인 포럼
  2. 2010.10.31 Pattie Maes and Pranav Mistry demo SixthSense
  3. 2010.10.16 ISMAR 2010: B O R D E R L E S S
  4. 2010.10.07 David M. L. Williams 서강대 영상대학원 특강
  5. 2010.09.18 Zenitum's 4th Open Lab
  6. 2010.08.24 2010 공개 SW 개발자대회 2차 기술세미나 - 모바일 오픈소스 플랫폼 '안드로이드'
  7. 2010.05.27 virtual studio 구현: virtual object rendering test
  8. 2010.05.26 virtual studio 구현: camera calibration
  9. 2010.05.18 virtual studio 구현: camera calibration test 1
  10. 2010.05.14 virtual studio 구현: feature points matching test
  11. 2010.04.27 virtual studio 구현: pattern design
  12. 2010.04.27 virtual studio 구현: grid pattern generator
  13. 2010.04.22 virtual studio 구현: feature point identification (...ing)
  14. 2010.04.22 virtual studio 구현: line fitting (Hough transform + non maximal suppression)
  15. 2010.03.03 ARToolKit test log
  16. 2010.03.02 Jonathan Mooser et al. "Tricodes: A Barcode-Like Fiducial Design for Augmented Reality Media"
  17. 2010.03.02 "Design Patterns for Augmented Reality Systems"
  18. 2010.02.26 virtual studio 구현: cross ratio test
  19. 2010.02.26 Chikara MATSUNAGA et al. "Optimal Grid Pattern for Automated Camera Calibration Using Cross Ratio"
  20. 2010.02.19 서용덕 & 김종성 & 홍기상 "증강현실의 기술과 동향"
  21. 2009.09.16 Chekhlov et al < Ninja on a Plane: Automatic Discovery of Physical Planes for Augmented Reality Using Visual SLAM>
  22. 2009.09.02 한국전자통신연구원 "모바일 혼합현실 기술"
  23. 2009.08.05 PTAM test log on Mac OS X 7
  24. 2009.07.23 Brian Williams, Georg Klein and Ian Reid <Real-Time SLAM Relocalisation>
  25. 2009.07.15 Georg Klein & David Murrayt <Parallel Tracking and Mapping for Small AR Workspaces>
2011. 5. 1. 20:39 Footmarks
posted by maetel
2010. 10. 31. 23:41 Cases

'Cases' 카테고리의 다른 글

David Reed  (0) 2012.06.29
Object Detection in Crowded Workspaces  (0) 2010.10.02
Bayard and Eco: How to Talk About Books You Haven't Read  (0) 2010.09.18
Richard Dreyfuss: Improving Civic Education  (0) 2010.08.04
Oyster card  (0) 2008.08.14
posted by maetel
2010. 10. 16. 12:11 Footmarks
http://www.ismar10.org



2010-10-14 목





2010-10-15 금

Jeffry Shaw
Artevertiser - Improved Reality





posted by maetel
2010. 10. 7. 23:00 Footmarks
2010-10-07 @서강대 영상대학원 가브리엘관 703호

David M. L. Williams's bio:
born in London
B.S.  in Information System
Ph. D. Cognitive Science
UX
HCI

Mojo Interactive Spaces Mojoispaces.com

posted by maetel
2010. 9. 18. 11:58 Footmarks

4th Open Lab


September 14, 2010 | Written by admin

마침내 오픈랩이 다시 돌아왔습니다. 벌써 4번째 행사네요.
꼭 방문하셔서 제니텀의 최근 작업들을 경험하면서 즐거운시간 가지시길 바랍니다.

Zenitum’s Open Lab is back! Our Open Lab 4 will showcase our latest work in the field of augmented reality, including 3D reconstruction, and various techniques for recognizing and tracking images.


전시내용:


1. 영상기반의 모바일 증강현실 트래킹 엔진 & GPS기반 모바일 증강현실 트래킹 엔진

http://youtu.be/OvLTOWoze0A
http://youtu.be/YcgebgYeU5M
http://youtu.be/ibWnY9ZXKzk
http://youtu.be/7jUaxlS52tU
http://youtu.be/O-myIJboPn0


2. 4Cast: Full 3D 재구성 시스템

http://youtu.be/LByly6rlZMg
http://youtu.be/577gv_xeWPU
http://youtu.be/xL8YSgdQEXM

- 원하시는 분은 자신의 Full 3D 재구성 모델을 만들어 드립니다.


3. Media Art Project: iWall

- 3D 질감을 표현하는 대형 액티브 미디어 월과 iPhone과의 만남

- 기존(작년의 프로토타입)의 Active Media Wall 프로젝트 동영상은

http://youtu.be/wLlAfTa2lVg

posted by maetel
2010. 8. 24. 21:13 Footmarks






Session #1. 안드로이드의 현황과 전망
Lecturer: 박성호 (정보통신산업진흥원(NIPA) 공개/지역SW팀) shpark2@nipa.kr

http://source.android.com/

http://developer.android.com/

http://www.android.com/market/

OESF (Open Embedded System Foundation)
http://www.oesf.jp/en/

People of Lava
http://www.peopleoflava.com/


Session #2. 안드로이드의 다양한 Screen Device를 위한 UI 처리
Lecturer: 박성서 (안드로이드펍 운영자)

http://www.androidpub.com/

http://graynote.tistory.com/


Session #3. 인터넷 서비스 연동 애플리케이션 개발
Lecturer: 강순권 (네오위즈 인터넷 팀장)


Session #4. 안드로이드 센서/카메라/위치정보의 활용
Lecturer: 백유태 (주식회사 라람인터랙티브)

http://rharham.com/

http://rharham.tistory.com/

http://nyatla.jp/nyartoolkit/wiki/index.php?FrontPage.en

http://code.google.com/p/andar/

http://www.mixare.org/


Session #5. Android AR (Augmented Reality)
Lecturer: 고종욱 (주식회사 포비커 대표)  ceo@fobikr.com

http://fobikr.com/




'Footmarks' 카테고리의 다른 글

David M. L. Williams 서강대 영상대학원 특강  (0) 2010.10.07
Zenitum's 4th Open Lab  (0) 2010.09.18
3D 영상산업의 전망과 동향 (Stereo Pictures 성필문 회장)  (0) 2010.03.24
RoSEC 2010 winter school  (0) 2010.01.14
CUDA  (0) 2009.04.24
posted by maetel
2010. 5. 27. 20:53 Computer Vision
virtual object rendering test
가상의 그래픽 합성 시험

OpenGL 그래픽과 OpenCV 이미지 합성

camera로부터의 입력 이미지를 OpenCV 함수로 받아 IplImage 형태로 저장한 것과 OpenGL 함수로 그린 그래픽 정보를 합성하기


Way #1.

OpenCV의 카메라 입력으로 받은 image frame을 texture로 만들어 OpenGL의 디스플레이 창에 배경 (평면에 texture mapping)으로 넣고 여기에 그래픽을 그려 display하는 방법
ref. http://cafe.naver.com/opencv/12266

여차저차 조사 끝에 정리하면,
OpenGL에서 texture mapping을 실행하는 함수 glTexImage2D( )의 입력 텍스처로 OpenCV의 image data structure인 IplImage를 넣어 줄 수 있으면 끝난다.
ref.
http://www.gamedev.net/community/forums/topic.asp?topic_id=205527
http://www.rauwendaal.net/blog/opencvandopengl-1
ARTag source code: cfar_code/OpenGL/opengl_only_test/opengl_only_test.cpp
ARTag source code: cfar_code/IntroARProg/basic_artag_opengl/basic_artag_opengl.cpp

테스팅 중 발견한 문제점:
cvRetrieveFrame() 함수를 while 아래에서 돌려 cvShowImage() 함수로 보여 주는 대신 glutDisplayFunc() 함수에서 불러 glutMainLoop() 함수로 돌리면 시간이 많이 걸린다. (* cvGrabFrame() 함수의 경우는 괜찮음.)


ref. OpenGL Programming Guide - Chapter 9 - Texture Mapping
Textures are simply rectangular arrays of data - for example, color data, luminance data, or color and alpha data. The individual values in a texture array are often called texels.

The data describing a texture may consist of one, two, three, or four elements per texel, representing anything from a modulation constant to an (R, G, B, A) quadruple.

A texture object stores texture data and makes it readily available. You can now control many textures and go back to textures that have been previously loaded into your texture resources.


6일 동안의 갖은 삽질 끝에 몇 줄 되지도 않는 source code. ㅜㅜ

glLoadMarix( ) 함수




Way #2.

OpenCV에서 카메라로부터 얻은 image frame과 이로부터 계산한 OpenGL의 그래픽 정보를 OpenCV의 Iplimage로 넘기는 방법

ref.
http://cafe.naver.com/opencv/12622


http://webcache.googleusercontent.com/search?q=cache:xUG17-FlHQMJ:www.soe.ucsc.edu/classes/cmps260/Winter99/Winter99/handouts/proj1/proj1_99.html+tsai+opengl&cd=5&hl=ko&ct=clnk&gl=kr


http://www.google.com/codesearch/p?hl=ko#zI2h2OEMZ0U/~mgattass/ra/software/tsai.zip%7CsGIrNzsqK4o/tsai/src/main.c&q=tsai%20glut&l=9

http://www.google.com/codesearch/p?hl=ko#XWPk_ZdtAX4/classes/cmps260/Winter99/handouts/proj1/cs260proj1.tar.gz|DRo4_7nUzpo/CS260/camera.c&q=tsai%20glut&d=7


posted by maetel
2010. 5. 26. 22:59 Computer Vision
2010/02/10 - [Visual Information Processing Lab] - Seong-Woo Park & Yongduek Seo & Ki-Sang Hong
2010/05/18 - [Visual Information Processing Lab] - virtual studio 구현: camera calibration test



1. 내부 파라미터 계산

cvCalibrateCamera2() 함수를 이용하여 카메라 내부/외부 파라미터와 렌즈 왜곡 변수를 얻는다.


frame # 191  ---------------------------
# of found lines = 8 vertical, 6 horizontal
vertical lines:
horizontal lines:
p.size = 48
CRimage.size = 48
# of corresponding pairs = 15 = 15

camera matrix
fx=286.148 0 cx=207.625
0 fy=228.985 cy=98.8437
0 0 1

lens distortion
k1 = 0.0728017
k2 = -0.0447815
p1 = -0.0104295
p2 = 0.00914935

rotation vector
-0.117104  -0.109022  -0.0709096

translation vector
-208.234  -160.983  163.298



이 결과를 가지고 cvProjectPoints2()를 써서 패턴의 점에 대응되는 이미지 상의 점을 찾은 결과는 아래와 같다.




1-1.

카메라 내부 파라미터와 외부 파라미터를 모두 계산하는 cvCalibrateCamera2() 함수 대신 내부 파라미터만 계산하는
cvInitIntrinsicParams2D() 함수를 써 본다.



2. lens distortion(kappa1, kappa2)을 가지고 rectification

패턴 인식이 성공적인 경우 당연히 카메라 캘리브레이션 결과가 정확해지며, 이로부터 가상의 물체를 합성하기 위해 필요한 object 또는 graphic coordinate을 실시간으로 계산할 수 있다. 현재 우리 프로그램에서 패턴 인식이 실패하는 원인은 직선 검출의 오차인데, 이 오차의 원인으로는 여러가지가 있지만 가장 큰 것은 렌즈 왜곡이다. (현재 렌즈 왜곡을 고려하지 않고 있다.) 그래서 실제로는 하나의 직선에 대해 여러 개 (2-3개)의 직선을 검출하며 (NMS 알고리즘만으로는 이 오차를 줄이는 데 한계를 보이고 있어), 이로부터 계산된 교차점들의 위치 좌표 오차는 cross ratio 계산에 결정적인 오차로 작용한다. 현재 방식의 패턴 생성과 패턴 인식은 cross ratios 값에 절대적으로 의존하고 있기 때문에 이 문제를 반드시 해결해야 한다. 그러므로 렌즈 왜곡을 고려하여 입력 이미지를 펴서 (rectification) 기존의 패턴 인식 알고리즘을 적용하자.

ref.
Learning OpenCV: Chapter 6: Image Trasnforms
opencv v2.1 documentation — Geometric Image Transformations


1) Undistortion

Learning OpenCV: 396p
"OpenCV provides us with a ready-to-use undistortion algorithm that takes a raw image and the distortion coefficients from cvCalibrateCamera2() and produces a corrected image (see Figure 11-12). We can access this algorithm either through the function cvUndistort2(), which does everything we need in one shot, or through the pair of routines cvInitUndistortMap() and cvRemap(), which allow us to handle things a little more efficiently for video or other situations where we have many images from the same camera. ( * We should take a moment to clearly make a distinction here between undistortion, which mathematically removes lens distortion, and rectifi cation, which mathematically aligns the images with respect to each other. )

입력 영상 (렌즈 왜곡)

출력 영상 (왜곡 제거)






 

# of corresponding pairs = 30 = 30

camera matrix
fx=94.6664 0 cx=206.772
0 fy=78.3349 cy=158.782
0 0 1

lens distortion
k1 = 0.0130734
k2 = -0.000955421
p1 = 0.00287948
p2 = 0.00158042









            if ( ( k1 > 0.3 && k1 < 0.6 ) && ( cx > 150.0 && cx < 170.0 ) && ( cy > 110 && cy < 130 ) )


# of corresponding pairs = 42 = 42

camera matrix
fx=475.98 0 cx=162.47
0 fy=384.935 cy=121.552
0 0 1

lens distortion
k1 = 0.400136
k2 = -0.956089
p1 = 0.00367761
p2 = 0.00547217







2) Recitifaction




cvInitUndistortRectifyMap



3. line detection




4. 패턴 인식 (대응점 찾기)




5. 외부 파라미터 계산 (4의 결과 & lens distortion = 0 입력)
cvFindExtrinsicCameraParams2()



6. reprojection
2에서 얻은 rectificated image에 할 것




posted by maetel
2010. 5. 18. 00:26 Computer Vision
ref.
2010/02/10 - [Visual Information Processing Lab] - R. Y. Tsai "A Versatile Camera Calibration Technique for High Accuracy 3-D Maching Vision Metrology Using Off-the-shelf TV Cameras and Lenses"


(1) 고정되어 있는 것으로 가정한 카메라의 내부 파라미터 값들을 구하고 (2) 실시간으로 들어오는 이미지 프레임마다 카메라의 회전과 이동을 계산하기 위하여 Tsai 알고리즘을 쓰기로 하고, C 또는 C++로 구현된 소스코드 또는 라이브러리를 찾아서 붙여 보기로 한다.


Try #1.
처음에는 CMU의 Reg Willson가 C로 짠 Tsai Camera Calibration 코드 에서 필요한 부분을 include하여 쓰려고 했는데, C++ 문법에 맞지 않는 구식 C 문법으로 코딩된 부분이 많아서 고치는 데 애를 먹었다. (Xcode의 C++ 프로젝트에서 .c 파일을 include하면 compile은 되지만, linking error가 난다. 때문에 .c를 .cpp로 바꾸어야 함.)  그런데 결정적으로, "cal_main.cpp" 파일에 정의된, 캘리브레이션의 최종 결과값을 주는 함수들이 호출하는 optimization을 실행하는 함수 lmdif_()가  Fortan 파일 "lmdif.f"에 정의되어 있고, Fortran을 C로 변환해 주는 "f2c.h"에 의해 이것을 "lmdif.c"로 하여 가지고 있다는 문제가 있었다. lmdif.c를 lmdif.cpp 형태로 만들기 위해서는 Fortran 언어와 Fortran을 C++로 변환하는 방법을 알아야 하므로, 결국 포기했다.



Try #2.
Michigan State University Charles B. Owen Display-Relative Calibration (DRC)을 구현한 DRC 프로그램( DRC.zip )에서 카메라 캘리브레이션에 Tsai의 알고리즘 libtsai.zip을 쓰고 있다. 이 라이브러리는 위의 C 코드를 C++로 수정하면서 "CTsai"라는 클래스를 사용하고 여러 함수들을 수정/보완/결합한 것인데, Visual Studio 용 프로젝트 프로그램을 만들면서 Windows 환경에 기반하여 MFC를 활용하였다. 그래서 이것을 나의 Mac OS X 기반 Xcode 프로젝트에서 그대로 가져다 쓸 수는 없다. 용법은 다음과 같다.

DRC/DisplayRelativeCalibration.cpp:
bool CDisplayRelativeCalibration::ComputeCameraCalibration(void)
{
    CTsai tsai;

    tsai.Width(m_camerawid);
    tsai.Height(m_camerahit);

    for(std::list<Corr>::const_iterator i=m_cameracorr.begin();  i!=m_cameracorr.end();  i++)
    {
        tsai.Point(i->x, i->y, i->z, i->u, i->v);
    }

    if(tsai.PointCount() < 8)
        return Error("Didn't get enough points");

    if(!tsai.Compute())
        return Error("Camera calibration failed");

    for(int n=0;  n<tsai.PointCount();  n++)
    {
        double ux, uy;
        tsai.WorldToImage (tsai.PointX(n), tsai.PointY(n), tsai.PointZ(n), ux, uy);

        m_cameraproj.push_back(CGrPoint(ux, uy, 0));
    }

   
    m_cameraf = tsai.F();
    m_cameracx = tsai.Cx();
    m_cameracy = tsai.Cy();
    m_camerakappa1 = tsai.Kappa1();
    m_camerasx = tsai.Sx();
    memcpy(m_cameramatrix, tsai.CameraMatrix(), sizeof(double) * 16);

    return true;
}




문제점#1.

class CTsai 안의 member functions 중에  ncc_compute_exact_f_and_Tz( )와 ncc_compute_exact_f_and_Tz_error( )가 있는데,

libtsai.h:21
class CTsai
{

    bool ncc_compute_exact_f_and_Tz();
    bool ncc_compute_exact_f_and_Tz_error (int m_ptr, int n_ptr, const double *params, double *err);

};

전자인 ncc_compute_exact_f_and_Tz()가 정의된 부분을 보면, 

Tsai_ncc.cpp:274
bool CTsai::ncc_compute_exact_f_and_Tz()
{
    CLmdif<CTsai> lmdif;

    lmdif.Lmdif (this, ncc_compute_exact_f_and_Tz_error,
            m_point_count, NPARAMS, x,
            NULL, NULL, NULL, NULL);
}

클래스 형태의 템플릿( CLmdif )으로 선언된 "lmdif"의 member function "Lmdif"를 호출할 때, 

min/Lmdif.h:48
template<class T> class CLmdif : private CLmdif_
{

int Lmdif(T *p_user, bool (T::*p_func)(int m, int n, const double *parms, double *err),
        int m, int n, double *x, double *fvec, double *diag, int *ipvt, double *qtf)

};

후자인 같은 member function, ncc_compute_exact_f_and_Tz_error()를 인자로 넣고 있고 (위 부분 코드들 중 오렌지 색 부분), 컴파일 하면 이 부분을 <unknown type>으로 인식하지 못 하겠다는 에러 메시지를 보낸다. 그리고 다음과 같은 형태를 추천한다고 한다.
 
note: candidates are: int CLmdif<T>::Lmdif(T*, bool (T::*)(int, int, const double*, double*), int, int, double*, double*, double*, int*, double*) [with T = CTsai]

function pointer의 형태가 틀린 모양인데, 오렌지색 부분을 그냥 함수가 아닌 어떤 class의 non-static member function을 가리키는 pointer로  &CTsai::ncc_compute_exact_f_and_Tz_error 이렇게 바꾸어 주면, 에러 메시지가 다음과 같이 바뀐다.

error: no matching function for call to 'CLmdif<CTsai>::Lmdif(CTsai* const, bool (*)(int, int, const double*, double*), int&, const int&, double [3], NULL, NULL, NULL, NULL)'

연두색 부분 대신 CTsai::ncc_compute_exact_f_and_Tz_error 이렇게 바꾸어 주면, 에러 메시지가 다음과 같다.

error: no matching function for call to 'CLmdif<CTsai>::Lmdif(CTsai* const, bool (&)(int, int, const double*, double*), int&, const int&, double [3], NULL, NULL, NULL, NULL)'

해결:
편법으로, class CLmdif를 클래스 형 템플릿이 아닌 그냥 클래스로 바꾸어서 선언하고 연두색 부분처럼 호출하면 에러는 안 나기에 일단 이렇게 넘어가기로 한다.


문제점#2.
코드에서 Windows OS 기반 MFC를 사용하고 있어 Mac OS X에서 에러가 난다.

해결:
MFC를 사용하는 "StdAfx.h"는 모두 주석 처리한다.


문제점#3.
Lmdif.h



... 기타 등등의 문제점들을 해결하고, 캘리브레이션을 수행한 결과가 맞는지 확인하자.

source code:
           if ( CRimage.size() > 0 ) // if there is a valid point with its cross ratio
            {  
                correspondPoints(indexI, indexW, p, CRimage, linesYorder.size(), linesXorder.size(), world, CRworld, dxList.size(), dyList.size(), iplMatch, scale );
            }  
            cvShowImage( "match", iplMatch );
            cvSaveImage( "match.bmp", iplMatch );
           
            cout << "# of pairs = " << indexI.size() << " = " << indexW.size() << endl;
           
            // # 6. camera calibration
           
            int numPair = indexI.size();
           
            tsai.Clear();
           
            for( int n = 0;  n < numPair;  n++ )
            {
                tsai.Point(world[indexW[n]].x, world[indexW[n]].y, world[indexW[n]].z, p[indexI[n]].x, p[indexI[n]].y);
               
                cout << "pair #" << n << ": " << p[indexI[n]].x << "  " <<  p[indexI[n]].y << "  : "
                    << world[indexW[n]].x << "  " << world[indexW[n]].y << "  " << world[indexW[n]].z << endl;
            }
           
            if( numPair < 8 )
                cout << "Didn't get enough points" << endl;
           
            if(!tsai.Compute())
                cout << "Camera calibration failed" << endl;
           
            cout << endl << "camera parameter" << endl
            << "focus = " << tsai.F() << endl
            << "principal axis (x,y) = " <<  tsai.Cx() << ", " <<  tsai.Cy() << endl
            << "kappa1 (lens distortion) = " <<  tsai.Kappa1() << endl
            << "skew_x = " << tsai.Sx() << endl;
          
            // reproject world points on to the image frame to check the result of computing camera parameters
            for(int n=0;  n<tsai.PointCount();  n++)
            {
                double ux, uy;
                tsai.WorldToImage (tsai.PointX(n), tsai.PointY(n), tsai.PointZ(n), ux, uy);
                CvPoint reproj = cvPoint( cvRound(ux), cvRound(uy) );
                cvCircle( iplInput, reproj, 3, CV_RGB(200,100,200), 2 );
            }
           
// draw a cube on the image coordinate computed by camera parameters according to the world coordinate
            drawcube( tsai, iplInput, patSize );
            cvShowImage( "input", iplInput );  



아래 사진은 구해진 카메라 내부/외부 파라미터들을 가지고 (1) 실제 패턴의 점에 대응하는 이미지 프레임 (image coordinate) 상의 점을 찾아 (reprojection) 보라색 원으로 그리고, (2) 실제 패턴이 있는 좌표 (world coordinate)를 기준으로 한 graphic coordinate에 직육면체 cube를 노란색 선으로 그린 결과이다.

이미지 프레임과 실제 패턴 상의 점을 1 대 1로 비교하여 연결한 16쌍의 대응점

구한 카메라 파라미터를 가지고 실제 패턴 위의 점들을 이미지 프레임에 reproject한 결과 (보라색 점)와 실제 패턴의 좌표를 기준으로 한 그래픽이 이미지 프레임 상에 어떻게 나타나는지 그린 결과 (노란색 상자)

 

위 왼쪽 사진에서 보여지는 16쌍의 대응점들의 좌표값을 "이미지 좌표(x,y) : 패턴 좌표 (x,y,z)"로 출력한 결과:
# of pairs = 16 = 16
pair #0: 7.81919  36.7864  : 119.45  82.8966  0
pair #1: 15.1452  71.2526  : 119.45  108.484  0
pair #2: 26.1296  122.93  : 119.45  147.129  0
pair #3: 36.6362  172.36  : 119.45  182.066  0
pair #4: 77.3832  20.4703  : 159.45  82.8966  0
pair #5: 85.4293  53.7288  : 159.45  108.484  0
pair #6: 97.8451  105.05  : 159.45  147.129  0
pair #7: 109.473  153.115  : 159.45  182.066  0
pair #8: 96.6046  15.962  : 171.309  82.8966  0
pair #9: 105.046  48.8378  : 171.309  108.484  0
pair #10: 118.177  99.9803  : 171.309  147.129  0
pair #11: 130.4  147.586  : 171.309  182.066  0
pair #12: 145.469  4.50092  : 199.965  82.8966  0
pair #13: 154.186  36.5857  : 199.965  108.484  0
pair #14: 168.033  87.5497  : 199.965  147.129  0
pair #15: 180.732  134.288  : 199.965  182.066  0


그런데 위 오른쪽 사진에서 보여지는 결과는 이전 프레임에서 20쌍의 대응점으로부터 구한 카메라 파라미터 값을 가지고 계산한 결과이다.
# of found lines = 8 vertical, 7 horizontal
vertical lines:
horizontal lines:
p.size = 56
CRimage.size = 56

# of pairs = 20 = 20
pair #0: -42.2331  53.2782  : 102.07  108.484  0
pair #1: -22.6307  104.882  : 102.07  147.129  0
pair #2: -4.14939  153.534  : 102.07  182.066  0
pair #3: 1.81771  169.243  : 102.07  193.937  0
pair #4: -10.9062  41.1273  : 119.45  108.484  0
pair #5: 8.69616  92.7309  : 119.45  147.129  0
pair #6: 27.0108  140.945  : 119.45  182.066  0
pair #7: 32.9779  156.653  : 119.45  193.937  0
pair #8: 57.4164  14.6267  : 159.45  108.484  0
pair #9: 77.7374  65.9516  : 159.45  147.129  0
pair #10: 96.3391  112.934  : 159.45  182.066  0
pair #11: 102.524  128.555  : 159.45  193.937  0
pair #12: 76.5236  7.21549  : 171.309  108.484  0
pair #13: 97.5633  58.2616  : 171.309  147.129  0
pair #14: 116.706  104.705  : 171.309  182.066  0
pair #15: 123.108  120.238  : 171.309  193.937  0
pair #16: 125.015  -11.5931  : 199.965  108.484  0
pair #17: 146.055  39.453  : 199.965  147.129  0
pair #18: 164.921  85.2254  : 199.965  182.066  0
pair #19: 171.323  100.758  : 199.965  193.937  0

camera parameter
focus = 3724.66
principal axis (x,y) = 168.216, 66.5731
kappa1 (lens distortion) = -6.19473e-07
skew_x = 1



대응점 연결에 오차가 없으면, 즉, 패턴 인식이 잘 되면, Tsai 알고리즘에 의한 카메라 파라미터 구하기가 제대로 되고 있음을 확인할 수 있다. 하지만, 현재 full optimization (모든 파라미터들에 대해 최적화 과정을 수행하는 것)으로 동작하게 되어 있고, 프레임마다 모든 파라미터들을 새로 구하고 있기 때문에, 속도가 매우 느리다. 시험 삼아 reprojection과 간단한 graphic을 그리는 과정은 속도에 큰 영향이 없지만, 그전에 카메라 캘리브레이션을 하는 데 필요한 계산 시간이 길다. 입력 프레임이 들어오는 시간보다 훨씬 많은 시간이 걸려 실시간 구현이 되지 못 하고 있다.

따라서, (1) 내부 파라미터는 첫 프레임에서 한 번만 계산하고 (2) 이후 매 프레임마다 외부 파라미터 (카메라의 회전과 이동)만을 따로 계산하는 것으로 코드를 수정해야 한다.




Try#3.
OpenCV 함수 이용

1) 내부 파라미터 계산
cvCalib
rateCamera2


2) lens distortion(kappa1, kappa2)을 가지고 rectification
cvInitUndistortRectifyMap

3) line detection

4) 패턴 인식 (대응점 찾기)

5) 외부 파라미터 계산 (4의 결과 & lens distortion = 0 입력)
cvFindExtrinsicCameraParams2

6) reprojection
2)에서 얻은 rectificated image에 할 것


posted by maetel
2010. 5. 14. 21:50 Computer Vision
Test on the correspondences of feature points
특징점 대응 시험

교점의 cross ratio 값을 구하고, 그 값과 가장 가까운 cross ratio 값을 가지는 점을 패턴에서 찾아 대응시킨다.


Try #1. one-to-all

입력 영상에서 검출한 직선들로부터 생기는 각 교점에서 수평 방향으로 다음 세 개의 교점, 수직 방향으로 다음 세 개의 교점을 지나는 직선에 대한 cross ratio (x,y)값을 구한다. 이상적으로, 1에서 구한 cross ratio 값과 일치하는 cross ratio 값을 가지는 패턴의 격자점이 입력 영상의 해당 교차점과 실제로 대응하는 점이라고 볼 수 있다.

직선 검출에 오차나 오류가 적을 경우, 아래 테스트 결과에서 보듯 입력 영상의 교차점에 대해 실제 패턴의 직선을 1대 1로 즉각적으로 찾는다. 즉, 입력 영상의 한 점에서의 수평 방향 cross ratio 값에 대해 패턴의 모든 수평선들의 cross ratio 값을 일일이 대조하여 가장 근접한 값을 가지는 직선을 대응시키는 방식이다. (아래 오른쪽 사진은 같은 방식으로 수직 방향 cross ratio 값을 가지고 대응되는 직선을 찾는 경우임.) (point-to-line)

수평선 위의 점들에 대한 cross ratio 값만 비교한 결과

수선 위의 점들에 대한 cross ratio 값만 비교한 결과



입력 영상에서 하나의 교차점의 x방향 cross ratio 값과 같은 cross ratio 값을 가지는 세로선을 실제 패턴에서 찾고, y방향 cross ratio 값에 대해서 가로선을 찾으면, 패턴 위에 그 세롯선과 가로선이 교차하는 점 하나가 나온다. 입력 이미지 상의 한 점에 대해 패턴의 모든 직선을 (가로선의 개수+세로선의 개수) 번 비교하여 대응점을 연결하는 것이다. (point-to-point)

(패턴 인식이 성공적인 경우)

(잘못된 대응점 연결이 발생한 경우)




그러므로 현재는 (1) 입력 영상에서 한 직선 위에 있는 것으로 추산된 일련의 점들에서의 cross ratio 값들의 수치적 경향을 고려하지 않고 있으며, (2) 입력 영상에 실제 패턴의 어느 부분(위치나 범위)이 잡힌 것인지를 판단하지 않고 무조건 전체 패턴의 모든 격자점들에 대해서 cross ratio 값을 비교하고 있다.      




Try #2. line-to-line




잘 되는 경우:
# of pairs = 25 = 25
# of imagePoints = 25 , 25
# of worldPoints = 25 , 25
imagePoint (0, 0) : worldPoint (4, 1)
imagePoint (0, 1) : worldPoint (4, 2)
imagePoint (0, 2) : worldPoint (4, 3)
imagePoint (0, 3) : worldPoint (4, 4)
imagePoint (0, 4) : worldPoint (4, 5)
imagePoint (1, 0) : worldPoint (5, 1)
imagePoint (1, 1) : worldPoint (5, 2)
imagePoint (1, 2) : worldPoint (5, 3)
imagePoint (1, 3) : worldPoint (5, 4)
imagePoint (1, 4) : worldPoint (5, 5)
imagePoint (2, 0) : worldPoint (6, 1)
imagePoint (2, 1) : worldPoint (6, 2)
imagePoint (2, 2) : worldPoint (6, 3)
imagePoint (2, 3) : worldPoint (6, 4)
imagePoint (2, 4) : worldPoint (6, 5)
imagePoint (3, 0) : worldPoint (7, 1)
imagePoint (3, 1) : worldPoint (7, 2)
imagePoint (3, 2) : worldPoint (7, 3)
imagePoint (3, 3) : worldPoint (7, 4)
imagePoint (3, 4) : worldPoint (7, 5)
imagePoint (4, 0) : worldPoint (8, 1)
imagePoint (4, 1) : worldPoint (8, 2)
imagePoint (4, 2) : worldPoint (8, 3)
imagePoint (4, 3) : worldPoint (8, 4)
imagePoint (4, 4) : worldPoint (8, 5)



잘 안 되는 경우:
# of pairs = 28 = 28
# of imagePoints = 28 , 28
# of worldPoints = 28 , 28
imagePoint (0, 0) : worldPoint (4, 6)
imagePoint (0, 1) : worldPoint (4, 7)
imagePoint (0, 2) : worldPoint (4, 1)
imagePoint (0, 3) : worldPoint (4, 2)
imagePoint (0, 4) : worldPoint (4, 3)
imagePoint (0, 5) : worldPoint (4, 4)
imagePoint (0, 6) : worldPoint (4, 5)
imagePoint (1, 0) : worldPoint (9, 6)
imagePoint (1, 1) : worldPoint (1, 7)
imagePoint (1, 2) : worldPoint (5, 1)
imagePoint (1, 3) : worldPoint (5, 2)
imagePoint (1, 4) : worldPoint (5, 3)
imagePoint (1, 5) : worldPoint (5, 4)
imagePoint (1, 6) : worldPoint (5, 5)
imagePoint (2, 0) : worldPoint (9, 6)
imagePoint (2, 1) : worldPoint (3, 7)
imagePoint (2, 2) : worldPoint (6, 1)
imagePoint (2, 3) : worldPoint (6, 2)
imagePoint (2, 4) : worldPoint (6, 3)
imagePoint (2, 5) : worldPoint (6, 4)
imagePoint (2, 6) : worldPoint (6, 5)
imagePoint (3, 0) : worldPoint (9, 6)
imagePoint (3, 1) : worldPoint (0, 7)
imagePoint (3, 2) : worldPoint (7, 1)
imagePoint (3, 3) : worldPoint (7, 2)
imagePoint (3, 4) : worldPoint (7, 3)
imagePoint (3, 5) : worldPoint (7, 4)
imagePoint (3, 6) : worldPoint (7, 5)

posted by maetel
2010. 4. 27. 22:19 Computer Vision
ref. 2010/04/27 - [Visual Information Processing Lab] - virtual studio 구현: grid pattern generator

case #1

Visual Studio: project 속성 > 구성 속성 > 디버깅 > 명령 인수
가로선: 40(개수) 15(최소 픽셀수) 45(최대 픽셀수) 20
세로선: 30 15 45 20

세로선 40개 간격:  가로선 30개 간격: 





세로선 40개, 가로선 30개로 생성된 패턴 (400x300pixels)

오른쪽의 패턴을 7배 확대한 영상


현재 코드는 검은색 바탕에 흰색 사각형을 그리게 되는데, 소수 값을 정수 값 (픽셀의 위치 좌표)으로 변환하는 과정에서 오차가 발생한다. 얼핏 격자 무늬로 보이는 오른쪽 그림을 확대한 왼쪽 그림을 보면, 격자 사이가 벌어지거나 겹치는 부분이 생긴다는 것을 알 수 있다.


그리는 방법을 달리했더니 해결된다. 이미지와 같은 높이의 세로 막대들을 하얀색으로 먼저 그리고 나서, 이미지와 같은 너비의 가로 막대들을 하얀색으로 그리고, 막대들이 서로 교차하는 (하얀색으로 두 번 그린 셈인) 부분을 다시 검은색으로 그렸다. (이건 뭔... 컴퓨터 비전도 이미지 프로세싱도 아니고 그렇다고 컴퓨터 그래픽스라고 보기도 우습고,  중학교 수학 경시대회 난이도 중상 정도의 문제를 푸는 기분이다. )

세로선 40개, 가로선 30개로 생성된 패턴 (400x300pixels)

오른쪽의 패턴을 7배 확대한 영상








각 꼭지점에서의 x방향과 y방향의 cross ratio 값을 계산한 결과는 다음과 같다. 이 중 값이 "-1"로 나온 것은 그 점에서 해당 방향의 직선에 대해 cross ratio를 계산할 수 없는 경우를 표시하기 위해 초기값으로 주었던 것이다.

CRworldX:
0.386312  0.094615  0.414865  0.284612  0.161689  0.323677  0.132262  0.471754  0.166943  0.114793  0.526767  0.146283  0.268856  0.254384  0.210419  0.282485  0.229261  0.262292  0.233925  0.302709  0.107159  0.385672  0.237546  0.276318  0.328597  0.0923081  0.439814  0.151013  0.295795  0.157482  0.342474  0.354428  0.0689949  0.5625  0.0725959  0.503555  0.0725959  -1  -1  -1 
CRworldY:
0.144347  0.293357  0.3338  0.212505  0.221081  0.232091  0.287101  0.203252  0.312434  0.113198  0.555337  0.105233  0.283001  0.261716  0.167103  0.452516  0.180647  0.218986  0.240322  0.260169  0.24469  0.125  0.5625  0.071018  0.512553  0.071018  0.384156  -1  -1  -1 





source code:
// calculate cross ratios in the world coordinate on real pattern
void crossRatioWorld( vector<CvPoint2D32f>& CRworld, vector<CvPoint3D32f>& world,  int dxListSize, int dyListSize, CvPoint2D32f scale )
{
    //    vector<CvPoint2D32f> crossRatioWorld; // cross ratios in the world coordinate on real pattern
    float crX = -1.0, crY = -1.0;
   
    for( int i = 0; i < dxListSize; i++ )   
    {
        for( int j = 0; j < dyListSize; j++ )
        { 
            CRworld.push_back(cvPoint2D32f(crX, crY));
        }
    }
   
    cout << "CRworld.size = " << CRworld.size() << endl;
   
    //  "cr[iP] = p1 * p3 / ((p1 + p2) * (p2 + p3))" in psoBasic.cpp: 316L
    // that is (b-a)(d-c)/(c-a)(d-b) with 4 consecutive points, a, b, c, and d
    float a, b, c, d;
    // cross ratios in horizontal lines
    for( int i = 0; i < dxListSize-3; i++ )   
    {
        a = world[i*dyListSize].x;
        b = world[(i+1)*dyListSize].x;
        c = world[(i+2)*dyListSize].x;
        d = world[(i+3)*dyListSize].x;
       
        crX = ( (b-a)*(d-c) ) / ( (c-a)*(d-b) ) ;
       
        for( int j = 0; j < dyListSize; j++ )
        {
            CRworld[i*dyListSize+j].x = crX;
        }
    }
   
    // cross ratios in vertical lines
    for( int j = 0; j < dyListSize-3; j++ )
    {
        a = world[j].y;
        b = world[j+1].y;
        c = world[j+2].y;
        d = world[j+3].y;
       
        crY = ( (b-a)*(d-c) ) / ( (c-a)*(d-b) ) ;
       
        for( int i = 0; i < dxListSize; i++ )
        {
            CRworld[i*dyListSize+j].y = crY;
        }
    }
   
    cout << "CRworldX: " << endl;
    for( int i = 0; i < dxListSize; i++ )
    {
        cout << /* "CRworldX[" << i << "] = " << */ CRworld[i*dyListSize].x << "  ";
    }
    cout << endl << "CRworldY: " << endl;
    for( int j = 0; j < dyListSize; j++ )
    {
        cout << /* "CRworldY[" << j << "] = " << */ CRworld[j].y << "  ";
    }
   
    // just to check
    /*    for( int i = 0; i < dxListSize; i++ )   
     {
     for( int j = 0; j < dyListSize; j++ )
     {
     cout << "CRworld[" << i << "," << j << "] = " << CRworld[i*dyListSize+j].x << ", " << CRworld[i*dyListSize+j].y << endl;;
     }
     }
     cout << endl;
     */  
}



Grids 40x30 Dim.s 4000x3000







case #2

Visual Studio: project 속성 > 구성 속성 > 디버깅 > 명령 인수
가로선: 15(개수) 10(최소 픽셀수) 40(최대 픽셀수) 20
세로선: 12 10 40 20




dxListSize = 15     dyListSize = 12
worldSize = 180
scale = 1.11126, 0.833261
CRworld.size = 180
CRworldX:
0.267229  0.236729  0.124688  0.485958  0.0692628  0.545564  0.0944922  0.443539  0.171158  0.294299  0.195769  0.150979  -1  -1  -1  
CRworldY:
0.165879  0.399442  0.23958  0.189141  0.133199  0.575565  0.0899842  0.341729  0.207025  -1  -1  -1  



Grids 15x12 Dim.s 1500x1200


posted by maetel
2010. 4. 27. 22:07

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2010. 4. 22. 20:50 Computer Vision
ref.
swPark_2000rti 439쪽: In the initial identification process, we first extract and identify vertical and horizontal lines of the pattern by comparing their cross-ratios, and then we compute the intersections of the lines. Theoretically with this method, we can identify feature points in every frame automatically, but several situations cause problems in the real experiments.


박승우_1999전자공학회지 94쪽: 초기 인식과정에서는 패턴 상의 교점을 인식하기 위해 패턴의 제작과정에서 설명한 것처럼 영상에서 구해진 가로선과 세로선의 Cross-ratio를 패턴의 가로선과 셀로선이 가지는 Cross-ratio와 비교함으로써 몇번째 선인지를 인식하게 된다. 이러한 방법을 이용해 영상으로부터 자동으로 특징점을 찾고 인식할 수 있지만, 실제 적용 상에서는 몇 가지 제한점이 따르게 된다.



0. NMS (Non Maximum Suppression)을 적용한 Hough transform에 의한 Line 찾기

OpenCV 라이브러리의 HoughLines2() 함수는 전에 기술한 바( http://leeway.tistory.com/801 )와 같이 실제 패턴에서는 하나의 직선 위에 놓인 점들에 대해 이미지 프레임에서 검출된 edges을 가지고 여러 개의 직선을 찾는 결과를 보인다. 이는 HoughLines2() 함수가 출력하는, 직선을 정의하는 두 파라미터 rho와 theta에 대해 ( x*cos(theta) + y*sin(theta) = rho ) 계산된 값들이 서로 비슷하게 나오는 경우에 최적값을 선별하는 과정을 거치지 않고 모든 값들을 그대로 내보내기 때문이다. 그래서 OpenCV의 이 함수를 이용하지 않고, 따로 Hough transform을 이용하여 선을 찾는 함수를 만들되 여기에 NMS (Non Maximum Suppression)를 적용하도록 해 보았다. 하지만 이 함수를 실시간 비디오 카메라 입력에 대해 매 프레임마다 실행시키면 속도가 매우 느려져 쓸 수 없었다. 그래서, 속도 면에서 월등한 성능을 보이는 OpenCV의 HoughLines2() 함수를 그대로 따 오고 대신 여기에 NMS 부분을 추가하여 수정한 함수를 매 입력 프레임마다 호출하는 방법을 택하였고, 실시간 처리가 가능해졌다. (->소스코드)


http://en.wikipedia.org/wiki/Feature-point_detection



1. 직선의 순서 매기기

산출된 수직선들을 이미지 프레임의 왼쪽에서부터 오른쪽으로 나타난 순서대로 번호를 매기고 (아래 그림의 붉은색 번호), 수평선들을 위로부터 아래로 나타난 순서대로 번호를 매긴다 (아래 그림의 푸른색 번호). 이 과정에서 수직선의 경우 x절편, 수평선의 경우 y절편의 값을 기준으로 하여 계산하였다. 



아래 코드에서 "line.x0"가 "line" 직선의 x절편임
// rearrange lines from left to right
void indexLinesY ( CvSeq* lines, IplImage* image )
{   
    // retain the values of "rho" & "theta" of found lines
    int numLines = lines->total;
    // line_param line[numLines]; 이렇게 하면 나중에 이 변수를 밖으로 빼낼 때 (컴파일 에러는 안 나지만) 문제가 됨.
    line_param *line = new line_param[numLines];

    for( int n = 0; n < numLines; n++ )
    {
        float* newline = (float*)cvGetSeqElem(lines,n);
        line[n].rho = newline[0];
        line[n].theta = newline[1];
    }
   
    // rearrange "line" array in geometrical order
    float temp_rho, temp_theta;
    for( int n = 0; n < numLines-1; n++ )
    {
        for ( int k = n+1; k < numLines; k++ )
        {
            float x0_here = line[n].rho / cos(line[n].theta);
            float x0_next = line[k].rho / cos(line[k].theta);
            if( x0_here > x0_next ) {
                temp_rho = line[n].rho;        temp_theta = line[n].theta;
                line[n].rho = line[k].rho;        line[n].theta = line[k].theta;
                line[k].rho = temp_rho;        line[k].theta = temp_theta;
            }
        }
    }
    // calculate the other parameters of the rearranged lines
    for( int n = 0; n < numLines; n++ )
    {
        line[n].a = cos(line[n].theta);
        line[n].b = sin(line[n].theta);
        line[n].x0 = line[n].rho / line[n].a;
        line[n].y0 = line[n].rho / line[n].b;
       
        cout << "x[" << n << "] = " << line[n].x0 << "    y[" << n << "] = " << line[n].y0 ;
        cout << "    rho[" << n << "] = " << line[n].rho << "    theta[" << n << "] = " << line[n].theta << endl;
       
        char txt[100]; sprintf(txt, "%d", n);
        cvPutText(image, txt, cvPoint(line[n].x0, 10+n*10), &cvFont(0.8), CV_RGB(255,50,50));
    }
}

초록색으로 칠한 줄에 대한 설명:
void indexLinesY( CvSeq* lines, IplImage* image ) 함수를 line_param* indexLinesY( CvSeq* lines, IplImage* image )라고 바꾸어 structure로 선언한 line_param 형태의 배열을 출력하도록 하고, 이 출력값을 교점을 구하는 함수의 입력으로 하면
line_param line[numLines];
이렇게 함수 안에서 선언했던 부분이 함수 밖으로 출력되어 다른 함수의 입력이 될 때 입력값이 제대로 들어가지 않는다. 다음과 같이 바꾸어 주어야 함.
line_param *line = new line_param[numLines];

ref. http://cplusplus.com/reference/std/new/



상기 0-1의 과정을 적용한 코드의 실행 결과




그런데 다음과 같은 문제를 발견함.

x방향 DoG 필터링한 영상

y방향 DoG 필터링한 영상

Hough transform에 NMS를 적용하여 검출한 직선에 순번을 매긴 결과


이미지 프레임에서 찾은 수평선들을 보면 제일 위쪽의 직선이 0번이 아니라 4번부터 순번이 매겨져 있다. 프레임 바깥에 (위쪽에) 세 개의 직선이 더 있다는 뜻인데...

수직성 상의 edges 검출 영상

수평선 상의 edges 검출 영상

수직선들을 왼쪽부터 오른쪽으로, 수평선들을 위에서 아래로 정열한 결과


왼쪽 두 개는 line detection에 입력으로 쓰인 영상이고, 마지막 것은 이로부터 순서대로 정열한 직선을 규정하는 매개변수 출력값이다. 0번부터 3번 수평선의 y절편 값이 음수로 나타나고 있다.



2. 교점의 순서 매기기

격자 무늬의 직선들의 교점(intersections)을 과정1에서 계산한 직선의 순번을 이용하여 indexing한다. 빨간 세로선 0번과 파란 가로선 0번의 교점은 00번, 이런 식으로.

// index intersection points of lines in X and Y
CvPoint* indexIntersections ( line_param* lineX, line_param* lineY, int numLinesX, int numLinesY, IplImage* image )
// find intersections of lines, "linesX" & "linesY", and draw them in "image"
{
    int numPoints = (numLinesX+1) * (numLinesY+1);
    CvPoint *p = new CvPoint[numPoints]; // the intersection point of lineX[i] and lineY[j]
    char txt[100]; // text to represent the index number of an intersection
   
    for( int i = 0; i < MIN(numLinesX,100); i++ )
    {
        for( int j = 0; j < MIN(numLinesY,100); j++ )
        {             
            int indexP = i*numLinesY + j;     
            float Px = ( lineX[i].rho*lineY[j].b - lineY[j].rho*lineX[i].b ) / ( lineX[i].a*lineY[j].b - lineX[i].b*lineY[j].a ) ;
            float Py = ( lineX[i].rho - lineX[i].a*Px ) / lineX[i].b ;
            p[indexP].x = cvRound(Px);
            p[indexP].y = cvRound(Py);
           
            // display the points in an image
            cvCircle( image, p[indexP], 3, CV_RGB(0,255,50) /* , <#int line_type#>, <#int shift#> */ );   
            sprintf(txt, "%d", indexP);   
            cvPutText(image, txt, p[indexP], &cvFont(0.7), CV_RGB(50,255,250));           
        }
    }       
    return p;
}


입력 영상 input을 단일 채널 temp로 바꾸어 1차 DoG 필터링을 하여 검출된 edges를 양 방향 세기 비교와 NMS를 통해 수평 방향과 수직 방향으로 나눈 영상 detected edges를 입력으로 하여 Hough transform에 NMS를 적용하여 line detection을 한 결과를 input 창에 그리고, 이미지 프레임 좌표를 기준으로 검출된 직선들에 순서를 매겨 이로부터 교차점의 위치와 순번을 계산하여 input 창에 표시한다.



현재 상태의 문제점: (1) 패턴과 카메라 모두 정지하여 입력 영상(상좌)이 고정된 경우에, DoG 필터링한 결과(중)는 비교적 안정적이지만 수평, 수직 방향 세기 비교와 NMS를 통해 각 방향에 대해 뽑은 edges를 표시한 영상(하)은 프레임이 들어올 때마다 변화가 있다. 그래서 이 두 영상을 입력으로 하여 직선 찾기를 한 결과(상좌 빨간색 선들)와 이로부터 계산한 교차점들의 위치 및 순번(상좌 연두색 동그라미와 하늘색 숫자)도 불안정하다. (2) 또한 패턴과의 거리에 대해 카메라 렌즈의 초점이 맞지 않으면 결과가 좋지 않다.     





3. 교점의 cross ratio 구하기

각 교점에서 수평 방향으로 다음 세 개의 교점, 수직 방향으로 다음 세 개의 교점을 지나는 직선에 대한 cross ratios를 구한다. 

직선 검출에 오차나 오류가 적을 경우, 아래 테스트 결과에서 보듯 입력 영상의 교차점에 대해 실제 패턴의 직선을 1대 1로 즉각적으로 찾는다.



matching 시험 결과 영상 (위: 실제 패턴 / 아래: 입력 영상)




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


posted by maetel
2010. 4. 22. 20:14

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2010. 3. 3. 19:54 Computer Vision
http://www.hitl.washington.edu/artoolkit/

ARToolKit Patternmaker
Automatically create large numbers of target patterns for the ARToolKit, by the University of Utah.


ARToolKit-2.72.tgz 다운로드

http://www.openvrml.org/

DSVideoLib
A DirectShow wrapper supporting concurrent access to framebuffers from multiple threads. Useful for developing applications that require live video input from a variety of capture devices (frame grabbers, IEEE-1394 DV camcorders, USB webcams).


openvrml on macports
http://trac.macports.org/browser/trunk/dports/graphics/openvrml/Portfile


galaxy:~ lym$ port search openvrml
openvrml @0.17.12 (graphics, x11)
    a cross-platform VRML and X3D browser and C++ runtime library
galaxy:~ lym$ port info openvrml
openvrml @0.17.12 (graphics, x11)
Variants:    js_mozilla, mozilla_plugin, no_opengl, no_x11, player, universal,
             xembed

OpenVRML is a free cross-platform runtime for VRML and X3D available under the
GNU Lesser General Public License. The OpenVRML distribution includes libraries
you can use to add VRML/X3D support to an application. On platforms where GTK+
is available, OpenVRML also provides a plug-in to render VRML/X3D worlds in Web
browsers.
Homepage:    http://www.openvrml.org/

Build Dependencies:   pkgconfig
Library Dependencies: boost, libpng, jpeg, fontconfig, mesa, libsdl
Platforms:            darwin
Maintainers:          raphael@ira.uka.de openmaintainer@macports.org
galaxy:~ lym$ port deps openvrml
openvrml has build dependencies on:
    pkgconfig
openvrml has library dependencies on:
    boost
    libpng
    jpeg
    fontconfig
    mesa
    libsdl
galaxy:~ lym$ port variants openvrml
openvrml has the variants:
    js_mozilla: Enable support for JavaScript in the Script node with Mozilla
    no_opengl: Do not build the GL renderer
    xembed: Build the XEmbed control
    player: Build the GNOME openvrml-player
    mozilla_plugin: Build the Mozilla plug-in
    no_x11: Disable support for X11
    universal: Build for multiple architectures


openvrml 설치



ARToolKit-2.72.1 설치 후 테스트

graphicsTest on the bin directory
-> This test confirms that your camera support ARToolKit graphics module with OpenGL.

videoTest on the bin directory
-> This test confirms that your camera supports ARToolKit video module and ARToolKit graphics module.

simpleTest on the bin directory
-> You need to notice that better the format is similar to ARToolKit tracking format, faster is the acquisition (RGB more efficient).


"hiro" 패턴을 쓰지 않으면, 아래와 같은 에러가 난다.

/Users/lym/ARToolKit/build/ARToolKit.build/Development/simpleTest.build/Objects-normal/i386/simpleTest ; exit;
galaxy:~ lym$ /Users/lym/ARToolKit/build/ARToolKit.build/Development/simpleTest.build/Objects-normal/i386/simpleTest ; exit;
Using default video config.
Opening sequence grabber 1 of 1.
vid->milliSecPerFrame: 200 forcing timer period to 100ms
Video cType is raw , size is 320x240.
Image size (x,y) = (320,240)
Camera parameter load error !!
logout


Using default video config.
Opening sequence grabber 1 of 1.
vid->milliSecPerFrame: 200 forcing timer period to 100ms
Video cType is raw , size is 320x240.
Image size (x,y) = (320,240)
*** Camera Parameter ***
--------------------------------------
SIZE = 320, 240
Distortion factor = 159.250000 131.750000 104.800000 1.012757
350.47574 0.00000 158.25000 0.00000
0.00000 363.04709 120.75000 0.00000
0.00000 0.00000 1.00000 0.00000
--------------------------------------
Opening Data File Data/object_data2
About to load 2 Models
Read in No.1
Read in No.2
Objectfile num = 2


arGetTransMat() 안에서 다음과 같이 pattern의 transformation 값을 출력해 보면,
    // http://www.hitl.washington.edu/artoolkit/documentation/tutorialcamera.htm
    printf("camera transformation: %f  %f  %f\n",conv[0][3],conv[1][3],conv[2][3]);

결과:


Feature List     
* A simple framework for creating real-time augmented reality applications    
* A multiplatform library (Windows, Linux, Mac OS X, SGI)    
* Overlays 3D virtual objects on real markers ( based on computer vision algorithm)    
* A multi platform video library with:          
o multiple input sources (USB, Firewire, capture card) supported          
o multiple format (RGB/YUV420P, YUV) supported          
o multiple camera tracking supported          
o GUI initializing interface    
* A fast and cheap 6D marker tracking (real-time planar detection)    
* An extensible markers patterns approach (number of markers fct of efficency)    
* An easy calibration routine    
* A simple graphic library (based on GLUT)    
* A fast rendering based on OpenGL    
* A 3D VRML support    
* A simple and modular API (in C)    
* Other language supported (JAVA, Matlab)    
* A complete set of samples and utilities    
* A good solution for tangible interaction metaphor    
* OpenSource with GPL license for non-commercial usage


framework



"ARToolKit is able to perform this camera tracking in real time, ensuring that the virtual objects always appear overlaid on the tracking markers."

how to
1. 매 비디오 프레임 마다 사각형 모양을 찾기
2. 검은색 사각형에 대한 카메라의 상대적 위치를 계산
3. 그 위치로부터 컴퓨터 그래픽 모델이 어떻게 그려질지를 계산
4. 실제 영상의 마커 위에 모델을 그림

limitations
1. 추적하는 마커가 영상 안에 보일 때에만 가상 물체를 합성할 수 있음
2. 이 때문에 가상 물체들의 크기나 이동이 제한됨
3. 마커의 패턴의 일부가 가려지는 경우 가상 물체를 합성할 수 없음
4. range(거리)의 제한: 마커의 모양이 클수록 멀리 떨어진 패턴까지 감지할 수 있으므로 추적할 수 있는 volume(범위)이 더 커짐
(이때 거리는  pattern complexity (패턴의 복잡도)에 따라 달라짐: 패턴이 단순할수록 한계 거리가 길어짐)
5. 추적 성능이 카메라에 대한 마커의 상대적인 orientation(방향)에 따라 달라짐
: 마커가 많이 기울어 수평에 가까워질수록 보이는 패턴의 부분이 줄어들기 때문에 recognition(인식)이 잘 되지 않음(신뢰도가 떨어짐)
6. 추적 성능이 lighting conditions (조명 상태)에 따라 달라짐
: 조명에 의해 종이 마커 위에 reflection and glare spots (반사)가 생기면 마커의 사각형을 찾기가 어려워짐
: 종이 대신 반사도가 적은 재료를 쓸 수 있음


ARToolKit Vision Algorithm



Development
Initialization    
1. Initialize the video capture and read in the marker pattern files and camera parameters. -> init()
Main Loop    
2. Grab a video input frame. -> arVideoGetImage()
3. Detect the markers and recognized patterns in the video input frame. -> arDetectMarker()
4. Calculate the camera transformation relative to the detected patterns. -> arGetTransMat)
5. Draw the virtual objects on the detected patterns. -> draw()
Shutdown    
6. Close the video capture down. -> cleanup()

ref.
http://king8028.tistory.com/entry/ARToolkit-simpletestc-%EC%84%A4%EB%AA%8512
http://kougaku-navi.net/ARToolKit.html



ARToolKit video configuration



camera calibration

Default camera properties are contained in the camera parameter file camera_para.dat, that is read in each time an application is started.

The program calib_dist is used to measure the image center point and lens distortion, while calib_param produces the other camera properties. (Both of these programs can be found in the bin directory and their source is in the utils/calib_dist and utils/calib_cparam directories.)



ARToolKit gives the position of the marker in the camera coordinate system, and uses OpenGL matrix system for the position of the virtual object.


ARToolKit API Documentation
http://artoolkit.sourceforge.net/apidoc/


ARMarkerInfo Main structure for detected marker
ARMarkerInfo2 Internal structure use for marker detection
ARMat Matrix structure
ARMultiEachMarkerInfoT Multi-marker structure
ARMultiMarkerInfoT Global multi-marker structure
ARParam Camera intrinsic parameters
arPrevInfo Structure for temporal continuity of tracking
ARVec Vector structure


arVideoGetImage()

video.h
/**
 * \brief get the video image.
 *
 * This function returns a buffer with a captured video image.
 * The returned data consists of a tightly-packed array of
 * pixels, beginning with the first component of the leftmost
 * pixel of the topmost row, and continuing with the remaining
 * components of that pixel, followed by the remaining pixels
 * in the topmost row, followed by the leftmost pixel of the
 * second row, and so on.
 * The arrangement of components of the pixels in the buffer is
 * determined by the configuration string passed in to the driver
 * at the time the video stream was opened. If no pixel format
 * was specified in the configuration string, then an operating-
 * system dependent default, defined in <AR/config.h> is used.
 * The memory occupied by the pixel data is owned by the video
 * driver and should not be freed by your program.
 * The pixels in the buffer remain valid until the next call to
 * arVideoCapNext, or the next call to arVideoGetImage which
 * returns a non-NULL pointer, or any call to arVideoCapStop or
 * arVideoClose.
 * \return A pointer to the pixel data of the captured video frame,
 * or NULL if no new pixel data was available at the time of calling.
 */
AR_DLL_API  ARUint8*        arVideoGetImage(void);


ARParam

param.h
/** \struct ARParam
* \brief camera intrinsic parameters.
*
* This structure contains the main parameters for
* the intrinsic parameters of the camera
* representation. The camera used is a pinhole
* camera with standard parameters. User should
* consult a computer vision reference for more
* information. (e.g. Three-Dimensional Computer Vision
* (Artificial Intelligence) by Olivier Faugeras).
* \param xsize length of the image (in pixels).
* \param ysize height of the image (in pixels).
* \param mat perspective matrix (K).
* \param dist_factor radial distortions factor
*          dist_factor[0]=x center of distortion
*          dist_factor[1]=y center of distortion
*          dist_factor[2]=distortion factor
*          dist_factor[3]=scale factor
*/
typedef struct {
    int      xsize, ysize;
    double   mat[3][4];
    double   dist_factor[4];
} ARParam;

typedef struct {
    int      xsize, ysize;
    double   matL[3][4];
    double   matR[3][4];
    double   matL2R[3][4];
    double   dist_factorL[4];
    double   dist_factorR[4];
} ARSParam;




arDetectMarker()

ar.h 헤더 파일의 설명:
/**
* \brief main function to detect the square markers in the video input frame.
*
* This function proceeds to thresholding, labeling, contour extraction and line corner estimation
* (and maintains an history).
* It's one of the main function of the detection routine with arGetTransMat.
* \param dataPtr a pointer to the color image which is to be searched for square markers.
*                The pixel format depend of your architecture. Generally ABGR, but the images
*                are treated as a gray scale, so the order of BGR components does not matter.
*                However the ordering of the alpha comp, A, is important.
* \param thresh  specifies the threshold value (between 0-255) to be used to convert
*                the input image into a binary image.
* \param marker_info a pointer to an array of ARMarkerInfo structures returned
*                    which contain all the information about the detected squares in the image
* \param marker_num the number of detected markers in the image.
* \return 0 when the function completes normally, -1 otherwise
*/
int arDetectMarker( ARUint8 *dataPtr, int thresh,
                    ARMarkerInfo **marker_info, int *marker_num );


You need to notice that arGetTransMat give the position of the marker in the camera coordinate system (not the reverse). If you want the position of the camera in the marker coordinate system you need to inverse this transformation (arMatrixInverse()).



XXXBK: not be sure of this function: this function must just convert 3x4 matrix to classical perspective openGL matrix. But in the code, you used arParamDecompMat that seem decomposed K and R,t, aren't it ? why do this decomposition since we want just intrinsic parameters ? and if not what is arDecomp ?




double arGetTransMat()

ar.h 헤더 파일의 설명:
/**
* \brief compute camera position in function of detected markers.
*
* calculate the transformation between a detected marker and the real camera,
* i.e. the position and orientation of the camera relative to the tracking mark.
* \param marker_info the structure containing the parameters for the marker for
*                    which the camera position and orientation is to be found relative to.
*                    This structure is found using arDetectMarker.
* \param center the physical center of the marker. arGetTransMat assumes that the marker
*              is in x-y plane, and z axis is pointing downwards from marker plane.
*              So vertex positions can be represented in 2D coordinates by ignoring the
*              z axis information. The marker vertices are specified in order of clockwise.
* \param width the size of the marker (in mm).
* \param conv the transformation matrix from the marker coordinates to camera coordinate frame,
*             that is the relative position of real camera to the real marker
* \return always 0.
*/
double arGetTransMat( ARMarkerInfo *marker_info,
                      double center[2], double width, double conv[3][4] )



arUtilMatInv()

ar.h 헤더 파일의 설명:
/**
* \brief Inverse a non-square matrix.
*
* Inverse a matrix in a non homogeneous format. The matrix
* need to be euclidian.
* \param s matrix input   
* \param d resulted inverse matrix.
* \return 0 if the inversion success, -1 otherwise
* \remark input matrix can be also output matrix
*/
int    arUtilMatInv( double s[3][4], double d[3][4] );






posted by maetel
2010. 3. 2. 20:31 Computer Vision
Tricodes: A Barcode-Like Fiducial Design for Augmented Reality Media - 2006
Jonathan Mooser, Suya You, Ulrich Neumann
International Conference on Multimedia Computing and Systems/International Conference on Multimedia and Expo - ICME(ICMCS)

posted by maetel
2010. 3. 2. 20:26 Computer Vision
Design Patterns for Augmented Reality Systems - 2004
Asa Macwilliams, Thomas Reicher, Gudrun Klinker, Bernd Brügge
Conference: Workshop on Exploring the Design and Engineering of Mixed Reality Systems - MIXER


Figure 2: Relationships between the individual patterns for augmented reality systems. Several approaches are used in combination within an augmented reality system. One approach might require the use of another approach or prevent its usage.


posted by maetel
2010. 2. 26. 01:11 Computer Vision
cross ratio test


Try #1. pi 값 이용

pi = 3.14159265358979323846264338327950288...
pi 값을 이용하여 cross ratio를 구해 보면, 다음과 같이 나온다.



cross ratio = 1.088889
cross ratio = 2.153846
cross ratio = 1.185185
cross ratio = 1.094737
cross ratio = 2.166667
cross ratio = 1.160714
cross ratio = 1.274510
cross ratio = 1.562500
cross ratio = 1.315789
cross ratio = 1.266667
cross ratio = 1.266667
cross ratio = 1.446429
cross ratio = 1.145455
cross ratio = 1.441176
cross ratio = 1.484848
cross ratio = 1.421875
cross ratio = 1.123457
cross ratio = 1.600000
cross ratio = 1.142857
cross ratio = 1.960784
cross ratio = 1.142857
cross ratio = 1.350000
cross ratio = 1.384615
cross ratio = 1.529412
cross ratio = 1.104575
cross ratio = 1.421875
cross ratio = 1.711111
cross ratio = 1.178571
cross ratio = 1.200000
cross ratio = 1.098039
cross ratio = 2.800000
cross ratio = 1.230769
cross ratio = 1.142857


다른 식 적용

cross ratio = 0.040000
cross ratio = 0.666667
cross ratio = 0.107143
cross ratio = 0.064935
cross ratio = 0.613636
cross ratio = 0.113636
cross ratio = 0.204545
cross ratio = 0.390625
cross ratio = 0.230769
cross ratio = 0.203620
cross ratio = 0.205882
cross ratio = 0.316406
cross ratio = 0.109375
cross ratio = 0.300000
cross ratio = 0.360000
cross ratio = 0.290909
cross ratio = 0.090909
cross ratio = 0.400000
cross ratio = 0.100000
cross ratio = 0.562500
cross ratio = 0.100000
cross ratio = 0.257143
cross ratio = 0.285714
cross ratio = 0.363636
cross ratio = 0.074380
cross ratio = 0.290909
cross ratio = 0.466667
cross ratio = 0.125000
cross ratio = 0.156250




Try #2. swPark_2000rti: 43p: figure 7의 cross ratio 값들로 패턴의 그리드 (격자 위치)를 역추산
 
40개의 수직선에 대한 37개의 cross ratio :
0.47, 0.11, 0.32, 0.17, 0.44, 0.08, 0.42, 0.25, 0.24, 0.13, 0.46, 0.18, 0.19, 0.29, 0.21, 0.37, 0.16, 0.38, 0.23, 0.09, 0.37, 0.26, 0.31, 0.18, 0.30, 0.15, 0.39, 0.16, 0.32, 0.27, 0.20, 0.28, 0.39, 0.12, 0.23, 0.28, 0.35
20개의 수평선에 대한 17개의 cross ratio :
0.42, 0.13, 0.32, 0.16, 0.49, 0.08, 0.40, 0.20, 0.29, 0.19, 0.37, 0.13, 0.26, 0.38, 0.21, 0.16, 0.42




뭥미?????

# of cross-ratios in vertical lines = 37
# of cross-ratios in horizontal lines = 17

x[0]=1  x[1]=2  x[2]=4
x[3]=-2.87805  x[4]=-1.42308  x[5]=-0.932099  x[6]=-0.787617  x[7]=-0.596499  x[8]=-0.55288  x[9]=-0.506403  x[10]=-0.456778  x[11]=-0.407892  x[12]=-0.390887  x[13]=-0.363143  x[14]=-0.338174  x[15]=-0.324067  x[16]=-0.312345  x[17]=-0.305022  x[18]=-0.293986  x[19]=-0.286594  x[20]=-0.273759  x[21]=-0.251966  x[22]=-0.244977  x[23]=-0.238299  x[24]=-0.231391  x[25]=-0.219595  x[26]=-0.20838  x[27]=-0.192558  x[28]=-0.183594  x[29]=-0.16952  x[30]=-0.159689  x[31]=-0.147983  x[32]=-0.131036  x[33]=-0.114782  x[34]=-0.0950305  x[35]=0.0303307  x[36]=0.964201  x[37]=-0.959599  x[38]=-0.519287  x[39]=-0.356521 


posted by maetel
2010. 2. 26. 00:07 Computer Vision
Optimal Grid Pattern for Automated Camera Calibration Using Cross Ratio

Chikara MATSUNAGA  Yasushi KANAZAWA  Kenichi KANATANI 

Publication IEICE TRANSACTIONS on Fundamentals of Electronics, Communications and Computer Sciences  Vol.E83-A  No.10  pp.1921-1928
Publication Date: 2000/10/20
Online ISSN: 
Print ISSN: 0916-8508
Type of Manuscript: Special Section PAPER (Special Section on Information Theory and Its Applications)
Category: Image Processing
Keyword: cross ratioMarkov processerror analysisreliability evaluationvirtual studio
Full Text:
출처:  http://www.suri.it.okayama-u.ac.jp/~kanatani/data/ejournal.html

MVA2000 IAPR Workshop on Machine Vision Applications, Nov. 28-30,2000, The University of Tokyo, Japan
13-28
Optimal Grid Pattern for Automated Matching Using Cross Ratio
Chikara Matsunaga (Broadcast Division, FOR-A Co. Ltd.)
Kenichi Kanatanit (Department of Computer Science, Gunma University)


Kenichi Kanatani  金谷健一   http://www.suri.it.okayama-u.ac.jp/%7Ekanatani/
Yasushi Kanazawa 金澤靖     http://www.img.tutkie.tut.ac.jp/~kanazawa/

IEICE (
The Institute of Electronics Information and Communication Engineers)   http://www.ieice.org
IAPR (International Association of Pattern Recognition)   http://www.iapr.org
IAPR - Machine Vision & Applications



Summary: 
With a view to virtual studio applications, we design an optimal grid pattern such that the observed image of a small portion of it can be matched to its corresponding position in the pattern easily. The grid shape is so determined that the cross ratio of adjacent intervals is different everywhere. The cross ratios are generated by an optimal Markov process that maximizes the accuracy of matching. We test our camera calibration system using the resulting grid pattern in a realistic setting and show that the performance is greatly improved by applying techniques derived from the designed properties of the pattern.


Camera calibration is a first step in all vision and media applications.
> pre-calibration (Tsai) vs. self-calibration (Pollefeys)
=> "simultaneous calibration" by placing an easily distinguishable planar pattern in the scene

Introducing a statistic model of image noise, we generate the grid intervals by an optimal Markov process that maximizes the accuracy of matching.
: The pattern is theoretically designed by statistical analysis

If the cross rations are given, the sequence is determined as follows.


To find a sequence of cross ratios such that the sequence of numbers is a homogeneous increasing with the average interval being 1 and the minimum width as specified.
=> To generate the sequence of cross ratios stochastically, according to a probability distribution defined in such a way that the resulting sequence of numbers has the desired properties
=> able to optimize the probability distribution so that the matching performance is maximized by analyzing the statistical properties of image noise

 



 

출처: C. Matsunaga, Y. Kanazawa, and K. Kanatani, Optimal grid pattern for automated camera calibration using cross ratio , IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, Vol. E83-A, No. 10, pp. 1921--1928, 2000. 중 1926쪽 Fig.8 4배 확대 캡처





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

"Design Patterns for Augmented Reality Systems"  (0) 2010.03.02
virtual studio 구현: cross ratio test  (0) 2010.02.26
virtual studio 구현: workflow  (0) 2010.02.23
chroma keying  (0) 2010.02.22
3차원 인터페이스 시장조사  (1) 2010.02.22
posted by maetel
2010. 2. 19. 16:40 Computer Vision
[소특집:이미지 인식 및 Understanding 기술] 증강현실의 기술과 동향        
서용덕 · 김종성 · 홍기상 (포항공과대학교 전기전자공학과 영상처리연구실)
대한전자공학회, 전자공학회지 제29권 제7호, 2002. 7, pp. 110 ~ 120 (11pages)



camera self-calibration 카메라 자동 보정
: 어떤 물체의 삼차원 VRML 모델을 여러 장의 영상에서 얻고자 하는 경우 그 영상들을 얻는 데 사용된 카메라에 대한 위치, 방향, 초점거리 등의 정보를 구하는 과정

projective geometric method 투영기하방법


1. 삼차원 모델 복원을 통한 증강 현실

SFM = structure from motion
: 카메라 파라미터와 영상열 (image sequence) 각 프레임의 카메라간의 상대적인 위치를 계산하고, 이러한 정보를 이용하여 영상열에 보이는 물체의 대략적인 3차원 구조를 계산

trilinearity
: 임의의 3차원 구조를 보고 있는 세 개의 투시뷰 (perspective view) 사이의 대수학적 연결 관계

trifocal tensor
: trilinearity를 수학적으로 모델링한 것
(영상에서 특징점과 직선을 정합하고, 투영 카메라를 계산하며, 투영 구조를 복원하는 데 이용됨)
(기존 epipolar geometry를 이용한 방법보다 더 정확한 결과를 얻을 수 있는 것으로 알려짐)



SFM 시스템의 핵심 기술을 영상열에서 정확하게 카메라를 계산하는 것이다.

1) projective reconstruction 투영 기하 복원
영상열에서 추출되는 특징점과 특징선들을 정확하게 연결하여 영상열에서 관찰되는 2차원 특징들과 우리가 복원하여 모델을 만들고자 하는 3차원 구조와의 초기 관계를 (실제 영상을 획득한 카메라의 파라미터들과 카메라간의 상대적인 파악함으로써) 계산



Trifocal tensor의 계산은 아주 정밀한 값을 요구하므로 잘못된 특징점이나 특징선의 연결이 들어가서는 안 된다. 이러한 잘못된 연결 (Outlier)를 제거하는 방법으로 LMedS (Least Median Square)나 RANSAC (Random Sampling Consensus) 기법이 사용된다.

세 개의 뷰 단위로 연속된 영상열에서 계속적으로 계산된 trifocal tensor들과 특징점과 특징선들은 임의의 기준 좌표계를 중심으로 정렬하는 다중 뷰 정렬 (Multi-view Registration) 처리를 통하여 통합된다. 이렇게 통합된 값들은 투영 통합 최적화 (Projective Bundle Adjustment)를 거쳐 투영 기하 아래에서 발생한 에러를 최소화한다.


2) camera auto-calibration 카메라 자동 보정
투영 기하 정보를 유클리드 기하 정보로 변환하기 위해서 필요한 것으로, 2차원 영상 정보의 기하학적인 특징을 이용하여 투영 기하에서 유클리드 기하로 3차원 구조를 변환하는 동시에 실세계에서의 카메라 변수(초점 거리, 카메라 중심, 축 비율, 비틀림 상수)와 카메라 간의 상대적인 위치를 정확하게 계산




카메라 자동 보정의 방법론에서는 카메라 보정을 위한 패턴을 따로 디자인하여 사용하지 않는다. 이 경우 실시간 계산의 기능은 없어지게 된다.


3) (유클리드) 구조 복원
모델의 3차원 기하 정보를 구함
: 자동 보정 단계를 통하여 복원된 3차원 정보를 그래픽 모델로 만들기 위해서 먼저 3차원 데이터를 데이터 삼각법 (Triangulation)을 이용하여 다각형 메쉬 모델 (Polygonal mesh model)로 만든 후에, 텍스처 삽입을 통해서 모델의 현실성을 증가시킴


2. 카메라 보정에 의한 증강 현실

1) 보정 패턴에 고정된 좌표계(W)와 카메라 좌표계(C) 그리고 그래픽을 위한 좌표계(G) 사이의 관계를 미리 설정해 둠

2) 카메라와 보정 패턴 사이의 상대적인 좌표변환 관계는 영상처리를 통하여 매 프레임마다 계산을 통해 얻음

3) (그래픽 좌표계와 보정 패턴 좌표계는 미리 결정되어 있어서 컴퓨터 그래픽에 의해 합성될 가상물체들의 상대적인 위치가 카메라 보정 단계 이전에 이미 알려져 있는 것이므로,) 카메라로부터 얻은 영상을 분석하여 보정 패턴을 인식하고 고정 패턴의 삼차원 좌표와 그 좌표의 영상 위치를 알아낸 후 그 둘 사이의 관계를 이용하여 카메라 보정값을 얻음

cross ratio 비조화비

4) trifocal tensor를 계산하여 카메라의 초기 정보를 계산하여 초기 영상복원을 구함

5) 영상열의 각 영상에 대해서 이전 시점의 영상 사이의 정합점들을 영상 정합 (image based matching: normalized cross correlation (NCC)를 이용하는) 방법을 통해 구함

6) RANSAC 알고리듬을 기초로 새로운 영상에 대한 카메라 행렬을 구하고, 새롭게 나타난 정합점들에 대해서 삼차원 좌표를 구함 (잘못 얻어진 정합점들을 제거하는 과정을 포함)

7) Euclidean Reconstruction: 투영 기하 공간에서 정의된 값들을 유클리드 공간에서 정의되는 값으로 변환


카메라 자동 보정 및 투영기하공간에서의 계산식들은 모두 비선형 방정식으로 되어 있기 때문에 최소자승 오차법 (Least square error method)으로 구해지는 값들이 원래 방정식을 제대로 따르지 못하는 경우가 많이 생긴다. 따라서 비선형 최적화 과정이 항상 필요하며 유클리드 공간으로의 변환과정의 최종 단계에서 그리고 투영기하공간에서 복원값들 구할 때 최적화 과정을 적절히 배치할 필요가 있다.










 

posted by maetel
2009. 9. 16. 22:04 Computer Vision
Denis Chekhlov, Andrew Gee, Andrew Calway, Walterio Mayol-Cuevas
Ninja on a Plane: Automatic Discovery of Physical Planes for Augmented Reality Using Visual SLAM
http://dx.doi.org/10.1109/ISMAR.2007.4538840

demo: Ninja on A Plane: Discovering Planes in SLAM for AR

http://www.cs.bris.ac.uk/Publications/pub_master.jsp?id=2000745
posted by maetel
2009. 9. 2. 17:51 Computer Vision
전자통신동향분석 22권 4호 (통권 106호) (발행일 : 2007.08)
모바일 혼합현실 기술 (Mobile Mixed Reality Technology)

저     자: 김기홍, 김홍기, 정혁, 김종성, 손욱호 / 가상현실연구팀
발행일자: 2007.08.15
발행권호: 22권 4호 (통권 106)
페 이 지: 96
논문구분: 융합 시대를 주도할 디지털콘텐츠 기술 특집 논문

초     록
혼합현실 기술을 휴대가 용이한 모바일 기기상에서 효과적으로 구현하기 위해서는 기기에 부착된 카메라의 위치를 인식하는 기술을 시작으로 입력된 실세계 공간에 가상의 디지털 정보를 정합하고 표현하는 기술, 사용자가 표현된 혼합현실 환경과 현실감있게 상호작용하는 기술, 그리고 다양한 응용분야에 맞게 혼합현실 콘텐츠를 저작하는 기술에 이르기까지 여러 가지 세부 기술들이 요구된다. 본 논문에서는 언급한 세부 기술들에 대한 개요와 국내외적으로 진행되고 있는 관련 기술들의 동향을 구체적인 사례를 통해 소개한다.
 
 
ARToolKit (Augmented Reality Tool Kit)
http://www.hitl.washington.edu/artoolkit/
software library for building Augmented Reality (AR) applications

MR-Platform

MxToolKit

ARTag
http://www.artag.net/

OSGART
http://www.osgart.org/
http://www.artoolworks.com/community/osgart/
C++ cross-platform development library that simplifies the development of Augmented Reality or Mixed Reality applications by combining computer vision based tracking libraries (e.g. ARToolKit, ARToolKitPlus, SSTT and BazAR) with the 3D scene graph libary OpenSceneGraph

AMIRE
http://www.amire.net/
http://sourceforge.net/projects/amire/
project about the efficient creation and modification of augmented reality (AR) and mixed reality (MR) applications

APRIL (Augmented Presentation and Interaction Authoring Language)
http://studierstube.icg.tu-graz.ac.at/april/
http://www.icg.tugraz.at/pub/APRIL
high-level descriptive language for authoring presentations in augmented reality (AR)

DART (The Designer's Augmented Reality Toolkit)
http://www.cc.gatech.edu/dart/
a set of software tools that support rapid design and implementation of augmented reality experiences and applications

ULTRA (Ultra portable augmented reality for industrial maintenance applications)
http://www.ist-ultra.org/


Authoring Tool

CMIL++




posted by maetel
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. 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. 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