IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2005, 2:08:16 PM (21 years ago)
Author:
Paul Price
Message:

Remaking shift into a program to shift a single image. It seems to work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stacTransform.c

    r3666 r3669  
    166166        psImage *image = images->data[n]; // The input image
    167167        psPlaneTransform *map = maps->data[n]; // The map
    168         psImage *error = errors->data[n]; // The error image
    169168        psImage *outImage = (*outputs)->data[n]; // The output image
    170         psImage *outError = (*outErrors)->data[n]; // The output error image
     169        psImage *error = NULL; // The error image
     170        psImage *outError = NULL; // The output error image
     171        if (errors) {
     172            error = errors->data[n];
     173            outError = (*outErrors)->data[n];
     174        }
    171175        float offset = 0.0;             // Relative offset
    172176        float scale = 1.0;              // Relative scale
     
    177181            scale = scales->data.F32[n];
    178182        }
    179 
    180 #if 0
    181         // No need for initialisation, since we iterate over the entire output image.
    182         for (int y = 0; y < outny; y++) {
    183             for (int x = 0; x < outnx; x++) {
    184                 outImage->data.F32[y][x] = 0.0;
    185                 outError->data.F32[y][x] = 0.0;
    186             }
    187         }
    188 #endif
    189183
    190184        // Mask
     
    208202                                                                              detector->y, mask, 1, 0.0,
    209203                                                                              PS_INTERPOLATE_BILINEAR);
    210                     // Error is actually the variance
    211                     outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
    212                                                                                             detector->x,
    213                                                                                             detector->y,
    214                                                                                             mask, 1, 0.0);
     204                    if (error) {
     205                        // Error is actually the variance
     206                        outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
     207                                                                                                detector->x,
     208                                                                                                detector->y,
     209                                                                                                mask, 1, 0.0);
     210                    }
    215211
    216212                    outImage->data.F32[y][x] = (outImage->data.F32[y][x] - offset) / scale;
Note: See TracChangeset for help on using the changeset viewer.