Пример #1
0
data_size = LEN#+4
MAX_BEADS_PERFRAME = 1000000

img_array = np.empty(data_size, dtype=np.uint16)
img_array2 = np.empty(data_size, dtype=np.uint16)
beadpos_xcol = np.empty(MAX_BEADS_PERFRAME, dtype=np.uint16)
beadpos_yrow = np.empty(MAX_BEADS_PERFRAME, dtype=np.uint16)
segmask_image =  np.empty(data_size, dtype=np.uint16)


MaestroF.darkfield_off()
MaestroF.filter_home()
MaestroF.filter_goto(my_color)
time.sleep(1)

MapFunc.init_illum()
MapFunc.light_all()

PC.py_snapPtr(img_array, .35,80,my_color)
#invert for images where beads are lighter than background
img_array = 16383 - img_array # invert the 14 bit image
num_beads = FO.find_objects(1000, 1000, \
                            img_array, \
                            beadpos_xcol, beadpos_yrow, \
                            segmask_image)
print("The number of beads found: %d" % num_beads)
MapFunc.convertPicPNG2(16383-img_array,0,1)
MapFunc.convertPicPNG2(segmask_image*65535, 0,2)
#MapFunc.convertPicPNG(segmask_image*65535+img_array, 0,3)