Changeset 15953
- Timestamp:
- Dec 28, 2007, 12:52:30 PM (18 years ago)
- Location:
- trunk/ppMerge/src
- Files:
-
- 4 edited
-
ppMergeMask.h (modified) (1 diff)
-
ppMergeMaskGrow.c (modified) (4 diffs)
-
ppMergeOptions.c (modified) (2 diffs)
-
ppMergeOptions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeMask.h
r15937 r15953 37 37 ); 38 38 39 bool ppMergeMaskGrowReadout (pmReadout *readout, psMaskType maskVal );39 bool ppMergeMaskGrowReadout (pmReadout *readout, psMaskType maskVal, int nPixels); 40 40 41 41 bool ppMergeMaskReadoutStats(const pmReadout *readout, -
trunk/ppMerge/src/ppMergeMaskGrow.c
r15937 r15953 18 18 // Generate a mask 19 19 bool ppMergeMaskGrow(ppMergeData *data, // Data 20 ppMergeOptions *options, // Options21 pmConfig *config // Configuration20 ppMergeOptions *options, // Options 21 pmConfig *config // Configuration 22 22 ) 23 23 { … … 35 35 while ((roOut = pmFPAviewNextReadout(view, fpaOut, 1))) { 36 36 37 ppMergeMaskGrowReadout(roOut, options->combine->maskVal); 38 37 // do this N iterations (XXX add to options) 38 ppMergeMaskGrowReadout(roOut, options->combine->maskVal, options->growPixels); 39 ppMergeMaskGrowReadout(roOut, options->combine->maskVal, options->growPixels); 39 40 } 40 41 } … … 46 47 } 47 48 48 # define NGROW 2 49 50 bool ppMergeMaskGrowReadout (pmReadout *readout, psMaskType maskVal) { 49 bool ppMergeMaskGrowReadout (pmReadout *readout, psMaskType maskVal, int nPixels) { 51 50 52 51 if (!readout->mask) return true; … … 62 61 for (int iy = 0; iy < Ny; iy++) { 63 62 for (int ix = 0; ix < Nx; ix++) { 64 65 if (oldMask->data.U8[iy][ix] && maskVal) {66 67 for (int jy = -NGROW; jy <= +NGROW; jy++) {68 int ny = iy + jy;69 if (ny < 0) continue;70 if ( ny >= Ny) continue;71 for (int jx = -NGROW; jx <= +NGROW; jx++) {72 int nx = ix + jx;73 if (nx < 0) continue;74 if (nx >= Nx) continue;75 n ewMask->data.U8[ny][nx] |= oldMask->data.U8[iy][ix];63 int nSum = 0; 64 for (int jy = -1; jy <= +1; jy++) { 65 int ny = iy + jy; 66 if (ny < 0) continue; 67 if (ny >= Ny) continue; 68 for (int jx = -1; jx <= +1; jx++) { 69 if (!jx && !jy) continue; 70 int nx = ix + jx; 71 if (nx < 0) continue; 72 if (nx >= Nx) continue; 73 if (oldMask->data.U8[ny][nx] & maskVal) { 74 nSum ++; 76 75 } 77 76 } 78 77 } 78 if (nSum >= nPixels) { 79 newMask->data.U8[iy][ix] = maskVal; 80 } else { 81 newMask->data.U8[iy][ix] = oldMask->data.U8[iy][ix]; 82 } 79 83 } 80 84 } 81 82 85 psFree (readout->mask); 83 86 readout->mask = newMask; -
trunk/ppMerge/src/ppMergeOptions.c
r15914 r15953 64 64 options->satMask = 0x00; 65 65 options->badMask = 0x00; 66 options->growPixels = 0; 66 67 return options; 67 68 } … … 156 157 OPTION_PARSE(options->maskBad, recipe, "MASK.BAD", F32); 157 158 OPTION_PARSE(options->statsByChip, recipe, "STATS.BY.CHIP", Bool); 159 OPTION_PARSE(options->growPixels, recipe, "MASK.GROW.NPIX", S32); 158 160 159 161 const char *masks = psMetadataLookupStr(NULL, recipe, "MASKVAL"); -
trunk/ppMerge/src/ppMergeOptions.h
r15914 r15953 43 43 psMaskType satMask; // Mask value for saturated pixels 44 44 psMaskType badMask; // Mask value for bad (low) pixels 45 int growPixels; 45 46 } ppMergeOptions; 46 47
Note:
See TracChangeset
for help on using the changeset viewer.
