IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26806


Ignore:
Timestamp:
Feb 6, 2010, 2:00:04 PM (16 years ago)
Author:
eugene
Message:

pixel to index is -0.5 not +0.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/imcombine/pmImageCombine.c

    r23989 r26806  
    118118            psImage *mask = masks->data[i]; // Mask of interest
    119119            pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal);
    120         }       
    121         // Set the pixel error data, if necessary
     120        }
     121        // Set the pixel error data, if necessary
    122122        if (errors) {
    123123            psImage *error = errors->data[i]; // Error image of interest
     
    132132        // Combine all the pixels, using the specified stat.
    133133        if (!psVectorStats(stats, pixelData, pixelErrors, pixelMasks, 0xff)) {
    134             psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
    135             return false;
    136         }
    137         if (isnan(stats->sampleMean)) {
     134            psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     135            return false;
     136        }
     137        if (isnan(stats->sampleMean)) {
    138138            combine->data.F32[y][x] = NAN;
    139139            psFree(buffer);
     
    141141        }
    142142        float combinedPixel = stats->sampleMean; // Value of the combination
    143        
     143
    144144        if (iter == 0) {
    145145            // Save the value produced with no rejection, since it may be useful later
     
    369369    psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);
    370370    if (!psVectorStats(stats, pixels, NULL, mask, 1)) {
    371         psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     371        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
    372372    }
    373373    float median = stats->sampleMedian;
     
    640640                                              (psPlaneTransform * )outToIn->data[otherImg],
    641641                                              outCoords);
    642                         psS32 xPix = (int)(inCoords->x + 0.5);
    643                         psS32 yPix = (int)(inCoords->y + 0.5);
     642                        psS32 xPix = (int)(inCoords->x - 0.5);
     643                        psS32 yPix = (int)(inCoords->y - 0.5);
    644644                        if ((xPix >= 0) && (xPix <= ((psImage*)(images->data[otherImg]))->numCols - 1) &&
    645645                                (yPix >= 0) && (yPix <= ((psImage*)(images->data[otherImg]))->numRows - 1)) {
Note: See TracChangeset for help on using the changeset viewer.