This shows you the differences between two versions of the page.
Next revision | |||
— | resources:eval:user-guides:eval-adsd3100-nxz:tof_auxtools_cli [14 Feb 2022 22:35] – created Andre Straker-Payne | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Time-of-Flight Auxiliary Tools ====== | ||
+ | |||
+ | The ADI Time-of-Flight Evaluation package provides additional tools for the user. These tools are generally secondary software that provide analysis of data generated by the Time-of-Flight signal chain. | ||
+ | |||
+ | These tools are in the // | ||
+ | |||
+ | In general the auxiliary tools require Python. | ||
+ | |||
+ | <note warning> | ||
+ | |||
+ | == Setting up Python == | ||
+ | |||
+ | - Install Miniconda (64-bit): https:// | ||
+ | - Open the " | ||
+ | - In the Miniconda prompt, create the virtual environment via environment.yaml | ||
+ | - cd <TOF installation folder> | ||
+ | - conda env create --file environment.yaml --name tof-tools-py39 | ||
+ | |||
+ | == Using Python == | ||
+ | |||
+ | - Open the " | ||
+ | - In the Miniconda prompt, create the virtual environment via environment.yaml | ||
+ | - cd <TOF installation folder> | ||
+ | - conda activate tof-tools-py39 | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Depth Compute ===== | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | **Overview** | ||
+ | |||
+ | tofi_compute_depth application processes the input raw files captured using ADI ToF system and generates Radial-Depth/ | ||
+ | |||
+ | **Getting Python ready:** | ||
+ | |||
+ | - Open the " | ||
+ | - In the Miniconda prompt, create the virtual environment via environment.yaml | ||
+ | - cd <TOF installation folder> | ||
+ | - conda activate tof-tools-py39 | ||
+ | |||
+ | **Tool help** | ||
+ | |||
+ | < | ||
+ | tofi_compute_depth --I=< | ||
+ | tofi_compute_depth (-h | --help) | ||
+ | tofi_compute_depth --version | ||
+ | |||
+ | Command Line Parameters: | ||
+ | -h --help | ||
+ | --version | ||
+ | --I=< | ||
+ | --O=< | ||
+ | --CCB=< | ||
+ | --MODE=< | ||
+ | --INI=< | ||
+ | |||
+ | Unit Testing Command Line Parameters: | ||
+ | --CONFIG=< | ||
+ | --b=< | ||
+ | --iterate=< | ||
+ | </ | ||
+ | |||
+ | **Example Usage** | ||
+ | < | ||
+ | tofi_compute_depth.exe --I=input_raw_file_folder --CCB=cal_file --MODE=mode --O=output_path | ||
+ | </ | ||
+ | |||
+ | Note: The ' | ||
+ | |||
+ | **Example for processing single raw file** | ||
+ | |||
+ | < | ||
+ | tofi_compute_depth.exe --I=./ | ||
+ | </ | ||
+ | |||
+ | Note: The filenames mentioned in the above example are for reference only, they need to be replaced with correct input/ | ||
+ | |||
+ | **Example for fsf file input with 1 or more frames** | ||
+ | |||
+ | < | ||
+ | tofi_compute_depth.exe --I ./ | ||
+ | </ | ||
+ | |||
+ | **Output** | ||
+ | |||
+ | * The output files will be generated in < | ||
+ | |||
+ | **Visualize Depth Image** | ||
+ | |||
+ | * Dependency : Requires Python 3.1(or later), numpy, and matplotlib libraries for visualization. | ||
+ | * The output AB (active brightness) and Radial depth images can be visualized using the python scripts ' | ||
+ | |||
+ | < | ||
+ | python visualize_ab.py < | ||
+ | positional arguments: | ||
+ | file path to AB data file | ||
+ | optional arguments: | ||
+ | width width of the image (default is 1024) | ||
+ | height | ||
+ | |||
+ | python visualize_depth.py < | ||
+ | positional arguments: | ||
+ | file path to RadialDepth data file | ||
+ | optional arguments: | ||
+ | width width of the image (default is 1024) | ||
+ | height | ||
+ | </ | ||
+ | |||
+ | **Example** | ||
+ | |||
+ | < | ||
+ | python visualize_ab.py test_data\MP\AB\frame_1001229429_0.bin 1024 1024 | ||
+ | </ | ||
+ | |||
+ | **Example** | ||
+ | |||
+ | < | ||
+ | python visualize_depth.py test_data\MP\RadialDepth\frame_1001229429_0.bin 1024 1024 | ||
+ | </ | ||
+ | |||
+ | **Visualize Point Cloud** | ||
+ | |||
+ | * Dependency : Requires Python 3.1(or later) and Open3D library for visualization. Open3D can be installed using python installer package as "pip install open3D" | ||
+ | * The output XYZ image (point cloud) can be visualized using the python script " | ||
+ | |||
+ | < | ||
+ | python visualize_pointcloud.py [-h] [--version] < | ||
+ | |||
+ | positional arguments: | ||
+ | width width of the image | ||
+ | height | ||
+ | xyz_file | ||
+ | |||
+ | optional arguments: | ||
+ | -h, --help | ||
+ | --version | ||
+ | </ | ||
+ | |||
+ | **Example** | ||
+ | |||
+ | < | ||
+ | python .\visualize_pointcloud.py 1024 1024 .\test_data\MP\XYZ\frame_1001229429_0.bin | ||
+ | </ | ||
+ | |||
+ | **Known Issues** | ||
+ | |||
+ | * The application may crash if wrong calibartion/ | ||
+ | * Frames/sec value may be reported incorrectly as ' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== FSF Extraction ===== | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | FSF is a video file format that is used by Microsoft to store various video data such as RAW, DEPTH, AB and XYZ. It supports the concept of streams for each of the data type. This format allows us to capture all video information | ||
+ | in a single file or separate files per stream. | ||
+ | |||
+ | Run the python file to extract FSF information (AB, Depth, Point-Cloud), | ||
+ | |||
+ | |||
+ | **Getting Python ready** | ||
+ | |||
+ | - Open the " | ||
+ | - In the Miniconda prompt, create the virtual environment via environment.yaml | ||
+ | - cd <TOF installation folder> | ||
+ | - conda activate tof-tools-py39 | ||
+ | |||
+ | **Example usage with the example FSF file that is included** | ||
+ | |||
+ | //Extract all frames// | ||
+ | < | ||
+ | python fsf_extract.py data/ | ||
+ | </ | ||
+ | //Extract frame 0 only// | ||
+ | < | ||
+ | python fsf_extract.py data/ | ||
+ | </ | ||
+ | //Extract frame 1, 2, 3// | ||
+ | < | ||
+ | python fsf_extract.py data/ | ||
+ | </ | ||
+ | |||
+ | **Output is placed into the //output// folder** | ||
+ | * frame_x_ab_lin.png | ||
+ | * frame_x_ab_log.png | ||
+ | * frame_x_depth_z.png | ||
+ | * frame_x_depth_z_gray16.png | ||
+ | * frame_x_depth_r.png | ||
+ | * frame_x_depth_r_gray16.png | ||
+ | * frame_x.ply | ||
+ | |||
+ | ---- | ||