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
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
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 @
789098e3
...
@@ -41,31 +41,37 @@ def image_extractor(scenes):
...
@@ -41,31 +41,37 @@ def image_extractor(scenes):
images
.
append
(
os
.
path
.
join
(
folder
,
im
))
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
return
images
#returns a list of file paths to .tiff files in the specified directory given in file_extractor
def
im_distribution
(
images
):
def
im_distribution
(
images
,
num
):
tiff0
=
[]
"""
tiff1
=
[]
Function that extracts tiff files from specific cameras and returns a list of all
tiff2
=
[]
the tiff files corresponding to that camera. i.e. all pictures labeled "_7.tiff" or otherwise
tiff3
=
[]
specified camera numbers.
files
=
os
.
listdir
(
"images"
)
Parameters:
scenes
=
[]
images (list): list of all tiff files, regardless of classification. This is NOT a list of directories but
for
file
in
files
:
of specific tiff files that can be opened right away. This is the list that we iterate through and
scene
=
os
.
path
.
join
(
"images"
,
file
)
divide.
sc
=
os
.
listdir
(
scene
)
for
s
in
sc
:
num (str): a string designation for the camera number that we want to extract i.e. "14" for double digits
if
s
[
-
6
]
==
'0'
:
of "_1" for single digits.
tiff0
.
append
(
os
.
path
.
join
(
scene
,
s
))
elif
s
[
-
6
]
==
'1'
:
Returns:
tiff1
.
append
(
os
.
path
.
join
(
scene
,
s
))
tiff (list): A list of tiff files that have the specified designation from num. They are the files extracted
elif
s
[
-
6
]
==
'2'
:
from the 'images' list that correspond to the given num.
tiff2
.
append
(
os
.
path
.
join
(
scene
,
s
))
"""
elif
s
[
-
6
]
==
'3'
:
tiff
=
[]
tiff3
.
append
(
os
.
path
.
join
(
scene
,
s
))
for
im
in
images
:
if
im
[
-
7
:
-
6
]
==
num
:
cameras
=
[
tiff0
,
tiff1
,
tiff2
,
tiff3
]
tiff
.
append
(
im
)
im
=
Image
.
open
(
tiff0
[
0
])
return
tiff
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
jj
=
0
fig
,
axs
=
plt
.
subplots
(
nrows
=
2
,
ncols
=
2
,
figsize
=
(
15
,
12
))
fig
,
axs
=
plt
.
subplots
(
nrows
=
2
,
ncols
=
2
,
figsize
=
(
15
,
12
))
for
cam
,
ax
in
zip
(
cameras
,
axs
.
ravel
()):
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