Esempio n. 1
0
for i in range(0, len(ref_image_list)):
    im_greyscale_reference, im_depth_reference = ref_image_list[i]
    im_greyscale_target, im_depth_target = target_image_list[i]

    im_depth_reference /= depth_factor
    im_depth_target /= depth_factor


    #depth_t = (im_depth_reference != 0).astype(Utils.depth_data_type_float)
    #im_depth_reference = np.add(im_depth_reference,depth_t)
    #depth_t = (im_depth_target != 0).astype(Utils.depth_data_type_float)
    #im_depth_target = np.add(im_depth_target,depth_t)

    # We only need the gradients of the target frame
    frame_reference = Frame.Frame(im_greyscale_reference, im_depth_reference, camera_reference, False)
    frame_target = Frame.Frame(im_greyscale_target, im_depth_target, camera_target, True)

    solver_manager = SolverThreadManager.Manager(1,
                                                 "Solver Manager",
                                                 frame_reference,
                                                 frame_target,
                                                 max_its=50,
                                                 eps=0.002,  #0.001, 0.00001, 0.00005, 0.00000001
                                                 alpha_step=0.63,  # 0.1, 0.04, 0.005, 0.55 - motion prior
                                                 gradient_monitoring_window_start=0,
                                                 image_range_offset_start=0,
                                                 twist_prior=twist_prior,
                                                 motion_cov_inv = motion_cov_inv,
                                                 use_ndc=use_ndc,
                                                 use_robust=True,
Esempio n. 2
0
 def test_init_raise(self):
     with self.assertRaises(TypeError):
         Frame.Frame(self.pixels_uint8, self.depth_float32, self.camera_identity, False)
Esempio n. 3
0
#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)
#cv2.imshow('image z-standard',pixels_normalized_disp)


#grayscale_image = ImageProcessing.normalize_to_image_space(frame.grad_x)
#abs = np.absolute(frame.grad_x)
#normed = cv2.normalize(abs, None, alpha=0, beta=65535, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_16UC1)
#cv2.imwrite("grad_x_scharr.png",abs)

while True:
Esempio n. 4
0
 def test_init(self):
     Frame.Frame(self.pixels_float32, self.depth_float32, self.camera_identity, False)