def calibrate(rerun_mcsc,calib_config,display_server_numbers):
    config = yaml.load(open(decode_url(calib_config)))

    for n in [int(i) for i in display_server_numbers]:
        src = DS_PKL + "/ds%d" % n
        ds = '/display_server%d' % n
        ids = [ds] + config['display_servers'][ds]

        a = AllPointPickle()
        a.initilize_from_directory(src)

        print "*"*20
        print src
        print "*"*20

        if rerun_mcsc:
            mcsc =  MultiCalSelfCam(src)
            mcsc.create_from_cams(
                            cam_ids=ids,
                            cam_resolutions=a.resolutions.copy(),
                            cam_points=a.results.copy(),
                            cam_calibrations={},
                            num_cameras_fill=0)
            dest = mcsc.execute(blocking=True, copy_files=True, silent=False)
        else:
            dest = src + "/result"

        MultiCalSelfCam.publish_calibration_points(
            dest,
            topic_base='/ds%d' % n)
def calibrate(rerun_mcsc, calib_config, display_server_numbers):
    config = yaml.load(open(decode_url(calib_config)))

    for n in [int(i) for i in display_server_numbers]:
        src = DS_PKL + "/ds%d" % n
        ds = '/display_server%d' % n
        ids = [ds] + config['display_servers'][ds]

        a = AllPointPickle()
        a.initilize_from_directory(src)

        print "*" * 20
        print src
        print "*" * 20

        if rerun_mcsc:
            mcsc = MultiCalSelfCam(src)
            mcsc.create_from_cams(cam_ids=ids,
                                  cam_resolutions=a.resolutions.copy(),
                                  cam_points=a.results.copy(),
                                  cam_calibrations={},
                                  num_cameras_fill=0)
            dest = mcsc.execute(blocking=True, copy_files=True, silent=False)
        else:
            dest = src + "/result"

        MultiCalSelfCam.publish_calibration_points(dest,
                                                   topic_base='/ds%d' % n)
Exemplo n.º 3
0
LASER_PKL = decode_url('package://flycave/calibration/laser')
FLYDRA_CALIB = decode_url('package://flycave/calibration/flydra')

#test mcsc wrapper
if 0:
    a = AllPointPickle()
    a.initilize_from_directory(DS1_PKL)

    mcsc = MultiCalSelfCam(DS1_CALIB)
    mcsc.create_from_cams(cam_ids=[],
                          cam_resolutions=a.resolutions.copy(),
                          cam_points=a.results.copy(),
                          cam_calibrations={},
                          num_cameras_fill=0)
    dest = mcsc.execute(blocking=True,
                        dest=tempfile.mkdtemp(prefix='mcsc'),
                        silent=False)
    MultiCalSelfCam.publish_calibration_points(dest)
    MultiCalSelfCam.save_to_pcd(dest, "/tmp/ds1.pcd")

#test roundtrip 2d -> 3d -> 2d
if 0:
    r = flydra.reconstruct.Reconstructor(cal_source=DS1_CALIB)

    cams = r.get_cam_ids()
    print "cameras", cams

    pts = a.get_points_in_cameras(r.get_cam_ids())

    pt = pts[0]
    print "2d points", pt
Exemplo n.º 4
0
LASER_PKL       = decode_url('package://flycave/calibration/laser')
FLYDRA_CALIB    = decode_url('package://flycave/calibration/flydra')

#test mcsc wrapper
if 0:
    a = AllPointPickle()
    a.initilize_from_directory(DS1_PKL)

    mcsc =  MultiCalSelfCam(DS1_CALIB)
    mcsc.create_from_cams(
            cam_ids=[],
            cam_resolutions=a.resolutions.copy(),
            cam_points=a.results.copy(),
            cam_calibrations={},
            num_cameras_fill=0)
    dest = mcsc.execute(blocking=True, dest=tempfile.mkdtemp(prefix='mcsc'), silent=False)
    MultiCalSelfCam.publish_calibration_points(dest)
    MultiCalSelfCam.save_to_pcd(dest, "/tmp/ds1.pcd")

#test roundtrip 2d -> 3d -> 2d
if 0:
    r = flydra.reconstruct.Reconstructor(cal_source=DS1_CALIB)

    cams = r.get_cam_ids()
    print "cameras",cams

    pts = a.get_points_in_cameras(r.get_cam_ids())

    pt = pts[0]
    print "2d points",pt
Exemplo n.º 5
0
def run_mcsc(path):
    mcsc = MultiCalSelfCam(path)
    dest = mcsc.execute(blocking=True, dest=tempfile.mkdtemp(),silent=False)
    pcd = '/tmp/mcscpoints.pcd'
    MultiCalSelfCam.save_to_pcd(dirname=dest, fname=pcd)
    print 'saved to pcd file', pcd
def run_mcsc(path):
    mcsc = MultiCalSelfCam(path)
    dest = mcsc.execute(blocking=True, dest=tempfile.mkdtemp(), silent=False)
    pcd = '/tmp/mcscpoints.pcd'
    MultiCalSelfCam.save_to_pcd(dirname=dest, fname=pcd)
    print 'saved to pcd file', pcd