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 /* classifier.h */ 00021 /* ****************************************************************** */ 00022 /* Prototype de structure pour les entrees et sorties */ 00023 /* */ 00024 /* */ 00025 /* Projet 120h : */ 00026 /* FORMALISATION des ETAPES de CLASSIFICATION en FUSION INFORMATIONS */ 00027 /* */ 00028 /* */ 00029 /* ****************************************************************** */ 00030 /* ****************************************************************** */ 00031 /* */ 00032 /* Nous décrirons dans ce fichier les structures et les types qui */ 00033 /* seront utilisés pour les données d'entrée, de sortie, */ 00034 /* d'apprentissage et d'évaluation. */ 00035 /* */ 00036 /* ****************************************************************** */ 00037 /* ****************************************************************** */ 00038 /* */ 00039 /* Creer le: 05/11/03 */ 00040 /* Modifier le 17/11/03 */ 00041 /* Créer par RAMASSO Emmanuel & JULLIEN Sylvie */ 00042 /* */ 00043 /* ****************************************************************** */ 00044 00045 #ifndef __classifier 00046 #define __classifier 00047 00048 00049 #include "image.h" 00050 #include "proto2D.h" 00051 #include <stdlib.h> 00052 #include <stdio.h> 00053 00060 #define CRISP_CHOICE 0 00061 00068 #define FUZZY_CHOICE 1 00069 00070 00077 typedef float *vector; 00078 00079 00089 union result{ 00090 int *crisp; 00092 vector *fuzzy; 00094 }; 00095 00096 00104 typedef struct { 00105 00106 int nb_attr; 00117 int nb_pts; 00123 int begin; 00129 int end; 00135 int equ_nb_rows; 00140 int equ_nb_cols; 00145 int equ_nb_depth; 00150 vector *attributes; 00158 }data_input; 00159 00160 00171 typedef struct { 00172 int nb_class; 00173 int nb_pts; 00174 int type; 00175 int equ_nb_rows; 00176 int equ_nb_cols; 00177 int equ_nb_depth; 00178 union result classes; 00179 }data_output; 00180 00181 00194 struct reference_set{ 00195 00196 data_input input_ref; 00202 data_output output_ref; 00206 }; 00207 00208 00215 typedef struct reference_set learning_set; 00216 00223 typedef struct reference_set evaluation_set; 00224 00225 00226 00227 int alloc_classifier_data_input_one_by_one(data_input *data); 00228 int alloc_classifier_data_input_completely(data_input *data); 00229 int alloc_classifier_data_output(data_output *dataO); 00230 int data_output_crisp_to_imageu1(data_output dataOC, imau1 *image_u1); 00231 int data_output_fuzzy_to_imageu1(data_output dataOF,imau1 **image_u1); 00232 int data_output_fuzzy_to_imagefl(data_output dataOF, imafl *image_fl); 00233 int free_data_input(data_input *dataI); 00234 int free_data_output(data_output *dataO); 00235 int normaliser_data_input_sur_a_b(float a, float b, data_input in, data_input *out); 00236 int normaliser_data_output_sur_a_b(float a, float b, data_output in, data_output *out); 00237 00238 #endif