Display user name\
This commit is contained in:
@@ -1,30 +1,34 @@
|
||||
from ijutils import *
|
||||
|
||||
RANGE = (10, 40)
|
||||
STEP_SIZE = 2.0
|
||||
|
||||
diam_disk = cover_detection.config.diameter_disk
|
||||
diam_target = cover_detection.config.diameter_target
|
||||
diam_dewar = cover_detection.config.diameter_dewar
|
||||
threshold_method = cover_detection.config.threshold_method
|
||||
center_x, center_y = ( cover_detection.config.center_x, cover_detection.config.center_y)
|
||||
radius_dewar = diam_dewar /2.0
|
||||
radius_dewar = diam_dewar/2.0
|
||||
roi = Rectangle(int(center_x-radius_dewar), int(center_y-radius_dewar), int(diam_dewar), int(diam_dewar))
|
||||
area_disc = int(pow(diam_disk/2,2) * math.pi)
|
||||
area_target = int(pow(diam_target/2,2) * math.pi)
|
||||
area = area_disc - area_target
|
||||
if TARGET_HOLES:
|
||||
area -= int(4* pow(12/2,2) * math.pi)
|
||||
debug=False
|
||||
settling_time = 0.4
|
||||
debug=True
|
||||
settling_time = cam.getAcquirePeriod()/1000.0 + 0.3
|
||||
|
||||
class Fitness(Readable):
|
||||
def read(self):
|
||||
try:
|
||||
ip = load_image(ImagingUtils.grayscale(img.output, None))
|
||||
set_circle_mask(ip.getProcessor(), center_x=center_x, center_y=center_y, radius=radius_dewar, bitwise=False)
|
||||
it = auto_threshold(ip, dark_background=True, method=threshold_method, in_place=False)
|
||||
#it = auto_threshold(ip, dark_background=True, method=threshold_method, in_place=False)
|
||||
it = threshold(ip, 128, 255, in_place=False)
|
||||
binary_open(it, dark_background=True, iterations=1, count=1);
|
||||
binary_open(it, dark_background=False, iterations=1, count=1);
|
||||
if debug:
|
||||
ImageBuffer.saveImage(it.getBufferedImage(), os.path.abspath(expand_path("{images}/ExposureScan.png")), "png")
|
||||
ImageBuffer.saveImage(it.getBufferedImage(), os.path.abspath(expand_path("{images}/ExposureScan/" + str( cam.getExposure()) + ".png")), "png")
|
||||
|
||||
h = get_histogram(it)
|
||||
b,w= h[0], h[-1]
|
||||
@@ -42,7 +46,7 @@ class Exposure(Writable):
|
||||
fitness=Fitness()
|
||||
exposure=Exposure()
|
||||
|
||||
ret = lscan(exposure,fitness,10, 60, 2.0, settling_time, save=False)
|
||||
ret = lscan(exposure,fitness,RANGE[0], RANGE[1], STEP_SIZE, settling_time, save=False)
|
||||
y, x = ret.getReadable(0), ret.getPositions(0)
|
||||
m=x[y.index(min(y))]
|
||||
p=get_plots()[0]
|
||||
|
||||
Reference in New Issue
Block a user