diagram processing code - trying to detect symbols in scientific diagrams