def save_point_cloud_from_VREP():
    depth_im, rgb_im = save_images_from_VREP("preDiploma_PC/")

    depth, rgb = image_processing.calculate_point_cloud(rgb_im, depth_im)

    current_object = PointsObject()
    current_object.add_points(depth, rgb)
    current_object.save_all_points("preDiploma_PC/", "box")
Пример #2
0
def save_point_cloud_from_images():
    rgb_im = image_processing.load_image("preDiploma_PC/", "rgb_box_0.png")
    depth_im = image_processing.load_image("preDiploma_PC/", "depth_box_0.png",
                                           "depth")
    points, color = image_processing.calculate_point_cloud(
        rgb_im / 255, depth_im / 255)
    current_object = PointsObject()
    current_object.add_points(points, color)
    current_object.save_all_points("preDiploma_PC/", "box")
Пример #3
0
def check_data_generation():
    data_generation.save_images_from_VREP()
    depth_im = image_processing.load_image("3d_map/", "room_depth0.png",
                                           "depth")
    rgb_im = image_processing.load_image("3d_map/", "room_rgb0.png")

    xyz, rgb = image_processing.calculate_point_cloud(rgb_im / 255,
                                                      depth_im / 255)

    temp = PointsObject()
    temp.add_points(xyz, rgb)
    temp.save_all_points("3d_map/", "room")
    visualization.visualize([temp])
Пример #4
0
def point_cloud_from_VREP():
    import vrep_functions
    import image_processing
    """Function for checking if vrep_functions and PointsObject are working fine"""
    client_id = vrep_functions.vrep_connection()
    vrep_functions.vrep_start_sim(client_id)
    kinect_rgb_id = vrep_functions.get_object_id(client_id, 'kinect_rgb')
    kinect_depth_id = vrep_functions.get_object_id(client_id, 'kinect_depth')
    depth_im, rgb_im = vrep_functions.vrep_get_kinect_images(
        client_id, kinect_rgb_id, kinect_depth_id)
    image_processing.save_image(rgb_im, "preDiploma_PC/", 0, "rgb_box_")
    image_processing.save_image(depth_im, "preDiploma_PC/", 0, "depth_box_")

    print(depth_im.shape, rgb_im.shape)
    vrep_functions.vrep_stop_sim(client_id)

    depth, rgb = image_processing.calculate_point_cloud(rgb_im, depth_im)

    current_object = PointsObject()
    current_object.add_points(depth, rgb)
    current_object.save_all_points("preDiploma_PC/", "box")
Пример #5
0
def save_points_cloud():
    points_cloud, points_color = create_points_cloud()
    object = PointsObject()
    object.set_points(points_cloud, points_color)
    object.save_all_points("Test", "ball")