IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 14, 2006, 4:50:13 PM (19 years ago)
Author:
Paul Price
Message:

Fixing multiple frees, and mask for statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmShutterCorrection.c

    r9984 r9997  
    400400            continue;
    401401        }
    402         images->data[i] = image;
     402        images->data[i] = psMemIncrRefCounter(image);
    403403        if (image->type.type != PS_TYPE_F32) {
    404404            psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Bad type for image: %x\n", image->type.type);
     
    429429                goto MEASURE_ERROR;
    430430            }
    431             masks->data[i] = mask;
     431            masks->data[i] = psMemIncrRefCounter(mask);
    432432
    433433            if (mask->type.type != PS_TYPE_U8) {
     
    452452                goto MEASURE_ERROR;
    453453            }
    454             masks->data[i] = mask;
    455 
    456             if (mask->type.type != PS_TYPE_F32) {
     454            weights->data[i] = psMemIncrRefCounter(weight);
     455
     456            if (weight->type.type != PS_TYPE_F32) {
    457457                psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Bad type for weights: %x\n", weight->type.type);
    458458                goto MEASURE_ERROR;
     
    484484            psRegion *region = regions->data[j]; // Region of interest
    485485            psImage *subImage = psImageSubset(image, *region); // Sub-image
    486             if (!psImageStats(stats, subImage, masks->data[i], maskVal)) {
     486            psImage *subMask = NULL;
     487            if (mask) {
     488                subMask = psImageSubset(mask, *region);
     489            }
     490            if (!psImageStats(stats, subImage, subMask, maskVal)) {
    487491                psString regionString = psRegionToString(*region);
    488492                psWarning("Unable to measure sample statistics at %s in image %ld.\n",
Note: See TracChangeset for help on using the changeset viewer.