From 8e69ba085b8e8a94a4a8498c8d808d9b120b73e3 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Thu, 22 Sep 2016 14:40:42 +0200 Subject: [PATCH] Closedown --- script/local.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/script/local.py b/script/local.py index 4a13210..1136cd2 100644 --- a/script/local.py +++ b/script/local.py @@ -30,8 +30,26 @@ class RobotTCP(TcpDevice): add_device(RobotTCP("robot_tcp", "127.0.0.1:3333"), force = True) +import ch.psi.pshell.imaging.Data as Data +class Exposure(Writable): + def write(self,pos): + cam.setExposure(pos) +exposure=Exposure() +add_device(exposure, force = True) + + +class Contrast(Readable): + def read(self): + data = img.getData() + roi = Data(data.getRectSelection(500,300,700,600)) + return roi.getGradientVariance() +contrast=Contrast() +add_device(contrast, force = True) + def detect_pucks(ip): + """ + """ aux = grayscale(ip, in_place=False) threshold(aux,0,50) binary_fill_holes(aux) @@ -39,7 +57,9 @@ def detect_pucks(ip): fill_holes = False, exclude_edges = True,print_table=True, output_image = "outlines", minCirc = 0.4, maxCirc = 1.0) -def detect_samples(ip): +def detect_samples(ip): + """ + """ aux = grayscale(ip, in_place=False) invert(aux) subtract_background(aux)