将扭曲/变换图像与基本图像匹配的最快且最准确的方法?
我正在尝试拍摄通过扫描仪(或可能是手机摄像头)拍摄的不同质量和失真的图像,并将其与基础图像(在打印和扫描之前通过 Photoshop 生成的图像)重新对齐。尽可能接近。
该图像的每个角都有四个厚角点,我一直使用原始方法来查找这四个点,然后对扫描图像使用透视变换。然而,我的算法完全是蛮力的并且非常容易被破解。
我尝试过使用 cvGoodFeaturesToTrack(),但我无法想出一种准确的方法来确保校准的四个点在所有情况下都是准确的。我曾考虑过使用模板匹配,但似乎它在各种扭曲下都无法可靠地工作。我看到很多方法来完成特定任务,例如查找轮廓、关键点、线条等,但没有任何迹象表明它们实际上做什么。
有没有更好的方法,我只是没有看到?
谢谢!
I'm trying to take an image taken in through a scanner (or possibly mobile phone camera) of varying quality and distortion, and re-align it with the base image (the one generated through photoshop, before it's printed and scanned) to be as close as possible.
The image has four thick corner points at each of the corners, which I've been using a primitive method to find the four points of, then using a perspective transform on the scanned image. However, my algorithm is completely brute-force and highly breakable.
I've tried using cvGoodFeaturesToTrack(), but I can't come up with an accurate way of making sure the four points for calibration are accurate under all circumstances. I've thought of using template matching, but it doesn't seem like it will work reliably under a variety of distortions. I'm seeing a lot of methods to do specific tasks, like finding contours, key points, lines, etc., but no indications of what do actually do with them.
Is there a better way that I'm just not seeing?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经典方法是二值化和斑点分析:找到比阈值暗的像素,并在它们接触时将它们分组(连通分量分析)。使点形状(良好的圆形度)和面积保持在预期范围内的组。使用重心。这对于您的参考点来说应该足够准确。
由于图像中存在附近的特征,您可能希望减少对角点的错误检测。更好区分的一个选择是使用环而不是圆盘并寻找带有孔的斑点。
The classical approach is binarization and blob analysis: find the pixels darker than a threshold and group them when they touch (connected components analysis). Keep the groups that have a dot shape (good circularity) and an area in the expected range. Use the center of gravity. This should be accurate enough for your reference points.
You may want to reduce false detections of the corner dots because of the nearby features in the image. An option for better discriminance is to use rings instead of disks and look for blobs with a hole.
如果您的扭曲可以描述为单应性,那么您可以使用“ESM”算法(高效二阶最小化,CVD 库中提供)。
http://www.edwardrosten.com/cvd/cvd/html/group__gEsm.html
如果您的畸变包括一些镜头畸变,您可以使用 DIC(数字图像相关)。
If your distortions can be described as homography, than you can use "ESM" algorithm (Efficient Second Order Minimization, available in CVD library).
http://www.edwardrosten.com/cvd/cvd/html/group__gEsm.html
If your distortions include some lense distortions that you can use DIC (Digital image correlation).