0

I have already installed the correct Intel RealSense SR300 camera drivers and can use the Intel RealSense viewer to see both the rgb and depth camera streams. So I know this side of things are working ok.

I now want to use SharpSenses library from nuget to experiment. I am using the same code they display in their homepage

        var cam = Camera.Create();
        cam.LeftHand.Visible += (sender, args) => {
            Console.WriteLine("Left Hand Visible");
        };
        cam.LeftHand.NotVisible += (sender, args) => {
            Console.WriteLine("Left Hand Not Visible");
        };
        cam.Start();
        Console.ReadLine();

However it fails to run with

System.NullReferenceException: 'Object reference not set to an instance of an object.'

In the line

var cam = Camera.Create();

the inner exception is

    StackTrace  "   at SharpSenses.RealSense.RealSenseCamera..ctor()\r\n   at SharpSenses.Camera.Create(Capability[] capabilities)\r\n   at SharpSenses.Camera.Create()\r\n   at WpfApp1.MainWindow..ctor() in c:\\users\\rfonseka\\documents\\visual studio 2017\\Projects\\WpfApp1\\WpfApp1\\MainWindow.xaml.cs:line 28"  string

What am I missing?

I have download and installed intel_rs_sdk_offline_package_10.0.26.0396.exe but that didn't make any difference.

rukiman
  • 597
  • 10
  • 32
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Alejandro Mar 19 '18 at 12:51
  • No this is specific to the SharpSenses library – rukiman Mar 20 '18 at 05:51

2 Answers2

0

Try replacing your first line with:

var cam = Camera.Create(Capability.HandTracking);
andrecarlucci
  • 5,927
  • 7
  • 52
  • 58
0

Figured it out. I uninstalled everything I installed for the RealSense. I installed the Depth Camera Manager for SR300 I installed the Intel RealSense SDK R2 (v10)

Ran my project and it worked! So I must have had a lot of stuff installed/not installed that was causing the issue.

rukiman
  • 597
  • 10
  • 32