IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33700


Ignore:
Timestamp:
Apr 4, 2012, 10:35:28 AM (14 years ago)
Author:
bills
Message:

Fix compile error in optimized build by initializing some variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/fiximage.c

    r33662 r33700  
    3434  // 4 -- repair y only
    3535  // 6 -- repair x & y only
    36  
     36
    3737  float *inB = (float *) in[0].matrix.buffer;
    3838  float *ctB = (float *) ct[0].matrix.buffer;
    3939  float *mkB = (float *) mask[0].matrix.buffer;
    4040
    41   // loop over input ct and find pixels that can be repaired. 
     41  // loop over input ct and find pixels that can be repaired.
    4242  for (iy = 1; iy < Ny - 1; iy++) {
    4343    for (ix = 1; ix < Nx - 1; ix++) {
    44      
     44
    4545      int Npix = ix + Nx*iy;
    4646
    4747      // does not need to be repaired
    4848      if (ctB[Npix]) { mkB[Npix] = 1.0; continue; }
    49      
     49
    5050      // if we have all 4 valid neighbors, we can fix
    5151      if (ctB[Npix - 1 ] && ctB[Npix + 1 ]) mkB[Npix] += 2.0;
     
    5353    }
    5454  }
    55        
     55
    5656  // loop over input ct and repair the reparable pixels
    5757  for (iy = 1; iy < Ny - 1; iy++) {
    5858    for (ix = 1; ix < Nx - 1; ix++) {
    59      
     59
    6060      int Npix = ix + Nx*iy;
    6161
     
    6363      if (mkB[Npix] == 1.0) continue; // does not need to be repaired
    6464
    65       float Vxm, Vxp, Vym, Vyp, Value;
     65      float Vxm = 0.0;
     66      float Vxp = 0.0;
     67      float Vym = 0.0;
     68      float Vyp = 0.0;
     69      float Value = 0.0;
    6670      if ((mkB[Npix] == 2) || (mkB[Npix] == 6)) {
    67         Vxm = inB[Npix - 1 ] / ctB[Npix - 1 ];
    68         Vxp = inB[Npix + 1 ] / ctB[Npix + 1 ];
     71        Vxm = inB[Npix - 1 ] / ctB[Npix - 1 ];
     72        Vxp = inB[Npix + 1 ] / ctB[Npix + 1 ];
    6973      }
    7074      if ((mkB[Npix] == 4) || (mkB[Npix] == 6)) {
    71         Vym = inB[Npix - Nx] / ctB[Npix - Nx];
    72         Vyp = inB[Npix + Nx] / ctB[Npix + Nx];
     75        Vym = inB[Npix - Nx] / ctB[Npix - Nx];
     76        Vyp = inB[Npix + Nx] / ctB[Npix + Nx];
    7377      }
    7478
    7579      if (mkB[Npix] == 2) {
    76         Value = 0.5*(Vxm + Vxp);
     80        Value = 0.5*(Vxm + Vxp);
    7781      }
    7882      if (mkB[Npix] == 4) {
    79         Value = 0.5*(Vym + Vyp);
     83        Value = 0.5*(Vym + Vyp);
    8084      }
    8185      if (mkB[Npix] == 6) {
    82         Value = 0.25*(Vxm + Vxp + Vym + Vyp);
     86        Value = 0.25*(Vxm + Vxp + Vym + Vyp);
    8387      }
    8488
Note: See TracChangeset for help on using the changeset viewer.