From 7c24fd7b395d18112af9cbad7512cdf4d27c53c5 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Wed, 14 Sep 2016 17:38:05 +0200 Subject: [PATCH] Script execution --- script/local.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/script/local.py b/script/local.py index b8d2958..e142712 100644 --- a/script/local.py +++ b/script/local.py @@ -28,4 +28,24 @@ class RobotTCP(TcpDevice): return self.execute('1', '1', puck, sample) -add_device(RobotTCP("robot_tcp", "127.0.0.1:3333"), force = True) \ No newline at end of file +add_device(RobotTCP("robot_tcp", "127.0.0.1:3333"), force = True) + + +def detect_pucks(ip): + aux = grayscale(ip, in_place=False) + subtract_background(aux) + 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.0, 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.7, maxCirc = 1.0)