01-07-2010 02:06 AM
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
Solved! Go to Solution.
01-11-2010 03:23 AM
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
Kind regards
Beat
NIG
01-11-2010 05:31 AM
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
01-11-2010 06:26 AM - edited 01-11-2010 06:31 AM
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.
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
01-11-2010 09:34 AM
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