如何找到图像中的对齐标记 [英] How to Locate Alignment Marks in an Image

查看:229
本文介绍了如何找到图像中的对齐标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计的系统将以标准化的形式扫描图像(例如,TBitmap)。我想要识别这些页面上的对齐标记,并使用这些裁剪标记的位置将页面旋转到正确的方向(因此顶部实际上是向上的),并将图像裁剪到对齐标记的位置。

I am designing a system that will scan in standardized forms to images (e.g., TBitmap). I would like to identify alignment marks on these pages and use the locations of these crop marks to rotate the page to its proper orientation (so top is actually up) and to crop the image to the location of the alignment marks.

我需要找到的典型标记的示例图像是:

An example image of a typical mark I'd need to locate is:

什么是评估从扫描仪获取的图像以定位各种图像中的标记?

What are techniques to evaluate an image obtained from a scanner to locate various marks within the image? I'd need to locate multiple marks and their center point locations.

推荐答案

只需集思广益,寻找一些可能的方法。

Just brainstorming some possible approaches.

模板匹配

一个强力的方法将会有一个位图图像,标记应该看起来像。然后,对于图像中具有与模板位图相同的宽度和高度的每个可能的矩形,您将图像像素与模板像素进行比较。如果大多数相应的像素匹配,您可能找到了一个注册标记。这是非常计算密集的,因为你必须扫描所有可能的位置,旋转,缩放因子等。你可以通过利用你知道的事情的优势。例如,您的注册标记是对称的,因此您不需要检查所有可能的旋转。也许你知道标记的确切大小,因此可以避免迭代不同的比例因子。最后,您可能知道注册标记应该靠近角落,因此可以跳过图片的大部分中间位置。

A brute-force method would be to have a bitmap image of what a registration mark should look like. Then, for every possible rectangle in the image that has the same width and height as the template bitmap, you compare the image pixels to the template pixels. If most of the corresponding pixels match, you've probably found a registration mark. This is very compute intensive because you have to scan over all possible positions, rotations, scale factors, etc. You can whittle this down by taking advantage of things you know. For example, your registration mark is symmetric, so you don't need to check all possible rotations. Perhaps you know the exact size the mark should be and thus can avoid iterating over different scale factors. Finally, you might know that the registration marks should be near the corners and thus can skip over most of the middle of the image.

有趣的点

找到一种方法来识别图像中的有趣点。例如,似乎在交叉点的中心的点可以通过用小内核进行卷积来找到,该小内核加强在基本方向上具有匹配像素的像素,然后对结果进行阈值。这给出了一个似乎是交叉点的像素列表(可能有一些噪声)。你可以搜索这个坐标子集,看看你的注册标记中的五个交叉点的星座。您可能仍需要应用模板匹配以找到最可能的位置,但这将大大减少您原本必须尝试的位置,旋转和缩放因子的数量。

Find a way to identify "interesting points" in the image. For example, points that seem to be at the center of an intersection could be found by doing a convolution with a small kernel that reinforces pixels that have matching pixels in the cardinal directions and then threshold the result. This gives a list of pixels that seem to be intersection points (there might be some noise). You can search this subset of coordinates for a "constellation" that looks like the five intersection points in your registration mark. You might still need to apply template matching to find the most likely positions, but this would vastly reduce the number of locations, rotations, and scale factors that you'd otherwise have to try.

功能检测

有线检测,圆检测等算法。您可以运行一堆然后查找圆内的两个交叉线段的组合。

There are algorithms for line detection, circle detection, etc. You might be able to run a bunch of these and then look for a combination of two crossing line segments within a circle. This may be the most robust way, but it's probably also the hardest to get working.

一些预处理步骤,如运行边缘检测器,阈值处理或膨胀,以及侵蚀过滤器,可能是最稳健的方法,但也可能是最难的工作方式。可能也有助于如果图像不是真正干净的开始。

Some preprocessing steps, like running edge detectors, thresholding, or dilation, and erosion filters might also help if the images aren't real clean to begin with.

这篇关于如何找到图像中的对齐标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆