Changeset 1889 for trunk/psModules/src/pmSubtractBias.c
- Timestamp:
- Sep 24, 2004, 1:47:21 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmSubtractBias.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmSubtractBias.c
r1885 r1889 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-09-24 23: 00:37$10 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-09-24 23:47:21 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 144 144 } 145 145 146 // XXX: Must scale the overscan vector 146 /****************************************************************************** 147 ScaleOverscanVector(): this routine takes as input an arbitrary vector, 148 creates anew vector of length n, and fills the new vector with the 149 interpolated values of the old vector. The type of interpolation is: 150 PM_FIT_POLYNOMIAL: fit a polynomial to the entire input vector data. 151 PM_FIT_SPLINE: fit splines to the input vector data. 152 XXX: Doesn't it make more sense to do polynomial interpolation on a few 153 elements of the input vector, rather than fit a polynomial to the entire 154 vector? 155 *****************************************************************************/ 147 156 psVector *ScaleOverscanVector(psVector *overscanVector, 148 157 int n, 158 void *fitSpec, 149 159 pmFit fit) 150 160 { 151 161 psVector *newVec = psVectorAlloc(n, PS_TYPE_F32); 152 153 if (fit == PM_FIT_POLYNOMIAL) {} 154 else if (fit == PM_FIT_SPLINE) {} 155 else {} 162 psPolynomial1D *myPoly; 163 psSpline1D *mySpline; 164 float x; 165 int i; 166 167 if (fit == PM_FIT_POLYNOMIAL) { 168 myPoly = (psPolynomial1D *) fitSpec; 169 myPoly = psVectorFitPolynomial1D(myPoly, NULL, overscanVector, NULL); 170 for (i=0;i<n;i++) { 171 x = (((float) i) / ((float) n)) * ((float) overscanVector->n); 172 newVec->data.F32[i] = psPolynomial1DEval(x, myPoly); 173 } 174 } else if (fit == PM_FIT_SPLINE) { 175 mySpline = (psSpline1D *) fitSpec; 176 mySpline = psVectorFitSpline1D(mySpline, NULL, overscanVector, NULL); 177 for (i=0;i<n;i++) { 178 x = (((float) i) / ((float) n)) * ((float) overscanVector->n); 179 newVec->data.F32[i] = psSpline1DEval(mySpline, x); 180 } 181 } else { 182 // XXX: psErrorMsg() 183 } 184 156 185 return(newVec); 157 186 } … … 251 280 } 252 281 psFree(tmpRow); 253 ScaleOverscanVector(overscanVector, (in->image)->numCols, fit );282 ScaleOverscanVector(overscanVector, (in->image)->numCols, fitSpec, fit); 254 283 } 255 284 if (overScanAxis == PM_OVERSCAN_COLUMNS) { … … 274 303 } 275 304 psFree(tmpCol); 276 ScaleOverscanVector(overscanVector, (in->image)->numRows, fit );305 ScaleOverscanVector(overscanVector, (in->image)->numRows, fitSpec, fit); 277 306 } 278 307
Note:
See TracChangeset
for help on using the changeset viewer.
