129 int sum_x,sum_y,sum_z;
166 unsigned y_class[CMV_COLOR_LEVELS];
167 unsigned u_class[CMV_COLOR_LEVELS];
168 unsigned v_class[CMV_COLOR_LEVELS];
170 region region_table[CMV_MAX_REGIONS];
171 region *region_list[CMV_MAX_COLORS];
172 int region_count[CMV_MAX_COLORS];
174 rle rmap[CMV_MAX_RUNS];
187 void classifyFrame(
image_pixel * restrict img,
unsigned * restrict map);
188 int encodeRuns(
rle * restrict out,
unsigned * restrict map);
189 void connectComponents(
rle * restrict map,
int num);
190 int extractRegions(
region * restrict reg,
rle * restrict rmap,
int num);
191 void calcAverageColors(
region * restrict reg,
int num_reg,
193 rle * restrict rmap,
int num_runs);
194 int separateRegions(
region * restrict reg,
int num);
195 region *sortRegionListByArea(
region * restrict list,
int passes);
196 void sortRegions(
int max_area);
199 int mergeRegions(
region *p,
int num,
double density_thresh);
208 bool initialize(
int nwidth,
int nheight);
209 bool loadOptions(
char *filename);
210 bool saveOptions(
char *filename);
211 bool enable(
unsigned opt);
212 bool disable(
unsigned opt);
216 bool getThreshold(
int color,
217 int &y_low,
int &y_high,
218 int &u_low,
int &u_high,
219 int &v_low,
int &v_high);
220 bool setThreshold(
int color,
221 int y_low,
int y_high,
222 int u_low,
int u_high,
223 int v_low,
int v_high);
228 char *getColorName(
int color)
229 {
return(colors[color].name);}
230 rgb getColorVisual(
int color)
231 {
return(colors[color].color);}
233 color_info *getColorInfo(
int color)
234 {
return(&colors[color]);}
235 void getColorInfo(
int color,color_info &info)
236 {info = colors[color];}
237 void setColorInfo(
int color,color_info &info)
238 {colors[color] = info;}
241 bool processFrame(
unsigned *map);
242 int numRegions(
int color_id);
243 region *getRegions(
int color_id);
244 void set_cmv_min_area(
int area) { cmv_min_area = area; }
245 void set_cmv_max_area(
int area) { cmv_max_area = area; }