diff --git a/BrightContrastModule.py b/BrightContrastModule.py index bedd81c..c5c7639 100644 --- a/BrightContrastModule.py +++ b/BrightContrastModule.py @@ -1,5 +1,6 @@ import logging import numpy as np +from skimage.filters import filters from skimage.color import convert_colorspace, rgb2gray from distutils.util import strtobool @@ -56,4 +57,10 @@ def getContrast(s,params): #RMS contrast rms_contrast=np.sqrt(pow(img - img.mean(), 2).sum() / img.size) s.addToPrintList("rms_contrast", str(rms_contrast)) + + #TenenGrad contrast + tmp = sobel(img) + tenenGrad_contrast=np.sqrt(np.sum(tmp**2))/img.size + s.addToPrintList("tenenGrad_contrast", str(tenenGrad_contrast)) + return