如何使用openCV检测图像中的字母?

时间:2017-12-01 05:41:28

标签: c++ c opencv

我想将我的图像分割成多个区域,其中一个区域等于一个字母。

我的示例图片是 https://myinvoice.be.carrefour.eu/sites/all/themes/custom/myinvoice/images/ticket.jpg

目标是分别检测每个字母。例如,它首先检测C的区域,然后检测A,R,R等等。

我可以使用哪种好的算法/技术来做到这一点?

我试图对像素阵列进行测距,当我发现一个像素跟随像素的形状直到我到达起点时。保存最小/最大坐标,然后通过x + maxSHape或类似的东西转到下一个坐标,但恐怕需要很长时间才能分析。

1 个答案:

答案 0 :(得分:1)

如果图像清晰。那很容易。

1. Thresholding image to binary image (Otsu thresholding will work well)
2. Add some Deliation, Erosion to remove noise
3. Find contour from entire image
4. Add some are filter to select the specific font-characters

您可以使用opencv和python来实现这些任务。