Skip to content
Snippets Groups Projects
Commit 08e94543 authored by David GEISSBUHLER's avatar David GEISSBUHLER
Browse files

Merge branch 'optimizations_fast_spec' into optimizations

parents ae87d133 30b0e319
Branches
Tags
1 merge request!6Optimizations
Pipeline #
...@@ -9,7 +9,9 @@ import scipy.signal as ssg ...@@ -9,7 +9,9 @@ import scipy.signal as ssg
import bob.ip.base import bob.ip.base
import bob.ip.color import bob.ip.color
from . import galbally_iqm_features as iqm from . import galbally_iqm_features as iqm
from . import tan_specular_highlights as tsh
#from . import tan_specular_highlights as tsh
from ._library import remove_highlights
''' Utility functions ''' ''' Utility functions '''
...@@ -155,8 +157,18 @@ def compute_iqa_specularity_features(rgbImage, startEps=0.05): ...@@ -155,8 +157,18 @@ def compute_iqa_specularity_features(rgbImage, startEps=0.05):
""" """
# separate the specular and diffuse components of input color image. # separate the specular and diffuse components of input color image.
speckleFreeImg, diffuseImg, speckleImg = tsh.remove_highlights( # original python version
rgbImage.astype(float), startEps, verboseFlag=False) #speckleFreeImg, diffuseImg, speckleImg = tsh.remove_highlights(
# rgbImage.astype(float), startEps, verboseFlag=False)
speckleFreeImg, diffuseImg, speckleImg = remove_highlights(
rgbImage.astype(np.float32), startEps)
#speckleImg[np.where(np.isinf(speckleImg))] = 0
#speckleImg[np.where(np.isnan(speckleImg))] = 0
#speckleImg[np.where(speckleImg < 0)] = 0
#speckleImg[np.where(speckleImg > 255)] = 255
# speckleImg contains the specular-component # speckleImg contains the specular-component
if len(speckleImg.shape) == 3: if len(speckleImg.shape) == 3:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment