Closedown

This commit is contained in:
gac-S_Changer
2017-06-21 17:39:41 +02:00
parent b5b24da58a
commit 09fa55f6b0

View File

@@ -1,3 +1,16 @@
from ijutils import *
roi_center = (800, 600)
roi_radius = 600
roi = (roi_center[0] - roi_radius, roi_center[1] - roi_radius, 2* roi_radius, 2*roi_radius)
def in_roi(x,y):
return math.hypot(x-roi_radius, y-roi_radius) < roi_radius
def integrate (ips):
for i in range(len(ips)):
if i==0:
@@ -21,25 +34,29 @@ def get_image(samples = 1):
img.backgroundEnabled=False
led_ctrl1.write(0.0)
led_ctrl2.write(0.0)
time.sleep(0.5)
time.sleep(1.0)
background = get_image(5)
#img.setBackground(background.getBufferedImage())
#img.captureBackground(1,0)
#show_panel(img.backgroundImage)
show_panel(background)
img.background = background
img.backgroundEnabled = True
time.sleep(0.5)
#img.backgroundEnabled = True
led_ctrl1.write(0.40)
led_ctrl2.write(0.40)
time.sleep(1.0)
image = get_image(5)
op_image(image, background, "subtract", float_result=True, in_place=True)
invert(aux)
auto_threshold(aux, method = "Percentile")
show_panel(image.getBufferedImage())
invert(image)
auto_threshold(image, method = "MaxEntropy") #Tested ok: MaxEntropy, Triangle, Yen
#binary_open(aux)
(results,output) = analyse_particles(aux, 250,1000,
(r,output) = analyse_particles(image, 250,1000,
fill_holes = True, exclude_edges = False, print_table=False,
output_image = "outlines", minCirc = 0.3
, maxCirc = 1.0)
@@ -53,8 +70,9 @@ for row in range (r.counter):
print str(npoints) + " - " + points
print results
print r
#show_panel(output.getBufferedImage())
#img.backgroundEnabled=False