Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.ip.qualitymeasure
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.ip.qualitymeasure
Commits
33a2ae79
Commit
33a2ae79
authored
Jun 30, 2017
by
David GEISSBUHLER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for remove_highlights_orig
parent
213096f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
bob/ip/qualitymeasure/test.py
bob/ip/qualitymeasure/test.py
+30
-0
No files found.
bob/ip/qualitymeasure/test.py
View file @
33a2ae79
...
...
@@ -18,6 +18,9 @@ import bob.ip.color
from
.
import
galbally_iqm_features
as
iqm
from
.
import
msu_iqa_features
as
iqa
from
bob.io
import
image
from
._library_orig
import
remove_highlights_orig
REF_VIDEO_FILE
=
'real_client001_android_SD_scene01.mp4'
REF_FEATURE_FILE
=
'real_client001_android_SD_scene01_ref_feats.h5'
...
...
@@ -106,3 +109,30 @@ def test_msu_feat_extr():
# test: compare feature-values in bobfset[] with those loaded from hdf5 file
nose
.
tools
.
assert_true
((
msufset
==
msu_ref_features
).
all
())
# test if the original version of the specular highlights algorithm
# (remove_highlights_orig.cpp::remove_highlights_orig) performs exactly
# like the original code from which it was mostly copied.
# (this test can probabalty be dropped.)
def
test_remove_highlights_orig_integrity
():
# open pictures
img1
=
image
.
load
(
F
(
'old_man.ppm'
))
img2
=
image
.
load
(
F
(
'toys.ppm'
))
# compute
sfi1
,
diff1
,
residue1
=
remove_highlights_orig
(
img1
.
astype
(
np
.
float32
),
0.5
)
sfi2
,
diff2
,
residue2
=
remove_highlights_orig
(
img2
.
astype
(
np
.
float32
),
0.5
)
#speckleImg[np.where(np.isinf(speckleImg))] = 0
#speckleImg[np.where(np.isnan(speckleImg))] = 0
diff1_u8
=
diff1
.
astype
(
'uint8'
)
diff2_u8
=
diff2
.
astype
(
'uint8'
)
# reference files
ref1
=
image
.
load
(
F
(
'old_man_diffuse.ppm'
))
ref2
=
image
.
load
(
F
(
'toys_diffuse.ppm'
))
# test: compare results
nose
.
tools
.
assert_true
((
diff1_u8
==
ref1
).
all
())
nose
.
tools
.
assert_true
((
diff2_u8
==
ref2
).
all
())
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