LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting color change information over time

Solved!
Go to solution

Hello everyone,

 

I'm new to LabView and to this forum, so I hope I'm in the right subforum. If not, it would be kind if a mod could move this thread.

My problem is the following:

 

Let's say I have a white spot which I want to observe with a camera. The color of the spot changes to green over time and I want to acquire the picture aswell as getting the increase intensity of the developing green color over time. I don't know which functions I need to use in order to achieve this. Can anyone hint me in the right direction? I think it's at least possible in LabView.

 

Thank your everyone for your help.

 

Best regards,

Tresdin

0 Kudos
Message 1 of 12
(3,950 Views)

Hi Tresdin, are you using the IMAQdx drivers in the vision acquisition software?

0 Kudos
Message 2 of 12
(3,923 Views)

hi gregoryj,

 

yes I'm using the IMAQdx drivers for vision acquisition. At the moment I have a cheap cam which I'm using just to test things. If I can code a program with LabView which does it's job I will spend money on something more expensive.

0 Kudos
Message 3 of 12
(3,914 Views)

Once you have your image you can use IMAQ ColorImageToArray to get the value at each pixel. It will be U32 and you should be able to extract the bytes of color intensity out of that.

0 Kudos
Message 4 of 12
(3,908 Views)

Thanks for your reply.

 

Is it possible to acquire a live image while measuring the increase in my green color? Or am I only able to get an image and process it afterwards?

 

I'm quite new to LabView actually (~1 month). I know the basics I think but I'm even newer when it comes to image processing and stuff.

0 Kudos
Message 5 of 12
(3,904 Views)

You can do it all together. The issue would just be if your calculations take a long time then you might slow down your image acquisition rate, but there's nothing that says you can't process your image immediately after capturing it.

0 Kudos
Message 6 of 12
(3,899 Views)

Damn, I was too slow, I drew a picture (it's quite bad but I think it doest the trick) in order what I want.

 

Do you have any information where I can read about image acquisition aswell as image processing? I already tried simple stuff with grabbing and taking snapshots, but I have a hard time grasping the concept with images and processing in LabView.

 

Thanks again

0 Kudos
Message 7 of 12
(3,896 Views)
Solution
Accepted by topic author Tresdin

I'm not sure what the best resource is for the IMAQdx drivers, I think the examples that NI provides are pretty helpful. Here is a simple VI that will tell you the average green value of all the pixels in your image.

 

 Color Analysis.png

Message 8 of 12
(3,879 Views)

Hello gregoryj,

 

thank you very much for your help. I have to digest that 🙂

 

If I understood it I have to implement it to a live picture. I hope I can do this, but your code was already very helpful. I'll try this. Thanks again

0 Kudos
Message 9 of 12
(3,848 Views)

Yes, there will be just a couple of changes. First, for a continuous acquisition you should right click the For loop and change to While loop. Then make sure to open the camera before the loop, and close the camera after the loop. Finally, replace the "load picture" VI with a "grab image" VI.

Message 10 of 12
(3,824 Views)