From 89025e5227bff61af72ad4a715c4d5182e261300 Mon Sep 17 00:00:00 2001 From: Rexmiao <35504986+Rexmiao@users.noreply.github.com> Date: Wed, 24 Jul 2019 16:17:50 -0400 Subject: [PATCH] Update BrightContrastModule.py --- BrightContrastModule.py | 7 +++++++ 1 file changed, 7 insertions(+) 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