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

Inheritance diagram of kgpy.img.mask.PolygonInteractor

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