- Timestamp:
- Feb 10, 2010, 11:37:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psModules/src/detrend/pmPattern.c
r26844 r26845 158 158 int numCols = image->numCols, numRows = image->numRows; // Size of image 159 159 160 psPolynomial1D *poly = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, numCols - 1); // Polynomial to apply 160 if (corr->numRows != numRows) { 161 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 162 "Number of rows of image (%d) does not match number of rows of pattern correction (%d)\n", 163 numRows, corr->numRows); 164 return false; 165 } 166 167 int order = corr->numCols - 1; // Polynomial order 168 psPolynomial1D *poly = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, order); // Polynomial to apply 161 169 psVector *indices = psVectorAlloc(numCols, PS_TYPE_F32); // Indices for polynomial 162 170 float norm = 2.0 / (float)numCols; // Normalisation for indices … … 166 174 167 175 for (int y = 0; y < numRows; y++) { 168 memcpy(poly->coeff, corr->data.F64[y], numCols* PSELEMTYPE_SIZEOF(PS_TYPE_F64));176 memcpy(poly->coeff, corr->data.F64[y], order * PSELEMTYPE_SIZEOF(PS_TYPE_F64)); 169 177 psVector *solution = psPolynomial1DEvalVector(poly, indices); // Solution vector 170 178 if (!solution) {
Note:
See TracChangeset
for help on using the changeset viewer.
