Dear Python and OpenCV-Fellows,
I am using openCV on a RPI4 - 4GB and I'm doing realtime person detection with it so frame rate is quite crucial. My whole algorithm takes 70ms and then, on top, the showimage takes again 70ms, which basically halfs the framerate.
Can you think of a way to speed up the imageshow? Currently, I am using a 1920x1080png with a size of around 1MB. I update only a few numbers (the current people count) on the image during each cycle using putText.
I've already thought about skipping every 2nd or maybe 4 out of 5 frames, which will cause a showimage delay of 1 second but might still be acceptable.
Are there eventually more efficient ways to show images than openCV?
Thank you!
Please see my code below:
I am using openCV on a RPI4 - 4GB and I'm doing realtime person detection with it so frame rate is quite crucial. My whole algorithm takes 70ms and then, on top, the showimage takes again 70ms, which basically halfs the framerate.
Can you think of a way to speed up the imageshow? Currently, I am using a 1920x1080png with a size of around 1MB. I update only a few numbers (the current people count) on the image during each cycle using putText.
I've already thought about skipping every 2nd or maybe 4 out of 5 frames, which will cause a showimage delay of 1 second but might still be acceptable.
Are there eventually more efficient ways to show images than openCV?
Thank you!
Please see my code below:
def showimage(img): to_show = img.copy() cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN) cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN) cv2.putText(to_show, str(allowed), (180, 660), cv2.FONT_HERSHEY_SIMPLEX, 10, (255, 255, 255), 15) cv2.putText(to_show, str(people_inside), (180, 1020), cv2.FONT_HERSHEY_SIMPLEX, 10, (255, 255, 255), 15) cv2.imshow("window", to_show) cv2.waitKey(1)