LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RGB Value from Image captured by webcam

Hi, i am doing a labview project in which i have to get RGB value directly from image captured by webcam. I am trying to do get result, but cannot attain RGB values. Help me to clear out this problem!Untitled.png

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 1 of 6
(4,614 Views)

Hi dhans,

 

why do you think that typecasting the reference to an image (aka "pointer") will result in a (scalar) RGB value?

 

IMAQ has functions to convert an image reference to an array of RGB values!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(4,595 Views)

Hi, thanks for answer. But i tried that too also. It shows an invalid image type error. 

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 3 of 6
(4,574 Views)
You have an IMAQ Create with nothing wired to image type. By default LabVIEW takes grayscale U8 and creates a space in memory for only that type of image. Wire RGB U32 and see.

0 Kudos
Message 4 of 6
(4,557 Views)
And also you shouldn't expect wiring a reference to do typecast to do conversion for you. Use specialized IMAQ functions (extract color plane, color plane threshold etc ) to lend you RGB values.

0 Kudos
Message 5 of 6
(4,544 Views)

What do you want?  Do you want the RGB Image split into a "Shades of Red" + "Shades of Green" + "Shades of Blue" set of images, or did you want the value of a particular Pixel expressed as an RGB triple?

 

If the former, I believe there have been posts on the forum within the last six months on this topic (I recall posting exactly such code which may or may not have been accepted as a "Solution", I don't remember).  Not sure how to find it ...

 

Bob Schor

0 Kudos
Message 6 of 6
(4,527 Views)