python - Async / Multi Threading Pillow Image Grab for 60fps -


what i'm trying do.

currently using pil grab screen shot of desktop , display image in constant loop. produces video effect of screenshots. intent analyze each image taken opencv , display manipulated results.

what i'm doing.

at moment have loop 1 millisecond delay taking screenshot , displaying through opencv. unfortunately grabbing , analyzing image takes while , produces effect looking for, @ lowered frame rate takes longer millisecond grab screenshot , display it.

what i'm looking for.

i'm hoping asynchronously run process concurrently can smoother frame rate. unfortunately when attempt use process or threadingon function warning saying action must taken main thread.

how may able make bellow code async/threaded?

def getimage(bbox):     while true:         #grab pil image         pil_image = imagegrab.grab(bbox=(bbox[0], bbox[1], bbox[2], bbox[3])).convert('rgb')          #conver image opencv can use         image = cv2.cvtcolor(numpy.array(pil_image), cv2.color_rgb2bgr)          #show image         cv2.imshow("image", image)          #wait millisecond image displays         cv2.waitkey(1) 

error:

*** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'nexteventmatchingmask should called main thread!' 


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -