IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2005, 1:11:41 PM (21 years ago)
Author:
gusciora
Message:

Removed bug in pmRejectPixels().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmImageCombine.c

    r4227 r4290  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-13 20:27:06 $
     10 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-06-16 23:11:41 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    207207                                (fabs(sigmaClip * stdev) + fabs(combinedPixel))) {
    208208                            numRejects++;
    209                             //printf("Rejecting pixel.  Image %d.  (row, col) (%d, %d)\n", im, row, col);
    210209                            pixelMask->data.U8[im] = maskVal;
    211210                            //
     
    225224                            ((psPixels *) ((*questionablePixels)->data[im]))->data[ptr].y = row;
    226225                            (qpPtr->data.S32[im])++;
     226                            // XXX: this pixel ->n increment is wierd
    227227                            ((psPixels *) ((*questionablePixels)->data[im]))->n = qpPtr->data.S32[im];
    228228                        }
     
    341341    return median / image->data.F32[y][x];
    342342}
    343 
    344343
    345344/******************************************************************************
     
    361360    myRegion.y0 = PS_MAX_F32;
    362361    myRegion.y1 = PS_MIN_F32;
    363 
    364362    psPlane in;
    365363    psPlane out;
     
    465463     I think they mean syncs with PWP.
    466464XXX: Must add mask parameter, use it in gradient calculation.
    467 XXX: This function does not work.
    468465 *****************************************************************************/
    469466psArray *pmRejectPixels(const psArray *images,          ///< Array of input images
     
    475472                       )
    476473{
    477     psLogMsg(__func__, PS_LOG_WARN, "WARNING: pmRejectPixels() has known bugs.  Specifically, in the psImageTransform() call.\n");
    478474    PS_ASSERT_PTR_NON_NULL(images, NULL);
    479475    PS_ASSERT_PTR_NON_NULL(errors, NULL);
     
    534530        // Transform that mask image into detector coordinate space
    535531        //
    536         psRegion myRegion = DetermineRegion(maskImageF32, myOutToIn);
     532        psRegion myRegionXForm = DetermineRegion(maskImageF32, myOutToIn);
    537533        psImage *transformedImage = psImageTransform(NULL, NULL, maskImageF32, NULL,
    538                                     0, myOutToIn, myRegion, NULL,
     534                                    0, myOutToIn, myRegionXForm, NULL,
    539535                                    PS_INTERPOLATE_BILINEAR, 0);
    540         //
    541         // XXX: Currently, a possibly buggy psImageTransform() corrupts the data in
    542         // in outToIn, and possibly other places.  The following printf() demonstrates
    543         // this in conjunction with the test code.
    544         //
    545         //
    546         // psPlaneTransform *tmpOutToIn2 = (psPlaneTransform *) outToIn->data[0];
    547         // printf("tmpOutToIn2: (%d, %d) (%d %d)\n", tmpOutToIn2->x->nX, tmpOutToIn2->x->nY, tmpOutToIn2->y->nX, tmpOutToIn2->y->nY);
    548         //
    549536
    550537        //
     
    566553                psF32 meanGrads = 0.0;
    567554                psS32 numGrads = 0;
    568 
    569555                //
    570556                // Loop through all other images, calculate their mean gradient.
     
    599585                    // pixelList is large enough; if not, we realloc()
    600586                    //
    601 
    602587                    psS32 ptr = rPtr->data.S32[im];
    603588                    psPixels *pixelListPtr = (psPixels *) rejects->data[im];
     
    611596                    ((psPixels *) rejects->data[im])->data[ptr].y = (pixelList->data[p]).y;
    612597                    (rPtr->data.S32[im])++;
     598                    // XXX: this pixel ->n increment is wierd
     599                    (((psPixels *) rejects->data[im])->n)++;
    613600                }
    614601            }
    615602        }
    616         psFree(myInToOut);
    617         psFree(myOutToIn);
     603
    618604        psFree(maskImage);
    619605        psFree(maskImageF32);
     
    625611    return(rejects);
    626612}
    627 
Note: See TracChangeset for help on using the changeset viewer.