IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19136


Ignore:
Timestamp:
Aug 20, 2008, 11:45:09 AM (18 years ago)
Author:
Paul Price
Message:

Reworked version of psImageInterpolate doesn't set the mask value to 0
if everything's good (it just leaves it unchanged; it ORs when
something is bad). This meant that the output mask was maintained at
previous values, so an entire tile was wiped out by a single bad
pixel! Now I have the mask value initially set to that of the closest
pixel in the input mask image. This allows us to propagate not just
whether the mask is good/poor/bad, but also why.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpTransformTile.c

    r18890 r19136  
    4141    pswarpMapGridCoordRange (args->grid, args->gridX, args->gridY, &minPt, &maxPt);
    4242
    43     psF32 **outImageData     = (args->output->image)  ? args->output->image->data.F32  : NULL;
     43    psF32 **outImageData     = (args->output->image)  ? args->output->image->data.F32 : NULL;
    4444    psF32 **outVarData       = (args->output->weight) ? args->output->weight->data.F32 : NULL;
    45     psMaskType **outMaskData = (args->output->mask)   ? args->output->mask->data.U8    : NULL;
     45    psMaskType **outMaskData = (args->output->mask)   ? args->output->mask->data.PS_TYPE_MASK_DATA : NULL;
     46    psMaskType **inMaskData  = (args->input->mask)    ? args->input->mask->data.PS_TYPE_MASK_DATA : NULL;
    4647
    4748    pswarpMap *map = args->grid->maps[args->gridX][args->gridY];
     
    8687
    8788            // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates
     89            maskValue = inMaskData ? inMaskData[(int)round(yIn)][(int)round(xIn)] : 0;
    8890            if (!psImageInterpolate(&imageValue, &varValue, &maskValue, xIn, yIn, args->interp)) {
    8991                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
Note: See TracChangeset for help on using the changeset viewer.