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

mr_lag.c File Reference

#include "mr_lag.h"
#include "mr_error.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <math.h>

Data Structures

struct  CoupleSegment
 Private structure for lag building. More...

Defines

#define PIXEL_BLACK   0
#define FACTOR_SECTION_SEGMENT   2.5
#define MIN_RATIO_WH_FILAMENT   1
#define MAX_FILAMENT_HEIGHT(t)   (t + (t + 1) / 2)
#define MAX_THRESHOLD_FILAMENT_CHAIN(s)   ((s + 1) / 2)
#define MAX_THRESHOLD_SAME_LINE(s)   ((s + 1)/2)
#define MIN_THRESHOLD_OTHER_LINE_OTHER_STAFF(s)   (2 * s)

Typedefs

typedef CoupleSegment CoupleSegment

Functions

MrLagmr_lag_new (unsigned int w, unsigned int h)
void mr_lag_free (void *p)
void mr_lag_add_segment (MrLag *lag, MrLagSegment *segment, unsigned int j)
MrLagSectionmr_lag_add_section (MrLag *lag, MrLagSegment *segment)
MrLagJunctionmr_lag_create_junction (MrLag *lag, MrLagSection *left_section, MrLagSection *right_section)
static unsigned int extract_max_index (unsigned int *histo, unsigned int size)
short int mr_lag_extract_segments (MrLag *lag, MrImage *img)
static void section_for_column_of_segment (MrLag *lag, unsigned int col)
static CoupleSegmentcouple_segment_new (MrLagSegment *seg1, MrLagSegment *seg2)
static void couple_segment_free (void *p)
static void process_two_columns (MrLag *lag, int j1, int j2)
void mr_lag_build_lag (MrLag *lag)
void mr_lag_filament_detection (MrLag *lag)
static void replace_chain_id (MrLag *lag, unsigned int old_id, unsigned int new_id)
static void next_chain (MrLagSection *section, MrVector *res)
static void build_chain_from_section (MrLag *lag, MrLagSection *section, float a, float b)
static short int sort_section_for_chain (void *s1, void *s2)
static void chain_data_extract (MrVector *chain, unsigned int *min_x, unsigned int *max_x)
unsigned int length_chain (MrVector *chain)
static unsigned int mean_length_chains (MrVector *chains)
void mr_lag_build_chain (MrLag *lag)
unsigned int mr_lag_chain_horizontal_line (MrVector *chain)
static short int sort_chain (void *c1, void *c2)
static unsigned short int score_extract (MrVector *glines)
void mr_lag_build_staff_line (MrLag *lag, MrVector *lines)
void mr_lag_remove_filaments_in_staff_lines (MrLag *lag, MrVector *lines)
void mr_lag_remove_filaments_in_staff_line (MrLag *lag, unsigned int y)
static void build_component (MrLagComponent *component, MrLagSection *section, MrVector *processed)
void mr_lag_extract_component (MrLag *lag, MrVector *components)
void mr_lag_remove_sections_on_image (MrLag *lag, MrImage *img)
void mr_lag_remove_section_on_image (MrLag *lag, MrLagSection *section, MrImage *img)
void mr_lag_remove_segment_on_image (MrLag *lag, MrLagSegment *segment, MrImage *img)

Define Documentation

#define FACTOR_SECTION_SEGMENT   2.5
 

#define MAX_FILAMENT_HEIGHT  )     (t + (t + 1) / 2)
 

#define MAX_THRESHOLD_FILAMENT_CHAIN  )     ((s + 1) / 2)
 

Threshold for filament chain

#define MAX_THRESHOLD_SAME_LINE  )     ((s + 1)/2)
 

#define MIN_RATIO_WH_FILAMENT   1
 

#define MIN_THRESHOLD_OTHER_LINE_OTHER_STAFF  )     (2 * s)
 

#define PIXEL_BLACK   0
 


Typedef Documentation

typedef struct CoupleSegment CoupleSegment
 


Function Documentation

static void build_chain_from_section MrLag lag,
MrLagSection section,
float  a,
float  b
[static]
 

static void build_component MrLagComponent component,
MrLagSection section,
MrVector processed
[static]
 

static void chain_data_extract MrVector chain,
unsigned int *  min_x,
unsigned int *  max_x
[static]
 

static void couple_segment_free void *  p  )  [static]
 

static CoupleSegment* couple_segment_new MrLagSegment seg1,
MrLagSegment seg2
[static]
 

static unsigned int extract_max_index unsigned int *  histo,
unsigned int  size
[static]
 

unsigned int length_chain MrVector chain  ) 
 

length of a chain chain : vector of section

static unsigned int mean_length_chains MrVector chains  )  [static]
 

MrLagSection* mr_lag_add_section MrLag lag,
MrLagSegment segment
 

Add a new section to the LAG : section with for first segment 'segment'

void mr_lag_add_segment MrLag lag,
MrLagSegment segment,
unsigned int  j
 

Add a segment to the LAG : segment extract from the column j

void mr_lag_build_chain MrLag lag  ) 
 

Link filaments to create chain

void mr_lag_build_lag MrLag lag  ) 
 

Build sections and jonctions

void mr_lag_build_staff_line MrLag lag,
MrVector lines
 

Build lines from chain and group them to form score lines : vector of vector of lines

unsigned int mr_lag_chain_horizontal_line MrVector chain  ) 
 

return the y coordinate of the horizontal line associate to a chain. Compute by using the mean of each component of the chain

MrLagJunction* mr_lag_create_junction MrLag lag,
MrLagSection left_section,
MrLagSection right_section
 

Add a junction between two section

void mr_lag_extract_component MrLag lag,
MrVector components
 

Group section by connected component

short int mr_lag_extract_segments MrLag ,
MrImage
 

Extract the segments from an image

void mr_lag_filament_detection MrLag lag  ) 
 

Mark section as filament according to their height and length

void mr_lag_free void *  p  ) 
 

Destroy the lag structure : Destroys the segment, section, junction, ...

MrLag* mr_lag_new unsigned int  w,
unsigned int  h
 

Init the structure for the lag for an image of size (w, h)

void mr_lag_remove_filaments_in_staff_line MrLag lag,
unsigned int  y
 

remove filament around line at position y

void mr_lag_remove_filaments_in_staff_lines MrLag lag,
MrVector lines
 

remove filaments around a set of group of horizontal lines lines : a vector of vector of lines

void mr_lag_remove_section_on_image MrLag lag,
MrLagSection section,
MrImage img
 

set the pixels of the section to 255

void mr_lag_remove_sections_on_image MrLag lag,
MrImage img
 

set the pixels of the sections with removed = 2 to 255

void mr_lag_remove_segment_on_image MrLag lag,
MrLagSegment segment,
MrImage img
 

set on the image the pixel of the segment to 255

static void next_chain MrLagSection section,
MrVector res
[static]
 

static void process_two_columns MrLag lag,
int  j1,
int  j2
[static]
 

static void replace_chain_id MrLag lag,
unsigned int  old_id,
unsigned int  new_id
[static]
 

static unsigned short int score_extract MrVector glines  )  [static]
 

static void section_for_column_of_segment MrLag lag,
unsigned int  col
[static]
 

static short int sort_chain void *  c1,
void *  c2
[static]
 

static short int sort_section_for_chain void *  s1,
void *  s2
[static]
 


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