问题描述
我正在寻找一些算法(最好是可用的源代码)
用于图像注册。
图像变形无法通过单应矩阵描述(因为我认为失真不对称而不是
齐),更具体地说,变形就像桶形/失真和梯形失真,可能是图像的一些旋转。
我想获得两个图像的像素对,因此我可以获得变形场的表示。
I'm looking for some algorithm (preferably if source code available)for image registration.Image deformation can't been described by homography matrix(because I think that distortion not symmetrical and nothomogeneous),more specifically deformations are like barrel/distortion and trapezoid distortion, maybe some rotation of image.I want to obtain pairs of pixel of two images and so i can obtain representation of "deformation field".
我谷歌很多,并发现那里是一些基于一些phisics想法的算法,但似乎它们可以将
收敛到局部最大值,但不是全局的。
我可以将程序设为半自动,这意味着一些简单的用户交互。
I google a lot and find out that there are some algorithm base on some phisics ideas, but it seems that they can convergeto local maxima, but not global.I can affort program to be semi-automatic, it means some simple user interation.
也许像SIFT这样的算法会合适吗?
但我认为它不能提供具有足够密度的变形场。
maybe some algorithms like SIFT will be appropriate?but I think it can't provide "deformation field" with regular sufficient density.
如果重要的是没有比例变化。
if it important there is no scale changes.
复杂字段的示例
推荐答案
您正在寻找的是光流。搜索这些术语将产生大量结果。
What you are looking for is "optical flow". Searching for these terms will yield you numerous results.
在OpenCV中,有一个名为calcOpticalFlowFarneback()的函数(在视频模块中)可以完成您想要的操作。
C API仍然有Horn& amp;经典论文的实现。 Schunck(1981)称之为确定光流。
In OpenCV, there is a function called calcOpticalFlowFarneback() (in the video module) that does what you want.The C API does still have an implementation of the classic paper by Horn & Schunck (1981) called "Determining optical flow".
您还可以查看我已完成的这项工作以及一些代码(但要小心,那里在opencl内存代码中仍然存在一些神秘的错误。我将在今年晚些时候发布更正版本。):
You can also have a look at this work I've done, along with some code (but be careful, there are still some mysterious bugs in the opencl memory code. I will release a corrected version later this year.): http://lts2www.epfl.ch/people/dangelo/opticalflow
除了OpenCV的光流(和我的;-),你可以看看在itk.org上的ITK上获得完整的图像注册链(主要针对医学成像)。
Besides OpenCV's optical flow (and mine ;-), you can have a look at ITK on itk.org for complete image registration chains (mostly aimed at medical imaging).
还有很多光流代码(matlab,C / C ++ ......)可以通过谷歌找到,例如cs.brown.edu/~ dqsun / research / software.html,gpu4vision等
There's also a lot of optical flow code (matlab, C/C++...) that can be found thanks to google, for example cs.brown.edu/~dqsun/research/software.html, gpu4vision, etc
- 编辑:关于光流 -
光流分为两类算法:密集算法和其他算法。
密集算法为每个像素提供一个运动矢量,非密集每个跟踪特征一个矢量。
Optical flow is divided in two families of algorithms : the dense ones, and the others.Dense algorithms give one motion vector per pixel, non-dense ones one vector per tracked feature.
密集家族的例子包括Horn-Schunck和Farneback(保持opencv),更普遍的是任何能够最大限度地降低整个图像(各种TV-L1流等)的成本函数的算法。
Examples of the dense family include Horn-Schunck and Farneback (to stay with opencv), and more generally any algorithm that will minimize some cost function over the whole images (the various TV-L1 flows, etc).
一个例子非密集族是KLT,在opencv中称为Lucas-Kanade。
An example for the non-dense family is the KLT, which is called Lucas-Kanade in opencv.
在密集的家庭中,由于每个像素的运动几乎是免费的,它可以处理规模变化。但请记住,在大运动/比例变化的情况下,这些算法可能会失败,因为它们通常依赖于线性化(运动和图像变化的泰勒展开)。此外,在变分方法中,每个像素对整体结果有贡献。因此,在一个图像中不可见的部分可能会使算法偏离实际解决方案。
In the dense family, since the motion for each pixel is almost free, it can deal with scale changes. Keep in mind however that these algorithms can fail in the case of large motions / scales changes because they usually rely on linearizations (Taylor expansions of the motion and image changes). Furthermore, in the variational approach, each pixel contributes to the overall result. Hence, parts that are invisible in one image are likely to deviate the algorithm from the actual solution.
无论如何,采用粗到精的实现等技术来绕过这些限制,这些问题通常只有很小的影响。某些算法也可以明确地处理残酷的照明变化或大的遮挡/未遮挡区域,例如参见计算了光学流场旁的创新稀疏图像。
Anyway, techniques such as coarse-to-fine implementations are employed to bypass these limits, and these problems have usually only a small impact. Brutal illumination changes, or large occluded / unoccluded areas can also be explicitly dealt with by some algorithms, see for example this paper that computes a sparse image of "innovation" alongside the optical flow field.
这篇关于图像配准(非刚性\非线性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!