hough ellipse fit inaccurate?

Arno Dietz arnodietz86 at googlemail.com
Wed Mar 4 18:49:52 EST 2015


 Ok sorry. Here is my code:

from skimage import color
> from skimage.filter import canny
> from skimage.transform import hough_ellipse
> from skimage.draw import ellipse_perimeter
> from skimage import io
> from skimage.viewer import ImageViewer
> # load image
> img = io.imread('ellipse.png')
> cimg = color.gray2rgb(img)
> # edges and ellipse fit
> edges = canny(img, sigma=0.1, low_threshold=0.55, high_threshold=0.8)
> result = hough_ellipse(edges, accuracy=4, threshold=25, min_size=47, 
> max_size=60)
> result.sort(order='accumulator')
> # Estimated parameters for the ellipse
> best = result[-1]
> yc = int(best[1])
> xc = int(best[2])
> a = int(best[3])
> b = int(best[4])
> orientation = best[5]
> # Draw the ellipse on the original image
> cy, cx = ellipse_perimeter(yc, xc, a, b, orientation)
> cimg[cy, cx] = (0, 0, 255)
> # Draw the edge (white) and the resulting ellipse (red)
> edges = color.gray2rgb(edges)
> edges[cy, cx] = (250, 0, 0)
> viewer = ImageViewer(edges)
> viewer.show()


I noticed, that the ellipse center is detected only in half pixel accuracy. 
Maybe this is the Problem? Is there a possibility to get the ellipse center 
with sub-pixel accuracy?

regards Arno 

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150304/81533ee8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ellipse.png
Type: image/png
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150304/81533ee8/attachment.png>


More information about the scikit-image mailing list