falahati / niwrapper.net Goto Github PK
View Code? Open in Web Editor NEWOpenNI 2 and NiTE 2 .Net Wrapper
Home Page: http://www.falahati.net
License: GNU Lesser General Public License v2.1
OpenNI 2 and NiTE 2 .Net Wrapper
Home Page: http://www.falahati.net
License: GNU Lesser General Public License v2.1
For super easy integration it would be nice if this wrapper supported NuGet. Learn more here: http://www.nuget.org/
To add a NuGet project to your own project you use the built in NuGet manager which is very easy to use. NuGet will download the dependencies automatically for everyone that builds your project, even the build server! Very neat. :-)
Hi there,
this NiTE2.NET wrapper is a real life savior. Thanks :-)
Unfortunatly, I cannot get it to work.
What I did:
I downloaded the file: NiWrapper.NiTE.NET x64.zip
Created a new C# Project
Added the references "NiWrapper.Net" and "NiWrapper.NiTE.Net"
Wrote following code:
//HandTracker handTracker;
NiTE.Status handTrackerStatus;
Console.WriteLine("Initializing");
handTrackerStatus = NiTE.Initialize();
Console.WriteLine(handTrackerStatus.ToString());
Console.Read();
NiTE.Shutdown();
Got the error: the file or assembly "NiWrapper.NiTE.Net, Version=2.2.0.5, Culture=neutral, PublicKeyToken=null" or some dependencies of it could not be found. A file with a false format was tried to be loaded.
I also copied all the files that come from the zip file into the debug folder of my project. Got the same error.
What did I miss?
Do I need the source code of the wrapper?
Thank you in advance and best regards,
This is probably not actually an NiWrapper issue, but it might be, so I'm posting here to hopefully get some help.
I have an application made using NiWrapper for x64 that crashes when trying to initialize OpenNI. The error I'm getting is "Unable to load NiWrapper.dll" as soon as I call OpenNI.Initialize(). I have installed the library with NuGet, and the DLL in question is located inside the same directory as the application. (See screenshots below of the error message in Visual studio + the code that's crashing, contents of the executable directory, and my installed NuGet packages).
The machine in question is running Win10 x64, fully-updated, and freshly reformatted and reinstalled last week. The code compiles without error, it's just when I try to run the program that it crashes on the OpenNI.Initialize() call.
Replicating the problem is trivial: I simply create a new project, install NiWrapper via NuGet, and put OpenNI.Initialize() inside main and the error happens (on that one machine). Curiously, the exact same code runs on other computers I've tested on, which is why I'm skeptical that this is specifically an issue with NiWrapper. But NiWrapper seems to be the only dll that the system is having trouble with, so I'm really not sure.
I have tried copying a working build from another computer onto the one I'm encountering problems on, and get the same result. Installing Visual Studio, reinstalling NiWrapper via NuGet, and recompiling directly on the test machine also results in the exact same error.
Screenshots:
Error message + code in main that's crashing: https://www.dropbox.com/s/bsjoboie4s8sf50/err.png?dl=0
Contents of the application directory: https://www.dropbox.com/s/1be9qwkfayjcp0q/dir.png?dl=0
Installed NuGet packages: https://www.dropbox.com/s/4fg0gqaggj5vvmc/nuget.png?dl=0
Thanks a lot for any insight/assistance you can offer. If you need more information please let me know and I'll provide whatever you need.
hi folks!
simple tip for netframework 2.0
Delete line number 3
Using System.Linq; in Commons.cs at NiWrapper
Replace
frm_Main.cs at NiViewer.Net
Line 39
this.BeginInvoke((Action)delegate to this.BeginInvoke(new MethodInvoker(delegate()
Line 15
this.BeginInvoke((Action)delegate to this.BeginInvoke(new MethodInvoker(delegate()
you can compile NiWrapper.NET for netframwork 2.0
I follow NiViewer.Net sample to develop my code, but I find out I can't show both depth and color in the same time. I used two Devices class to show, but not work, please give some advices
Thanks in advance.
Hi,
I am wondering, why am I not able to change image registration mode for Kinect xbox as follows:
"if(device.isImageRegistrationModeSupported(Device.ImageRegistrationMode.DEPTH_TO_COLOR))
device.ImageRegistration = Device.ImageRegistrationMode.DEPTH_TO_COLOR;"
Above code with xbox Kinect just skips registration part, as if it does not support DEPTH_TO_COLOR mapping. However, it runs well both depth and Image stream simultaneously on NiViewer Sample application. How ???
Any help appreciated !
Thank you :)
If an error occurs an Exception
is thrown making it hard to catch. It's very problematic to catch these exception types as it will also catch e.g. NullReferenceException
and thus potentially hide serious problems in the application.
It's recommended to throw a more specific exception such as OpenNIException
that an application can catch safely.
Hi,
Well, This is not an bug/issue rather i want suggestion from you regarding my project.
For my project I have combined multiple sensors aligned horizontally one by one. My aim is to track a user uniquely through out all sensors. What approach you can suggest for this ? Also this has to be done over network because of the limitation of number of sensors connected to one single pc.
Thanks
Hi,
Greetings !
I need your help in a weird problem !!
While working on a project with Kinect XBOX sensor & your NiWrapper lib, I recently came out with a problem that I am NOT able to change VideoMode.Resolution of output frame of given node.
(i.e. Kinect xbox by default gives resolution of 640 x 480. However, nothing works, even if I try to change that resolution to 320x480 as follows--> )
code lines:
depth.VideoMode.Resolution = new Size(320, 240);
image.VideoMode.Resolution = new Size(320, 240);
Here, Output resolution is supposed get change from 640 x 480 to ---> 320 x 240. But it doesn't !
Any help appreciated !
Thank you :)
when used in Unity3D , none device could be found.
init OK , but no device from
DeviceInfo[] devices = OpenNI.EnumerateDevices ();
I have recompiered via .net 3.5 to use it in Unity3D.
and all my dlls are x86.
Hi falahati,
I am having problem understanding color codes used in function "FillImageFromUserMap" in NiWrapper Sample "UserColor/frmMain.cs"
int[] colors = new int[] { 16777215, 14565387, 32255, 7996159, 16530175, 8373026, 14590399, 7062435, 13951499, 55807 };
Please, advice !!
P.S. Code is running successfully, its only thing that I am unable to understand this part of it.
Hi, I am recreating this issue, I've previously encountered.
I was away from code for last couple of days. Today, I returned to same project and tried below code that @npapadop had suggested previously.
However, despite different efforts, same could not work for me !! As you can see here in screenshot, that error is still same as previous...
I could not checked "CustomBitmapCopyVB" on my VS 2010 . But, I would appreciate if anyone, refer some c# project in place, to check working on kinect xbox !
Hi everyone!
First of all, thanks for your program, it is very usefull. But, I have a problem using it. I'm using Visual Studio 2018, and a project with C# WPF. When I installed the packages with NuGet, and I try to compile the project, I obtain this error: "El generador de tareas "CodeTaskFactory" no se pudo cargar desde el ensamblado "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Tasks.v15.0.dll". No se puede cargar el archivo o ensamblado 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Tasks.v15.0.dll' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado"
I'm trying to solve this problem and I found this: https://social.msdn.microsoft.com/Forums/en-US/1f61c490-589f-4905-acdb-3c067f07cc54/error-message-the-task-factory-quotcodetaskfactoryquot-could-not-be-loaded-from-the-assembly?forum=visualstudiogeneral . And, I think that the problem could be this: "- 1st: update NuGet packages for your project. The resoning behind it is that probably one of your NuGet packages is using pre MS-BUILD 15 way of referencing the CodeTaskFactory, this has changed in VS15. "
Thanks for all and sorry for my horrible English.
There is a slight memory leak with reading frames. It seems to be ~1Mb every few minutes at the start, then slows down a bit and is ~1Mb every 25 minutes until you run out of memory. I am using a depth camera. This problem is in the current version as well as the older version. It becomes a issue when using many cameras together continuously for several days, especially in 32bit applications.
Here is a very bare bones vb.net winforms example. I don't do anything with the frame data, I just grab it from the wrapper in a using block and release it. Though I think .Release() is redundant and I have tried it without that as well with the same issue.
Public Class ImageCaptureForm
Private mobjOpenNIDevice As OpenNIWrapper.Device
Private WithEvents mobjVideoStream As OpenNIWrapper.VideoStream
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
OpenNIWrapper.OpenNI.Initialize()
StartCapture()
End Sub
Private Sub StartCapture()
mobjOpenNIDevice = OpenNIWrapper.Device.Open(OpenNIWrapper.OpenNI.EnumerateDevices(0).Uri)
mobjVideoStream = mobjOpenNIDevice.CreateVideoStream(OpenNIWrapper.Device.SensorType.Depth)
mobjVideoStream.Start()
End Sub
Private Sub SensorFrameReady(vStream As OpenNIWrapper.VideoStream) Handles mobjVideoStream.OnNewFrame
'Read the depth frame
Using currentFrame As OpenNIWrapper.VideoFrameRef = vStream.ReadFrame 'Memory leak
currentFrame.Release() 'Also tried without this, with dispose instead, and both, no difference
End Using
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
OpenNIWrapper.OpenNI.Shutdown()
End Sub
End Class
It doesn't seem like the wrapper allows to call Device.open with a custom URI.
First off: Thanks for a great wrapper! Most symbols have names following c# convensions with classes, methods, and properties having initial upper case letter. However, some symbols have problems where they start with a lower case letter which makes my code look weird.
I would gladly create a pull request if you think its a good idea?
How to reproduce: update the NiViewer with give files and run it by selecting the new "Color & Depth" option. Choose 640x480@30 Rgb888 for Video mode and 640x480@30 Depth 1Mm. Click the Update button and let the stream run for a few minutes. One or both the streams freeze after a few minutes of running.
Extra details of the test run:
Intermittently say one in ten when closing a device that has had its two streams started, it will hang when calling Device.Close()
. I have previously closed the two streams.
I quickly looked at the code and it looks as if the streams are closed again when the device is closed. Perhaps this is something that OpenNI does not like?
Hello,
There are 3 predetermined hand gestures (hand raise, wave, click). How can I add new hand gestures or create my own hand gestures?
Thank you in advance.
P.S. I already looked at your samples and know how to get joint information, but I want to add new gestures as "enum" like predetermined gestures.
i'm happy to using your NiWrapper.net
and I would really appreciate it if you could provide NITE2 for .NET also
Thanks
When building/rebuilding/cleaning the project which referes to the Nuget package, an error occurs:
The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll' or one of its dependencies. The system cannot find the file specified. NinjaCross_OpenNI E:\NinjaData\NinjaProgetti\Interni\NinjaDotNET\Dipendenze\Nuget\Baseclass.Contrib.Nuget.Output.1.0.7\build\net40\Baseclass.Contrib.Nuget.Output.targets 40
The target is in this path:
\Nuget\Baseclass.Contrib.Nuget.Output.1.0.7\build\net40\Baseclass.Contrib.Nuget.Output.targets
The error occurs in the target "CleanOutput", action "UnzipNuspec"
<Target Name="CleanOutput" Inputs="@(NupkgFiles)" Outputs="%(Identity).Dummy" AfterTargets="Clean">
<Message Text="Clean for %(NupkgFiles.Filename):" />
<UnzipNuspec Nupkg="%(NupkgFiles.FullPath)" >
<Output PropertyName="NuspecFile" TaskParameter="NuspecPath" />
</UnzipNuspec>
I'm using Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.