Main Page | Data Structures | File List | Data Fields | Globals

mr_lag.h

Go to the documentation of this file.
00001 /* The Partitions Musics Recognition System project.
00002  * (c)2003 by Fabien Pelisson (fabien dot pelisson at wanadoo dot fr)
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #ifndef MR_LAG_H
00020 #define MR_LAG_H
00021 
00022 #include <mr_vector.h>
00023 #include <mr_image.h>
00024 
00025 #include <mr_lag_segment.h>
00026 #include <mr_lag_section.h>
00027 #include <mr_lag_junction.h>
00028 #include <mr_lag_component.h>
00029 
00030 #include <mr_line.h>
00031 
00032 #ifdef __cplusplus
00033 extern              "C"
00034 {
00035 #endif /* __cplusplus */
00036 
00037 typedef struct MrLag MrLag;
00038 
00046 struct MrLag
00047 {
00049   MrVector* segments;
00051   MrVector* sections;
00053   MrVector* junctions;
00056   MrVector* filaments;
00059   MrVector* chains;
00060 
00062   unsigned int w;
00064   unsigned int h;
00065 
00067   unsigned int staff_line_thickness;
00069   unsigned int staff_spacing;
00070 };
00071 
00072 
00073   
00075 MrLag* mr_lag_new(unsigned int w, unsigned int h);
00076 
00078 void mr_lag_free(void *p);
00079 
00082 
00084 short int mr_lag_extract_segments(MrLag*, MrImage*);
00086 void mr_lag_build_lag(MrLag* lag);
00088 void mr_lag_filament_detection(MrLag* lag);
00090 void mr_lag_build_chain(MrLag* lag);
00094 void mr_lag_build_staff_line(MrLag* lag, MrVector* lines);
00096 void mr_lag_remove_filaments_in_staff_line(MrLag* lag, unsigned int y);
00099 void mr_lag_remove_filaments_in_staff_lines(MrLag* lag, MrVector* lines);
00100 
00101 void mr_lag_bar_detection(MrImage* image, MrLine* bb);
00102 
00104 void mr_lag_extract_component(MrLag* lag, MrVector* components);
00105 
00110 
00112 void mr_lag_add_segment(MrLag* lag, MrLagSegment* segment, unsigned int j);
00114 MrLagSection* mr_lag_add_section(MrLag* lag, MrLagSegment* segment);
00116 MrLagJunction* mr_lag_create_junction(MrLag* lag, 
00117                                       MrLagSection* left_section,
00118                                       MrLagSection* right_section);
00121 unsigned int length_chain(MrVector* chain);
00122 
00126 unsigned int mr_lag_chain_horizontal_line(MrVector* chain); 
00127 
00129 void mr_lag_remove_sections_on_image(MrLag* lag, MrImage* img);
00131 void mr_lag_remove_section_on_image(MrLag* lag, MrLagSection* section, MrImage* img);
00133 void mr_lag_remove_segment_on_image(MrLag* lag, MrLagSegment* segment, MrImage* img);
00134 
00137 #ifdef __cplusplus
00138 }
00139 #endif /* __cplusplus */
00140 
00141 #endif /* MR_LAG_H */

Generated on Sun Apr 9 17:29:40 2006 for MusicReco by  doxygen 1.4.4