是否有任何opencv函数,如“cvHoughCircles()”用于方形检测? [英] Are there any opencv function like "cvHoughCircles()" for square detection?

查看:883
本文介绍了是否有任何opencv函数,如“cvHoughCircles()”用于方形检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有像cvHoughCircles()这样的opencv函数可以用于方形检测编程
用于 CvSeq * circles = cvHoughCircles()的圆检测程序,但我不能找到方形检测。

Are there any opencv function like "cvHoughCircles()" that can use for square detection programming for circle detection program that is CvSeq* circles = cvHoughCircles() but i couldn't find for square detection.

推荐答案

您不需要任何单独的函数。 OpenCV带有方形检测样本(它实际上检测矩形,你可以添加约束,所有边长度应该相等,以得到正方形)。

You don't need any separate function for that. OpenCV comes with square detection sample( which actually detects rectangles, you can add constraint that all sides should be equal in length to get square).

检查此链接: squares.cpp

这个代码在这个SOF中的工作原理有很好的解释:如何使用javacv来识别具有可变长度和宽度的正方形或矩形?

There is a good explanation on how this code works in this SOF : How to identify square or rectangle with variable lengths and width by using javacv?

以下是应用该代码时获得的结果。

Below is the result you get when apply that code.

这篇关于是否有任何opencv函数,如“cvHoughCircles()”用于方形检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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