work on config, fiducial, autofocus
This commit is contained in:
33
swissmx.py
33
swissmx.py
@@ -1611,37 +1611,34 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
|
||||
def cb_autofocus(self):
|
||||
app=QApplication.instance()
|
||||
cfg=app._cfg
|
||||
cfg=app._cfg.value(AppCfg.GEO_AUTOFOC)
|
||||
geo=app._geometry
|
||||
#geo.autofocus(app._camera, self.tweakers['base_z'],rng=(-1, 1), n=30,saveImg=True)
|
||||
|
||||
misc=cfg.value(AppCfg.GBL_MISC)
|
||||
af_range=misc['af_range']
|
||||
n=misc['af_steps']
|
||||
af_range=cfg['range']
|
||||
n=cfg['steps']
|
||||
vel=cfg['vel']
|
||||
rng=(-af_range/2, af_range/2)
|
||||
#geo.autofocus(app._camera, self.tweakers['base_z'],rng, n,dlg)
|
||||
af= geometry.autofocus(app._camera, self.tweakers['base_z'])
|
||||
af=geometry.autofocus(app._camera, self.tweakers['base_z'])
|
||||
# af.run(rng, n, dlg)
|
||||
|
||||
#with pg.ProgressDialog('Progress', 0, n) as dlg:
|
||||
af.run_continous(rng=(-.5, .5), velo=0.3)
|
||||
af.run_continous(rng=rng, velo=vel)
|
||||
|
||||
def cb_find_fiducial(self):
|
||||
app=QApplication.instance()
|
||||
geo=app._geometry
|
||||
#geo.autofocus(app._camera, self.tweakers['base_z'],rng=(-1, 1), n=30,saveImg=True)
|
||||
pos,corr=geo.find_fiducial(app._camera, sz=(210,210),brd=(20,20))
|
||||
cfg=app._cfg.value(AppCfg.GEO_FND_FID)
|
||||
|
||||
fx=self.tweakers["fast_x"].get_rbv()
|
||||
fy=self.tweakers["fast_y"].get_rbv()
|
||||
scl=np.linalg.norm(geo.pos2pix((.001,0))) #pix/um
|
||||
sz=int(cfg['sz']*scl)
|
||||
brd=int(cfg['brd']*scl)
|
||||
# sz=( 84, 84); brd=( 7, 7) # zoom 001
|
||||
# sz=(128, 128); brd=( 9, 9) # zoom 200
|
||||
# sz=(200, 200); brd=(13, 13) # zoom 400
|
||||
_log.debug(f'sz:{sz} brd:{brd}')
|
||||
pos,corr=geo.find_fiducial(app._camera, sz=(sz,sz),brd=(brd,brd))
|
||||
bz=self.tweakers["base_z"].get_rbv()
|
||||
|
||||
#oc=geo._opt_ctr
|
||||
#bm_pos=self._goBeamMarker.pos()
|
||||
#bm_sz=self._goBeamMarker.size()
|
||||
#pos_eu=geo.pix2pos(pos)
|
||||
#pImg=pg.Point(self._goImg.mapFromScene(pos))
|
||||
#pTrk=pg.Point(self._goTracked.mapFromScene(pos))
|
||||
pos_scn=self._goImg.mapToScene(pg.Point(pos))
|
||||
pos_eu=self._goTracked.mapFromScene(pos_scn)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user