LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the hue of a ROI

Hello,
I am trying to determine the change of the color in an smal area.
What I am looking for is a way to:
1.find the arrea, which appears by applying a little volume of a dark fluid on a light test-field
2.determine the change of the color in this area over the time
 
My idea for 2. was to extract the hue-value of the RGB-Data from the USB-cam I use.
But I do not understand how I can get this hue-value in a range from 0° to 359° from the grayscale picture the Vision Assistant creates. I tried to plot a histogram of this hue picture, but it only generates a histogram for values from 0 to 255.
I do not understand how this hue value (0-359) can be represented by 8 bits. Is there a loss of resolution in this conversion?
 
I would be very thankful for any answer. I am a complete beginner in LabVIEW especially in image processing.
Thanks
Dominik
0 Kudos
Message 1 of 4
(3,214 Views)
Hello Dominik,

i think you mixed up some things about the histogram. The histogram represents on the x axis the pixel value for example 0 until 255. And on the y axis the pixel count. With a normal RGB image with 24 bit (8 bit for every panel) you could not generate a histogram with a x value of 359. Mabye you send me a printscreen or the vision script to see the behaviour. The best way to start with vision is to have a look at the examples and the concept manual. You can find the concept manual under Start/Programme/National Instruments/Vision Assistant/ Concepts Manual.

Kind regards,

Elmar
0 Kudos
Message 2 of 4
(3,192 Views)

Hello Elmar,

thanks for your answer.

As far as I know, the hue in HSV is presentet by a value from 0° (red) over 120° (green) and 240° (blue) back to 360°/0°.

What I did was to extract the hue in Vision Assistant by color plane extraction what made a grayscale picture (8 bit) out of my RGB picture (24 bit). The greyscale corresponds to the hue. Red is darker than green than blue. Now I made a histogram of this grayscale picture. For shure I can not get a value of 359° out of this because it is just a 8 bit picture. But that is the point, Is it possible to get a higher resolution for the hue in LabView?

Testing this system I took a generated picture (made by corel draw) with red, green and blue areas (also CMGY). The result of the histogram was:

red=peek at 5 (7°)

green=peek at 108 (152°)

blue=peek at 150 (211°)

Now I can get teh value in degrees (256=360°) but I have a loss of information because of the conversion to the 8 bit grayscale picture.

Any Idea to get better results? I couldn´t find any example for something like that. Where do I have to search? If you need more details, just ask.

I just need a system to find the color of an area.

Thanks

0 Kudos
Message 3 of 4
(3,186 Views)
Hello Dominik,

the color model will be represented in LV as an 32bit image. 8 Bit for every panel and 1 x 8 Bit for reserve. The best way to calculate the degree is to use the normal RGB format and write a lv code to calculate the degree. Use the link below for the degree calculation.

http://www-lehre.informatik.uni-osnabrueck.de/~cg/2000/skript/9_8_HSV_Modell.html

With the ROI function you can set a specify region to extract all pixels in the image.
And with the imaq to array function you get all pivel values from the roi.
So that you are able to get the whole color information.

Kind regards,

Elmar



0 Kudos
Message 4 of 4
(3,181 Views)