Symbol recognition is very poor, not sure why

that should be changed fundamentally.

the resize() turns everything into a 20x30 image. if it’s a vertical line… that gets turned into a black rectangle. if it’s a horizontal line, it gets turned into? a black rectangle (or white, after the threshold with INV flag).

you’ll need to resize while maintaining aspect ratio, while also setting the border mode to CONSTANT with background value chosen appropriately.