Digitization errors in small circles

Adam Hughes hughesadam87 at gmail.com
Mon Feb 17 20:40:33 EST 2014


On Monday, February 17, 2014 8:14:10 PM UTC-5, Juan Nunez-Iglesias wrote:
>
> Your first error is the circularity of a square of side 1, which according 
> to your formula should be 4 * pi * 1 / (4^2) = pi / 4 ≈ 0.785.
>

Doh!  Duh, right.
 

>
> I don't know anything about the Canvas object so I'll let others comment 
> on the rest, but clearly this is very dependent on how perimeter is 
> computed: are we computing the perimeter of a polygon with the boundary 
> vertices of the rasterization, or the perimeter along the (square) pixel 
> boundaries, or the *convex* polygon enveloping the rasterized circle? Based 
> on your numbers, I'd bet on one of the first two. Again, I'll let someone 
> else deal with the correctness of the approach. =)
>

Canvas is actually just wrapping skimage.draw and region_props, so it uses 
the same rasterization that scikit image uses when a user draws a circle. 
 Here's an example that uses pure scikit:

http://nbviewer.ipython.org/github/hugadams/pyparty/blob/digitiaztion_help/examples/Notebooks/_digitization_compliment.ipynb

I'm pretty sure that the results in the canvas are correct for the plotted 
circularity.  Assuming that the calls to skimage.draw() are correct, would 
you know which *perimeter* of the methods you listed would be returned by 
region_props?
 
Thanks Juan


> Juan.
>
>
>
> On Tue, Feb 18, 2014 at 11:35 AM, Adam Hughes <hughes... at gmail.com<javascript:>
> > wrote:
>
>> Hi,
>>
>> I was trying to measure the circularity as a function of circle radius 
>> using the underlying circle object from skimage.draw().  I got some strange 
>> results, and tried to outline the exercise as well as the confusing outcome 
>> in a notebook.  Essentially, the circularity as a function of particle 
>> radius does not seem to converge to 1.0, and in addition, at very small 
>> radii, the circularity does not agree with what one would expect from the 
>> circularity of a pixel (ie rectangle).
>>
>> I was hoping that an expert could have a glance at the notebook and offer 
>> some feedback?  Hoping that I made an obvious mistake or assertion 
>> somewhere.
>>
>> The notebook actually uses my "pyparty" library that I posted a while 
>> back for drawing and storing the descriptors; however, I verified that 
>> these are the same descriptors that one gets using skimage.labels() 
>> directly (this is not show in the notebook).
>>
>> Here's the static view:
>>
>>
>> http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/digitization.ipynb
>>
>> Thanks.
>>
>> -- 
>> 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... at googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20140217/1cb2ac93/attachment.html>


More information about the scikit-image mailing list