如何识别此图像中的矩形? [英] How to recognize rectangles in this image?

查看:1064
本文介绍了如何识别此图像中的矩形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个水平和垂直线的图像。其实这张图片是BBC网站改成水平和垂直线的。
我的问题是,我想要能够找到图像中的所有矩形。我想写一个计算机程序找到所有的矩形。
有谁知道如何做到这一点或建议如何开始的想法?这个任务对我来说很容易找到可视矩形,但我不知道如何描述它作为一个程序。

I have a image with horizontal and vertical lines. In fact, this image is the BBC website converted to horizontal and vertical lines. My problem is that I want to be able to find all the rectangles in the image. I want to write a computer program to find all the rectangles. Does anyone know how to do this or suggest ideas on how to get started? This task is easy for me as a person to find the visual rectangles, but I am not sure how to describe it as a program.

图片是BBC的网站在这里< a href =http://www.bbc.co.uk/ =nofollow noreferrer> http://www.bbc.co.uk/

Image is the BBC website here http://www.bbc.co.uk/

感谢,菲利普

更新到这里,我写了一个代码,将BBC网站图片转换为水平和垂直线,问题是这些线不完全在角落处相遇,有时它们不完全形成矩形。谢谢!

Update to this, I wrote the code which converts the BBC website image to the horizontal and vertical line, the problem is these lines do not completely meet at the corners and sometimes they do not completely form a rectangle. Thanks!

推荐答案

Opencv (c中的图像处理和计算机视觉库)具有hough变换的实现(简单的hough变换在图像中查找线,而广义的找到更复杂的对象),这样可以是一个好的开始。对于有闭合角的矩​​形,还有角落检测器,如可以帮助的cornerHarris。

Opencv (image processing and computer vision library written in c) has implementation for hough transform (the simple hough transform find lines in an image, while the generalized one finds more complex objects) so that could be a good start. For the rectangles which do have closed corners there are also corner detectors such as cornerHarris which can help.

我运行opencv提供的houghlines演示,这里是图像上的结果你给了(红色标记的检测到的行):

I ran the houghlines demo provided with opencv and here's the result on the image you gave (detected lines marked in red):

这篇关于如何识别此图像中的矩形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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