Saturday, June 25, 2011

StartMenu on CodePlex

With change set 8122 I've added the source code for the Candescent StartMenu WPF application to CodePlex.

To show the menu, present your open hand to the kinect at a distance of around 0.5 - 1 meters. To close the menu again, just close the hand. To start an application, stretch out one finger, move it over the icon (which gets highlighted), then close the hand quickly, so no finger is visible anymore.

If you're using the Kinect SDK the distance is limited to 850 to 950mm.
Open Start Menu

There is currently only one item in the start menu by default (Windows Explorer). You can configure programs or files to be shown in the Settings View. To open it, right click on the task bar icon and select "Settings..." or double click the icon.


Start Menu Settings

The configuration is stored in the file "menu_config.csv", you can also edit this file manually. Please don't change the first line. All other lines have to be in the format <Name>;<Path>.

To stop the program, press escape while the start menu is visible or right click the task bar icon ans select "Close".

The icons in the settings view are from "Crystal Project Icons"
Author:    Everaldo Coelho
Site:    http://www.everaldo.com
Contact: everaldo@everaldo.com
License: LGPL

16 comments:

  1. greetings!

    Great work on the app! I have a question, when I try to debug the Start Menu project, it says running but somehow the depth window did not appear. I'm really new in Kinect development and really passionate to learn about it.

    Kindly request your assistance! Thnks!

    ReplyDelete
  2. Hi jedi_harry

    You did nothing wrong, I've removed that part for the moment. I will add a WPF video view somewhen in the future (the current one is using WinForms).

    But you can enable it yourself like this:
    1. Important: Get the newest change set (8193)
    2. Add the following code to the end of the constructor of the class MainViewPresenter

    var form = new System.Windows.Forms.Form();
    var depthImageSource = this.factory.CreateDepthImageDataSource();
    form.Controls.Add(new CCT.NUI.Visual.VideoControl(depthImageSource));
    form.Show();

    Regards,
    Stefan

    ReplyDelete
  3. Good work Stefan, did you have plans share the image manipulator code?

    ReplyDelete
  4. Hi Ano

    That code isn't ready to be published, but I can work on it next.

    Regards,
    Stefan

    ReplyDelete
  5. Thanks for the tip Stefan. I'm hoping to learn more about Kinect as I go along your samples. Great work!

    ReplyDelete
  6. hey stefan,

    i have problems with your framework.

    is it possible to cantact you more directly like icq, msn, skype?

    regards,
    bernhard

    ReplyDelete
  7. Hi Bernhard

    Sorry for not having answered earlier. I was away for three days (hiking in the Alps).

    The easiest way for me to answer questions is by e-mail (info@candescent.ch), maybe you can describe your problems?

    If we don't find a solution, I can send you my ICQ number to your e-mail address.

    Regards,
    Stefan

    ReplyDelete
  8. well... it takes a few lines to describe the problem...
    i wrote you an email

    ReplyDelete
  9. Can you make the distance adaptive? maybe by finding the closes point and assuming that its the hand as long as it is one cluster? that way the program can run from the place the person decides to use rather than stepping into the location, also if you're using the KinectSDK you can look for the joint position in the hand and start looking for the image area around that instead of the whole image. might speed up your calculations. you could also check the angle of the joints if they are held out from the body to start your calculations.

    ReplyDelete
  10. Hi EddHead

    The first solution you propose is quite easy to implement, you can try it yourself like this (maybe I'll add it as an option later):

    In ClusterDataSource.cs add the following line at the beginning of the method FindPointsWithinDepthRange:

    ushort minDepthFound = ushort.MaxValue;

    then after pDepth++; add
    if (depthValue > 0 && y < maxY)
    {
    minDepthFound = Math.Min(depthValue, minDepthFound);
    }

    And add the following lines right before return result;

    if (minDepthFound < ushort.MaxValue)
    {
    this.settings.MaximumDepthThreshold = minDepthFound + 100;
    }

    This will set the maximum depth threshold to the nearest point +10cm and will apply in the next frame.

    Also change the following method in KMeans.cs (Because sometimes, when the cluster is big, the iterations take too long or don't stop at all, I'd have to find a better break condition)

    public void IterateUntilStable()
    {
    int[] counts;
    int iterationCount = 0;
    do
    {
    counts = this.clusters.Select(c => c.Count).ToArray();
    this.IterateOnce();
    iterationCount++;
    } while (iterationCount < 100 && DetectCountChange(counts));

    foreach (var cluster in this.clusters)
    {
    cluster.CalculateVolume();
    }
    }

    About using the joint positions: I'd like to keep my code indepenent of the SDK or OpenNI for the moment.

    Regards,
    Stefan

    ReplyDelete
  11. Thanks, will try it out. maybe you should have this code enabled with a checkbox. Agree on the skeleton independent thing - maybe it makes more sense to try to port this to Accelerator.NET to work on the GPU for speed

    ReplyDelete
  12. For the Kinect SDK, the feed is flipped Horizontally. is that intentional? how do I flip it back?

    ReplyDelete
  13. I changed that in changeset 8263, which one are you using?

    Is your Kinect in front of you or behind you?

    I think I'll have to add an option for enabling / disabling mirroring.

    ReplyDelete
  14. @Anonymous: The image manipulation code is now on CodePlex

    ReplyDelete