Fixed (?) prior error causing null `frame_to_show`

This commit is contained in:
slashtechno 2023-12-22 16:44:21 -06:00
parent bec1d5b979
commit e7b63126d2
Signed by: slashtechno
GPG Key ID: 8EC1D9D9286C2B17
2 changed files with 10 additions and 12 deletions

View File

@ -88,8 +88,6 @@ def main():
# Display the resulting frame # Display the resulting frame
# TODO: When multi-camera support is added, this needs to be changed to allow all feeds # TODO: When multi-camera support is added, this needs to be changed to allow all feeds
if not args.no_display: if not args.no_display:
# When a face isn't recognized: "cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'"
# Seems to be because frame_to_show is null
cv2.imshow("Video", frame_to_show) cv2.imshow("Video", frame_to_show)
# Hit 'q' on the keyboard to quit! # Hit 'q' on the keyboard to quit!

View File

@ -150,16 +150,16 @@ def process_footage(
) )
# To debug plotting, use r.plot() to cross reference the bounding boxes drawn by the plot_label() and r.plot() # To debug plotting, use r.plot() to cross reference the bounding boxes drawn by the plot_label() and r.plot()
frame_to_show = plot_label( frame_to_show = plot_label(
boxes=plot_boxes, boxes=plot_boxes,
full_frame=frame, full_frame=frame,
# full_frame=r.plot(), # full_frame=r.plot(),
run_scale=run_scale, run_scale=run_scale,
view_scale=view_scale, view_scale=view_scale,
) )
# Unsure if this should also return the objects_and_peoples dict # Unsure if this should also return the objects_and_peoples dict
return frame_to_show return frame_to_show
def plot_label( def plot_label(