licornea_tools

calibration
   calibrate_intrinsics
   cameras_from_checkerboards
   cg_choose_refgrid
   cg_compare_straight_depths
   cg_cors_viewer_f
   cg_cors_viewer_v
   cg_filter_features
   cg_generate_artificial
   cg_measure_optical_flow_slopes
   cg_model_optical_flow_slopes
   cg_optical_flow_cors
   cg_optical_flow_features
   cg_rcpos_from_cors
   cg_redistribute_cors
   cg_rotation_from_depths
   cg_rotation_from_fslopes
   cg_slopes_viewer
   cg_stitch_cameras
   cg_straight_depths_from_depths
   cg_straight_depths_from_disparity
   cg_visualize_fslopes
   copy_cors
   cors_info
   cors_view_fpoints
   evaluate_calibration
   export_feature_depths
   merge_cors
   read_feature_depths
   remove_cors
   undistort_cors
   undistort_fpoints
   undistort_image
camera
   export_mpeg
   import_matlab
   import_mpeg
   import_xml
   merge_cameras
   restrict_cameras
   transform
   visualize
dataset
   duplicates
   flip
   missing
   slice
   view_dataset
kinect
   calibrate_color_ir_reprojection
   checkerboard_color_depth
   checkerboard_depth_parallel
   checkerboard_depth_samples
   checkerboard_depth_stat
   checkerboard_depth_viewer
   checkerboard_samples
   close_kinect
   color_intrinsic_reprojection
   depth_remapping
   depth_reprojection
   fetch_internal_parameters
   import_raw_data
   internal_ir_intrinsics
   ir_distortion_viewer
   ir_intrinsic_reprojection
   parallel_wall
   remapping_viewer
   reprojection_viewer
   viewer
misc
   apply_homography
   cam_rotation
   cat_obj_img_cors
   copy_json
   extract_all
   extract_parametric
   homography_maximal_border
   psnr
   touch
   view_depth
   view_distortion
   view_syn
   yuv_export
   yuv_import
vsrs
   export_for_vsrs
   list_increase_baseline_experiments
   list_parametric_experiments
   list_skip_n_experiments
   make_vsrs_config
   psnr_experiments
   run_vsrs
   run_vsrs_experiments
   vsrs_disparity

vsrs/vsrs_disparity

Convert depth map to YUV disparity map for use with VSRS.

vsrs/vsrs_disparity depth.png out_disparity.yuv z_near z_far [8/16]

depth.png is a 16 bit depth image, where pixel values are orthogonal distances. z_near and z_far must be set to the minimal/maximal depth values in the region of interest. A YUV file is written to out_disparity.yuv. It is by default 8 bit, but can be set to 16 bit if 16 is put as the last argument.

The output YUV file is a 3 channel YUV240 file, but only the first channel (Luma Y) is filled with depth values. It is padded to twice that size to add empty UV channels, because this is needed by VSRS.

The values for z_near and z_far need to be given to VSRS as LeftNearestDepthValue and LeftFarthestDepthValue (same for Right) in its config file. To use 16 bit disparity maps, VSRS needs to be recompiled with the appropriate flag.

Only depth values z inside [z_near, z_far] will be mapped to disparity values d. Disparity values are discrete integer values. The mapping is non-linear, for depth closer to z_near, the disparity graduation is finer. The smaller z_far - z_near, the higher the detail in the disparity map.

The mapping is d = a + b/z, with a = -255 z_near / (z_far - z_near) and b = 255 z_near z_far / (z_far - z_near). 255 becomes 65535 for 16 bit disparity maps. d is a projected depth values VSRS uses with its projection matrices to do 3D warping.