The aim of SLARToolkit is to make Augmented Reality with Silverlight as easy as possible so that everyone will be able to make Silverlight Augmented Reality applications. Therefore the SLARToolkit release not only includes the full Balder sample you might know from this blog post, it also comes with a brand new sample that uses Silverlight's 3D projection capabilities through my Matrix3DEx library to project different UIElements on the marker.
The SLARToolkit project description from the CodePlex site:
SLARToolkit is a flexible Augmented Reality library for Silverlight with the aim to make real time Augmented Reality applications with Silverlight as easy and fast as possible. It can be used with Silverlight's Webcam API or with any other CaptureSource or a WriteableBitmap. SLARTookit is based on the established NyARToolkit and ARToolkit. SLARToolkit uses a dual license model and could be used for open or closed source applications under certain conditions. See the License page for details.Features:
- Direct Support for Silverlight's CaptureSource
- Flexible through a generic WriteableBitmap detector
- Multiple marker detection
- Simple black square markers
- Custom markers
- Real time performance
- Easy to use
- Documentation
- Based on established algorithms and techniques
- Uses the Matrix3DEx library
A webcam and at least the Silverlight 4 runtime must be installed to run the sample. It's available for Windows and Mac. Alternatively there is also a new video of the Silverlight projection sample embedded below.
If you want to try it yourself you need do download the SLAR and / or L marker, print them and hold them in front of the camera. The marker(s) should be printed non-scaled at the original size (80 x 80 mm) and centered for a small white border. Also make sure the camera is set up properly and the scene is illuminated well without hard shadows. See the SLARToolkit Markers documentation for more details.
Simply press the "Start Fun" Button to start the webcam. Use the ComboBox to select a different UIElement that will be mapped on the marker. The size and the orientation can be changed with the "Scale" and "Rotation" Sliders. The "Threshold" Slider controls the threshold for the marker detection. The "Flip x-axis" Checkbox could be used to flip the video (the webcam output is mirror-reversed by default).
If you click the "Start Fun" Button for the first time you need to give your permission for the capturing. This application uses the default Silverlight capture device. You can specify the video and audio devices that are used by default with the Silverlight Configuration. Just press the right mouse button over the application, click "Silverlight" in the context menu and select the "Webcam / Mic" tab to set them.
Video
I've recorded a short video of the new sample with Expression Encoder's Screen Capture feature. Please keep in mind that the screen recording software eats up a lot of resources while recording and that the actual frame rate is way better.
How it works
This sample uses the SLARToolkit CaptureSourceMarkerDetector to detect the markers in each webcam frame. The detection result contains a transformation matrix for each found marker which is then used to transform the selected UIElement. The tracked marker region is highlighted with a red quad through the WriteableBitmapEx library.
Download it, build your app and augment your reality
The open source SLARToolkit library and the samples are hosted at CodePlex. If you have any comments, questions or suggestions don't hesitate and write a comment, use the Issue Tracker on the CodePlex site or contact me via any other media.
Have fun with the library and please keep me updated if you use it anywhere so I can put a link on the project site.
Update 03-15-2010
Updated to the Silverlight 4 Release Candidate.
Update 04-15-2010
Updated to the final Silverlight 4 RTW build.