The image processing software runs on either a video stream, or image
files on the computer. We've modified it to do three things:
Detect red pixels, using hue, saturation, and value of each pixel
to determine what is and isn't red. In our pictures, all red pixels
have been turned bright blue.
Determine if there is a red molding in the center of the picture.
If a red molding is detected (at least 7 red pixels in a row), a grey
line will be displayed through the center of the picture.
Determine the slope and position of a red molding, if one is
present in the picture. If one is detected, a magenta line will
appear in the picture where the red molding has been found. In order
to do this, we look at every column, finding the highest and lowest
red pixel. These pixels are displayed as bright green on the screen.
The ends of the red molding are at the center of the first reasonably
large batch of red pixels in a row.
The code to do all of these can be found here.
And here are some screenshots of our code at work.
Doesn't it look pretty?
No more molding detected in the center, since it got too small.
Even though we have a red fire alarm in the picture, it still works.
Although there are still a few problems.