ra1nty / DXcam

A Python high-performance screen capture library for Windows using Desktop Duplication API
MIT License
457 stars 67 forks source link

dxcam is fast, so is yolo, but cv2 isn't #68

Open dvdco opened 1 year ago

dvdco commented 1 year ago

I'm working on a project to use yolo to realtime mark the objects on the user's screen. after going through a cprofile, i found that dxcam and yolo only took less than 50% of process time, but cv2.waikey(1) took nearly 20%. does anyone know how to speed up the cv2.imshow or is there a faster or a better way to realtime display pics on the screen?

AI-M-BOT commented 11 months ago

cv2.waikey(1) designed to sleep around 15ms it actually calls windows sleep function and for your situation, just don't show it on the same thread