fix: masquerade demo

This commit is contained in:
esimov
2022-11-10 11:31:51 +02:00
parent 0c9a71c262
commit 68a68eda70
10 changed files with 5 additions and 5 deletions

View File

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -59,10 +59,10 @@ def process_frame(pixs):
return dets
# initialize the camera
width, height = 640, 480
screen_width, screen_height = 640, 480
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, screen_width)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, screen_height)
while(True):
ret, frame = cap.read()
@@ -70,8 +70,8 @@ while(True):
pixs = pixs.flatten()
# We need to make sure that the whole frame size is transfered over Go,
# otherwise we might getting an index out of range panic error.
if len(pixs) == width*height:
# otherwise we might getting an index out of range panic error.
if len(pixs) == screen_width*screen_height:
dets = process_frame(pixs) # pixs needs to be numpy.uint8 array
if dets is not None: