PolygonInteractor

class kgpy.img.mask.PolygonInteractor(ax, poly)

Bases: object

A polygon editor.

Key-bindings

‘t’ toggle vertex markers on and off. When vertex markers are on,

you can move them, delete them

‘d’ delete the vertex under point

‘i’ insert a vertex at point. You must be within epsilon of the

line connecting two existing vertices

__init__(ax, poly)

Attributes

epsilon

showverts

Methods

__init__(ax, poly)

button_press_callback(event)

whenever a mouse button is pressed

button_release_callback(event)

whenever a mouse button is released

draw_callback(event)

get_ind_under_point(event)

get the index of the vertex under point if within epsilon tolerance

get_mask(shape)

Return image mask given by mask creator

key_press_callback(event)

whenever a key is pressed

motion_notify_callback(event)

on mouse movement

poly_changed(poly)

this method is called whenever the polygon object is called

Inheritance Diagram

digraph inheritance64cdc4d7c1 { bgcolor=transparent; rankdir=TB; size="8.0, 12.0"; "kgpy.img.mask.PolygonInteractor" [URL="kgpy.img.mask.PolygonInteractor.html#kgpy.img.mask.PolygonInteractor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A polygon editor."]; }
button_press_callback(event)

whenever a mouse button is pressed

button_release_callback(event)

whenever a mouse button is released

draw_callback(event)
get_ind_under_point(event)

get the index of the vertex under point if within epsilon tolerance

get_mask(shape)

Return image mask given by mask creator

key_press_callback(event)

whenever a key is pressed

motion_notify_callback(event)

on mouse movement

poly_changed(poly)

this method is called whenever the polygon object is called

epsilon = 5
showverts = True