def setup():
    cameras = []

    Camera.setRange(0, 4500)  ## points in the distance range to be colored

    uiOffset = 20
    ports = Camera.scan()  ## Scan for available Tau Camera devices
    for port in ports:
        camera = Camera.open(port)  ## Open the first available Tau Camera
        camera.setModulationChannel(0)  ## autoChannelEnabled: 0, channel: 0
        camera.setIntegrationTime3d(0, 1000)  ## set integration time 0: 1000
        camera.setMinimalAmplitude(0, 10)  ## set minimal amplitude 0: 80

        cameras.append(camera)

        cameraInfo = camera.info()

        print("\nToF camera opened successfully:")
        print("    model:      %s" % cameraInfo.model)
        print("    firmware:   %s" % cameraInfo.firmware)
        print("    uid:        %s" % cameraInfo.uid)
        print("    resolution: %s" % cameraInfo.resolution)
        print("    port:       %s" % cameraInfo.port)

        cv2.namedWindow('Tau %s' % cameraInfo.uid)
        cv2.moveWindow('Tau %s' % cameraInfo.uid, 20, uiOffset)
        uiOffset += 340

    if len(ports) > 0:
        print("\nPress Esc key over GUI or Ctrl-c in terminal to shutdown ...")

    return cameras
Exemple #2
0
def setup(serialPort=None):
    port = None
    camera = None
    # if no serial port is specified, scan for available Tau Camera devices
    if serialPort is None:
        ports = Camera.scan()                      ## Scan for available Tau Camera devices

        if len(ports) > 0:
            port = ports[0]
    else:
        port = serialPort

    if port is not None:
        Camera.setRange(0, 4500)                   ## points in the distance range to be colored

        camera = Camera.open(port)             ## Open the first available Tau Camera
        camera.setModulationChannel(0)             ## autoChannelEnabled: 0, channel: 0
        camera.setIntegrationTime3d(0, 1000)       ## set integration time 0: 1000
        camera.setMinimalAmplitude(0, 10)          ## set minimal amplitude 0: 80

        cameraInfo = camera.info()

        print("\nToF camera opened successfully:")
        print("    model:      %s" % cameraInfo.model)
        print("    firmware:   %s" % cameraInfo.firmware)
        print("    uid:        %s" % cameraInfo.uid)
        print("    resolution: %s" % cameraInfo.resolution)
        print("    port:       %s" % cameraInfo.port)

        print("\nPress Esc key over GUI or Ctrl-c in terminal to shutdown ...")

    return camera
def setup():
    camera = None
    ports = Camera.scan()  ## Scan for available Tau Camera devices

    if len(ports) > 0:
        Camera.setRange(0, 4500)  ## points in the distance range to be colored

        camera = Camera.open(ports[0])  ## Open the first available Tau Camera
        camera.setModulationChannel(0)  ## autoChannelEnabled: 0, channel: 0
        camera.setIntegrationTime3d(0, 1000)  ## set integration time 0: 1000
        camera.setMinimalAmplitude(0, 10)  ## set minimal amplitude 0: 80

        cameraInfo = camera.info()

        print("\nToF camera opened successfully:")
        print("    model:      %s" % cameraInfo.model)
        print("    firmware:   %s" % cameraInfo.firmware)
        print("    uid:        %s" % cameraInfo.uid)
        print("    resolution: %s" % cameraInfo.resolution)
        print("    port:       %s" % cameraInfo.port)

        print("\nPress Esc key over GUI or Ctrl-c in terminal to shutdown ...")

        cv2.namedWindow('Depth Map')
        cv2.namedWindow('Grayscale')

        cv2.moveWindow('Depth Map', 20, 20)
        cv2.moveWindow('Grayscale', 20, 360)

    return camera
Exemple #4
0
def scanPortsAndSetup():
    camera = None

    ports = Camera.scan()  ## Scan for available Tau Camera devices
    print('\nFound %d possible device(s)' % len(ports))

    for port in ports:
        print('Attempting to connect to device on port \'%s\'' % port)
        camera = setup(port)

    return camera
Exemple #5
0
def setup():
    camera = None
    ports = Camera.scan()                      ## Scan for available Tau Camera devices

    if len(ports) > 0:
        camera = Camera.open(ports[0])             ## Open the first available Tau Camera
        camera.setModulationChannel(0)             ## autoChannelEnabled: 0, channel: 0
        camera.setIntegrationTime3d(0, 1000)       ## set integration time 0: 1000
        camera.setMinimalAmplitude(0, 10)          ## set minimal amplitude 0: 80

        cameraInfo = camera.info()

        print("\nToF camera opened successfully:")
        print("    model:      %s" % cameraInfo.model)
        print("    firmware:   %s" % cameraInfo.firmware)
        print("    uid:        %s" % cameraInfo.uid)
        print("    resolution: %s" % cameraInfo.resolution)
        print("    port:       %s" % cameraInfo.port)

        print("\nPress Ctrl-c in terminal to shutdown ...")

    return camera
Exemple #6
0
def setup():
    camera = None
    ports = Camera.scan()                      ## Scan for available Tau Camera devices

    if len(ports) > 0:
        '''
        cameraNum = 0
        cameraSelected = 0
        if len(ports) >= 1:
            print("\nMore than 1 cameras found:")
            for port in ports:
                print(cameraNum, ':', port)
                cameraNum += 1
            
            cameraSelected = int(input("Enter the number to select a camera from the list:"))
            print(cameraSelected, "entered, try to connect to port ", ports[cameraSelected])
        '''
    
        Camera.setRange(0, 4500)                   ## points in the distance range to be colored

        camera = Camera.open(ports[0])
        #camera = Camera.open(ports[cameraSelected])
        camera.setModulationChannel(0)             ## autoChannelEnabled: 0, channel: 0
        camera.setIntegrationTime3d(0, 1000)       ## set integration time 0: 1000
        camera.setMinimalAmplitude(0, 10)          ## set minimal amplitude 0: 80

        cameraInfo = camera.info()

        print("\nToF camera opened successfully:")
        print("    model:      %s" % cameraInfo.model)
        print("    firmware:   %s" % cameraInfo.firmware)
        print("    uid:        %s" % cameraInfo.uid)
        print("    resolution: %s" % cameraInfo.resolution)
        print("    port:       %s" % cameraInfo.port)

        print("\nPress Esc key over GUI or Ctrl-c in terminal to shutdown ...")

    return camera