Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ctdef.hpp
00001 /*
00002 This file was taken from Calife library and slightly modified:
00003 In IMCT change from LISTE to std::vector    
00004     old: LISTE *liste;
00005     new: std::vector<CHAINE*> liste;
00006 The structs are converted to classes.
00007 */
00008 
00009 /*----------------------------------------------------------------------
00010      
00011                          -- C N R S -- 
00012          Laboratoire d'Automatique et d'Analyse des Systemes 
00013                  7 Avenue du colonel Roche   
00014                      31 077 Toulouse Cedex  
00015 
00016      
00017   Fichier              : /usr/local/calife/common/ctdef.h
00018   Fonction             : 
00019      
00020   Date de creation     : Jeudi 9  Aout 14:07:04 1990
00021   Date de modification : Vendredi 18 Septembre 11:56:59 1992
00022   Nb de lignes         : 117 
00023      
00024   Auteur               : (Calife)
00025   Groupe               : Robotique et Intelligence Artificielle  
00026      
00027   Copyright (C) 1990  LAAS-CNRS. 
00028 ----------------------------------------------------------------------*/
00029 /*
00030  * Definition du type chaine de points de contour
00031  *
00032  * Matthieu Herrb - Avril 90
00033  * Michel Devy    - Aout  90 - ajout d'attribut sur chaque contours
00034  */
00035 
00036  
00037 #ifndef DEFCT
00038 #define DEFCT
00039 
00040 //#include "erreur_calife.h"
00041 //#include "liste.h"
00042 #include <vector>
00043 
00044 
00045 namespace jafar{
00046   namespace lines{
00047     #define MAXPOINTS    2000     /* max number of points for a chain */
00048     
00049     #ifndef TRUE
00050     #define TRUE 1
00051     #endif
00052     
00053     #ifndef FALSE
00054     #define FALSE 0
00055     #endif
00056     
00057     /* le type chaine de points de contours */
00058     
00059     class CHAINE /* an edge chain */
00060     {
00061     public:
00062         int num;    /* numero de la chaine */
00063         int flag;   /* flags associe's a` la chaine */
00064         short npoints;  /* nombre de points */
00065         char *local;        /* attributs locaux */
00066         short *x, *y; /* tableaux des coordonnees */
00067     };
00068     
00069     
00070     /* macros d'acces aux champs d'une chaine */
00071     
00072     #define ctnum(c)  ((c)->num)
00073     #define ctflag(c) ((c)->flag)
00074     #define ctnpts(c) ((c)->npoints)
00075     #define ctlocal(c) ((c)->local)
00076     #define ctx(c)    ((c)->x)
00077     #define cty(c)    ((c)->y)
00078     #define ct_x(c,i) ((c)->x[i])
00079     #define ct_y(c,i) ((c)->y[i])
00080     
00081     /* Le flag pour chaine fermee */
00082     
00083     #define CT_FERMEE 0x01
00084     
00085     /* le type des chaines pour utilisation en listes */
00086     
00087     #define typchaine 120
00088     
00089     /* Codes d'erreur */
00090     #define Cf_Ctfic 155
00091     
00092     #define ERR_CT_INIT   ErrNum(Cf_Ctfic, 1)
00093     
00094     /*------------------------------------------------------------------------*/
00095     
00100     class IMCT{
00101     public:
00102         //LISTE *liste;   /* liste des chaines */
00103         std::vector<CHAINE*> liste;
00104         int nchains;    /* nombre de chaines */
00105         int di, dj;     /* taille de l'image originale */
00106     };
00107     
00108     //extern int nchain;
00109     
00110     /* macros pour acces aux champs de ces images */
00111     
00112     #define listect(c) ((c)->liste)
00113     #define dict(c)    ((c)->di)
00114     #define djct(c)    ((c)->dj)
00115     #define nimct(c)   ((c)->nchains)
00116     
00117     
00118     /*------------------------------------------------------------------------*/
00119     
00123     //#include "contours_proto.h"
00124       
00125       void ExtractContours1(char *input, IMCT* output, int di,int dj, int c_i0, int c_j0,int di0,int dj0, int up_thr, int down_thr, int  min_length);
00126       void seuilhy(IMCT* output, int c_i0,int c_j0, int di0, int dj0, int sh, int sb, int  mlen);
00127       int confcont(int  ip, int seuil, int il, int ic, int sb, int  mlen, int *sens, int *direction);
00128       int get_direction(int  i,int j, int in, int jn);
00129       void destroy_leftright(int  dir, int ip);
00130       void initChain(CHAINE* chain, int nPoints);
00131     
00132     
00133   } // namespace lines
00134 } // namspace jafar
00135 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:24 for Jafar by doxygen 1.7.6.1
LAAS-CNRS