C# Class KinectMenu.KinectPage

A generalized Page that is meant to make use of the Kinect's sensors (motion control, speech recognition,...) Extend this page to enable kinect controls on your Page.
Inheritance: System.Windows.Controls.Page
Mostra file Open project: NUIC/2-Kinects-1-Machine

Protected Properties

Property Type Description
_handLeft double
_handTop double
_selectedButton System.Windows.Controls.Button
buttons List
inAction System.Boolean
kinectLeft Coding4Fun.Kinect.Wpf.Controls.HoverButton
kinectLeft1 Coding4Fun.Kinect.Wpf.Controls.HoverButton
kinectRight Coding4Fun.Kinect.Wpf.Controls.HoverButton
kinectRight1 Coding4Fun.Kinect.Wpf.Controls.HoverButton
liveVideo Image

Public Methods

Method Description
IsCursorOverObject ( FrameworkElement hand, List

Checks to see if the kinect cursor is over an object.

IsHandsTogetherOnAButton ( FrameworkElement hand, FrameworkElement otherHand, List

Checks to see if both hands are together in a clapping motion over a button.

KinectPage ( ) : System
OnButtonLocationChanged ( Hands movingHand, int x, int y ) : void

The main method for handling motion. Checks for clapping or hover events.

SpeechRecognized ( object sender, SpeechRecognizedEventArgs args ) : void

The main method for speech recognition. If an utterance is recognised by the SpeechEngine, this handler is called with the command. The handler checks the button names for the matching button and calls its Click event.

SpeechRejected ( object sender, SpeechRecognitionRejectedEventArgs args ) : void

The main method for speech rejection. Used to notify the user of a rejected speech utterance.

Protected Methods

Method Description
InitializeButtons ( ) : void

Override this method. Allows the kinect page to "know" about any selectable buttons on the Page.

InitializeKinectHandIcons ( ) : void

Override this method. Attaches the kinect hand icons to the user's hands.

InitializeVideoImage ( ) : void

Override this method. Allows the kinect page to update the video image of the person moving.

Private Methods

Method Description
MainWindow_Loaded ( object sender, RoutedEventArgs e ) : void

A callback method for when the page is loaded. Set's up the buttons and live image for the current page. Initializes the motion and speech controls as well.

MainWindow_Unloaded ( object sender, RoutedEventArgs e ) : void

A callback method for when the page is unloaded. Remove's event handlers from the speech and motion modules. Reset's all of the referrences.

runtime_VideoFrameReady ( object sender, ColorImageFrameReadyEventArgs e ) : void

Method Details

InitializeButtons() protected method

Override this method. Allows the kinect page to "know" about any selectable buttons on the Page.
protected InitializeButtons ( ) : void
return void

InitializeKinectHandIcons() protected method

Override this method. Attaches the kinect hand icons to the user's hands.
protected InitializeKinectHandIcons ( ) : void
return void

InitializeVideoImage() protected method

Override this method. Allows the kinect page to update the video image of the person moving.
protected InitializeVideoImage ( ) : void
return void

IsCursorOverObject() public static method

Checks to see if the kinect cursor is over an object.
public static IsCursorOverObject ( FrameworkElement hand, List
hand System.Windows.FrameworkElement The Kinect cursor
buttons List The list of buttons to check against
return bool

IsHandsTogetherOnAButton() public static method

Checks to see if both hands are together in a clapping motion over a button.
public static IsHandsTogetherOnAButton ( FrameworkElement hand, FrameworkElement otherHand, List
hand System.Windows.FrameworkElement The first hand
otherHand System.Windows.FrameworkElement The second hand
buttons List The list of buttons to check against
return bool

KinectPage() public method

public KinectPage ( ) : System
return System

OnButtonLocationChanged() public static method

The main method for handling motion. Checks for clapping or hover events.
public static OnButtonLocationChanged ( Hands movingHand, int x, int y ) : void
movingHand Hands The hand that is currently moving
x int The moving hand's current x position
y int The moving hand's current y position
return void

SpeechRecognized() public method

The main method for speech recognition. If an utterance is recognised by the SpeechEngine, this handler is called with the command. The handler checks the button names for the matching button and calls its Click event.
public SpeechRecognized ( object sender, SpeechRecognizedEventArgs args ) : void
sender object
args SpeechRecognizedEventArgs
return void

SpeechRejected() public method

The main method for speech rejection. Used to notify the user of a rejected speech utterance.
public SpeechRejected ( object sender, SpeechRecognitionRejectedEventArgs args ) : void
sender object
args SpeechRecognitionRejectedEventArgs
return void

Property Details

_handLeft protected_oe static_oe property

protected static double _handLeft
return double

_handTop protected_oe static_oe property

protected static double _handTop
return double

_selectedButton protected_oe static_oe property

protected static Button,System.Windows.Controls _selectedButton
return System.Windows.Controls.Button

buttons protected_oe property

protected List
return List

inAction protected_oe property

protected Boolean,System inAction
return System.Boolean

kinectLeft protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectLeft
return Coding4Fun.Kinect.Wpf.Controls.HoverButton

kinectLeft1 protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectLeft1
return Coding4Fun.Kinect.Wpf.Controls.HoverButton

kinectRight protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectRight
return Coding4Fun.Kinect.Wpf.Controls.HoverButton

kinectRight1 protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectRight1
return Coding4Fun.Kinect.Wpf.Controls.HoverButton

liveVideo protected_oe property

protected Image liveVideo
return Image