Changeset 4162 for trunk/psLib/src/image/psImageConvolve.h
- Timestamp:
- Jun 8, 2005, 1:40:46 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImageConvolve.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageConvolve.h
r3264 r4162 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 2-17 19:26:24$9 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-08 23:40:45 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 41 41 /** Allocates a convolution kernel of the given range 42 42 * 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 50 50 * behavior of other psImage operations. 51 51 * 52 * This construction allows the kernel member to use negative indices, while 52 * This construction allows the kernel member to use negative indices, while 53 53 * preserving the location of psMemBlocks relative to allocated memory. 54 54 * 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 59 59 * more negative than -3 and -2, respectively. 60 60 * 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 63 63 * the offending values shall be exchanged. 64 64 * … … 74 74 /** Generates a kernel given a list of shift values 75 75 * 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. 83 83 * 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 86 86 * vector trimmed to the length of the shorter, and the function shall continue. 87 87 * … … 97 97 /** convolve an image with a kernel 98 98 * 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 101 101 * 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 110 110 * image back to the original size. 111 111 * 112 * @return psImage* resulting image 112 * @return psImage* resulting image 113 113 */ 114 114 psImage* psImageConvolve( … … 119 119 ); 120 120 121 #endif 121 #endif // #ifndef PS_IMAGE_CONVOLVE_H
Note:
See TracChangeset
for help on using the changeset viewer.
