IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30341


Ignore:
Timestamp:
Jan 22, 2011, 11:55:36 AM (15 years ago)
Author:
eugene
Message:

psKernelTruncate was failing drastically (zeroing the kernel) if the maxSize was reached

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psLib/src/imageops/psImageConvolve.c

    r30299 r30341  
    275275    float threshold = sumKernel * (1.0 - frac); // Threshold for truncation
    276276
     277    int truncateRadius = maxSize;       // Truncation radius
     278    bool truncate = false;
     279
    277280    // Find truncation size
    278     int truncate = 0;                     // Truncation radius
    279     for (int radius = 1; truncate == 0 && radius < maxSize; radius++) {
     281    for (int radius = 1; !truncate && (radius < maxSize); radius++) {
    280282        int uMin = PS_MAX(-radius, xMin);
    281283        int uMax = PS_MIN(radius, xMax);
     
    293295            }
    294296        }
     297        // This is the truncation radius
    295298        if (sum > threshold) {
    296             // This is the truncation radius
    297             truncate = radius;
    298         }
    299     }
    300     if (truncate == maxSize) {
    301         // No truncation possible
     299            truncate = true;
     300            truncateRadius = radius;
     301        }
     302    }
     303
     304    // Do nothing if no truncation is possible
     305    if (!truncate) {
    302306        return true;
    303307    }
Note: See TracChangeset for help on using the changeset viewer.