11-28-2006 11:10 AM
11-30-2006 11:41 AM
Convert your images to a different numeric base before averaging them. Converting U8 to I16 will allow you to add together 256 images (or more) without any loss. Converting to DBL should give you all the precision you need.
It might be faster to convert the images to arrays, combine the arrays, divide, then convert back to an image. In this case, you could convert to U32 for the calculations.
You definitely want to add the images together before dividing so you don't lose significant digits. The only case where it wouldn't matter is when the image is in DBL format.
Bruce
12-08-2006 07:25 PM
09-27-2011 11:04 AM
Hi Naveen,
Would it be possible to post your solution? I'm new to LabVIEW IMAQ and unsure of how to allocate buffers for this type of situation. Are you allocating a new buffer for each image, or looping through grabbing images and putting them in the same buffer after the previous image is already inputted into an array? Or are you doing something completely different? I'm generally unsure about how to use buffers, so if you know of any good examples or text, that would be helpful as well. We're interested in doing something similar -- averaging many images -- and then we'll be analyzing them using a subvi that is already ready to go.
Thank you!
09-28-2011 06:15 PM - edited 09-28-2011 06:16 PM
Due to the age of this forum post, it's not likely we'll get Naveen's exact implementation. I have come up with a basic application that would show how to approximately do this. Hopefully it helps point you in the right direction!
09-28-2011 09:06 PM
Th0r has nearly got it right, although don't try it like this with RGB (U32) images - if you do want to average color images, you'll need to extract and average the R,G and B planes separately.
If you want to average Greyscale images, then the easiest approach is to use SGL (or I16) images, and you don't even need to convert to arrays to do the averaging. On the first iteration, you just need to copy the image into the Sum image.
09-29-2011 12:48 PM
That's a good point! The code I posted would best be used for images that are 8 or 16 bits.