Changeset 30752
- Timestamp:
- Feb 24, 2011, 12:47:58 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psModules/src/objects
- Files:
-
- 2 edited
-
pmFootprintCullPeaks.c (modified) (3 diffs)
-
pmFootprintFindAtPoint.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintCullPeaks.c
r30748 r30752 70 70 // XXX test point 71 71 // pmPeak *myPeak = fp->peaks->data[0]; 72 // if ((fabs(myPeak->x - 320) < 30) && (fabs(myPeak->y - 430) < 30)) {72 // if ((fabs(myPeak->x - 205) < 100) && (fabs(myPeak->y - 806) < 100)) { 73 73 // fprintf (stderr, "test peak\n"); 74 74 // } … … 138 138 bool keep = true; 139 139 for (int j = 0; keep && !peak->assigned && (j < brightPeaks->n); j++) { 140 const pmPeak *peak2 = fp->peaks->data[j]; 140 // const pmPeak *peak2 = fp->peaks->data[j]; XXX isn't this an error? we only care about the kept brighter peak, right? 141 const pmPeak *peak2 = brightPeaks->data[j]; 141 142 int x2 = peak2->x - subImg->col0; 142 143 int y2 = peak2->y - subImg->row0; … … 150 151 continue; 151 152 } 152 153 153 psArrayAdd (brightPeaks, 128, fp->peaks->data[i]); 154 154 } -
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.
