Detecting Kinect Sensor

by Hiren 16. August 2012 15:37

In my last blog post we discussed about the basics to get started with Kinect programming, today we will see how we can detect a connected Kinect device and Enable its stream and start that device. We will start by creating a sample application in WPF that uses the Kinect device. Open Visual studio and create a new WPF Application.

 

Next we need to add reference to Microsoft.Kinect dll. This will enable us to use Kinect with our application

 

In MainWindow.xaml.cs add the using directive for Microsoft.kinect, now we are ready to use kinect device, with our application.

Before we move further, it is important to know different status a kinect sensor can have. These statuses as defined in the KinectStatus enumeration, are:

Status

Description

Connected

The Kinect is fully connected and ready.

DeviceNotGenuine

The Kinect is not genuine.

DeviceNotSupported

The Kinect is not supported.

Disconnected

The Kinect is not connected to the USB connector.

Error

An error has occurred.

Initializing

The Kinect is initializing.

InsufficientBandwidth

The USB connector does not have sufficient bandwidth.

NotPowered

The Kinect is not powered up.

NotReady

Some part of the kinect is not yet ready.

Undefined

The status is not defined.

We will use some of these statuses in our code, which is as follows:

using Microsoft.Kinect;

namespace KinectBiginner
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private KinectSensor sensor = null;

        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            getKinect();// assigns the kinect sensor device to KinectSensor object.

            //tracks the change in the kinect's status.
            KinectSensor.KinectSensors.StatusChanged +=new EventHandler<StatusChangedEventArgs>(KinectSensors_StatusChanged);
            if (sensor != null)
            {
                lblKinectStatus.Content = "Kinect Conected.";
            }
            else
            {
                lblKinectStatus.Content = "No device found.";
            }

        }

        /// <summary>
        /// Assigns the first kinect detected to the KinectSensor object.
        /// Enables Skeletonstream and starts the device.
        /// </summary>
        private void getKinect()
        {
            sensor = KinectSensor.KinectSensors.FirstOrDefault(s => s.Status == KinectStatus.Connected);
            if (sensor != null)
            {
                sensor.SkeletonStream.Enable();
                sensor.Start();
            }
        }

        /// <summary>
        /// This is called each time, when there is a change in the kinect device status.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void KinectSensors_StatusChanged(Object sender, StatusChangedEventArgs e) 
        {
            switch (e.Status)
            {
                case KinectStatus.Initializing:
                    if (sensor == null)
                    {
                        lblKinectStatus.Content = "Initializing Kinect...";
                    }
                    break;

                case KinectStatus.Connected:
                    if (sensor == null)
                    {
                        getKinect();
                        if (sensor != null)
                        {
                            lblKinectStatus.Content = "Kinect Connected.";
                        }

                    }

                    break;

                case KinectStatus.Disconnected:
                    if (sensor == e.Sensor)
                    {
                        
                        lblKinectStatus.Content = "Kinect was disconnected.";
                        if (sensor != null)
                        {
                            sensor.Stop();
                            sensor = null;
                        }
                    }
                    break;

                case KinectStatus.NotPowered:
                    if (sensor == e.Sensor)
                    {
                        lblKinectStatus.Content = "Kinect not powered.Please check the power supply.";
                        if (sensor != null)
                        {
                            sensor.Stop();
                            sensor = null;
                        }
                        
                    }
                    break;
            }
          
        }
    }
}

 

 

This application will show the current status of the Kinect device, as can be seen in below screen shots: 

  1. Initially if the device is not connected
  2. When Kinect device is initializing
  3. When the status of the kinect is connected and is ready to be used
  4. When status of kinect is disconnected
  5. When the power adapter of kinect is not powered

For any commercial Kinect application it is important to track the status of Kinect device in real time.

In next blog we will see how we can track user skeleton using Kinect.

SharePoint 2013 - Features

by Amit Wadhwani 31. July 2012 16:46

With the launch of SharePoint 2013, Microsoft tends to change the way people used to work. SharePoint 2013 comes flooded with numerous out of the box features which are targeted to ease the life of not only developers but SharePoint users as well. Few of the major features of SharePoint 2013 are discussed here.

 

Design and Implement
When it comes to branding, SharePoint 2013 lets you expand your hands wide and accept everything. Designers can now design a website using HTML, CSS and Javascript as they would usually do for a static website using applications like Adobe Dreamweaver etc. and integrate it to SharePoint 2013, thereby offering greater control over the website designing and branding.

Everything is in Apps
SharePoint 2013 is loaded with Cloud app model. Just like mobile apps, SharePoint 2013 apps are functional units performing independently. Each app extends the capabilities of a SharePoint website and do not interact with each other. Apps do not affect server load and are extremely easy to use. The users can device what app to use and what not. Administrators can download apps from the app store or get their own custom app build.

Access to document - Online or Offline
One of the biggest improvements in SharePoint 2013 is the way it allows the users to synchronize. The users can synchronize the document libraries with their local hard drive and save all the data locally. This allows them to access the documents even when offline.

Multi-platform access
Whether you are on a PC or a mobile/tablet device, SharePoint 2013 will never create a hurdle in your access. Developers can create device specific master pages to make sure that the website works perfect with all kinds of devices. This is a strong reason for companies to upgrade to SharePoint 2013.

Get Social
With SharePoint 2013, getting social is easier than it ever was. Users get real time notifications about the documents, sites and people they are following.

Workflows - They were never so good
Workflows in SharePoint 2013 are not just better than their previous versions also they have got much smarter. They have enhanced capabilities in managing complex activities. They can integrate with your current systems easily with web services to give you outstanding results.

Beginning With Kinect Programming

by Hiren 6. July 2012 11:49

Microsoft’s Kinect device has brought a whole new domain for developers to create innovative applications, which has amazed the end users with its great user experience. In this and couple of more blogs in coming weeks we will discuss the basics of Kinect programming that can get you started with Kinect application development using Kinect SDK.

Firstly, to start the development you will need a Kinect device and Kinect SDK installed on your system. You can download the latest Kinect SDK from here. In next few blogs we will be creating application in WPF that uses the Kinect device. Now before we start coding we need  to know about the basic streams and frames of kinect device.They are:

  • Skeleton Stream: Maintains the stream of skeleton data coming from the Kinect. The Kinect streams skeleton data using SkeletonFrame objects, each one of which contains one frame of skeleton data. The SkeletonStream contains data to track up to six skeletons at the same time.
  • Depth Image Stream: Represents a stream of DepthImageStream objects.
  • Color Stream: It represents a stream of ColorImageFrame objects.

Next we need to be aware of events related to the kinect device that we will deal with while developing kinect applications.They are:

  • AllFramesReady: Event that fires when all frames are available.
  • ColorFrameReady: Event that fires when a new color frame for the ColorStream is available.
  • DepthFrameReady: Event that fires when a new depth frame for the DepthStream is available.
  • SkeletonFrameReady: Event that fires when a new skeleton frame for the SkeletonStream is available.

Another important thing to look for is the KinectSensor Class. It represents a single kinect device.

Now the most basics thing that we need to do in all most all kinect applications are:

  1. Create a KinectSensor Class object.
  2. Identify attached kinect and assign it to the KinectSensor class object.
  3. Next enable different streams according to the applications requirement.
  4. Start kinect.
  5. Call the associated FrameReady event and do all the processing relevant to the application in these events.
  6. Once done stop kinect. 

This should get any one started with kinect application development. In the next blog we will discuss further on kinect application development and will start with basic coding examples. 

Why Microsoft Exchange Online is better than Google Apps?

by Raveesh 4. July 2012 12:37
  • Google apps treats an email thread as a conversation. All the replies and forwards are added to a single thread which makes it a little confusion and complicated to identify the messages in the thread. On the other hand, Exchange Online allows you to keep the messages individually so that it is easy for you to locate a particular message.
  • Microsoft Exchange Online supports folder ordering for email messages. The messages can be moved to a folder for ease of access while in Google apps, the email messages can just be marked and not actually moved to a folder. It allows you to create different marks and mark messages to group them up.
  • If you are using a web mail on Outlook, you can have your data synchronized with Microsoft Exchange freely. But if you are using Google mail on Outlook, you need an additional plugin to be installed for keeping the data between the Outlook and Google apps synchronized. Also if you are using any other email client except Outlook, you won’t be able to keep your data synchronized as Google does not provide any plugin for other clients.
  • The Microsoft Exchange Server calendar offers seamless capabilities as compared to Google apps calendar. Activities like meeting invitations and setup are a handy task in Exchange server than Google apps.
  • One of the biggest advantages of Microsoft Exchange Server is consistency. Exchange Server and Outlook maintain navigational and functional consistency despite of providing new capabilities in every update. On the other hand, Google apps is not very much consistent. The navigational layout and other structure is changed in every update making it a little difficult and time consuming while learning every update.
  • While using Google apps you might have to face compliance issue as your mails are hosted on same server that contains all other Google mail ID’s.  It may create compliance issue for users as they don’t know where their mails are being stored while in Microsoft Exchange environment users are well aware of these things and do not face such problems.
  • Microsoft Exchange Server serves requirements like tasks, notes and journals etc. which are basic necessities of most of the businesses. These items are not available in Google apps.
  • Microsoft Exchange Server lets you manage your contacts much efficiently. There are large numbers of fields for storing more information about your contacts in Microsoft Exchange as against Google apps which offers limited contact information.
  • With Microsoft Exchange Server, you can have different signatures for new messages and replies while in Google apps, you can configure only a single signature for both the new messages and replies.
  • Exchange Server lets users flag messages for different dates while in Google apps, the messages can just be marked important or starred.
  • Outlook offers many options for customized delivery which Google does not yet support. This includes delivery receipts, read receipts, sensitivity flags and voting buttons

Beginning with Kinect Programming

by Hiren 1. July 2012 06:06

Microsoft’s Kinect device has brought a whole new domain for developers to create innovative applications, which has amazed the end users with its great user experience.

In this and couple of more blogs in coming weeks we will discuss the basics of Kinect programming that can get you started with kinect application development using Kinect SDK.

Firstly, to start the development you will need a kinect device and Kinect SDK installed on your system. You can download the latest Kinect SDK from here.

In next few blogs we will be creating application in WPF that uses the kinect device.
Now before we start coding we need  to know about the basic streams and frames of kinect device.They are:

  • Skeleton Stream: Maintains the stream of skeleton data coming from the kinect. The kinect streams skeleton data using SkeletonFrame objects, each one of which contains one frame of skeleton data. The SkeletonStream contains data to track up to six skeletons at the same time.
  • Depth Image Stream: Represents a stream of DepthImageStream objects.
  • Color Stream: It represents a stream of ColorImageFrame objects.

Next we need to be aware of events related to the kinect device that we will deal with while developing kinect applications.They are:


  • AllFramesReady:Event that fires when all frames are available.
  • ColorFrameReady: Event that fires when a new color frame for the ColorStream is available.
  • DepthFrameReady:Event that fires when a new depth frame for the DepthStream is available.
  • SkeletonFrameReady:Event that fires when a new skeleton frame for the SkeletonStream is available.

Another important thing to look for is the KinectSensor Class. It represents a single kinect device.
 

Now the most basics thing that we need to do in all most all kinect applications are:

  • Create a KinectSensor Class object.
  • Identify attached kinect and assign it to the KinectSensor class object.
  • Next enable different streams according to the applications requirement.
  • Start kinect.
  • Call the associated FrameReady event and do all the processing relevant to the application in these events.
  • Once done stop kinect.
This should get any one started with kinect application development.
In the next blog we will discuss further on kinect application development and will start with basic coding examples.

 

 

 

 

 

 

Tags: , , ,

About Ignatiuz

Ignatiuz Technologies is an IT company offering technology solutions for customers keeping partner centric approach with a mantra "Compelling IT Solutions". The company is passionate to latest technologies & innovation. Our consulting led approach make our customers become partners & partner's transformation to global corporations.

Ignatiuz QR Code

Month List

Tag cloud