01-29-2020 03:32 AM
Im trying to get a single pixel color value of HSV starting on the x0 y0 coordinates from my picture, x1 y0, x2 y0, ... at the rows and then continue to columns. Where would i get the frequency of each color (0-255) on the whole picture at the table with one column for H => 0-255, S => 0-255 and V=> 0-255. But i need the frequency so i only need to add +1 everytime it appearce in there for each color to count it at the end (i need it for fuzzy later, to show my fruit has a good color and is ready to be harvested).
Could you please help me with that?
01-29-2020 03:37 AM
Hi Lise,
what is the data source? I guess you read some images using the PictureFile functions…
@WonderLise wrote:
i need the frequency so i only need to add +1 everytime it appearce in there for each color to count it at the end
Could you please help me with that?
Simple steps: try on your own. When you get into trouble you should attach your VI(s) and ask for specific help.
01-29-2020 03:48 AM
Are you using NIVision? Or are you working on pixmaps?
NIVision has conversion VIs to convert from RGB to HSV (or was it HSL?). Once you converted, you can use the thresholding function(s) to mask all 'frequencies'. After that, you can use object detection functions to do the grouping of objects, or get all pixels as an array and add them. Or use a histogram on the HSx image.
Keep in mind that H will wrap around 0. IIRC, red will be centered around 0, so one threshold might not suffice. If the range is 20, correct thresholding might be 0-10 OR 245-255. All from the top of my head, so check the details (for instance, max H might not be 255).
01-29-2020 04:08 AM
Im using Vision, i can show you, even tho its really simple for now.
Thank you, for you reply, i will keep the threshol in mind.