I have this sample cropped image:
I need to make black thick lines (horizontal and vertical) disappear or extracted while leave all other info intact. These specific lines are either 4 or 5 pixels thick. I tried:
- Simple filtering of rows having more zeros/ones if image is read as NumPy array but the filtering condition doesn't terminate till a single row is left with zero or one.
- Erosion with simple kernel (3,3) but it leaves some noise because some symbols are also thick black
- Dilation with line structuring element of the width of image width but there are overwhelming variations on line segments' sizes connecting different symbols that the basic info about each small line segment is lost.
Can someone give insights or directions about what kind of structuring elements, what type of morphological ops should be considered or may be any other clever heuristics? The output, if extraction of thick black lines is done, will then look like this grid of random line segments:

