From 561670f2e5a99ef656c3971e4e816ee70a8e8191 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Mon, 19 Sep 2016 16:13:56 +0200 Subject: [PATCH] Script execution --- script/imgtest.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/script/imgtest.py b/script/imgtest.py index 188b215..635745a 100644 --- a/script/imgtest.py +++ b/script/imgtest.py @@ -11,6 +11,25 @@ import ch.psi.pshell.imaging.Pen as Pen +def detect_pucks(ip): + aux = grayscale(ip, in_place=False) + threshold(aux,0,50) + binary_fill_holes(aux) + return analyse_particles(aux, 10000,50000, + fill_holes = False, exclude_edges = True,print_table=True, + output_image = "outlines", minCirc = 0.4, maxCirc = 1.0) + +def detect_samples(ip): + aux = grayscale(ip, in_place=False) + invert(aux) + subtract_background(aux) + auto_threshold(aux) + binary_open(aux) + return analyse_particles(aux, 250,1000, + fill_holes = False, exclude_edges = True,print_table=True, + output_image = "outlines", minCirc = 0.9, maxCirc = 1.0) + + class MyFilter(Filter): def process(self, image, data): ip = load_image(image)