NYAR Toolkit A Basic Webcam Recognition Example In WPF


This example tells you how to set up a webcam and vision recognition of a single marker in WPF using NYARToolkit.


Example Application: WpfWebcam.zip


  1. First, you should have NYARToolkit downloaded and extracted.
  2. You should also have installed Microsoft Managed DirectX as explained on the main page.
  3. If you are using NYARToolkit from the main website, you should read this tutorial first. You can skip this step if you have used the package ( downloaded from this website.
  4. NYARToolkit does recognition on colour images. So, if you're markers aren't perfectly black, they won't be seen by the toolkit. We correct this using AForge.Imaging, which performs black-and-white thresholding. Download and extract this package from
  5. Open the WpfWebcam.sln project.
  6. In the Solution Explorer, expand on the References. AForge, AForge.Imaging, DirectShowLib-2005, NyARToolkitCS, and NYARToolkitCSUtils are missing.
  7. Right click on References to relink these references.
  8. You will find AForge and AForge.Imagining in <extracted directory>\AForge-x.x.x\Release
  9. You will find DirectShowLib-2005 in <extracted directory>\NyARToolkit-2.5.x\extlib\DirectShowLibV2\lib
  10. You will find NyARToolkitCS and NYARToolkitCSUtils in <extracted directory>\NyARToolkit-2.5.x\lib
  11. Attach your webcam and install its drivers, if needed
  12. You should be able to build and run the demo application now

More Information

<extracted directory>\NyARToolkitCS-\forFW2.0\sample has four examples for Windows Forms.

Contact http://nyatla.jp/ for more information.