Wiki

no way to compare when less than two revisions

Differences

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 //bin\tools// folder of the installed software.
 +
 +In general the auxiliary tools require Python.
 +
 +<note warning>These tools have been only tested on Windows 10 64-bit</note>
 +
 +== Setting up Python ==
 +
 +  - Install Miniconda (64-bit): https://docs.conda.io/en/latest/miniconda.html
 +  - Open the "Anaconda prompt (Miniconda3)"
 +  - In the Miniconda prompt, create the virtual environment via environment.yaml
 +    - cd <TOF installation folder>\bin\tools\FSF
 +    - conda env create --file environment.yaml --name tof-tools-py39
 +
 +== Using Python ==
 +
 +  - Open the "Anaconda prompt (Miniconda3)"
 +  - In the Miniconda prompt, create the virtual environment via environment.yaml
 +    - cd <TOF installation folder>\bin\tools
 +    - conda activate tof-tools-py39
 +
 +----
 +
 +===== Depth Compute =====
 +
 +<note important>IMPORTANT: before using, activate the Conda environment as described in //Setting up Python//.</note>
 +
 +**Overview**
 +
 +tofi_compute_depth application processes the input raw files captured using ADI ToF system and generates Radial-Depth/AB/XYZ output images. 
 +
 +**Getting Python ready:**
 +
 +  - Open the "Anaconda prompt (Miniconda3)"
 +  - In the Miniconda prompt, create the virtual environment via environment.yaml
 +    - cd <TOF installation folder>\bin\tools
 +    - conda activate tof-tools-py39
 +
 +**Tool help**
 +
 +<code>
 +tofi_compute_depth --I=<input_fsf_or_raw_file> --O=<output_path> --CCB=<calibration> --MODE=<mode>
 +tofi_compute_depth (-h | --help) 
 +tofi_compute_depth --version
 +
 +Command Line Parameters:
 +  -h --help      Show this screen
 +  --version      Show version
 +  --I=<s>        Input file or folder
 +  --O=<s>        Output folder
 +  --CCB=<s>      Calibration Binary [default: 0]
 +  --MODE=<n>     mode of operation(Mode=10 for 1MP)  
 +  --INI=<s>      INI File (optional)
 +
 +Unit Testing Command Line Parameters:
 +  --CONFIG=<s>   Configuration File [default: 0]
 +  --b=<s>        Benchmark enable. [default: 0]
 +  --iterate=<n>  Benchmark number of iterations [default: 1]
 +</code>
 +
 +**Example Usage**
 +<code>
 +tofi_compute_depth.exe --I=input_raw_file_folder --CCB=cal_file --MODE=mode --O=output_path
 +</code>
 +
 +Note: The 'mode' setting much match the capture mode of the data in the .bin or .fsf file(s) and the calibration file (.ccb) should be the corresponding calibration file used for data capture. 
 +
 +**Example for processing single raw file**
 +
 +<code>
 +tofi_compute_depth.exe --I=./test_data/MP/raw/frame_1001229429.bin --O=./test_data/MP/  --CCB=./test_data/MP/test_data_example_040638.ccb --MODE=10
 +</code>
 +
 +Note: The filenames mentioned in the above example are for reference only, they need to be replaced with correct input/output/calibration CCB filenames. Microsoft power shell is used as command shell.
 +
 +**Example for fsf file input with 1 or more frames**
 +
 +<code>
 +tofi_compute_depth.exe --I ./test_data/QMP/example_12230.fsf --O=./test_data/QMP/ --CCB ./test_data/QMP/fsf_test_12230.ccb --MODE=0
 +</code>
 +
 +**Output**
 +
 +* The output files will be generated in <output_path> folder specified while running the tofi_compute_depth.
 +
 +**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 'visualize_ab.py' and 'visualize_depth.py', with a specific filename. 
 +
 +<code>
 +python visualize_ab.py <file> [width] [height]
 +positional arguments:
 +  file     path to AB data file
 +optional arguments:
 +  width      width of the image (default is 1024)
 +  height      height of the image (default is 1024)
 +
 +python visualize_depth.py <file> [width] [height]
 +positional arguments:
 +  file     path to RadialDepth data file
 +optional arguments:
 +  width      width of the image (default is 1024)
 +  height      height of the image (default is 1024)
 +</code>
 +
 +**Example**
 +
 +<code>
 +python visualize_ab.py test_data\MP\AB\frame_1001229429_0.bin 1024 1024
 +</code>
 +
 +**Example**
 +
 +<code>
 +python visualize_depth.py test_data\MP\RadialDepth\frame_1001229429_0.bin 1024 1024  
 +</code>
 +
 +**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 "visualize_pointcloud.py"
 +
 +<code>
 +python visualize_pointcloud.py [-h] [--version] <width> <height> <xyz_file>
 +
 +positional arguments:
 +  width       width of the image
 +  height      height of the image
 +  xyz_file    path to xyz file
 +
 +optional arguments:
 +  -h, --help  show this help message and exit
 +  --version   show program's version number and exit
 +</code>
 +
 +**Example**
 +
 +<code>
 +python .\visualize_pointcloud.py 1024 1024 .\test_data\MP\XYZ\frame_1001229429_0.bin
 +</code>
 +
 +**Known Issues**
 +
 +* The application may crash if wrong calibartion/config data is used.
 +* Frames/sec value may be reported incorrectly as 'inf', define argument '--b=1' to return a valid frames/sec estimate.
 +
 +
 +
 +
 +----
 +
 +===== FSF Extraction =====
 +
 +<note important>IMPORTANT: before using, activate the Conda environment as described in //Setting up Python//.</note>
 +
 +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), the python file uses a JSON file //bound.json// to get the values of depth_min/depth_max/ab_min/ab_max.
 +
 +
 +**Getting Python ready**
 +
 +  - Open the "Anaconda prompt (Miniconda3)"
 +  - In the Miniconda prompt, create the virtual environment via environment.yaml
 +    - cd <TOF installation folder>\bin\tools
 +    - conda activate tof-tools-py39
 +
 +**Example usage with the example FSF file that is included**
 +
 +//Extract all frames//
 +<code>
 +python fsf_extract.py data/example_XYZ.fsf 
 +</code>
 +//Extract frame 0 only//
 +<code>
 +python fsf_extract.py data/example_XYZ.fsf 0 0 
 +</code>
 +//Extract frame 1, 2, 3//
 +<code>
 +python fsf_extract.py data/example_XYZ.fsf 1 3
 +</code>
 +
 +**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
 +
 +----
  
resources/eval/user-guides/eval-adsd3100-nxz/tof_auxtools_cli.txt · Last modified: 12 Feb 2024 16:41 by Andre Straker-Payne