Re: hough ellipse fit inaccurate?
@Stefan, good idea! I am curious to know whether this solves your problem.
On Mar 10, 2015, at 2:49 PM, Stéfan van der Walt <stefanv@berkeley.edu> wrote:
It may be a good idea to upsample your image before doing canny, because edges lie in between pixels, and can only be accurately marked with enough resolution.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
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
Hi Arno On Wed, Mar 11, 2015 at 3:18 AM, Arno Dietz <arnodietz86@googlemail.com> wrote:
ok it seams reasonable that its caused by canny because with other edge detection method (starburst) the ellipse fit works fine. Certainly 0.4 px isn't too bad. But my aim is a very high accuracy and the outliers are clearly systematic errors so they should be avoidable.
Do you suspect that there is something wrong with our implementation of Canny? Or can it be improved? If so, it would be well worth investigating further! Stéfan
participants (3)
-
Arno Dietz
-
Johannes Schoenberger
-
Stéfan van der Walt