hough ellipse fit inaccurate?

Arno Dietz arnodietz86 at googlemail.com
Wed Mar 11 06:18:52 EDT 2015


Hi,

ok it seams reasonable that its caused by canny because with other edge 
detection method (starburst) the ellipse fit works fine.
Certainly <http://www.dict.cc/englisch-deutsch/certainly.html> 0.4 px isn't 
too bad. But my aim is a very high accuracy and the outliers are clearly systematic 
<http://www.dict.cc/englisch-deutsch/systematic.html>error 
<http://www.dict.cc/englisch-deutsch/error.html>s so they should 
be avoidable.

Upsampling sounds like a good Idea. I tried it like this:
...
img_upsampled = cv2.resize(img, (0, 0), fx=(8.0), fy=(8.0), interpolation = 
cv2.INTER_CUBIC)
ret, thresh = cv2.threshold(img_upsampled, 20, 255, cv2.THRESH_BINARY_INV)
img = canny(thresh, sigma=3).astype(np.uint8)
img[img > 0] = 255
coords = np.column_stack(np.nonzero(img))
model, inliers = measure.ransac(coords, measure.EllipseModel, 
min_samples=5, residual_threshold=1, max_trials=200)

cx = model.params[1] / 8.0
cy = model.params[0] / 8.0

But there are still a lot of outliers. The upsampled canny image doesn't 
look too good (see image).
I also tried without thresholding and with different interpolation methods 
but without success.

Regards,
Arno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150311/f2b0c1af/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: canny_upsampled.png
Type: image/png
Size: 7627 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150311/f2b0c1af/attachment.png>


More information about the scikit-image mailing list