SLARToolkit uses simple black square markers to calculate the camera position and orientation in real time.


SLARToolkit ships with three markers: the SLAR, L and Hiro marker. The PDFs and the pat files that are used by the Toolkit are included in the CommonData folder.
A marker PDF should be printed non-scaled at the original size (80 x 80 mm) and centered for a small white border. As an alternative it's also possible to open a marker file on a mobile device and to use the device's screen as marker. But for the best results the marker should be printed and glued on a piece of cardboard to avoid warping. It is also important that the camera is set up properly and the scene is illuminated well without hard shadows. A darker lightning is often better than too bright or back light.
A good print and soft lighting are the keys.

Custom markers

It is also possible to use custom markers with SLARToolkit. The easiest way is to use two online tools for the marker generation:
  1. Use the The ARToolkit Marker Maker to create a PDF with an ARToolkit 2.X marker from an image. The default size of 80 mm is appropriate.
  2. Convert the created PDF to a JPG, PNG or GIF. You can use the nice online converter tool from Neevia.
  3. The ARToolKit Marker Generator generates the pat file that SLARToolkit uses. The ARToolkit Marker Maker generates markers where 50% of the size is the actual pattern. 16 x 16 segments should be sufficient for most scenarios. The FLARToolkit documentation has an excellent tutorial about the ARToolKit Marker Generator.
  4. The generated pat file is then used to initialize a SLARToolkit marker. The physical marker size / width (80 mm) and the number of segments (16 x 16) are passed as parameters:
var markerStream = App.GetResourceStream(new Uri("SLARToolKitSample;component/data/Marker_SLAR_16x16segments_80width.pat", UriKind.Relative)).Stream;
var marker = Marker.Load(markerStream, 16, 16, 80.0);

// or even simpler when the Marker is built in the assembly as Resource:
var marker = Marker.LoadFromResource("data/Marker_SLAR_16x16segments_80width.pat", 16, 16, 80.0);

Last edited May 16, 2010 at 8:14 AM by teichgraf, version 23


reed665 Jan 21 at 2:09 PM 
I have a problem creating custom marker. Dont know how to create the .pat file from .pdf. Swf app dont work with images at all. Can anybody help me?

Akuthakur Aug 12, 2012 at 4:21 PM 
the pat file is generating an error :
"Only 32 Bit ARGB pixel format is supported, not Format32bppArgb."
can u help with it?

martinhellstrom Oct 29, 2010 at 11:12 AM 
I just wanna tell u that the page you have a link to ( is for sale and dont have the info I assume u want it to show :)