Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.ip.qualitymeasure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.ip.qualitymeasure
Commits
70b6a67f
Commit
70b6a67f
authored
7 years ago
by
David GEISSBUHLER
Browse files
Options
Downloads
Patches
Plain Diff
Options for remove_highlights script
parent
eb526ac0
No related branches found
No related tags found
1 merge request
!6
Optimizations
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/ip/qualitymeasure/__init__.py
+1
-0
1 addition, 0 deletions
bob/ip/qualitymeasure/__init__.py
bob/ip/qualitymeasure/script/remove_highlights.py
+38
-1
38 additions, 1 deletion
bob/ip/qualitymeasure/script/remove_highlights.py
with
39 additions
and
1 deletion
bob/ip/qualitymeasure/__init__.py
+
1
−
0
View file @
70b6a67f
...
@@ -6,6 +6,7 @@ from .msu_iqa_features import compute_msu_iqa_features
...
@@ -6,6 +6,7 @@ from .msu_iqa_features import compute_msu_iqa_features
from
._library
import
remove_highlights
from
._library
import
remove_highlights
from
._library_orig
import
remove_highlights_orig
from
._library_orig
import
remove_highlights_orig
from
.
import
tan_specular_highlights
as
tsh
def
get_config
():
def
get_config
():
...
...
This diff is collapsed.
Click to expand it.
bob/ip/qualitymeasure/script/remove_highlights.py
+
38
−
1
View file @
70b6a67f
...
@@ -9,12 +9,15 @@ Created on 28 Jun 2017
...
@@ -9,12 +9,15 @@ Created on 28 Jun 2017
import
sys
import
sys
import
argparse
import
argparse
import
time
import
bob.io.base
import
bob.io.base
import
bob.io.image
import
bob.io.image
import
numpy
as
np
import
numpy
as
np
from
bob.ip.qualitymeasure
import
remove_highlights_orig
from
bob.ip.qualitymeasure
import
remove_highlights_orig
from
bob.ip.qualitymeasure
import
remove_highlights
from
bob.ip.qualitymeasure
import
tsh
def
main
(
command_line_parameters
=
None
):
def
main
(
command_line_parameters
=
None
):
"""
Remove the specular component of the input image and write result to
"""
Remove the specular component of the input image and write result to
...
@@ -38,6 +41,27 @@ def main(command_line_parameters=None):
...
@@ -38,6 +41,27 @@ def main(command_line_parameters=None):
default
=
None
,
default
=
None
,
help
=
'
filename of specular free image.
'
)
help
=
'
filename of specular free image.
'
)
argParser
.
add_argument
(
'
-r
'
,
'
--residue
'
,
dest
=
'
resImg
'
,
default
=
None
,
help
=
'
filename of specular residue image.
'
)
argParser
.
add_argument
(
'
-e
'
,
'
--epsilon
'
,
dest
=
'
epsilon
'
,
default
=
0.5
,
help
=
'
value of epsilon parameter.
'
)
argParser
.
add_argument
(
'
-a
'
,
'
--algorithm
'
,
dest
=
'
algorithm
'
,
default
=
0
,
help
=
'
version of the algoritm used.
'
)
args
=
argParser
.
parse_args
(
command_line_parameters
)
args
=
argParser
.
parse_args
(
command_line_parameters
)
if
not
args
.
inpImg
:
if
not
args
.
inpImg
:
...
@@ -52,11 +76,24 @@ def main(command_line_parameters=None):
...
@@ -52,11 +76,24 @@ def main(command_line_parameters=None):
# 2. compute
# 2. compute
print
(
"
Extracting diffuse component...
"
)
print
(
"
Extracting diffuse component...
"
)
sfi
,
diff
,
residue
=
remove_highlights_orig
(
img
.
astype
(
np
.
float32
),
0.5
)
if
int
(
args
.
algorithm
)
==
0
:
print
(
'
v0
'
)
sfi
,
diff
,
residue
=
tsh
.
remove_highlights
(
img
.
astype
(
np
.
float32
),
float
(
args
.
epsilon
))
elif
int
(
args
.
algorithm
)
==
1
:
print
(
'
v1
'
)
sfi
,
diff
,
residue
=
remove_highlights_orig
(
img
.
astype
(
np
.
float32
),
float
(
args
.
epsilon
))
else
:
print
(
'
v2
'
)
sfi
,
diff
,
residue
=
remove_highlights
(
img
.
astype
(
np
.
float32
),
float
(
args
.
epsilon
))
# 1. save output image
# 1. save output image
print
(
"
Saving output file: %s
"
%
args
.
outImg
)
print
(
"
Saving output file: %s
"
%
args
.
outImg
)
bob
.
io
.
base
.
save
(
diff
.
astype
(
'
uint8
'
),
args
.
outImg
)
bob
.
io
.
base
.
save
(
diff
.
astype
(
'
uint8
'
),
args
.
outImg
)
if
args
.
resImg
:
print
(
"
Saving residue file: %s
"
%
args
.
resImg
)
bob
.
io
.
base
.
save
(
residue
.
astype
(
'
uint8
'
),
args
.
resImg
)
print
(
'
Done
'
)
print
(
'
Done
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment