人物图像细化
我正在做一个 ocr 应用程序。我很困惑如何倾斜这样的图像:
其次,我有一个带有多种字体的字符图像尺寸。问题是:如何将它们细化为相同大小
im doing an ocr application . im confusing that how to do skew an image like this :
Second ,i have a character image with many font size. the problem is : how to thin them to the same size like this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于第一点:找到文本旋转的角度,然后将图像旋转该角度。在您的示例中,您可以通过查找边缘上的大黑色斑块与白色区域之间的线条角度来完成此操作。查看边缘检测和hough 变换 帮助您找到线条,然后帮助您找到它们的角度。 OpenCV 对这两种算法都有很好的实现。
对于第二点:这是形态学操作二元骨架的实际应用。
For your first point: find the angle by which the text is rotated, and rotate your image by that angle. In your sample you can do this by finding the angles of the lines between the large black patches on the edges and the white areas. Look into edge detection and hough transform to help you find the lines, and then help you find their angle. OpenCV has a good implementation of both algorithms.
For your second point: that is the morphological operation binary skeleton in action.
您可以使用以下代码来检测和纠正倾斜,但如果您获得任何细化算法,我需要您的帮助...假设输入图像位于图片框上...
you can use the following code for detecting and correcting skew but i need your help if you get any thinning algorithms...asume the input image is on the picture box....