Changeset 4131
- Timestamp:
- Jun 7, 2005, 12:13:42 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmSubtractBias.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmSubtractBias.c
r4030 r4131 4 4 * in place from an input image. 5 5 * 6 * @author G eorge Gusciora, MHPCC6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.3 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 5-25 20:28:32 $8 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-07 22:13:42 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 12 12 * 13 13 */ 14 15 16 17 18 14 19 15 #if HAVE_CONFIG_H … … 31 27 place from the input image. 32 28 *****************************************************************************/ 33 psReadout *psSubtractFrame(psReadout *in,34 const psReadout *bias)29 static psReadout *SubtractFrame(psReadout *in, 30 const psReadout *bias) 35 31 { 36 32 psS32 i; … … 39 35 if (bias == NULL) { 40 36 psLogMsg(__func__, PS_LOG_WARN, 41 "WARNING: pmSubtractBias.c: psSubtractFrame(): bias frame is NULL. Returning original image.\n"); 42 return(in); 43 } 44 45 if (((in->image)->numRows + in->row0 - bias->row0) > (bias->image)->numRows) { 37 "WARNING: pmSubtractBias.c: SubtractFrame(): bias frame is NULL. Returning original image.\n"); 38 return(in); 39 } 40 41 42 if ((in->image->numRows + in->row0 - bias->row0) > bias->image->numRows) { 46 43 psError(PS_ERR_UNKNOWN,true, "bias image does not have enough rows. Returning in image\n"); 47 44 return(in); 48 45 } 49 if (( (in->image)->numCols + in->row0 - bias->row0) > (bias->image)->numCols) {46 if ((in->image->numCols + in->col0 - bias->col0) > bias->image->numCols) { 50 47 psError(PS_ERR_UNKNOWN,true, "bias image does not have enough columns. Returning in image\n"); 51 48 return(in); 52 49 } 53 50 54 for (i=0;i< (in->image)->numRows;i++) {55 for (j=0;j< (in->image)->numCols;j++) {56 (in->image)->data.F32[i][j]-=57 (bias->image)->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0];51 for (i=0;i<in->image->numRows;i++) { 52 for (j=0;j<in->image->numCols;j++) { 53 in->image->data.F32[i][j]-= 54 bias->image->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0]; 58 55 if ((in->mask != NULL) && (bias->mask != NULL)) { 59 ( (in->mask)->data.U8[i][j])|=60 (bias->mask)->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];56 (in->mask->data.U8[i][j])|= 57 bias->mask->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0]; 61 58 } 62 59 } … … 67 64 68 65 /****************************************************************************** 69 p_psImageSubtractScalar(): subtract a scalar from the input image. 66 ImageSubtractScalar(): subtract a scalar from the input image. 67 68 XXX: Use a psLib function for this. 69 70 XXX: This should 70 71 *****************************************************************************/ 71 psImage *p_psImageSubtractScalar(psImage *image,72 psF32 scalar)72 static psImage *ImageSubtractScalar(psImage *image, 73 psF32 scalar) 73 74 { 74 75 for (psS32 i=0;i<image->numRows;i++) { 75 76 for (psS32 j=0;j<image->numCols;j++) { 76 (image->data.F32[i][j])-= scalar;77 image->data.F32[i][j]-= scalar; 77 78 } 78 79 } … … 87 88 listed lower in the code. 88 89 *****************************************************************************/ 89 psStatsOptions GenNewStatOptions(const psStats *stat)90 static psStatsOptions GenNewStatOptions(const psStats *stat) 90 91 { 91 92 psS32 numOptions = 0; … … 153 154 vector? 154 155 *****************************************************************************/ 155 psVector *ScaleOverscanVector(psVector *overscanVector,156 psS32 n,157 void *fitSpec,158 pmFit fit)156 static psVector *ScaleOverscanVector(psVector *overscanVector, 157 psS32 n, 158 void *fitSpec, 159 pmFit fit) 159 160 { 160 161 psTrace(".psModule.pmSubtracBias.ScaleOverscanVector", 4, … … 170 171 // 171 172 // If the new vector is the same size as the old, simply copy the data. 173 // 172 174 if (n == overscanVector->n) { 173 175 for (psS32 i = 0 ; i < n ; i++) { … … 320 322 321 323 322 323 324 324 if (overScanAxis == PM_OVERSCAN_NONE) { 325 325 if (fit != PM_FIT_NONE) { … … 332 332 "WARNING: pmSubtractBias.(): overScanAxis equals NONE and overscans does not equal NULL. Proceeding to full fram subtraction.\n"); 333 333 } 334 return( psSubtractFrame(in, bias));334 return(SubtractFrame(in, bias)); 335 335 } 336 336 … … 361 361 return(in); 362 362 } 363 p_psImageSubtractScalar(in->image, statValue);363 ImageSubtractScalar(in->image, statValue); 364 364 365 365 tmpOverscan = tmpOverscan->next; … … 639 639 640 640 if (bias != NULL) { 641 return( psSubtractFrame(in, bias));641 return(SubtractFrame(in, bias)); 642 642 } 643 643 return(in);
Note:
See TracChangeset
for help on using the changeset viewer.
