计算 MATLAB 中移动的位移
我需要比较两个或多个图像来计算一个点在 x 和 y 方向上移动了多少。我该如何在 MATLAB 中执行此操作?
I need to compare two or more images to calculate how much a point shifted in the x and y direction. How do I go about doing this in MATLAB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找的是“光流”算法。周围有很多,有些更快但不太准确,有些更慢但更准确。
单击此处查找 MATLAB 光流实现 (Lucas Kanade)。
What you are looking for is an "Optical Flow" algorithm. There are many around, some faster but less accurate, some slower and more accurate.
Click here to find a MATLAB optical flow implementation (Lucas Kanade).
Gilads 关于 Lucas-Kanade 跟踪器/光流计算器的建议非常好,也是我会使用的。然而,它确实有一个缺点,如果场景变化太大,它就不能很好地工作。
如果场景确实非常不同(假设您移动并旋转了相机很多),您将不得不以其他方式找到相应的点。一个示例是使用 SIFT 描述符来查找两幅图像中的图像特征,然后确定哪些点彼此对应。如果您知道两个图像的相机矩阵,那么事情就变得非常容易。
Gilads suggestion about a Lucas-Kanade tracker/optical flow calculator is really good, and is what I would use. It does however have the drawback of not working very well if the scene has changed too much.
If the scenes are indeed very different (say you moved and rotated the camera quite a lot) you would have to find your corresponding points in some other way. One example could be to use a SIFT descriptor to find image features in the two images and then determine which points correspond to each other. If you know the camera matrices of the two images then it becomes quite easy.