Changeset 30752 for branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintFindAtPoint.c
- Timestamp:
- Feb 24, 2011, 12:47:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintFindAtPoint.c
r29004 r30752 31 31 * 32 32 * This is the guts of pmFootprintsFindAtPoint 33 * 34 * This function is/was ill-defined if pixel values are NAN. we should either treat NAN as > 35 * threshold or < threshold, but the current (r29004) code is ambiguous. 36 * EAM : change code so NAN is always > threshold 33 37 */ 34 38 bool pmFootprintSpansBuild(pmFootprint *fp, // the footprint that we're building … … 103 107 for (int j = x0 - 1; j >= -1; j--) { 104 108 double pixVal = (j < 0) ? threshold - 100 : (F32 ? imgRowF32[j] : imgRowS32[j]); 105 if ((maskRow[j] & PM_STARTSPAN_DETECTED) || pixVal < threshold) { 109 bool belowThreshold = (pixVal < threshold) && isfinite(pixVal); 110 if ((maskRow[j] & PM_STARTSPAN_DETECTED) || belowThreshold) { 106 111 if (j < x0 - 1) { // we found some pixels above threshold 107 112 nx0 = j + 1; … … 119 124 for (int j = nx0 + 1; j <= numCols; j++) { 120 125 double pixVal = (j >= numCols) ? threshold - 100 : (F32 ? imgRowF32[j] : imgRowS32[j]); 121 if ((maskRow[j] & PM_STARTSPAN_DETECTED) || pixVal < threshold) { 126 bool belowThreshold = (pixVal < threshold) && isfinite(pixVal); 127 if ((maskRow[j] & PM_STARTSPAN_DETECTED) || belowThreshold) { 122 128 nx1 = j - 1; 123 129 break; … … 146 152 for (int j = nx1 + 1; j <= x1 + 1; j++) { 147 153 double pixVal = (j >= numCols) ? threshold - 100 : (F32 ? imgRowF32[j] : imgRowS32[j]); 148 if (!(maskRow[j] & PM_STARTSPAN_DETECTED) && pixVal >= threshold) { 154 bool aboveThreshold = (pixVal >= threshold) || !isfinite(pixVal); 155 if (!(maskRow[j] & PM_STARTSPAN_DETECTED) && aboveThreshold) { 149 156 int sx0 = j++; // span that we're working on is sx0:sx1 150 157 int sx1 = -1; // We know that if we got here, we'll also set sx1 151 158 for (; j <= numCols; j++) { 152 159 double pixVal = (j >= numCols) ? threshold - 100 : (F32 ? imgRowF32[j] : imgRowS32[j]); 153 if ((maskRow[j] & PM_STARTSPAN_DETECTED) || pixVal < threshold) { // end of span 160 bool belowThreshold = (pixVal < threshold) && isfinite(pixVal); 161 if ((maskRow[j] & PM_STARTSPAN_DETECTED) || belowThreshold) { // end of span 154 162 sx1 = j; 155 163 break; … … 306 314 for (i = col; i >= 0; i--) { 307 315 pixVal = F32 ? imgRowF32[i] : imgRowS32[i]; 308 if ((maskRow[i] & PM_STARTSPAN_DETECTED) || pixVal < threshold) { 316 bool belowThreshold = (pixVal < threshold) && isfinite(pixVal); 317 if ((maskRow[i] & PM_STARTSPAN_DETECTED) || belowThreshold) { 309 318 break; 310 319 } … … 313 322 for (i = col; i < numCols; i++) { 314 323 pixVal = F32 ? imgRowF32[i] : imgRowS32[i]; 315 if ((maskRow[i] & PM_STARTSPAN_DETECTED) || pixVal < threshold) { 324 bool belowThreshold = (pixVal < threshold) && isfinite(pixVal); 325 if ((maskRow[i] & PM_STARTSPAN_DETECTED) || belowThreshold) { 316 326 break; 317 327 }
Note:
See TracChangeset
for help on using the changeset viewer.
