关于opencv中的霍夫圆变换的理解
发布日期:2022-01-31 02:37:27 浏览次数:34 分类:技术文章

本文共 2249 字,大约阅读时间需要 7 分钟。

详情见下面的引文,其实opencv中 a = x1 – Rcosθb = y1 – Rsinθ
这个式子中是不知道R,知道 cosθ的值(这里的余弦和正弦是指定点的)可以通过计算指定点的sobel梯度来得到,(也就是x1,y1和 θ已经限定了)然后R开始慢慢增加,得到一组(a,b)的值,接下来就和线变换一样了,也是累加器的运用
Here I’ll tell you how to detect circles (which are quite important in computer vision application) using a technique similar to the standard Hough transform. This article assumes you know how the Hough transform works, or you’ve understood the previous articles in this series (The Hough Transform).The parameterizationA circle can be described completely with three pieces of information: the center (a, b) and the radius. (The center consists of two parts, hence a total of three)x = a + Rcosθy = b + RsinθWhen the θ varies from 0 to 360, a complete circle of radius R is generated.So with the Circle Hough Transform, we expect to find triplets of (x, y, R) that are highly probably circles in the image. That is, we want to find three parameters. Thus, the parameter space is 3D… meaning things can get ugly if you don’t tread slowly. Out of memory errors are common even if your programming language uses virtual memory.So we’ll start simple.Assuming R is knownTo begin, we’ll start with the assumption that you’re looking for circles of a particular radius, that is, R is known. The equation of each circle is:x = a + Rcosθy = b + RsinθSo, every point in the xy space will be equivalent to a circle in the ab space (R isn’t a parameter, we already know it). This is because on rearranging the equations, we get:a = x1 – Rcosθb = y1 – Rsinθfor a particular point (x1, y1). And θ sweeps from 0 to 360 degrees.So, the flow of events is something like this:Load an imageDetect edges and generate a binary imageFor every ‘edge’ pixel, generate a circle in the ab spaceFor every point on the circle in the ab space, cast ‘votes’ in the accumulator cellsThe cells with greater number of votes are the centersWhen R is not knownWhen the radius is not known, the simplest solution is to just guess. Assume R = 1, and then run the same algorithm. Then assume R = 2, and run it again. Assume R = 3…. and so on.Whats the upper limit of R? A safe limit would be the length of the diagonal of the image. No possible circle on the image can have a radius greater than or equal to the diagonal.

转载地址:https://blog.csdn.net/LJH0600301217/article/details/8666810 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:sprintf( char *buffer, const char *format, [ argument] … );
下一篇:opencv第四章第二题

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月22日 12时46分33秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

什么是服务熔断? 2019-04-27
服务器压力过大?CPU打满?我来帮你快速检查Linux服务器性能 2019-04-27
C++面经总结之《Effective C++》(一) 2019-04-27
C++面经总结之《Effective C++》(二) 2019-04-27
这是什么“虎狼之词”啊!!!程序员的健康问题,看一线老中医怎么说!!! 2019-04-27
打开我的收藏夹 -- Python数据分析杂谈 2019-04-27
上手Pandas,带你玩转数据(1)-- 实例详解pandas数据结构 2019-04-27
上手Pandas,带你玩转数据(2)-- 使用pandas从多种文件中读取数据 2019-04-27
上手Pandas,带你玩转数据(3)-- pandas数据存入文件 2019-04-27
爬虫遇上不让右击、不让F12的网站,该怎么办? 2019-04-27
上手Pandas,带你玩转数据(4)-- 数据清洗 2019-04-27
上手Pandas,带你玩转数据(5)-- 数据转换与数据定位 2019-04-27
上手Pandas,带你玩转数据(6)-- 摆脱对pandas可视化丑图的刻板印象吧 2019-04-27
从零开始,学会Python爬虫不再难!!! -- (1)开篇:初识爬虫,基础铺垫 丨蓄力计划 2019-04-27
从零开始,学会Python爬虫不再难!!! -- (2)承接:解析网页,抓取标签 丨蓄力计划 2019-04-27
AttributeError: module ‘urllib‘ has no attribute ‘quote‘的解决办法 2019-04-27
linux shell — 6.初识 EXT2 文件系统 2019-04-27
Java — String(字符串) 2019-04-27
linux shell — 7.linux 磁盘与文件系统管理 2019-04-27
linux shell — 8.linux 磁盘与文件系统管理(2) 2019-04-27