IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 28, 2012, 1:54:24 PM (13 years ago)
Author:
bills
Message:

In psImageSmooth, handle sigma values that result in Nrange < 1. If sigma < .25 skip smoothing

File:
1 edited

Legend:

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

    r33089 r34724  
    605605    PS_ASSERT_IMAGE_NON_NULL(image, false);
    606606
     607    if (sigma < 0.25) {
     608        psTrace("psLib.imageops", 5, "sigma: %f < 0.25 skipping smoothing", sigma);
     609        return true;
     610    }
     611
    607612    // relevant terms
    608613    int Nrange = sigma*Nsigma + 0.5;    // Number of pixels either side for convolution kernel
     614    if (Nrange < 1) {
     615        // using zero will cause an arithmetic exception in the loop
     616        psTrace("psLib.imageops", 5, "Nrange %d for smoothing too small skipping smoothing", Nrange);
     617        return true;
     618    }
    609619    int Nx = image->numCols;            // Number of columns
    610620    int Ny = image->numRows;            // Number of rows
Note: See TracChangeset for help on using the changeset viewer.