Connected Character segmentation in OpenCV

后端 未结 1 419
情歌与酒
情歌与酒 2021-01-01 02:29

What is a good method to segment characters that are united as in the following figure, knowing that:

  • characters have this font, but the font size varies based
相关标签:
1条回答
  • 2021-01-01 03:04

    IDEA: if you have a good ocr already, you can try to apply ocr all these connected components (or contours). If ocr cant detect a letter; than there is not 1 letter, there are 2 or more.

    IDEA: check convexity defects of these connected components, the closest defect points are where the bridges are.

    IDEA: use a kernel having small width & big height for erosion+dilation (morphological opening)

    IDEA: take y-derivative of the image. The smallest contours (or lines) left will be your bridges. Mark them and erase those pixels from the original image.

    IDEA: search problem approach: Take 2 letters from alphabet (and this font), connect them horizontally with some tool and use matchShapes method (moment match) of opencv to find if that shape matches with your connected component. Or try to implement autocorrelation.

    good luck.

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