在图像文件中定位点的最佳算法是什么?

发布于 2024-09-03 05:54:53 字数 275 浏览 3 评论 0原文

我想创建一个标记表识别器。 描述如下:

  1. 我的系统使用黑白配色方案。
  2. 标记纸的每个角上都有一个小黑色矩形,并且在前面的矩形之一附近还有一个附加的小黑色矩形,以确定方向。
  3. 扫描纸张以生成图像(例如 bmp 格式)。

第一步是尽可能有效地在图像中定位这五个参考。

我的粗略想法是逐行跟踪,每行从左到右。 我认为这听起来很慢。

有更好的方法吗?

先感谢您。

问候,

苏岳

I want to create a mark sheet recognizer.
Here is the description:

  1. My system uses black and white color scheme.
  2. The mark sheet paper has a small black rectangle on each corner and an additional small black rectangle, to determine orientation, near one of the previous rectangles.
  3. The paper is scanned to yield an image (in bmp format for example).

The first step is to locate these five references in image as eficient as possible.

My rough idea is to trace row by row and from left to right for each row.
It sounds very slow I think.

Is there any better way to do that?

Thank you in advance.

regards,

Suugaku

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

疏忽 2024-09-10 05:54:53

您可以首先搜索通常希望找到参考图像的位置。您可以通过统计他们之前的位置来做到这一点。特别是如果您相继拍摄了两帧,则参考点很可能不会移动太远。

一旦找到一个或多个参考点,其他参考点的位置就会受到严格限制,因此您可以很好地猜测其他参考点必须位于哪里。每次您找到一个新点时,它都会提供更多关于剩余点可能在哪里的提示。

因此,您可以首先使用一些猜测来快速找到点,如果失败则恢复为逐行扫描。

You can start by searching where you typically expect to find the reference images. You can do this by keeping statistics of where they were before. In particular if you have two frames taken one after the other, the chances are the reference points won't have moved very far.

Once you have found one or more of the reference points, the position of the others becomes heavily constrained so you can make a very good guess as to where the others must lie. Each time you find a new point it provides more hints as to where the remaining points can be.

So you can start by using a bit of guesswork to find the points quickly, and revert to a line-by-line scan if that fails.

橘和柠 2024-09-10 05:54:53

如果您使用 BitMap.LockBits,速度不是问题() 实例方法 (https ://web.archive.org/web/20121203144033/http://www.bobpowell.net/lockingbits.htm)。然后,您所需要的只是几个小时。

Speed is not an issue if you use the BitMap.LockBits() instance method (https://web.archive.org/web/20121203144033/http://www.bobpowell.net/lockingbits.htm). Then, all you need is a couple of hours.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文