IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 7:34:39 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201 (substantially changes to the kernel matching code; updates to pmDetection container, added pmPattern, etc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStackReject.c

    r25468 r26893  
    3535{
    3636    int size = kernels->size;           // Half-size of convolution kernel
    37     psImage *polyValues = p_pmSubtractionPolynomialFromCoords(NULL, kernels, numCols, numRows,
    38                                                               xMin + size + 1, yMin + size + 1); // Polynomial
     37    int x = PS_MIN(xMin + size + 1, kernels->xMax); // x coordinate of interest
     38    int y = PS_MIN(yMin + size + 1, kernels->yMax); // y coordinate of interest
     39
     40    psImage *polyValues = p_pmSubtractionPolynomialFromCoords(NULL, kernels, x, y); // Polynomial
    3941    int box = p_pmSubtractionBadRadius(NULL, kernels, polyValues, false, poorFrac); // Radius of bad box
    4042    psTrace("psModules.imcombine", 10, "Growing by %d", box);
     
    150152    pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image
    151153    inRO->image = image;
     154    convRO->image = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32);
    152155    for (int i = 0; i < numRegions; i++) {
    153156        psRegion *region = subRegions->data[i]; // Region of interest
    154157        pmSubtractionKernels *kernels = subKernels->data[i]; // Kernel of interest
    155         if (!pmSubtractionConvolve(NULL, convRO, NULL, inRO, NULL, stride, 0, 0, 1.0, 0.0,
     158        if (!pmSubtractionConvolve(NULL, convRO, NULL, inRO, NULL, stride, 0, 0, 1.0, 0.0, 0.0,
    156159                                   region, kernels, false, true)) {
    157160            psError(PS_ERR_UNKNOWN, false, "Unable to convolve mask image in region %d.", i);
     
    165168
    166169        // Image of the kernel at the centre of the region
    167         float xNorm = (region->x0 + 0.5 * (region->x1 - region->x0) - kernels->numCols/2.0) /
    168             (float)kernels->numCols;
    169         float yNorm = (region->y0 + 0.5 * (region->y1 - region->y0) - kernels->numRows/2.0) /
    170             (float)kernels->numRows;
    171         psImage *kernel = pmSubtractionKernelImage(kernels, xNorm, yNorm, false);
     170        psImage *kernel = pmSubtractionKernelImage(kernels, 0.5, 0.5, false);
    172171        if (!kernel) {
    173172            psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image.");
Note: See TracChangeset for help on using the changeset viewer.