Difference between revisions of "Tutorial Fiducials"

From BoofCV
Jump to navigationJump to search
(Created page with "<center> <gallery caption="Supported Fiducials" heights=200 widths=200 > Image:Fiducial_squre_binary.png| Square Binary Image:Example_Image_segmentation_Lines.jpg|Region borde...")
 
m
Line 2: Line 2:
<gallery caption="Supported Fiducials" heights=200 widths=200 >
<gallery caption="Supported Fiducials" heights=200 widths=200 >
Image:Fiducial_squre_binary.png| Square Binary
Image:Fiducial_squre_binary.png| Square Binary
Image:Example_Image_segmentation_Lines.jpg|Region borders highlighted in red.
Image:Fiducial_square_image.png| Square Image
Image:Example_Image_Segmentation_Color.jpg|Regions are assigned their average color.
Image:Example_Image_Segmentation_Color.jpg|Regions are assigned their average color.
</gallery>
</gallery>
Line 8: Line 8:




In computer vision, a fiducial marker is a known object from which can be identified and its pose estimated.  BoofCV provides built in support several different fiducials which can be easily printed.  Applications are provided for automatically creating postscript files for the printer and a high level interface for detecting, identifying and pose estimation.  In the sections below a tutorial is provided for creating and detecting each type of fiducial.
In computer vision, a fiducial marker is a known object from which can be identified and its pose estimated.  BoofCV provides built in support several different fiducials which can be easily printed.  Applications are provided for automatically creating postscript files for the printer and a high level interface for detecting, identifying and pose estimation.   
 
Square binary and square image are fiducials which encode a pattern insude a black square box.  These targets can be uniquely identified and provide a pose estimate.  This is essentialy the same way ARToolkit works, which was the inspiration for these fiducials.  However, an ARToolkit fiducial and BoofCV fiducial might not be compatible even if they look similar due to the square widths being different.
 
Calibration targets fiducials are just calibration targets.  They tend to provide very accurate pose estimation when close to the camera, but can have difficulty as they move away.  There are two significant disadvantage for calibration targets. 1) They don't provide a unique ID.  2) Most patterns are not fully orientation invariant.  You can see the lack of rotation invariance when it suddenly flips 180 degrees.


== Square Binary ==
== Square Binary ==
Line 17: Line 21:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
gradle fiducialBinary -Pwidth=10 -Pnumber=325
gradle fiducialBinary -Pwidth=10 -Pnumber=325
:applications:classes UP-TO-DATE
:applications:fiducialBinary
Target width 10.0 (cm)  number = 325
101000101000
BUILD SUCCESSFUL
</syntaxhighlight>
</syntaxhighlight>
This will create a pattern which is 10cm wide and encodes the number 325.  The output will be saved in "boofcv/applications/pattern.eps" file.  See the top figure the resulting pattern.
This will create a pattern which is 10cm wide and encodes the number 325.  The output will be saved in "boofcv/applications/pattern.eps" file.  See the top figure the resulting pattern.
Line 26: Line 37:


== Square Image ==
== Square Image ==
<syntaxhighlight lang="bash">
gradle fiducialImage -Pwidth=10.0 -Pimage="../data/applet/fiducial/image/dog.png"
:applications:classes UP-TO-DATE
:applications:fiducialImage
Target width 10.0 (cm)  image = dog.png
BUILD SUCCESSFUL
</syntaxhighlight>
This will create a pattern which is 10cm wide and encodes the image contained in 'dog.png'.  The output will be saved in "boofcv/applications/fiducial_image.eps" file.  See the top figure the resulting pattern.


== Calibration Target ==
== Calibration Target ==

Revision as of 10:42, 3 September 2014


In computer vision, a fiducial marker is a known object from which can be identified and its pose estimated. BoofCV provides built in support several different fiducials which can be easily printed. Applications are provided for automatically creating postscript files for the printer and a high level interface for detecting, identifying and pose estimation.

Square binary and square image are fiducials which encode a pattern insude a black square box. These targets can be uniquely identified and provide a pose estimate. This is essentialy the same way ARToolkit works, which was the inspiration for these fiducials. However, an ARToolkit fiducial and BoofCV fiducial might not be compatible even if they look similar due to the square widths being different.

Calibration targets fiducials are just calibration targets. They tend to provide very accurate pose estimation when close to the camera, but can have difficulty as they move away. There are two significant disadvantage for calibration targets. 1) They don't provide a unique ID. 2) Most patterns are not fully orientation invariant. You can see the lack of rotation invariance when it suddenly flips 180 degrees.

Square Binary

The square binary fiducial encodes a 12-bit number, 4096 possible values, using a binary pattern. The number is encoded by breaking up the inner portion into 16 squares in a 4x4 grid. Three of the corners are always white and one black. This is how it resolves an orientation ambiguity.

A new fiducial can be created using the DetectFiducialSquareBinary application. For easy of use a Gradle script has been provided:

gradle fiducialBinary -Pwidth=10 -Pnumber=325

:applications:classes UP-TO-DATE
:applications:fiducialBinary
Target width 10.0 (cm)  number = 325
101000101000

BUILD SUCCESSFUL

This will create a pattern which is 10cm wide and encodes the number 325. The output will be saved in "boofcv/applications/pattern.eps" file. See the top figure the resulting pattern.

Detection is easy enough using the high level Fiducial interface. See the example below for the details.

Binary Detection Example


Square Image

gradle fiducialImage -Pwidth=10.0 -Pimage="../data/applet/fiducial/image/dog.png"

:applications:classes UP-TO-DATE
:applications:fiducialImage
Target width 10.0 (cm)  image = dog.png

BUILD SUCCESSFUL

This will create a pattern which is 10cm wide and encodes the image contained in 'dog.png'. The output will be saved in "boofcv/applications/fiducial_image.eps" file. See the top figure the resulting pattern.

Calibration Target