Changeset 20568 for trunk/psModules/src/imcombine/pmSubtraction.c
- Timestamp:
- Nov 6, 2008, 2:07:23 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r20561 r20568 1088 1088 1089 1089 bool pmSubtractionConvolve(pmReadout *out1, pmReadout *out2, const pmReadout *ro1, const pmReadout *ro2, 1090 psImage *subMask, psMaskType maskBad, psMaskType maskPoor, float poorFrac,1091 float sysError, const psRegion *region, const pmSubtractionKernels *kernels,1092 bool doBG, bool useFFT)1090 psImage *subMask, int stride, psMaskType maskBad, psMaskType maskPoor, 1091 float poorFrac, float sysError, const psRegion *region, 1092 const pmSubtractionKernels *kernels, bool doBG, bool useFFT) 1093 1093 { 1094 1094 int numCols = 0, numRows = 0; // Image dimensions … … 1124 1124 PS_ASSERT_IMAGE_SIZE(subMask, numCols, numRows, false); 1125 1125 } 1126 PS_ASSERT_INT_NONNEGATIVE(stride, false); 1127 PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(poorFrac, 0.0, false); 1128 PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(poorFrac, 1.0, false); 1129 PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(sysError, 0.0, false); 1130 PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(sysError, 1.0, false); 1126 1131 if (region && psRegionIsNaN(*region)) { 1127 1132 psString string = psRegionToString(*region); … … 1212 1217 1213 1218 int size = kernels->size; // Half-size of kernel 1214 int fullSize = 2 * size + 1; // Full size of kernel1215 1219 1216 1220 // Get region for convolution: [xMin:xMax,yMin:yMax] … … 1236 1240 psImageConvolveSetThreads(false); 1237 1241 1238 for (int j = yMin; j < yMax; j += fullSize) { 1239 int ySubMax = PS_MIN(j + fullSize, yMax); // Range for subregion of interest 1240 for (int i = xMin; i < xMax; i += fullSize) { 1241 int xSubMax = PS_MIN(i + fullSize, xMax); // Range for subregion of interest 1242 if (stride == 0) { 1243 // Use the full size of the kernel 1244 stride = 2 * size + 1; 1245 } 1246 1247 for (int j = yMin; j < yMax; j += stride) { 1248 int ySubMax = PS_MIN(j + stride, yMax); // Range for subregion of interest 1249 for (int i = xMin; i < xMax; i += stride) { 1250 int xSubMax = PS_MIN(i + stride, xMax); // Range for subregion of interest 1242 1251 1243 1252 psRegion *subRegion = psRegionAlloc(i, xSubMax, j, ySubMax); // Bounds of subtraction
Note:
See TracChangeset
for help on using the changeset viewer.
