/*object *my_alg_level3(unsigned char *image, int width, int height, int *n_object)*/ object *my_alg_level3(unsigned char *image, unsigned char *mask, int width, int height, int *n_object) { /*********************************MYCODE*********************************/ unsigned int width_sub = 0, height_sub = 0; create_sub_images(image, width, height, &width_sub, &height_sub); /*export_ppm_subimages(3, width, height, width_sub, height_sub);*/ calculate_histogram(3, width, height, width_sub, height_sub); calculate_threshold(width, height, width_sub, height_sub); calculate_threshold_with_interpolation(0, width, height, width_sub, height_sub); final_stage(width, height, width_sub, height_sub); /*free_mem_subimages(width, height, width_sub, height_sub);*/ /*********************************MYCODE*********************************/ /* transform_1D_to_2D_RGB(image, width, height); allocate_mem_data_CIELAB(width, height); convert_RGB_to_CIELAB(width, height); unsigned int max_grad = 0; first_derivative_CIELAB(0, width, height, &max_grad); calculate_histogram_of_gradient(width, height, max_grad); histogram_analysis(width, height, max_grad); return NULL; */ return NULL;/*baseline(image, mask, width, height, n_object);*/ }
object *my_alg_level1(unsigned char *image, unsigned char *mask, int width, int height, int *n_object) { /*********************************MYCODE*********************************/ unsigned int width_sub = 0, height_sub = 0; create_sub_images(image, width, height, &width_sub, &height_sub); /* export_ppm_subimages(3, width, height, width_sub, height_sub); */ calculate_histogram(3, width, height, width_sub, height_sub); calculate_threshold(width, height, width_sub, height_sub); calculate_threshold_with_interpolation(0, width, height, width_sub, height_sub); final_stage(width, height, width_sub, height_sub); /*free_mem_subimages(width, height, width_sub, height_sub);*/ /*********************************MYCODE*********************************/ return NULL/*baseline(image, mask, width, height, n_object)*/; }
void ThresholdMain::render_gui(void *data) { if(thread) { calculate_histogram((VFrame*)data); thread->window->lock_window("ThresholdMain::render_gui"); ((ThresholdWindow*)thread->window)->canvas->draw(); thread->window->unlock_window(); } }
/*object *my_alg_level2(unsigned char *image, int width, int height, int *n_object)*/ object *my_alg_level2(unsigned char *image, unsigned char *mask, int width, int height, int *n_object) { /*********************************MYCODE*********************************/ unsigned int width_sub = 0, height_sub = 0; create_sub_images(image, width, height, &width_sub, &height_sub); /*export_ppm_subimages(3, width, height, width_sub, height_sub);*/ calculate_histogram(3, width, height, width_sub, height_sub); calculate_threshold(width, height, width_sub, height_sub); calculate_threshold_with_interpolation(0, width, height, width_sub, height_sub); final_stage(width, height, width_sub, height_sub); /*free_mem_subimages(width, height, width_sub, height_sub);*/ /*********************************MYCODE*********************************/ /* transform_1D_to_2D(image, width, height); export_ppm_from_2D(3, width, height); convert_to_greyscale(width, height); noise_reduction(width, height); export_ppm_from_2D(4, width, height); Sobel_operator(3, width,height); non_maximum_suppression(width, height); int high = 0, low = 0; calculate_thresholds(width, height, &high, &low); printf("l:%d h:%d\n", low, high); hysteresis_thresholding(width, height, high, low); export_ppm_from_2D(4, width, height); return NULL; */ return NULL;/*baseline(image, mask, width, height, n_object);*/ }