We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Alfredo • 10 months ago

Hi, great job!

Not sure how old this post is, but any chance the author can check the section on "Circle Detection using the Circle Hough Transform", there seem to be some parts missing when your refer a variable, like in "all the possible values for , and ." I suspect there should be something before the comma and the end point, like: ""all the possible values for something, and something."

Fuad fulan • 3 years ago

what library canny must install?
i got error cannot import name 'canny_edge_detector' from 'canny'
i dont know what library canny must i install on pip, please help me

[CG]Maxime • 2 years ago

canny is a file available in this article (see the tabs?)

Shreyas Bhat • 3 years ago

The code works wonderfully, but I wanted to know how to get the number of circles in a given image

BD14 • 3 years ago

I tried this code and it works very well. It's just little slow, and I
need to find a solution to get something faster. I thought to give a
gray image or b&w image, but I don't know how adapt the code for
that. If anyone knows... ? Thank you.

Duha • 3 years ago

Hi , when I run this code I faced this problem -->
( File "C:\Users\Duha\Desktop\Circle-Hough-Transform-master1\canny.py", line 10, in canny_edge_detector
grayscaled = compute_grayscale(input_pixels, width, height)
File "C:\Users\Duha\Desktop\Circle-Hough-Transform-master1\canny.py", line 32, in compute_grayscale
grayscale[x, y] = (pixel[0] + pixel[1] + pixel[2]) / 3
TypeError: 'int' object is not subscriptable)
help me please
Note : I changed just the image

Gflaesch • 3 years ago

Okay, sorry, I was mistaken. The reason is rather whether you have a grayscale image or rgb. in case of rgb grayscale is calculated from the average of the vector entries in pixel. If it is a greyscale image, then pixel is an integeter, such that pixel[0] makes no sense. You can rather just say grayscale[x, y] =pixel.

Gflaesch • 3 years ago

Watch out for the file format. You might have a .tiff file. i don't know whether others cause trouble as well, but I tried the code for a tiff, got the same problem as you. Using .png worked.

Anonymous • 4 years ago

I really appreciate what you did here, it was very helpful to see what is basically the inner workings of the openCV style library.

Durga Prasad • 4 years ago

Hello, i want to find the angle of the inclined line at the tip of the pen using open cv and python. Any help would be appreciated.Thanks in advance

KHUSHI • 2 years ago

hey.. if we want to get the circle count then what should we do? when i run this code i m getting array as an output.. i want the count of circles present in that image. plz hlp me with this ASAP

Ruchika • 5 years ago

the codes given here at https://www.codingame.com/p... are not working offline. anyone having any idea

Thibaud • 4 years ago

If you are running python 2, there is some integer division that will yield zeroes. Notably in the blur kernel or in the if statement line 35 of the last script. Either add a float around v or switch to python 3