analogdevicesinc / ToF

MIT License
36 stars 26 forks source link

XYZ bin file generation using tofi_compute_depth #695

Open Vignesh-E opened 5 months ago

Vignesh-E commented 5 months ago

Hi there,

We are trying to extract point cloud data from the raw frame, like wise you guys did using TOF module.

./tofi_compute_depth --I=./ADTF3175_TOF/raw_frames_release_mode3 --O=./ADTF3175_TOF/raw_frames_release_mode3/processed --CCB=./crXXX.ccb --MODE=3 --INI=config/RawToDepthAdsd3500_lr-qnative.ini --ISP_Enable=1

if we run the above command, it will gives us three different frames namely AB, Radian depth and xyz bin files right. whats the logic used to extract xyz from raw frame.

I tried using a GenerateXYZTables() function, but still not able extract same xyz frames.

Pls, help with necessary info.

andrestraker commented 5 months ago

Hi,

For lr-qnative the frame received from the ADSD3500 already needs to be de-interleaved, followed by extraction of the AB, depth and confidence frames.

Afterwards, the XYZ can be derived.

This can be seen in the following code: https://github.com/analogdevicesinc/ToF/tree/main/sdk/common/adi/depth-compute-opensource/src

Note, we have an example that will show this functionality more directly. This example is expected to be ready by 7/3. I will update here.

Regards, Andre

Vignesh-E commented 4 months ago

Hi andre,

Is it possible build tofi_compute_depth binary in TOF git repository?

It is not getting built by default. Do I need enable any flag to build tofi_compute_depth binary?

Regards, Vignesh

andrestraker commented 4 months ago

No, it is not possible to do so. It is supplied as a binary in the eval kits, 4.3.0 and earlier.

Vignesh-E commented 4 months ago

how to calcuate distance using xyz bin file?

andrestraker commented 4 months ago

z is the distance in mm.

Vignesh-E commented 4 months ago

This distance is the measurement from camera to oobject right?

andrestraker commented 4 months ago

Correct.

Vignesh-E commented 3 months ago

Hi andre,

I'm running in mode 3, so every 4 ,5 byte has Absolute Brightness. For few pixel it has values only in 4th byte and 5th byte is 0, for few pixel values in 4th and 5th byte

I'm reading and displaying it as uint16 data, for pixel which has data in 4th and 5th was not giving proper video.

I'm not sure how to process it for preview and display

Can you please help me on this

Thanks Vignesh

andrestraker commented 3 months ago

Hi Vignesh,

I am assuming you are referring to the fact that the data coming from the eval kit is interleaved before processing. The NXP we use in the eval kit does not support virtual channels. Therefore the data comes interleaved from the ToF sensors.

You can see how to de-interleave the data via the following code: https://github.com/analogdevicesinc/ToF/blob/08d887e82b781f0e95bbc8abca724f03437b4a12/sdk/common/adi/depth-compute-opensource/src/tofiCompute.cpp#L66

Note, this discussion is relevant to pre-v5.0.0.

Regards, Andre