Skip to content

LuisOrtizF/Robotic_and_Computer_Vision_Projects_cpp_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robotic and Computer Vision Projects with C++


This repository contains projects of computer vision tasks implemented with C++ libraries.

opencv_logo pcl_logo cmake_logo
  • Kitti_Clouds_Viewer_and_Writer (leftCamRef): Visualize in 3D and write Kitti sequence point clouds in PCL format (.pcd). The output point clouds are in the left camera coordinate system.
    • inputs:
      • times_file_path: path of the directory where the times (.txt) file of the kitti sequences is saved
      • clouds_sequence_path: path of the directory where the kitti point clouds (.bin) are saved
      • max_frame: max mumber of frame in the sequence that we need visualize or write
      • write_flag (optional): use only if you need save the point clouds into (.pcd) PCL format.
    • how use: ./clouds_viewer_writer <times_file_path> <clouds_sequence_path> <max_frame> <write_flag>
    • example: ./clouds_viewer_writer ~/data_odometry_gray/sequences/04/ ~/clouds/sequences/04/ 270 -w
    • output: folder ~/build/sequence_clouds/ with the saved point cloud, only if you set write_flag with -w
  • Kitti_Clouds_Viewer_and_Writer (lidarRef): Visualize in 3D and write Kitti sequence point clouds in PCL format (.pcd). The output point clouds are in the Velodyne lidar coordinate system.
    • inputs:
      • times_file_path: path of the directory where the times (.txt) file of the kitti sequences is saved
      • clouds_sequence_path: path of the directory where the kitti point clouds (.bin) are saved
      • max_frame: max mumber of frame in the sequence that we need visualize or write
      • write_flag (optional): use only if you need save the point clouds into (.pcd) PCL format.
    • how use: ./clouds_viewer_writer <times_file_path> <clouds_sequence_path> <max_frame> <write_flag>
    • example: ./clouds_viewer_writer ~/data_odometry_gray/sequences/04/ ~/clouds/sequences/04/ 270 -w
    • output: folder ~/build/sequence_clouds/ with the saved point cloud, only if you set write_flag with -w
kitti_clouds_viewer
  • Kitti_Convert_StereoImages_to_PointClouds: Convert kitti sequence gray images into PCL point clouds (.pcd).
    • inputs:
      • sequence_path: path of the directory where the kitti images are saved
      • num_frames: number of frames in the sequence that we need convert
      • write_flag (optional): use only if you need save the point clouds into PCL format.
    • how use: ./stereo2cloud <sequence_path> <num_frames> <write_flag (optional)>
    • example: ./stereo2cloud ~/data_odometry_gray/sequences/04/ 270 -w
    • output: folder ~/build/sequence_clouds/ with the saved point cloud, only if you set write_flag with -w
stereo2cloud
  • Kitti_Odometry_Viewer: Visualization 3D of the Kitti cameras odometry
    • inputs:
      • kitti_poses_file: poses file (.txt) of the kitti sequence
    • how use: ./kitti_odometry_viewer <kitti_poses_file>
    • example: ./kitti_odometry_viewer ~/data_odometry_poses/poses/04.txt
    • output: file ~/build/poses_quaternion.txt with the kitti sequence poses (tx ty tz qw qx qy qz)
  • Kitti_Save_Scales: Compute the scales for a Kitti sequence. The scale is computed using the ground truth poses.
    • inputs:
      • kitti_poses_file: poses file (.txt) of the kitti sequence to compute the scales
      • out_file_name: name of the output file (.txt) where the code save the kitti sequence scales
    • how use: ./kitti_scales <kitti_poses_file> <out_file_name>
    • example: ./kitti_scales ~/data_odometry_poses/poses/04.txt ~/Desktop/scales_kitti_seq_04.txt
    • output: (.txt) file with the saved scales
  • Kitti_Sttiching: Demonstrates how to use the Stitching module of OpenCV to create a panorama using left and right images of the Kitti sequence.
    • inputs:
      • sequence_path: path of the directory where the kitti images are saved
    • how use: ./panorama <sequence_path>
    • example: ./panorama ~/data_odometry_gray/sequences/04/
    • output: file ~/build/panorama.png with the result of the sttiching beeteen left and right images.
  • Plot_3D_Arrow: Test PCL visualizer plotting 3D arrows.
    • how use: ./plot_3D
  • Real_Time_Chessboard_Corners_Detection: Detect and plot the corners of a chessboard in real-time using OpenCV and a webcam.
    • how use: ./livecorners
  • Real_Time_Chessboard_Corners_Detection_SVO: Detect and plot the corners of a chessboard in (.svo*) video using OpenCV.
    • how use: ./zedcorners
  • Record_SVO_from_ZED: Record an (.svo) video using ZED camera.
    • inputs:
      • cam_resolution: ZED camera resolutions VGA or HD720 or HD1080 or HD2K
      • output_dir: directory to save the (.svo) video and the camera intrinsic parameters
    • how use:./record_svo_zed <cam_resolution> <output_dir>
    • example: ./record_svo_zed HD720 ~/Desktop
    • output: a folder with the (.svo) video and a (.txt) file with the camera intrinsic parameters
  • Record_SVO_ZED+P3AT_Automatic: Record a video using a ZED camera mounted on a robot Pioneer 3AT. The robot moves into a straight line for some distance. When the robot starts, use the arrow keys to drive it and the spacebarto stop. Assume you are ready to record a video, then press keyato switch to automatic mode. PressEsc` to exit.
    • inputs:
      • cam_resolution: ZED camera resolutions VGA or HD720 or HD1080 or HD2K
      • output_dir: directory to save the (.svo) video
      • distance_in_mm: distance that the robot moves fordward in straight line
    • how use: ./record_svo_automatic <cam_resolution> <output_dir> <distance_in_mm> -rp /dev/ttyUSB0
    • example: ./record_svo_automatic HD720 ~/Desktop/ 17000 -rp /dev/ttyUSB0
    • output: a folder with the (.svo) video.
  • Record_SVO_ZED+P3AT_Manual: Record a video using a ZED camera mounted on a robot Pioneer 3AT. You can drive the robot with the keyboard (arrows). Then when you are ready to record, press s and press q to exit when you finish.
    • inputs:
      • cam_resolution: ZED camera resolutions VGA or HD720 or HD1080 or HD2K
      • output_dir: directory to save the (.svo) video and camera parameters file.
    • how use: ./record_svo_manual <cam_resolution> <output_dir> -rp /dev/ttyUSB0
    • example: ./record_svo_manual HD720 ~/Desktop/ -rp /dev/ttyUSB0
    • output: a folder with the (.svo) video and camera parameters file .yml
  • Registration_3D_using_Features: Demonstrates how use the registration PCL module. This code computes the relative transform between two point clouds.
    • inputs:
      • source_cloud : (.pcd) PCL cloud
      • target_cloud : (.pcd) PCL cloud
    • how use:./registration3D <source_cloud> <target_cloud>
  • Registration_Point_Clouds_using_SVD: Compute the transformation between two point clouds using the SVD algorithm. Use this transformation to register the two-point clouds. Finally, compute the RMSE between the two-point clouds.
    • how use:./svd
  • Save_ZED_All_Data: Capture left, right images, depth, and a point cloud from the ZED.
    • how use:./save_all <VGA or HD720 or HD1080 or HD2K>
    • outputs:
      • /left/: folder with (.png) images
      • /right/: folder with (.png) images
      • /depth/: folder with (.png) depth map (in milieters)
      • /cloud/: folder with (.pcd) clouds
      • /poses.txt: camera poses referenced to the world coordinate system in Kitti format
      • /confidence.txt: depth map confidence
      • /times.txt: timestamps in milliseconds
      • /calibration.txt: intrinsics parameters of the camera
  • Save_ZED_Data_Manual(keyboard): Capture left, right images, depth, and a point cloud from the ZED using the keyboard. When you press s or S the code saves data only of the current frame.
    • how use:./save_all <VGA or HD720 or HD1080 or HD2K>
    • outputs:
      • /left/: folder with (.png) images
      • /right/: folder with (.png) images
      • /depth/: folder with (.png) depth map (in milieters)
      • /cloud/: folder with (.pcd) clouds
      • /poses.txt: camera poses referenced to the world coordinate system in Kitti format
      • /confidence.txt: depth map confidence
      • /times.txt: timestamps in milliseconds
      • /calibration.txt: intrinsics parameters of the camera
  • Save_ZED_Processing_Times(Images_Depth_Clouds): Carried out and analyzed of processing times of each capture step in the ZED camera, i.e., the time that takes in capture an image, a depth map, and a point cloud.
    • inputs:
      • zed_resolution : VGA or HD720 or HD1080 or HD2K
      • frames_per_second : Remember that VGA mode have 15, 30, 60 and 100 fps. HD720 mode have 15, 30 and 60 fps. HD1080 mode have 15 and 30 fps and HD2K mode have only 15 fps.
    • how use: ./save_processing_times <zed_resolution> <frames_per_second>
    • outputs:
      • depth_var_xx: (.png) image that reflects the variance in each pixel of the all taked images
      • depth_mean_xx: (.png) image that reflects the mean in each pixel of all taked images for the analisys
      • depth_var_xx: (.txt) file with the variance in each pixel of all taked images for the analisys
      • depth_mean_xx: (.txt) file with the mean in each pixel of all taked images for the analisys
  • Save_ZED_Undistorted_and_Distorted_Images:
    • inputs:
      • zed_resolution : VGA or HD720 or HD1080 or HD2K
    • how use: ./save_zed <zed_resolution>
    • outputs:
      • /left/: folder with (.png) left rectifiqued (undistorted) images
      • /right/: folder with (.png) right rectifiqued (undistorted) images
      • /left_unrec/: folder with (.png) left unrectifiqued (distorted images
      • /right_unrec/: folder with (.png) right unrectifiqued (distorted) images
      • /calibration.txt: (.txt) file with intrinsic parameters of left and right cameras
  • Save_ZED(SVO)_Images_and_Poses_in_Kitti_Format: Save left and right images form (.svo) video. Also, save camera poses in Kitti format.
    • inputs:
      • svo_video : (.svo) file path
    • how use: ./save_zed_data <svo_video>
    • example: ./save_zed_data ../Data/test.svo
    • outputs:
      • ../Data/left/: folder with saved left rgb images
      • ../Data/right/: folder with saved right rgb images
      • ../Data/poses_world.txt: file with ZED poses referenced to world coordinate system
      • ../Data/poses_camera.txt: file with ZED poses referenced to camera coordinate system
  • Save_ZED(SVO)_Poses_in_TUM_Format: Save ZED camera poses form (.svo) video. The poses are in TUM format.
    • inputs:
      • svo_video : (.svo) file path
    • how use:./save_zed_data <svo_video>
    • example: ./save_zed_data ../Data/test.svo
    • outputs:
      • ../Data/poses_zed.txt: file with ZED poses referenced to camera coordinate system
  • Test_Kv1_using_OpenNI: Test the Microsoft Kinect version 1 using OpenNI.
    • how use:./test_kv1
  • Test_Kv2_using_Libfreenect2: Test the Microsoft Kinect version 2 using Libfreenect2.
    • how use:./test_kv1
  • Test_Kv2_using_OpenNI: Test the Microsoft Kinect version 2 using OpenNI.
    • how use:./test_kv1
  • Visual_Monocular_SLAM_using_UcoSlam: Compute visual monocular SLAM using UcoSlam (MODE_SLAM).
    • inputs:
      • video : (.avi) video recorded with a monocular camera
      • camera_parameters : .yml file with the intrinsics parameters of the camera
      • vocabulary : .fbow vocabulary for the ORB keypoint descriptor
      • output_map : .map result map with all data
    • how use: ./ucoslam_monocular <video> <camera_parameters> <vocabulary> <output_map>
    • example: ./ucoslam_monocular ../Data/test.avi ../Data/mono_params.yml ../Data/orb.fbow ../Data/out.map
    • outputs:
      • ../Data/poses_Kitti.txt: file with camera poses referenced to camera coordinate system in Kitti format.
ucoslam_monocular_slam
  • Visual_Stereo_SLAM_using_UcoSlam: Compute visual stereo SLAM using UcoSlam (MODE_SLAM) in a Kitti sequence. MODE_SLAM is used to create and update maps. In that mode, the MapManager thread is activated to decide when keyframes are added, etc.
    • inputs:
      • video_left : .mp4 video recorded with left camera
      • video_right : .mp4 video recorded with right camera
      • stereo_calibration_file : .yml file with the intrinsics and extrinsics parameters of the left and right cameras
      • kitti_times_file : (.txt) kitti times file of the sequence
      • output_poses : (.txt) file with the saved camera poses in TUM format
      • voc_path : .fbow vocabulary for the ORB keypoint descriptor
      • ucoslam_params : .yml parameters to setup UcoSlam
    • how use:./slam_stereo <video_left> <video_right> <stereo_calibration_file> <kitti_times_file> <output_poses> <voc_path> <ucoslam_params>
    • example: ./slam_stereo ../Data/cam0.mp4 ../Data/cam1.mp4 ../Data/stereo.yml ../Data/times.txt ../Data/poses_TUM.txt ../Data/orb.fbow ../Data/myparams.yml
    • outputs:
      • ../Data/poses_TUM.txt: file with camera poses referenced to camera coordinate system
ucoslam_stereo_slam

Installation:

  • Dependences (mandatory):

    • ZED SDK 3.0
    • CUDA 10.0
    • OpenCV 3.4.1
    • Aruco 3.0.12
    • PCL 1.8
    • ARIA or ARIACODA
    • UcoSLAM
    • Boost
    • Freenect2
    • Libviso2
    • Open-NI
    • Libusb 1.0
  • Download any project and open a terminal ctrl+t:

    $ cd path 
    $ mkdir build & cd build 
    $ cmake .. 
    $ make
    

NOTE:

If you find any of these codes helpful, please share my GitHub and STAR ⭐ this repository to help other enthusiasts to find these tools. Remember, the knowledge must be shared. Otherwise, it is useless and lost in time.

About

This repository contains projects of computer vision tasks implemented with C++ libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published