Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
python3-convert-jp4
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
python3-convert-jp4
Commits
59af6bb9
Commit
59af6bb9
authored
Jun 11, 2019
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added batch converting
parent
25ce6e0e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
jp4_batch_convert_singles.py
jp4_batch_convert_singles.py
+41
-0
jp4_composite.py
jp4_composite.py
+4
-0
No files found.
jp4_batch_convert_singles.py
0 → 100644
View file @
59af6bb9
#!/usr/bin/env python3
from
jp4_composite
import
JP4_C
#import cv2
import
numpy
as
np
import
sys
from
PIL
import
Image
,
ImageOps
import
os
try
:
src
=
sys
.
argv
[
1
]
except
IndexError
:
src
=
"."
try
:
dst
=
sys
.
argv
[
2
]
except
IndexError
:
dst
=
"."
lst
=
os
.
listdir
(
src
)
lst
.
sort
()
for
f
in
lst
:
path
=
os
.
path
.
join
(
src
,
f
)
if
os
.
path
.
isfile
(
path
):
print
(
"Converting "
+
f
)
img
=
JP4_C
(
path
)
#print(img.exif.toString())
#print(img.exif.data['Model'])
img
.
deblock
()
img
.
demosaic_bilinear
()
img_arr
=
img
.
saturation
()
im
=
Image
.
fromarray
(
img_arr
.
astype
(
np
.
uint8
))
im
.
save
(
os
.
path
.
join
(
dst
,
img
.
basename
+
"_"
+
str
(
img
.
subnames
)
+
".jpeg"
))
#subs = img.extract_subframes()
#for i in range(len(subs)):
#subs[i].save(os.path.join("../res",img.basename+"_"+str(img.subnames[i])+".png"))
# subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg"))
jp4_composite.py
View file @
59af6bb9
...
@@ -54,6 +54,10 @@ class JP4_C(JP4):
...
@@ -54,6 +54,10 @@ class JP4_C(JP4):
else
:
else
:
subnames
=
[
chn
-
101
,
chn
-
101
+
8
,
chn
-
101
+
16
]
subnames
=
[
chn
-
101
,
chn
-
101
+
8
,
chn
-
101
+
16
]
else
:
subnames
=
self
.
exif
.
data
[
'Page'
][
0
]
return
subnames
return
subnames
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment