From e41e9cddf99eec15ecb1c5ea6749d157f9467966 Mon Sep 17 00:00:00 2001 From: PengGuanjun Date: Mon, 14 Sep 2020 20:16:54 +0800 Subject: [PATCH] Update athreshold_plg.py update --- menus/Opencv/Threshold/athreshold_plg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/menus/Opencv/Threshold/athreshold_plg.py b/menus/Opencv/Threshold/athreshold_plg.py index e00b411..f9c8ce8 100644 --- a/menus/Opencv/Threshold/athreshold_plg.py +++ b/menus/Opencv/Threshold/athreshold_plg.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from imagepy import IPy + import numpy as np, cv2 -from imagepy.core.engine import Filter +from sciapp.action import Filter class Plugin(Filter): title = 'Adaptive Threshold' @@ -17,4 +17,4 @@ class Plugin(Filter): def run(self, ips, snap, img, para = None): med = cv2.ADAPTIVE_THRESH_MEAN_C if para['med']=='mean' else cv2.ADAPTIVE_THRESH_GAUSSIAN_C mtype = cv2.THRESH_BINARY_INV if para['inv'] else cv2.THRESH_BINARY - cv2.adaptiveThreshold(snap, para['max'], med, para['inv'], para['size'], para['offset'], dst=img) \ No newline at end of file + cv2.adaptiveThreshold(snap, para['max'], med, mtype, para['size'], para['offset'], dst=img)