LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting a snapped image from usb webcam to rgb model color

Hellow everyone,

 

I am trying to convert  a snapped image using usb webcam to RGB model. I have two VIs, for snapping and the other for converting JPEG to RGB as the attached VIs bellow. My problem is how to connect these two VIs in one VI to make direct conversion from snapping to RGB model. I am using LABVIEW 8.6

Download All
0 Kudos
Message 1 of 8
(3,017 Views)

Hi,

 

You could use "IMAQ ColorImageToArray (4881)" which converts the image datatype to an two dimensional array, which could be converted to a pixmap using "Flatten Pixmap" as follows:

          

             convert.jpg

 

 

Christian

0 Kudos
Message 2 of 8
(3,001 Views)

Thank you so much for your help, It work with me well, but I when I connect to the second program It shows me the blue color of the image in the graph only though I connect the same graph for each value it still show me blue color of the image... how I solve this problem.

0 Kudos
Message 3 of 8
(2,983 Views)

Why should an Intensity Graph know that it's green or blue or red when you simply pass an array of numbers to it?

 

You have to change the color of the markers of the graph:

 

marker.jpg

 

 

Christian

0 Kudos
Message 4 of 8
(2,975 Views)

There is also an KB which shows where how to change it programmatically: How can I Change the Color of an Intensity Chart or Graph?

0 Kudos
Message 5 of 8
(2,972 Views)

Thank you dear, hope anyone  complete for me VI using the attached VIs and add for the convertor to RGB the intensity graph that show the Red, Green and Blue of the image,

 

Thank you

0 Kudos
Message 6 of 8
(2,937 Views)
Iam waiting your help for my post above
0 Kudos
Message 7 of 8
(2,926 Views)

So the two VIs that you have are not directly compatible with each other. Notice that the first one uses IMAQ VIs (an add-on), while the second is using VIs from NI's Base Package. This means that the first VI (the snap) outputs an "Image" type, while the second VI is using an "imagedata" type.

 

To clarify, you want the histogram of each color in the image, is that right? This is what a histogram is:

http://zone.ni.com/reference/en-XX/help/372916J-01/nivisionconcepts/histogram/

 

If so, you can use the IMAQ ExtractColorPlanes VI to extract each individual color plane...

http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_extractcolorplanes/ 

...and then you can use the IMAQ Histogram VI to map the histogram of that color plane.

http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_histogram/

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 8 of 8
(2,917 Views)