Changeset 3702 for trunk/psLib/src/imageops/psImageConvolve.c
- Timestamp:
- Apr 14, 2005, 2:12:09 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageConvolve.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageConvolve.c
r3682 r3702 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-04- 07 20:27:41$7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-04-15 00:12:08 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 398 398 } 399 399 400 psImageWriteSection(paddedImage,0,0,0,NULL,0,"paddedImage.fits");401 402 400 // pad the kernel to the same size of paddedImage 403 401 psImage* paddedKernel = psImageAlloc(paddedCols,paddedRows,PS_TYPE_KERNEL); … … 421 419 } 422 420 423 psImageWriteSection(paddedKernel,0,0,0,NULL,0,"paddedKernel.fits");424 425 421 psImage* kernelFourier = psImageFFT(NULL, paddedKernel, PS_FFT_FORWARD); 426 422 if (kernelFourier == NULL) { … … 440 436 441 437 // convolution in fourier domain is just a pixel-wise multiplication 442 psBinaryOp(inFourier,inFourier,"*",kernelFourier); 438 for (int row = 0; row < paddedRows; row++) { 439 psC32* inRow = inFourier->data.C32[row]; 440 psC32* kRow = kernelFourier->data.C32[row]; 441 for (int col = 0; col < paddedCols; col++) { 442 inRow[col] *= kRow[col]; 443 } 444 } 443 445 444 446 psImage* complexOut = psImageFFT(NULL, inFourier, … … 451 453 } 452 454 453 {454 psImage* tmp = psImageReal(NULL,complexOut);455 psImageWriteSection(tmp,0,0,0,NULL,0,"complexOut.fits");456 psFree(tmp);457 }458 459 455 // subset out the padded area now. 460 456 psImage* complexOutSansPad = psImageSubset(complexOut, … … 463 459 464 460 out = psImageRecycle(out,numCols,numRows,PS_TYPE_F32); 465 float factor = 1.0f/ numCols/numRows;461 float factor = 1.0f/(float)paddedCols/(float)paddedRows; 466 462 for (psS32 row = 0; row < numRows; row++) { 467 463 psF32* outRow = out->data.F32[row];
Note:
See TracChangeset
for help on using the changeset viewer.
