Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Kinect with MS-SDK

Discussion in 'Assets and Asset Store' started by roumenf, Dec 17, 2013.

  1. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Look here: https://rfilkov.com/about/
     
  2. ghufronhasan23

    ghufronhasan23

    Joined:
    Aug 17, 2016
    Posts:
    7
    roumenf likes this.
  3. iqbal170795

    iqbal170795

    Joined:
    May 17, 2017
    Posts:
    2
  4. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Please e-mail me the same message from that e-mail address. This is to prove the e-mail address really belongs to you.
     
  5. iqbal170795

    iqbal170795

    Joined:
    May 17, 2017
    Posts:
    2
    I have already sent you an email sir.
     
  6. Zainul_hasan

    Zainul_hasan

    Joined:
    Apr 6, 2018
    Posts:
    1
    hi i have a final project problem with kinect.
    I made a race game with kinect for the users of a static bike
    I do not know the script to move my object by bicycle?
    maybe some one can help me ..
    My e-mail:Zainulhasan280913@gmail.com
    looking forward for your response.
    Thank you for your help
    I am from Indonesia
     
  7. Seifwares

    Seifwares

    Joined:
    Jul 28, 2013
    Posts:
    16
    HI ,
    i want to know how to calculate the angles , for exemple angles for shoulders and legs , how to do that ?
    thanks
     
  8. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Get the positions of 3 joints forming the angle (for instance shoulder, elbow, wrist), estimate the direction vectors (Vsh - Vel, Vwr - Vel), and use Vector3.Angle() to find out the angle between these two vectors.
     
  9. MicBoucinha

    MicBoucinha

    Joined:
    Jul 7, 2015
    Posts:
    2
    Hello @roumenf

    I am having a strange issue that I cannot figure out what might be wrong. Hopefully you can help me.

    I am using the K1 asset in Unity2018.1.9f2 and everything has been working fine. In my project, I am using the Kinect's camera to read QRCodes and for that I use the Compute Color map option and Display Color Map.

    Inside the editor, everything works perfectly, and I'm able to get the Color32[] for the QRCode reader. However, when I build the project (either in x86 or x86_64) I am getting a NullReferenceException exception on the KinectWrapper.PollColor (System.IntPtr colorStreamHandle, System.Byte[]& videoBuffer, UnityEngine.Color32[]& colorImage) method, more specifically in the line with
    Code (CSharp):
    1. frameTexture.LockRect(0, ref lockedRectPtr, r, 0);
    so I assume that the problem might be in the return of one of these two lines
    Code (CSharp):
    1. NuiImageFrame imageFrame = (NuiImageFrame)Marshal.PtrToStructure(imageFramePtr, typeof(NuiImageFrame));
    2. INuiFrameTexture frameTexture = (INuiFrameTexture)Marshal.GetObjectForIUnknown(imageFrame.pFrameTexture);
    I have the official Microsoft Kinect SDK 1.8 installed and only that and the remaining functionality works perfectly fine (I tested with the my scene where I have an avatar).

    Also, and because of other dependencies I have in my project, I am using the .NET 4.x Equivalent scripting runtime and the .NET Standard 2.0 Api Compatibility Level.

    Do you know what could be the cause of the problem?

    Thank you.
     
  10. jackvob1

    jackvob1

    Joined:
    Mar 2, 2018
    Posts:
    38
    can I use Kinect v2 demo with Kinect v1 I want to create fittingroom with Kinect v1 ? any advice or example to create it if I cant used it?
     
  11. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi,

    Hmm, this looks interesting... The same lines of code you can find in the PollDepth()-method either. Aren't they causing NullReferenceException, too? I don't have Kinect-v1 at the moment, and can't look at the issue. But you could use some Debug.Log() statements here and there, and then check in the log-file what exactly goes wrong.
     
  12. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Yes, the K2-asset should work with Kinect-v1, too. Regarding the fitting-room: There are two fitting-room demo scenes in the K2-asset. And here is the tip: https://rfilkov.com/2015/01/25/kinect-v2-tips-tricks-examples/#t12

    Please mind the models in the demo scenes are optimized for bodies and body joints as detected by Kinect-v2. Maybe for Kinect-v1 you would need to change the skinning of the models a bit.
     
    jackvob1 likes this.
  13. MicBoucinha

    MicBoucinha

    Joined:
    Jul 7, 2015
    Posts:
    2
    So... and for future reference for someone that might encounter this, it seems that the problem was that the Api Compatibility Layer needs to be in .NET 4.x. After I changed that, I started to have the Color Map.
    Wasn't really expecting that but now I need to try to understand what might be missing in the .NET Standard 2.0 support to have this behavior.

    Thanks @roumenf for the great lib.
     
    digqa, andreiagmu and roumenf like this.
  14. jackvob1

    jackvob1

    Joined:
    Mar 2, 2018
    Posts:
    38
    How about kinect xbox 360 ?
     
  15. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Thank you for the research, too!
     
  16. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    'Kinect for Xbox 360' is the other name of Kinect-v1. 'Kinect for Xbox One' is the other name of Kinect-v2 ;)
     
  17. jackvob1

    jackvob1

    Joined:
    Mar 2, 2018
    Posts:
    38
    my bad because I got confused when I search it there kinect xbox360 and theres Kinect v1 similar to Kinect v2
     
    roumenf likes this.
  18. jackvob1

    jackvob1

    Joined:
    Mar 2, 2018
    Posts:
    38
    Is it possible for fitting room use Kinect xbox 360 but I want use camera dslr for main camera ?
     
  19. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    You would need to calibrate and syncronize the Kinect with the external camera. Sorry, but I have not done this so far.
     
  20. SaikiStudio

    SaikiStudio

    Joined:
    Jan 26, 2019
    Posts:
    1
    Hello,
    I'm not sure if this post it's still available to answer a question about the asset MS-SDK, but I hope someone can help me.
    I'm trying to use to start an interaction 3D with a Kinect. My problem is when play it, first show me an error and if I try to play it again my unity froze. I try to see if there's an error in the script or some information about what it's happening but doesn't show me anything new.
    I share with you the image of my problem, and I think I have to restart my computer because the unity it's not responding.
    Thanks for your time, and good coding.
     

    Attached Files:

  21. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    I suppose you experience the freezing-issue, explained here: https://rfilkov.com/2013/12/16/kinect-with-ms-sdk/#ki
    Interesting is that I though the issue is solved in the course of Unity version updates. See, in one of the comments here http://www.assetstore.unity3d.com/#/content/7747 Coburn37 says:
    "
    Unity: 2018.1
    Windows: 10.0.16299, Windows 10 Pro x64
    Kinect: v1, I bought it standalone about 5 years ago, I do not own an Xbox 360 at all.
    SDK: v1.8

    I installed the SDK before importing this asset. I have not received any sort of freezing or NotGenuine error yet (*knock on wood*).
    "
     
  22. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi
    I need is to only track a single x,y,z coordinate (preferably head) of a person. In the SDK is it possible to 'turn off' parts of skeletal tracking to improve tracking performance or is skeletal tracking either ALL on or off?
     
  23. AlbyDj90

    AlbyDj90

    Joined:
    Feb 7, 2015
    Posts:
    35
    Hi guys! I've got a question: since we have to build an app that has to be rendered in a vertical screen, there is a method for limiting the area scanned by the Kinect to fit the area of the screen?
    Now if an user exit from the screen is still tracked until he escape from the view of the sensor and this is a little bit annoying because we want only 1 user at time to be scanned.
    I see that i can choose to detect the users in order of: Appearance, Left To right or distance...so i assume i can write logic where the user most close to a point is space will be the user 0 in the list and if he walks away, the system will stop tracking him. I'm right? If so, how can i do this?
    thanks in advance!

    EDIT: How i am dumb? I don't figure out that i could use Min User Distance, Max User Distance and Right Left Distance from the Kinect Manager for this! I leave the post just in case! XD
     
    Last edited: May 24, 2019
    roumenf likes this.
  24. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    I suppose your post is regarding the K2-asset. For vertical screen, use the PortraitBackground-component. Here is the tip: https://rfilkov.com/2015/01/25/kinect-v2-tips-tricks-examples/#t19 The rest you have figured out by yourself.
     
  25. siebedemetser

    siebedemetser

    Joined:
    Oct 14, 2019
    Posts:
    2
    hey

    I want to make a kinect game for my thesis. but when I want to make a character folow my movements, the arms are always behind the character. Is there an easy solution for this?

    SOLVED: I just had to change the standard angle of the shoulder in the character files
     
    Last edited: Oct 30, 2019
    roumenf likes this.
  26. siebedemetser

    siebedemetser

    Joined:
    Oct 14, 2019
    Posts:
    2
    hey

    is there still a possibility to download KinectExtras with ms-sdk?
     
  27. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Just e-mail me and I'll send you back the requested KinectExtras-asset.
     
  28. Chris9694

    Chris9694

    Joined:
    Nov 19, 2018
    Posts:
    1
    Hello, I have a problem with working across multiple scenes. I read the Howto-Use-KinectManager-Across-Multiple-Scenes.pdf and did what it says but the cursor doesn't work when I change between scenes. It only works when I run each scene separately. I didn't attach the KinectManager to any camera in any scene, I attached it in an empty game Object. Can you please help me?
     
  29. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi, I don't have Kinect-v1 sensor to test this at the moment, but I think in your case the cursor's game object should be a child of the KinectObject. The KinectObject remains across the scenes (along with its child objects), while all other objects get destroyed.
     
  30. GZMRD17

    GZMRD17

    Joined:
    Jan 25, 2020
    Posts:
    33
    I am trying to use two Kinect azure V3 cameras with the ‘KinectAvatarDemo4’ from RF Solutions.

    First, I added an extra ‘kinect-4-azure’ interface to the existing kinect4azure in the Kinect-controller, in the inspector. Next, I connected the cameras in daisy chain, configured the master/subordinate, and indexes 0/1 in the inspector for each of the Kinect-4-azure interfaces. I pointed the Kinect cameras to two different parts of my office.

    I also added an extra game scene/view to the example and created a second virtual camera in Unity. So, I am trying to use the avatardemo4 slightly modified to track a person as he/she passes in front of one camera and then passes in front of the next camera. However, I can only get one camera to do tracking and show the avatar in one scene (the main/default camera). The other scene and the other view/Kinect camera does not show anything. I thought I could use more than one body tracker with the newest examples/assets from RF and newest SDK from Microsoft. Any recommendations?
     
  31. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi, I suppose you wanted to post to this forum: https://forum.unity.com/threads/azure-kinect-examples-for-unity.715796/ This forum here is for the Kinect-v1 asset, but I'll answer anyway.

    To use multiple sensors for continuous body tracking, you need to calibrate them first. See this tip on how to do that: https://rfilkov.com/2019/08/26/azure-kinect-tips-tricks/#t10 After you finish with the calibration, you can use the generated config-file, to set up the same sensor interfaces in any other scene. To do it, just enable 'Use multi-cam config'-setting of the KinectManager-component in that scene. This will also activate the body tracking between the sensors. Please note, there should be an intersection area between the sensors. Otherwise the user's body may be lost, when he/she crosses the border between the sensor-tracked areas.

    You need to have at least v1.9 of the K4A-asset, as well.
     
  32. GZMRD17

    GZMRD17

    Joined:
    Jan 25, 2020
    Posts:
    33
    Thanks very much. I have K4A-asset v1.8. Will this work? I will post in the kinect forum in the future.
     
  33. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    No, you need at least v1.9, because the body tracker between sensors was added to that release. Just update to the latest version of the K4A-asset from the Asset store. It's free of any charge.
     
  34. jaquesoler

    jaquesoler

    Joined:
    Oct 4, 2019
    Posts:
    1
    Hello, great app. However, I'm facing a problem that I have no idea how to solve.

    I'm using the K1 version, the kinect works and displays just fine inside of Unity but when building for windows the kinect manager appears not to be reading the user and background, it's as if I deactivated it in the scene.

    Any idea how to solve this?
     
  35. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Please send me the Player's log-file, so I can take a closer look. Here is where to find Unity log-files: https://docs.unity3d.com/Manual/LogFiles.html
     
  36. Falke-3D

    Falke-3D

    Joined:
    Jun 1, 2020
    Posts:
    6
    Hello,
    everything worked at the beginning.
    However, since the last 2 updates from Unity, I have been notified of script errors when I start the original program from you.

    I can't do anything with your contribution to a user’s review:

    The easiest fix would be to replace 'GUIText' with 'UnityEngine.UI.Text' and 'GUITexture' with 'UnityEngine.UI.RawImage'. And after the recompilation, you should replace '.guiText.text' with just '.text' and deal with HandCursor1 & HandCursor2 in KinectManager a in bit other way, if you need them, because there are no GUITextures any more. Or, just develop the scripts from the ground up instead, "to be compatible with the newer Unity versions".

    Please how do you change something that Kinect 1 works with Unity as before.

    -- Thanks ! ---
     
  37. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    I'm not sure what you mean by "I can't do anything with your contribution to a user’s review". What exactly does not work there?

    As to me, the easiest way to make it work again would be to downgrade Unity to the version you have used for that same project, when it worked before.
     
  38. Falke-3D

    Falke-3D

    Joined:
    Jun 1, 2020
    Posts:
    6
    Thank you for your reply.
    How do I downgrade Unity, I can't find an older program, I searched before.
    I haven't even started using ss properly, I'm a newbie.
    I need the version before the last 2 Unity updates.
     
  39. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Here you can find the previous Unity releases: https://unity3d.com/get-unity/download/archive
     
  40. Sound-Master

    Sound-Master

    Joined:
    Aug 1, 2017
    Posts:
    48
    Hello @roumenf

    I am having an issue when building some scenes on windows 10, specifically the DepthColliderDemo scene and the KinectOverlayDemo scene. It would appear that the user map cannot be computed possibly? Is this a known issue or anything on my side? All scenes run fine in the editor, the issue occurs only when runing the build.

    I am using unity 2018.4.29f1 on windows 10 v1803 - build 17134.1304

    Any ideas?

    Many thanks
     
  41. coltonhash

    coltonhash

    Joined:
    Nov 20, 2018
    Posts:
    6
    Hi, I am not sure if this project is still active, but if so I appreciate the help!

    I am using Unity 2018, and I am getting the sample programs to work in the Unity Editor, but when I run a build I am getting a nullReferenceException during the KinectManager Update for PollDepth() and PollColor(), each getting the error at frameTexture.LockRect(0, ref lockedRectPtr,r,0);

    I am using a v1 Kinect Sensor with the v1.8 Kinect SDK.

    I appreciate any help or ideas you might have, thanks!
     
  42. Sound-Master

    Sound-Master

    Joined:
    Aug 1, 2017
    Posts:
    48
    In case anybody else has the same problem, switching to .NET 4.x solved the issue for me
     
    andreiagmu and rfilkov like this.
  43. DwikyAnderson

    DwikyAnderson

    Joined:
    Apr 5, 2020
    Posts:
    4
    Hello @roumenf

    Im having Issue with gesture detection on unity, the kinect often lagging and cant detect a gesture.
    is there a way to know when gesture detetction failed or not?