Friday, October 14, 2011

sixteen

This activity is similar to the previous one.  The difference is that only two classes are used for each instance and LDA classification is used.  . 

Here, the same samples used in the previous activity are utilized here and are shown below.

1peso_thumb2

Figure 1. Class: 1-peso coin

25cents_thumb2
Figure 2. Class: 25-cent coin

chizcurlz_thumb2
Figure 3. Class: Chiz Curlz

piattos_thumb2
Figure 4. Class: Piattos

Shown below are the accuracy results, in percent of the LDA classification of two classes.  Only when the coins are compared side-by-side does the LDA classification not have a 100% accuracy rate.  This may be due to the fact that the general shape and structure of the two classes are very similar.

Table 1. Results of the LDA classification between classes
Class 1 Class 2 Accuracy
1-peso 25-cents 90
1-peso Chiz Curlz 100
1-peso Piattos 100
25-cents Chiz Curlz 100
25-cents Piattos 100
Chiz Curlz Piattos 100

Over-all grade: 9/10

REFERENCES:
1. A19 – Probabilistic Classification, Applied Physics 186 Manual
2. Pattern Recognition 2, prepared by Dr. S. Marcos

fifteen

In the world of image processing, a class is a set of patterns that share common properties and a pattern can be considered a set of features – color, shape and size for example.  These features can numerically be called feature vectors and can be used in pattern recognition to determine if a pattern belongs to a specific class. 

To perform pattern recognition, one has to define the features that will be able to separate classes from each other and then use these features to create a classifier.

In this activity, we use minimum distance classification to tell if objects belong in one class or another.  When you have a set of W classes, the mean feature vector of a class Wj is then defined as
eq1
where xj is the set of all feature vectors in the respective class and there are Nj samples in this class.  For the equation below, a sample must belong to a class if for an unknown vector x, it produces the smallest distance.
eq3

The following images were the different object classes and samples used in this activity.  The training set are presented in the top rows while the testing sets are shown in the bottom rows.

1peso
Figure 1. Class: 1-peso coin

25cents
Figure 2. Class: 25-cent coin

chizcurlz
Figure 3. Class: Chiz Curlz

piattos
Figure 4. Class: Piattos

The classifier used in this activity was the Minimum Distance Classification system.  The overall accuracy rate is 60%.  However, the accuracy for the 1-peso coin class was 100%; the 25-cents coin class, 60%; the Chiz Curlz class, 20% and the Piattos class, 60%.  This may have something to do with the morphology of the samples in the objects themselves.  It’s funny to note that the four mistakenly classified samples had been identified as a 1-peso coin and, thrice, a Piattos chip. 

Overall grade: 9/10

REFERENCES
1. A14 – Pattern Recognition, Applied Physics 186 Manual

fourteen

The main goal of this activity is to separate a colored region from a separately colored background.  To do this, each pixel coordinate can be normalized by the equations shown below and thus become Normalized Chromaticity Coordinates (NCC)

ncc equation

Shown below are the corresponding colors of the r and g values.

ncc fig
Figure 1. Normalized chromaticity space where the x-axis is r and y-axis is g.

Before any color segmentation can occur, a region of interest (ROI) is obtained from the selected image.  The image below is from the My Pictures folder of my computer.  Thank you again, Windows. 

tulips
roi_enlarged
Figure 2. (top) The original image and (bottom) the corresponding region of interest (ROI).

When the NCC and Gaussian histograms of the ROI are taken and compared with Figure 1, we can see that the location corresponds to the red and orange colors.

histogram
Figure 3. (left) Non-parametric: 2D histogram of NCC of ROI and (right) Parametric: Gaussian distribution fit of NCC values for the ROI.

From these histograms, masks were created to filter only the pixels of the color we’re interested in. 

gmask
Figure 4. Binarized Masks: (left) Non-parametric and (right) Parametric.

These masks were applied to the original image, hence only the colored ROI are seen.

gimage
Figure 5. Color Segmentation: (left) Non-parametric and (right) Parametric.

Well, there.  That was fun.  In conclusion, I think that the Parametric method is better than the Non-Parametric Method.

Grade: 9/10

REFERENCES:
1. A13 – Color Image Segmentation, Applied Physics 186 Manual