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
Elphel
image-compression
Commits
789098e3
Commit
789098e3
authored
Jan 25, 2022
by
Nathaniel Callens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
functions added
parent
802e8010
Changes
1
Hide 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 @
789098e3
...
...
@@ -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
=
[]
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
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
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