covpp.gui

Submodules

covpp.gui.rect_event_hl

Rectangle Event Handler module.

class RecEventHandler(map_img: numpy.ndarray)

Bases: object

Rectangle Event Handler class. Handles mouse and keyboard events for rectangle manipulation.

mouse_handle(event, x, y, flags, param)
on_mouse_move(x, y, flags)
on_lb_db_click(x, y, flags)
on_button_down(x, y, flags)
on_button_up(x, y, flags)
on_key_press(key)
on_key_release(key)
update_history()
deselect()
update_image()
get_vis_objects(selected=False)
get_main_obj() → VisualRectangle

covpp.gui.rectangle

Rectangle class module.

class Rectangle(data: dict, rid: int = None)

Bases: object

Rectangle class. all data in pixels. Includes methods to manipulate rectangle points and rotation.

rid: int = 0
property data: dict
update_data()

Update rectangle data dictionary.

up_all_points()
up_4_points()
up_rotation_point()
cal_min_xy()
rotate_point(dx, dy, rotation)
rotate_point_v2(x, y, rotation)
rotate_point_t(dx, dy, rotation)
is_in_rect(x, y)
are_close(p1, p2)
cal_distance_t(p1, p2)

covpp.gui.visual_rectangle

Visual Rectangle class module for GUI interaction.

class VisualRectangle(data: dict)

Bases: Rectangle

Visual Rectangle class for GUI interaction. Inherits from Rectangle class and adds GUI interaction features.

deselect()
is_in_box(x, y)
detect(x, y)
button_down(x, y)
button_up(x, y)
button_move(x, y)
drag_center(x, y)
drag_rotation(x, y)
drag_top_left(x, y)
drag_top_right(x, y)
drag_bottom_left(x, y)
drag_bottom_right(x, y)
draw(img: numpy.ndarray)
get_rect() → Rectangle

Module contents