Changeset 41852 for branches/eam_branches/ipp-dev-20210817/psModules
- Timestamp:
- Oct 22, 2021, 5:45:06 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-dev-20210817/psModules/src/imcombine/pmStack.c
r41843 r41852 756 756 // *goodMask &= mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn]; // save the mask bits still used 757 757 // check for set bits and increment counter as appropriate 758 // count the number of times a given mask bit is set in the input pixels. 759 // NOTE: since we have explicitly skipped the pixels with any bad bits, these are only 760 // the suspect bits (nGoodBits is a bit of a misnomer: it is more like 'nSuspectBitsForGoodInputs' 758 761 { 759 762 psImageMaskType value = 0x0001; … … 1550 1553 pmReadout *ro = data->readout; // Readout of interest 1551 1554 psImage *image = ro->image; 1555 psImage *mask = ro->mask; 1552 1556 1553 1557 int xIn = x - data->readout->col0; … … 1557 1561 if (fabs(image->data.F32[yIn][xIn]) > 1e5) continue; 1558 1562 // XXX need to test the input mask as well here 1563 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & badMaskBits); 1564 1565 // XXX save the count of suspect bits 1566 1567 # if (0) 1568 // count the number of times a given mask bit is set in the input pixels. 1569 // NOTE: since we have explicitly skipped the pixels with any bad bits, these are only 1570 // the suspect bits (nGoodBits is a bit of a misnomer: it is more like 'nSuspectBitsForGoodInputs' 1571 if (1) { 1572 psImageMaskType value = 0x0001; 1573 for (int nbit = 0; nbit < 16; nbit ++) { 1574 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & value) { 1575 // XXX nGoodBits[nbit] ++; 1576 } 1577 value <<= 1; 1578 } 1579 } 1580 # endif 1559 1581 1560 1582 pixelData->data.F32[nGood] = image->data.F32[yIn][xIn]; … … 1571 1593 } 1572 1594 1595 # if (0) 1596 # define SUSPECT_FRACTION 0.65 1597 // set the mask bits if nGoodBits[i] > f*numGood 1598 if (0) { 1599 psImageMaskType value = 0x0001; 1600 for (int nbit = 0; nbit < 16; nbit ++) { 1601 if (nGoodBits[nbit] > SUSPECT_FRACTION*numGood) { 1602 *goodMask |= value; 1603 } 1604 value <<= 1; 1605 } 1606 } 1607 # endif 1608 1573 1609 int Ns = MIN(MAX(0, minRange * nGood),nGood); // e.g., 0.1 * 50 = 5 1574 1610 int Ne = MIN(MAX(0, maxRange * nGood),nGood); // e.g., 0.9 * 50 = 45 … … 1587 1623 // variance on the mean (stdev / sqrt(N))^2 1588 1624 float varValue = varSum / (Npt - 1) / Npt; 1625 1626 // XXX this is probably not the correct variance to save 1627 // the predicted variance should be the 1 / sum (1/var) 1589 1628 1590 1629 combined->image->data.F32[y][x] = mean;
Note:
See TracChangeset
for help on using the changeset viewer.
