Changeset 5294 for trunk/psLib/src/imageops/psImageStats.c
- Timestamp:
- Oct 12, 2005, 11:02:20 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageStats.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageStats.c
r5213 r5294 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.8 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005- 09-30 23:09:13$11 * @version $Revision: 1.83 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-10-12 21:02:20 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 233 233 chebPolys[1]->coeff[1] = 1; 234 234 for (i = 2; i < maxChebyPoly; i++) { 235 for (j = 0; j < (1 + chebPolys[i - 1]-> COOL_1D_n); j++) {235 for (j = 0; j < (1 + chebPolys[i - 1]->nX); j++) { 236 236 chebPolys[i]->coeff[j + 1] = 2 * chebPolys[i - 1]->coeff[j]; 237 237 } 238 for (j = 0; j < (1 + chebPolys[i - 2]-> COOL_1D_n); j++) {238 for (j = 0; j < (1 + chebPolys[i - 2]->nX); j++) { 239 239 chebPolys[i]->coeff[j] -= chebPolys[i - 2]->coeff[j]; 240 240 } … … 291 291 // 29 in the ADD: sums[k][l] = SUM { 292 292 // image(x,y) * Tk(x) * Tl(y) } 293 sums = (double **)psAlloc((1 + coeffs-> COOL_2D_nX) * sizeof(double *));294 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {295 sums[i] = (double *)psAlloc((1 + coeffs-> COOL_2D_nY) * sizeof(double));293 sums = (double **)psAlloc((1 + coeffs->nX) * sizeof(double *)); 294 for (i = 0; i < (1 + coeffs->nX); i++) { 295 sums[i] = (double *)psAlloc((1 + coeffs->nY) * sizeof(double)); 296 296 } 297 297 // We scale the pixel positions to values … … 303 303 // are needed, then create them. 304 304 // XXX: recorde or verify the poly order/nterm change 305 maxChebyPoly = coeffs-> COOL_2D_nX;306 if (coeffs-> COOL_2D_nY > coeffs->COOL_2D_nX) {307 maxChebyPoly = coeffs-> COOL_2D_nY;305 maxChebyPoly = coeffs->nX; 306 if (coeffs->nY > coeffs->nX) { 307 maxChebyPoly = coeffs->nY; 308 308 } 309 309 chebPolys = p_psCreateChebyshevPolys(maxChebyPoly + 1); 310 310 311 311 // Compute the sums[][] data structure. 312 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {313 for (j = 0; j < (1 + coeffs-> COOL_2D_nY); j++) {312 for (i = 0; i < (1 + coeffs->nX); i++) { 313 for (j = 0; j < (1 + coeffs->nY); j++) { 314 314 sums[i][j] = 0.0; 315 315 for (x = 0; x < input->numRows; x++) { … … 332 332 } 333 333 334 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {335 for (j = 0; j < (1 + coeffs-> COOL_2D_nY); j++) {334 for (i = 0; i < (1 + coeffs->nX); i++) { 335 for (j = 0; j < (1 + coeffs->nY); j++) { 336 336 coeffs->coeff[i][j] = sums[i][j]; 337 337 coeffs->coeff[i][j] /= (double)(input->numRows * input->numCols); … … 355 355 356 356 // Free some data 357 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {357 for (i = 0; i < (1 + coeffs->nX); i++) { 358 358 psFree(sums[i]); 359 359 } … … 438 438 // 29 in the ADD: sums[k][l] = SUM { 439 439 // image(x,y) * Tk(x) * Tl(y) } 440 sums = (double **)psAlloc((1 + coeffs-> COOL_2D_nX) * sizeof(double *));441 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {442 sums[i] = (double *)psAlloc((1 + coeffs-> COOL_2D_nY) * sizeof(double));440 sums = (double **)psAlloc((1 + coeffs->nX) * sizeof(double *)); 441 for (i = 0; i < (1 + coeffs->nX); i++) { 442 sums[i] = (double *)psAlloc((1 + coeffs->nY) * sizeof(double)); 443 443 } 444 444 // We scale the pixel positions to values … … 449 449 // Determine how many Chebyshev polynomials 450 450 // are needed, then create them. 451 maxChebyPoly = coeffs-> COOL_2D_nX;452 if (coeffs-> COOL_2D_nY > coeffs->COOL_2D_nX) {453 maxChebyPoly = coeffs-> COOL_2D_nY;451 maxChebyPoly = coeffs->nX; 452 if (coeffs->nY > coeffs->nX) { 453 maxChebyPoly = coeffs->nY; 454 454 } 455 455 chebPolys = p_psCreateChebyshevPolys(maxChebyPoly + 1); 456 456 457 457 // Compute the sums[][] data structure. 458 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {459 for (j = 0; j < (1 + coeffs-> COOL_2D_nY); j++) {458 for (i = 0; i < (1 + coeffs->nX); i++) { 459 for (j = 0; j < (1 + coeffs->nY); j++) { 460 460 sums[i][j] = 0.0; 461 461 for (x = 0; x < input->numRows; x++) { … … 481 481 } 482 482 483 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {484 for (j = 0; j < (1 + coeffs-> COOL_2D_nY); j++) {483 for (i = 0; i < (1 + coeffs->nX); i++) { 484 for (j = 0; j < (1 + coeffs->nY); j++) { 485 485 coeffs->coeff[i][j] = sums[i][j]; 486 486 coeffs->coeff[i][j] /= (double)(input->numRows * input->numCols); … … 504 504 505 505 // Free some data 506 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {506 for (i = 0; i < (1 + coeffs->nX); i++) { 507 507 psFree(sums[i]); 508 508 } … … 540 540 // Determine how many Chebyshev polynomials 541 541 // are needed, then create them. 542 maxChebyPoly = coeffs-> COOL_2D_nX;543 if (coeffs-> COOL_2D_nY > coeffs->COOL_2D_nX) {544 maxChebyPoly = coeffs-> COOL_2D_nY;542 maxChebyPoly = coeffs->nX; 543 if (coeffs->nY > coeffs->nX) { 544 maxChebyPoly = coeffs->nY; 545 545 } 546 546 … … 550 550 for (y = 0; y < input->numCols; y++) { 551 551 polySum = 0.0; 552 for (i = 0; i < (1 + coeffs-> COOL_2D_nX); i++) {553 for (j = 0; j < (1 + coeffs-> COOL_2D_nY); j++) {552 for (i = 0; i < (1 + coeffs->nX); i++) { 553 for (j = 0; j < (1 + coeffs->nY); j++) { 554 554 polySum += 555 555 psPolynomial1DEval(chebPolys[i], rScalingFactors[x]) *
Note:
See TracChangeset
for help on using the changeset viewer.
