Changeset 27319 for trunk/psModules/src/imcombine/pmStackReject.c
- Timestamp:
- Mar 18, 2010, 12:01:15 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStackReject.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStackReject.c
r27307 r27319 10 10 #include "pmSubtractionThreads.h" 11 11 #include "pmSubtractionKernels.h" 12 13 #include "pmStackReject.h" 12 14 13 15 #define PIXEL_LIST_BUFFER 100 // Number of pixels to add to list at a time … … 115 117 116 118 117 psPixels *pmStackReject(const psPixels *in, int numCols, int numRows, float threshold, float poorFrac,118 int stride,const psArray *subRegions, const psArray *subKernels)119 psPixels *pmStackReject(const psPixels *in, int numCols, int numRows, float threshold, int stride, 120 const psArray *subRegions, const psArray *subKernels) 119 121 { 120 122 PS_ASSERT_PIXELS_NON_NULL(in, NULL); … … 223 225 psTrace("psModules.imcombine", 7, "Found %ld bad pixels", bad->n); 224 226 225 // Now, grow the mask to include everything that touches a bad pixel in the convolution 226 psImage *source = psPixelsToMask(NULL, bad, psRegionSet(0, numCols - 1, 0, numRows - 1), 227 return bad; 228 } 229 230 231 psPixels *pmStackRejectGrow(const psPixels *in, int numCols, int numRows, float poorFrac, 232 const psArray *subRegions, const psArray *subKernels) 233 { 234 PS_ASSERT_PIXELS_NON_NULL(in, NULL); 235 PS_ASSERT_ARRAY_NON_NULL(subRegions, NULL); 236 PS_ASSERT_ARRAY_NON_NULL(subKernels, NULL); 237 PS_ASSERT_ARRAYS_SIZE_EQUAL(subRegions, subKernels, NULL); 238 239 psImage *source = psPixelsToMask(NULL, in, psRegionSet(0, numCols - 1, 0, numRows - 1), 227 240 PM_STACK_MASK_BAD); // Mask image to grow 228 241 … … 243 256 bool oldThreads = psImageConvolveSetThreads(false); // Old value of threading for psImageColvolve 244 257 245 psImage *target = psImage Recycle(convolved,numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image258 psImage *target = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image 246 259 psImageInit(target, 0); 247 260 for (int i = 0; i < subRegions->n; i++) { … … 326 339 327 340 psFree(source); 328 bad = psPixelsFromMask(bad, target, PM_STACK_MASK_ALL);341 psPixels *bad = psPixelsFromMask(NULL, target, PM_STACK_MASK_ALL); // All bad pixels 329 342 psFree(target); 330 343 psTrace("psModules.imcombine", 7, "Total %ld bad pixels", bad->n);
Note:
See TracChangeset
for help on using the changeset viewer.
