Ejemplo n.º 1
0
def main():
    models = [get_reconstructed_model(f,True) for f in model_files]
    scene_full = get_raw_depth(depth_file)
    errors = []
    for i in range(len(objects)):
        R,t = icp(models[i]['positions'],scene_full,True)
        #apply the ICP results to the model
        transformed_points = [se3.apply((R,t),p) for p in models[i]['positions']]
        errors.append(matching_error(transformed_points,scene_full))
        print "Object",objects[i],"matching error:",errors[-1]
        models[i]['positions'] = transformed_points

    bestIndex = 0
    bestError = min(errors)
    for i in range(len(objects)):
        if errors[i] == bestError:
            bestIndex = i
            break

    #pick one of the models to visualize
    visualization_model = bestIndex
    print scene, " scene's best match was the object: ", objects[bestIndex]

    opengl_plot = OpenGLPlot(models[visualization_model], scene_full)
    opengl_plot.initialize_main_loop()
Ejemplo n.º 2
0
def main():
    models = [get_reconstructed_model(f,True) for f in model_files]
    scene_full = get_raw_depth(depth_file)
    errors = []
    for i in range(len(objects)):
        R,t = icp(models[i]['positions'],scene_full)
        #apply the ICP results to the model
        transformed_points = [se3.apply((R,t),p) for p in models[i]['positions']]
        errors.append(matching_error(transformed_points,scene_full))
        print "Object",objects[i],"matching error:",errors[-1]
        models[i]['positions'] = transformed_points

    #pick one of the models to visualize
    visualization_model = 2
Ejemplo n.º 3
0
def main():
    models = [get_reconstructed_model(f, True) for f in model_files]
    scene_full = get_raw_depth(depth_file)
    errors = []
    for i in range(len(objects)):
        print "started main"
        R, t = icp(models[i]["positions"], scene_full)
        print "exited icp"
        # apply the ICP results to the model
        transformed_points = [se3.apply((R, t), p) for p in models[i]["positions"]]
        print "transformed points"
        errors.append(matching_error(transformed_points, scene_full))
        print "appended errors"
        print "Object", objects[i], "matching error:", errors[-1]
        models[i]["positions"] = transformed_points

    # pick one of the models to visualize
    visualization_model = 0

    opengl_plot = OpenGLPlot(models[visualization_model], scene_full)
    opengl_plot.initialize_main_loop()