0

I have an image like this:-

enter image description here

I want to split them into rows based on the lines and then apply ocr on it and store them in a list.

The latter part is easy but I'm not sure how to achieve the first task, I'm new to image processing and would love some guidance

I have tried my best to do the same referring to similar problem posts with no avail.

5
  • You probably want Hough lines. One example here: stackoverflow.com/a/39925278/7750891 Commented Jun 21, 2024 at 10:58
  • 4
    If the horizontal lines are truly horizontal, you can just sum, or average, the pixels across the image and if they are largely black, they will sum/average to near zero. Explicitly, I mean np.sum(image, axis=1) See stackoverflow.com/a/63174271/2836621 Commented Jun 21, 2024 at 11:31
  • Nobody wants Hough lines. Nobody should want Hough lines. At best, that'll give you some lines. Then you'll have to puzzle them together into a table. Commented Jun 21, 2024 at 13:34
  • Not exactly the same problem, but very closely related answers: Here and here. Commented Jun 21, 2024 at 20:35
  • You could invert your image so the lines are white on a black background and then use np.count_nonzero() along axis=1 (see numpy.org/doc/stable/reference/generated/…) and then find the high count values. Perhaps threshold to remove the low count values to make the high ones stand out. Commented Jun 21, 2024 at 23:44

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.