Software Archive
Read-only legacy content

How to set the depth range ?

Hui_L_3
Beginner
1,159 Views

Hi, 

I am using R200 to develop some apps, I saw there's a function SetDSMinMaxZ(...) which I could use to set the range of depth map (am I right?). After I tried, the depth image did not change at all. Is it useless ? Or how should I use it ? 

Thanks!

0 Kudos
1 Solution
Henning_J_
New Contributor I
1,159 Views

Yeah, well...it's annoying, but here it is:

You won't get a valid device from the SenseManager (through QueryCaptureManager()->QueryDevice()), until you enabled streams and called init() on the SenseManager. Before that, you will get no device at all (null pointer) or an invalid one. So it won't work to call SetDSMinMaxZ() on that.

So, you can only get a valid device from the SenseManager at a point in time when you can't call SetDSMinMaxZ() on it anymore.

That's why I was using the complicated way to create the device from the session. That's the only way I could figure out to get a valid device, before it was to late to call SetDSMinMaxZ().

View solution in original post

0 Kudos
7 Replies
samontab
Valued Contributor II
1,159 Views

Did you check the actual depth values?. maybe they just look similar, but are numerically different.

0 Kudos
Hui_L_3
Beginner
1,159 Views

samontab wrote:

Did you check the actual depth values?. maybe they just look similar, but are numerically different.

I haven't check the value yet, but I have tried some extreme values like [100, 200], [1000, 10000], etc. the depth map looked the same. 

I believe there's a physic limit here, but I don't know the value, and I don't know how I could do things properly with function SetDSMinMaxZ(...).

b.t.w there's another function called SetLeftRightGain(...) which has an impact on the depth map, could you give me some information about the Gain value range for this function ? And how does the gain *cooperate* with the SetDSMinMaxZ(...) function ? 

 

Thanks very much!

0 Kudos
Henning_J_
New Contributor I
1,159 Views

You can only use SetDSMinMaxZ() before starting any streams. For more details see:

https://software.intel.com/en-us/forums/realsense/topic/597076

About the gain: the following document mentions valid values are 1-4 and how changing it affects the depth image (page 4 ff.):

https://software.intel.com/sites/default/files/Intel%20RealSense%20SDK%20Design%20Guidelines%20R200%20v1_1.pdf

0 Kudos
Hui_L_3
Beginner
1,159 Views

Henning J. wrote:

You can only use SetDSMinMaxZ() before starting any streams. For more details see:

https://software.intel.com/en-us/forums/realsense/topic/597076

About the gain: the following document mentions valid values are 1-4 and how changing it affects the depth image (page 4 ff.):

https://software.intel.com/sites/default/files/Intel%20RealSense%20SDK%2...

Hi, 

I checked the return code of SetDSMinMaxZ(..), it's correct. Below is the pipeline of using the function. 

pm = PXCSenseManager::CreateInstance();

device = pm->QueryCaptureManager()->QueryDevice();

device->SetDSMinMaxZ(range);

pm->EnableStream(...);

pm->Init();

I read the old thread that you gave me, you were using a session to create the device, here I used a very simple way showed above,  did I use the wrong pipeline ? 

 

After I set the depth, I checked the value range of depth image, it's always [0, 2^16-1]. 

 

Thanks!

 

0 Kudos
Henning_J_
New Contributor I
1,160 Views

Yeah, well...it's annoying, but here it is:

You won't get a valid device from the SenseManager (through QueryCaptureManager()->QueryDevice()), until you enabled streams and called init() on the SenseManager. Before that, you will get no device at all (null pointer) or an invalid one. So it won't work to call SetDSMinMaxZ() on that.

So, you can only get a valid device from the SenseManager at a point in time when you can't call SetDSMinMaxZ() on it anymore.

That's why I was using the complicated way to create the device from the session. That's the only way I could figure out to get a valid device, before it was to late to call SetDSMinMaxZ().

0 Kudos
Hui_L_3
Beginner
1,159 Views

Henning J. wrote:

Yeah, well...it's annoying, but here it is:

You won't get a valid device from the SenseManager (through QueryCaptureManager()->QueryDevice()), until you enabled streams and called init() on the SenseManager. Before that, you will get no device at all (null pointer) or an invalid one. So it won't work to call SetDSMinMaxZ() on that.

So, you can only get a valid device from the SenseManager at a point in time when you can't call SetDSMinMaxZ() on it anymore.

That's why I was using the complicated way to create the device from the session. That's the only way I could figure out to get a valid device, before it was to late to call SetDSMinMaxZ().

It works now! But seems like it only filtering out the depth values from the original depth map. 

I tried to use SetLeftRightGain in the same way, but it failed...don't know why. Do you have any idea ? 

 

Thanks!

0 Kudos
Henning_J_
New Contributor I
1,159 Views

I tried to use SetLeftRightGain in the same way, but it failed...don't know why. Do you have any idea ? 

Maybe you need to do that after you initialized the streams? I don't know, I never tried it.

0 Kudos
Reply