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

mr_elements_detector.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "mr_lib.h"

Defines

#define PIXEL_BLACK   0
#define MAX_DIFF_VALUE   255
#define WIDTH_SCALING   0.6
#define HEIGHT_SCALING   0.6
#define MIN_ENERGY   0.5
#define MIN_ENERGY_MOVE   0.2
#define SQUAREROOT(x)   ((x) ? (float) sqrt((x)*(x)) : 0.f)

Functions

MrElementsDetectormr_elements_detector_new ()
void mr_elements_detector_free (void *o)
void mr_elements_detector_clear (MrElementsDetector *ed)
short int mr_elements_detector_origin (MrElementsDetector *ed, unsigned int pos)
unsigned int mr_elements_detector_size (MrElementsDetector *ed, unsigned int pos)
static short int create_black_pattern (MrElementsDetector *ed, unsigned int w, unsigned int h)
static int diff_pattern (MrElementsDetector *ed)
static short int elements_detector_one_line (MrElementsDetector *ed, unsigned int pos, short int scale)
short int mr_elements_detector (MrImage *image, MrScore *score, MrElementsDetector *ed)
static int elements_minx (MrVector *elts, int fromx, int endx)
float mr_elements_detector_match (MrElementsDetector *model, unsigned int posm, MrElementsDetector *object, unsigned int poso, float scale_factor)

Define Documentation

#define HEIGHT_SCALING   0.6
 

#define MAX_DIFF_VALUE   255
 

#define MIN_ENERGY   0.5
 

#define MIN_ENERGY_MOVE   0.2
 

#define PIXEL_BLACK   0
 

#define SQUAREROOT  )     ((x) ? (float) sqrt((x)*(x)) : 0.f)
 

#define WIDTH_SCALING   0.6
 


Function Documentation

static short int create_black_pattern MrElementsDetector ed,
unsigned int  w,
unsigned int  h
[static]
 

free previous pattern if exist

static int diff_pattern MrElementsDetector ed  )  [static]
 

static short int elements_detector_one_line MrElementsDetector ed,
unsigned int  pos,
short int  scale
[static]
 

static int elements_minx MrVector elts,
int  fromx,
int  endx
[static]
 

short int mr_elements_detector MrImage image,
MrScore score,
MrElementsDetector ed
 

Extracts notes from an image where lines was previously detected and grouped in a partition.

void mr_elements_detector_clear MrElementsDetector ed  ) 
 

Destroy elements previously detected.

void mr_elements_detector_free void *  o  ) 
 

Destroy a notes detector

float mr_elements_detector_match MrElementsDetector model,
unsigned int  posm,
MrElementsDetector object,
unsigned int  poo,
float  scale_factor
 

Match a graphic music element. This will be soon moved in another module.

MrElementsDetector* mr_elements_detector_new  ) 
 

Creates a new notes detector

short int mr_elements_detector_origin MrElementsDetector ed,
unsigned int  pos
 

Translate elements in x so the left most element will have its x coordinate to 0.

unsigned int mr_elements_detector_size MrElementsDetector ed,
unsigned int  pos
 

Returns the number of graphics elements


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