Deliverables
- Matlab source code for your lab
- Figure of your points in 3D. Either plot with color or use different shapes to distinguish your colored object from your background samples
- Second figure showing the points in the previous plot, along with the planar decision surface
- Third figure showing the points in the previous plot, along with the decision surface used by your neural network
- Your original image (please also show me the color version on your laptop screen.)
- Binary image found by your hand-made linear classifier
- Binary image found by your neural network
Overview
In this lab, you will be classifying colored objects using a manually-constructed linear classifier and a neural network using a similar approach to what we did in class
Select an example image and interest regions
Take an image with your camera of an object with some, but not high-contrast color. The object should not be bright red, and the object should not have the same color as the background. Like the green text we used in class, the object whould be "interesting" in that the color can be seen, but is close to other colors in the scene.
Click on the object and select a small window containing the example color.
Click on a similarly-colored object and select another small window containing this "background" object. Your second window should not contain the target. (You may also want to use an entire image taken in the space where you wish to youse your classifier.
Finding the Linear Classifier
Plot the RGB values of points in the two windows you selected. Make sure to use markers that will show up when you print, and be sure to label the R, G, B axes.
Select any two dimensions (or all three, if you wish) and manually construct a line (in two dimensions) or a plane (in three) to separate your target color pixels from the background pixels.
For example, in class, we used the condition g > r + 25 to find green text.
Create a second plot including the same points in RGB space, but also including your decision surface.
Apply your classifier to the original image to produce a binary image where white (true) pixels indicate the object is present, and black (false) pixels are everywhere else.
Finding a neural network
Follow the example code from class or open the help topic called "Fit Data with a Neural Network" which is the first help topic that you find when running the command doc fit data with a neural network
in Matlab.
Use the same samples as in the previous section to train a neural network to separate your colored pixels from the background pixels.
Again, create a plot with the surface used by the neural network.
Also, create an image by applying the neural network to all the pixel values in the image. Apply a threshold to produce a binary image. Include this binary image in your report.