Пример #1
0
def generate_image_depth_pair_match(dataset_root, rgb_file_path,
                                    depth_file_path, match_text, image_id):
    rgb_ref_file_path, depth_ref_file_path = associate.return_rgb_depth_from_rgb_selection(
        rgb_file_path, depth_file_path, match_text, dataset_root, image_id)
    im_greyscale_reference = cv2.imread(
        rgb_ref_file_path, cv2.IMREAD_GRAYSCALE).astype(Utils.image_data_type)
    im_greyscale_reference = ImageProcessing.z_standardise(
        im_greyscale_reference)
    im_depth_reference = cv2.imread(depth_ref_file_path,
                                    cv2.IMREAD_ANYDEPTH).astype(
                                        Utils.depth_data_type_float)

    return im_greyscale_reference, im_depth_reference
Пример #2
0
def generate_image_depth_pair(dataset_root, rgb_folder, depth_folder, image_id,
                              ext):

    image_id_str = f'{image_id:.9f}'
    rgb_ref_file_path = dataset_root + rgb_folder + image_id_str + ext
    depth_ref_file_path = dataset_root + depth_folder + image_id_str + ext

    im_greyscale_reference = cv2.imread(
        rgb_ref_file_path, cv2.IMREAD_GRAYSCALE).astype(Utils.image_data_type)
    im_greyscale_reference = ImageProcessing.z_standardise(
        im_greyscale_reference)
    im_depth_reference = cv2.imread(depth_ref_file_path,
                                    cv2.IMREAD_ANYDEPTH).astype(
                                        Utils.depth_data_type_float)
    return im_greyscale_reference, im_depth_reference
Пример #3
0
from Numerics import Utils
import Camera.Intrinsic as Intrinsic
import Camera.Camera as Camera
import Solver_Cython
from VisualOdometry import Frame
from Numerics import ImageProcessing

# TODO use raw depth values

#im_greyscale_reference = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_fov_90_square_Y.png',0)
im_greyscale_reference = cv2.imread(
    '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_fov_90_square.png',
    0)
#im_greyscale_reference = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_fov_90_square_negative.png',0)
#im_greyscale_reference = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Home_Images/Images_ZR300_X_Trans_Depth/image_25_small.png',0)
im_greyscale_reference = ImageProcessing.z_standardise(im_greyscale_reference)

#im_greyscale_target = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_translated_fov_90_square_Y.png',0)
im_greyscale_target = cv2.imread(
    '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_translated_fov_90_square.png',
    0)
#im_greyscale_target = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_left_90_fov_90_square.png',0)
#im_greyscale_target = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/framebuffer_translated_fov_90_square_negative.png',0)
#im_greyscale_target = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Home_Images/Images_ZR300_X_Trans_Depth/image_30_small.png',0)
im_greyscale_target = ImageProcessing.z_standardise(im_greyscale_target)

#depth_reference = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/depthbuffer_fov_90_square_Y.png',0).astype(
#    Utils.depth_data_type)
depth_reference = cv2.imread(
    '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Synthetic/depthbuffer_fov_90_square.png',
    0).astype(Utils.depth_data_type)
Пример #4
0
import numpy as np
import cv2
import Camera.Intrinsic as Intrinsic
import Camera.Camera as Camera
from VisualOdometry import Frame
from Numerics import ImageProcessing, Utils

#im_greyscale = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Home_Images/Images_ZR300_XTrans/image_1.png',0)
#im_greyscale = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/rccar_26_09_18/marc_1_full/color/966816.173323313.png',cv2.IMREAD_GRAYSCALE)
#im_greyscale = cv2.imread('/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Bench/rgbd_dataset_freiburg2_desk/rgb/1311868164.363181.png',cv2.IMREAD_GRAYSCALE)
im_greyscale = cv2.imread('/Users/marchaubenstock/Workspace/Rust/open-cv/images/calib.png',cv2.IMREAD_GRAYSCALE)
#im_greyscale = im_greyscale.astype(Utils.image_data_type)

pixels_standardised = ImageProcessing.z_standardise(im_greyscale)
pixels_norm = im_greyscale.astype(np.float64)

pixels_normalized_disp = ImageProcessing.normalize_to_image_space(pixels_standardised)
pixels_disp = ImageProcessing.normalize_to_image_space(pixels_norm)
depth_image = pixels_standardised.astype(Utils.depth_data_type_int)

se3_identity = np.identity(4, dtype=Utils.matrix_data_type)
intrinsic_identity = Intrinsic.Intrinsic(-1, -1, 0, 0)
camera_identity = Camera.Camera(intrinsic_identity, se3_identity)

frame = Frame.Frame(pixels_standardised, depth_image, camera_identity, True)

#cv2.imshow('grad x',frame.grad_x)
cv2.imshow('grad x abs',np.abs(frame.grad_x))
#cv2.imshow('neg sobel x',-frame.grad_x)
#cv2.imshow('sobel y',frame.grad_y)
#cv2.imshow('image',pixels_disp)