# HoughCircles votes output in python?

**URL:** <https://forum.opencv.org/t/houghcircles-votes-output-in-python/6290>\
**Category:** Python\
**Created:** [November 18, 2021, 2:25pm UTC](https://forum.opencv.org/t/houghcircles-votes-output-in-python/6290 "2021-11-18T14:25:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nanopete](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nanopete](https://forum.opencv.org/u/nanopete)\
**Post date:** [November 18, 2021, 2:25pm UTC](https://forum.opencv.org/t/houghcircles-votes-output-in-python/6290/1 "2021-11-18T14:25:04Z")

</div>

Hi, I always only get x,y,r as output for HoughCircles.  
How do I get the votes as the fourth element as well?  
I have tried to put “circles” argument as an empty np float32 array of size (1,10,4) when I would normally get the same of size (1,10,3) when not giving the circles argument.  
But then I only get very odd numbers out in that array.  
Thank you.

---

<div class="post-metadata">

**Author:** ![furas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/furas/32/706_2.png) [@furas](https://forum.opencv.org/u/furas)\
**Post date:** [November 20, 2021, 1:53am UTC](https://forum.opencv.org/t/houghcircles-votes-output-in-python/6290/2 "2021-11-20T01:53:16Z")

</div>

What `votes` ? `HoughCircles` always gives only 3 values.

And if you use too big array `(1,10,4)` then probably it puts values in wrong places.

It may first create flat list with all values and later reformat it to `(1,10,4)`.

* * *

Source code in [hough.cpp](https://github.com/npinto/opencv/blob/master/modules/imgproc/src/hough.cpp#L1006) shows `sizeof(float)*3` in many places - so it uses only 3 values.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [November 20, 2021, 7:36am UTC](https://forum.opencv.org/t/houghcircles-votes-output-in-python/6290/3 "2021-11-20T07:36:05Z")

</div>

@furas, you’re looking at an outdated clone of the openv code (bad link, that’s from 2012 !)  
the real stuff is here:

> <https://github.com/opencv/opencv/blob/4.x/modules/imgproc/src/hough.cpp#L2254>

but unfortunately, this feature might not be available in the python api ;[

---

<div class="post-metadata">

**Author:** ![nanopete](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nanopete](https://forum.opencv.org/u/nanopete)\
**Post date:** [November 23, 2021, 1:27pm UTC](https://forum.opencv.org/t/houghcircles-votes-output-in-python/6290/4 "2021-11-23T13:27:59Z")

</div>

Thank you, I feared that 🙂
