图像算法计数对象 [英] Counting object on image algorithm
本文介绍了图像算法计数对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我再次得到了学校的任务。这个时候,我的老师给我的任务创建的算法对图像计算有多少只鸭子。
I got school task again. This time, my teacher gave me task to create algorithm to count how many ducks on picture.
该画面是与此类似:
我想我应该用模式识别为它寻找有多少只鸭子。但我不知道哪个模式匹配为每个鸭。
I think I should use pattern recognition for searching how many ducks on it. But I don't know which pattern match for each duck.
推荐答案
这里有一种方法:
Hough变换的圆:
Hough transform for circles:
- 在初始化累加器数组索引(X,Y,半径)
- 对于每个像素:
- 计算的边缘(如Sobel算子将同时提供大小和方向),如果幅度超过某个阈值,则:
- 在每次加为蓄电池此边缘可能可能借证(只(X,Y)的边缘的方向,min_duck_radius和max_duck_radius之间只有半径)
- Initialize an accumulator array indexed by (x,y,radius)
- For each pixel:
- calculate an edge (e.g. Sobel operator will provide both magnitude and direction), if magnitude exceeds some threshold then:
- increment every accumulator for which this edge could possibly lend evidence (only the (x,y) in the direction of the edge, only radii between min_duck_radius and max_duck_radius)
所以这是非常简洁的,但它可以让你开始。
So that's very terse, but it can get you started.
这篇关于图像算法计数对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- calculate an edge (e.g. Sobel operator will provide both magnitude and direction), if magnitude exceeds some threshold then:
- 计算的边缘(如Sobel算子将同时提供大小和方向),如果幅度超过某个阈值,则:
查看全文