roiiii
roiiii
def initialize_frame_and_roi(self):
"""Initialize the frame and restore ROI if available"""
# Clear any existing ROI
if hasattr(self, 'canvas'):
self.canvas.delete("all")
if not self._initialized:
# Create a message on the canvas
canvas_width = self.canvas.winfo_width()
canvas_height = self.canvas.winfo_height()
self.canvas.create_text(
canvas_width / 2,
canvas_height / 2,
font=("Arial", 14),
fill="#666666"
)
self._initialized = True
if not self.dropdown_values:
self.status_label.configure(text="No cameras available",
text_color="#FF0000")
except Exception as e:
print(f"Error updating camera list: {e}")
self.status_label.configure(text="Error updating camera list",
text_color="#FF0000")
def display_frame(self):
"""Display the current frame on the canvas"""
if self.frame is not None:
# Get current canvas dimensions
canvas_width = self.canvas.winfo_width()
canvas_height = self.canvas.winfo_height()