IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16851


Ignore:
Timestamp:
Mar 6, 2008, 12:33:21 PM (18 years ago)
Author:
Paul Price
Message:

Fake convolution when NO_CONVOLUTION is defined. This should speed things up when testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackMatch.c

    r16834 r16851  
    1313
    1414//#define TESTING
     15#define NO_CONVOLUTION
    1516
    1617bool ppStackMatch(pmReadout *readout, psArray **regions, psArray **kernels,
     
    2425    assert(config);
    2526
     27    pmReadout *output = pmReadoutAlloc(NULL); // Output readout, for holding results temporarily
     28
    2629    // Look up appropriate values from the ppSub recipe
    27     bool mdok;                          // Status of MD lookup
    2830    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
    2931    int size = psMetadataLookupS32(NULL, recipe, "KERNEL.SIZE"); // Kernel half-size
     32
     33#ifndef NO_CONVOLUTION
     34    bool mdok;                          // Status of MD lookup
    3035    int order = psMetadataLookupS32(NULL, recipe, "SPATIAL.ORDER"); // Spatial polynomial order
    3136    float regionSize = psMetadataLookupF32(NULL, recipe, "REGION.SIZE"); // Size of iso-kernel regs
     
    8388        psFree(fake);
    8489        psFree(optWidths);
     90        psFree(output);
    8591        return false;
    8692    }
     
    95101
    96102    // Do the image matching
    97     pmReadout *output = pmReadoutAlloc(NULL); // Output readout, for holding results temporarily
    98103    if (!pmSubtractionMatch(output, NULL, readout, fake, footprint, regionSize, spacing, threshold,
    99104                            sources, stampsName, type, size, order, widths, orders, inner, ringsOrder,
     
    116121    readout->mask   = psMemIncrRefCounter(output->mask);
    117122    readout->weight = psMemIncrRefCounter(output->weight);
     123
     124#else  // NO_CONVOLUTION
     125    // Fake the convolution
     126    {
     127        psRegion *region = psRegionAlloc(0, 0, readout->image->numCols - 1, readout->image->numRows - 1);
     128        psMetadataAddPtr(output->analysis, PS_LIST_TAIL, PM_SUBTRACTION_ANALYSIS_REGION, PS_META_DUPLICATE_OK,
     129                         "Fake subtraction region", region);
     130        psFree(region);
     131        pmSubtractionKernels *kernels = pmSubtractionKernelsPOIS(size, 0, PM_SUBTRACTION_MODE_1);
     132        // Set solution to delta function
     133        kernels->solution1 = psVectorAlloc(kernels->num + 1, PS_TYPE_F64);
     134        psVectorInit(kernels->solution1, 0.0);
     135        for (int i = 0; i < kernels->num; i++) {
     136            if (kernels->u->data.S32[i] == 0 && kernels->v->data.S32[i] == 0) {
     137                kernels->solution1->data.F64[i] = 1.0;
     138            }
     139        }
     140        psMetadataAddPtr(output->analysis, PS_LIST_TAIL, PM_SUBTRACTION_ANALYSIS_KERNEL, PS_META_DUPLICATE_OK,
     141                         "Fake subtraction kernel", kernels);
     142        psFree(kernels);
     143    }
     144#endif
    118145
    119146    // Extract the regions and solutions used in the image matching
Note: See TracChangeset for help on using the changeset viewer.