Demo - not able to track white & black color

Added by ck w about 8 years ago

We hook up the CMUcam4 & the LCD display.
Power up and ran the CMUcam4 demo.
We tested red, yellow, orange, green..base on LCD display..the color tracking ok.
Base on the image from the LCD, CMUcam4 seems to have problem with tracking white color & black.

Or maybe our setup have a problem ?

Any advice ?

Replies (2)

RE: Demo - not able to track white & black color - Added by Kwabena Agyeman about 8 years ago

So, the demo mode feature preforms very rough color tracking. It's not that intelligent.

Depending on your setup the background color for your scene may be black or white. The color tracking demo works in YUV mode which is a bit different than RGB mode and has different characteristics.

Hook up the CMUcam4 to your computer using a serial FTDI board or cable. Then take a picture of the object you want to track using the "DF 0 0" command. The CMUcam4 will save the picture to the SD card.

You can then open the picture up in paint, for example, and use the eye dropper tool to select the color value you want to track. Try to get a few samples of the color you want to track from the object you want to track. Average the R, G, and B color values for the samples you want to track.

Then, add a confidence bound around the mean of the samples you took from the object you want to track. So, let's say the color of the object you want to track is R=123, G=213, B=031. That's the rough mean estimate of the object you want to track given the picture you took of it. So, different lighting conditions and such will cause the object to change colors. In general, color tracking is not easy and ultra robust given changes in lighting. If you want the CMUcam4 to work well you must understand that the camera does not see as well as a human. In general, this is the case given any sensor. So, it's important to use the "DF" (Dump Frame) command to take a picture of the object in the scene you want to track. The difference between colors may not be as sharp as you think.

Anyway, so, you have R=123, G=213, and B=031. A good starting point is to add +-30 to each channel and use that as your color tracking bounds. So, Rmin=93, Rmax=153, Gmin=183, GMax=243, Bmin=001, Bmax=061.

Just adding +-30 to each channel is just what the demo mode feature does. It finds the mean of the color in front of it and tracks +-30 the mean of each color channel. This... is not the best way to track colors. In fact, it's a really bad way to track colors. But, it's cheap. And we had limited space in the firmware for the demo mode feature.

If you want to track colors really well you'll want to use the histogram feature. If you do "GH 0 5" this gives you all 32 bins of the red channel in the image. If you then limit the virtual window to just bound the colored object you want to track using the "SW" (Set Window) command to get only the histogram of the color blob, i.e. the object you want to track, in the image.

Once you have the histogram for each channel you can easily see the distribution of the colors in the image for the object you want to track. All, you have to do then is pick the cut off points with a bit of accommodation for lighting.

Please see the Color-tracking Explanation section. You use the "ST" or "TC" command to set the color tracking bounds.

... Demo mode is just for show. If it worked for a few objects then that means it works! Now, you'll have to apply a bit of experimentation and science to pick the correct color tracking bounds. This is the hardest part of using the CMUcam4. But, once you have good color tracking bounds it will work well for you application.


RE: Demo - not able to track white & black color - Added by Anonymous almost 2 years ago

You may post on the professional credentials for the blog owner. You could express it's outstanding. Your blog experience can springboard your click through

Friv Run 3