Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Hashim_K_
Beginner
100 Views

Object reference not set to an instance of an object error using Intel Real Sense sample.

Hello,

I am using a sample XAML app for recognizing face, but while debugging, I am getting Null Reference exception unhandled error in the below code and the line which is erroring is written in bold . I checked and could see that device is getting null (ie senseManager.QueryCaptureManager().QueryDevice() is returning null). Could you please help me solving this issue. Note: I have opened the cameraexplorer tool which is obtained while installing the RealSense SDK and it is not detecting the cam. However I just opened the camera using Skype and it is opened, but not here

 

 

PXCMFaceConfiguration.RecognitionConfiguration.RecognitionStorageDesc recognitionDesc = new PXCMFaceConfiguration.RecognitionConfiguration.RecognitionStorageDesc();
            recognitionDesc.maxUsers = DatabaseUsers;
            //recognitionConfig.CreateStorage(DatabaseName, out recognitionDesc);
            //recognitionConfig.UseStorage(DatabaseName);
            LoadDatabaseFromFile();
            recognitionConfig.SetRegistrationMode(PXCMFaceConfiguration.RecognitionConfiguration.RecognitionRegistrationMode.REGISTRATION_MODE_CONTINUOUS);

            // Apply changes and initialize
            faceConfig.ApplyChanges();
            senseManager.Init();
            faceData = faceModule.CreateOutput();

            // Mirror image
            senseManager.QueryCaptureManager().QueryDevice().SetMirrorMode(PXCMCapture.Device.MirrorMode.MIRROR_MODE_HORIZONTAL);

0 Kudos
4 Replies
RBang
New Contributor II
100 Views

Hi Hashim,

While you have commented out the Create and Use storage commands, you have to realize you do need these commands to capture, store and then access image(s). Try searching for an alternative for this one.

As for your query, in one of your other forum posts, you had mentioned you didn't install DCM, so kindly do that first and let me know if you still face the issue, because if this command:

senseManager.QueryCaptureManager().QueryDevice().SetMirrorMode(PXCMCapture.Device.MirrorMode.MIRROR_MODE_HORIZONTAL);

is returning null, it means that the software is not able to Query your device and return the Device instance, and hence returns NULL/null.
 

 

 

 

Hashim_K_
Beginner
100 Views

I installed DCM and it is working. Now I am concerned with the storage of data in SQL server database.

RBang
New Contributor II
100 Views

Hashim K. wrote:

I installed DCM and it is working. Now I am concerned with the storage of data in SQL server database.



These should provide more insight regarding your concern:

Recording and Playing Back
http://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?...

Accessing Image Data
http://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?...

Hashim_K_
Beginner
100 Views

I am not getting clear when I went through the link. I am attaching my sample application here. Can you please check and suggest? I am not able to properly recognize the person. Right now while storing, I store face data as bytes in to database. Here for recognitionConfig.SetDatabaseBuffer(buffer); the buffer should contain all the face data from database which will cause memory related issues and time problems. Here I need to basically compare using some unique details so that i do not need to collect all the people face data, See the attached sample. Your help is really appreciated!!

Reply