Wednesday, January 21, 2009

So close and yet so fire

This week I've been working on creating the necessary architecture to classify parts of images as being fire or not based on the pixel color values. I've also created a large training and testing set of labeled fire images to use once everything is working. The following is a description of how the system works so far:

  1. Run a script to go through a directory of raw fire images and make sure there are no pixels with the rgb value (255,0,0) since this is going to be the indicator color in the next stages of this process. Also create a copy of all of the original images. There is now a directory of slightly modified images called 'target' and a directory of the original images called 'original'.
  2. Use a paint program and manually label all target image fire pixels by coloring them with the rgb value (255,0,0).
  3. Run a script which reads each target image and where it finds pixels with the color (255,0,0) grab the color value at the corresponding pixel location in the original image and write it down to file.
  4. Repeat steps 1-3 for positive and negative example images to create positive and testing sets.
  5. Get rid of all duplicate values in the data sets using the Unix 'sort' and 'uniq' commands.
  6. Run another script to convert the raw positive and negative sets into training and testing sets of mixed negative and positive examples.
  7. Run a training program to train the perceptron classifier.
  8. Feed a testing image to the final fire color classifier program which uses the trained perceptron to classify fire pixels in the input image.
Currently there's a bug in either the training and/or classification stage of the process which I need to hunt down and eliminate with extreme prejudice. Other than that everything is looking good.

On a related note, the following are the color palettes of fire and non-fire pixel colors:

No comments:

Post a Comment