From c43a30fb50af903cc64b588313b48e8c61dc1d74 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Wed, 14 Sep 2016 16:48:48 +0200 Subject: [PATCH] Script execution --- script/imgtest.py | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/script/imgtest.py b/script/imgtest.py index 6f2256c..29cf222 100644 --- a/script/imgtest.py +++ b/script/imgtest.py @@ -8,29 +8,33 @@ import java.awt.Color as Color #Image Loading ip = load_image("{images}/test2.png", title="Image") -aux = ip.duplicate() -aux.show() -grayscale(aux) -gaussian_blur(aux); aux.repaintWindow() -#invert(aux); aux.repaintWindow() -#smooth(aux); aux.repaintWindow() -#sharpen(aux); aux.repaintWindow() - - -#Histogram +""" +#Puck Detection +aux = grayscale(ip, in_place=False) +aux.show() plot(get_histogram(aux)) - - - -auto_threshold(aux) -invert(aux) +subtract_background(aux) +threshold(aux,0,50); aux.repaintWindow() binary_fill_holes(aux); aux.repaintWindow() -#binary_fill_holes(aux) -#aux.show() -(results,output_img)=analyse_particles(aux, 400,1000, +(results,output_img)=analyse_particles(aux, 10000,50000, fill_holes = False, exclude_edges = True,print_table=True, output_image = "outlines", minCirc = 0.0, maxCirc = 1.0) output_img.show() +""" + +#Sample detection +aux = grayscale(ip, in_place=False) +aux.show() +#gaussian_blur(aux); aux.repaintWindow() +invert(aux); aux.repaintWindow() +subtract_background(aux); aux.repaintWindow() +auto_threshold(aux); aux.repaintWindow() +binary_open(aux); aux.repaintWindow() +#binary_fill_holes(aux); aux.repaintWindow() +(results,output_img)=analyse_particles(aux, 250,1000, + fill_holes = False, exclude_edges = True,print_table=True, + output_image = "outlines", minCirc = 0.7, maxCirc = 1.0) +output_img.show()