LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

image averaging vision

Solved!
Go to solution

Hello,

I want to average 5 images from a webcam, therefore I wanted to create an array containing 5 Images, adding a new image after 200ms, and kicking the oldest one out (doing the "IMAQ add" and so on). But it didn't work.

Therefore I modified the examples\Vision\2. Functions\Operators\Image Averaging Example.vi to exclude any other problems.

I only took the read image out of the for-loop, and gave into a separate for-loop - but unfortunatelly it also doesn't average anymore.

Shouldn't Labview be abel to handle image-arrays ?

 

Thanks in advance !

Alex

0 Kudos
Message 1 of 5
(6,737 Views)

Hi Alex

 

I had a look on your program and there are missing several things:

 

1. LabVIEW is able to handle arrays of images, but for each image you have to create an image buffer !

In your program there are only 3 image buffers available, so you can not process 5 images

3. When you like to work with an USB webcam you have to use the IMAQdx driver

 

I tried it and it is very easy to acquire 5 images from my webcam and present them with an Image Display

 

2010-01-11_1022.png

Kind regards

 

Beat

NIG

0 Kudos
Message 2 of 5
(6,683 Views)

Hi Pixar,

 

in the mean time I saved the 5 images, loaded them, averaged them, overwrote them and so on. - It also worked fine.

Yes, you were right, several things were missing, as I didn't understand the IMAQ thing. But handling with the array is definitely the more

 elegant way. Therefore I changed my VI. My webcam doesn't support IMAQdx, thus I still have to use the IMAQ USB.

The whole procedure works very well. The last thing which I don't understand is, why I can't average the RGB images directly - it only works, if I 

separate the red, green, blue plane , average the planes, and put it together afterwards (see below).

 

Thank you very much so far !

 

Best regards Alex 

Download All
0 Kudos
Message 3 of 5
(6,668 Views)

Hi Alex

 

You also use the IMAQ Divide function for the average?

 

Please read the detailled help for this function:

 

The image type of Image Src B depends on the image type of Image Src A.

  • If Image Src A is a signed 16-bit image, Image Src B must be a signed 16-bit image or an unsigned 8-bit image.
  • If Image Src A is a 32-bit floating-point image, Image Src B must be a 32-bit floating-point image, signed 16-bit image, or unsigned 8-bit image.
  • If Image Src A is a complex image, Image Src B must be a complex image, 32-bit floating-point image, signed 16-bit image, or unsigned 8-bit image.
  • If Image Src A is a 32-bit RGB image, Image Src B must be a 32-bit RGB image, complex image, 32-bit floating-point image, signed 16-bit image, or unsigned 8-bit image.

Otherwise, Image Src B must be the same type as Image Src A.

When the value of a pixel in Image Src B is 0, the result of the divide operation for the pixel is either the maximum or minimum pixel value for the image type. If the corresponding pixel value in Image Src A is greater than 0, then the result is the maximum possible pixel value for the image type. Otherwise, the result is the minimum possible value for the image type.

 

So when your webcam supports RGB 32 bit images it should work without dividing into the different color parts.

But I really don´t believe that your webcam supports 32 bit RGB images 😉

 

Kind regards

 

Beat

NI Germany

Message Edited by Pixar on 01-11-2010 06:31 AM
0 Kudos
Message 4 of 5
(6,655 Views)
Solution
Accepted by topic author alex_s

Hi Pixar,

 

Ok, now I got it ! I don't have to extract the planes any more, just dividing !

Indeed, the webcam has only 24 bit, thus I had to divide them 🙂

Thank you very much !

 

Best regards Alex 

0 Kudos
Message 5 of 5
(6,640 Views)