Closedown

This commit is contained in:
gac-S_Changer
2017-06-23 14:54:45 +02:00
parent 6b62017f34
commit b085789df2
3 changed files with 30 additions and 15 deletions

View File

@@ -34,23 +34,33 @@ renderer.clearOverlays()
invert(image)
auto_threshold(image, method = "MaxEntropy") #Tested ok: MaxEntropy, Triangle, Yen
#binary_open(aux)
(r,output) = analyse_particles(image, 250,1000,
(r,output) = analyse_particles(image, 150,1000,
fill_holes = True, exclude_edges = False, print_table=False,
output_image = "outlines", minCirc = 0.3
, maxCirc = 1.0)
points = ""
npoints = 0
x=[]
y=[]
for row in range (r.counter):
if in_roi(r.getValue("XM",row), r.getValue("YM",row)):
#x, y = int(r.getValue("XM", row))+roi[0], int(r.getValue("YM", row))+roi[1]
x, y = int(r.getValue("XM", row)), int(r.getValue("YM", row))
points = points + " (" + str(x) + ", " + str(y) + ")"
x.append(int(r.getValue("XM", row)))
y.append(int(r.getValue("YM", row)))
points = points + " (" + str(x[-1]) + ", " + str(y[-1]) + ")"
npoints = npoints + 1
renderer.addOverlay(Crosshairs(Pen(java.awt.Color.MAGENTA), java.awt.Point(x,y), java.awt.Dimension(15,15)))
renderer.addOverlay(Crosshairs(Pen(java.awt.Color.MAGENTA), java.awt.Point(x[-1],y[-1]), java.awt.Dimension(15,15)))
print str(npoints) + " - " + points
print r
print x
print y
offset = int(math.sqrt(1000)/2)
cv = (min(x)-offset, min(y)-offset, max(x)+offset, max(y)+offset)
renderer.addOverlay(Rect(Pen(java.awt.Color.MAGENTA), java.awt.Point(cv[0], cv[1]), java.awt.Dimension(cv[2]-cv[0],cv[3]-cv[1])))
#show_panel(output.getBufferedImage())
#img.backgroundEnabled=False