IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14704


Ignore:
Timestamp:
Aug 30, 2007, 10:15:23 AM (19 years ago)
Author:
Paul Price
Message:

Was doing direct convolution using x+u instead of x-u --- no
difference if the kernel is symmetric.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageConvolve.c

    r14638 r14704  
    77/// @author Eugene Magnier, IfA
    88///
    9 /// @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
    10 /// @date $Date: 2007-08-23 21:52:29 $
     9/// @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
     10/// @date $Date: 2007-08-30 20:15:23 $
    1111///
    1212/// Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    259259        for (int row = 0; row < numRows; row++) { \
    260260            ps##TYPE *outRow = out->data.TYPE[row]; \
     261            int kRowMin = PS_MAX(yMin, row + 1 - numRows); \
     262            int kRowMax = PS_MIN(yMax, row); \
    261263            for (int col = 0; col < numCols; col++) { \
     264                int kColMin = PS_MAX(xMin, col + 1 - numCols); \
     265                int kColMax = PS_MIN(xMax, col); \
    262266                ps##TYPE pixel = 0.0; \
    263                 for (int kRow = PS_MAX(yMin, -row); kRow <= PS_MIN(yMax, numRows - row - 1); kRow++) { \
    264                     for (int kCol = PS_MAX(xMin, -col); kCol <= PS_MIN(xMax, numCols - col - 1); kCol++) { \
    265                         pixel += kernelData[kRow][kCol] * inData[row + kRow][col + kCol]; \
     267                for (int kRow = kRowMin; kRow <= kRowMax; kRow++) { \
     268                    for (int kCol = kColMin; kCol <= kColMax; kCol++) { \
     269                        pixel += kernelData[kRow][kCol] * inData[row - kRow][col - kCol]; \
    266270                    } \
    267271                } \
     
    286290                    continue; \
    287291                } \
    288                 for (int y = PS_MAX(- ky, 0); y < PS_MIN(numRows, numRows - ky); y++) { \
    289                     for (int x = PS_MAX(- kx, 0); x < PS_MIN(numCols, numCols - kx); x++) { \
    290                         out->data.TYPE[y][x] += kValue * inData[y + ky][x + kx]; \
     292                for (int y = PS_MAX(ky, 0); y < PS_MIN(numRows, numRows + ky); y++) { \
     293                    for (int x = PS_MAX(kx, 0); x < PS_MIN(numCols, numCols + kx); x++) { \
     294                        out->data.TYPE[y][x] += kValue * inData[y - ky][x - kx]; \
    291295                    } \
    292296                } \
Note: See TracChangeset for help on using the changeset viewer.