Log in

View Full Version : Creating a Binary Image for Autonomous


Drucifur
13-02-2010, 14:50
Does anybody know what the RGB values of the carpet will be at competition? I need to set them for imaqColorThreshold() as part of the autonomous ball tracking mode.

Thanks, and, if anybody knows where I can find some documentation on the National Instruments particle analysis, please pass it on.

Thanks again,
Drew

Greg McKaskle
13-02-2010, 18:31
More important than the RGB of the competition carpet is the carpet you'll test against, and the process you use to calibrate to a carpet sample.

What I'd recommend is to see if you can get it to work using the gray carpet commonly used in the past. If you can get it to work using just the luminance plane and mono thresholding, it will be faster anyway.

Later, try a piece of blue or green office carpet. If you can pretty quickly and reliably get it to work on different colors, you are set.

As for how I'd measure the color content, my favorite is to open the Vision Assistant, connect the camera directly to the PC, PC IP of 192..., and you should be able to snap Capture pictures directly into Vision Asst. Next, use the Extract Plane to do the luminance, followed by a threshold block. If you want to do color, just use a color threshold.

With whatever threshold you are using, select a piece of carpet in the image by dragging a rectangle over it. If you capture some other stuff in the rect, redraw it. The graphs in the configuration window will show you the color values inside your rectangle. Typically, you'd drag the sliders to one side and the other in order to configure the threshold. This may be useful to fine tune so you can determine how much shadow or other stuff you want to filter out. This also lets you experiment with RGB and HSL color modes and compare them to the luminance.

Finally, take the numbers and approach to the code and use the upper and lower numbers for your threshold. By doing this a few times under different lighting, you should be able to calibrate to almost any solid colored flooring quite easily, and then you'll be able to get numbers you can share with any other team who asks.

Also, if you are doing color based thresholding, be sure to change the white balance on the camera from auto to something else. It doesn't mater too much which you use as long as you are consistent, and again, Vision Asst is the fastest way to compare the camera settings to see which gives you the best threshold.

Greg McKaskle