cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L7 Histogram configuration to get all raw histogram bins

jiantang
Associate

 

From the user manual "A Guide for Using the Artificial Intelligence Enabler VL53L7CH and VL53L8CH Multizone Time-of-Flight (ToF) Sensors" -- specifically the "Histogram Configuration" section -- it mentions that we can use 'start_bin', 'num_bins', and 'sub_sample' to configure the CNH data. I've implemented this configuration using the Example_12_cnh_data.c file, and it works well.

My first question is, how many bins are there in the device's raw histogram bins?

My second question is, how can I get all raw histogram bins?     Currently, I find that in 4x4 mode, I can obtain a maximum of 75 bins, and in 8x8 mode, a maximum of 18 bins. Is it possible to access all raw histogram bins by editing the API's source code? In other words, assuming the device's raw histogram bins number is 100, how can I obtain 4x4x100 CNH in 4x4 mode, and how to get 8x8x100 CNH in 8x8 mode?

Thanks
- Jian

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

There are 128 bins total. 

But the problem is memory size.

We buffer the results of one range, while we do the next range. And that buffer is only so big. 

That's why we compress the data. 

Each bin is 5 bytes, times either 16 (4x4) or 64 bins (8x8) and we just don't have the memory to do all that. 

It's the memory limitation that we are fighting. 

So, you can average several bins to cover the entire distance, or you can limit what area of the histogram you can extract.

But if you want it all, you are going to have to extract the first 75 bins (in 4x4) mode. The re-configure which bins you want, range again, and extract the end part of the histogram. Then stitch the two together. 

That should be a fun project to write. Would not work well if the target were moving though. 

But 75 bins times 3.75 cm/bin is 2.8 meters. Could you not just limit your investigation to that smaller range?

- john


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.

View solution in original post

2 REPLIES 2
John E KVAM
ST Employee

There are 128 bins total. 

But the problem is memory size.

We buffer the results of one range, while we do the next range. And that buffer is only so big. 

That's why we compress the data. 

Each bin is 5 bytes, times either 16 (4x4) or 64 bins (8x8) and we just don't have the memory to do all that. 

It's the memory limitation that we are fighting. 

So, you can average several bins to cover the entire distance, or you can limit what area of the histogram you can extract.

But if you want it all, you are going to have to extract the first 75 bins (in 4x4) mode. The re-configure which bins you want, range again, and extract the end part of the histogram. Then stitch the two together. 

That should be a fun project to write. Would not work well if the target were moving though. 

But 75 bins times 3.75 cm/bin is 2.8 meters. Could you not just limit your investigation to that smaller range?

- john


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.

Thank you very much!

I now understand why I can only obtain 75 bins and encounter errors when trying larger values.

Your suggestion makes sense, I have indeed tried extracting the first 75 bins, reconfigure, and extracting the remaining part and output. As you mentioned, this approach may not work well in dynamic scenarios.

I have also tried to limit the ranging distance so that 75 bins are sufficient (in fact, this is the method I am currently using).

Thank you so much for your response; it has been very helpful. I hope that the memory limitation will be resolved one day.