Machine Vision

Showing results for 
Search instead for 
Did you mean: 

Identify GREEN color

I am using NI VISION imaqColorHistogram in CVI which gives me a report for each plane, for a colorMode that i choose ( RGB , HSL HSV, HSI,CIE, CIEXYZ ) on an image which needs to contains a GREEN spot (the spot is most of the image)


The report includes:


int* histogram; //An array describing the number of pixels that fell into each class.
int histogramCount; //The number of elements in the histogram array.
float min; //The smallest pixel value that the function classified.
float max; //The largest pixel value that the function classified.
float start; //The smallest pixel value that fell into the first class.
float width; //The size of each class.
float mean; //The mean value of the pixels that the function classified.
float stdDev; //The standard deviation of the pixels that the function classified.
int numPixels; //The number of pixels that the function classified.


I want to verify that the most of colored image is as closest to GREEN. 

What ColorMode should i use? and what should be my criteria on that report?







0 Kudos
Message 1 of 2

I would pick one of the color modes that includes H (hue).  Hue directly corresponds to the color, so you can run a test image and find out what hue value matches your green spot.


Once you know the hue value for your green, I would look for hue values that are close to that value (maybe +/- 5).  I would also want the pixels to have a significant Saturation and Intensity values, so I know it isn't an almost black pixel or a slightly off gray pixel.



Bruce Ammons
Ammons Engineering
Message 2 of 2