Items with no label
3335 Discussions

[Question to limit depthrange][RealSense SDK 2016 R3][Scan 3D][SR300][C# ]

mschn9
Beginner
2,403 Views

Hello

I have a question to constrain the depth while scanning. Instead of scanning the whole distance the camera can use, only e.g. the first 80 cm's should be used, to avoid problems with items in the backround(They should not be scanned). I'm using the Scan3d from Intel® RealSense™ SDK for Windows 2016 R3. I try different ways but no one is working, could you please show me a working possibility? I'm using C# and SR300 on Win10.

I try to constrain depth by:

1.)

setting the Area. (https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/index.html?setarea_pxcscan.html Intel® RealSense™ SDK 2016 R3 Documentation ).

Intel.RealSense.Scan.Area myArea=scan.QueryArea();

myArea.depth=0.8f;//Unit is meter

scan.SetArea(myArea);

Controlling this by checking:

Intel.RealSense.Scan.Area myArea2=scan.QueryArea();

leads to myArea.depth==0, so no update here. All examples/ways are also used while scanning - but items in backround are always the same.

2.)

try to change: https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/index.html?depthsensorrange_device_pxccapture.html Intel® RealSense™ SDK 2016 R3 Documentation ; but this is read only - where can I set it?

Intel.RealSense.RangeF32 r=device.DepthSensorRange;

f.max=1024;

device.DepthSensorRange=f;//Not working because DepthSensorRange is read only

3.)

Intel.RealSense.RangeF32 f2=device.DSMinMaxZ;//This is used for other cameratype, but I found it while inspecting the device in the debugger

f2.max=(f2.max+1)/2;

device.DSMinMaxZ=f2;

0 Kudos
1 Solution
jb455
Valued Contributor II
656 Views

At what point in the flow are you setting the area? I do it while the camera is running and that works for me.

Note, the Depth property of the scanning area refers to the depth of the object being scanned, not how far away from the camera it is, so if the object to be scanned is 30cm deep set it to 0.3. You'll just have to make sure the background is more than 30cm behind the front of the object then.

View solution in original post

9 Replies
MartyG
Honored Contributor III
656 Views

In the implementation of RealSense in the Unity engine with SDK 2016 R2 (the one before R3), you can set in an options menu how close a person has to be to the camera lens before detection occurs. This is called the Real World Box. Here's a guide I wrote a while ago on the subject.

https://software.intel.com/en-us/forums/realsense/topic/610438 Unity Tip: Knowing When To Use The RealSense TrackingAction's Real World Box Center

Using the Real World Box, you could set it so that a trackable object (e.g the user's hand or face) had to be very close to the camera before tracking activated.

0 Kudos
mschn9
Beginner
656 Views

Hi MartG,

thanks for your answer, I installed Unity, deinstalled R3 and go back to R2, but unity is not compiling the example (EnsureRunningOnMainThread), I just tried it with example7 Object tracking, so I stopped here because otherwise I had to get rid of all the things with unity, before I can go back to realsense sdk :/. I really just want to use the scan3d script to get the scanning working - I mounted the sr300 in a circle, so I just wanted to cut the depth to half of the circle. Options while scanning is full(not e.g. object or Face), because the whole object will never be scanned at whole (Please see picture I attached). So I need it for the scanning module... .

Best

sammas

0 Kudos
MartyG
Honored Contributor III
656 Views

Could you tell me please what you were trying to run in Unity? What was 'the example'. Thanks!

0 Kudos
mschn9
Beginner
656 Views

"The example", was RSUnityToolkit/Samples/Scenes/sample 7 -Object tracking,(I opened Assests->RSUnityToolKit->Actions->TrackingAction), and when I open the samplesdk browser sample 7 was the one where I found object tracking, so I thought that would be a good point to start... .

0 Kudos
MartyG
Honored Contributor III
656 Views

You should be able to run the sample programs from the Unity Toolkit folder without needing to install anything in Unity.

If you are starting a new project of your own in Unity though, the camera will not work. This is because once you start a new project, you need to run the UnityToolkit.exe program whilst Unity is open. this imports the camera drivers and the Action scripts into your project.

0 Kudos
mschn9
Beginner
656 Views

The sample, when opened in the bin folder is running(FF_ObjectTracking.cs.exe), I printed the targetEarth.jpg, but then I try to build the sample, to see that I can run the example on my own, but there the problem rises. I open in the SDK Sample browser Run, unity opens, and I try to build it(where the error expires).

But again, even when I solve this problem, then I know how to use the module tracking, but not 3d capturing and scanning - or what do I forget? I had to use the Intel.RealSebse.cs.dll and Intel.RealSense,Scan.cs.dll so I need to adjust there something, right? I think the "box" will not exist in the used dlls...

0 Kudos
MartyG
Honored Contributor III
656 Views

Samples should ideally be run from a folder that the SDK placed on your desktop called 'Intel RealSense SDK Gold'. This is because the bin folder in Program Files (x86) > Intel > RSSDK is a protected area that does not allow the computer to write data to it. So samples may not function properly if run from the bin.

Inside the desktop SDK Gold folder is a program called 'Sample Browser'. If you run this then you can access the samples through that and run them without problems.

An easy way to find the 3DScan program is to type '3dscan' into the search box in the Sample browser application.

0 Kudos
jb455
Valued Contributor II
657 Views

At what point in the flow are you setting the area? I do it while the camera is running and that works for me.

Note, the Depth property of the scanning area refers to the depth of the object being scanned, not how far away from the camera it is, so if the object to be scanned is 30cm deep set it to 0.3. You'll just have to make sure the background is more than 30cm behind the front of the object then.

mschn9
Beginner
656 Views

Thx, I was setting it directly after creation of the Scan3D object but I've to wait for Initialisation. Now it's working.

0 Kudos
Reply