IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 11, 2012, 2:04:31 PM (13 years ago)
Author:
watersc1
Message:

Merge from my branch including background restoration and stack stage projection cell binned images.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/psModules

  • trunk/psModules/src/camera/pmFPABin.c

    r24906 r34800  
    4343    }
    4444
     45    int Nbits = (int) (ceil(log(maskVal)/log(2)) + 1);
     46    int *bitcounter = malloc(sizeof(int) * Nbits);
     47    int pxlcount;
     48
    4549    int xLast = numColsIn - 1, yLast = numRowsIn - 1; // Last index
    4650    int yStart = psImageBinningGetFineY(binning, 0); // Starting input y for binning
     
    5559            float sum = 0.0;            // Sum of pixels
    5660            int numPix = 0;             // Number of pixels
     61
     62            for (int j = 0; j < Nbits; j++) { // Reset bit counter
     63              bitcounter[j] = 0;
     64            }
     65            pxlcount = 0;
     66           
    5767            for (int y = yStart; y < yStop; y++) {
    5868                for (int x = xStart; x < xStop; x++) {
     69                  if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] != 0)) {
     70                      for (int j = 0; j < Nbits; j++) {
     71                        psImageMaskType M = (psImageMaskType) pow(2,j);
     72                        if (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & M) {
     73                          bitcounter[j]++;
     74                        }
     75                      }
     76                    }
     77                 
    5978                    if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal)) {
    6079                        continue;
     
    6584                    sum += inImage->data.F32[y][x];
    6685                    numPix++;
     86
     87
    6788                }
    6889            }
    69 
     90           
     91           
    7092            // Values to set
    7193            float imageValue;
     
    79101            }
    80102            outImage->data.F32[yOut][xOut] = imageValue;
    81             outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue;
     103            //            outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue;
     104            outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = 0;
     105            for (int j = 0; j < Nbits; j++) {
     106              if (bitcounter[j] > 0.5 * pxlcount) {
     107                outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] |= (int) pow(2,j);
     108              }
     109            }
    82110            xStart = xStop;
    83111        }
Note: See TracChangeset for help on using the changeset viewer.