Changeset 26806
- Timestamp:
- Feb 6, 2010, 2:00:04 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psModules/src/imcombine/pmImageCombine.c
r23989 r26806 118 118 psImage *mask = masks->data[i]; // Mask of interest 119 119 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 necessary120 } 121 // Set the pixel error data, if necessary 122 122 if (errors) { 123 123 psImage *error = errors->data[i]; // Error image of interest … … 132 132 // Combine all the pixels, using the specified stat. 133 133 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)) { 138 138 combine->data.F32[y][x] = NAN; 139 139 psFree(buffer); … … 141 141 } 142 142 float combinedPixel = stats->sampleMean; // Value of the combination 143 143 144 144 if (iter == 0) { 145 145 // Save the value produced with no rejection, since it may be useful later … … 369 369 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 370 370 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"); 372 372 } 373 373 float median = stats->sampleMedian; … … 640 640 (psPlaneTransform * )outToIn->data[otherImg], 641 641 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); 644 644 if ((xPix >= 0) && (xPix <= ((psImage*)(images->data[otherImg]))->numCols - 1) && 645 645 (yPix >= 0) && (yPix <= ((psImage*)(images->data[otherImg]))->numRows - 1)) {
Note:
See TracChangeset
for help on using the changeset viewer.
