Example Code

Identify "Perfection" Piece Using Geometric Pattern Matching

Code and Documents

Attachment

Download All

Overview

This VI uses a camera and Geometric Matching vision algorithms to identify one of the 25 pieces from the board game Perfection.


Description

First, a Geometric Matching template was created for each piece using the NI Template Editor that comes with the Vision Development Module. Within the VI itself, an array of these template images is created. When a piece is placed in the camera's view and the program is run, the camera takes an image and compares the image to the 25 piece templates using the Match Geometric Pattern 2 VI. The template with the best match score is determined to be the correct piece, and that piece is displayed on the front panel along with information about the piece such as rotation, position, and scale (in relation to the template image).


Steps to Implement Code

1.  Download Identify Piece.zip

2.  Make sure the VI and the Perfection Templates folder are both contained in the same directory

3.  Place a Perfection piece under a camera or select a sample image

4.  Run the program

Requirements

Software

LabVIEW 2009 or later

Vision Development Module

Hardware

Vision Acquisition Software compatible camera (optional but recommended)

Perfection (or Perfection Pieces)


Additional Images

Front Panel:

IPFP.PNG

Block Diagram:

IPBD.png


Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors