OpenCV: 如何检测标签的位置?

huangapple go评论61阅读模式
英文:

OpenCV: How to detect the position of label?

问题

以下是要翻译的部分:

我有下面的一张图像,如何检测图像中的标签,即线条和标签,但最重要的是标签,它带有编号。

我试图从中提取信息的图像如下所示

OpenCV: 如何检测标签的位置?

这是我的想法:

  • 获取所有的线条
  • 使用轮廓来识别标签并绘制矩形
  • 通过找到最接近线条的标签来过滤一些噪音。

为什么我的解决方案不起作用?

我尝试使用霍夫变换(Hough Transform),但效果不佳。

以下是我拥有的示例

OpenCV: 如何检测标签的位置?

预期的最终结果应该类似于这个

OpenCV: 如何检测标签的位置?

英文:

I have an image below, how do I detect the label in the image, i.e. the line and label, but the most important thing is label, which is the label with numbering.

The image I'm trying to extract from is shown below

OpenCV: 如何检测标签的位置?

Here is my thoughts:

  • Get all lines
  • Rectangle out the label using contour
  • And filter out some noise by finding label that is nearest to a line.

Why my solutions didn't work?

I have tried using HoughTransformP but it didn't work well.

Below is the example I have

OpenCV: 如何检测标签的位置?

The expected final result should be similar to this

OpenCV: 如何检测标签的位置?

答案1

得分: 1

根据您期望的最终结果,场景文本检测和识别算法将非常有用。

以下是一篇著名的论文:使用笔画宽度变换在自然场景中检测文本。在您的情况下,您有一张看起来像蓝图或工程图纸的图像。与自然场景相比,情况要简单得多。此外,在您的情况下,所有的文本都是正面的,没有透视失真。这将使场景文本检测算法更容易。

在您的情况下,您可以在检测算法之后运行识别算法,以确保您只捕获数字。

这里有一个在GitHub上广受欢迎的项目,您可以进行实验:https://github.com/HCIILAB/Scene-Text-Recognition-Recommendations

英文:

Based on your expected final result, scene text detection and recognition algorithms will be very useful.

The following is a famous paper: Detecting Text in Natural Scenes with
Stroke Width Transform
. In your case, you have an image that looks like a blueprint or engineering drawing. The situation is simpler compared to a natural scene. Also, in your case, all the text is facing the front without perspective distortion. It will be even more easy for the scene text detection algorithms.

In your case, you could run a recognition algorithm after the detection algorithm, to make sure you only capture the numbers.

Here is a well received project on github that you can experiment with: https://github.com/HCIILAB/Scene-Text-Recognition-Recommendations

huangapple
  • 本文由 发表于 2023年5月15日 14:46:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76251490.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定