Software Archive
Read-only legacy content
17060 ディスカッション

query device & vertices

agund4
初心者
2,177件の閲覧回数

Dear All,

I'm using c# interface

I need to get the x,y,z  coordinates of  22 points in hand module.

I found that query vertices is the option to do that.

Can some one help me with- the code to create a instance for pxcmcapture.device  and help me with the required code to get vertices using queryvertices function.

 

I am trying to develope hands console(which is in cpp  in sample browser) in  c# environment

0 件の賞賛
3 返答(返信)
jb455
高評価コントリビューター II
2,177件の閲覧回数

To start off you need the SenseManager:

pSenseManager = PXCMSenseManager.CreateInstance();

Then the device instance:

var device = pSenseManager.captureManager.QueryDevice();

Get the depth photo & data:

PXCMCapture.Sample photo = pSenseManager.QuerySample();
PXCMImage depth = photo.depth;
PXCMImage.ImageData ddata;
depth.AcquireAccess(PXCMImage.Access.ACCESS_READ, out ddata);

Set up the projection:

projection = device.CreateProjection();

Then get the vertices:

PXCMPoint3DF32[] vertices = new PXCMPoint3DF32[depth.info.width * depth.info.height];
projection.QueryVertices(depth, vertices);

Note, the projection and vertices take a fair amount of processing and memory so I'd advise against updating those every frame. Also make sure you Dispose and/or Release everything when you're done with it each frame or the memory will keep piling up!

Let me know if you need any more help!

agund4
初心者
2,177件の閲覧回数

Dear James..

Greetings!!!

Thank you it helped me..

I was using FF Hands console in cpp.

plz help me in decreasing the frame rate .

Very new to cpp, real sense. Kindly please help me with exact location.

jb455
高評価コントリビューター II
2,177件の閲覧回数

Hi,

If you want to only do the calculations every few frames (is this what you meant?), you can do something like (again, C# as I don't know C++ but I'd imagine it'd be similar):

int frameCount = -1 //before the loop starts (start at -1 so it does the calculations on the first frame)

//inside the while loop which does the imaging stuff:
if
((frameCount++) % 10 == 0)
  [do stuff]

Where you replace 10 with however often you want to update everything (so if your camera stream is 30fps this'll go 3 times per second)

James

返信