{"id":12,"date":"2011-01-08T23:29:22","date_gmt":"2011-01-08T23:29:22","guid":{"rendered":"https:\/\/peterklemperer.com\/blog\/?p=12"},"modified":"2011-01-08T23:39:04","modified_gmt":"2011-01-08T23:39:04","slug":"kinect-keyboard","status":"publish","type":"post","link":"https:\/\/peterklemperer.com\/blog\/2011\/01\/08\/kinect-keyboard\/","title":{"rendered":"Kinect Keyboard"},"content":{"rendered":"<p>For Christmas my lovely girlfriend gave me a Kinect for my Xbox. \u00a0After playing several hours of Dance Central, I decided to get down to the serious business of writing my own fun demo. \u00a0Hope you enjoy. \u00a0See below the cut for details on the implementation.<\/p>\n<p><iframe loading=\"lazy\" title=\"Kinect Keyboard Demo\" width=\"640\" height=\"480\" src=\"https:\/\/www.youtube.com\/embed\/FdA2-GUTv2E?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p><!--more--><\/p>\n<p>The above video is just a screen capture showing depth map from the Kinect (whiter is further back) on the top left, the live video on the top right, and my keyboard view on the bottom left. \u00a0The keyboard view displays the outline of any objects observed within a certain distance range from Kinect. \u00a0You can tell this because I appear and disappear as I move through this range in the video. \u00a0The computer vision software then determines the centroid of the largest blob in the keyboard view and calculates the location. \u00a0I use that location to trigger which key should be played.<\/p>\n<p>To get my Kinect working with my Mac, I downloaded the libfreenect package using the brew package manager. \u00a0I also used get to get the excellent ofxKinect library for openFrameworks. \u00a0To my suprise, things just compiled in xcode on the first try. \u00a0Things look a little rough getting installed but it worked out fine for me. \u00a0See the bottom of the post for links back to all of these great free tools.<\/p>\n<p>This was my first experience with openFramework but the UI development aspects feel very much like Processing (except in C). \u00a0The documentation available on their website was complete enough for me to work out any issues I had. \u00a0OpenCV is also included in openFramework and I used it&#8217;s blob detection capabilities to map my movements in front of the camera to the keys. \u00a0The sound is amateurish but I just ripped out the openFrameworks sound demo and modified it to emit sine waves of the appropriate pitches for the keys.<\/p>\n<ul>\n<li>http:\/\/openkinect.org\/wiki\/Main_Page<\/li>\n<li>http:\/\/www.openframeworks.cc\/<\/li>\n<li>https:\/\/github.com\/ofTheo\/ofxKinect<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>For Christmas my lovely girlfriend gave me a Kinect for my Xbox. \u00a0After playing several hours of Dance Central, I decided to get down to the serious business of writing my own fun demo. \u00a0Hope you enjoy. \u00a0See below the &hellip; <a href=\"https:\/\/peterklemperer.com\/blog\/2011\/01\/08\/kinect-keyboard\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[58,6],"tags":[4,3,5],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-kinect","category-projects","tag-kinect","tag-kinect-keyboard","tag-opencv"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1VqWo-c","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":0,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}