IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2010, 6:02:38 PM (16 years ago)
Author:
Paul Price
Message:

Fairly extensive change to make subtractions more stable on images with limited lit area in the presence of spatial variation. Took the polynomials which were scaled over the entire image and scale them only over the lit area. Removed some fprintf statements. Fixed the problem causing the background term to always come out 1.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/imcombine/pmSubtractionStamps.c

    r26735 r26739  
    709709        }
    710710    }
    711     fprintf(stderr, "Normalization window radius: %d\n", stamps->normWindow);
    712711
    713712    psTrace("psModules.imcombine", 3, "Normalisation window radius set to %d\n", stamps->normWindow);
     
    741740
    742741bool pmSubtractionStampsExtract(pmSubtractionStampList *stamps, psImage *image1, psImage *image2,
    743                                 psImage *variance, int kernelSize)
     742                                psImage *variance, int kernelSize, psRegion bounds)
    744743{
    745744    PM_ASSERT_SUBTRACTION_STAMP_LIST_NON_NULL(stamps, false);
     
    758757    }
    759758
    760     int numCols = image1->numCols, numRows = image1->numRows; // Size of images
    761759    int size = kernelSize + stamps->footprint; // Size of postage stamps
    762760
     
    767765        }
    768766
    769         if (isnan(stamp->xNorm)) {
    770             stamp->xNorm = 2.0 * (stamp->x - (float)numCols/2.0) / (float)numCols;
    771         }
    772         if (isnan(stamp->yNorm)) {
    773             stamp->yNorm = 2.0 * (stamp->y - (float)numRows/2.0) / (float)numRows;
    774         }
     767        p_pmSubtractionPolynomialNormCoords(&stamp->xNorm, &stamp->yNorm, stamp->x, stamp->y,
     768                                            bounds.x0, bounds.x1, bounds.y0, bounds.y1);
    775769
    776770        int x = stamp->x + 0.5, y = stamp->y + 0.5; // Stamp coordinates
    777         if (x < size || x > numCols - size || y < size || y > numRows - size) {
    778             psError(PS_ERR_UNKNOWN, false, "Stamp %d (%d,%d) is within the image border.\n", i, x, y);
     771        if (x < bounds.x0 + size || x > bounds.x1 - size || y < bounds.y0 + size || y > bounds.y1 - size) {
     772            psError(PS_ERR_UNKNOWN, false, "Stamp %d (%d,%d) is within the region border.\n", i, x, y);
    779773            return false;
    780774        }
Note: See TracChangeset for help on using the changeset viewer.