Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

under teaching/skimage/coin_segmentation_tutorial.ipynb #1

Open
bicepjai opened this issue Nov 10, 2017 · 1 comment
Open

under teaching/skimage/coin_segmentation_tutorial.ipynb #1

bicepjai opened this issue Nov 10, 2017 · 1 comment

Comments

@bicepjai
Copy link

bicepjai commented Nov 10, 2017

under
When i run segmentation.mark_boundaries(distance, labels_ws), i get the following error. any idea why ?

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-140-7170fd3acc8c> in <module>()
      6 markers = morphology.label(local_maxi)
      7 labels_ws = watershed(-distance, markers)
----> 8 plt.imshow(segmentation.mark_boundaries(image, labels_ws))
      9 
     10 # from skimage import color

~/Programs/anaconda3/envs/statoilicc/lib/python3.6/site-packages/skimage/segmentation/boundaries.py in mark_boundaries(image, label_img, color, outline_color, mode, background_label)
    213     find_boundaries
    214     """
--> 215     marked = img_as_float(image, force_copy=True)
    216     if marked.ndim == 2:
    217         marked = gray2rgb(marked)

~/Programs/anaconda3/envs/statoilicc/lib/python3.6/site-packages/skimage/util/dtype.py in img_as_float(image, force_copy)
    334 
    335     """
--> 336     return convert(image, np.float64, force_copy)
    337 
    338 

~/Programs/anaconda3/envs/statoilicc/lib/python3.6/site-packages/skimage/util/dtype.py in convert(image, dtype, force_copy, uniform)
    234     if kind_in == 'f':
    235         if np.min(image) < -1.0 or np.max(image) > 1.0:
--> 236             raise ValueError("Images of type float must be between -1 and 1.")
    237         if kind_out == 'f':
    238             # float -> float

ValueError: Images of type float must be between -1 and 1.
@stefanv
Copy link
Owner

stefanv commented Nov 11, 2017

What versions of skimage and numpy are you on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants