23#include "fmi_image_filter.h"
24#include "fmi_image_filter_line.h"
30void detect_horz_line_segments(
FmiImage *target,
FmiImage *trace,
unsigned char min_length,
unsigned char min_elevation){
32 detect_vert_maxima(target,trace);
33 if (FMI_DEBUG(1)) write_image(
"maxima",trace,PGM_RAW);
36 mask_image(trace,trace,min_elevation,0);
37 if (FMI_DEBUG(1)) write_image(
"maxima2",trace,PGM_RAW);
40 propagate_right(NULL,trace,trace,1,put_pixel);
41 if (FMI_DEBUG(1)) write_image(
"prop",trace,PGM_RAW);
44 propagate_left(trace,trace,trace,0,put_pixel);
45 if (FMI_DEBUG(1)) write_image(
"prop2",trace,PGM_RAW);
47 mask_image(trace,trace,min_length,0);
50void detect_horz_edge_segments(
FmiImage *target,
FmiImage *trace,
unsigned char min_length,
unsigned char min_elevation){
52 detect_horz_edges(target,trace);
53 if (FMI_DEBUG(1)) write_image(
"maxima",trace,PGM_RAW);
56 mask_image(trace,trace,min_elevation,0);
57 if (FMI_DEBUG(1)) write_image(
"maxima2",trace,PGM_RAW);
60 propagate_right(NULL,trace,trace,1,put_pixel);
61 if (FMI_DEBUG(1)) write_image(
"prop",trace,PGM_RAW);
64 propagate_left(trace,trace,trace,0,put_pixel);
65 if (FMI_DEBUG(1)) write_image(
"prop2",trace,PGM_RAW);
67 mask_image(trace,trace,min_length,0);
70void detect_vert_line_segments(
FmiImage *target,
FmiImage *trace,
unsigned char min_length,
unsigned char min_elevation){
80 detect_horz_maxima(target,trace);
81 if (FMI_DEBUG(1)) write_image(
"maxima",trace,PGM_RAW);
84 mask_image(trace,trace,min_elevation,0);
85 if (FMI_DEBUG(1)) write_image(
"maxima2",trace,PGM_RAW);
88 propagate_up(NULL,trace,trace,1,put_pixel);
89 if (FMI_DEBUG(1)) write_image(
"prop",trace,PGM_RAW);
92 propagate_down(trace,trace,trace,0,put_pixel);
93 if (FMI_DEBUG(1)) write_image(
"prop2",trace,PGM_RAW);
95 mask_image(trace,trace,min_length,0);