Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
BSH_project2
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
Ryan
2021-04-12 00:57:05 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1354bc69c9c6c70946d0c10afd2c85912c627668
1354bc69
1 parent
60ec24e1
etc: add make_video.py
makes video of selected roi images
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
etc/make_video.py
etc/make_video.py
0 → 100644
View file @
1354bc6
import
cv2
import
re
import
os
import
matplotlib.pyplot
as
plt
import
numpy
as
np
path
=
"C:/Datasets/vid15"
count
=
0
img_data
=
[]
fourcc
=
cv2
.
VideoWriter_fourcc
(
*
'XVID'
)
out
=
cv2
.
VideoWriter
(
'15.avi'
,
fourcc
,
10
,
(
270
,
450
))
dir_list
=
os
.
listdir
(
path
)
dir_list
.
sort
(
key
=
lambda
var
:[
int
(
x
)
if
x
.
isdigit
()
else
x
for
x
in
re
.
findall
(
r'[^0-9]|[0-9]+'
,
var
)])
for
img
in
dir_list
:
img_array
=
cv2
.
imread
(
os
.
path
.
join
(
path
,
img
),
cv2
.
IMREAD_COLOR
)
new_array
=
cv2
.
resize
(
img_array
,
(
270
,
450
))
#cv2.imwrite('out{}.jpg'.format(count), new_array)
out
.
write
(
new_array
)
count
+=
1
\ No newline at end of file
Please
register
or
login
to post a comment