15147
How does the Pixel Aggregate method work when resizing data with ENVI ?
When resizing data in ENVI, using the Resize Data tool or the RESIZE_DOIT routine, different resampling methods are proposed. When the resize factor is less than 1, the 2 resampling methods are Nearest Neighbor and Pixel Aggregate.
The definition of the Pixel Aggregate method is the following: it averages all of the pixel values that contribute to the output pixel. This Help Article shows how the Pixel Aggregate method is working to define the output image values, based on a data sample.
This article presents an example based on input image of 6*6 pixels, composed of 36 values going from 0 to 35:
This image will be resized to a 4*4 pixel image, using the pixel aggregate resampling method. The output image will be as follows:

In order to understand how each output value is computed we will overlay the output image (in red) onto the input one (in blue). This will illustrate the contribution of the each input pixel in the output pixels. In order to overlay the output image onto the original one the ratio between the input and output size of the image (in pixel) is computed. In this example this ratio is equal to 6/4=1.5 for both columns and lines so each output pixel will cover 1.5 input pixels (in lines and columns):

For example we will consider the following output pixel: (2,1). The contribution of the input pixels to this output one is written below:
- 100% of the input pixel (3,2) with a value of 15
- 50% of the input pixel (4,2) with a value of 16
- 50% of the input pixel (3,1) with a value of 9
- 25% of the input pixel (4,1) with a value of 10
The output pixel value will then be computed as the average of each contribution
(15+0.5*16+0.5*9+0.25*10)/(1.5*1.5)=13.3
Below is the result for each output pixel:
Pixel 0,0: (0+0.5*1+0.5*6+0.25*7)/(1.5²)=2.3
Pixel 1,0: (0.5*1+2+0.25*7+0.5*8)/(1.5²)=3.6
Pixel 2,0: (3+0.5*4+0.5*9+0.25*10)/(1.5²)=5.3
Pixel 3,0: (0.5*4+5+0.25*10+0.5*11)/(1.5²)=6.6
Pixel 0,1: (0.5*6+0.25*7+12+0.5*13)/(1.5²)=10.3
Pixel 1,1: (0.25*7+0.5*8+14+0.5*13)/(1.5²)=11.6
Pixel 2,1: (0.5*9+0.25*10+0.5*16+15)/(1.5²)=13.3
Pixel 3,1: (0.25*10+0.5*11+17+0.5*16)/(1.5²)=14.6
Pixel 0,2: (18+0.5*19+0.5*24+0.25*25)/(1.5²)=20.3
Pixel 1,2: (0.5*19+20+0.25*25+0.5*26)/(1.5²)=21.6
Pixel 2,2: (21+0.5*22+0.5*27+0.25*28)/(1.5²)=23.3
Pixel 3,2: (0.5*22+23+0.25*28+0.5*29)/(1.5²)=24.6
Pixel 0,3: (0.5*24+0.25*25+30+0.5*31)/(1.5²)=28.3
Pixel 1,3: (0.25*25+0.5*26+32+0.5*31)/(1.5²)=29.6
Pixel 2,3: (0.5*27+0.25*28+0.5*34+33)/(1.5²)=31.3
Pixel 3,3: (0.25*28+0.5*29+35+0.5*34)/(1.5²)=32.6
___________________________________________________________
Reviewed by PS on 2/20/2014