在图像中找到扭曲的矩形(OpenCV) [英] Find distorted rectangle in image (OpenCV)

查看:323
本文介绍了在图像中找到扭曲的矩形(OpenCV)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找合适的算法来解决这个图像处理问题:

I am looking for the right set of algorithms to solve this image processing problem:


  • 我有一个包含失真的扭曲二进制图像矩形

  • 我需要找到这个矩形的4个角点的良好近似值

我可以使用OpenCV计算轮廓,但是由于图像失真,它通常包含4个以上的角点。
是否有一个很好的近似算法(最好使用OpenCV操作)使用二进制图像或轮廓描述找到矩形角点?

I can calculate the contour using OpenCV, but as the image is distorted it will often contain more than 4 corner points. Is there a good approximation algorithm (preferably using OpenCV operations) to find the rectangle corner points using the binary image or the contour description?

图像看起来像这个:

谢谢!

Dennis

推荐答案

使用 cvApproxPoly 功能消除轮廓的节点数,然后过滤掉那些节点太多或角度与90度大不相同的轮廓。另请参阅类似的答案

Use cvApproxPoly function to eliminate number of nodes of your contour, then filter out those contours that have too many nodes or have angles which much differ from 90 degrees. See also similar answer

这篇关于在图像中找到扭曲的矩形(OpenCV)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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