IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 30, 2009, 4:27:45 PM (17 years ago)
Author:
bills
Message:

don't try and change image values that are not finite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppbgrestore/src/ppbgrestoreLoop.c

    r25973 r25974  
    113113        for (int y = 0; y < numRows; y++) {
    114114            for (int x = 0; x < numCols; x++) {
    115                 float value = backData[y][x];
    116                 if (!isfinite(value)) {
     115                float imageval =  image->data.F32[y][x] ;
     116                float bgvalue = backData[y][x];
     117                if (!isfinite(bgvalue)) {
    117118                    // if background is NAN leave the image unchanged
    118119                    // According to ppImageSubtractBackground pixels where the background is not finite should be NAN
    119120                    // experimentally
    120121                    // for breakpoint
    121                     float imageval =  image->data.F32[y][x] ;
    122122                    nancount++;
    123123                    if (isfinite(imageval)) {
     
    128128                    //      NANS are appearing in the model for some reason.
    129129                    //      image->data.F32[y][x] = NAN;
    130                 } else {
     130                } else if (isfinite(imageval)) {
    131131                    // XXX: TODO:following ppImage we should not modify pixels that are masked.
    132                     image->data.F32[y][x] += value;
     132                    image->data.F32[y][x] += bgvalue;
    133133                }
    134134            }
Note: See TracChangeset for help on using the changeset viewer.