Changeset 41957 for branches/eam_branches/ipp-20211108
- Timestamp:
- Dec 3, 2021, 8:02:04 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c
r41954 r41957 1715 1715 if ((Npt < 1) || (nGood < MIN_GOOD_PERCENTILE)) ESCAPE; 1716 1716 1717 // XXX note that this does not respect the clipping above1718 // set the given (suspect) mask bit if nGoodBits[i] > f*nGood1719 // in other words if more than 65% of the good inputs had one of1720 // these bits set, then we should set that bit in the output mask1717 // Set the given (suspect) mask bit if nGoodBits[i] > f*nGood in other words 1718 // if more than 65% of the good inputs had one of these bits set, then we 1719 // should set that bit in the output mask. Note that this analysis counts the 1720 // mask bits of pixels rejected by the clipping above. 1721 1721 psImageMaskType value = 0x0001; 1722 1722 psImageMaskType outputMask = 0x0000; … … 1735 1735 } 1736 1736 float mean = sum / (float) Npt; 1737 float varValue = varSum / (float) (nGoodClip*nGoodClip); 1737 1738 1738 1739 // alternative: calculate the stdev of the pixel values … … 1742 1743 // } 1743 1744 // variance on the mean (stdev / sqrt(N))^2 1745 1746 // the reported variance values can be extremely high / wrong. 1747 // if we have enough measurements, let's just use the interquartile range 1748 // of the data to estimate the per-pixel variance. NOTE: this is not valid 1749 // if the inputs have been significantly smoothed. In that case we need 1750 // to include the covariance explicitly. But this algorithm should be used 1751 // without convolution. 1752 // XXX How do we choose the cutoff here? 1753 if (nGoodClip >= 9) { 1754 // Measure interquartile range 1755 int P25 = 0.25*nGoodClip + Nlo; 1756 int P75 = 0.75*nGoodClip + Nlo; 1757 float rawSigma = 0.74*(pixelData->data.F32[P75] - pixelData->data.F32[P25]); 1758 varValue = PS_SQR(rawSigma) / (float) nGoodClip; // sigma_mean = sigma_meas / sqrt(Nmeas) -> var_mean = var_meas / Nmeas 1759 } 1744 1760 1745 1761 // Note: since we are calculating the average of a subset of a sorted … … 1752 1768 1753 1769 // this coefficient varies between 1.4 (for pure median) and 1.05 for 68% range. 1754 1755 float varValue = varSum / (float) (nGoodClip*nGoodClip);1756 1770 1757 1771 combined->image->data.F32[y][x] = mean;
Note:
See TracChangeset
for help on using the changeset viewer.
