Image processing / super light OCR

前端 未结 3 873
孤街浪徒
孤街浪徒 2021-01-01 07:02

I have 55 000 image files (in both JPG and TIFF format) which are pictures from a book.

The structure of each page is this:

some text

相关标签:
3条回答
  • 2021-01-01 07:57

    Probably the easiest way to detect your lines is using the Hough transform in OpenCV (which has wrappers for many languages).

    The OpenCV Hough tranform will detect all lines in the image and return their angles and start/stop coordinates. You should only keep the ones whose angles are close to horizontal and of adequate length.

    O'Reilly's Learning OpenCV explains in detail the function's input and output (p.156).

    0 讨论(0)
  • 2021-01-01 07:58

    you might want to try John' Resig's OCR and Neural Nets in Javascript

    0 讨论(0)
  • 2021-01-01 08:00

    If you have good contrast, try running connected components and analyze the result. It can be an alternative to finding lines through Hough and cover the case when your structured elements are a bit curved or a line algorithm picks up the lines you don’t want it to pick up.

    Connected components is a super fast, two raster scan algorithm and will give you a mask with all you connected elements in it marked with different labels and accounted for. You can discard anything short ( in terms of aspect ratio). Overall, this can be more general, faster but probably a bit more involved than running Hough transform. The Hough transform on the other hand will be more tolerable for contrast artifacts and even accidental gaps in lines. OpenCV has the function findContours() that find components for you.

    0 讨论(0)
提交回复
热议问题