Changeset 16851
- Timestamp:
- Mar 6, 2008, 12:33:21 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r16834 r16851 13 13 14 14 //#define TESTING 15 #define NO_CONVOLUTION 15 16 16 17 bool ppStackMatch(pmReadout *readout, psArray **regions, psArray **kernels, … … 24 25 assert(config); 25 26 27 pmReadout *output = pmReadoutAlloc(NULL); // Output readout, for holding results temporarily 28 26 29 // Look up appropriate values from the ppSub recipe 27 bool mdok; // Status of MD lookup28 30 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe 29 31 int size = psMetadataLookupS32(NULL, recipe, "KERNEL.SIZE"); // Kernel half-size 32 33 #ifndef NO_CONVOLUTION 34 bool mdok; // Status of MD lookup 30 35 int order = psMetadataLookupS32(NULL, recipe, "SPATIAL.ORDER"); // Spatial polynomial order 31 36 float regionSize = psMetadataLookupF32(NULL, recipe, "REGION.SIZE"); // Size of iso-kernel regs … … 83 88 psFree(fake); 84 89 psFree(optWidths); 90 psFree(output); 85 91 return false; 86 92 } … … 95 101 96 102 // Do the image matching 97 pmReadout *output = pmReadoutAlloc(NULL); // Output readout, for holding results temporarily98 103 if (!pmSubtractionMatch(output, NULL, readout, fake, footprint, regionSize, spacing, threshold, 99 104 sources, stampsName, type, size, order, widths, orders, inner, ringsOrder, … … 116 121 readout->mask = psMemIncrRefCounter(output->mask); 117 122 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 118 145 119 146 // Extract the regions and solutions used in the image matching
Note:
See TracChangeset
for help on using the changeset viewer.
