IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 25, 2012, 5:33:33 PM (14 years ago)
Author:
watersc1
Message:

Hardcoded version that gets the right solution. I wanted to save this before attempting to clean up the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/pswarp/src/pswarpTransformTile.c

    r34442 r34470  
    8686    for (int y = yMin; y < yMax; y++) {
    8787        for (int x = xMin; x < xMax; x++) {
    88 /*        if ((x == 931)||(x == 717)||(x == 924)) { */
    89 /* /\*      if ((y == 1348)||(y == 1249)||(y == 1081)) { *\/ */
    90 /* /\*        fprintf(stderr,"BEcause: %d %d [%d %d %d %d]\n",x,y,yMin,yMax,xMin,xMax); *\/ */
    91 /* /\*      } *\/ */
    92 /*        } */
    93             if (((x == 931)&&(y == 1348))||
    94                 ((x == 717)&&(y == 1249))||
    95                 ((x == 924)&&(y == 1081))) {
    96               psTrace("pswarp",3,"TT: A\n");
    97               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    98 
    99             }
    100 
    10188            // Only transform those pixels requested
    10289            if (region && region->data.PS_TYPE_IMAGE_MASK_DATA[y][x]) {
    10390                continue;
    10491            }
    105             if (((x == 931)&&(y == 1348))||
    106                 ((x == 717)&&(y == 1249))||
    107                 ((x == 924)&&(y == 1081))) {
    108               psTrace("pswarp",3,"TT: B\n");
    109               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    110 
    111             }
    112 
    11392            // pswarpMapApply converts the output coordinate (x,y) to the input coordinate.
    11493            // both are in the parent frames of the input and output images.
    11594            double xIn, yIn;            // Input pixel coordinates
    11695            pswarpMapApply(&xIn, &yIn, map, x + 0.5, y + 0.5);
    117             if (((x == 931)&&(y == 1348))||
    118                 ((x == 717)&&(y == 1249))||
    119                 ((x == 924)&&(y == 1081))) {
    120               psTrace("pswarp",3,"TT: Ct\n");
    121               psTrace("pswarp",3,"TT: %d %d %d %d %g %g %d %d\n",xMin,xMax,yMin,yMax,xIn,yIn,inNumCols,inNumRows);
    12296
    123             }
     97            if (args->interp->mode == 8) {
     98              xIn += 177.0 / 400.0;
     99              yIn += 166.0 / 400.0;
    124100
     101              if ((xIn > inNumCols - 177.0/ 400.0)||
     102                  (yIn > inNumRows - 166.0/ 400.0)||
     103                  (xIn < 177.0/ 400.0)||
     104                  (yIn < 166.0/ 400.0)
     105                 
     106                  ) {
     107                fprintf(stderr,"\n");
     108                continue;
     109              }
     110            }           
     111           
    125112            if (xIn < 0 || xIn >= inNumCols || yIn < 0 || yIn >= inNumRows) {
    126113                continue;
    127114            }
    128             if (((x == 931)&&(y == 1348))||
    129                 ((x == 717)&&(y == 1249))||
    130                 ((x == 924)&&(y == 1081))) {
    131               psTrace("pswarp",3,"TT: C\n");
    132               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    133 
    134             }
    135115
    136116            // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates
     
    144124            int xOut = x - outCol0, yOut = y - outRow0; ///< Position on output image
    145125
    146             if ((xIn >= args->interp->image->numCols - 1)||
    147                 (yIn >= args->interp->image->numRows - 1)) {
    148               imageValue = NAN;
     126            if (((xOut % 500) == 0)&&((yOut % 500) == 0)) {
     127              fprintf(stderr,"%d %d %g %g %d %d (%d %d %d %d) %g %g %g\n",
     128                      x,y,xIn,yIn,xOut,yOut,xMin,xMax,yMin,yMax,imageValue,
     129                      (4846 - 400 * (12)) / 2.0,
     130                      (4868 - 400 * (12)) / 2.0
     131                     
     132                      );
    149133            }
     134           
     135/*          if ((xIn >= args->interp->image->numCols - 1)|| */
     136/*              (yIn >= args->interp->image->numRows - 1)) { */
     137/*            imageValue = NAN; */
     138/*          } */
    150139            if (outImageData) {
    151140                outImageData[yOut][xOut] = imageValue * jacobian;
     
    159148
    160149            goodPixels++;
    161 
    162             if ((x == 931)||(x == 717)||(x == 924)) {
    163               if ((y == 1348)||(y == 1249)||(y == 1081)) {
    164               psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld %g %g %g %g\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
    165                       args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp,
    166                       0.0,0.0,0.0,0.0);
    167 /*                    inImage->data.F32[(int) yIn][(int) xIn], */
    168 /*                    inImage->data.F32[(int) yIn+1][(int) xIn], */
    169 /*                    inImage->data.F32[(int) yIn+1][(int) xIn+1], */
    170 /*                    inImage->data.F32[(int) yIn][(int) xIn+1]); */
    171               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    172               }
    173             }
    174            
    175             if (((xOut == 931)&&(yOut == 1348))||
    176                 ((xOut == 717)&&(yOut == 1249))||
    177                 ((xOut == 924)&&(yOut == 1081))) {
    178               psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld %g %g %g %g\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
    179                       args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp,
    180                                       0.0,0.0,0.0,0.0);
    181 /*                    inImage->data.F32[(int) yIn][(int) xIn], */
    182 /*                    inImage->data.F32[(int) yIn+1][(int) xIn], */
    183 /*                    inImage->data.F32[(int) yIn+1][(int) xIn+1], */
    184 /*                    inImage->data.F32[(int) yIn][(int) xIn+1]); */
    185               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    186 
    187             }
    188             if ((xOut ==  443)&&(yOut == 659)) {
    189               psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
    190                       args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp);
    191               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    192 
    193             }
    194             if ((xOut ==  524)&&(yOut == 576)) {
    195               psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
    196                       args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp);
    197               psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
    198              
    199             }
    200150        }
    201151    }
Note: See TracChangeset for help on using the changeset viewer.