English 中文(简体)
光流的简单情况
原标题:simple case of optical flow

概述:我希望我要描述的用例是一个光流问题的简单案例,由于我对这个主题没有太多知识,我想知道是否有人对我如何解决问题有任何建议。

我已经做过的研究:我开始阅读基于翘曲理论的高精度光流估计论文,我计划查看粒子视频论文。我找到了一个MATLAB高精度光流光流的实现。然而,论文(和代码)似乎描述了一些非常复杂的概念,可能需要很多时间来深入研究和理解。我希望我的问题的解决方案可能更简单。

问题:我有一系列图像。这些图像描绘了材料断裂过程,其中材料和背景为黑色,裂纹为白色。我感兴趣的是反向遍历图像序列,试图将在断裂过程中形成的所有裂纹映射到第一个黑色图像。你可以把这些材料想象成一个大拼图,我正试图把这些碎片按它们断裂的相反顺序重新组合起来。

在每个图像中,可能有一些刚刚出现的裂纹和/或一些已经完全形成的裂纹(从而产生碎片)。在整个破碎过程中,一些碎片可能会分离并进一步破碎。碎片也可以彼此移动得更远(后续帧之间的变化很小)。

所需输出:序列中映射到序列中第一个图像的所有裂缝/线。

附加说明:图像有灰度格式(即原始)和二进制格式,其中裂纹以白色勾勒,背景完全为黑色。请参阅下面的一些图像示例。

orig_img1 orig_img2 orig_img3

binary_img1 binary_img2 binary_img3

顶行显示原始图像,底行显示二进制图像。正如你所看到的,随着图像序列的发展,中间的裂缝越来越宽。因此,底部裂缝与下部碎片一起移动。当反向遍历序列时,我希望通过算法实现中间的裂缝合为一(并将其正确映射到第一张图像),同时正确映射底部裂缝,保持其与底部碎片的正确对应关系(大小和位置)。

一个序列通常包含大约30到40个图像,所以我只显示了开始的子集。此外,尽管这些图像没有显示它,但特定的图像可能只包含裂纹的开始(即其初始外观),并且在随后的图像中,它变得越来越长,并可能与其他裂纹结合。

语言:虽然没有必要,但我想使用MATLAB实现该解决方案(因为与该项目相关的大多数其他代码都是在MATLAB中完成的)。然而,如果OpenCV可能更容易,我可以灵活地使用我的语言/库。

任何想法都将不胜感激。

问题回答

向前遍历而不是反向遍历,并且不要使用光流。使用断裂线分割黑色部分,跟踪每个黑色部分随时间变化的质心。每当出现一条新的断裂线穿过黑色线段时,将线段一分为二,并继续分别跟踪每条线段。

由此,您应该能够构建一个树结构,表示随着时间的推移黑色部分的分割。断裂线可以作为元数据添加到此树中,也许可以将断裂线分配给它们首次出现的线段节点。

I would advise you to follow your initial idea of backtracking the cracks. Yo kind of know how the cracks look like so you can track all the points that belong to the crack. You just track all the white points with an optical flow tracker, start with Lukas-Kanade tracker and see where you get. The high-accuracy optical flow method is a global one and more general, I ll track all the pixels in the image trying to keep some smoothness everywhere. The LK is a local method that will just use a small window around each point to do the tracking. The problem is that appart from the cracks all the pixels are plain black so nothing to track there, you ll just waist time trying to track something that you can t track and you don t need to track. If lines are very straight you might end up with what s called the aperture problem and you ll get inaccurate results. You can also try some shape fitting/deformation based on snakes.

我同意达米安的观点。像HAOF这样的大多数光流方法依赖于强度恒定约束方程I(x,t)=I(x+v,t+dt)的一阶泰勒近似。这意味着解决方案取决于图像导数,其中梯度决定了运动矢量的大小和角度,即你需要一定量的纹理。然而,非二进制图像的纹理非常低就足够了。您可以尝试直方图均衡来增加输入数据的对比度,但对两个输入图像应用相同的变换是很重要的。例如如下:

cv::Mat equalizeMat(grayInp1.rows, grayInp1.cols * 2 , CV_8UC1);
grayInp1.copyTo(equalizeMat(cv::Rect(0,0,grayInp1.cols,grayInp1.rows))); 
grayInp2.copyTo(equalizeMat(cv::Rect(grayInp1.cols,0,grayInp2.cols,grayInp2.rows)));
cv::equalizeHist(equalizeMat,equalizeMat);
equalizeMat(cv::Rect(0,0,grayInp1.cols,grayInp1.rows)).copyTo(grayInp1);
equalizeMat(cv::Rect(grayInp1.cols,0,grayInp2.cols,grayInp2.rows)).copyTo(grayInp2);
// estimate optical flow




相关问题
Using QCView and iSight to capture image

I have a QCView that loads a Quartz file which gives you iSights feedback (basically like a QTCaptureView) Everything displays fine The button simply takes a snapshot using the following simple ...

Taking picture with QTCaptureView

Is it possible to simply take a picture and save it somewhere using a QTCaptureView and Apple s built-in iSight? I ve seen lots of tutorials on recording video but none on simply taking a picture. Any ...

Transform rectangular image into trapezoid

In .NET how can I transform an image into a trapezoid. The Matrix class supports rotation, shear, etc, but I can t see a trapezoidal transformation. I m using the usual System.Drawing.* API, but I m ...

Rotate image through Y-axis on web page

What are my options for rotating an image on a web page through the Y-axis? I m not sure if I even have the terminology right. Is this called a rotate or a transform. Most of the searches that I ve ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

Convert from 32-BPP to 8-BPP Indexed (C#)

I need to take a full color JPG Image and remap it s colors to a Indexed palette. The palette will consist of specific colors populated from a database. I need to map each color of the image to it s "...

热门标签