找到一张图像相对于另一张图像的旋转

发布于 2024-10-08 13:17:21 字数 74 浏览 9 评论 0原文

我有 2 张图片。一个是参考图像,另一个是参考图像的旋转版本。我想知道第二张图像相对于第一张图像旋转的角度是多少。我想自动执行此操作。

I have 2 images. One is the reference image and the other is the rotated version of the reference image. I would like to find what is the angle by which the 2nd image is rotated wrt 1st one.i want to do this automatically.

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

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

发布评论

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

评论(5

心舞飞扬 2024-10-15 13:17:21

暴力破解吧!编写一个函数来比较旋转图像的交集(每个点之间的差值之和或差值平方和),然后迭代旋转角度以找到与最小差值对应的角度。

虽然知道matlab可能有一个函数只告诉你旋转,但它的名字很奇怪。

Brute-force it! Write a function to compare the intersection of the rotated images (sum of the difference or sum of the difference squared between each point), and then iterate through rotation angles to find the one corresponding to the minimum difference.

Although knowing matlab there's probably a function that just tells you the rotation, but it's called something weird.

玩物 2024-10-15 13:17:21

执行此操作的一般方法是:

理想情况下,所有匹配的兴趣点都将具有相同的相对比例和旋转。然而,图片拍摄方式的可变性和前一阶段的不准确性会引入可变的比例和旋转,因此:

  • 使用诸如 RANSAC 确定最适合的比例和旋转。

量子电动力学

The general method for doing this is:

  • Use an algorithm such as SIFT to get a list of interest-point descriptors. These descriptors provide scale, direction and geometry of the interest points. The geometry information is scale- and rotation-invariant.

  • Use a nearest-neighbor algorithm to match interest points in each of the pictures by comparing geometries.

  • for each pair of matching interest points, compare their scale and rotation.

Ideally, all of the matching interest points will have the same relative scale and rotation. However, variability in how the pictures were taken and inaccuracy in the previous stages will introduce variable scales and rotations, so:

  • use an algorithm such as RANSAC to determine the best-fitting scale and rotation.

QED

酷炫老祖宗 2024-10-15 13:17:21

注意:由于该问题最初并未要求自动化解决方案,因此我发布了此解决方案,该解决方案需要用户为每个图像选择一组控制点。虽然问题中的要求已经更新,但我认为这个答案对于任何想要在 MATLAB 中进行图像配准的人仍然有用,所以我将其留在这里......

非自动化方法:

您所询问的内容称为图像注册,您可以选择使用来自 CP2TFORM 的函数/www.mathworks.com/help/toolbox/images/" rel="nofollow">图像处理工具箱。

事实上,有一个非常好的例子该函数的文档看起来它解决了您试图解决的相同问题。

NOTE: Since the question did not originally ask for an automated solution, I had posted this solution which requires a set of control points to be selected by the user for each image. Although the requirements in the question have been updated, I think this answer could still be useful for anyone wanting to do image registration in MATLAB, so I'm leaving it here...

The non-automated approach:

What you're asking about is known as image registration, and one option you have is to use the function CP2TFORM from the Image Processing Toolbox.

In fact, there's a very nice example in that function's documentation which looks like it tackles the same exact problem you're trying to solve.

无敌元气妹 2024-10-15 13:17:21

Here is an example of how to recover a transformation between two images using local features and RANSAC from the Computer Vision System Toolbox.

柳絮泡泡 2024-10-15 13:17:21

这是代码。

http://www.mathworks.com/matlabcentral /fileexchange/1713- Three-Dimensional-reconstruction-from-planar-slices

该算法使用两个对象是圆形的先验知识。青年MMV

Here is the code.

http://www.mathworks.com/matlabcentral/fileexchange/1713-three-dimensional-reconstruction-from-planar-slices

This algorithm use apriori knowledge that the two objects are round. YMMV

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