예제 #1
0
depth_im = np.array(Image.open(imagefile_d))

tracker.initialize(image=image, state=selection, depth_im=depth_im)

while True:
    imagefile = handle.frame()
    if not imagefile:
        break

    # imagefile = ''.join(imagefile)
    # imagefile = imagefile[20:-2]

    # image = tracker._read_image(imagefile)

    imagefile_rgb = imagefile[0]
    imagefile_d = imagefile[1]
    assert imagefile_rgb.find("color") >= 0
    assert imagefile_d.find("depth") >= 0
    image = tracker._read_image(imagefile_rgb)
    depth_im = np.array(Image.open(imagefile_d))

    start_time = time.time()
    state = tracker.track(image=image, depth_im=depth_im)

    #overlay_boxes(image, state, imagefile[0], tracker_name)

    #confidence=1
    selection = Rectangle(state[0], state[1], state[2], state[3])
    handle.report(selection)
    time.sleep(0.01)
예제 #2
0
depth_im = np.array(Image.open(imagefile_d))

tracker.initialize(image=image, state=selection, depth_im=depth_im)

while True:
    imagefile = handle.frame()
    if not imagefile:
        break

    # imagefile = ''.join(imagefile)
    # imagefile = imagefile[20:-2]

    # image = tracker._read_image(imagefile)

    imagefile_rgb = imagefile[0]
    imagefile_d = imagefile[1]
    assert imagefile_rgb.find("color") >= 0
    assert imagefile_d.find("depth") >= 0
    image = tracker._read_image(imagefile_rgb)
    depth_im = np.array(Image.open(imagefile_d))

    start_time = time.time()
    state, conf = tracker.track(image=image, depth_im=depth_im)

    #overlay_boxes(image, state, imagefile[0], tracker_name)

    #confidence=1
    selection = Rectangle(state[0], state[1], state[2], state[3])
    handle.report(selection, conf)
    time.sleep(0.01)