识别规则网格中的扭曲
为了给您一些关于我正在做的事情的背景知识:我正在尝试通过图像分析定量记录可压缩流体流量的变化。实现此目的的一种方法是利用流体的折射率与其密度直接相关的事实。如果您在流动后面设置某种图像,则由于整个流体场的折射率变化而导致的图像失真会导致密度梯度,这有助于表征流动模式。
我有一组例程,可以使用常规的 2D 点图案成功地完成此操作。点图案稍微扭曲,通过将扭曲图像中的点的位置与未扭曲图像中的点的位置进行比较,我得到了位移场,这正是我所需要的。这种方法的问题在于分辨率。分辨率仅限于视野中的点数,我正在探索为我提供更多数据的方法。
我的一个想法是使用水平和垂直线的规则网格。该图像将以同样的方式扭曲,但我将得到网格的连续扭曲,而不是仅得到点的位移。似乎必须有某种标准算法或程序来将一个几何网格与另一个几何网格进行比较并推断出某种位移场。尽管如此,我在研究中还没有发现类似的事情。
有人有一些想法可以指引我正确的方向吗?仅供参考,我不是计算机科学家——我是工程师。我这么说只是因为由于来自不同的领域,我可能忽略了一些明显的方法。但我可以编程。我正在使用 MATLAB,但我可以阅读 Python、C/C++ 等。
以下是我正在使用的图像类型的示例:
Regular: Distorted:
--------
To give you some background as to what I'm doing: I'm trying to quantitatively record variations in flow of a compressible fluid via image analysis. One way to do this is to exploit the fact that the index of refraction of the fluid is directly related to its density. If you set up some kind of image behind the flow, the distortion in the image due to refractive index changes throughout the fluid field leads you to a density gradient, which helps to characterize the flow pattern.
I have a set of routines that do this successfully with a regular 2D pattern of dots. The dot pattern is slightly distorted, and by comparing the position of the dots in the distorted image with that in the non-distorted image, I get a displacement field, which is exactly what I need. The problem with this method is resolution. The resolution is limited to the number of dots in the field, and I'm exploring methods that give me more data.
One idea I've had is to use a regular grid of horizontal and vertical lines. This image will distort the same way, but instead of getting only the displacement of a dot, I'll have the continuous distortion of a grid. It seems like there must be some standard algorithm or procedure to compare one geometric grid to another and infer some kind of displacement field. Nonetheless, I haven't found anything like this in my research.
Does anyone have some ideas that might point me in the right direction? FYI, I am not a computer scientist -- I'm an engineer. I say that only because there may be some obvious approach I'm neglecting due to coming from a different field. But I can program. I'm using MATLAB, but I can read Python, C/C++, etc.
Here are examples of the type of images I'm working with:
Regular: Distorted:
--------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在寻找数字图像相关算法。
在这里您可以看到一个演示。
这是一个 Matlab 实现。
来自维基百科:
在这里编辑
我使用
Mathematica
将 DIC 算法应用于扭曲图像,显示相对位移。编辑
您还可以轻松识别最大位移区域:
编辑
经过一些工作(坦白说,相当多的工作),您可以得到这样的结果,代表“位移场”,清楚地表明您正在处理漩涡:
(更暗、更大箭头意味着更多的位移(速度))
如果您对此的 Mathematica 代码感兴趣,请给我发表评论。我认为我的代码不会对其他人有帮助,所以我省略了发布它。
I think you are looking for the Digital Image Correlation algorithm.
Here you can see a demo.
Here is a Matlab Implementation.
From Wikipedia:
Edit
Here I applied the DIC algorithm to your distorted image using
Mathematica
, showing the relative displacements.Edit
You may also easily identify the maximum displacement zone:
Edit
After some work (quite a bit, frankly) you can come up to something like this, representing the "displacement field", showing clearly that you are dealing with a vortex:
(Darker and bigger arrows means more displacement (velocity))
Post me a comment if you are interested in the Mathematica code for this one. I think my code is not going to help anybody else, so I omit posting it.
我还建议线路跟踪算法效果很好。
只需从图像的第一条像素线开始,然后开始沿着每条垂直线向下(您只需从第一行开始即可获取起点。这可以通过与渐变正交移动的简单图案来完成当您到达水平线的交叉点时,您可以测量该点(以 x,y 坐标表示)并将其与扭曲图像中相应的交叉点进行比较,
因为您知道网格是规则的。第 m 条垂直黑线上的第 n 个测量交叉点在两个图像中都是对应的,然后您只需通过计算网格上的每条线的距离来比较这两个点,您就会得到每条线的距离。网格的交叉点是扭曲的。
这种跟随线算法也用于基本的边缘链接算法或 Canny 边缘检测器
(所有这些都只是理论想法,我无法为您提供算法。但我想它应该。轻松处理扭曲的图像,就像你在那里一样......但也许这对你有帮助)
I would also suggest a line tracking algorithm would work well.
Simply start at the first pixel line of the image and start following each of the vertical lines downwards (You just need to start this at the first line to get the starting points. This can be done by a simple pattern that moves orthogonally to the gradient of that line, ergo follows a line. When you reach a crossing of a horizontal line you can measure that point (in x,y coordinates) and compare it to the corresponding crossing point in your distorted image.
Since your grid is regular you know that the n'th measured crossing point on the m'th vertical black line are corresponding in both images. Then you simply compare both points by computing their distance. Do this for each line on your grid and you will get, by how far each crossing point of the grid is distorted.
This following a line algorithm is also used in basic Edge linking algorithms or the Canny Edge detector.
(All this are just theoretic ideas and I cannot provide you with an algorithm to it. But I guess it should work easily on distorted images like you have there... but maybe it is helpful for you)