Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -69,16 +69,16 @@ def send_threaded(Client_socket, addr, queue): | ... | @@ -69,16 +69,16 @@ def send_threaded(Client_socket, addr, queue): |
69 | print("Disconnected") | 69 | print("Disconnected") |
70 | Client_socket.close() | 70 | Client_socket.close() |
71 | 71 | ||
72 | -def webcam(queue): | 72 | +def preprocessing(queue): |
73 | capture = cv2.VideoCapture(0) | 73 | capture = cv2.VideoCapture(0) |
74 | while True: | 74 | while True: |
75 | ret, frame = capture.read() | 75 | ret, frame = capture.read() |
76 | 76 | ||
77 | if ret == False: | 77 | if ret == False: |
78 | continue | 78 | continue |
79 | - frame = bboxes(frame) | 79 | + cropped = bboxes(frame) # return Preprocessed Img |
80 | encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90] | 80 | encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90] |
81 | - result, imgencode = cv2.imencode('.jpg', frame, encode_param) | 81 | + result, imgencode = cv2.imencode('.jpg', cropped, encode_param) |
82 | data = np.array(imgencode) | 82 | data = np.array(imgencode) |
83 | stringData = data.tostring() | 83 | stringData = data.tostring() |
84 | queue.put(stringData) | 84 | queue.put(stringData) |
... | @@ -115,7 +115,7 @@ if __name__ == '__main__': | ... | @@ -115,7 +115,7 @@ if __name__ == '__main__': |
115 | 115 | ||
116 | print('server start') | 116 | print('server start') |
117 | 117 | ||
118 | - start_new_thread(webcam, (enclose_q,)) | 118 | + start_new_thread(preprocessing, (enclose_q,)) |
119 | while True: | 119 | while True: |
120 | print('wait') | 120 | print('wait') |
121 | 121 | ... | ... |
-
Please register or login to post a comment