LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding an average 2D array using looped input 2D arrays

Hello,

    So I am using a CCD camera to take images over time and I want to average the pixel values over time, but keep the spatial structure.

 

The CCD puts out a 2D array, with the values in the array corresponding to the pixel value.  Basically I have a "while loop" going which gets a new 2D array each iteration.  I want to average each pixel over time and create an average array and a standard deviation array.

 

The simple idea is that I have 10 2D arrays with elements a_{i,j,k} where i is the row number, j is the column, and k is the page number.  I want to average over k, but not i or j.  The complication is that I have to build the array over several loops to get the k dimension.

 

Anyone know how to do this?  I figured out how to average over everything, but I only want to average over one dimension.

0 Kudos
Message 1 of 2
(2,128 Views)

Hi,

Here's one way of doing it.

All data is in a 3D array (in first dimension I put time, in second X and in third Y), I stored data in the default value of the 3D array (I put 3 frames), the rest is documented in the VI (in LV 2010).

 

Basically, the idea in my example is to "flatten" the 2D structure of each frame into a 1D array so it's easier to handle.

 

Let me know if you have any questions, hope this helps.

 

EDIT: not sure this is the best option is you have big data sets or want to perform the average each time you have a new frame but that's a start...


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 2
(2,114 Views)