Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2015102747
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이재빈
2020-12-03 17:31:45 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
12dc402670b089c154d6e8b047717d72e0358185
12dc4026
1 parent
e9021215
전처리 과정 수정
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
Modules/edge_cloud.py
Modules/edge_cloud.py
View file @
12dc402
...
...
@@ -69,16 +69,16 @@ def send_threaded(Client_socket, addr, queue):
print
(
"Disconnected"
)
Client_socket
.
close
()
def
webcam
(
queue
):
def
preprocessing
(
queue
):
capture
=
cv2
.
VideoCapture
(
0
)
while
True
:
ret
,
frame
=
capture
.
read
()
if
ret
==
False
:
continue
frame
=
bboxes
(
frame
)
cropped
=
bboxes
(
frame
)
# return Preprocessed Img
encode_param
=
[
int
(
cv2
.
IMWRITE_JPEG_QUALITY
),
90
]
result
,
imgencode
=
cv2
.
imencode
(
'.jpg'
,
frame
,
encode_param
)
result
,
imgencode
=
cv2
.
imencode
(
'.jpg'
,
cropped
,
encode_param
)
data
=
np
.
array
(
imgencode
)
stringData
=
data
.
tostring
()
queue
.
put
(
stringData
)
...
...
@@ -115,7 +115,7 @@ if __name__ == '__main__':
print
(
'server start'
)
start_new_thread
(
webcam
,
(
enclose_q
,))
start_new_thread
(
preprocessing
,
(
enclose_q
,))
while
True
:
print
(
'wait'
)
...
...
Please
register
or
login
to post a comment