kandi background

scikit-image | Image processing in Python | Computer Vision library

Download this library from

kandi X-RAY | scikit-image Summary

scikit-image is a Python library typically used in Artificial Intelligence, Computer Vision, OpenCV, Numpy applications. scikit-image has no bugs, it has no vulnerabilities, it has build file available and it has medium support. However scikit-image has a Non-SPDX License. You can install using 'pip install scikit-image' or download it from GitHub, PyPI.
Image processing in Python

kandi-support Support

  • scikit-image has a medium active ecosystem.
  • It has 4784 star(s) with 1961 fork(s). There are 184 watchers for this library.
  • There were 3 major release(s) in the last 6 months.
  • There are 138 open issues and 2051 have been closed. On average issues are closed in 340 days. There are 187 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of scikit-image is v0.19.1

quality kandi Quality

  • scikit-image has 0 bugs and 0 code smells.

securitySecurity

  • scikit-image has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • scikit-image code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.

license License

  • scikit-image has a Non-SPDX License.
  • Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

buildReuse

  • scikit-image releases are available to install and integrate.
  • Deployable package is available in PyPI.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • scikit-image saves you 24051 person hours of effort in developing the same functionality from scratch.
  • It has 54306 lines of code, 3630 functions and 609 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
Top functions reviewed by kandi - BETA

kandi has reviewed scikit-image and discovered the below as its top functions. This is intended to give you an instant insight into scikit-image implemented functionality, and help decide if they suit your requirements.

  • Compute the region properties of the image .
  • Calculate RANSAC .
  • Slice an image .
  • Random walker .
  • Image decomposition .
  • Warp an image .
  • Compute structural similarity between two images .
  • Generate an active contour .
  • Unsupervisedwiener .
  • Dynamically plot an image .

scikit-image Key Features

Image processing in Python

scikit-image Examples and Code Snippets

  • Installation from source
  • Python Script on Startup:: ValueError:numpy.ndarray size changed, may indicate binary incompatibility. Expected 48 from C header, got 40 from PyObject
  • Using plotly express to show image and plot with animation
  • How do skimage.morphology.remove_small_holes and skimage.morphology.remove_small_objects differ?
  • How does skimage.segmentation.slic achieve segmentation under non-binary masks?
  • How to make conda use its own gcc version?
  • UnsatisfiableError on importing environment pywin32==300 (Requested package -> Available versions)
  • Issue in Python version after installing PySpark
  • How to install bob python toolkit with docker?
  • Docker: Cannot install specific pip packages
  • scikit-image color.rgb2gray warning

Installation from source

pip install -r requirements.txt

Community Discussions

Trending Discussions on scikit-image
  • How to import Skimage to segment an image with watershed?
  • Python Script on Startup:: ValueError:numpy.ndarray size changed, may indicate binary incompatibility. Expected 48 from C header, got 40 from PyObject
  • Using plotly express to show image and plot with animation
  • ModuleNotFoundError: No module named 'skimage.measure.simple_metrics'
  • How do skimage.morphology.remove_small_holes and skimage.morphology.remove_small_objects differ?
  • How to find the intersection between 2 skimage.measure.LineModelND objects?
  • How does skimage.segmentation.slic achieve segmentation under non-binary masks?
  • Is there an alternative to Numba for functions that use many features not supported by Numba?
  • Solving conda environment stuck
  • How to make conda use its own gcc version?
Trending Discussions on scikit-image

QUESTION

How to import Skimage to segment an image with watershed?

Asked 2022-Mar-14 at 01:01

I'm trying to use Skimage to segment an image with watershed, but I always get this error. Do you have a solution please?

AttributeError: module 'skimage.morphology' has no attribute 'watershed'

Source code : https://scikit-image.org/docs/0.12.x/auto_examples/xx_applications/plot_coins_segmentation.html

import numpy as np
import matplotlib.pyplot as plt
import cv2

from skimage.feature import canny
from scipy import ndimage as ndi
from skimage import morphology
from skimage.filters import sobel
from skimage import data
from skimage.color import label2rgb


coins = data.coins()
hist = np.histogram(coins, bins=np.arange(0, 256))

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 3))
ax1.imshow(coins, cmap=plt.cm.gray, interpolation='nearest')
ax1.axis('off')
ax2.plot(hist[1][:-1], hist[0], lw=2)
ax2.set_title('histogram of grey values')

    # Threshold
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(6, 3), sharex=True, sharey=True)
ax1.imshow(coins > 100, cmap=plt.cm.gray, interpolation='nearest')
ax1.set_title('coins > 100')
ax1.axis('off')
ax1.set_adjustable('box')
ax2.imshow(coins > 150, cmap=plt.cm.gray, interpolation='nearest')
ax2.set_title('coins > 150')
ax2.axis('off')
ax2.set_adjustable('box')
margins = dict(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, right=1)
fig.subplots_adjust(**margins)


elevation_map = sobel(coins)

fig, ax = plt.subplots(figsize=(4, 3))
ax.imshow(elevation_map, cmap=plt.cm.gray, interpolation='nearest')
ax.axis('off')
ax.set_title('elevation_map')

markers = np.zeros_like(coins)
markers[coins < 30] = 1
markers[coins > 150] = 2

fig, ax = plt.subplots(figsize=(4, 3))
ax.imshow(markers, cmap=plt.cm.Spectral, interpolation='nearest')
ax.axis('off')
ax.set_title('markers')


segmentation = morphology.watershed(elevation_map, markers)

fig, ax = plt.subplots(figsize=(4, 3))
ax.imshow(segmentation, cmap=plt.cm.gray, interpolation='nearest')
ax.axis('off')
ax.set_title('segmentation')


segmentation = ndi.binary_fill_holes(segmentation - 1)
labeled_coins, _ = ndi.label(segmentation)
image_label_overlay = label2rgb(labeled_coins, image=coins)

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(6, 3), sharex=True, sharey=True)
ax1.imshow(coins, cmap=plt.cm.gray, interpolation='nearest')
ax1.contour(segmentation, [0.5], linewidths=1.2, colors='y')
ax1.axis('off')
ax1.set_adjustable('box')
ax2.imshow(image_label_overlay, interpolation='nearest')
ax2.axis('off')
ax2.set_adjustable('box')

fig.subplots_adjust(**margins)

plt.show()

Error on line : segmentation = morphology.watershed(elevation_map, markers)

ANSWER

Answered 2022-Mar-14 at 01:01

You are for some reason looking at the old documentation for scikit-image, version 0.12. (See the 0.12.x in the URL that you shared.) You can look at the examples for the latest released version at:

https://scikit-image.org/docs/stable/auto_examples/

Concretely for your code, you need to update the import to from skimage.segmentation import watershed.

Source https://stackoverflow.com/questions/71461134

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install scikit-image

Also see installing scikit-image.
Debian/Ubuntu: sudo apt-get install python-skimage
OSX: pip install scikit-image
Anaconda: conda install -c conda-forge scikit-image
Then, install scikit-image using:.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

Build your Application

Share this kandi XRay Report