Usage

Introduction

Our STD program has three different working modes:
Demo mode
This mode demonstrates how the STD algorithm works with  the default template patterns and a preset unknown character pattern. Users do not need to provide any input in this mode.
User mode - default template patterns
This mode automatically loads the default template patterns and requires the user to provide a bitmap file as the unknown character pattern. The user also needs to manually start the algorithm.
User mode - custom template patterns
This mode requires the user to provide a set of template patterns and an unknown character pattern.  The user also needs to manually start the algorithm.
The program is available for download here.

File Format

Template patterns
Each of the template pattern is a 100 by 100 24-bit bitmap file with black strokes and white background. All the template patterns must be placed under the same directory and have the file extension ".bmp" for the program to load successfully.
Unknown character
A unknown character has exactly the same format as a template pattern. It is a 100 by 100 24-bit bitmap file with black strokes and white background. The unknown character file does not required to have the file extension ".bmp" since the user will specify its full name. The unknown character file can be placed anywhere in the system.

Running the Program

This program is written in matlab with graphical user interface.  To start the program, first switch the working directory of matlab to the one that contains the "STDUI.fig" file and type STDUI and press enter. The user should see the program main screen like the one below.

Program main screen
Only the push buttons available at current step is enabled to avoid confusion.  Next we will explain how to run the three modes step by step.
Once the program finished running, the user can press the Reset button to start a new trial.

Modify the Program Parameters

There are some adjustable parameter in the STD algorithm, such as number of iterations, learning rate, neighborhood shrink factor and input picture size.  Those parameters are located in execSTD.m which is the main algorithm body of this program. The default values for each of the parameters are listed below.  Feel free to change them and observe what happens to the training process and result.

T = 100;        % Maximum iterations
t = 0;          % Current iteration
alpha = 0.1;    % Learning rate
s = 1;          % Current scaling factor of ellipse neighborhood
sfac = 0.9;     % Shrink facotr of scaling factor
picw = 100;     % Picture width
pich = 100;     % Picture height