Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
Image Compression
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
Nathaniel Callens
Image Compression
Commits
2838647d
Commit
2838647d
authored
Jan 27, 2022
by
Kelly Chang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.elphel.com/nathaniel/image-compression
parents
33e09db3
789098e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
23 deletions
+29
-23
compress_start.py
compress_start.py
+29
-23
No files found.
compress_start.py
View file @
2838647d
...
...
@@ -41,31 +41,37 @@ def image_extractor(scenes):
images
.
append
(
os
.
path
.
join
(
folder
,
im
))
return
images
#returns a list of file paths to .tiff files in the specified directory given in file_extractor
def
im_distribution
(
images
):
tiff0
=
[]
tiff1
=
[]
tiff2
=
[]
tiff3
=
[]
files
=
os
.
listdir
(
"images"
)
scenes
=
[]
for
file
in
files
:
scene
=
os
.
path
.
join
(
"images"
,
file
)
sc
=
os
.
listdir
(
scene
)
for
s
in
sc
:
if
s
[
-
6
]
==
'0'
:
tiff0
.
append
(
os
.
path
.
join
(
scene
,
s
))
elif
s
[
-
6
]
==
'1'
:
tiff1
.
append
(
os
.
path
.
join
(
scene
,
s
))
elif
s
[
-
6
]
==
'2'
:
tiff2
.
append
(
os
.
path
.
join
(
scene
,
s
))
elif
s
[
-
6
]
==
'3'
:
tiff3
.
append
(
os
.
path
.
join
(
scene
,
s
))
cameras
=
[
tiff0
,
tiff1
,
tiff2
,
tiff3
]
im
=
Image
.
open
(
tiff0
[
0
])
im
=
np
.
array
(
im
)[
1
:,:]
print
(
im
)
def
im_distribution
(
images
,
num
):
"""
Function that extracts tiff files from specific cameras and returns a list of all
the tiff files corresponding to that camera. i.e. all pictures labeled "_7.tiff" or otherwise
specified camera numbers.
Parameters:
images (list): list of all tiff files, regardless of classification. This is NOT a list of directories but
of specific tiff files that can be opened right away. This is the list that we iterate through and
divide.
num (str): a string designation for the camera number that we want to extract i.e. "14" for double digits
of "_1" for single digits.
Returns:
tiff (list): A list of tiff files that have the specified designation from num. They are the files extracted
from the 'images' list that correspond to the given num.
"""
tiff
=
[]
for
im
in
images
:
if
im
[
-
7
:
-
6
]
==
num
:
tiff
.
append
(
im
)
return
tiff
def
plot_hist
(
tiff_list
):
"""
This function is the leftovers from the first attempt to plot histograms.
As it stands it needs some work in order to function again. We will
fix this later. 1/25/22
"""
jj
=
0
fig
,
axs
=
plt
.
subplots
(
nrows
=
2
,
ncols
=
2
,
figsize
=
(
15
,
12
))
for
cam
,
ax
in
zip
(
cameras
,
axs
.
ravel
()):
...
...
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