Qhull error
Juan Nunez-Iglesias
jni.soma at gmail.com
Thu Jun 13 02:52:44 EDT 2013
Hi all. I'm getting the below error when computing regionprops(...,
['Solidity']). Does anyone know what's going on? At first I thought maybe
it was passing a singleton array or something, but this array looks like a
reasonable thing to compute a convex hull on, no?
If I'm not being totally stupid (which is a big if), perhaps we should add
a try/except around the convex hull calculation and return a non-value,
e.g. -1, when the calculation fails?
In [49]: test_im = array([[ 0., 0., 0., 0., 1., 0., 0.],
[ 0., 0., 1., 1., 1., 1., 1.],
[ 1., 1., 1., 0., 0., 0., 0.]], np.int)
In [50]: test_im
Out[50]:
array([[0, 0, 0, 0, 1, 0, 0],
[0, 0, 1, 1, 1, 1, 1],
[1, 1, 1, 0, 0, 0, 0]])
In [51]: measure.regionprops(test_im.astype(int), ['Solidity'])
QH6228
Qhull internal error (qh_findbestlower): all neighbors of facet 8 are
flipped or upper Delaunay.
Please report this error to qhull_bug at qhull.org with the input and all
of the output.
ERRONEOUS FACET:
- f8
- flags: bottom simplicial upperDelaunay
- normal: -0.8366 -0.5167 0.182
- offset: 1.254902
- center: 0.7380952380952381 2.30952380952381 3.054054054054054
- vertices: p30(v6) p56(v3) p28(v0)
- neighboring facets: f3 f23 f22
While executing: | qhull d Qz Qbb Qt
Options selected for Qhull 2010.1 2010/01/14:
run-id 1680623163 delaunay Qz-infinity-point Qbbound-last Qtriangulate
_pre-merge _zero-centrum Pgood _max-width 7 Error-roundoff 9.7e-15
_one-merge 6.8e-14 _near-inside 3.4e-13 Visible-distance 1.9e-14
U-coplanar-distance 1.9e-14 Width-outside 3.9e-14 _wide-facet 1.2e-13
Last point added to hull was p33. Last merge was #1.
At error exit:
Delaunay triangulation by the convex hull of 57 points in 3-d:
Number of input sites and at-infinity: 10
Number of nearly incident points: 10
Number of Delaunay regions: 0
Number of non-simplicial Delaunay regions: 1
Statistics for: | qhull d Qz Qbb Qt
Number of points processed: 10
Number of hyperplanes created: 27
Number of facets in hull: 15
Number of distance tests for qhull: 512
Number of distance tests for merging: 127
Number of distance tests for checking: 0
Number of merged facets: 1
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-51-efe47406d455> in <module>()
----> 1 measure.regionprops(test_im.astype(int), ['Solidity'])
/Users/nuneziglesiasj/venv/husc/lib/python2.7/site-packages/scikit_image-0.9dev-py2.7-macosx-10.5-x86_64.egg/skimage/measure/_regionprops.pyc
in regionprops(label_image, properties, intensity_image)
363 if 'Solidity' in properties:
364 if _convex_image is None:
--> 365 _convex_image = convex_hull_image(array)
366 obj_props['Solidity'] = m[0, 0] / np.sum(_convex_image)
367
/Users/nuneziglesiasj/venv/husc/lib/python2.7/site-packages/scikit_image-0.9dev-py2.7-macosx-10.5-x86_64.egg/skimage/morphology/convex_hull.pyc
in convex_hull_image(image)
52
53 # Find the convex hull
---> 54 chull = Delaunay(coords).convex_hull
55 v = coords[np.unique(chull)]
56
/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/scipy/spatial/qhull.so
in scipy.spatial.qhull.Delaunay.__init__
(scipy/spatial/qhull.c:4109)()
/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/scipy/spatial/qhull.so
in scipy.spatial.qhull._construct_delaunay
(scipy/spatial/qhull.c:1314)()
RuntimeError: Qhull error
> /Users/nuneziglesiasj/Data/images-work/qhull.pyx(172)scipy.spatial.qhull._construct_delaunay (scipy/spatial/qhull.c:1314)()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130613/ca449e7c/attachment.html>
More information about the scikit-image
mailing list