简体   繁体   中英

Identify GREEN color in an image with NI VISION in Labwindows\CVI

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)

A 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?

I used HSL color mode and checked the Hue plane only.

By observing the hue Value (in windows Paint) of several pictures, i set the tolerance of the Hue value and checked it via mean field in the report.

Works like a charm.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM