Kinect Background Removal with smoothing of an acquired image - c#

I have implemented background removal(aka:Green Screen Effect) using Kinect for windows V2 in Windows-RT C# platform.
Now it's working fine for me but the issue I'm facing is with noise, when i mapping color co-ordinate to depth co-ordinate it's very noisy.
I have option to go through the Open-CV but for use Open-CV i need to convert my application in Native(C++) application.
Also another option is with Emgu-CV which are wrapper of the Open-CV for C#. But it not support in the windows-RT.
So Any another solution for the smoothing of Kinect acquired object.

With OpenCV you will also get noise: it's caused by Kinect's precission, not by the API. Try Microsoft's background removal API, they have implemented a smoothing function that greatly improves the results.
On MSDN: https://msdn.microsoft.com/en-us/library/dn435663.aspx.
There is a sample on the Kinect SDK as well: https://msdn.microsoft.com/en-us/library/dn435686.aspx.

Related

How disabled auto white balance in Kinect 2.0 (Win)?

I develop chroma key effect for Kinect 2.0. In static image (only background) it's ok. But Kinect doing auto balance when people appear in frame and colors is changing. Algorithm doesn't work in this case. How disabled auto white balance in Kinect 2.0 for Windows?
You can't.
The SDK doesn't give you any control over camera settings. You can read the camera settings using the ColorCameraSettings class, but you can't change them.
There was a thread in the official support forum about "Auto Exposure Compensation", basically doing some post processing on the color image. Maybe you can do something like that.

Kinect touchable Surface

I have a programming project using Kinect Xbox one sensor. The project is mainly about turning any surface into an interactive touchable screen. I have collected all the hardware including the projector. In addition, I have done my research and downloaded the related packets such as Visual Studio in order to start coding in C#.
So, my question here:
Is there any any library that I could use which may facilitate me to determine the angles/depth of the surface?
Plus, I don't have a fully vision of the steps which need to be done for the next steps, so I would really appreciate it if there is anyone could draw me a small map for me for this project.
If you have trouble with getting started with kinect go through this
Quick start series
and you also might want to capture the depth of objects. For that try to use Kinect's depth image streams and the sdk itself does not provide much happy methods. You will have to do some image processing on that gray scaled depth stream. Then you can find the edges of a single object in different depths.

Display corrected video stream in .NET 4.0

I have to display a video stream from an ethernet camera into a WinForm C# 4.0 application. I made some tests with the software of the camera and I saw that the image provided by the camera was distorted by lenses.
I know that it's possible to correct the image using a calibration grid.
Do you have any feedback about some image processing libraray that can be use for this purpose? The library not necessary need to be free.
For some other projects I use Halcon or OpenCV, but I don't know witch one is the best for that.
Thanks in advance.
OpenCV can do it without any problem. There are a lot of implementations of camera calibration with OpenCV:
Here you have the official version of EmguCV calibration, it uses the CameraCalibration class
Or you can find the official OpenCV's sample application of camera calibration on OpenCV's GitHub, but this one is a native implementation.

Ask about kinect fusion for AR

I want to create an AR application using Kinect Fusion.
I want to insert a 3d model into my kinect fusion reconstruction. The expected output is like these two videos:
https://www.youtube.com/watch?v=gChlRebNloA
https://www.youtube.com/watch?v=MvP4cHfUD5g
How to overlay the 3D object onto the 3d reconstruction?
Is there function in the SDK that can be used to achieve my goal?
Thanks
ps: I use C#
You should probably start to explore the KinectFusionExplorer-WPF KinectFusion available on codeplex:
http://kinectforwindows.codeplex.com/SourceControl/latest#v1.x/ToolkitSamples1.8.0
KinectFusionExplorer-WPF has some nice utility methods for matrix transformations, (virtual) camera configuration, etc.
The process for doing the AR augmentation is:
viewport: set your viewport using the same resolution as the one for the camera image,
video background: retrieve the video image from the Kinect and displays it in the background (either as done in the SDK examples or using a textured quad with the video image as done more traditionally),
geometric registration: use WPF3D and set a Camera object using: the intrinsic parameters of the Kinect camera (or the same ones used by KF), the camera pose you get via GetCurrentWorldToVolumeTransform() from your volume,
rendering: set any local transformation you want for your model (xaml) and render (using the way it's generally done with WPF3D).

Rendering graphics in C#

Is there another way to render graphics in C# beyond GDI+ and XNA?
(For the development of a tile map editor.)
SDL.NET is the solution I've come to love. If you need 3D on top of it, you can use Tao.OpenGL to render inside it. It's fast, industry standard (SDL, that is), and cross-platform.
Yes, I have written a Windows Forms control that wraps DirectX 9.0 and provides direct pixel level manipulation of the video surface.
I actually wrote another post on Stack Overflow asking if there are other better approaches: Unsafe C# and pointers for 2D rendering, good or bad?
While it is relatively high performance, it requires the unsafe compiler option as it uses pointers to access the memory efficiently. Hence the reason for this earlier post.
This is a high level of the required steps:
Download the DirectX SDK.
Create a new C# Windows Forms project and reference the installed
Microsoft DirectX assembly.
Initialize a new DirectX Device object with Presentation Parameters
(windowed, back buffering, etc.) you require.
Create the Device, taking care to record the surface "Pitch" and
current display mode (bits per pixel).
When you need to display something, Lock the backbuffer
surface and store the returned pointer to the start of surface
memory.
Use pointer arithmetic, calculate the actual pixel position in the
data based on the surface pitch,
bits per pixel and the actual x/y pixel coordinate.
In my case for simplicity I am sticking to 32 bpp, meaning setting a pixel is as simple as: *(surfacePointer + (y * pitch + x))=Color.FromARGB(255,0,0);
When finished drawing, Unlock the back buffer surface. Present the surface.
Repeat from step 5 as required.
Be aware that taking this approach you need to be very careful about checking the current display mode (pitch and bits per pxiel) of the target surface. Also you will need to have a strategy in place to deal with window resizing or changes of screen format while your program is running.
Managed DirectX (Microsoft.DirectX namespace) for faster 3D graphics. It's a solid .NET wrapper over DirectX API, which comes with a bit of performance hit for creating .NET objects and marshalling. Unless you are writing a full featured modern 3D engine, it will work fine.
Window Presentation Foundation (WPF) (Windows.Media namespace) - best choice for 2D graphics. Also has limited 3D abilities. Aimed to replace Windows Forms with vector, hardware accelerated resolution-independent framework. Very convenient, supports several flavours of custom controls, resources, data binding, events and commands... also has a few WTFs. Speed is usually faster than GDI and slower than DirectX, and depends greatly on how you do things (seen something to work 60 times faster after rewriting in a sensible way). We had a success implementing 3 1280x1024 screens full of real-time indicators, graphs and plots on a single (and not the best) PC.
You could try looking into WPF, using Visual Studio and/or Expression Blend. I'm not sure how sophisticated you're trying to get, but it should be able to handle a simple editor. Check out this MSDN Article for more info.
You might look into the Cairo graphics library. The Mono project has bindings for C#.
Cairo is an option. I'm currently rewriting my mapping software using both GDI+ and Cairo. It has a tile map generator, among other features.

Categories