Main Page | Files | Data Structures | Functions | Global Variables |
include/gpiv/gpiv-imgproc.h
Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
00002 
00003 /*-----------------------------------------------------------------------------
00004 
00005    libgpiv - library for Particle Image Velocimetry
00006 
00007    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Gerber van der Graaf
00008 
00009    This file is part of libgpiv.
00010 
00011    Libgpiv is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; either version 2, or (at your option)
00014    any later version.
00015 
00016    This program is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019    GNU General Public License for more details.
00020 
00021    You should have received a copy of the GNU General Public License
00022    along with this program; if not, write to the Free Software Foundation,
00023    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
00024 
00025 -------------------------------------------------------------------------------
00026 FILENAME:               imgproc.h
00027 LIBRARY:                libgpiv:
00028 EXTERNAL FUNCTIONS:
00029 SOURCE:                 imgproc_par.c
00030                         gpiv_imgproc_parameters_set
00031                         gpiv_imgproc_default_parameters
00032                         gpiv_imgproc_fscan_parameters
00033                         gpiv_imgproc_read_parameters 
00034                         gpiv_imgproc_check_parameters
00035                         gpiv_imgproc_test_parameters
00036                         gpiv_imgproc_print_parameters
00037                         gpiv_imgproc_fprint_parameters
00038                         gpiv_imgproc_cp_parameters
00039 
00040 SOURCE:                 imgproc.c
00041                         gpiv_imgproc_mktestimg
00042                         gpiv_imgproc_subtractimg
00043                         gpiv_imgproc_smooth
00044                         gpiv_imgproc_highlow
00045                         gpiv_imgproc_clip
00046                         gpiv_imgproc_getbit
00047                         gpiv_imgproc_fft
00048                         gpiv_imgproc_lowpass
00049                         gpiv_imgproc_highpass
00050                         gpiv_imgproc_correlate
00051                         gpiv_imgproc_convolve
00052 
00053 -----------------------------------------------------------------------------*/
00064 #ifndef __LIBGPIV_IMGPROC_H__
00065 #define __LIBGPIV_IMGPROC_H__
00066 
00067 #define GPIV_IMGPROCPAR_MAX__THRESHOLD 255
00068 #define GPIV_IMGPROCPAR_MAX__WINDOW 50
00069 
00070 #define GPIV_IMGPROCPAR_KEY "IMGPROC"       
00075 enum GpivImgFilter {
00076     GPIV_IMGFI_MKTESTIMG,       
00077     GPIV_IMGFI_SUBACK,          
00078     GPIV_IMGFI_SMOOTH,          
00079     GPIV_IMGFI_HILO,            
00080     GPIV_IMGFI_CLIP,            
00082     GPIV_IMGFI_FFT,             
00083     GPIV_IMGFI_INVFFT,          
00084     GPIV_IMGFI_CORR,            
00085     GPIV_IMGFI_CONV,            
00086     GPIV_IMGFI_LOWPASS,         
00087     GPIV_IMGFI_HIGHPASS,        
00089     GPIV_IMGFI_GETBIT,  
00090 };
00091 
00095 enum GpivImgSmoothOperator {
00096     GPIV_IMGOP_EQUAL,    
00097     GPIV_IMGOP_SUBTRACT, 
00098     GPIV_IMGOP_ADD,      
00099     GPIV_IMGOP_MULTIPLY, 
00100     GPIV_IMGOP_DIVIDE    
00101 };
00102 
00103 
00104 typedef struct __GpivImageProcPar GpivImageProcPar;
00105 
00116 struct __GpivImageProcPar {
00117     guint bit;                  
00118     gboolean bit__set;          
00120     enum GpivImgFilter filter;  
00121     gboolean filter__set;       
00123     enum GpivImgSmoothOperator smooth_operator; 
00124     gboolean smooth_operator__set;              
00126     guint window;               
00127     gboolean window__set;       
00129     guint threshold;            
00130     gboolean threshold__set;    
00131 };
00132 
00133 
00134 
00135 
00143 void
00144 gpiv_imgproc_parameters_set (GpivImageProcPar *image_proc_par,
00145                              const gboolean flag
00146                              );
00147 
00148 
00149 
00157 void
00158 gpiv_imgproc_default_parameters     (GpivImageProcPar       *imgproc_par_default,
00159                     const gboolean         force
00160                     );
00161 
00162 
00163 
00173 void
00174 gpiv_imgproc_read_parameters        (FILE                   *fp_h, 
00175                     GpivImageProcPar    *image_proc_par, 
00176                     const gboolean      print_par
00177                     );
00178 
00179 
00180 
00190 gchar *
00191 gpiv_imgproc_check_parameters_read  (GpivImageProcPar   *image_proc_par,
00192                     const GpivImageProcPar  *image_proc_par_default
00193                     );
00194 
00195 
00196 
00203 gchar *
00204 gpiv_imgproc_test_parameters        (const GpivImageProcPar *image_proc_par
00205                     );
00206 
00207 
00208 
00217 void
00218 gpiv_imgproc_print_parameters       (FILE                   *fp, 
00219                     const GpivImageProcPar  *image_proc_par
00220                     );
00221 
00222 
00229 GpivImageProcPar *
00230 gpiv_imgproc_cp_parameters      (const GpivImageProcPar *imgproc_par
00231                     );
00232 
00233 
00242 GpivImage *
00243 gpiv_imgproc_mktestimg      (const GpivImagePar     *image_par,
00244                 const GpivImageProcPar      *image_proc_par
00245                 );
00246 
00247 
00257 gchar *
00258 gpiv_imgproc_subtractimg        (const GpivImage        *image_in,
00259                                  GpivImage          *image_out
00260                                  );
00261 
00262 
00271 gchar *
00272 gpiv_imgproc_smooth     (GpivImage          *image, 
00273                 const GpivImageProcPar      *image_proc_par
00274                 );
00275 
00276 
00285 gchar *
00286 gpiv_imgproc_highpass       (GpivImage          *image, 
00287                 const GpivImageProcPar      *image_proc_par
00288                 );
00289 
00290 
00299 gchar *
00300 gpiv_imgproc_highlow        (GpivImage          *image,
00301                 const GpivImageProcPar      *image_proc_par
00302                 );
00303 
00304 
00312 gchar *
00313 gpiv_imgproc_clip       (GpivImage          *image,
00314                 const GpivImageProcPar      *image_proc_par
00315                 );
00316 
00317 
00326 gchar *
00327 gpiv_imgproc_getbit     (GpivImage          *image,
00328                 const GpivImageProcPar      *image_proc_par
00329                 );
00330 
00331 
00339 gchar *
00340 gpiv_imgproc_fft            (GpivImage              *image,
00341                     const GpivImageProcPar  *image_proc_par
00342                     );
00343 
00344 
00345 #ifndef USE_FFTW3
00346 
00355 gchar *
00356 gpiv_imgproc_lowpass            (GpivImagePar       image_par, 
00357                     GpivImageProcPar    image_proc_par,
00358                     guint16         **img
00359                     );
00360 
00361 
00362 
00373 gchar *
00374 gpiv_imgproc_correlate          (GpivImagePar           image_par, 
00375                     GpivImageProcPar    image_proc_par,
00376                     guint16         **img1_in, 
00377                     guint16         **img2_in, 
00378                     guint16*        **img_out
00379                     );
00380 
00381 
00382 
00394 gchar *
00395 gpiv_imgproc_convolve       (GpivImagePar           image_par, 
00396                 GpivImageProcPar        image_proc_par,
00397                  guint16            **img1_in, 
00398                  guint16            **img2_in, 
00399                  guint16*           **img_out
00400                  );
00401 
00402 #endif /* USE_FFTW3 */
00403 
00404 
00414 gchar *
00415 gpiv_imgproc_deform     (GpivImage          *image,
00416                 const GpivPivData       *piv_data
00417                 );
00418 
00419 
00420 #endif /* __LIBGPIV_IMGPROC_H__ */
00421