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.12 2006/11/22 19:55:32 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. If image type is IM_MAP or IM_BINARY, must use order=0. \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. If image type is IM_MAP or IM_BINARY, must use order=0. \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 * Can not operate on IM_MAP nor IM_BINARY images.
00054 *
00055 * \verbatim im.ProcessReduceBy4(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00056 * \verbatim im.ProcessReduceBy4New(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00057 * \ingroup resize */
00058 void imProcessReduceBy4(const imImage* src_image, imImage* dst_image);
00059
00060 /** Extract a rectangular region from an image. \n
00061 * Images must be of the same type. Destiny image size must be smaller than source image width-xmin, height-ymin. \n
00062 * ymin and xmin must be >0 and <size.
00063 *
00064 * \verbatim im.ProcessCrop(src_image: imImage, dst_image: imImage, xmin: number, ymin: number) [in Lua 5] \endverbatim
00065 * \verbatim im.ProcessCropNew(image: imImage, xmin: number, xmax: number, ymin: number, ymax: number) -> new_image: imImage [in Lua 5] \endverbatim
00066 * \ingroup resize */
00067 void imProcessCrop(const imImage* src_image, imImage* dst_image, int xmin, int ymin);
00068
00069 /** Insert a rectangular region in an image. \n
00070 * Images must be of the same type. Region image size can be larger than source image. \n
00071 * ymin and xmin must be >0 and <size. \n
00072 * Source and destiny must be of the same size. Can be done in place.
00073 *
00074 * \verbatim im.ProcessInsert(src_image: imImage, region_image: imImage, dst_image: imImage, xmin: number, ymin: number) [in Lua 5] \endverbatim
00075 * \verbatim im.ProcessInsertNew(image: imImage, region_image: imImage, xmin: number, ymin: number) -> new_image: imImage [in Lua 5] \endverbatim
00076 * \ingroup resize */
00077 void imProcessInsert(const imImage* src_image, const imImage* region_image, imImage* dst_image, int xmin, int ymin);
00078
00079 /** Increase the image size by adding pixels with zero value. \n
00080 * Images must be of the same type. Destiny image size must be greatter than source image width+xmin, height+ymin.
00081 *
00082 * \verbatim im.ProcessAddMargins(src_image: imImage, dst_image: imImage, xmin: number, ymin: number) [in Lua 5] \endverbatim
00083 * \verbatim im.ProcessAddMarginsNew(image: imImage, xmin: number, xmax: number, ymin: number, ymax: number) -> new_image: imImage [in Lua 5] \endverbatim
00084 * \ingroup resize */
00085 void imProcessAddMargins(const imImage* src_image, imImage* dst_image, int xmin, int ymin);
00086
00087
00088
00089 /** \defgroup geom Geometric Operations
00090 * \par
00091 * Operations to change the shape of the image.
00092 * \par
00093 * See \ref im_process_loc.h
00094 * \ingroup process */
00095
00096 /** Calculates the size of the new image after rotation.
00097 *
00098 * \verbatim im.ProcessCalcRotateSize(width: number, height: number, cos0: number, sin0: number) [in Lua 5] \endverbatim
00099 * \ingroup geom */
00100 void imProcessCalcRotateSize(int width, int height, int *new_width, int *new_height, double cos0, double sin0);
00101
00102 /** Rotates the image using the given interpolation order (see \ref imProcessResize). \n
00103 * Images must be of the same type. The destiny size can be calculated using \ref imProcessCalcRotateSize to fit the new image size,
00104 * or can be any size, including the original size. The rotation is relative to the center of the image. \n
00105 * Returns zero if the counter aborted.
00106 *
00107 * \verbatim im.ProcessRotate(src_image: imImage, dst_image: imImage, cos0: number, sin0: number, order: number) -> counter: boolean [in Lua 5] \endverbatim
00108 * \verbatim im.ProcessRotateNew(image: imImage, cos0: number, sin0: number, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00109 * \ingroup geom */
00110 int imProcessRotate(const imImage* src_image, imImage* dst_image, double cos0, double sin0, int order);
00111
00112 /** Rotates the image using the given interpolation order (see \ref imProcessResize). \n
00113 * Images must be of the same type. Destiny can have any size, including the original size. \n
00114 * The rotation is relative to the reference point. But the result can be shifted to the origin. \n
00115 * Returns zero if the counter aborted.
00116 *
00117 * \verbatim im.ProcessRotateRef(src_image: imImage, dst_image: imImage, cos0: number, sin0: number, x: number, y: number, to_origin: boolean, order: number) -> counter: boolean [in Lua 5] \endverbatim
00118 * \verbatim im.ProcessRotateRefNew(image: imImage, cos0: number, sin0: number, x: number, y: number, to_origin: boolean, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00119 * \ingroup geom */
00120 int imProcessRotateRef(const imImage* src_image, imImage* dst_image, double cos0, double sin0, int x, int y, int to_origin, int order);
00121
00122 /** Rotates the image in 90 degrees counterclockwise or clockwise. Swap columns by lines. \n
00123 * Images must be of the same type. Destiny width and height must be source height and width. \n
00124 * Direction can be clockwise (1) or counter clockwise (-1).
00125 *
00126 * \verbatim im.ProcessRotate90(src_image: imImage, dst_image: imImage, dir_clockwise: boolean) [in Lua 5] \endverbatim
00127 * \verbatim im.ProcessRotate90New(image: imImage, dir_clockwise: boolean) -> new_image: imImage [in Lua 5] \endverbatim
00128 * \ingroup geom */
00129 void imProcessRotate90(const imImage* src_image, imImage* dst_image, int dir_clockwise);
00130
00131 /** Rotates the image in 180 degrees. Swap columns and swap lines. \n
00132 * Images must be of the same type and size.
00133 *
00134 * \verbatim im.ProcessRotate180(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00135 * \verbatim im.ProcessRotate180New(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00136 * \ingroup geom */
00137 void imProcessRotate180(const imImage* src_image, imImage* dst_image);
00138
00139 /** Mirror the image in a horizontal flip. Swap columns. \n
00140 * Images must be of the same type and size.
00141 * Can be done in-place.
00142 *
00143 * \verbatim im.ProcessMirror(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00144 * \verbatim im.ProcessMirrorNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00145 * \ingroup geom */
00146 void imProcessMirror(const imImage* src_image, imImage* dst_image);
00147
00148 /** Apply a vertical flip. Swap lines. \n
00149 * Images must be of the same type and size.
00150 * Can be done in-place.
00151 *
00152 * \verbatim im.ProcessFlip(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00153 * \verbatim im.ProcessFlipNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00154 * \ingroup geom */
00155 void imProcessFlip(const imImage* src_image, imImage* dst_image);
00156
00157 /** Apply a radial distortion using the given interpolation order (see imProcessResize). \n
00158 * Images must be of the same type and size. Returns zero if the counter aborted.
00159 *
00160 * \verbatim im.ProcessRadial(src_image: imImage, dst_image: imImage, k1: number, order: number) -> counter: boolean [in Lua 5] \endverbatim
00161 * \verbatim im.ProcessRadialNew(image: imImage, k1: number, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00162 * \ingroup geom */
00163 int imProcessRadial(const imImage* src_image, imImage* dst_image, float k1, int order);
00164
00165 /** Apply a swirl distortion using the given interpolation order (see imProcessResize). \n
00166 * Images must be of the same type and size. Returns zero if the counter aborted.
00167 *
00168 * \verbatim im.ProcessSwirl(src_image: imImage, dst_image: imImage, k: number, order: number) -> counter: boolean [in Lua 5] \endverbatim
00169 * \verbatim im.ProcessSwirlNew(image: imImage, k: number, order: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00170 * \ingroup geom */
00171 int imProcessSwirl(const imImage* src_image, imImage* dst_image, float k1, int order);
00172
00173 /** Split the image in two images, one containing the odd lines and other containing the even lines. \n
00174 * Images must be of the same type. Height of the output images must be half the height of the input image.
00175 * If the height of the input image is odd then the first image must have height equals to half+1.
00176 *
00177 * \verbatim im.ProcessInterlaceSplit(src_image: imImage, dst_image1: imImage, dst_image2: imImage) [in Lua 5] \endverbatim
00178 * \verbatim im.ProcessInterlaceSplitNew(image: imImage) -> new_image1: imImage, new_image2: imImage [in Lua 5] \endverbatim
00179 * \ingroup geom */
00180 void imProcessInterlaceSplit(const imImage* src_image, imImage* dst_image1, imImage* dst_image2);
00181
00182
00183
00184 /** \defgroup morphgray Morphology Operations for Gray Images
00185 * \par
00186 * See \ref im_process_loc.h
00187 * \ingroup process */
00188
00189 /** Base gray morphology convolution. \n
00190 * Supports all data types except IM_CFLOAT. Can be applied on color images. \n
00191 * Kernel is always IM_INT. Use kernel size odd for better results. \n
00192 * Use -1 for don't care positions in kernel. Kernel values are added to image values, then \n
00193 * you can use the maximum or the minimum within the kernel area. \n
00194 * No border extensions are used.
00195 * All the gray morphology operations use this function. \n
00196 * If the kernel image attribute "Description" exists it is used by the counter.
00197 *
00198 * \verbatim im.ProcessGrayMorphConvolve(src_image: imImage, dst_image: imImage, kernel: imImage, ismax: boolean) -> counter: boolean [in Lua 5] \endverbatim
00199 * \verbatim im.ProcessGrayMorphConvolveNew(image: imImage, kernel: imImage, ismax: boolean) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00200 * \ingroup morphgray */
00201 int imProcessGrayMorphConvolve(const imImage* src_image, imImage* dst_image, const imImage* kernel, int ismax);
00202
00203 /** Gray morphology convolution with a kernel full of "0"s and use minimum value.
00204 *
00205 * \verbatim im.ProcessGrayMorphErode(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00206 * \verbatim im.ProcessGrayMorphErodeNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00207 * \ingroup morphgray */
00208 int imProcessGrayMorphErode(const imImage* src_image, imImage* dst_image, int kernel_size);
00209
00210 /** Gray morphology convolution with a kernel full of "0"s and use maximum value.
00211 *
00212 * \verbatim im.ProcessGrayMorphDilate(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00213 * \verbatim im.ProcessGrayMorphDilateNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00214 * \ingroup morphgray */
00215 int imProcessGrayMorphDilate(const imImage* src_image, imImage* dst_image, int kernel_size);
00216
00217 /** Erode+Dilate.
00218 *
00219 * \verbatim im.ProcessGrayMorphOpen(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00220 * \verbatim im.ProcessGrayMorphOpenNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00221 * \ingroup morphgray */
00222 int imProcessGrayMorphOpen(const imImage* src_image, imImage* dst_image, int kernel_size);
00223
00224 /** Dilate+Erode.
00225 *
00226 * \verbatim im.ProcessGrayMorphClose(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00227 * \verbatim im.ProcessGrayMorphCloseNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00228 * \ingroup morphgray */
00229 int imProcessGrayMorphClose(const imImage* src_image, imImage* dst_image, int kernel_size);
00230
00231 /** Open+Difference.
00232 *
00233 * \verbatim im.ProcessGrayMorphTopHat(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00234 * \verbatim im.ProcessGrayMorphTopHatNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00235 * \ingroup morphgray */
00236 int imProcessGrayMorphTopHat(const imImage* src_image, imImage* dst_image, int kernel_size);
00237
00238 /** Close+Difference.
00239 *
00240 * \verbatim im.ProcessGrayMorphWell(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00241 * \verbatim im.ProcessGrayMorphWellNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00242 * \ingroup morphgray */
00243 int imProcessGrayMorphWell(const imImage* src_image, imImage* dst_image, int kernel_size);
00244
00245 /** Difference(Erode, Dilate).
00246 *
00247 * \verbatim im.ProcessGrayMorphGradient(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00248 * \verbatim im.ProcessGrayMorphGradientNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00249 * \ingroup morphgray */
00250 int imProcessGrayMorphGradient(const imImage* src_image, imImage* dst_image, int kernel_size);
00251
00252
00253
00254 /** \defgroup morphbin Morphology Operations for Binary Images
00255 * \par
00256 * See \ref im_process_loc.h
00257 * \ingroup process */
00258
00259 /** Base binary morphology convolution. \n
00260 * Images are all IM_BINARY. Kernel is IM_INT, but values can be only 1, 0 or -1. Use kernel size odd for better results. \n
00261 * Hit white means hit=1 and miss=0, or else hit=0 and miss=1. \n
00262 * Use -1 for don't care positions in kernel. Kernel values are simply compared with image values. \n
00263 * The operation can be repeated by a number of iterations.
00264 * The border is zero extended. \n
00265 * Almost all the binary morphology operations use this function.\n
00266 * If the kernel image attribute "Description" exists it is used by the counter.
00267 *
00268 * \verbatim im.ProcessBinMorphConvolve(src_image: imImage, dst_image: imImage, kernel: imImage, hit_white: boolean, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00269 * \verbatim im.ProcessBinMorphConvolveNew(image: imImage, kernel: imImage, hit_white: boolean, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00270 * \ingroup morphbin */
00271 int imProcessBinMorphConvolve(const imImage* src_image, imImage* dst_image, const imImage* kernel, int hit_white, int iter);
00272
00273 /** Binary morphology convolution with a kernel full of "1"s and hit white.
00274 *
00275 * \verbatim im.ProcessBinMorphErode(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00276 * \verbatim im.ProcessBinMorphErodeNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00277 * \ingroup morphbin */
00278 int imProcessBinMorphErode(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00279
00280 /** Binary morphology convolution with a kernel full of "0"s and hit black.
00281 *
00282 * \verbatim im.ProcessBinMorphDilate(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00283 * \verbatim im.ProcessBinMorphDilateNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00284 * \ingroup morphbin */
00285 int imProcessBinMorphDilate(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00286
00287 /** Erode+Dilate.
00288 * When iteration is more than one it means Erode+Erode+Erode+...+Dilate+Dilate+Dilate+...
00289 *
00290 * \verbatim im.ProcessBinMorphOpen(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00291 * \verbatim im.ProcessBinMorphOpenNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00292 * \ingroup morphbin */
00293 int imProcessBinMorphOpen(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00294
00295 /** Dilate+Erode.
00296 *
00297 * \verbatim im.ProcessBinMorphClose(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00298 * \verbatim im.ProcessBinMorphCloseNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00299 * \ingroup morphbin */
00300 int imProcessBinMorphClose(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00301
00302 /** Erode+Difference. \n
00303 * The difference from the source image is applied only once.
00304 *
00305 * \verbatim im.ProcessBinMorphOutline(src_image: imImage, dst_image: imImage, kernel_size: number, iter: number) -> counter: boolean [in Lua 5] \endverbatim
00306 * \verbatim im.ProcessBinMorphOutlineNew(image: imImage, kernel_size: number, iter: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00307 * \ingroup morphbin */
00308 int imProcessBinMorphOutline(const imImage* src_image, imImage* dst_image, int kernel_size, int iter);
00309
00310 /** Thins the supplied binary image using Rosenfeld's parallel thinning algorithm. \n
00311 * Reference: \n
00312 * "Efficient Binary Image Thinning using Neighborhood Maps" \n
00313 * by Joseph M. Cychosz, [email protected] \n
00314 * in "Graphics Gems IV", Academic Press, 1994
00315 *
00316 * \verbatim im.ProcessBinMorphThin(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00317 * \verbatim im.ProcessBinMorphThinNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00318 * \ingroup morphbin */
00319 void imProcessBinMorphThin(const imImage* src_image, imImage* dst_image);
00320
00321
00322
00323 /** \defgroup rank Rank Convolution Operations
00324 * \par
00325 * All the rank convolution use the same base function. Near the border the base function
00326 * includes only the real image pixels in the rank. No border extensions are used.
00327 * \par
00328 * See \ref im_process_loc.h
00329 * \ingroup process */
00330
00331 /** Rank convolution using the median value. \n
00332 * Returns zero if the counter aborted. \n
00333 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00334 *
00335 * \verbatim im.ProcessMedianConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00336 * \verbatim im.ProcessMedianConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00337 * \ingroup rank */
00338 int imProcessMedianConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00339
00340 /** Rank convolution using (maximum-minimum) value. \n
00341 * Returns zero if the counter aborted. \n
00342 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00343 *
00344 * \verbatim im.ProcessRangeConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00345 * \verbatim im.ProcessRangeConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00346 * \ingroup rank */
00347 int imProcessRangeConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00348
00349 /** Rank convolution using the closest maximum or minimum value. \n
00350 * Returns zero if the counter aborted. \n
00351 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00352 *
00353 * \verbatim im.ProcessRankClosestConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00354 * \verbatim im.ProcessRankClosestConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00355 * \ingroup rank */
00356 int imProcessRankClosestConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00357
00358 /** Rank convolution using the maximum value. \n
00359 * Returns zero if the counter aborted. \n
00360 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00361 *
00362 * \verbatim im.ProcessRankMaxConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00363 * \verbatim im.ProcessRankMaxConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00364 * \ingroup rank */
00365 int imProcessRankMaxConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00366
00367 /** Rank convolution using the minimum value. \n
00368 * Returns zero if the counter aborted. \n
00369 * Supports all data types except IM_CFLOAT. Can be applied on color images.
00370 *
00371 * \verbatim im.ProcessRankMinConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00372 * \verbatim im.ProcessRankMinConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00373 * \ingroup rank */
00374 int imProcessRankMinConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00375
00376 /** Threshold using a rank convolution with a range contrast function. \n
00377 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny. \n
00378 * Local variable threshold by the method of Bernsen. \n
00379 * Extracted from XITE, Copyright 1991, Blab, UiO \n
00380 * http://www.ifi.uio.no/~blab/Software/Xite/
00381 \verbatim
00382 Reference:
00383 Bernsen, J: "Dynamic thresholding of grey-level images"
00384 Proc. of the 8th ICPR, Paris, Oct 1986, 1251-1255.
00385 Author: Oivind Due Trier
00386 \endverbatim
00387 * Returns zero if the counter aborted.
00388 *
00389 * \verbatim im.ProcessRangeContrastThreshold(src_image: imImage, dst_image: imImage, kernel_size: number, min_range: number) -> counter: boolean [in Lua 5] \endverbatim
00390 * \verbatim im.ProcessRangeContrastThresholdNew(image: imImage, kernel_size: number, min_range: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00391 * \ingroup threshold */
00392 int imProcessRangeContrastThreshold(const imImage* src_image, imImage* dst_image, int kernel_size, int min_range);
00393
00394 /** Threshold using a rank convolution with a local max function. \n
00395 * Returns zero if the counter aborted. \n
00396 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.
00397 *
00398 * \verbatim im.ProcessLocalMaxThreshold(src_image: imImage, dst_image: imImage, kernel_size: number, min_level: number) -> counter: boolean [in Lua 5] \endverbatim
00399 * \verbatim im.ProcessLocalMaxThresholdNew(image: imImage, kernel_size: number, min_level: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00400 * \ingroup threshold */
00401 int imProcessLocalMaxThreshold(const imImage* src_image, imImage* dst_image, int kernel_size, int min_level);
00402
00403
00404
00405 /** \defgroup convolve Convolution Operations
00406 * \par
00407 * See \ref im_process_loc.h
00408 * \ingroup process */
00409
00410 /** Base Convolution with a kernel. \n
00411 * Kernel can be IM_INT or IM_FLOAT, but always IM_GRAY. Use kernel size odd for better results. \n
00412 * Supports all data types. The border is mirrored. \n
00413 * Returns zero if the counter aborted. Most of the convolutions use this function.\n
00414 * If the kernel image attribute "Description" exists it is used by the counter.
00415 *
00416 * \verbatim im.ProcessConvolve(src_image: imImage, dst_image: imImage, kernel: imImage) -> counter: boolean [in Lua 5] \endverbatim
00417 * \verbatim im.ProcessConvolveNew(image: imImage, kernel: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00418 * \ingroup convolve */
00419 int imProcessConvolve(const imImage* src_image, imImage* dst_image, const imImage* kernel);
00420
00421 /** Base convolution when the kernel is separable. Only the first line and the first column will be used. \n
00422 * Returns zero if the counter aborted.\n
00423 * If the kernel image attribute "Description" exists it is used by the counter.
00424 *
00425 * \verbatim im.ProcessConvolveSep(src_image: imImage, dst_image: imImage, kernel: imImage) -> counter: boolean [in Lua 5] \endverbatim
00426 * \verbatim im.ProcessConvolveSepNew(image: imImage, kernel: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00427 * \ingroup convolve */
00428 int imProcessConvolveSep(const imImage* src_image, imImage* dst_image, const imImage* kernel);
00429
00430 /** Base Convolution with two kernels. The result is the magnitude of the result of each convolution. \n
00431 * Kernel can be IM_INT or IM_FLOAT, but always IM_GRAY. Use kernel size odd for better results. \n
00432 * Supports all data types. The border is mirrored. \n
00433 * Returns zero if the counter aborted. Most of the convolutions use this function.\n
00434 * If the kernel image attribute "Description" exists it is used by the counter.
00435 *
00436 * \verbatim im.ProcessConvolveDual(src_image: imImage, dst_image: imImage, kernel1, kernel2: imImage) -> counter: boolean [in Lua 5] \endverbatim
00437 * \verbatim im.ProcessConvolveDualNew(image: imImage, kernel1, kernel2: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00438 * \ingroup convolve */
00439 int imProcessConvolveDual(const imImage* src_image, imImage* dst_image, const imImage *kernel1, const imImage *kernel2);
00440
00441 /** Repeats the convolution a number of times. \n
00442 * Returns zero if the counter aborted.\n
00443 * If the kernel image attribute "Description" exists it is used by the counter.
00444 *
00445 * \verbatim im.ProcessConvolveRep(src_image: imImage, dst_image: imImage, kernel: imImage, count: number) -> counter: boolean [in Lua 5] \endverbatim
00446 * \verbatim im.ProcessConvolveRepNew(image: imImage, kernel: imImage, count: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00447 * \ingroup convolve */
00448 int imProcessConvolveRep(const imImage* src_image, imImage* dst_image, const imImage* kernel, int count);
00449
00450 /** Convolve with a kernel rotating it 8 times and getting the absolute maximum value. \n
00451 * Kernel must be square. \n
00452 * The rotation is implemented only for kernel sizes 3x3, 5x5 and 7x7. \n
00453 * Supports all data types except IM_CFLOAT.
00454 * Returns zero if the counter aborted.\n
00455 * If the kernel image attribute "Description" exists it is used by the counter.
00456 *
00457 * \verbatim im.ProcessCompassConvolve(src_image: imImage, dst_image: imImage, kernel: imImage) -> counter: boolean [in Lua 5] \endverbatim
00458 * \verbatim im.ProcessCompassConvolveNew(image: imImage, kernel: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00459 * \ingroup convolve */
00460 int imProcessCompassConvolve(const imImage* src_image, imImage* dst_image, imImage* kernel);
00461
00462 /** Utility function to rotate a kernel one time.
00463 *
00464 * \verbatim im.ProcessRotateKernel(kernel: imImage) [in Lua 5] \endverbatim
00465 * \ingroup convolve */
00466 void imProcessRotateKernel(imImage* kernel);
00467
00468 /** Difference(Gaussian1, Gaussian2). \n
00469 * Supports all data types,
00470 * but if source is IM_BYTE or IM_USHORT destiny image must be of type IM_INT.
00471 *
00472 * \verbatim im.ProcessDiffOfGaussianConvolve(src_image: imImage, dst_image: imImage, stddev1: number, stddev2: number) -> counter: boolean [in Lua 5] \endverbatim
00473 * \verbatim im.ProcessDiffOfGaussianConvolveNew(image: imImage, stddev1: number, stddev2: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00474 * \ingroup convolve */
00475 int imProcessDiffOfGaussianConvolve(const imImage* src_image, imImage* dst_image, float stddev1, float stddev2);
00476
00477 /** Convolution with a laplacian of a gaussian kernel. \n
00478 * Supports all data types,
00479 * but if source is IM_BYTE or IM_USHORT destiny image must be of type IM_INT.
00480 *
00481 * \verbatim im.ProcessLapOfGaussianConvolve(src_image: imImage, dst_image: imImage, stddev: number) -> counter: boolean [in Lua 5] \endverbatim
00482 * \verbatim im.ProcessLapOfGaussianConvolveNew(image: imImage, stddev: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00483 * \ingroup convolve */
00484 int imProcessLapOfGaussianConvolve(const imImage* src_image, imImage* dst_image, float stddev);
00485
00486 /** Convolution with a kernel full of "1"s inside a circle. \n
00487 * Supports all data types.
00488 *
00489 * \verbatim im.ProcessMeanConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00490 * \verbatim im.ProcessMeanConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00491 * \ingroup convolve */
00492 int imProcessMeanConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00493
00494 /** Convolution with a float gaussian kernel. \n
00495 * If sdtdev is negative its magnitude will be used as the kernel size. \n
00496 * Supports all data types.
00497 *
00498 * \verbatim im.ProcessGaussianConvolve(src_image: imImage, dst_image: imImage, stddev: number) -> counter: boolean [in Lua 5] \endverbatim
00499 * \verbatim im.ProcessGaussianConvolveNew(image: imImage, stddev: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00500 * \ingroup convolve */
00501 int imProcessGaussianConvolve(const imImage* src_image, imImage* dst_image, float stddev);
00502
00503 /** Convolution with a barlett kernel. \n
00504 * Supports all data types.
00505 *
00506 * \verbatim im.ProcessBarlettConvolve(src_image: imImage, dst_image: imImage, kernel_size: number) -> counter: boolean [in Lua 5] \endverbatim
00507 * \verbatim im.ProcessBarlettConvolveNew(image: imImage, kernel_size: number) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00508 * \ingroup convolve */
00509 int imProcessBarlettConvolve(const imImage* src_image, imImage* dst_image, int kernel_size);
00510
00511 /** Magnitude of the sobel convolution. \n
00512 * Supports all data types.
00513 *
00514 * \verbatim im.ProcessSobelConvolve(src_image: imImage, dst_image: imImage) -> counter: boolean [in Lua 5] \endverbatim
00515 * \verbatim im.ProcessSobelConvolveNew(image: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00516 * \ingroup convolve */
00517 int imProcessSobelConvolve(const imImage* src_image, imImage* dst_image);
00518
00519 /** Magnitude of the prewitt convolution. \n
00520 * Supports all data types.
00521 *
00522 * \verbatim im.ProcessPrewittConvolve(src_image: imImage, dst_image: imImage) -> counter: boolean [in Lua 5] \endverbatim
00523 * \verbatim im.ProcessPrewittConvolveNew(image: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00524 * \ingroup convolve */
00525 int imProcessPrewittConvolve(const imImage* src_image, imImage* dst_image);
00526
00527 /** Spline edge dectection. \n
00528 * Supports all data types.
00529 *
00530 * \verbatim im.ProcessSplineEdgeConvolve(src_image: imImage, dst_image: imImage) -> counter: boolean [in Lua 5] \endverbatim
00531 * \verbatim im.ProcessSplineEdgeConvolveNew(image: imImage) -> counter: boolean, new_image: imImage [in Lua 5] \endverbatim
00532 * \ingroup convolve */
00533 int imProcessSplineEdgeConvolve(const imImage* src_image, imImage* dst_image);
00534
00535 /** Finds the zero crossings of IM_INT and IM_FLOAT images. Crossings are marked with non zero values
00536 * indicating the intensity of the edge. It is usually used after a second derivative, laplace. \n
00537 * Extracted from XITE, Copyright 1991, Blab, UiO \n
00538 * http://www.ifi.uio.no/~blab/Software/Xite/
00539 *
00540 * \verbatim im.ProcessZeroCrossing(src_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
00541 * \verbatim im.ProcessZeroCrossingNew(image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
00542 * \ingroup convolve */
00543 void imProcessZeroCrossing(const imImage* src_image, imImage* dst_image);
00544
00545 /** First part of the Canny edge detector. Includes the gaussian filtering and the nonmax suppression. \n
00546 * After using this you could apply a Hysteresis Threshold, see \ref imProcessHysteresisThreshold. \n
00547 * Image must be IM_BYTE/IM_GRAY. \n
00548 * Implementation from the book:
00549 \verbatim
00550 J. R. Parker
00551 "Algoritms for Image Processing and Computer Vision"
00552 WILEY
00553 \endverbatim
00554 *
00555 * \verbatim im.ProcessCanny(src_image: imImage, dst_image: imImage, stddev: number) [in Lua 5] \endverbatim
00556 * \verbatim im.ProcessCannyNew(image: imImage, stddev: number) -> new_image: imImage [in Lua 5] \endverbatim
00557 * \ingroup convolve */
00558 void imProcessCanny(const imImage* src_image, imImage* dst_image, float stddev);
00559
00560 /** Calculates the kernel size given the standard deviation. \n
00561 * If sdtdev is negative its magnitude will be used as the kernel size.
00562 *
00563 * \verbatim im.GaussianStdDev2KernelSize(stddev: number) -> kernel_size: number [in Lua 5] \endverbatim
00564 * \ingroup convolve */
00565 int imGaussianStdDev2KernelSize(float stddev);
00566
00567 /** Calculates the standard deviation given the kernel size.
00568 *
00569 * \verbatim im.GaussianKernelSize2StdDev(kernel_size: number) -> stddev: number [in Lua 5] \endverbatim
00570 * \ingroup convolve */
00571 float imGaussianKernelSize2StdDev(int kernel_size);
00572
00573
00574 #if defined(__cplusplus)
00575 }
00576 #endif
00577
00578 #endif