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
edf41700
Commit
edf41700
authored
Sep 25, 2020
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming and license/description headers
parent
59af6bb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
16 deletions
+50
-16
jp4.py
jp4.py
+8
-4
jp4_batch_convert.py
jp4_batch_convert.py
+15
-5
jp4_batch_convert_eyesis4pi.py
jp4_batch_convert_eyesis4pi.py
+15
-7
jp4_composite.py
jp4_composite.py
+12
-0
No files found.
jp4.py
View file @
edf41700
__copyright__
=
"Copyright 2018, Elphel, Inc."
__license__
=
"GPL-3.0+"
__maintainer__
=
"Oleg Dzhimiev"
__email__
=
"oleg@elphel.com"
'''
SPDX-License-Identifier: GPL-3.0-or-later
Copyright (c) 2020, Elphel, Inc.
Author: Oleg Dzhimiev <oleg@elphel.com>
Description: Class for converting JP4 raw images to
JPEG for previewing
'''
import
numpy
as
np
#import imageio
...
...
jp4_batch_convert.py
View file @
edf41700
#!/usr/bin/env python3
'''
SPDX-License-Identifier: GPL-3.0-or-later
Copyright (c) 2020, Elphel, Inc.
Author: Oleg Dzhimiev <oleg@elphel.com>
Description: Converts jp4 images to jpeg for preview
Scans all images in src-dir and puts results to dst-dir
'''
from
jp4_composite
import
JP4_C
#import cv2
import
numpy
as
np
...
...
@@ -30,10 +39,11 @@ for f in lst:
#print(img.exif.data['Model'])
img
.
deblock
()
img
.
demosaic_bilinear
()
img
.
saturation
()
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 = 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"
))
# subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg"))
jp4_batch_convert_
singles
.py
→
jp4_batch_convert_
eyesis4pi
.py
View file @
edf41700
#!/usr/bin/env python3
'''
SPDX-License-Identifier: GPL-3.0-or-later
Copyright (c) 2020, Elphel, Inc.
Author: Oleg Dzhimiev <oleg@elphel.com>
Description: Converts composite jp4 images from Eyesis4Pi-like camera or
camera with mux. A "composite" image consists of 2-3 images stacked
vertically.
Scans all images in src-dir and puts results to dst-dir.
'''
from
jp4_composite
import
JP4_C
#import cv2
import
numpy
as
np
...
...
@@ -30,12 +41,9 @@ for f in lst:
#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"
))
img
.
saturation
()
#
subs = img.extract_subframes()
#
for i in range(len(subs)):
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"))
subs
[
i
]
.
save
(
os
.
path
.
join
(
dst
,
img
.
basename
+
"_"
+
str
(
img
.
subnames
[
i
])
+
".jpeg"
))
jp4_composite.py
View file @
edf41700
'''
SPDX-License-Identifier: GPL-3.0-or-later
Copyright (c) 2020, Elphel, Inc.
Author: Oleg Dzhimiev <oleg@elphel.com>
Description: Class for converting composite JP4 raw images to
JPEG for previewing.
Composite images consist of 2-3 single ones stacked vertically -
for example in Eyesis4Pi panoramic camera.
The methods here are specifically for Eyesis4Pi - channels are
hardcoded.
'''
import
re
import
os
...
...
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