Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 19, 2024, 10:55:59 10:55


Login with username, password and session length


Pages: [1]
Print
Author Topic: Kenect Hacking And Programming (Windows And By Virtual Studio)  (Read 3276 times)
0 Members and 1 Guest are viewing this topic.
pertican
Active Member
***
Offline Offline

Posts: 172

Thank You
-Given: 436
-Receive: 1130



« on: June 08, 2014, 08:55:48 08:55 »

Hi To All

I'd like to write a simple program By Virtual Studio(C# Or Vb.net).

Who ever worked on Kinect hacking and Programming?

Regards
« Last Edit: June 11, 2014, 08:15:01 20:15 by pertican » Logged

pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4634

Thank You
-Given: 823
-Receive: 4176


There is no evidence that I muted SoNsIvRi


« Reply #1 on: June 08, 2014, 11:08:21 11:08 »

I have read a few pages on Kinect, in windows the first thing is you need to have an NVidia video card in your system as all drivers, I have found use this card.
Here are some of my bookmarks. I have not had much free time to do any work as yet, still collecting infomation.

Adafruit Industries offered a bounty for an open-source driver for Kinect.
http://en.wikipedia.org/wiki/Kinect
http://www.techradar.com/news/gaming/the-first-batch-of-kinect-2-for-windows-sensors-is-now-up-for-pre-order-1252153
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
pertican
Active Member
***
Offline Offline

Posts: 172

Thank You
-Given: 436
-Receive: 1130



« Reply #2 on: June 08, 2014, 06:03:48 18:03 »

For First Project I Work On Project A Video Camera display

I bought XBox Kinect + Adapter ($117)   
1  Download KinectSDK-v1.8 And Install It.
2 - Install Microsoft Visual Studio 2012
3 - I connect the Kinect to the PC And Drivers installed without problem.
4 -  Run Virtual Studio 2012 And Create a Windows Presentation Foundation (WPF) application Project (C#)
5 - add the Kinect SDK assemblies to  project.(C:\Program Files\Microsoft SDKs\Kinect\v1.8\Assemblies\Microsoft.Kinect.dll)
6 - add  The following code top of the program Codes that This makes it easier to use the Kinect classes in programs.
Code:
using Microsoft.Kinect;

7 - add  The following code top of the program Codes that The program can then use this variable every time it wants to control the Kinect.
Quote
    public partial class MainWindow : Window
    {
        KinectSensor myKinect;
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}
8 - add Window_Loaded event handler in MainWindow.
9 - add the statement below to the Window_Loaded that set the value of Kinect to refer to the KinectSensor class that the program will be  using.
Now that the program has an object that can be used to control a Kinect sensor
Code:
myKinect = KinectSensor.KinectSensors[0];
10 - The first thing it must do is initialize the sensor and tell the sensor what kind of data to produce. We can ask the sensor for several different kinds of data. Your  Enable method as follows. This version of the Enable method has no parameters and asks the Kinect sensor to generate video frames that are 640 pixels wide and 480 pixels high at the rate of 30 frames a second. You can add a parameter to the Enable method if you want different resolutions.
Code:
myKinect.ColorStream.Enable();
[/b]
11 - The next thing the program must do is to tell the sensor what to do when it has captured some new video data to be displayed. The program will use an event handler to do this. Effectively it will say to myKinect, “When you get a new frame to display, call this method, which will draw it on the screen.” You can get Visual Studio to generate the event handler method for you. Start by typing the following into the Window_Loaded method just underneath the call of Initialize:
Code:
myKinect.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(myKinect_ColorFrameReady);
12 - add  The following code For Start The Kinect
Code:
myKinect.Start();

13 - add  The following code End Of private void Window_Loaded(object sender, RoutedEventArgs e)   
Code:
void myKinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
{
       throw new NotImplementedException();
}
14 -   Next, you have to add the code that takes the video frame and displays it on the screen , there are two stages to this. the first stage is to create an image display element in the WPF window on the screen, and the second stage  is to create the code that will take the video data from the Kinect data stream and put it on the image
on the screen.
15 - Adding an Image Display element to the WPF Window , Go to MainWindow.xaml And add  The following code , You have created an Image element and given it the name kinectVideo. The program can use this name to refer to the image in the window on the screen.
Quote
<Window x:Class="Project1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    <Grid>
        <Image Name="kinectVideo" />
    </Grid>
</Window>
16 - add  The following codes in void myKinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
Quote
            using (ColorImageFrame colorFrame = e.OpenColorImageFrame()) //get the color image frame out of the parameters supplied to the event handler.
            {
                if (colorFrame == null) return;         // The program must test to make sure that it has a genuine frame to work on.
                byte[] colorData = new byte[colorFrame.PixelDataLength]; //It must now create a buffer to hold all the video data that has been received from the camera.
                colorFrame.CopyPixelDataTo(colorData);  //extract the color data from the frame and put it in the array.

                kinectVideo.Source = BitmapSource.Create(
                                    colorFrame.Width, colorFrame.Height, // image dimensions
                                    96, 96,  // resolution - 96 dpi for video frames
                                    PixelFormats.Bgr32, // video format
                                    null,               // palette - none
                                    colorData,          // video data
                                    colorFrame.Width * colorFrame.BytesPerPixel // stride
                                    );
            }

At this point all the links in the chain should be complete, and you have a program that should use
the video camera in the Kinect sensor.

Refrence : Start Here! Learn The Kinect API

Regards
« Last Edit: June 08, 2014, 06:08:56 18:08 by pertican » Logged

#tester
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 1
-Receive: 15


« Reply #3 on: June 08, 2014, 10:27:43 22:27 »

loads of data and sample code here
http://www.kinecthacks.com
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC