X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



15242 Rate this article:
4.0

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

 

 

 

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »