Skip to content

Commit

Permalink
Delete points when changing the image
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustín Castro committed Feb 6, 2024
1 parent 3bd7833 commit 568ccc5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions norfair/common_reference_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ def reference_coord_chosen_in_reference(event):
def get_reset_video_handler(video_type):
def handle_reset_video(event):
global skipper
global canvas_footage
global canvas_reference

if skipper[video_type]["current_frame"] > 1:
skipper[video_type]["video"].video_capture.release()
Expand All @@ -624,6 +626,8 @@ def handle_reset_video(event):
skipper[video_type]["image_container"], image=image
)
skipper[video_type]["canvas"].imgref = image
canvas_footage.delete("myPoint")
canvas_reference.delete("myPoint")

skipper[video_type]["current_frame_label"].config(
text=f"Total frames {video_type}: 1/{skipper[video_type]['total_frames']}"
Expand All @@ -636,6 +640,8 @@ def get_skiper_handler(video_type):

def handle_skip_frame(event):
global skipper
global canvas_footage
global canvas_reference

try:
frames_to_skip = int(entry_skip.get())
Expand Down Expand Up @@ -687,6 +693,8 @@ def handle_skip_frame(event):
skipper[video_type]["current_frame_label"].config(
text=f"Total frames {video_type}: {frame_number}/{total_frames}"
)
canvas_footage.delete("myPoint")
canvas_reference.delete("myPoint")

return handle_skip_frame

Expand Down

0 comments on commit 568ccc5

Please sign in to comment.