图像处理 - 将曲线从一个图像匹配到另一个图像 [英] Image processing - Match curves from one image to another

查看:194
本文介绍了图像处理 - 将曲线从一个图像匹配到另一个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做类似这个问题:





它可能更适合普通的灰度图像,但它似乎适用于这些数据。看起来线条在两条曲线周围连接大致相同的点;将所有这些对插入像 FindHomography 在OpenCv中的功能,小的差异甚至应该自己出来,你得到两个图像之间的仿射变换矩阵。



对于您的特定数据,您可能会出现更好的关键点描述符;也许是检测线端,线交叉和尖角的东西。



或者这是怎么回事:这是一个多一点的工作,但如果你可以将你的路径矢量化为bezier或b-spline,你可以从中获得一些自然的关键点样条描述符。

我不知道任何矢量化库,但 Inkscape 有一个基本的实现你可以测试这种方法。
一旦你有一小组描述符而不是一个大的2d位图,你只需要根据FindHomography匹配两个图像之间的这些描述符。






回答评论:



兴趣点只是具有特定属性的小区域。所以这些区域的中心可能是黑色或白色;该算法不专门寻找白色像素或大规模形状,例如曲线。重要的是,线条在两条曲线上大致连接相同的点,至少乍看之下。


I am doing something similar to this problem: Matching a curve pattern to the edges of an image

Basically, I have the same curve in two images, but with some affine transform between the two. Here is an example of two images:

Image1

Image2

So in order to get to Image2, you can apply some translation, rotation, scale, etc. to Image1.

Does anyone know how to solve for this transform?

Phase correlation doesn't work because it's not a translation only. Optical flow doesn't work since there's not enough detail to resolve translation, rotation, scale (It's pretty much a binary image). I'm not sure if Hough Transforms will give me good data.

解决方案

I think some sort of keypoint matching algorithm like sift or surf would work with this kind of data as well. The basic idea would be to find a limited number of "interesting" keypoints in each image, then match these keypoints pairwise.

Here is a quick test of your image with an online ASIFT demo: http://demo.ipol.im/demo/my_affine_sift/result?key=BF9F4E4E006AB5168497709836C39C74#

It is probably more suited for normal greyscale images, but nevertheless it seems to work for this data. It looks like the lines connect roughly the same points around both of the curves; plugging all these pairs into something like the FindHomography function in OpenCv, the small discrepancies should even themselves out and you get the affine transformation matrix between the two images.

For your particular data you might be able to come up with better keypoint descriptors; perhaps something to detect the line ends, line crossings and sharp corners.

Or how about this: It is a little more work, but if you can vectorize your paths into a bezier or b-spline, you can get some natural keypoints from the spline descriptors.
I do not know any vectorisation library, but Inkscape has a basic implementation with which you could test the approach. Once you have a small set of descriptors instead of a large 2d bitmap, you only need to match these descriptors between the two images, as per FindHomography.


answer to comment:

The points of interest are merely small areas that have certain properties. So the center of those areas might be black or white; the algorithm does not specifically look for white pixels or large-scale shapes such as the curve. What matter is that the lines connect roughly the same points on both curves, at least at first glance.

这篇关于图像处理 - 将曲线从一个图像匹配到另一个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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