user4085386
user4085386

Reputation:

(OPENNI) Need to add mockDepthgenerator (created without basing on another Depth Generator) to recorder

The following is what roughly I am doing.

MockDepthGenerator mockDepth;
//nRetVal = mockDepth.CreateBasedOn(depth); // *I dont want this line (so not doing)*

mockDepth.Create(context, "MockDepth"); // *But I want to do this, starting from scratch*

// setting my own depth data
XnDepthPixel* mydata = new XnDepthPixel[640*480];
mockDepth.SetData(11, 1212, 640*480, mydata); 

// setting mode
XnMapOutputMode aa= {640, 480, 30};
mockDepth.SetMapOutputMode(aa);

// creating recorder
Recorder recorder;
nRetVal = recorder.Create(context);
nRetVal = recorder.SetDestination(XN_RECORD_MEDIUM_FILE, strOutputFile);

// add depth node to recorder
nRetVal = recorder.AddNodeToRecording(mockDepth); // ** getting run-time error here **

What else properties of mockDepth do I need to initialize so that I can add it to the recorder without an actual Depth Generator?

N.B. I am not good at understanding OPENNI SDK. That's why I am asking it here?

Upvotes: 1

Views: 133

Answers (1)

songuke
songuke

Reputation: 189

I had the same idea of creating a new MockDepthGenerator from the context instead of basing on an existing depth generator. But for me it never works. The recorder declines to add the mock depth and throws an exception saying that some functions are not implemented! (I'm using OpenNI 1.5.4.)

The current workaround that I use is simply use a dummy and small ONI file to retrieve the depth generator, and create the mock depth generator based on it.

Upvotes: 1

Related Questions