Changeset 35533
- Timestamp:
- May 8, 2013, 1:38:20 PM (13 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 3 edited
-
ppImage.h (modified) (1 diff)
-
ppImageAuxiliaryMask.c (modified) (7 diffs)
-
ppImageLoop.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImage.h
r35531 r35533 315 315 void ppImageRandomGaussianFree(void); 316 316 317 bool ppImageAuxiliaryMask(pmConfig *config, const pmFPAview *view, const ppImageOptions *options );317 bool ppImageAuxiliaryMask(pmConfig *config, const pmFPAview *view, const ppImageOptions *options, psMetadata *stats); 318 318 319 319 #endif -
trunk/ppImage/src/ppImageAuxiliaryMask.c
r35531 r35533 53 53 54 54 // In this function, we augment the mask with the more conservative auxiliary mask 55 bool ppImageAuxiliaryMask(pmConfig *config, const pmFPAview *view, const ppImageOptions *options )55 bool ppImageAuxiliaryMask(pmConfig *config, const pmFPAview *view, const ppImageOptions *options, psMetadata *stats) 56 56 { 57 57 psAssert(config, "Need configuration"); … … 60 60 61 61 if (!options->doAuxMask) { 62 psLogMsg ("ppImage", PS_LOG_INFO, "Auxiliary mask not enabled."); 62 63 return true; 63 64 } … … 139 140 return false; 140 141 } 142 psLogMsg ("ppImage", PS_LOG_INFO, "Auxiliary mask file: %s", auxMaskFileName); 141 143 142 144 psFree(results); … … 160 162 return false; 161 163 } 164 psLogMsg ("ppImage", PS_LOG_INFO, "Auxiliary video mask file: %s", options->auxVideoMask); 162 165 pmConfigRunFilenameAddRead(config, "PPIMAGE.AUXVIDEOMASK", options->auxVideoMask); 163 166 recordFileInHeader(chip, "DETREND.AUXVIDEOMASK", "auxiliary video mask", options->auxVideoMask); … … 179 182 psImageMaskType maskDetector = pmConfigMaskGet("DETECTOR", config); 180 183 184 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PPIMAGE"); 185 psAssert(recipe, "Need recipe!"); 186 psImageMaskType staticMaskVal = psMetadataLookupImageMask(&status, recipe, "MASKSTAT.STATIC"); 187 psAssert(staticMaskVal, "Need staticMaskVal!"); 188 181 189 int numCols = mask->numCols, numRows = mask->numRows; // Size of image 190 unsigned long numMasked = 0; 182 191 for (int y = 0; y < numRows; y++) { 183 192 for (int x = 0; x < numCols; x++) { … … 185 194 // XXX: support other types and get the mask value from the header 186 195 if (auxMask->data.F32[y][x] == 0) { 187 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskDetector; 196 if ((mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & staticMaskVal) == 0) { 197 // pixel was not previously included in the static mask so mask it 198 ++numMasked; 199 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskDetector; 200 } 188 201 // I don't need to do this. 189 202 // The background subtraction code runs after us and will do it there … … 193 206 } 194 207 208 float maskedFrac = (float) numMasked / (numRows * numCols); 209 psLogMsg ("ppImage", PS_LOG_INFO, "Auxiliary masks masked %ld aditional pixels. Masked fraction: %f", numMasked, maskedFrac); 210 if (stats) { 211 psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_MAGIC", PS_META_REPLACE, 212 "Fraction of pixels masked by auxiliary masks", maskedFrac); 213 } 214 195 215 psFree(auxMask); 196 216 -
trunk/ppImage/src/ppImageLoop.c
r35531 r35533 189 189 } 190 190 191 if (!ppImageAuxiliaryMask(config, view, options )) {191 if (!ppImageAuxiliaryMask(config, view, options, stats)) { 192 192 ESCAPE("Unable to apply auxiliary mask"); 193 193 }
Note:
See TracChangeset
for help on using the changeset viewer.
