[scikit-image] Fitting Ellipse Model

Surya Kasturi suryak at udel.edu
Sun Jun 11 23:59:55 EDT 2017


Hi,

I am trying to understand how measure.EllipseModel is working. Following is the snippet.

x1, y1, a1, b1 = 3, 3, 20, 40
rr1, cc1 = draw.ellipse_perimeter(x1, y1, a1, b1) # some ellipse

# Estimate ellipse model with the above points
model = EllipseModel()
model.estimate(np.array([rr1,cc1]).T)
x2, y2, a2, b2, theta = np.array(model.params, dtype=int)
rr2, cc2 = draw.ellipse_perimeter(x2, y2, a2, b2, orientation=theta) # estimated ellipse

ax.scatter(rr1, cc1, s=5, label="actual")
ax.scatter(rr2, cc2, s=5, label="estimated")


The below is output. Shouldn’t both ellipses in the image overlap since I’m using data points of a perfect ellipse to estimate a new ellipse?



Thanks
Surya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20170611/50962f16/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-06-11 at 11.56.31 PM.png
Type: image/png
Size: 33091 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20170611/50962f16/attachment-0001.png>


More information about the scikit-image mailing list