36 #ifndef msImageProcessor_H
37 #define msImageProcessor_H
56 #define TOTAL_ITERATIONS 14
57 #define BIG_NUM 0xffffffff
58 #define NODE_MULTIPLE 10
61 const double Xn = 0.95050;
62 const double Yn = 1.00000;
63 const double Zn = 1.08870;
66 const double Un_prime = 0.19784977571475;
67 const double Vn_prime = 0.46834507665248;
68 const double Lt = 0.008856;
71 const double XYZ[3][3] = { { 0.4125, 0.3576, 0.1804 },
72 { 0.2125, 0.7154, 0.0721 },
73 { 0.0193, 0.1192, 0.9502 } };
76 const double RGB[3][3] = { { 3.2405, -1.5371, -0.4985 },
77 { -0.9693, 1.8760, 0.0416 },
78 { 0.0556, -0.2040, 1.0573 } };
81 typedef unsigned char byte;
84 enum imageType {GRAYSCALE, COLOR};
87 class msImageProcessor:
public MeanShift {
95 msImageProcessor(
void );
96 ~msImageProcessor(
void );
146 void DefineImage(
byte*,imageType,
int,
int);
147 void DefineBgImage(
byte*, imageType ,
int ,
int );
196 void SetWeightMap(
float*,
float);
223 void RemoveWeightMap(
void);
272 void Filter(
int,
float, SpeedUpLevel);
319 void FuseRegions(
float,
int);
374 void Segment(
int,
float,
int, SpeedUpLevel);
413 void RGBtoLUV(
byte*,
float*);
448 void LUVtoRGB(
float*,
byte*);
488 void GetRawData(
float*);
523 void GetResults(
byte*);
551 RegionList *GetBoundaries(
void );
618 int GetRegions(
int**,
float**,
int**);
621 void SetSpeedThreshold(
float);
632 void NonOptimizedFilter(
float,
float);
635 void NewNonOptimizedFilter(
float,
float);
637 void OptimizedFilter1(
float,
float);
644 void NewOptimizedFilter1(
float,
float);
647 void OptimizedFilter2(
float,
float);
653 void NewOptimizedFilter2(
float,
float);
660 void Connect(
void );
671 void BuildRAM(
void );
674 void DestroyRAM(
void );
677 void TransitiveClosure(
void );
679 void ComputeEdgeStrengths(
void );
691 void DefineBoundaries(
void );
700 bool InWindow(
int,
int);
704 float SqDistance(
int,
int);
710 void InitializeOutput(
void );
713 void DestroyOutput(
void );
725 RegionList *regionList;
758 int *modePointCounts;
784 unsigned char *visitTable;
795 float speedThreshold;