00001 /** \file
00002 * \brief Image Processing - Local Operations
00003 *
00004 * See Copyright Notice in im_lib.h
00005 * $Id: im_process_loc.h,v 1.6 2005/12/13 18:35:02 scuri Exp $
00006 */
00007
00008 #ifndef __IM_PROCESS_LOC_H
00009 #define __IM_PROCESS_LOC_H
00010
00011 #include "im_image.h"
00012
00013 #if defined(__cplusplus)
00014 extern "C" {
00015 #endif
00016
00017
00018
00019 /** \defgroup resize Image Resize
00020 * \par
00021 * Operations to change the image size.
00022 * \par
00023 * See \ref im_process_loc.h
00024 * \ingroup process */
00025
00026 /** Only reduze the image size using the given decimation order. \n
00027 * Supported decimation orders:
00028 * \li 0 - zero order (mean)
00029 * \li 1 - first order (bilinear decimation)
00030 * Images must be of the same type. \n
00031 * Returns zero if the counter aborted.
00032 *
00033 * \verbatim im.ProcessReduce(src_image: imImage, dst_image: imImage, order: number) -> counter: boolean [in Lua 5] \endverbatim
00034 * \verbatim im.ProcessReduceNew(image: imImage, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00035 * \ingroup resize */
00036 int imProcessReduce(const imImage* src_image, imImage* dst_image, int order);
00037
00038 /** Change the image size using the given interpolation order. \n
00039 * Supported interpolation orders:
00040 * \li 0 - zero order (near neighborhood)
00041 * \li 1 - first order (bilinear interpolation)
00042 * \li 3 - third order (bicubic interpolation)
00043 * Images must be of the same type. \n
00044 * Returns zero if the counter aborted.
00045 *
00046 * \verbatim im.ProcessResize(src_image: imImage, dst_image: imImage, order: number) -> counter: boolean [in Lua 5] \endverbatim
00047 * \verbatim im.ProcessResizeNew(image: imImage, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00048 * \ingroup resize */
00049 int imProcessResize(const imImage* src_image, imImage* dst_image, int order);
00050
00051 /** Reduze the image area by 4 (w/2,h/2). \n
00052 * Images must be of the same type. Destiny image size must be source image width/2, height/2.
00053 *
00054 * \verbatim im.ProcessReduceBy4(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00055 * \verbatim im.ProcessReduceBy4New(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00056 * \ingroup resize */
00057 void imProcessReduceBy4(const imImage* src_image, imImage* dst_image);
00058
00059 /** Extract a rectangular region from an image. \n
00060 * Images must be of the same type. Destiny image size must be smaller than source image width-xmin, height-ymin. \n
00061 * ymin and xmin must be >0 and <size.
00062 *
00063 * \verbatim im.ProcessCrop(src_image: imImage, dst_image: imImage, xmin: number, ymin: number) [in Lua 5] \endverbatim
00064 * \verbatim im.ProcessCropNew(image: imImage, xmin: number, xmax: number, ymin: number, ymax: number) -> new_image: imImage [in Lua 5] \endverbatim
00065 * \ingroup resize */
00066 void imProcessCrop(const imImage* src_image, imImage* dst_image, int xmin, int ymin);
00067
00068 /** Insert a rectangular region in an image. \n
00069 * Images must be of the same type. Region image size can be larger than source image. \n
00070 * ymin and xmin must be >0 and <size. \n
00071 * Source and destiny must be of the same size. Can be done in place.
00072 *
00073 * \verbatim im.ProcessInsert(src_image: imImage, region_image: imImage, dst_image: imImage, xmin: number, ymin: number) [in Lua 5] \endverbatim
00074 * \verbatim im.ProcessInsertNew(image: imImage, region_image: imImage, xmin: number, ymin: number) -> new_image: imImage [in Lua 5] \endverbatim
00075 * \ingroup resize */
00076 void imProcessInsert(const imImage* src_image, const imImage* region_image, imImage* dst_image, int xmin, int ymin);
00077
00078 /** Increase the image size by adding pixels with zero value. \n
00079 * Images must be of the same type. Destiny image size must be greatter than source image width+xmin, height+ymin.
00080 *
00081 * \verbatim im.ProcessAddMargins(src_image: imImage, dst_image: imImage, xmin: number, ymin: number) [in Lua 5] \endverbatim
00082 * \verbatim im.ProcessAddMarginsNew(image: imImage, xmin: number, xmax: number, ymin: number, ymax: number) -> new_image: imImage [in Lua 5] \endverbatim
00083 * \ingroup resize */
00084 void imProcessAddMargins(const imImage* src_image, imImage* dst_image, int xmin, int ymin);
00085
00086
00087
00088 /** \defgroup geom Geometric Operations
00089 * \par
00090 * Operations to change the shape of the image.
00091 * \par
00092 * See \ref im_process_loc.h
00093 * \ingroup process */
00094
00095 /** Calculates the size of the new image after rotation.
00096 *
00097 * \verbatim im.ProcessCalcRotateSize(width: number, height: number, cos0: number, sin0: number) [in Lua 5] \endverbatim
00098 * \ingroup geom */
00099 void imProcessCalcRotateSize(int width, int height, int *new_width, int *new_height, double cos0, double sin0);
00100
00101 /** Rotates the image using the given interpolation order (see \ref imProcessResize). \n
00102 * Images must be of the same type. The destiny size can be calculated using \ref imProcessCalcRotateSize. \n
00103 * Returns zero if the counter aborted.
00104 *
00105 * \verbatim im.ProcessRotate(src_image: imImage, dst_image: imImage, cos0: number, sin0: number, order: number) -> counter: boolean [in Lua 5] \endverbatim
00106 * \verbatim im.ProcessRotateNew(image: imImage, cos0: number, sin0: number, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00107 * \ingroup geom */
00108 int imProcessRotate(const imImage* src_image, imImage* dst_image, double cos0, double sin0, int order);
00109
00110 /** Rotate the image in 90 degrees counterclockwise or clockwise. Swap columns by lines. \n
00111 * Images must be of the same type. Destiny width and height must be source height and width. \n
00112 * Direction can be clockwise (1) or counter clockwise (-1).
00113 *
00114 * \verbatim im.ProcessRotate90(src_image: imImage, dst_image: imImage, dir_clockwise: boolean) [in Lua 5] \endverbatim
00115 * \verbatim im.ProcessRotate90New(image: imImage, dir_clockwise: boolean) -> new_image: imImage [in Lua 5] \endverbatim
00116 * \ingroup geom */
00117 void imProcessRotate90(const imImage* src_image, imImage* dst_image, int dir_clockwise);
00118
00119 /** Rotate the image in 180 degrees. Swap columns and swap lines. \n
00120 * Images must be of the same type and size.
00121 *
00122 * \verbatim im.ProcessRotate180(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00123 * \verbatim im.ProcessRotate180New(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00124 * \ingroup geom */
00125 void imProcessRotate180(const imImage* src_image, imImage* dst_image);
00126
00127 /** Mirrors the image in a horizontal flip. Swap columns. \n
00128 * Images must be of the same type and size.
00129 *
00130 * \verbatim im.ProcessMirror(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00131 * \verbatim im.ProcessMirrorNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00132 * \ingroup geom */
00133 void imProcessMirror(const imImage* src_image, imImage* dst_image);
00134
00135 /** Apply a vertical flip. Swap lines. \n
00136 * Images must be of the same type and size.
00137 *
00138 * \verbatim im.ProcessFlip(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00139 * \verbatim im.ProcessFlipNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00140 * \ingroup geom */
00141 void imProcessFlip(const imImage* src_image, imImage* dst_image);
00142
00143 /** Apply a radial distortion using the given interpolation order (see imProcessResize). \n
00144 * Images must be of the same type and size. Returns zero if the counter aborted.
00145 *
00146 * \verbatim im.ProcessRadial(src_image: imImage, dst_image: imImage, k1: number, order: number) -> counter: boolean [in Lua 5] \endverbatim
00147 * \verbatim im.ProcessRadialNew(image: imImage, k1: number, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00148 * \ingroup geom */
00149 int imProcessRadial(const imImage* src_image, imImage* dst_image, float k1, int order);
00150
00151
00152
00153 /** \defgroup morphgray Morphology Operations for Gray Images
00154 * \par
00155 * See \ref im_process_loc.h
00156 * \ingroup process */
00157
00158 /** Base gray morphology convolution. \n
00159 * Supports all data types except IM_CFLOAT. Can be applied on color images. \n
00160 * Kernel is always IM_INT. Use kernel size odd for better results. \n
00161 * You can use the maximum value or else the minimum value. \n
00162 * No border extensions are used.
00163 * All the gray morphology operations use this function. \n
00164 * If the kernel image attribute "Description" exists it is used by the counter.
00165 *
00166 * \verbatim im.ProcessGrayMorphConvolve(src_image: imImage, dst_image: imImage, kernel: imImage, ismax: boolean) -> counter: boolean [in Lua 5] \endverbatim
00167 * \verbatim im.ProcessGrayMorphConvolveNew(image: imImage, kernel: imImage, ismax: boolean) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00168 * \ingroup morphgray */
00169 int imProcessGrayMorphConvolve(const imImage* src_image, imImage* dst_image, const imImage* kernel, int ismax);
00170
00171 /** Gray morphology convolution with a kernel full of "0"s and use minimum value.
00172 *
00173 * \verbatim im.ProcessGrayMorphErode(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00174 * \verbatim im.ProcessGrayMorphErodeNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00175 * \ingroup morphgray */
00176 int imProcessGrayMorphErode(const imImage* src_image, imImage* dst_image, int kernel_size);
00177
00178 /** Gray morphology convolution with a kernel full of "0"s and use maximum value.
00179 *
00180 * \verbatim im.ProcessGrayMorphDilate(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00181 * \verbatim im.ProcessGrayMorphDilateNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00182 * \ingroup morphgray */
00183 int imProcessGrayMorphDilate(const imImage* src_image, imImage* dst_image, int kernel_size);
00184
00185 /** Erode+Dilate.
00186 *
00187 * \verbatim im.ProcessGrayMorphOpen(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00188 * \verbatim im.ProcessGrayMorphOpenNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00189 * \ingroup morphgray */
00190 int imProcessGrayMorphOpen(const imImage* src_image, imImage* dst_image, int kernel_size);
00191
00192 /** Dilate+Erode.
00193 *
00194 * \verbatim im.ProcessGrayMorphClose(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00195 * \verbatim im.ProcessGrayMorphCloseNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00196 * \ingroup morphgray */
00197 int imProcessGrayMorphClose(const imImage* src_image, imImage* dst_image, int kernel_size);
00198
00199 /** Open+Difference.
00200 *
00201 * \verbatim im.ProcessGrayMorphTopHat(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00202 * \verbatim im.ProcessGrayMorphTopHatNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00203 * \ingroup morphgray */
00204 int imProcessGrayMorphTopHat(const imImage* src_image, imImage* dst_image, int kernel_size);
00205
00206 /** Close+Difference.
00207 *
00208 * \verbatim im.ProcessGrayMorphWell(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00209 * \verbatim im.ProcessGrayMorphWellNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00210 * \ingroup morphgray */
00211 int imProcessGrayMorphWell(const imImage* src_image, imImage* dst_image, int kernel_size);
00212
00213 /** Difference(Erode, Dilate).
00214 *
00215 * \verbatim im.ProcessGrayMorphGradient(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00216 * \verbatim im.ProcessGrayMorphGradientNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00217 * \ingroup morphgray */
00218 int imProcessGrayMorphGradient(const imImage* src_image, imImage* dst_image, int kernel_size);
00219
00220
00221
00222 /** \defgroup morphbin Morphology Operations for Binary Images
00223 * \par
00224 * See \ref im_process_loc.h
00225 * \ingroup process */
00226
00227 /** Base binary morphology convolution. \n
00228 * Images are all IM_BINARY. Kernel is IM_INT. Use kernel size odd for better results. \n
00229 * Hit white means hit=1 and miss=0, or else hit=0 and miss=1. \n
00230 * Use -1 for don't care positions in kernel. \n
00231 * The operation can be repeated by a number of iterations.
00232 * The border is zero extended. \n
00233 * Almost all the binary morphology operations use this function.\n
00234 * If the kernel image attribute "Description" exists it is used by the counter.
00235 *
00236 * \verbatim im.ProcessBinMorphConvolve(src_image: imImage, dst_image: imImage, kernel: imImage, hit_white: boolean, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00237 * \verbatim im.ProcessBinMorphConvolveNew(image: imImage, kernel: imImage, hit_white: boolean, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00238 * \ingroup morphbin */
00239 int imProcessBinMorphConvolve(const imImage* src_image, imImage* dst_image, const imImage* kernel, int hit_white, int iter);
00240
00241 /** Binary morphology convolution with a kernel full of "1"s and hit white.
00242 *
00243 * \verbatim im.ProcessBinMorphErode(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00244 * \verbatim im.ProcessBinMorphErodeNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00245 * \ingroup morphbin */
00246 int imProcessBinMorphErode(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00247
00248 /** Binary morphology convolution with a kernel full of "0"s and hit black.
00249 *
00250 * \verbatim im.ProcessBinMorphDilate(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00251 * \verbatim im.ProcessBinMorphDilateNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00252 * \ingroup morphbin */
00253 int imProcessBinMorphDilate(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00254
00255 /** Erode+Dilate.
00256 * When iteration is more than one it means Erode+Erode+Erode+...+Dilate+Dilate+Dilate+...
00257 *
00258 * \verbatim im.ProcessBinMorphOpen(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00259 * \verbatim im.ProcessBinMorphOpenNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00260 * \ingroup morphbin */
00261 int imProcessBinMorphOpen(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00262
00263 /** Dilate+Erode.
00264 *
00265 * \verbatim im.ProcessBinMorphClose(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00266 * \verbatim im.ProcessBinMorphCloseNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00267 * \ingroup morphbin */
00268 int imProcessBinMorphClose(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00269
00270 /** Erode+Difference. \n
00271 * The difference from the source image is applied only once.
00272 *
00273 * \verbatim im.ProcessBinMorphOutline(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00274 * \verbatim im.ProcessBinMorphOutlineNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00275 * \ingroup morphbin */
00276 int imProcessBinMorphOutline(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00277
00278 /** Thins the supplied binary image using Rosenfeld's parallel thinning algorithm. \n
00279 * Reference: \n
00280 * "Efficient Binary Image Thinning using Neighborhood Maps" \n
00281 * by Joseph M. Cychosz, [email protected] \n
00282 * in "Graphics Gems IV", Academic Press, 1994
00283 *
00284 * \verbatim im.ProcessBinMorphThin(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00285 * \verbatim im.ProcessBinMorphThinNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00286 * \ingroup morphbin */
00287 void imProcessBinMorphThin(const imImage* src_image, imImage* dst_image);
00288
00289
00290
00291 /** \defgroup rank Rank Convolution Operations
00292 * \par
00293 * All the rank convolution use the same base function. Near the border the base function
00294 * includes only the real image pixels in the rank. No border extensions are used.
00295 * \par
00296 * See \ref im_process_loc.h
00297 * \ingroup process */
00298
00299 /** Rank convolution using the median value. \n
00300 * Returns zero if the counter aborted. \n
00301 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00302 *
00303 * \verbatim im.ProcessMedianConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00304 * \verbatim im.ProcessMedianConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00305 * \ingroup rank */
00306 int imProcessMedianConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00307
00308 /** Rank convolution using (maximum-minimum) value. \n
00309 * Returns zero if the counter aborted. \n
00310 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00311 *
00312 * \verbatim im.ProcessRangeConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00313 * \verbatim im.ProcessRangeConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00314 * \ingroup rank */
00315 int imProcessRangeConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00316
00317 /** Rank convolution using the closest maximum or minimum value. \n
00318 * Returns zero if the counter aborted. \n
00319 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00320 *
00321 * \verbatim im.ProcessRankClosestConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00322 * \verbatim im.ProcessRankClosestConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00323 * \ingroup rank */
00324 int imProcessRankClosestConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00325
00326 /** Rank convolution using the maximum value. \n
00327 * Returns zero if the counter aborted. \n
00328 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00329 *
00330 * \verbatim im.ProcessRankMaxConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00331 * \verbatim im.ProcessRankMaxConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00332 * \ingroup rank */
00333 int imProcessRankMaxConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00334
00335 /** Rank convolution using the minimum value. \n
00336 * Returns zero if the counter aborted. \n
00337 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00338 *
00339 * \verbatim im.ProcessRankMinConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00340 * \verbatim im.ProcessRankMinConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00341 * \ingroup rank */
00342 int imProcessRankMinConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00343
00344 /** Threshold using a rank convolution with a range contrast function. \n
00345 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny. \n
00346 * Local variable threshold by the method of Bernsen. \n
00347 * Extracted from XITE, Copyright 1991, Blab, UiO \n
00348 * http://www.ifi.uio.no/~blab/Software/Xite/
00349 \verbatim
00350 Reference:
00351 Bernsen, J: "Dynamic thresholding of grey-level images"
00352 Proc. of the 8th ICPR, Paris, Oct 1986, 1251-1255.
00353 Author: Oivind Due Trier
00354 \endverbatim
00355 * Returns zero if the counter aborted.
00356 *
00357 * \verbatim im.ProcessRangeContrastThreshold(src_image: imImage, dst_image: imImage, kernel_size: number, min_range: number) -> counter: boolean [in Lua 5] \endverbatim
00358 * \verbatim im.ProcessRangeContrastThresholdNew(image: imImage, kernel_size: number, min_range: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00359 * \ingroup threshold */
00360 int imProcessRangeContrastThreshold(const imImage* src_image, imImage* dst_image, int kernel_size, int min_range);
00361
00362 /** Threshold using a rank convolution with a local max function. \n
00363 * Returns zero if the counter aborted. \n
00364 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.
00365 *
00366 * \verbatim im.ProcessLocalMaxThreshold(src_image: imImage, dst_image: imImage, kernel_size: number, min_level: number) -> counter: boolean [in Lua 5] \endverbatim
00367 * \verbatim im.ProcessLocalMaxThresholdNew(image: imImage, kernel_size: number, min_level: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00368 * \ingroup threshold */
00369 int imProcessLocalMaxThreshold(const imImage* src_image, imImage* dst_image, int kernel_size, int min_level);
00370
00371
00372
00373 /** \defgroup convolve Convolution Operations
00374 * \par
00375 * See \ref im_process_loc.h
00376 * \ingroup process */
00377
00378 /** Base Convolution with a kernel. \n
00379 * Kernel can be IM_INT or IM_FLOAT, but always IM_GRAY. Use kernel size odd for better results. \n
00380 * Supports all data types. The border is mirrored. \n
00381 * Returns zero if the counter aborted. Most of the convolutions use this function.\n
00382 * If the kernel image attribute "Description" exists it is used by the counter.
00383 *
00384 * \verbatim im.ProcessConvolve(src_image: imImage, dst_image: imImage, kernel: imImage) -> counter: boolean [in Lua 5] \endverbatim
00385 * \verbatim im.ProcessConvolveNew(image: imImage, kernel: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00386 * \ingroup convolve */
00387 int imProcessConvolve(const imImage* src_image, imImage* dst_image, const imImage* kernel);
00388
00389 /** Repeats the convolution a number of times. \n
00390 * Returns zero if the counter aborted.\n
00391 * If the kernel image attribute "Description" exists it is used by the counter.
00392 *
00393 * \verbatim im.ProcessConvolveRep(src_image: imImage, dst_image: imImage, kernel: imImage, count: number) -> counter: boolean [in Lua 5] \endverbatim
00394 * \verbatim im.ProcessConvolveRepNew(image: imImage, kernel: imImage, count: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00395 * \ingroup convolve */
00396 int imProcessConvolveRep(const imImage* src_image, imImage* dst_image, const imImage* kernel, int count);
00397
00398 /** Convolve with a kernel rotating it 8 times and getting the absolute maximum value. \n
00399 * Kernel must be square. \n
00400 * The rotation is implemented only for kernel sizes 3x3, 5x5 and 7x7. \n
00401 * Supports all data types except IM_CFLOAT.
00402 * Returns zero if the counter aborted.\n
00403 * If the kernel image attribute "Description" exists it is used by the counter.
00404 *
00405 * \verbatim im.ProcessCompassConvolve(src_image: imImage, dst_image: imImage, kernel: imImage) -> counter: boolean [in Lua 5] \endverbatim
00406 * \verbatim im.ProcessCompassConvolveNew(image: imImage, kernel: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00407 * \ingroup convolve */
00408 int imProcessCompassConvolve(const imImage* src_image, imImage* dst_image, imImage* kernel);
00409
00410 /** Utility function to rotate a kernel one time.
00411 *
00412 * \verbatim im.ProcessRotateKernel(kernel: imImage) [in Lua 5] \endverbatim
00413 * \ingroup convolve */
00414 void imProcessRotateKernel(imImage* kernel);
00415
00416 /** Difference(Gaussian1, Gaussian2). \n
00417 * Supports all data types,
00418 * but if source is IM_BYTE or IM_USHORT destiny image must be of type IM_INT.
00419 *
00420 * \verbatim im.ProcessDiffOfGaussianConvolve(src_image: imImage, dst_image: imImage, stddev1: number, stddev2: number) -> counter: boolean [in Lua 5] \endverbatim
00421 * \verbatim im.ProcessDiffOfGaussianConvolveNew(image: imImage, stddev1: number, stddev2: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00422 * \ingroup convolve */
00423 int imProcessDiffOfGaussianConvolve(const imImage* src_image, imImage* dst_image, float stddev1, float stddev2);
00424
00425 /** Difference(Gaussian1, Gaussian2) using gaussian repetitions. \n
00426 * Supports all data types,
00427 * but if source is IM_BYTE or IM_USHORT destiny image must be of type IM_INT.
00428 *
00429 * \verbatim im.ProcessDiffOfGaussianConvolveRep(src_image: imImage, dst_image: imImage, stddev1: number, stddev2: number) -> counter: boolean [in Lua 5] \endverbatim
00430 * \verbatim im.ProcessDiffOfGaussianConvolveRepNew(image: imImage, stddev1: number, stddev2: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00431 * \ingroup convolve */
00432 int imProcessDiffOfGaussianConvolveRep(const imImage* src_image, imImage* dst_image, float stddev1, float stddev2);
00433
00434 /** Convolution with a laplacian of a gaussian kernel. \n
00435 * Supports all data types,
00436 * but if source is IM_BYTE or IM_USHORT destiny image must be of type IM_INT.
00437 *
00438 * \verbatim im.ProcessLapOfGaussianConvolve(src_image: imImage, dst_image: imImage, stddev: number) -> counter: boolean [in Lua 5] \endverbatim
00439 * \verbatim im.ProcessLapOfGaussianConvolveNew(image: imImage, stddev: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00440 * \ingroup convolve */
00441 int imProcessLapOfGaussianConvolve(const imImage* src_image, imImage* dst_image, float stddev);
00442
00443 /** Convolution with a kernel full of "1"s inside a circle. \n
00444 * Supports all data types.
00445 *
00446 * \verbatim im.ProcessMeanConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00447 * \verbatim im.ProcessMeanConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00448 * \ingroup convolve */
00449 int imProcessMeanConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00450
00451 /** Convolution with a gaussian kernel. The gaussian in obtained by repetition of a base 3x3 IM_INT kernel. \n
00452 * Supports all data types.
00453 *
00454 * \verbatim im.ProcessGaussianConvolveRep(src_image: imImage, dst_image: imImage, stddev: number) -> counter: boolean [in Lua 5] \endverbatim
00455 * \verbatim im.ProcessGaussianConvolveRepNew(image: imImage, stddev: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00456 * \ingroup convolve */
00457 int imProcessGaussianConvolveRep(const imImage* src_image, imImage* dst_image, float stddev);
00458
00459 /** Convolution with a float gaussian kernel. \n
00460 * Supports all data types.
00461 *
00462 * \verbatim im.ProcessGaussianConvolve(src_image: imImage, dst_image: imImage, stddev: number) -> counter: boolean [in Lua 5] \endverbatim
00463 * \verbatim im.ProcessGaussianConvolveNew(image: imImage, stddev: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00464 * \ingroup convolve */
00465 int imProcessGaussianConvolve(const imImage* src_image, imImage* dst_image, float stddev);
00466
00467 /** Magnitude of the sobel convolution. \n
00468 * Supports all data types except IM_CFLOAT.
00469 *
00470 * \verbatim im.ProcessSobelConvolve(src_image: imImage, dst_image: imImage) -> counter: boolean [in Lua 5] \endverbatim
00471 * \verbatim im.ProcessSobelConvolveNew(image: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00472 * \ingroup convolve */
00473 int imProcessSobelConvolve(const imImage* src_image, imImage* dst_image);
00474
00475 /** Finds the zero crossings of IM_INT and IM_FLOAT images. Crossings are marked with non zero values
00476 * indicating the intensity of the edge. It is usually used after a second derivative, laplace. \n
00477 * Extracted from XITE, Copyright 1991, Blab, UiO \n
00478 * http://www.ifi.uio.no/~blab/Software/Xite/
00479 *
00480 * \verbatim im.ProcessZeroCrossing(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00481 * \verbatim im.ProcessZeroCrossingNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00482 * \ingroup convolve */
00483 void imProcessZeroCrossing(const imImage* src_image, imImage* dst_image);
00484
00485 /** First part of the Canny edge detector. Includes the gaussian filtering and the nonmax suppression. \n
00486 * After using this you could apply a Hysteresis Threshold, see \ref imProcessHysteresisThreshold. \n
00487 * Image must be IM_BYTE/IM_GRAY. \n
00488 * Implementation from the book:
00489 \verbatim
00490 J. R. Parker
00491 "Algoritms for Image Processing and Computer Vision"
00492 WILEY
00493 \endverbatim
00494 *
00495 * \verbatim im.ProcessCanny(src_image: imImage, dst_image: imImage, stddev: number) [in Lua 5] \endverbatim
00496 * \verbatim im.ProcessCannyNew(image: imImage, stddev: number) -> new_image: imImage [in Lua 5] \endverbatim
00497 * \ingroup convolve */
00498 void imProcessCanny(const imImage* src_image, imImage* dst_image, float stddev);
00499
00500 /** Calculates the number of 3x3 gaussian repetitions given the standard deviation.
00501 *
00502 * \verbatim im.GaussianStdDev2Repetitions(stddev: number) -> count: number [in Lua 5] \endverbatim
00503 * \ingroup convolve */
00504 int imGaussianStdDev2Repetitions(float stddev);
00505
00506 /** Calculates the kernel size given the standard deviation.
00507 *
00508 * \verbatim im.GaussianStdDev2KernelSize(stddev: number) -> kernel_size: number [in Lua 5] \endverbatim
00509 * \ingroup convolve */
00510 int imGaussianStdDev2KernelSize(float stddev);
00511
00512
00513 #if defined(__cplusplus)
00514 }
00515 #endif
00516
00517 #endif