Items with no label
3335 Discussions

Query skeleton using R200 camera with C# SDK

NMinh1
Novice
2,008 Views

I'm working with SDK 2016 R2 to get Skeleton points with my R200 camera. Setting up is ok but it's alway return 0 values. I heared that I need change the mode to "interactive" but I can't find any way to set it.

Can you solve this problem?

Thank you.

And if the problem can not be solved, I think I will create a console app with C++ (It works fine) and print the skeleton points data, and the C# app will read and process it. Any way better? Can you tell me?

13 Replies
MartyG
Honored Contributor III
502 Views

The command is TRACKING_MODE_INTERACTIVE. A comment linked to below has a script showing how the instruction is used.

Also note in the script that Skeleton mode is Enabled. Enabling Skeleton mode is, according to other Skeleton mode users, the other thing you have to do to get Skeleton Tracking working, as it is apparently disabled by default.

0 Kudos
NMinh1
Novice
502 Views

But I can't find SetTrackingMode function in C# library, but in C++ Library, it exist. The sample code in the link is use C++ library.

This is my enable Skeleton code, I think it's ok.

senseManager.EnablePersonTracking();

personModule = senseManager.QueryPersonTracking();

personConfig = personModule.QueryConfiguration();

personConfig.QuerySkeletonJoints().Enable();

personConfig.QuerySkeletonJoints().SetTrackingArea(PXCMPersonTrackingConfiguration.SkeletonJointsConfiguration.SkeletonMode.AREA_FULL_BODY);

But when i get numbers of skeleton, it returns 0.

0 Kudos
MartyG
Honored Contributor III
502 Views

This discussion features a user who was trying to get skeleton tracking working in C# and was getting 0 returned. They provide a C# script (in the C# version of the code, PXCM is used instead of PXC, like you did in your own script.)

https://software.intel.com/en-us/forums/realsense/topic/685380 RealSense R200: How resolve call to QueryJoints (C# ) causing exception?

I believe that if the code is fine then skeleton tracking works once it has been Enabled.

0 Kudos
NMinh1
Novice
502 Views

I edited Realsense library as this blog tutorial, but nothing changed.

https://mtaulty.com/2016/05/11/windows-10-wpf-realsense-sr300-person-tracking-continued/ https://mtaulty.com/2016/05/11/windows-10-wpf-realsense-sr300-person-tracking-continued/

Numbers of skeleton always return 0.

I tried to contact Mtaulty but failed.

Can you give me any other solution?

0 Kudos
MartyG
Honored Contributor III
502 Views

I have carefully researched both this forum and the old RealSense forum that was used before this one. In all the cases of people who were trying skeleton and tracking and getting '0' returned, I could find only one person who got it working. They posted a script that seems to be C++ (I know you need C# ).

People found that whilst the C++ Person Tracking sample for the R200 provided with the SDK worked, they could not adapt the code for their own projects and just got '0' returned.

There is unfortunately no further information on this subject to research to try to find a solution. The best chance of a resolution may be if an Intel member picks up the case and researches it, as they have access to internal expertise that I do not. Good luck!

0 Kudos
NMinh1
Novice
502 Views

I have found a solution for this problem.

The most important thing you have to do is SetTrackingMode to TRACKING_MODE_INTERACTIVE, but the C # SDK does not have a function to do that.

So I tried to edit the pxcclr.cs library, but there is no function named SetTrackingMode.

I go deeper, I try to edit the cpp2c library, there is a function called SetTrackingMode, set the default value to TRACKING_MODE_INTERACTIVE, build a DLL file, import to project, and I succeeded.

0 Kudos
MartyG
Honored Contributor III
502 Views

Awesome news! People have struggled with the skeleton tracking 'returns 0' problem for a very long time, so it's great that they have a new possibility to try. Many thanks!

0 Kudos
anguy7
Beginner
502 Views

Hello Clovers1254,

I am happy to see your answer, can you share your modified libpxccpp2c.dll file? Or any suggestion to be able to edit this file?

Thank you.

0 Kudos
DMosk1
Beginner
502 Views

Hello! Can somebody post fixed libpxccpp2c.dll for x64?

I can't compile mine, it get me errors. (compile for x86 is good, but x64 - error "unresolved external symbol _UnityPluginUnload@0" and "_UnityPluginload@4")

It will be great if someone can help me

0 Kudos
MartyG
Honored Contributor III
502 Views

I haven't seen that error before. I've attached a copy of the x64 DLL of the file from my own installation of the '2016 R2' SDK.

0 Kudos
DMosk1
Beginner
502 Views

Hi, thanks for the answer!

But,i think you missunderstand me(sorry, bad english)

It will be great, if someone post a rebuilded dll of libpxccpp2c.dll(for x64), with clovers1254 solution to problem with SetTrakingMode(edit the libpxccpp2c library, there is a function called SetTrackingMode, set the default value to TRACKING_MODE_INTERACTIVE, build a DLL file)

I can rebuild this DLL from sources by myself for x86, but then i try to do this for x64, VS gives me errors, that i mentioned above(Don't know why).

Maybe somebody here can do this

0 Kudos
MartyG
Honored Contributor III
502 Views

Going back to the start of this old discussion, I.see what you mean now. You would like someone to edit the cpp2c file and post an updated dll built from the edit. My apologies for the misunderstanding.

0 Kudos
PSeeb
Beginner
502 Views

Hello,

i'm struggling to get the Skeleton tracking work with the C# SDK and R200 camera.

I've tried the solution mentioned by clovers1254 and haven't found any function with the name SetTrackingMode in the cpp2c library.

Does anyone know where i can find this function or know the solution in detail, to set the default value ?

0 Kudos
Reply