Marker Detection using ARToolkitPlus and OpenCV

Posted 2010/02/09 16:35 by nosanr


Notes: ARToolkitPlus for OpenCV
1. Complie ARToolKitPlus with g++-4.1 unless it succeeds

2. Pattern
 PATTERN_IMAGE_WIDTH is the number of columns of a pattern. A marker  consists of a border and patterns inside of the border.
So, marker of simple-id consists of 6x6 patterns. Widths of borders are 0.25 and 0.125.
 You can print a pattern found under id-markers directory by enlarging it with some tools; ALSEE for my case.

3. Simple-id stores 9bits number. so it can represent 0-511. 2^9=512.

4. ARTKP supports three formats: RGBA (32 bits), RGB (16bits), Gray (8bits)
ARTKPsupports three detection methods: template matching, Simple-ID and BCHencoding. But it seems to support only ID based methods.

5. bpp in the source code represents depth. So 1 for grayscale input, 3 for RGB input.

6. Markers are already stored in memory when a program starts. A marker is not searched in real-time.

7. Border width is very important. Use the right width for the certain image.
    For thin simple ID or BCH encoding, use 0.125.
    For standard simple ID, use 0.25

8. Use OpenCV to capture images and use ARToolkitPlus functions
    IplImage* image= cvCreateImage( imgSize, IPL_DEPTH_8U, 3 );
    IplImage* grayImage= cvCreateImage( imgSize, IPL_DEPTH_8U, 1 );
    tracker->setPixelFormat(ARToolKitPlus::PIXEL_FORMAT_LUM);  // gray input
    cvCvtColor( image, grayImage, CV_RGB2GRAY );
    ARToolKitPlus::ARMarkerInfo* marker_info;
    int numMarkers= 0;
  int markerId = tracker->calc( arImage, -1, true, &marker_info, &numMarkers );

Source code (not documented)
marker.tar.gz

Tag : ARToolkitPlus, Marker, opencv, Pattern

Installation of ARToolkitPlus

Posted 2010/02/05 17:49 by nosanr
Extract ARToolkitPlus under not ARToolKitPlus but ARToolkitPlus.
In some Makefiles, the include path is set to ARToolkitPlus.

Use g++-4.1 to build.

$ make CXX=g++-4.1
$ make CXX=g++-4.1 install

To test, move to the following directory
ARToolkitPlus/sample/simple$
and run
$ ../../../bin/simple

This is because the 'simple' test access data/ directory as a relative access.

Marker Detection using ARToolkit on OpenCV

Posted 2010/02/04 17:21 by nosanr

Very simple code combining OpenCV and ARToolkit.
Custom marker (25mm).
Camera is not calibrated.
The key point to combine both libraries is to convert OpenCV image data to AR data as follows:

    ARUint8* arImage;
    arImage = (ARUint8 *)cvPtr2D( image, 0, 0 );

Source code is attached.
This code is for obtaining the pose of the marker.
The test was done on Ubuntu 9.10 with USB web camera.
ARMarker.cpp

Stereo Vision Source Code using OpenCV

Posted 2010/01/15 09:24 by nosanr
This is undocumented source code for stereo vision using OpenCV.
I post this code since someone might have interest in the basic implementation of stereo vision using OpenCV.

Please note that in the code, Flea cameras, a product of Point Grey Research are used for stereo vision. And, it might have problems.
In the attached file, visualodmetry files are included to show how to set camera parameters from a file. The visual odometry codes are implemented using the code of Willow Garage. And it is not working well yet.






Tag : opencv, Stereo Vision

Photos with my fiancée

Posted 2010/01/11 20:48 by nosanr

« PREV : 1 : 2 : 3 : 4 : 5 : ... 48 : NEXT »