Skip to content

Barebone tools for interactive image scribbles on python

License

Notifications You must be signed in to change notification settings

lorenzocerrone/scarabocchi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scarabocchi

Barebone tools for interactive image scribbles on python

Alt Text

Requirements

  • numpy
  • matplotlib
  • skimage

Usage

Run the annotation tools:

from scarabocchi.scarabocchi import scribbles_tools2d
from skimage.data import astronaut

# Simple annotator example
annotator = scribbles_tools2d(img=astronaut(), figsize=(10, 10))
  • Paint scribbles by mouse click and move on the image.
  • Use digits or up-down arrows to select new labels.
  • remove scribble with r.
  • new random color map with t.

Annotator

The annotator object contains all labels information:

  • a label mask with same spatial dimension as the initial image.
annotator.mask
  • a dictionary with all annotation information and pixel-wise segmentation for each object.
# Example for segment "1"
annotation = annotator.labels["1"]

# Scribbles
annotation.xdata, annotation.ydata

# Object segmentation
annotation.xsegdata, annotation.ysegdata

Segmentation

Segmentation is performed with a simple seeded watershed, for custom segmentation algorithm just override the following method:

annotator.update_segmentation() 

Jupyter notebook

To get scarabocchi works on jupyter notebooks to use the following magic commands

%matplotlib notebook

About

Barebone tools for interactive image scribbles on python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages