
This is all very weird. Stefan, no, I didn't figure it out, I just implemented my proposal of having a try/except around it and setting it to 1.1 if the error came up! =) It was a minority of my objects and I chuck out outliers anyway... Chintak's finding suggests a more Pull-Requestable way forward... =) On Wed, Jul 10, 2013 at 2:52 PM, Chintak Sheth <chintaksheth@gmail.com>wrote:
Hi Juan,
I tried computing `convex_hull_image` of `test_im` directly and as expected got the error you posted above.
Then I tried to run `regionprops` on the `test_im` padded with 0s. This again threw the same error. But oddly so, direct computation of `convex_hull_image` of padded `test_im` does give a result! In spite of the traceback showing that the problem originated in `convex_hull_image` function.
At least for the purposes of your problem you can probably compute the Solidity manually here.
``` In [27]: a = np.zeros((5,9), int)
In [28]: a Out[28]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]])
In [29]: a[1:-1, 1:-1] = test_im
In [30]: a Out[30]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]])
In [31]: b = convex_hull_image(a).astype(int)
In [32]: b Out[32]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]])```
Thanks, Chintak
-- 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/groups/opt_out.
participants (1)
-
Juan Nunez-Iglesias