|
Re: improvements to demo camera code anyone
The default code in both LV and C/C++ are already doing conversion to HSL. I'll speak about the LV example since I'm more familiar. The image passed into FindTwoColor first passes through an optional decimate/subset case. Next if debug HSL is on, it converts everything to HSL and displays on the panel in HSL so that you can hover and read pixel values out in HSL. By the way, don't leave this on or it will slow things down, it is for debugging.
Next it performs a color threshold. The image going in is normally an RGB, but the thresholds are spec'd in HSL, so as needed the pixels in your image will be converted for thresholding. To speed things up, it only converts the parts it needs. So the L is computed, and only if it passes is the S computed, and only if it passes is H computed. This gives the same results, but takes advantage of the speed of computing the elements.
Following this is particle analysis which returns area and bounding rect edges. The VI was written so that it would be easy to ask for more properties for the particles, perhaps the percent coverage or the ratio of the edges of the best rectangle fit.
The next step is looping through looking for a secondary in the right location to a primary. This involves subsetting the image and looking in the tiny areas for the second color.
Back to the original topic. I also want to hear what people have done to improve it. I just wanted to make sure it was clear what it currently does, like HSL, before starting to change it.
Greg McKaskle
|