如何在图像中定位对齐标记 [英] How to Locate Alignment Marks in an Image

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

问题描述

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

我需要定位的典型标记的示例图像是:


(来源:tpub.com)

评估从扫描仪获得的图像以定位图像中的各种标记的技术有哪些?我需要定位多个标记及其中心点位置.

解决方案

只是集思广益一些可能的方法.

模板匹配

一种蛮力的方法是拥有一个注册标记应该是什么样子的位图图像.然后,对于图像中与模板位图具有相同宽度和高度的每个可能的矩形,将图像像素与模板像素进行比较.如果大多数相应的像素匹配,您可能已经找到了注册标记.这是非常计算密集型的,因为您必须扫描所有可能的位置、旋转、比例因子等.您可以通过利用您知道的东西来减少它.例如,您的注册标记是对称的,因此您无需检查所有可能的旋转.也许您知道标记的确切大小,因此可以避免在不同的比例因子上进行迭代.最后,您可能知道注册标记应该靠近角落,因此可以跳过图像中间的大部分.

有趣的点

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

特征检测

有用于线检测、圆检测等的算法.您可以运行一堆这些算法,然后在圆内寻找两条交叉线段的组合.这可能是最稳健的方式,但也可能是最难开始工作的方式.

一些预处理步骤,例如运行边缘检测器、阈值化或膨胀以及侵蚀过滤器,如果图像一开始就不是很干净,也可能会有所帮助.

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:


(source: tpub.com)

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.

Template Matching

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.

Interesting Points

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.

Feature Detection

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天全站免登陆