binary_filters.h

00001 
00002 /*----------------------------------------------------------------------------
00003  *                                  E.S.O.
00004  *----------------------------------------------------------------------------
00005  * File name    :   binary_filters.h
00006  * Author       :   Nicolas Devillard
00007  * Created on   :   March 4th, 1997
00008  * Hardware     :   Sun Sparc 20
00009  * Software     :   ANSI C under Solaris Unix
00010  *                  Part of ECLIPSE library for Adonis
00011  * Description  :   various binary filters
00012  *--------------------------------------------------------------------------*/
00013 
00014 /*
00015 
00016  $Id: binary_filters.h,v 1.1 2003/09/03 12:50:47 amodigli Exp $
00017  $Author: amodigli $
00018  $Date: 2003/09/03 12:50:47 $
00019  $Revision: 1.1 $
00020 
00021  */
00022 
00023 #ifndef _BINARY_FILTERS_H_
00024 #define _BINARY_FILTERS_H_
00025 
00026 /*----------------------------------------------------------------------------
00027  *                              Includes
00028  *--------------------------------------------------------------------------*/
00029 
00030 #include <stdlib.h>
00031 #include <stdio.h>
00032 #include <math.h>
00033 
00034 #include "memory.h"
00035 #include "pixelmaps.h"
00036 #include "globals.h"
00037 
00038 /*----------------------------------------------------------------------------
00039  *                       Function ANSI C prototypes
00040  *--------------------------------------------------------------------------*/
00041 
00042 /*---------------------------------------------------------------------------
00043  * Function :   binary_filter_erosion()
00044  * In       :   pixel_map
00045  * Out      :   newly created pixel_map
00046  * Job      :   performs a binary morphological erosion (min)
00047  * Notice   :
00048  *--------------------------------------------------------------------------*/
00049 
00050 pixel_map * binary_filter_erosion(pixel_map * in) ;
00051 
00052 
00053 /*----------------------------------------------------------------------------
00054  * Function :   binary_filter_dilatation()
00055  * In       :   pixel_map
00056  * Out      :   newly created pixel_map
00057  * Job      :   performs a binary morphological dilatation (max)
00058  * Notice   :
00059  *--------------------------------------------------------------------------*/
00060 
00061 
00062 pixel_map * binary_filter_dilatation(pixel_map * in) ;
00063 
00064 
00065 
00066 /*----------------------------------------------------------------------------
00067  * Function :   binary_morpho_closing()
00068  * In       :   pixel_map
00069  * Out      :   newly created pixel_map
00070  * Job      :   perform a morphological binary closing
00071  * Notice   :   equivalent to erosion + dilatation
00072  *--------------------------------------------------------------------------*/
00073 
00074 pixel_map * binary_morpho_closing(pixel_map *in) ;
00075 
00076 
00077 
00078 /*----------------------------------------------------------------------------
00079  * Function :   binary_morpho_opening()
00080  * In       :   pixel_map
00081  * Out      :   newly created pixel map
00082  * Job      :   perform a morphological binary closing
00083  * Notice   :   equivalent to dilatation + erosion
00084  *--------------------------------------------------------------------------*/
00085 
00086 pixel_map * binary_morpho_opening(pixel_map *in) ;
00087 
00088 /*---------------------------------------------------------------------------
00089  * Function :   erode_binary()
00090  * In       :   image pixel_map, kernel pixel map
00091  * Out      :   newly created eroded pixel_map
00092  * Job      :   performs a binary morphological erosion with a kernel
00093  *          :   defined by the ONE's in kernel_map
00094  * Notice   :   This is a high level interface to erode_binary_prim
00095  *          :   which does the erosion. This routine allocates
00096  *          :   the new pixel_map and initializes it
00097  *--------------------------------------------------------------------------*/
00098 pixel_map *erode_binary(pixel_map *pm, pixel_map *f);
00099 
00100 /*---------------------------------------------------------------------------
00101    Function :   dilate_binary()
00102    In       :   image pixel_map, kernel pixel_map
00103    Out      :   newly created dilated pixel_map
00104    Job      :   performs a binary morphological dilatation with a kernel
00105                 defined by the one's in kernel_map
00106    Notice   :   This is a high level interface to dilate_binary_prim()
00107                 which does the dilatation. This routine allocates 
00108                 the new pixel_map and initializes it
00109  ---------------------------------------------------------------------------*/
00110 pixel_map *dilate_binary(pixel_map *in, pixel_map *kernel) ;
00111 
00112 /*---------------------------------------------------------------------------
00113  * Function :   erode_binary_prim()
00114  * In       :   image pixel_map, kernel pixel map, output eroded
00115  *          :   pixel_map (initially filled in with identical data as
00116  *          :   in_map (which are then altered)
00117  * Out      :   0 if Ok -1 if not
00118  * Job      :   performs a binary morphological erosion with a kernel
00119  *          :   defined by the ONE's in kernel_map
00120  * Notice   :   This is the low level routine which
00121  *          :   does the erosion. This routine 
00122  *          :   will (someday hopefully) be modified to take a single
00123  *          :   pixelmap and act destructively upon it
00124  *--------------------------------------------------------------------------*/
00125 int erode_binary_prim(pixel_map *pm, pixel_map *f, pixel_map *om);
00126 
00127 /*---------------------------------------------------------------------------
00128  * Function :   dilate_binary_prim()
00129  * In       :   image pixel_map, kernel pixel map, output dilated
00130  *          :   pixel_map (initially filled in with identical data as
00131  *          :   in_map (which are then altered)
00132  * Out      :   0 if Ok -1 if not
00133  * Job      :   performs a binary morphological erosion with a kernel
00134  *          :   defined by the ONE's in kernel_map
00135  * Notice   :   This is the low level routine which
00136  *          :   does the erosion. This routine 
00137  *          :   will (someday hopefully) be modified to take a single
00138  *          :   pixelmap and act destructively upon it
00139  *--------------------------------------------------------------------------*/
00140 int dilate_binary_prim(pixel_map *in_map, pixel_map *kernel_map, 
00141         pixel_map *out_map);
00142 
00143 /*---------------------------------------------------------------------------
00144  * Function :   create_kernel_cross()
00145  * In       :   length & height of cross 
00146  * Out      :   pixelmap lx times ly in size with ONE's in the cross
00147  * Job      :   creates a cross pixelmap kernel
00148  * Notice   :   
00149  *--------------------------------------------------------------------------*/
00150 pixel_map *create_kernel_cross(int lx, int ly);
00151 
00152 /*---------------------------------------------------------------------------
00153  * Function :   close_binary()
00154  * In       :   image pixel_map, kernel pixel map
00155  * Out      :   0 if OK -1 if not OK
00156  * Job      :   performs a binary morphological closing with a kernel
00157  *          :   defined by the ONE's in kernel_map
00158  * Notice   :   This routine acts destructively on in_map
00159  *--------------------------------------------------------------------------*/
00160 int close_binary(pixel_map *in, pixel_map *f);
00161 
00162 /*---------------------------------------------------------------------------
00163  * Function :   print_kernel()
00164  * In       :   kernel pixel map, output file
00165  * Out      :   0 if OK -1 if not
00166  * Job      :   prints a 2-dimensional integer table of kernel_map
00167  * Notice   :   
00168  *--------------------------------------------------------------------------*/
00169 int print_kernel(pixel_map *k_map,FILE *f);
00170 
00171 /*--------------------------------------------------------------------------*/
00172 #endif

Generated on Wed Oct 26 13:08:51 2005 for SINFONI Pipeline Reference Manual by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001