00001
00002
00003 /*---------------------------------------------------------------------------
00004 E.S.O.
00005 ----------------------------------------------------------------------------
00006 File name : spectro_arcs.h
00007 Author : T.Rogon
00008 Created on : October 1999
00009 Language : ANSI C
00010 Description : spectroscopy routines
00011 *--------------------------------------------------------------------------*/
00012
00013 /*
00014
00015 $Id: spectro_arcs.h,v 1.3 2004/08/01 10:14:35 amodigli Exp $
00016 $Author: amodigli $
00017 $Date: 2004/08/01 10:14:35 $
00018 $Revision: 1.3 $
00019
00020 */
00021
00022 #ifndef _SPECTRO_ARCS_H_
00023 #define _SPECTRO_ARCS_H_
00024
00025 /*---------------------------------------------------------------------------
00026 Includes
00027 ---------------------------------------------------------------------------*/
00028
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031
00032 #include "eclipse.h"
00033
00034 /*---------------------------------------------------------------------------
00035 Defines
00036 ---------------------------------------------------------------------------*/
00037
00038
00039
00040 /* Arc detection */
00041
00042 #define ARC_PARAM_MEDIAN_SIZE 64
00043 #define ARC_PARAM_PTYPE BPP_DEFAULT
00044 #define ARC_PARAM_THRESHFACT (1.0/3.0)
00045 #define ARC_PARAM_WINDOWSIZE 32
00046 #define ARC_PARAM_MINNBARCS 4
00047 #define ARC_PARAM_MINGOODPIX 100
00048 #define ARC_PARAM_NBSAMPLES 20
00049 #define ARC_PARAM_ORIENTATION 0
00050 #define ARC_PARAM_MINARCLENFACT 2.0
00051 #define ARC_PARAM_MAXARCWIDTH 33
00052
00053 #define ARC_DEBUG_LEVEL 8
00054
00055
00056
00057 /*---------------------------------------------------------------------------
00058 New types
00059 ---------------------------------------------------------------------------*/
00060
00061
00062
00063
00064 typedef struct _ARC_PARAM_T_ {
00065 /* zone to avoid in arc detection */
00066 int badtop;
00067 int badbot;
00068 int badleft;
00069 int badright;
00070 /* nb of samples i.e. horizontal cuts */
00071 int n_calib ;
00072 /* size of median filter for detection */
00073 int vert_med_size;
00074 /* factor on moving median for detection */
00075 double thresh_fact;
00076 /* size of window for moving theshold */
00077 int window_size;
00078 /* Min nb of detected arcs in order to be able to estimate a 2-d dist poly*/
00079 int min_nb_arcs;
00080 /* Minimum arclen for detection */
00081 int min_arclen;
00082 /* Maximum arcwidth for detection */
00083 int max_arcwidth;
00084 /* minimum white pixels to try and detect arcs with */
00085 int min_good_pixels;
00086 /* detect horizontal or vertical lines */
00087 orientation_t arc_orientation;
00088 } arc_param_t;
00089
00090
00091 /*---------------------------------------------------------------------------
00092 Function prototypes
00093 ---------------------------------------------------------------------------*/
00094
00095 /*--------------------------------------------------------------------------
00096 * Function : compute_distortion()
00097 * In : OneImage, the zone to consider defined within
00098 the coordinates badleft badright badtop badbot
00099 * Out : a 2-D polynomial poly2d
00100 * Job : computes the inverse distortion polynomium
00101 c, x, y, xy, x^2, y^2
00102 in order of appearance
00103 * Notice : This function s a wrapper calling
00104 setup_default_arc_param() and dist_engine
00105 C-style convention for coordinates is used, i.e.
00106 top,left=0,0
00107 Input image is assumed dark subtracted
00108 *------------------------------------------------------------------------*/
00109 /*<python>*/
00110 poly2d *compute_distortion(OneImage *in, int badleft, int badright,
00111 int badtop, int badbot, int orientation, float offset);
00112 /*</python>*/
00113
00114 /*-------------------------------------------------------------------------
00115 * Function : setup_default_arc_param()
00116 * In : the moving median thresholding window size,
00117 the size of the vertical median filter
00118 * Out : an arc_param_t structure to be freed by free()
00119 * Job : Sets up default and hidden
00120 parameters for dist_engine;
00121 * Notice : After calling this function, the parameters
00122 badleft, badright, badtop, badbot, arc_orientation
00123 MUST be set up manually
00124 (see the arc_param_t definition)
00125 before a call to dist_engine().
00126 *------------------------------------------------------------------------*/
00127 arc_param_t *setup_default_arc_param(
00128 int window_size,
00129 int vert_med_size,
00130 double thresh_fact) ;
00131
00132 /*-------------------------------------------------------------------------
00133 * Function : dist_engine()
00134 * In : An arc_param_t structure, an image
00135 * Out : a 2-D polynomial of size 6 double
00136 * Job : This is the low level function called by compute_distortion
00137 * Notice : see arc_param_t for a description of the individual
00138 * fields.
00139 Input image is assumed dark subtracted
00140 *------------------------------------------------------------------------*/
00141 double *dist_engine(arc_param_t *arc_param, OneImage *in, float offset);
00142
00143
00144
00145
00146 #endif
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001