从 OpenCV 中的 findHomography 中检测垃圾单应性? [英] Detecting garbage homographies from findHomography in OpenCV?

查看:24
本文介绍了从 OpenCV 中的 findHomography 中检测垃圾单应性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在点列表上使用 findHomography 并将结果发送到 warpPerspective.

I'm using findHomography on a list of points and sending the result to warpPerspective.

问题是有时结果是完全垃圾,结果图像由奇怪的灰色矩形表示.

The problem is that sometimes the result is complete garbage and the resulting image is represented by weird gray rectangles.

如何检测 findHomography 何时向我发送错误结果?

How can I detect when findHomography sends me bad results?

推荐答案

您可以对输出执行几个健全性测试.在我的头顶上:

There are several sanity tests you can perform on the output. On top of my head:

  1. 计算单应性的行列式,看看它是否太接近于零而不舒适.
  2. 更好的是,计算它的 SVD,并验证第一个奇异值与最后一个奇异值的比率价值是理智的(不太高).任一结果都会告诉您矩阵是否接近单数.
  3. 计算图像角及其中心的图像(即您在您将单应性应用于那些角落和中心),并验证它们是否有意义,即它们是否在图像画布内(如果您希望它们在)?他们分开了吗从彼此?
  4. 在 matlab/octave 中绘制您拟合单应性的输出(数据)点,沿使用单应性从输入值中计算出它们的值,并验证它们接近(即错误很低).

导致垃圾结果的常见错误是输入和输出点列表的排序不正确,这会导致拟合例程使用错误的对应关系工作.检查您的索引是否正确.

A common mistake that leads to garbage results is incorrect ordering of the lists of input and output points, that leads the fitting routine to work using wrong correspondences. Check that your indices are correct.

这篇关于从 OpenCV 中的 findHomography 中检测垃圾单应性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆