IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23231


Ignore:
Timestamp:
Mar 9, 2009, 12:58:27 PM (17 years ago)
Author:
Paul Price
Message:

Lanczos kernel wasn't being calculated correctly, resulting in
smoothed output images. The fixed code produces images that aren't as
smoothed: the covariance matrix goes from 1 in the centre to 0.1 for
the nearby pixels, compared to 0.5 before the fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageInterpolate.c

    r21290 r23231  
    133133    }
    134134
    135     float norm1 = 2.0 / PS_SQR(M_PI); // Normalisation for laczos
    136     float norm2 = M_PI * 4.0 / (float)size; // Normalisation for sinc function 1
    137     float norm3 = M_PI_2 * 4.0 / (float)size; // Normalisation for sinc function 2
     135    float norm1 = size / 2.0 / PS_SQR(M_PI); // Normalisation for laczos
     136    float norm2 = M_PI;                // Normalisation for sinc function 1
     137    float norm3 = M_PI * 2.0 / (float)size; // Normalisation for sinc function 2
    138138    float pos = - (size - 1)/2 - frac;  // Position of interest
    139139    for (int i = 0; i < size; i++, pos += 1.0) {
Note: See TracChangeset for help on using the changeset viewer.