Changeset 13898 for trunk/psModules/src/camera/pmFPAMosaic.c
- Timestamp:
- Jun 19, 2007, 4:22:26 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAMosaic.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMosaic.c
r13499 r13898 22 22 23 23 #define CELL_LIST_BUFFER 10 // Buffer size for cell lists 24 25 #define BLANK_VALUE 0.0 // Value for pixels that are blank in the mosaicked image (e.g., // 26 // between cells). 27 // XXX This should ultimately be set to NAN, but psphot doesn't like 28 // that (masking needs to be more thorough). 24 29 25 30 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 397 402 for (int x = 0; x < image->numCols; x++) { \ 398 403 int xTarget = xTargetBase + xParity * x; \ 399 mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x]; \404 mosaic->data.TYPE[yTarget][xTarget] = image->data.TYPE[y][x]; \ 400 405 } \ 401 406 } \ … … 416 421 for (int k = 0; k < xBinSource->data.S32[i]; k++) { \ 417 422 int xTarget = (int)(xTargetBinBase + xParity * (float)k / (float)xBinTarget); \ 418 mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x]; \423 mosaic->data.TYPE[yTarget][xTarget] = image->data.TYPE[y][x]; \ 419 424 } \ 420 425 } \ … … 504 509 psTrace("psModules.camera", 3, "Spliced image will be %dx%d\n", (int)xSize, (int)ySize); 505 510 psImage *mosaic = psImageAlloc((int)xSize, (int)ySize, type); // The mosaic image 506 psImageInit(mosaic, 0);511 psImageInit(mosaic, unexposed); 507 512 508 513 // Next pass through the images to do the mosaicking … … 524 529 (yFlip->data.U8[i] == 0)) { 525 530 // Let someone else do the hard work 526 psImageOverlaySection(mosaic, image, xTargetBase, yTargetBase, " +");531 psImageOverlaySection(mosaic, image, xTargetBase, yTargetBase, "="); 527 532 continue; 528 533 } … … 723 728 int *xBinChip, int *yBinChip, // The binning in x and y, to be returned 724 729 const pmChip *chip, // Chip to mosaic 725 const pmCell *targetCell // Cell to which to mosaic 730 const pmCell *targetCell, // Cell to which to mosaic 731 psMaskType blank // Mask value to give blank pixels 726 732 ) 727 733 { … … 804 810 // Mosaic the images together and we're done 805 811 if (allGood) { 806 *mosaicImage = imageMosaic(images, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, NAN);807 *mosaicWeights = imageMosaic(weights, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, NAN);808 *mosaicMask = imageMosaic(masks, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, 0xff);812 *mosaicImage = imageMosaic(images, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, BLANK_VALUE); 813 *mosaicWeights = imageMosaic(weights, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, BLANK_VALUE); 814 *mosaicMask = imageMosaic(masks, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, blank); 809 815 } 810 816 … … 830 836 const pmFPA *fpa, // FPA to mosaic 831 837 const pmChip *targetChip, // Chip to which to mosaic 832 const pmCell *targetCell // Cell to which to mosaic 838 const pmCell *targetCell, // Cell to which to mosaic 839 psMaskType blank // Mask value to give blank pixels 833 840 ) 834 841 { … … 937 944 // Mosaic the images together and we're done 938 945 if (allGood) { 939 *mosaicImage = imageMosaic(images, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, NAN);940 *mosaicWeights = imageMosaic(weights, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, NAN);941 *mosaicMask = imageMosaic(masks, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, 0xff);946 *mosaicImage = imageMosaic(images, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, BLANK_VALUE); 947 *mosaicWeights = imageMosaic(weights, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, BLANK_VALUE); 948 *mosaicMask = imageMosaic(masks, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, blank); 942 949 } 943 950 … … 986 993 // the mosaic image. 987 994 988 bool pmChipMosaic(pmChip *target, const pmChip *source, bool deepCopy )995 bool pmChipMosaic(pmChip *target, const pmChip *source, bool deepCopy, psMaskType blank) 989 996 { 990 997 // Target exists, and has only a single cell … … 1039 1046 // Case 2 --- we need to mosaic by cut and paste 1040 1047 psTrace("psModules.camera", 1, "Case 2 mosaicking: cut and paste.\n"); 1041 if (!chipMosaic(&mosaicImage, &mosaicMask, &mosaicWeights, &xBin, &yBin, source, targetCell )) {1048 if (!chipMosaic(&mosaicImage, &mosaicMask, &mosaicWeights, &xBin, &yBin, source, targetCell, blank)) { 1042 1049 psError(PS_ERR_UNKNOWN, false, "Unable to mosaic cells.\n"); 1043 1050 return false; … … 1217 1224 1218 1225 1219 bool pmFPAMosaic(pmFPA *target, const pmFPA *source, bool deepCopy )1226 bool pmFPAMosaic(pmFPA *target, const pmFPA *source, bool deepCopy, psMaskType blank) 1220 1227 { 1221 1228 // Target exists, and has only a single chip with single cell … … 1260 1267 psTrace("psModules.camera", 1, "Case 2 mosaicking: cut and paste.\n"); 1261 1268 if (!fpaMosaic(&mosaicImage, &mosaicMask, &mosaicWeights, &xBin, &yBin, source, 1262 targetChip, targetCell )) {1269 targetChip, targetCell, blank)) { 1263 1270 psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chips.\n"); 1264 1271 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
