IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 8, 2005, 1:40:46 PM (21 years ago)
Author:
desonia
Message:

added comments on the end of #endif and #else

File:
1 edited

Legend:

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

    r3264 r4162  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-17 19:26:24 $
     9 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-08 23:40:45 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4141/** Allocates a convolution kernel of the given range
    4242 *
    43  *  In order to perform a convolution, we need to define the convolution 
    44  *  kernel. We need a more general object than a psImage so that we can 
    45  *  incorporate the offset from the (0, 0) pixel to the (0, 0) value of the 
    46  *  kernel. It might be convenient to allow both positive and negative 
    47  *  indices to convey the positive and negative shifts. One might consider 
    48  *  setting the x0 and y0 members of a psImage to the appropriate offsets, 
    49  *  but this is not the purpose of these members, and doing so may affect the 
     43 *  In order to perform a convolution, we need to define the convolution
     44 *  kernel. We need a more general object than a psImage so that we can
     45 *  incorporate the offset from the (0, 0) pixel to the (0, 0) value of the
     46 *  kernel. It might be convenient to allow both positive and negative
     47 *  indices to convey the positive and negative shifts. One might consider
     48 *  setting the x0 and y0 members of a psImage to the appropriate offsets,
     49 *  but this is not the purpose of these members, and doing so may affect the
    5050 *  behavior of other psImage operations.
    5151 *
    52  *  This construction allows the kernel member to use negative indices, while 
     52 *  This construction allows the kernel member to use negative indices, while
    5353 *  preserving the location of psMemBlocks relative to allocated memory.
    5454 *
    55  *  The maximum extent of the kernel shifts shall be defined by the xMin, 
    56  *  xMax, yMin and yMax members. Note that xMin and yMin, under normal 
    57  *  circumstances, should be negative numbers. That is, 
    58  *  myKernel->kernel[-3][-2] may be defined if yMin and xMin are equal to or 
     55 *  The maximum extent of the kernel shifts shall be defined by the xMin,
     56 *  xMax, yMin and yMax members. Note that xMin and yMin, under normal
     57 *  circumstances, should be negative numbers. That is,
     58 *  myKernel->kernel[-3][-2] may be defined if yMin and xMin are equal to or
    5959 *  more negative than -3 and -2, respectively.
    6060 *
    61  *  In the event that one of the minimum values is greater than the 
    62  *  corresponding maximum value, the function shall generate a warning, and 
     61 *  In the event that one of the minimum values is greater than the
     62 *  corresponding maximum value, the function shall generate a warning, and
    6363 *  the offending values shall be exchanged.
    6464 *
     
    7474/** Generates a kernel given a list of shift values
    7575 *
    76  *  Given a list of values (e.g., shifts made in the course of OT guiding), 
    77  *  psKernelGenerate shall return the appropriate kernel.  The vectors xShifts 
    78  *  and yShifts, which are a list of shifts relative to some starting point, 
    79  *  will be supplied by the user. The elements of the vectors should be of an 
    80  *  integer type; otherwise the values shall be truncated to integers. The 
    81  *  output kernel shall be normalized such that the sum over the kernel is 
    82  *  unity. 
     76 *  Given a list of values (e.g., shifts made in the course of OT guiding),
     77 *  psKernelGenerate shall return the appropriate kernel.  The vectors xShifts
     78 *  and yShifts, which are a list of shifts relative to some starting point,
     79 *  will be supplied by the user. The elements of the vectors should be of an
     80 *  integer type; otherwise the values shall be truncated to integers. The
     81 *  output kernel shall be normalized such that the sum over the kernel is
     82 *  unity.
    8383 *
    84  *  If the vectors are not of the same number of elements, then the function 
    85  *  shall generate a warning shall be generated, following which, the longer 
     84 *  If the vectors are not of the same number of elements, then the function
     85 *  shall generate a warning shall be generated, following which, the longer
    8686 *  vector trimmed to the length of the shorter, and the function shall continue.
    8787 *
     
    9797/** convolve an image with a kernel
    9898 *
    99  *  Given an input image and the convolution kernel, psImageConvolve shall 
    100  *  convolve the input image, in, with the kernel, kernel and return the 
     99 *  Given an input image and the convolution kernel, psImageConvolve shall
     100 *  convolve the input image, in, with the kernel, kernel and return the
    101101 *  convolved image, out.
    102  * 
    103  *  Two methods shall be available for the convolution: if direct is true, 
    104  *  then the convolution shall be performed in real space (appropriate for 
    105  *  small kernels); otherwise, the convolution shall be performed using Fast 
    106  *  Fourier Transforms (FFTs; appropriate for larger kernels). The latter 
    107  *  option involves padding the input image, copying the kernel into an image 
    108  *  of the same size as the padded input image, performing an FFT on each, 
    109  *  multiplying the FFTs, and performing an inverse FFT before trimming the 
     102 *
     103 *  Two methods shall be available for the convolution: if direct is true,
     104 *  then the convolution shall be performed in real space (appropriate for
     105 *  small kernels); otherwise, the convolution shall be performed using Fast
     106 *  Fourier Transforms (FFTs; appropriate for larger kernels). The latter
     107 *  option involves padding the input image, copying the kernel into an image
     108 *  of the same size as the padded input image, performing an FFT on each,
     109 *  multiplying the FFTs, and performing an inverse FFT before trimming the
    110110 *  image back to the original size.
    111111 *
    112  *  @return psImage*  resulting image 
     112 *  @return psImage*  resulting image
    113113 */
    114114psImage* psImageConvolve(
     
    119119);
    120120
    121 #endif
     121#endif // #ifndef PS_IMAGE_CONVOLVE_H
Note: See TracChangeset for help on using the changeset viewer.