IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30752


Ignore:
Timestamp:
Feb 24, 2011, 12:47:58 PM (15 years ago)
Author:
eugene
Message:

culling was looking at the full list, not the bright peaks; nan pix values relative to threshold were ambiguous

Location:
branches/eam_branches/ipp-20110213/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintCullPeaks.c

    r30748 r30752  
    7070    // XXX test point
    7171    // 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)) {
    7373    //  fprintf (stderr, "test peak\n");
    7474    // }
     
    138138        bool keep = true;
    139139        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];
    141142            int x2 = peak2->x - subImg->col0;
    142143            int y2 = peak2->y - subImg->row0;
     
    150151            continue;
    151152        }
    152 
    153153        psArrayAdd (brightPeaks, 128, fp->peaks->data[i]);
    154154    }
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintFindAtPoint.c

    r29004 r30752  
    3131 *
    3232 * 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
    3337 */
    3438bool pmFootprintSpansBuild(pmFootprint *fp, // the footprint that we're building
     
    103107        for (int j = x0 - 1; j >= -1; j--) {
    104108            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)  {
    106111                if (j < x0 - 1) {       // we found some pixels above threshold
    107112                    nx0 = j + 1;
     
    119124            for (int j = nx0 + 1; j <= numCols; j++) {
    120125                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) {
    122128                    nx1 = j - 1;
    123129                    break;
     
    146152        for (int j = nx1 + 1; j <= x1 + 1; j++) {
    147153            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) {
    149156                int sx0 = j++;          // span that we're working on is sx0:sx1
    150157                int sx1 = -1;           // We know that if we got here, we'll also set sx1
    151158                for (; j <= numCols; j++) {
    152159                    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
    154162                        sx1 = j;
    155163                        break;
     
    306314        for (i = col; i >= 0; i--) {
    307315            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) {
    309318                break;
    310319            }
     
    313322        for (i = col; i < numCols; i++) {
    314323            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) {
    316326                break;
    317327            }
Note: See TracChangeset for help on using the changeset viewer.