Skip to content

Instantly share code, notes, and snippets.

View r-barnes's full-sized avatar

Richard Barnes r-barnes

View GitHub Profile
@r-barnes
r-barnes / mask_creator.py
Last active May 8, 2023 16:25 — forked from tonysyu/mask_creator.py
Tool to create polygon mask in Matplotlib
"""
Interactive tool to draw mask on an image or image-like array.
Adapted from matplotlib/examples/event_handling/poly_editor.py
"""
import numpy as np
# import matplotlib as mpl
# mpl.use('tkagg')
import matplotlib.pyplot as plt