04-08-2010 01:59 PM
Solved! Go to Solution.
04-08-2010 02:11 PM
Do you want to take the average of each pixel over the 50 images? Do you need any of the original images after you have done the averaging?
If the answers are yes and no, respectively, put the 2D array in a shift register. Initialize it to all zeros. After each image acquisition add the current values to the values in the shift register. After all acquisitions divide the array by the number of acquisitions. This will work well and is very simple, provided that the sum cannot overflow the datatype you are using for the array. If you are using color, it may be necessary to make 3 separate arrays for the red, green, and blue components.
Lynn
04-08-2010 02:17 PM
04-08-2010 02:26 PM
04-08-2010 02:39 PM
04-08-2010 02:52 PM
And initialize the array to the size of your image.
For the summing array you need to convert to a datatype which will hold larger values than the 0..255 of a U8. By the time you have summed 50 iterations you may have exceeded 255 on some pixels.
You are also not doing any averaging. The image shows dividing by Number of Images to get the averaged pixels before you save. I do not have the IMAQ VIs so they show up with the gray question marks.
Lynn
04-08-2010 03:09 PM
I don't have IMAQ, so here's a quick example using a simulated random 2D array.
Of course you only need to update the image at N=50.
(Another possibility would be to place the image acq inside your N=50 inner FOR loop).
04-09-2010 02:12 PM