Skip to content

Instantly share code, notes, and snippets.

@tinku99
Last active December 5, 2019 21:25
Show Gist options
  • Select an option

  • Save tinku99/cd39bfed85e6bafcedf7a390e51c2430 to your computer and use it in GitHub Desktop.

Select an option

Save tinku99/cd39bfed85e6bafcedf7a390e51c2430 to your computer and use it in GitHub Desktop.
from skimage.viewer import ImageViewer
from skimage.viewer.widgets import Slider
from skimage import data
from skimage.viewer.plugins.lineprofile import LineProfile
image = data.camera()
viewer = ImageViewer(image)
plugin = Plugin(image_filter=lambda img,
threshold: img > threshold)
plugin += Slider('threshold', 0, 255)
lpaint = LabelPainter()
viewer += plugin
viewer += LineProfile()
viewer += lpaint
processed = viewer.show()[0][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment