decision_fusion_by_decision_templates.h

Go to the documentation of this file.
00001 /*
00002 *    Copyright (c) 2007. The BATI team. All right reserved.
00003 *
00004 *    This file is part of BATI library.
00005 *
00006 *    BATI library is free software: you can redistribute it and/or modify
00007 *    it under the terms of the GNU General Public License as published by
00008 *    the Free Software Foundation, either version 3 of the License, or
00009 *    (at your option) any later version.
00010 *
00011 *    BATI library  is distributed in the hope that it will be useful,
00012 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *    GNU General Public License for more details.
00015 *
00016 *    You should have received a copy of the GNU General Public License
00017 *    along with BATI library.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #ifndef __decision_fusion_by_decision_templates
00021 #define __decision_fusion_by_decision_templates
00022 
00023 
00024 #include "image.h"
00025 #include "proto2D.h"
00026 
00027 #include <stdlib.h>
00028 #include <glib.h>
00029 
00030 #include "classifier.h"
00031 
00032 
00033 /* ---------------------------------------------------
00034 constantes 
00035 -----------------------------------------------------*/
00036 
00037 
00038 /* le premier element d'une GList commence a 0 */
00039 #define PREMIER_ELEMENT           0
00040 
00041 /* pour afficher nom fichier et ligne */
00042 #define FICHIER_EN_COURS          __FILE__
00043 #define LIGNE_EN_COURS             __LINE__
00044 
00045 /* choix de la fonction de similitude */
00046 #define NORME_LP 0
00047 
00048 #define NO_ERROR 0
00049 
00050 #define PRENDRE_CONTEXTE 1
00051 #define NE_PAS_PRENDRE_CONTEXTE -1
00052 
00053 #define NB_AFFICH 5
00054 
00055 #define NE_PAS_SEUILLER 123045060//valeur improbable
00056 #define SEUILLER 0
00057 
00058 
00059 /*---------------------------------------------------
00060   descripteur 
00061   ---------------------------------------------------*/
00062 
00063  /* classes est une structure stockant : 
00064     -> les vrais labels, 
00065     -> le nombre de points par label 
00066     -> et les labels normalisés de 0 a nb_label - 1 */
00067 
00068 
00069 typedef struct{
00070   int label_masque;
00071   int label_classifieur;
00072   int nb_pts;
00073   int label_norm;
00074 }une_classe_inconnue;
00075 
00076   
00077 typedef struct {
00078     int label_masque;
00079     int label_normalise;
00080     int nb_pts;
00081   }une_classe_DT; 
00082 
00083 
00084 typedef struct{
00085   int *label;
00086   int *nb_pts;
00087 }un_contexte;
00088 
00089   
00090 typedef struct{
00091   
00092   /* les infos sur les classes */
00093   une_classe_DT *les_classes;
00094   
00095   /* point pb */
00096   une_classe_inconnue *classes_inconnues;
00097   int nb_class_inconnues;
00098   int nb_labels_inconnus;
00099 
00100   /* rejet */
00101   int label_rejet;
00102 
00103   /* contexte */
00104   int flag_contexte;
00105   int flag_contexte_apprent;
00106   un_contexte *contexte;
00107   int nb_voisins;
00108   int *nb_labels_contexte;
00109   int equ_nb_cols;
00110   int equ_nb_rows;
00111   int  nb_pts_effectif;
00112   int nb_voisins_apprent;
00113   int cpt_pt_apprent;
00114 
00115   /* pour les DT : chaque element est une dataoutput */
00116   data_output *data_field_of_glist_DT;
00117 
00118   /* La Glist des DT */
00119   GList *DT;
00120 
00121   /* seuil rejet */
00122   float seuil;
00123 
00124 }decision_fusion_by_decision_templates_t;
00125 
00126 
00127 
00128 /*---------------------------------------------------
00129   les operations
00130 ---------------------------------------------------*/
00131 
00132 param *decision_fusion_by_decision_templates_lect(
00133                                                   decision_fusion_by_decision_templates_t *desc,
00134                                                   param *ptp,
00135                                                   char *debq
00136                                                   );
00137 
00138 
00139 int decision_fusion_by_decision_templates_init(
00140                                                decision_fusion_by_decision_templates_t *desc,
00141                                                GList *DP,
00142                                                data_output expert_decision,
00143                                                const int LABEL_FOND,                                   
00144                                                float seuil,
00145                                                int nb_voisins,
00146                                                data_output *final_crisp_decision
00147                                                );
00148 
00149 
00150 int decision_fusion_by_decision_templates_calc(
00151                                                decision_fusion_by_decision_templates_t *desc ,
00152                                                GList *DP,
00153                                                int similarity_measure_choix,
00154                                                int indice_point,                
00155                                                const int norme_lp,
00156                                                data_output *crisp_decision 
00157                                                );
00158 
00159 
00160 int decision_fusion_by_decision_templates_ferm(
00161                                                decision_fusion_by_decision_templates_t *desc
00162                                                );
00163 
00164 
00165 
00166 int calc_similarity_from_DP_to_DT_by_squared_norme_lp(GList *DP, decision_fusion_by_decision_templates_t *desc, int indice_point, const int norme_lp, float *result);
00167 
00168 
00169 int calc_similarity_from_DP_to_DT_by_squared_norme_lp_with_contexte(  
00170                                                                 GList *DP, 
00171                                                                 decision_fusion_by_decision_templates_t *desc,
00172                                                                 int indice_point, 
00173                                                                 const int norme_lp,
00174                                                                 float *result
00175                                                                 );
00176 
00177 int chercher_nb_class(data_output *dataO,int *labels);
00178 
00179 
00180 int built_decisions_templates_by_arithmetic_mean(
00181                                                  decision_fusion_by_decision_templates_t *desc,
00182                                                  int labelfond,
00183                                                  int nb_class_classifieurs,
00184                                                  int type,
00185                                                  int nb_DT,
00186                                                  data_output mask_learn_DT ,
00187                                                  GList *DP                                      
00188                                                  );
00189 
00190 
00191 int classifier_contexte_decision(data_output decision, int nb_voisins, data_output *contexte_decision);
00192 
00193 
00194 
00195 #endif

Generated on Tue Apr 22 13:31:02 2008 for donnee1D by  doxygen 1.5.3