IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2006, 11:30:47 AM (20 years ago)
Author:
Paul Price
Message:

For the easy case, we didn't consider that there might be binning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAMosaic.c

    r7634 r7641  
    468468        int xParity = xFlip->data.U8[i] ? -1 : 1; // Parity difference, in x
    469469        int yParity = yFlip->data.U8[i] ? -1 : 1; // Parity difference, in y
     470        int xTargetBase = (x0->data.S32[i] - xMin) / xBinTarget; // The base x position in the target frame
     471        int yTargetBase = (y0->data.S32[i] - yMin) / yBinTarget; // The base y position in the target frame
    470472        if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget &&
    471473                xFlip->data.U8[i] == 0 && yFlip->data.U8[i] == 0) {
    472             // Let someone else do the hard work; useful to test psImageOverlaySection if no other reason
    473             psImageOverlaySection(mosaic, image, x0->data.S32[i] - xMin, y0->data.S32[i] - yMin, "+");
     474            // Let someone else do the hard work
     475            psImageOverlaySection(mosaic, image, xTargetBase, yTargetBase, "+");
    474476        } else if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget) {
    475477            // There's a difference with the parities, but we don't have to worry about binning
     
    477479            #define COPY_WITH_PARITY_DIFFERENCE(TYPE) \
    478480        case PS_TYPE_##TYPE: { \
    479                 int yTargetBase = (y0->data.S32[i] - yMin) / yBinTarget; \
    480                 int xTargetBase = (x0->data.S32[i] - xMin) / xBinTarget; \
    481481                for (int y = 0; y < image->numRows; y++) { \
    482482                    int yTarget =  yTargetBase + yParity * y; \
     
    501501            // In case the original image is binned but the mosaic is not, we need to fill in the
    502502            // values in the mosaic.
    503 
    504 
    505503            #define FILL_IN(TYPE) \
    506504        case PS_TYPE_##TYPE: \
    507505            for (int y = 0; y < image->numRows; y++) { \
    508                 float yTargetBase = (y0->data.S32[i] + yParity * yBinSource->data.S32[i] * y - yMin) / \
    509                                     yBinTarget; \
     506                float yTargetBinBase = yTargetBase + yParity * yBinSource->data.S32[i] * y / yBinTarget; \
    510507                for (int x = 0; x < image->numCols; x++) { \
    511                     float xTargetBase = (x0->data.S32[i] + xParity * xBinSource->data.S32[i] * x - xMin) / \
    512                                         xBinTarget; \
     508                    float xTargetBinBase = xTargetBase + xParity * xBinSource->data.S32[i] * x / xBinTarget; \
    513509                    for (int j = 0; j < yBinSource->data.S32[i]; j++) { \
    514                         int yTarget = (int)(yTargetBase + yParity * (float)j / (float)yBinTarget); \
     510                        int yTarget = (int)(yTargetBinBase + yParity * (float)j / (float)yBinTarget); \
    515511                        for (int k = 0; k < xBinSource->data.S32[i]; k++) { \
    516                             int xTarget = (int)(xTargetBase + xParity * (float)k / (float)xBinTarget); \
     512                            int xTarget = (int)(xTargetBinBase + xParity * (float)k / (float)xBinTarget); \
    517513                            mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x]; \
    518514                        } \
Note: See TracChangeset for help on using the changeset viewer.