artkp

Description

TODO Fluxus ARToolKitPlus module.

(ar-init width-number height-number filename-string [marker-mode-symbol])

Returns void

Initializes the AR single marker tracker with the camera resolution and camera parameter file. The forth optional paremeter sets the type of markers to be detected. The marker mode can be 'template, 'id or 'bch. Template markers are the classic marker type used in ARToolKit. Id-based markers directly encode the marker id in the image. Simple markers use 3-times redundancy to increase robustness, while BCH markers use an advanced CRC algorithm to detect and repair marker damages. The default mode is 'id.

Example

 (define cam (camera-init 0 320 240))
 (ar-init (camera-width cam) (camera-height cam) "data/camera-para.dat")

(ar-set-threshold threshold-number)

Returns void

Sets the threshold value that is used for black/white conversion.

Example

 (ar-set-threshold 150)

(ar-get-threshold)

Returns threshold-number

Returns the current threshold value.

Example

 (ar-get-threshold)

(ar-auto-threshold activate-bool)

Returns void

Enables or disables automatic threshold calculation.

Example

 (ar-auto-threshold #t)

(ar-set-pattern-width width-number)

Returns void

Example

 (ar-set-pattern-width 40)

(ar-activate-vignetting-compensation activate-bool)

Returns void

Activates the compensation of brightness falloff in the corners of the camera image.

Example

 (ar-activate-vignetting-compensation #t)

(ar-detect buffer-imgptr)

Returns number

Detects the markers in the image. Returns the number of detected markers.

Example

 TODO

(ar-get-projection-matrix)

Returns projection-matrix-vector

Returns the projection matrix acquired from the camera parameter file.

Example

 (set-projection-transform (ar-get-projection-matrix))
 (set-camera-transform (mident))

(ar-get-modelview-matrix index-number)

Returns modelview-matrix-vector

Returns the modelview matrix of the marker with the given index or #f if no marker is detected. The number of detected markers are returned by (ar-detect). The index can go from 0 to the number of detected markers - 1.

Example

 (let ([marker-count (ar-detect (camera-imgptr cam))])
   (for ([i (in-range marker-count)])
		(let ([m (ar-get-modelview-matrix i)]
			  [id (ar-get-marker-id)])
		   (printf "marker index:~a id:~a matrix:~a~n" i id m))))

(ar-get-id index-number)

Returns marker-id-number

Returns the ID of the marker with the given index or #f if the id could not be determined. The number of detected markers are returned by (ar-detect). The index can go from 0 to the number of detected markers - 1.

Example

 (let ([marker-count (ar-detect (camera-imgptr cam))])
   (for ([i (in-range marker-count)])
		(let ([m (ar-get-modelview-matrix i)]
			  [id (ar-get-id i)])
		   (printf "marker index:~a id:~a matrix:~a~n" i id m))))

(ar-get-confidence index-number)

Returns confidence-number

Returns the confidence value of the marker with the given index. The number of detected markers are returned by (ar-detect). The index can go from 0 to the number of detected markers - 1.

Example

 (let ([marker-count (ar-detect (camera-imgptr cam))])
   (for ([i (in-range marker-count)])
		(let ([conf (ar-get-confidence i)])
		   (printf "marker index:~a confidence:~a matrix:~a~n" i id m))))

(ar-load-pattern filename-string)

Returns id-number

Adds a pattern to the tracker, returns the pattern id.

Example

 (define hiro (ar-load-pattern "hiro.patt"))