IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20807


Ignore:
Timestamp:
Nov 20, 2008, 11:12:59 AM (17 years ago)
Author:
bills
Message:

add debugging option to change intensity of streaked pixels as opposed
to setting them to NAN

Location:
trunk/magic/remove/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r20780 r20807  
    336336        sf->tiles->data.S32[2] = 1;
    337337    }
     338
     339    sf->transparentStreaks = psMetadataLookupF64(&status, config->arguments, "TRANSPARENT_STREAKS");
    338340
    339341    return sf;
     
    495497            "skip excising of non warped pixels", true);
    496498    }
     499
     500    if ((argnum = psArgumentGet(argc, argv, "-transparent"))) {
     501        if (gotReplace) {
     502            psError(PS_ERR_UNKNOWN, true, "cannot make transparent streaks if -replace");
     503            return NULL;
     504        }
     505        psArgumentRemove(argnum, &argc, argv);
     506        double transparentStreaks = atof(argv[argnum]);
     507        psMetadataAddF64(config->arguments, PS_LIST_TAIL, "TRANSPARENT_STREAKS", 0,
     508            "value to adjust excised pixels", transparentStreaks);
     509        psArgumentRemove(argnum, &argc, argv);
     510    }
    497511       
    498512    // if skycells are not provided then we have to execise all pixels  unless -keepnonwarped
     
    881895setupImageRefs(sFile *out, sFile *recovery, sFile *in, int extnum, bool exciseAll)
    882896{
    883     if (exciseAll) {
     897    if (!exciseAll) {
     898        // set output image to be the input image
     899        out->image = (psImage*) psMemIncrRefCounter(in->image);
     900        if (recovery) {
     901            // create a recovery image initialized to NAN
     902            createNewImage(recovery, in, extnum, NAN);
     903        }
     904    } else {
     905        // Excising all pixels in the input
    884906        // set the output to an image all NANs
    885907        createNewImage(out, in, extnum, NAN);
     
    887909            // save the whole input as the recovery image
    888910            recovery->image = (psImage*) psMemIncrRefCounter(in->image);
    889         }
    890     } else {
    891         // output is the input image
    892         out->image = (psImage*) psMemIncrRefCounter(in->image);
    893         if (recovery) {
    894             // create a recovery image initialized to zero
    895             createNewImage(recovery, in, extnum, 0);
    896911        }
    897912    }
     
    12151230        }
    12161231        psFree(command);
     1232        // XXX: shouldn't I be doing mv in->resolved_name.bak out->resolved_name
     1233        // to complete the swap if !remove?
    12171234    }
    12181235
     
    13031320    }
    13041321
    1305 #define ACTUALLY_MASK_PIXEL
    1306 #ifdef ACTUALLY_MASK_PIXEL
    1307     psImageSet (sfiles->outImage->image,  x, y, NAN);
    1308 #else
    1309     if (newMaskValue == MASK_BAD_WARP) {
     1322    if (sfiles->transparentStreaks == 0) {
    13101323        psImageSet (sfiles->outImage->image,  x, y, NAN);
    13111324    } else {
    1312         // as a visualization aid don't mask the pixel, just reduce it in intensity a bit
    1313         psImageSet (sfiles->outImage->image,  x, y, imageValue - 50);
    1314     }
    1315 #endif
     1325        if (newMaskValue == MASK_BAD_WARP) {
     1326            psImageSet (sfiles->outImage->image,  x, y, NAN);
     1327        } else {
     1328            // as a visualization aid don't mask the pixel, just change the intensity
     1329            psImageSet (sfiles->outImage->image,  x, y, imageValue + sfiles->transparentStreaks);
     1330        }
     1331    }
    13161332
    13171333    // TODO:
  • trunk/magic/remove/src/streaksremove.h

    r20779 r20807  
    6767    psImage *warpedPixels;
    6868    psVector    *tiles;
    69     float   recoveryImageValue;
    70     float   recoveryMaskValue;
    71     float   recoveryWeightValue;
     69    double  transparentStreaks;
    7270} streakFiles;
    7371
Note: See TracChangeset for help on using the changeset viewer.