New ScreenPanel

This commit is contained in:
2018-01-19 10:56:53 +01:00
commit ae4d621609
580 changed files with 46598 additions and 0 deletions

38
script/ImageStats.py Executable file
View File

@@ -0,0 +1,38 @@
from ijutils import *
from mathutils import fit_gaussian
from ch.psi.pshell.imaging.Overlays import *
import ch.psi.pshell.imaging.Pen as Pen
image = img
image = tst
def wait_next():
camera.waitNext(250)
def get_centroid():
bi = image.getImage()
op = show_panel(bi, "Original")
if bi is None:
return None
ip = load_image(bi)
grayscale(ip)
invert(ip)
gaussian_blur(ip)
auto_threshold(ip)
#binary_erode(ip)
show_panel(ip.getBufferedImage(), "Image")
(results,output_img)=analyse_particles(ip, 1000,20000, print_table=True)
op.clearOverlays()
show_panel(output_img.getBufferedImage(), "Outlines")
if results.size()>0:
print results
centroid = (results.getValue("XM",0), results.getValue("YM",0))
ov = Crosshairs(Pen(java.awt.Color.ORANGE), java.awt.Point(int(centroid[0]),int(centroid[1])), java.awt.Dimension(15,15))
op.addOverlay(ov)
return centroid
get_centroid()