11-14-2019 05:59 AM
Hello to all.
First of all thanks a lot for reading this post and being able to help.
I would like to do the next:
I think I must have a template wich is going to be the color (in this case orange). And with options I can specify the intensity color or something like that for algorithm recognition.
Is there any function in vision labview to do this?
Any ideas?
I just need a tip and then work on it.
Thanks a lot.
Solved! Go to Solution.
11-14-2019 07:10 AM
Convert the image to HSL (or any H**), and use the Hue channel. Do a simple threshold on the Hue of orange +/- a margin, and only orange objects are selected.
11-14-2019 10:35 AM
Are there going to be many colors to pick from? A color classifier might be a choice.
Check out the Color Classification example in the Example Finder. If that looks like it would work, there's a Vision Color Classification Training program that you can use to create a new classifier and add examples of all the colors you're looking for.
I think finding the shapes and identifying its colors would be easiest done in two stages. First process to find all the particles in your image. Look up the examples for thresholding, segmentation, labelling, and binary particle analysis report if you need some ideas. The iterate through and identify the color of each of the particles.
11-21-2019 04:58 AM
Hello,
Thanks for replying.
There are going to be two or three color properly. but for example, for one color There could be many intensities.
In the second option that you mentioned about first get the shape and then get the color I think it is complicated in this case for the next reason:
The image could be like this:
So, the shape that it is in red circle. I would like to count the orange part (1 in image) if this part has more than 100 pixels for example. If this part is less than 100 pixels not count.
Could I do that?
11-21-2019 05:00 AM
Thanks a lot for replying.
I did an example with HSL and it works (I have to improve the example), but now I would like to do what I post above.
Could you help me?
Thanks a lot.
11-26-2019 04:52 AM
@Alvaro.S wrote:
Thanks a lot for replying.
I did an example with HSL and it works (I have to improve the example), but now I would like to do what I post above.
Could you help me?
Thanks a lot.
Colors aren't exactly defined. So how do you want to "count colors"?
You should be able to get all the pixels (in RGB and\or HSL) as a 1D or 2D array. Than you can do with them what you want in plain LV. I'd guess a histogram could be useful.
Keep in mind that H is a 'continuous' scale, wrapping around it's maximum. So you should support ranges from 10-30, but also from 250-15 (from 250-255 and from 0-15).