如何找到图像移动的像素量?

发布于 2024-09-12 17:10:01 字数 687 浏览 8 评论 0原文

我试图计算从固定相机捕获的每个连续图像中对象移动了多少。我们在这里测试的是每次将对象放置在同一位置的设置的可重复性。

该物体的中心有一个印记,上面有一个简单的形状(见下文)。相机的视野只有几平方毫米(~25)。图像中可能还有其他伪影需要清除,但我目前所能展示的只是一张简单的图画。

模板

我想要计算的是每张图像中线条相交位置与前一张图像相比的偏移量。在下图中,红线代表第二张图像中线相交的位置,即。他们已经移动了多远。

问题

我的问题是,使用图像识别 C# 库,最好是 EmguCV,如何计算绿色矩形的尺寸(偏移量)?我遵循了 Emgu 的一些教程,通过精明的转换,该软件只能检测到两条线,但我对如何到达它们相交的位置一无所知,因为该库创建了 500 多条迷你线,而不是 2 条长线。

如有任何帮助、想法和建议,我们将不胜感激。谢谢!

I am trying to calculate by how much an object has moved in each consecutive image captured from a stationary camera. What we're testing here is the repeatability of our setup to place an object in the same place each time.

The object in question has a stamp placed on its center that has a simple shape on it (see below). The camera only has a view of a few square millimeters(~25). There might be other artifacts in the image that will need to be cleared up, but all I can show currently is just a simple drawing.

Template

What I am trying to calculate is the offset of where the lines intersect in each image compared to the previous one. In the picture below, the red lines represent where the lines intersect in the 2nd image, ie. how far they have moved.

Problem

My question is, using an image recognition C# library, preferably EmguCV, how can I calculate the dimensions of the green rectangle(the offset)? I have followed a few of Emgu's tutorials, and through canny conversions the software is able to detect just the two lines, but I am clueless as to how to get where they intersect as the library creates over 500 mini lines instead of 2 long ones.

Any help, ideas, and suggestions are appreciated. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

街角迷惘 2024-09-19 17:10:01

作为旁注,如果您正在进行大量像素调整,您可能需要认真考虑使用“不安全”属性 - 这将阻止运行时验证对像素数组的每个订阅访问,这将使您回到本机性能范围 - 否则,你的算法将运行得非常慢wwwwwwllllllyyyyyy :-)

As a side note, if you're doing a lot of pixel twiddling, you may want to seriously consider the use of the 'unsafe' attribute - this will stop the runtime from validating each subscriped access to the pixel array, which will get you back into native performance range - otherwise, your algs will run very slooowwwwwwllllllyyyyyy :-)

姜生凉生 2024-09-19 17:10:01

您需要研究“图像跟踪”算法,例如均值漂移算法: http://en.wikipedia.org/wiki/Mean-shift

You'll want to look into "image tracking" algorithms, like for example the mean-shift algorithm: http://en.wikipedia.org/wiki/Mean-shift.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文