analogdevicesinc / adi_3dtof_adtf31xx

The ADI 3D ToF ADTF31xx is a ROS (Robot Operating System) package for working with ADI’s ADTF3175D ToF sensor.
Other
4 stars 1 forks source link

Pointcloud data generation. #4

Open bala-t opened 2 weeks ago

bala-t commented 2 weeks ago

Hi there,

we are trying to extract point cloud data from the raw frame, like wise you guys did using TOF module. used some formulas to generate but could not be able to match the point cloud generated using TOF module. The binaries are only available for ubuntu 20 and we need it for arm platform.

Is there any way to know about how this " computePointCloud" function are defined. what are intrinsic parameters used and Is there any camera distortion coefficients used in generation of point cloud.

Pls, help with necessary info.

anilsripadarao commented 2 weeks ago

Hi Bala, You can refer to computePointCloud() function definition in _image_procutils.h file. We use intrinsics, and distortion parameters to compute the point cloud. Also, note that the package can also run on ARM platform.

bala-t commented 1 week ago

Anil,

Thanks for the reply. if we run the below command, it will gives us three different frames namely AB, Radian depth and raw_frames_release_mode3_0.bin file right. whats the logic used to extract xyz from raw frame.

_./tofi_compute_depth --I=/home/balajit/Downloads/ADTF3175_TOF/raw_frames_release_mode3 --O=/home/balajit/Downloads/ADTF3175_TOF/raw_frames_release_mode3/processed --CCB=./crXXX.ccb --MODE=3 --INI=config/RawToDepthAdsd3500_lr-qnative.ini --ISPEnable=1 The resolution we are using is 512*512. Reading Depth Data:

We read the depth data from a frame0.raw file containing 16-bit depth values.
Each depth value was extracted by combining two consecutive bytes.

Camera Intrinsic Parameters:

Initial parameters (fx, fy, cx, cy) were used based on general assumptions and specific calibration data (e.g., Freiburg 1 RGB).
These parameters are essential for projecting 2D depth data into 3D space.

Point Cloud Generation:

Each depth value was converted to 3D coordinates using the intrinsic parameters.
Adjustments were made to Y and Z values to try and match the TOF module's output:

To resolve this issue, we need:

Exact Intrinsic Parameters:
    Accurate focal lengths (fx, fy) and optical center coordinates (cx, cy) used by the TOF module.
    Any documentation or calibration data specific to the TOF module.

Distortion Coefficients:
    The set of distortion coefficients (d0, d1, d2, d3, d4) applied by the TOF module.
    Information on how these coefficients are used in the point cloud generation process.

Verification of Our Approach:
    Review of our current method for depth data extraction and conversion.
    Suggestions for any additional corrections or improvements to better match the TOF module's output.

convert_xyz.txt

    Also pls provide more info about package to run on ARM platform. concept to find xyz image from raw file is all we needed.

    Thanks & regards,
    Balaji
anilsripadarao commented 1 week ago

Hi Balaji, If you are looking for the information on "tofi_compute_depth" executable, I would suggest to look at the https://github.com/analogdevicesinc/ToF repo. However, if you want to read camera parameters and compute xyz(point-cloud) you can refer to the functions in src/input_sensor_adtf31xx.cpp(configureSensor()) and include/image_proc_utils.h(computePointCloud()). Hope, it helps.

bala-t commented 1 week ago

Anil,

How is that XYZ frame is being extracted from raw frame. Is there any document to refer.?

Regards, Balaji T

anilsripadarao commented 1 week ago

Hi Bala, If you are referring to tofi_compute_depth executable, please refer to https://github.com/analogdevicesinc/ToF repo. In general XYZ frames(point clouds) are constructed using the Depth images by standard 2d-3d transformation(https://medium.com/yodayoda/from-depth-map-to-point-cloud-7473721d3f). Please refer to include/image_proc_utils.h(computePointCloud()) for code. Regards, Anil M S