Changeset 29219
- Timestamp:
- Sep 23, 2010, 8:28:16 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/psModules/src/imcombine/pmStack.c
r29215 r29219 19 19 20 20 #include <stdio.h> 21 #include <st darg.h>21 #include <string.h> // for memset 22 22 #include <pslib.h> 23 23 … … 328 328 *goodMask = 0xffff; 329 329 330 int nGoodBits[16]; // accumulate the good pixel bits here for fuzzy logic 331 psAssert (sizeof(psImageMaskType) == 2, "psImageMaskType is not the expected size"); 332 memset (nGoodBits, 0, 16*sizeof(int)); 333 330 334 // Extract the pixel and mask data 331 335 int numGood = 0; // Number of good pixels … … 371 375 pixelSuspects->data.U8[numGood] = mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & suspectMaskBits ? true : false; 372 376 373 *goodMask &= mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn]; // save the mask bits still used 377 // *goodMask &= mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn]; // save the mask bits still used 378 // check for set bits and increment counter as appropriate 379 { 380 psImageMaskType value = 0x0001; 381 for (int nbit = 0; nbit < 16; nbit ++) { 382 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & value) { 383 nGoodBits[nbit] ++; 384 } 385 value <<= 1; 386 } 387 } 374 388 375 389 psImage *image = data->readout->image; // Image of interest … … 395 409 pixelSuspects->n = numGood; 396 410 *num = numGood; 411 412 // set the mask bits if nGoodBits[i] > f*numGood 413 { 414 # define SUSPECT_FRACTION 0.65 415 *goodMask = 0x0000; 416 psImageMaskType value = 0x0001; 417 for (int nbit = 0; nbit < 16; nbit ++) { 418 if (nGoodBits[nbit] > SUSPECT_FRACTION*numGood) { 419 *goodMask |= value; 420 } 421 value <<= 1; 422 } 423 } 397 424 398 425 #ifdef TESTING
Note:
See TracChangeset
for help on using the changeset viewer.
