Is there a problem with the function points_in_poly ? measure.points_in_poly

Johannes Schoenberger jsch at demuc.de
Thu Dec 4 13:19:07 EST 2014


The docs say `points` must be a (N, 2) array. You pass a (2, ) array.

Make it: ``skimage.measure.points_in_poly(np.array([[0,0]]),cont2)``

> On Dec 4, 2014, at 1:05 PM, Julien Derr <julien.derr at gmail.com> wrote:
> 
> Hi everyone, 
> 
> I would like to use the function points_in_poly to test if the point x,y is in the contour cont2
> x=0 y=0, but I have the problem with any value of x and y:
> 
> skimage.measure.points_in_poly(np.array([x,y]),cont2)  where cont2 is a contour of type  array :
> but I get the following error:  "IndexError: invalid index"
> 
> it is a little obscure for me, is there a problem with this function, or is it me who don't know how to apply it ?
> 
> thanks a lot!
> 
> Julien
> 
> 
> 
> 
> cont2        ndarray    7879x2: 15758 elems, type `float64`, 126064 bytes (123 kb)
> 
> In [12]: skimage.measure.points_in_poly(np.array([0,0]),cont2)
> ---------------------------------------------------------------------------
> IndexError                                Traceback (most recent call last)
> /home/julien/Dropbox/density_seiche/<ipython-input-12-2271d0f2b0ba> in <module>()
> ----> 1 skimage.measure.points_in_poly(np.array([0,0]),cont2)
> 
> /usr/local/lib/python2.7/dist-packages/scikit_image-0.11dev-py2.7-linux-x86_64.egg/skimage/measure/_pnpoly.so in skimage.measure._pnpoly.points_in_poly (skimage/measure/_pnpoly.c:2397)()
> 
> IndexError: invalid index
> 
> 
> -- 
> 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 at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.




More information about the scikit-image mailing list