当前位置: 首页 > 工具软件 > Leptonica > 使用案例 >

leptonica 表格图像分析

宰父劲
2023-12-01

水平腐蚀留下水平线,垂直腐蚀留下竖直线。

 

leptonica 去除水平线方法:

  1. Deskew the image. 校正图像使直线水平化。We want the lines to be horizontal so the can be effectively removed by large morphological openings.
  2. Extract the horizontal lines. 提取水平线。Ideally, we want just these lines, but we get some of the background as well.
  3. Remove the background. 去除背景If the light background is not removed, we will lighten the final result when we remove the lines. The light background is removed by setting to white given a threshold.
  4. Darken the lines. 水平变黑。If the lines are not dark enough, they will not be entirely removed. The lines are darkened by setting to black given a threshold.
  5. Remove the lines from the deskewed version of the original. 从原图去除水平线。This is done by adding the inverse (value --> 255 - value) of the line image.
  6. Reconstitute the missing pixels. 重构水平线部分。Set those pixels to the minimum values above and below, using morphological opening followed by pixel selection.

 

 类似资料: