Changeset 27319 for trunk/psModules
- Timestamp:
- Mar 18, 2010, 12:01:15 PM (16 years ago)
- Location:
- trunk/psModules/src/imcombine
- Files:
-
- 2 edited
-
pmStackReject.c (modified) (5 diffs)
-
pmStackReject.h (modified) (1 diff)
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); -
trunk/psModules/src/imcombine/pmStackReject.h
r20568 r27319 12 12 int numCols, int numRows, ///< Size of image of interest 13 13 float threshold, ///< Threshold on convolved image, 0..1 14 float poorFrac, ///< Fraction for "poor"15 14 int stride, ///< Size of convolution patches 16 15 const psArray *regions, ///< Array of image regions for image 17 16 const psArray *kernels ///< Array of kernel parameters for each region 17 ); 18 19 /// Given a list of pixels from the convolved image, we grow them by convolution to get the list of all pixels 20 /// which should be rejected. 21 psPixels *pmStackRejectGrow(const psPixels *in, ///< List of pixels in the convolved image 22 int numCols, int numRows, ///< Size of image of interest 23 float poorFrac, ///< Fraction for "poor" 24 const psArray *regions, ///< Array of image regions for image 25 const psArray *kernels ///< Array of kernel parameters for each region 18 26 ); 19 27
Note:
See TracChangeset
for help on using the changeset viewer.
