dahtah / imager

R package for image processing
GNU Lesser General Public License v3.0
187 stars 43 forks source link

hough_circle function doesn't work properly #128

Closed ShotaOchi closed 4 years ago

ShotaOchi commented 4 years ago

@dahtah I received an e-mail that reported hough_circle function didn't work properly, and I confirmed it. We can confirm it by running the code shown below.

library(imager)
px <- enorm(imgradient(px.circle(100, 300, 300), "xy")) > 0
hc <- hough_circle(px, 100)
plot(hc)

plot(hc) shows us blank image.

It seems that there is a problem in houghcircle function. https://github.com/dahtah/imager/blob/master/src/hough.cpp#L62-L76

What do you think?

garcia-nacho commented 4 years ago

Same problem here. Even the example doesn't work and it worked before. You can make it work by using the old library:

library(devtools)

install_version("imager", version = "0.41.1", repos = "http://cran.us.r-project.org")

dahtah commented 4 years ago

Thanks for reporting this, something must have changed in CImg. Should be fixed in the latest master, please check!

ShotaOchi commented 4 years ago

Thank you for fixing hough_circle function.