From 418146e2b6f32aa8c5ef37dadf7260c035a9a88f Mon Sep 17 00:00:00 2001 From: Jeremy Lightsmith Date: Tue, 1 Mar 2011 13:45:32 -0800 Subject: [PATCH 01/19] adding a getting started section to the readme --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index d8b09ef..143fc0f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,35 @@ We want to recognize: - Individual fingers - Finger-based hand gestures (e.g. peace sign, etc) +Getting Started +--------------- + +Right now, you'll want to be on Chrome, on OSX, then: + +- Plug in your Kinect to your computer via USB +- Download this code from http://github.com/doug/depthjs +- Install the chrome extension + - Bring up the extensions management page by clicking the wrench icon and choosing *Tools* > *Extensions*. + - If *Developer mode* has a + by it, click the + to add developer information to the page. The + changes to a -, and more buttons and information appear. + - Click the *Load unpacked extension* button. A file dialog appears. + - In the file dialog, navigate to your *depthjs/chrome-extension-mac* and click *OK*. +- Open a new web page (it only affects new pages) +- Have fun! + +What the camera sees... + +- When the extension starts up, it opens 3 windows, blob, first, and second +- first & second show the limits of the depth of field the camera is paying attention to, you should try to make it so that your hand is in both first & second and not much else +- blob shows you everything the camera can see as well as a blue circle around where it thinks your hand is. + +After opening a new page in Chrome, + +- Pull your hand back so that both first & second windows are blank and there is no circle in the blob window +- Then bring your hand forward until it gets an outline in the blob window, and pause for a second until the blue circle appears +- You should then see a blue circle on the web site that will track your movements +- To click, just close your hand into a fist! + + Components ---------- DepthJS is very modular. The Kinect driver and computer vision are written on top of Open Frameworks and OpenCV in C++. This component can output the raw RGB image, the raw depth map (filtered for the hand), as well as the high-level events that the computer vision recognizes. The three outputs are pumped out on three separate 0MQ TCP sockets. Next, a Torando web server (written in Python) takes the 0MQ data and wraps it into a WebSocket, which is what enables the web browser extension to receive the data. Finally a pure javascript-based extension connects to the WebSocket server to receive the events. Event handlers may be placed globally, in content scripts injected into each web page, or pushed via the content script to local DOM elements written by 3rd parties. From 07bcbc75e4358b6f94b02a7afa6c8af403e67de8 Mon Sep 17 00:00:00 2001 From: Jeremy Lightsmith Date: Thu, 3 Mar 2011 15:48:09 -0800 Subject: [PATCH 02/19] add hover events --- .../content_script/event_handlers.js | 5 ++ chrome-extension-mac/content_script/init.js | 27 +++++++--- chrome-extension-mac/content_script/root.js | 2 +- .../content_script/selector_box.js | 51 ++++++++++++++----- 4 files changed, 63 insertions(+), 22 deletions(-) diff --git a/chrome-extension-mac/content_script/event_handlers.js b/chrome-extension-mac/content_script/event_handlers.js index 1c4875d..49078d7 100644 --- a/chrome-extension-mac/content_script/event_handlers.js +++ b/chrome-extension-mac/content_script/event_handlers.js @@ -88,6 +88,7 @@ DepthJS.eventHandlers.onRegister = function(data) { console.log("Ignoring in two hands for now"); return; } + data.mode = "theforce"; if (data.mode == "theforce") { DepthJS.registerMode = "selectorBox"; } else if (data.mode == "twohands") { @@ -100,6 +101,7 @@ DepthJS.eventHandlers.onRegister = function(data) { DepthJS.lastRegisterTime = new Date(); DepthJS.state = DepthJS.registerMode; DepthJS[DepthJS.registerMode].show(); + $("#kinect-help").hide(); }; DepthJS.eventHandlers.onUnregister = function() { @@ -109,6 +111,7 @@ DepthJS.eventHandlers.onUnregister = function() { DepthJS.selectorBox.hide(); DepthJS.selectorBoxPopup.hide(); DepthJS.depthose.hide(); + $("#kinect-help").show(); }; DepthJS.eventHandlers.onHandClick = function() { @@ -167,6 +170,8 @@ DepthJS.eventHandlers.onMove = function(data) { } else if (DepthJS.state == "selectorBoxPopup") { DepthJS.selectorBoxPopup.move(accumulatedX, accumulatedY, accumulatedZ); } else { + //console.debug("setting the force") + DepthJS.eventHandlers.onRegister({mode:"theforce"}); if (DepthJS.verbose) console.log("Ignoring move in state " + DepthJS.state); } }; diff --git a/chrome-extension-mac/content_script/init.js b/chrome-extension-mac/content_script/init.js index b7c3482..6190c94 100644 --- a/chrome-extension-mac/content_script/init.js +++ b/chrome-extension-mac/content_script/init.js @@ -9,14 +9,25 @@ $(function() { // Let us know its running console.log("Finished initing, sticking in logo"); - $("").css({ - position: "fixed", - width: "32px", - height: "32px", - bottom: "20px", - left: "20px" - }).appendTo("body"); - console.log($("img")); + $("").attr("src", chrome.extension.getURL("logo_128x128.png")) + .css({ + position: "fixed", + width: "32px", + height: "32px", + bottom: "20px", + left: "20px" + }) + .appendTo("body"); + $("
").text("move your hand closer until you see your hand on the screen") + .css({ + position: "fixed", + left: "55px", + bottom: "20px", + backgroundColor: "white", + padding: 4 + }) + .appendTo("body"); + // console.log($("img")); var lastTime = null; diff --git a/chrome-extension-mac/content_script/root.js b/chrome-extension-mac/content_script/root.js index c456577..e69512a 100644 --- a/chrome-extension-mac/content_script/root.js +++ b/chrome-extension-mac/content_script/root.js @@ -54,7 +54,7 @@ function print() { }); var alphabeticalKeys = _.keys(counts).sort(); - console.log("------" + (new Date() + "")); + // console.log("------" + (new Date() + "")); _.each(alphabeticalKeys, function(type) { console.log([" " + counts[type] + " " + type + "; last = ", lastByType[type]]); }); diff --git a/chrome-extension-mac/content_script/selector_box.js b/chrome-extension-mac/content_script/selector_box.js index 9f999b2..35cd755 100644 --- a/chrome-extension-mac/content_script/selector_box.js +++ b/chrome-extension-mac/content_script/selector_box.js @@ -46,33 +46,58 @@ DepthJS.selectorBox.move = function(x, y) { if (x != $box.css("left") || y != $box.css("top")) { $box.css({left: x, top: y}); } + DepthJS.selectorBox.handleHover() }; -DepthJS.selectorBox.activate = function() { - if (DepthJS.verbose) console.log("DepthJS: Activating underneath selectorBox"); - // Lame code for now... - - var $intersectingLinks = $("a").filter(function() { +$.fn.findOverlapping = function($box) { + var bx = $box.position().left + $box.width() / 2; + var by = $box.position().top + $box.height() / 2; + + return $(this).filter(function() { var $a = $(this); var ax = $a.offset().left + $(window).scrollLeft(); var aw = $a.width(); var ay = $a.offset().top + $(window).scrollTop(); var ah = $a.height(); - var $box = DepthJS.selectorBox.$box; - var bx = $box.position().left; - var by = $box.position().top; - var bw = $box.width(); - var bh = $box.height(); - if (by > ay + ah || // box-top is lower than link-bottom - by + bh < ay || // box-bottom is higher than link-top + by < ay || // box-bottom is higher than link-top bx > ax + aw || // box-left is right of link right - bx + bw < aw) { // box-right is left of link left + bx < ax) { // box-right is left of link left return false; } return true; }); +} + +DepthJS.selectorBox.handleHover = function() { + var $lastElement = $('.depthjs-hover'); + var $hoverables = $("a").findOverlapping(DepthJS.selectorBox.$box); + + var trigger = function(element, name) { + var event = document.createEvent("Events") + event.initEvent(name, true, true); //true for can bubble, true for cancelable + // var event = document.createEvent(name); + // event.initEvent(msg.type, false, false); + element[0].dispatchEvent(event); + } + + if ($hoverables[0] == $lastElement[0]) { // same element + // do nothing + } else { + if ($lastElement.length > 0) { + trigger($lastElement.removeClass('depthjs-hover'), 'hoverOut'); + } + if ($hoverables.length > 0) { + trigger($hoverables.addClass("depthjs-hover"), "hoverOver"); + } + } +}; + +DepthJS.selectorBox.activate = function() { + if (DepthJS.verbose) console.log("DepthJS: Activating underneath selectorBox"); + // Lame code for now... + var $intersectingLinks = $("a").findOverlapping(DepthJS.selectorBox.$box); if (DepthJS.verbose) console.log("Got " + $intersectingLinks.length + " links"); if (DepthJS.verbose) console.log($intersectingLinks); From 995baa2bfc7687ca578c8a4f84372343d83b0949 Mon Sep 17 00:00:00 2001 From: Jeremy Lightsmith Date: Mon, 7 Mar 2011 18:05:52 -0800 Subject: [PATCH 03/19] optimized hit test by using elementFromPoint --- .../content_script/selector_box.js | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/chrome-extension-mac/content_script/selector_box.js b/chrome-extension-mac/content_script/selector_box.js index 35cd755..5ea7df7 100644 --- a/chrome-extension-mac/content_script/selector_box.js +++ b/chrome-extension-mac/content_script/selector_box.js @@ -49,58 +49,51 @@ DepthJS.selectorBox.move = function(x, y) { DepthJS.selectorBox.handleHover() }; -$.fn.findOverlapping = function($box) { - var bx = $box.position().left + $box.width() / 2; - var by = $box.position().top + $box.height() / 2; +DepthJS.selectorBox.elementAtCursor = function() { + var $box = DepthJS.selectorBox.$box; + var x = $box.position().left + $box.width() / 2; + var y = $box.position().top + $box.height() / 2; - return $(this).filter(function() { - var $a = $(this); - var ax = $a.offset().left + $(window).scrollLeft(); - var aw = $a.width(); - var ay = $a.offset().top + $(window).scrollTop(); - var ah = $a.height(); - - if (by > ay + ah || // box-top is lower than link-bottom - by < ay || // box-bottom is higher than link-top - bx > ax + aw || // box-left is right of link right - bx < ax) { // box-right is left of link left - return false; - } - return true; - }); + $box.hide(); + var element = document.elementFromPoint(x, y); + $box.show(); + return $(element).closestMatching('a,.hoverable'); +} + +$.fn.closestMatching = function(selector) { + if ($(this).is(selector)) return $(this)[0]; + + var parents = $(this).parents(); + for (var i = 0; i < parents.length; i++) { + if ($(parents[i]).is(selector)) return $(parents[i])[0]; + } + return undefined; } DepthJS.selectorBox.handleHover = function() { - var $lastElement = $('.depthjs-hover'); - var $hoverables = $("a").findOverlapping(DepthJS.selectorBox.$box); + var lastElement = $('.depthjs-hover')[0]; + var element = DepthJS.selectorBox.elementAtCursor(); var trigger = function(element, name) { var event = document.createEvent("Events") event.initEvent(name, true, true); //true for can bubble, true for cancelable - // var event = document.createEvent(name); - // event.initEvent(msg.type, false, false); - element[0].dispatchEvent(event); + element.dispatchEvent(event); } - if ($hoverables[0] == $lastElement[0]) { // same element + if (element == lastElement) { // same element // do nothing } else { - if ($lastElement.length > 0) { - trigger($lastElement.removeClass('depthjs-hover'), 'hoverOut'); + if (lastElement) { + trigger($(lastElement).removeClass('depthjs-hover')[0], 'hoverOut'); } - if ($hoverables.length > 0) { - trigger($hoverables.addClass("depthjs-hover"), "hoverOver"); + if (element) { + trigger($(element).addClass("depthjs-hover")[0], "hoverOver"); } } }; DepthJS.selectorBox.activate = function() { - if (DepthJS.verbose) console.log("DepthJS: Activating underneath selectorBox"); - // Lame code for now... - var $intersectingLinks = $("a").findOverlapping(DepthJS.selectorBox.$box); - - if (DepthJS.verbose) console.log("Got " + $intersectingLinks.length + " links"); - if (DepthJS.verbose) console.log($intersectingLinks); + var $intersectingLinks = DepthJS.selectorBox.elementAtCursor(); if ($intersectingLinks.length > 0) { DepthJS.selectorBoxPopup.$links = $intersectingLinks; DepthJS.selectorBoxPopup.activate(); From 00ecf18665cb5985f35760bfbcc50d1bbaf92a8d Mon Sep 17 00:00:00 2001 From: Aaron Zinman Date: Sat, 5 Mar 2011 07:50:50 +0800 Subject: [PATCH 04/19] Got the plugin to have events successfully called back to Safari-land --- webkit-plugin-mac/DLog.h | 20 + webkit-plugin-mac/DLog.mm | 39 + webkit-plugin-mac/ocv_freenect.hpp | 4 +- .../{ocv_freenect.cpp => ocv_freenect.mm} | 43 +- .../webkit-plugin-mac.xcodeproj/aaron.pbxuser | 1561 +++++++++-------- .../aaron.perspectivev3 | 95 +- .../project.pbxproj | 25 +- .../webkit-plugin-mac_Prefix.pch | 4 + webkit-plugin-mac/webkit_plugin_macView.h | 8 +- webkit-plugin-mac/webkit_plugin_macView.mm | 165 +- 10 files changed, 1109 insertions(+), 855 deletions(-) create mode 100644 webkit-plugin-mac/DLog.h create mode 100644 webkit-plugin-mac/DLog.mm rename webkit-plugin-mac/{ocv_freenect.cpp => ocv_freenect.mm} (92%) diff --git a/webkit-plugin-mac/DLog.h b/webkit-plugin-mac/DLog.h new file mode 100644 index 0000000..f128a00 --- /dev/null +++ b/webkit-plugin-mac/DLog.h @@ -0,0 +1,20 @@ +/* + * DebugLog.h + * DebugLog + * + * Created by Karl Kraft on 3/22/09. + * Copyright 2009 Karl Kraft. All rights reserved. + * + */ + +#ifndef __OPTIMIZE__ + +#define DLog(args...) _DLog(__FILE__,__PRETTY_FUNCTION__,__LINE__,args); + +#else + +#define DLog(x...) + +#endif + +void _DLog(const char *file, const char *function, int lineNumber, NSString *format,...); diff --git a/webkit-plugin-mac/DLog.mm b/webkit-plugin-mac/DLog.mm new file mode 100644 index 0000000..f4ac7bc --- /dev/null +++ b/webkit-plugin-mac/DLog.mm @@ -0,0 +1,39 @@ +/* + * DebugLog.m + * DebugLog + * + * Created by Karl Kraft on 3/22/09. + * Copyright 2009 Karl Kraft. All rights reserved. + * + */ + +#include "DLog.h" + +//void _DebugLog(const char *function, int lineNumber, NSString *format,...) { +// va_list ap; +// +// va_start (ap, format); +// if (![format hasSuffix: @"\n"]) { +// format = [format stringByAppendingString: @"\n"]; +// } +// NSString *body = [[NSString alloc] initWithFormat: format arguments: ap]; +// va_end (ap); +// NSString *fileName=[[NSString stringWithUTF8String:file] lastPathComponent]; +// fprintf(stderr,"%s:%d %s",[fileName UTF8String],lineNumber,[body UTF8String]); +// [body release]; +//} + + +void _DLog(const char *file, const char *function, int lineNumber, NSString *format,...){ + va_list args; + va_start(args, format); + + NSString *body = [[NSString alloc] initWithFormat:format arguments:args]; + //NSString *filename = [[NSString stringWithFormat:@"%s",file] lastPathComponent]; + NSString *logLine = [[NSString alloc] initWithFormat:@"%s %@\n", function, body]; + va_end(args); + + [[NSFileHandle fileHandleWithStandardOutput] writeData: [logLine dataUsingEncoding: NSNEXTSTEPStringEncoding]]; + [logLine release]; + [body release]; +} diff --git a/webkit-plugin-mac/ocv_freenect.hpp b/webkit-plugin-mac/ocv_freenect.hpp index deb2211..c584a87 100644 --- a/webkit-plugin-mac/ocv_freenect.hpp +++ b/webkit-plugin-mac/ocv_freenect.hpp @@ -30,8 +30,8 @@ using namespace cv; #include -int launchOcvFreenect(); - +int initFreenect(); +void* ocvFreenectThread(void *arg); void killOcvFreenect(); #endif // __DEPTHJS_OCV_FREENECT_HPP__ \ No newline at end of file diff --git a/webkit-plugin-mac/ocv_freenect.cpp b/webkit-plugin-mac/ocv_freenect.mm similarity index 92% rename from webkit-plugin-mac/ocv_freenect.cpp rename to webkit-plugin-mac/ocv_freenect.mm index 5181cd3..351d338 100644 --- a/webkit-plugin-mac/ocv_freenect.cpp +++ b/webkit-plugin-mac/ocv_freenect.mm @@ -22,8 +22,8 @@ int window; pthread_mutex_t buf_mutex = PTHREAD_MUTEX_INITIALIZER; -Mat depthMat(Size(640,480),CV_16UC1,Scalar(0)), -rgbMat(Size(640,480),CV_8UC3,Scalar(0)); +Mat depthMat(cv::Size(640,480),CV_16UC1,Scalar(0)), +rgbMat(cv::Size(640,480),CV_8UC3,Scalar(0)); freenect_device *f_dev; @@ -77,9 +77,9 @@ void rgb_cb(freenect_device *dev, void *rgb, uint32_t timestamp) extern Scalar refineSegments(const Mat& img, Mat& mask, Mat& dst, - vector& contour, - vector& second_contour, - Point2i& previous); + vector& contour, + vector& second_contour, + cv::Point2i& previous); extern void makePointsFromMask(Mat& maskm,vector& points, bool _add = false); extern void drawPoint(Mat& out,vector& points,Scalar color, Mat* maskm = NULL); @@ -224,7 +224,7 @@ void* ocvFreenectThread(void* arg) { vector prevPts,nextPts; vector statusv; vector errv; - Rect cursor(frameMat.cols/2,frameMat.rows/2,10,10); + cv::Rect cursor(frameMat.cols/2,frameMat.rows/2,10,10); bool update_bg_model = true; int fr = 1; int register_ctr = 0,register_secondbloc_ctr = 0; @@ -274,7 +274,7 @@ void* ocvFreenectThread(void* arg) { Mat blobMaskInput = depthf < 255; //anything not white is "real" depth - vector ctr,ctr2; + vector ctr,ctr2; Scalar blb = refineSegments(Mat(),blobMaskInput,blobMaskOutput,ctr,ctr2,midBlob); //find contours in the foreground, choose biggest @@ -287,7 +287,7 @@ void* ocvFreenectThread(void* arg) { //cvtColor(depthf, outC, CV_GRAY2BGR); //closest point to the camera - Point minLoc; double minval,maxval; + cv::Point minLoc; double minval,maxval; minMaxLoc(depthf, &minval, &maxval, &minLoc, NULL, blobMaskInput); circle(outC, minLoc, 5, Scalar(0,255,0), 3); @@ -318,12 +318,12 @@ void* ocvFreenectThread(void* arg) { // Vec4f _line; Mat curve(ctr); // fitLine(curve, _line, CV_DIST_L2, 0, 0.01, 0.01); - // line(outC, Point(blb[0]-_line[0]*70,blb[1]-_line[1]*70), - // Point(blb[0]+_line[0]*70,blb[1]+_line[1]*70), + // line(outC, cv::Point(blb[0]-_line[0]*70,blb[1]-_line[1]*70), + // cv::Point(blb[0]+_line[0]*70,blb[1]+_line[1]*70), // Scalar(255,255,0), 1); //blob center - circle(outC, Point(blb[0],blb[1]), 50, Scalar(255,0,0), 3); + circle(outC, cv::Point(blb[0],blb[1]), 50, Scalar(255,0,0), 3); // cout << "min depth " << minval << endl; @@ -365,7 +365,7 @@ void* ocvFreenectThread(void* arg) { //---------------------- fist detection --------------------- //calc laplacian of curve - vector approxCurve; //approximate curve + vector approxCurve; //approximate curve approxPolyDP(curve, approxCurve, 10.0, true); Mat approxCurveM(approxCurve); @@ -397,7 +397,7 @@ void* ocvFreenectThread(void* arg) { { //some debug on screen.. stringstream ss; ss << "high curve pts " << hcr_ctr << ", avg " << _avg[0]; - putText(outC, ss.str(), Point(50,50), CV_FONT_HERSHEY_PLAIN, 2.0,Scalar(0,0,255), 2); + putText(outC, ss.str(), cv::Point(50,50), CV_FONT_HERSHEY_PLAIN, 2.0,Scalar(0,0,255), 2); } } else { //not registered, look for gestures @@ -412,7 +412,7 @@ void* ocvFreenectThread(void* arg) { double timediff = ((double)getTickCount()-appearTS)/getTickFrequency(); if (timediff > .2 && timediff < 1.0) { //enough time passed from appearence - line(outC, appear, Point(blb[0],blb[1]), Scalar(0,0,255), 3); + line(outC, appear, cv::Point(blb[0],blb[1]), Scalar(0,0,255), 3); if (appear.x - blb[0] > 100) { cout << "right"<32DBCF9F0370C38200C91783 0259C582FE90428111CA0C5A 1ED78706FE9D4A0611CA0C5A + 2E58F364FFB232C311CA0CBA + 93F691811321A45600F53A8A + 93F691841321A45B00F53A8A 1C37FBAC04509CD000000102 - 937655B5131308DD00AC9D36 - 9376560913136E2F00AC9D36 1C37FAAC04509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey @@ -328,18 +329,23 @@ _historyCapacity 0 bookmark - 937656211313700E00AC9D36 + 93F691DA1321B1F400F53A8A history - 938DB61E130F3490008C37B1 - 938DB6E4130F3A7D008C37B1 - 938DB708130F444D008C37B1 - 938DB81E130F4A2E008C37B1 - 938DB82E130F4AF9008C37B1 - 937655E213136B9200AC9D36 - 9376561D1313700E00AC9D36 - 9376561E1313700E00AC9D36 - 9376561F1313700E00AC9D36 + 93F690F3132189E700F53A8A + 93F690F4132189E700F53A8A + 93F690F6132189E700F53A8A + 93F690F8132189E700F53A8A + 93F690FF13218A0500F53A8A + 93F691401321913700F53A8A + 93F691411321913700F53A8A + 93F69153132191B300F53A8A + 93F69154132191B300F53A8A + 93F6918D1321A60000F53A8A + 93F6918F1321A60000F53A8A + 93F691911321A60000F53A8A + 93F691931321A60000F53A8A + 93F691B41321AB9700F53A8A SplitCount @@ -353,16 +359,16 @@ GeometryConfiguration Frame - {{0, 0}, {1283, 1077}} + {{0, 0}, {1283, 888}} Module PBXNavigatorGroup Proportion - 1077pt + 888pt Proportion - 192pt + 381pt Tabs @@ -376,7 +382,7 @@ GeometryConfiguration Frame - {{10, 27}, {1283, 165}} + {{10, 27}, {1283, -27}} Module XCDetailModule @@ -392,7 +398,7 @@ GeometryConfiguration Frame - {{10, 27}, {1043, 591}} + {{10, 27}, {1283, 632}} Module PBXProjectFindModule @@ -430,7 +436,7 @@ GeometryConfiguration Frame - {{10, 27}, {1043, 591}} + {{10, 27}, {1283, 354}} Module PBXBuildResultsModule @@ -458,11 +464,11 @@ TableOfContents - 937655BC131308DE00AC9D36 + 93F690BD1321786C00F53A8A 1CA23ED40692098700951B8B - 937655BD131308DE00AC9D36 + 93F690BE1321786C00F53A8A 938563CC130E6093000F4333 - 937655BE131308DE00AC9D36 + 93F690BF1321786C00F53A8A 1CA23EDF0692099D00951B8B 1CA23EE00692099D00951B8B 1CA23EE10692099D00951B8B @@ -503,8 +509,6 @@ Layout - BecomeActive - ContentConfiguration PBXProjectModuleGUID @@ -515,14 +519,14 @@ GeometryConfiguration Frame - {{0, 0}, {1520, 391}} + {{0, 0}, {1520, 376}} RubberWindowFrame - 652 197 1520 1315 0 0 2560 1578 + 927 168 1520 1315 0 0 2560 1578 Module PBXDebugCLIModule Proportion - 391pt + 376pt ContentConfiguration @@ -541,8 +545,8 @@ yes sizes - {{0, 0}, {729, 200}} - {{729, 0}, {791, 200}} + {{0, 0}, {730, 254}} + {{730, 0}, {790, 254}} VerticalSplitView @@ -557,8 +561,8 @@ yes sizes - {{0, 0}, {1520, 200}} - {{0, 200}, {1520, 678}} + {{0, 0}, {1520, 254}} + {{0, 254}, {1520, 639}} @@ -578,7 +582,7 @@ DebugSTDIOWindowFrame {{200, 200}, {500, 300}} Frame - {{0, 396}, {1520, 878}} + {{0, 381}, {1520, 893}} PBXDebugSessionStackFrameViewKey DebugVariablesTableConfiguration @@ -588,20 +592,20 @@ Value 85 Summary - 561 + 560 Frame - {{729, 0}, {791, 200}} + {{730, 0}, {790, 254}} RubberWindowFrame - 652 197 1520 1315 0 0 2560 1578 + 927 168 1520 1315 0 0 2560 1578 RubberWindowFrame - 652 197 1520 1315 0 0 2560 1578 + 927 168 1520 1315 0 0 2560 1578 Module PBXDebugSessionModule Proportion - 878pt + 893pt Name @@ -619,13 +623,13 @@ TableOfContents - 937655C3131308E800AC9D36 + 93F690C01321786C00F53A8A 1CCC7628064C1048000F2A68 1CCC7629064C1048000F2A68 - 937655C4131308E800AC9D36 - 937655C5131308E800AC9D36 - 937655C6131308E800AC9D36 - 937655C7131308E800AC9D36 + 93F690C11321786C00F53A8A + 93F690C21321786C00F53A8A + 93F690C31321786C00F53A8A + 93F690C41321786C00F53A8A 938563CC130E6093000F4333 ToolbarConfigUserDefaultsMinorVersion @@ -660,13 +664,12 @@ 5 WindowOrderList - 937656221313700E00AC9D36 - 937655C9131308E800AC9D36 - 937655CA131308E800AC9D36 - /Volumes/New HD/Users/aaron/eclipseWorkspace/depthjs/webkit-plugin-mac/webkit-plugin-mac.xcodeproj + 93F6910313218A0500F53A8A + 93F6910413218A0500F53A8A + /Users/aaron/eclipseWorkspace/depthjs/webkit-plugin-mac/webkit-plugin-mac.xcodeproj WindowString - 652 197 1520 1315 0 0 2560 1578 + 927 168 1520 1315 0 0 2560 1578 WindowToolsV3 diff --git a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj index 6239433..5ebd50a 100644 --- a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj +++ b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj @@ -13,11 +13,13 @@ 8D1AC9800486D23B00FE50C9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */; }; 937655FA13136C7500AC9D36 /* libMallocDebug.A.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 937655F913136C7500AC9D36 /* libMallocDebug.A.dylib */; }; 938563E3130E61AF000F4333 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 938563DC130E61AF000F4333 /* Info.plist */; }; - 938564A3130E6EC0000F4333 /* ocv_freenect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938564A1130E6EC0000F4333 /* ocv_freenect.cpp */; }; + 938564A3130E6EC0000F4333 /* ocv_freenect.mm in Sources */ = {isa = PBXBuildFile; fileRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; }; 938564A8130E6EE0000F4333 /* bg_fg_blobs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938564A6130E6EE0000F4333 /* bg_fg_blobs.cpp */; }; 938DB6F5130F3CDC008C37B1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 938DB6F4130F3CDC008C37B1 /* IOKit.framework */; }; 938DB6FE130F3D7D008C37B1 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 938DB6FD130F3D7D008C37B1 /* libz.dylib */; }; 938DB702130F43F0008C37B1 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 938DB701130F43F0008C37B1 /* Accelerate.framework */; }; + 93F690C71321789600F53A8A /* DLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93F690C61321789600F53A8A /* DLog.mm */; }; + 93F691821321A45600F53A8A /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F691811321A45600F53A8A /* JavaScriptCore.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -58,13 +60,16 @@ 93856486130E6E4B000F4333 /* libopencv_objdetect.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopencv_objdetect.a; path = opencv/libopencv_objdetect.a; sourceTree = ""; }; 93856488130E6E4B000F4333 /* libopencv_video_pch_dephelp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopencv_video_pch_dephelp.a; path = opencv/libopencv_video_pch_dephelp.a; sourceTree = ""; }; 9385648A130E6E4B000F4333 /* libopencv_video.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopencv_video.a; path = opencv/libopencv_video.a; sourceTree = ""; }; - 938564A1130E6EC0000F4333 /* ocv_freenect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ocv_freenect.cpp; sourceTree = ""; }; + 938564A1130E6EC0000F4333 /* ocv_freenect.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ocv_freenect.mm; sourceTree = ""; }; 938564A2130E6EC0000F4333 /* ocv_freenect.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ocv_freenect.hpp; sourceTree = ""; }; 938564A6130E6EE0000F4333 /* bg_fg_blobs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bg_fg_blobs.cpp; sourceTree = ""; }; 938564A7130E6EE0000F4333 /* bg_fg_blobs.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bg_fg_blobs.hpp; sourceTree = ""; }; 938DB6F4130F3CDC008C37B1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 938DB6FD130F3D7D008C37B1 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 938DB701130F43F0008C37B1 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + 93F690C51321789600F53A8A /* DLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLog.h; sourceTree = ""; }; + 93F690C61321789600F53A8A /* DLog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DLog.mm; sourceTree = ""; }; + 93F691811321A45600F53A8A /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; DD92D38A0106425D02CA0E72 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; /* End PBXFileReference section */ @@ -79,6 +84,7 @@ 938DB6FE130F3D7D008C37B1 /* libz.dylib in Frameworks */, 938DB702130F43F0008C37B1 /* Accelerate.framework in Frameworks */, 937655FA13136C7500AC9D36 /* libMallocDebug.A.dylib in Frameworks */, + 93F691821321A45600F53A8A /* JavaScriptCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -95,6 +101,7 @@ 2E58F364FFB232C311CA0CBA /* Frameworks */, 938DB701130F43F0008C37B1 /* Accelerate.framework */, 937655F913136C7500AC9D36 /* libMallocDebug.A.dylib */, + 93F691811321A45600F53A8A /* JavaScriptCore.framework */, ); name = webkit_plugin_mac; sourceTree = ""; @@ -160,6 +167,8 @@ children = ( 0259C57AFE90428111CA0C5A /* webkit_plugin_macView.h */, 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */, + 93F690C51321789600F53A8A /* DLog.h */, + 93F690C61321789600F53A8A /* DLog.mm */, ); name = Classes; sourceTree = ""; @@ -167,7 +176,7 @@ 32DBCF9F0370C38200C91783 /* Other Sources */ = { isa = PBXGroup; children = ( - 938564A1130E6EC0000F4333 /* ocv_freenect.cpp */, + 938564A1130E6EC0000F4333 /* ocv_freenect.mm */, 938564A2130E6EC0000F4333 /* ocv_freenect.hpp */, 938564A6130E6EE0000F4333 /* bg_fg_blobs.cpp */, 938564A7130E6EE0000F4333 /* bg_fg_blobs.hpp */, @@ -257,8 +266,9 @@ buildActionMask = 2147483647; files = ( 8D1AC96B0486D14A00FE50C9 /* webkit_plugin_macView.mm in Sources */, - 938564A3130E6EC0000F4333 /* ocv_freenect.cpp in Sources */, + 938564A3130E6EC0000F4333 /* ocv_freenect.mm in Sources */, 938564A8130E6EE0000F4333 /* bg_fg_blobs.cpp in Sources */, + 93F690C71321789600F53A8A /* DLog.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -384,6 +394,13 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ( + "-I${SOURCE_ROOT}/include", + "-I${SOURCE_ROOT}/include/libusb-1.0", + "-I${SOURCE_ROOT}/include/opencv", + "-I${SOURCE_ROOT}/include/opencv2", + "-I${SOURCE_ROOT}/include/libfreenect", + ); PREBINDING = NO; SDKROOT = macosx10.5; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; diff --git a/webkit-plugin-mac/webkit-plugin-mac_Prefix.pch b/webkit-plugin-mac/webkit-plugin-mac_Prefix.pch index d4c4c67..2990a27 100644 --- a/webkit-plugin-mac/webkit-plugin-mac_Prefix.pch +++ b/webkit-plugin-mac/webkit-plugin-mac_Prefix.pch @@ -3,7 +3,11 @@ // #ifdef __OBJC__ +#ifdef __cplusplus #include +#endif #import #import + #import "DLog.h" #endif + diff --git a/webkit-plugin-mac/webkit_plugin_macView.h b/webkit-plugin-mac/webkit_plugin_macView.h index f2a0490..abc8a2f 100644 --- a/webkit-plugin-mac/webkit_plugin_macView.h +++ b/webkit-plugin-mac/webkit_plugin_macView.h @@ -10,13 +10,11 @@ @interface webkit_plugin_macView : NSView { - BOOL haveInitDevice; NSDictionary *pluginArguments; + BOOL haveInitDevice; + NSThread *ocvThread; } - (NSDictionary *)pluginArguments; - (void)setPluginArguments:(NSDictionary *)value; - -- (void) InitDepthJS; -- (void) ShutdownDepthJS; - + @end diff --git a/webkit-plugin-mac/webkit_plugin_macView.mm b/webkit-plugin-mac/webkit_plugin_macView.mm index 8296ef2..eeb01f9 100644 --- a/webkit-plugin-mac/webkit_plugin_macView.mm +++ b/webkit-plugin-mac/webkit_plugin_macView.mm @@ -7,25 +7,37 @@ // #import "webkit_plugin_macView.h" - - #import #import +#import #include "ocv_freenect.hpp" -static volatile bool haveInitDevice = false; +// PRIVATE METHODS --------------------------------------------------------------------------------- + +@interface webkit_plugin_macView (JsExposed) +- (void) InitDepthJS; +- (void) ShutdownDepthJS; +- (void) CallbackTest; +@end + +@interface webkit_plugin_macView (Internal) +- (id)_initWithArguments:(NSDictionary *)arguments; +- (void) ocvMainLoop; +@end + +// BRIDGE BACK FROM C++ LAND ----------------------------------------------------------------------- static volatile webkit_plugin_macView* hostPlugin = nil; bool SendEventToBrowser(const string& _eventJson) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Top-level pool NSString *eventJson = [NSString stringWithCString:_eventJson.c_str() encoding:[NSString defaultCStringEncoding]]; - NSLog(@"Going to send the following eventJson nsstring: %@", eventJson); + DLog(@"Going to send the following eventJson nsstring: %@", eventJson); if (hostPlugin == nil) { - NSLog(@"DepthJS Plugin: Ignoring event for uninit host"); + DLog(@"DepthJS Plugin: Ignoring event for uninit host"); return false; } @@ -34,22 +46,19 @@ bool SendEventToBrowser(const string& _eventJson) { /* retrieve a reference to the webview */ WebView *myWebView = [[pluginContainer webFrame] webView]; NSString *js = [NSString stringWithFormat:@"if(DepthJS && DepthJS.npBackend)DepthJS.npBackend.receiveEvent(%@)", eventJson]; + + [[myWebView windowScriptObject] performSelectorOnMainThread:@selector(evaluateWebScript:) withObject:js waitUntilDone:YES]; // [[myWebView windowScriptObject] evaluateWebScript:js]; - NSLog(@"Sent to javascript"); + DLog(@"Sent to javascript"); [pool release]; // Release the objects in the pool. return true; } else { - NSLog(@"Could not find pluginContainer?!;"); + DLog(@"Could not find pluginContainer?!;"); [pool release]; // Release the objects in the pool. return false; } } - -@interface webkit_plugin_macView (Internal) -- (id)_initWithArguments:(NSDictionary *)arguments; -@end - @implementation webkit_plugin_macView // WebPlugInViewFactory protocol @@ -70,6 +79,7 @@ - (void)setPluginArguments:(NSDictionary *)value { if (pluginArguments != value) { [pluginArguments release]; pluginArguments = [value copy]; + DLog(@"just set args: %@", pluginArguments); } } @@ -84,41 +94,41 @@ - (void)webPlugInInitialize { // This method will be only called once per instance of the plug-in object, and will be called // before any other methods in the WebPlugIn protocol. // You are not required to implement this method. It may safely be removed. - NSLog(@"webPlugInInitialize"); + DLog(@"webPlugInInitialize"); haveInitDevice = NO; + ocvThread = nil; + hostPlugin = self; // TODO remove later after testing } - (void)webPlugInStart { // The plug-in usually begins drawing, playing sounds and/or animation in this method. // You are not required to implement this method. It may safely be removed. - NSLog(@"webPlugInStart"); + DLog(@"webPlugInStart"); } - (void)webPlugInStop { // The plug-in normally stop animations/sounds in this method. // You are not required to implement this method. It may safely be removed. - NSLog(@"webPlugInStop"); + DLog(@"webPlugInStop; killing ocv"); + killOcvFreenect(); } - (void)webPlugInDestroy { - // Perform cleanup and prepare to be deallocated. - // You are not required to implement this method. It may safely be removed. - NSLog(@"webPlugInDestroy"); + DLog(@"webPlugInDestroy"); haveInitDevice = FALSE; - } - (void)webPlugInSetIsSelected:(BOOL)isSelected { // This is typically used to allow the plug-in to alter its appearance when selected. // You are not required to implement this method. It may safely be removed. - NSLog(@"webPlugInSetIsSelected"); + DLog(@"webPlugInSetIsSelected"); } - (id)objectForWebScript { // Returns the object that exposes the plug-in's interface. The class of this object can implement // methods from the WebScripting informal protocol. // You are not required to implement this method. It may safely be removed. - NSLog(@"objectForWebScript"); + DLog(@"objectForWebScript"); return self; } @@ -127,62 +137,123 @@ - (NSString *)webScriptNameForSelector:(SEL)selector { return @"InitDepthJS"; } else if (selector == @selector(ShutdownDepthJS)) { return @"ShutdownDepthJS"; + } else if (selector == @selector(CallbackTest)) { + return @"CallbackTest"; } return nil; } + (BOOL)isSelectorExcludedFromWebScript:(SEL)selector { - NSLog(@"isSelectorExcludedFromWebScript"); + DLog(@"isSelectorExcludedFromWebScript"); if(selector == @selector(InitDepthJS) || - selector == @selector(ShutdownDepthJS)) { - NSLog(@"NO"); + selector == @selector(ShutdownDepthJS) || + selector == @selector(CallbackTest)) { + DLog(@"NO"); return NO; } - NSLog(@"YES"); + DLog(@"YES"); return YES; } - (void)finalizeForWebScript { - NSLog(@"finalizeForWebScript"); + DLog(@"finalizeForWebScript"); +} + +@end + +@implementation webkit_plugin_macView (Internal) + +- (id)_initWithArguments:(NSDictionary *)newArguments { + if (!(self = [super initWithFrame:NSZeroRect])) + return nil; + + [self setPluginArguments: newArguments]; + return self; +} + +- (void) ocvMainLoop { + ocvThread = [NSThread currentThread]; + ocvFreenectThread(NULL); +} + +@end + +@implementation webkit_plugin_macView (JsExposed) + +NSString* jsRefToTypeString(JSContextRef& ctx, JSValueRef& t) { + switch (JSValueGetType(ctx, t)) { + case kJSTypeNull: + return @"null"; + case kJSTypeUndefined: + return @"undefined"; + case kJSTypeBoolean: + return @"boolean"; + case kJSTypeNumber: + return @"number"; + case kJSTypeString: + return @"string"; + case kJSTypeObject: + return @"object"; + default: + return [NSString stringWithFormat:@"Unknown type: %d", t]; + } +} + + +// This isn't really used... but it shows how the JavaScriptCore framework can be used if needed. +- (void) CallbackTest { + DLog(@"CallbackTest"); + id pluginContainer = [[hostPlugin pluginArguments] objectForKey:WebPlugInContainerKey]; + WebView *myWebView = [[pluginContainer webFrame] webView]; + JSObjectRef globalObj = [[myWebView windowScriptObject] JSObject]; + JSValueRef exception; + DLog(@"starting stuff to call DepthJS.k()"); + + // JSObjectRef globalObj = JSContextGetGlobalObject(ctx); + JSContextRef ctx = [[myWebView mainFrame] globalContext]; + JSValueRef depthJsRef = JSObjectGetProperty(ctx, globalObj, JSStringCreateWithCFString((CFStringRef)@"DepthJS"), &exception);; + DLog(@"depthjs ref type %s", jsRefToTypeString(ctx, depthJsRef)); + JSObjectRef depthJsObj = JSValueToObject(ctx, depthJsRef, &exception); + JSValueRef funcRef = JSObjectGetProperty(ctx, depthJsObj, JSStringCreateWithCFString((CFStringRef)@"k"), &exception); + DLog(@"depthjs.k ref type %s", jsRefToTypeString(ctx, funcRef)); + JSObjectRef funcObj = JSValueToObject(ctx, funcRef, &exception); + + JSValueRef result = JSObjectCallAsFunction(ctx, funcObj, NULL, 0, NULL, &exception); + if (result == NULL) { + DLog(@"got back null"); + } else { + DLog(@"got back type %s", jsRefToTypeString(ctx, result)); + } + DLog(@"done"); } - (void) InitDepthJS { - NSLog(@"DepthJS Plugin: InitDepthJS"); + DLog(@"DepthJS Plugin: InitDepthJS"); if (!haveInitDevice) { - NSLog(@"DepthJS Plugin: Device not yet init; initing"); - haveInitDevice = launchOcvFreenect() == 0; + DLog(@"DepthJS Plugin: Device not yet init; initing"); + int failed = initFreenect(); + haveInitDevice = !failed; if (haveInitDevice) { - NSLog(@"DepthJS Plugin: Successfully inited Kinect"); + DLog(@"DepthJS Plugin: Successfully inited Kinect; Starting ocv thread"); hostPlugin = self; + [NSThread detachNewThreadSelector:@selector(ocvMainLoop) toTarget:self withObject:nil]; } else { - NSLog(@"DepthJS Plugin: Failed to init Kinect"); + DLog(@"DepthJS Plugin: Failed to init Kinect"); } } else { - NSLog(@"DepthJS Plugin: Already init, ignoring"); + DLog(@"DepthJS Plugin: Already init, ignoring"); } } - (void) ShutdownDepthJS { - NSLog(@"DepthJS Plugin: ShutdownDepthJS"); + DLog(@"DepthJS Plugin: ShutdownDepthJS"); killOcvFreenect(); - NSLog(@"DepthJS Plugin: ShutdownDepthJS complete"); + DLog(@"DepthJS Plugin: ShutdownDepthJS complete"); haveInitDevice = false; if (hostPlugin == self) { hostPlugin = NULL; } } -@end - -@implementation webkit_plugin_macView (Internal) - -- (id)_initWithArguments:(NSDictionary *)newArguments { - if (!(self = [super initWithFrame:NSZeroRect])) - return nil; - - [self setPluginArguments: newArguments]; - return self; -} - -@end +@end \ No newline at end of file From 3669149ac086dc48e5e1d9cbb3bab477986cfdb4 Mon Sep 17 00:00:00 2001 From: Aaron Zinman Date: Sat, 5 Mar 2011 08:30:56 +0800 Subject: [PATCH 05/19] added modelv3 to ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 85b7772..ce28416 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ app/bin/* build/* *.pbxuser *.mode1v3 +*.perspectivev3 # old skool .svn From 2dbbffc4d66a8906dc517fcd0baf3a7fb5c0ee08 Mon Sep 17 00:00:00 2001 From: Aaron Zinman Date: Sat, 5 Mar 2011 08:31:30 +0800 Subject: [PATCH 06/19] ignore user files --- .../webkit-plugin-mac.xcodeproj/aaron.pbxuser | 1350 --------------- .../aaron.perspectivev3 | 1497 ----------------- 2 files changed, 2847 deletions(-) delete mode 100644 webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.pbxuser delete mode 100644 webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.perspectivev3 diff --git a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.pbxuser b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.pbxuser deleted file mode 100644 index 881a361..0000000 --- a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.pbxuser +++ /dev/null @@ -1,1350 +0,0 @@ -// !$*UTF8*$! -{ - 0259C573FE90428111CA0C5A /* Project object */ = { - activeBuildConfigurationName = Debug; - activeExecutable = 938DB81C130F4A2C008C37B1 /* Safari */; - activeTarget = 8D1AC9600486D14A00FE50C9 /* webkit-plugin-mac */; - addToTargets = ( - 8D1AC9600486D14A00FE50C9 /* webkit-plugin-mac */, - ); - codeSenseManager = 938563D6130E6093000F4333 /* Code sense */; - executables = ( - 938DB81C130F4A2C008C37B1 /* Safari */, - ); - perUserDictionary = { - "PBXConfiguration.PBXBreakpointsDataSource.v1:1CA23EDF0692099D00951B8B" = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 20, - 321, - 20, - 221, - 221, - 151, - 20, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXBreakpointsDataSource_ActionID, - PBXBreakpointsDataSource_TypeID, - PBXBreakpointsDataSource_BreakpointID, - PBXBreakpointsDataSource_UseID, - PBXBreakpointsDataSource_LocationID, - PBXBreakpointsDataSource_ConditionID, - PBXBreakpointsDataSource_IgnoreCountID, - PBXBreakpointsDataSource_ContinueID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; - PBXFileTableDataSourceColumnWidthsKey = ( - 22, - 300, - 692, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXExecutablesDataSource_ActiveFlagID, - PBXExecutablesDataSource_NameID, - PBXExecutablesDataSource_CommentsID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 10, - 20, - 48, - 43, - 43, - 20, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - PBXFileDataSource_Target_ColumnID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; - PBXFileTableDataSourceColumnWidthsKey = ( - 200, - 818, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFindDataSource_MessageID, - PBXFindDataSource_LocationID, - ); - }; - PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 764, - 60, - 20, - 48, - 43, - 43, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXTargetDataSource_PrimaryAttribute, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - ); - }; - PBXPerProjectTemplateStateSaveDate = 320960571; - PBXWorkspaceStateSaveDate = 320960571; - }; - perUserProjectItems = { - 93F690A71321783400F53A8A = 93F690A71321783400F53A8A /* PBXTextBookmark */; - 93F690A81321783400F53A8A = 93F690A81321783400F53A8A /* PBXTextBookmark */; - 93F690BA1321786A00F53A8A /* PBXBookmark */ = 93F690BA1321786A00F53A8A /* PBXBookmark */; - 93F690BB1321786A00F53A8A /* PBXTextBookmark */ = 93F690BB1321786A00F53A8A /* PBXTextBookmark */; - 93F690BC1321786C00F53A8A /* PBXTextBookmark */ = 93F690BC1321786C00F53A8A /* PBXTextBookmark */; - 93F690DC1321879000F53A8A /* PBXTextBookmark */ = 93F690DC1321879000F53A8A /* PBXTextBookmark */; - 93F690DD1321879000F53A8A /* PBXTextBookmark */ = 93F690DD1321879000F53A8A /* PBXTextBookmark */; - 93F690DE1321879000F53A8A /* PBXTextBookmark */ = 93F690DE1321879000F53A8A /* PBXTextBookmark */; - 93F690DF1321879000F53A8A /* XCBuildMessageTextBookmark */ = 93F690DF1321879000F53A8A /* XCBuildMessageTextBookmark */; - 93F690E01321879000F53A8A /* PBXTextBookmark */ = 93F690E01321879000F53A8A /* PBXTextBookmark */; - 93F690E9132187F000F53A8A /* PBXTextBookmark */ = 93F690E9132187F000F53A8A /* PBXTextBookmark */; - 93F690EA132187F000F53A8A /* XCBuildMessageTextBookmark */ = 93F690EA132187F000F53A8A /* XCBuildMessageTextBookmark */; - 93F690EB132187F000F53A8A /* PBXTextBookmark */ = 93F690EB132187F000F53A8A /* PBXTextBookmark */; - 93F690F3132189E700F53A8A /* PBXTextBookmark */ = 93F690F3132189E700F53A8A /* PBXTextBookmark */; - 93F690F4132189E700F53A8A /* PBXTextBookmark */ = 93F690F4132189E700F53A8A /* PBXTextBookmark */; - 93F690F6132189E700F53A8A /* PBXTextBookmark */ = 93F690F6132189E700F53A8A /* PBXTextBookmark */; - 93F690F8132189E700F53A8A /* PBXTextBookmark */ = 93F690F8132189E700F53A8A /* PBXTextBookmark */; - 93F690F9132189E700F53A8A /* PBXTextBookmark */ = 93F690F9132189E700F53A8A /* PBXTextBookmark */; - 93F690FA132189E700F53A8A /* PBXTextBookmark */ = 93F690FA132189E700F53A8A /* PBXTextBookmark */; - 93F690FB132189EB00F53A8A /* PBXTextBookmark */ = 93F690FB132189EB00F53A8A /* PBXTextBookmark */; - 93F690FC132189EB00F53A8A /* PBXTextBookmark */ = 93F690FC132189EB00F53A8A /* PBXTextBookmark */; - 93F690FF13218A0500F53A8A /* PBXTextBookmark */ = 93F690FF13218A0500F53A8A /* PBXTextBookmark */; - 93F6910013218A0500F53A8A /* PBXTextBookmark */ = 93F6910013218A0500F53A8A /* PBXTextBookmark */; - 93F6910113218A0500F53A8A /* PBXTextBookmark */ = 93F6910113218A0500F53A8A /* PBXTextBookmark */; - 93F6910513218A0900F53A8A /* PBXTextBookmark */ = 93F6910513218A0900F53A8A /* PBXTextBookmark */; - 93F6910613218A0B00F53A8A /* PBXTextBookmark */ = 93F6910613218A0B00F53A8A /* PBXTextBookmark */; - 93F6910D13218AF600F53A8A /* PBXTextBookmark */ = 93F6910D13218AF600F53A8A /* PBXTextBookmark */; - 93F6910E13218AF600F53A8A /* PBXTextBookmark */ = 93F6910E13218AF600F53A8A /* PBXTextBookmark */; - 93F6911113218B1200F53A8A /* PBXTextBookmark */ = 93F6911113218B1200F53A8A /* PBXTextBookmark */; - 93F6911213218B3900F53A8A /* PBXTextBookmark */ = 93F6911213218B3900F53A8A /* PBXTextBookmark */; - 93F6911713218B7600F53A8A /* PBXTextBookmark */ = 93F6911713218B7600F53A8A /* PBXTextBookmark */; - 93F6911913218B7B00F53A8A /* PBXTextBookmark */ = 93F6911913218B7B00F53A8A /* PBXTextBookmark */; - 93F6911A13218B7E00F53A8A /* PBXTextBookmark */ = 93F6911A13218B7E00F53A8A /* PBXTextBookmark */; - 93F6911C13218BBB00F53A8A /* PBXTextBookmark */ = 93F6911C13218BBB00F53A8A /* PBXTextBookmark */; - 93F6911D13218BC300F53A8A /* PBXTextBookmark */ = 93F6911D13218BC300F53A8A /* PBXTextBookmark */; - 93F6911E13218ECD00F53A8A /* PBXTextBookmark */ = 93F6911E13218ECD00F53A8A /* PBXTextBookmark */; - 93F6911F13218ECD00F53A8A /* PBXTextBookmark */ = 93F6911F13218ECD00F53A8A /* PBXTextBookmark */; - 93F6912013218ECD00F53A8A /* PBXTextBookmark */ = 93F6912013218ECD00F53A8A /* PBXTextBookmark */; - 93F6912113218ECD00F53A8A /* PBXTextBookmark */ = 93F6912113218ECD00F53A8A /* PBXTextBookmark */; - 93F6912213218ECD00F53A8A /* PBXTextBookmark */ = 93F6912213218ECD00F53A8A /* PBXTextBookmark */; - 93F6912313218F2700F53A8A /* PBXTextBookmark */ = 93F6912313218F2700F53A8A /* PBXTextBookmark */; - 93F6913E1321913700F53A8A /* PBXTextBookmark */ = 93F6913E1321913700F53A8A /* PBXTextBookmark */; - 93F6913F1321913700F53A8A /* PBXTextBookmark */ = 93F6913F1321913700F53A8A /* PBXTextBookmark */; - 93F691401321913700F53A8A /* PBXTextBookmark */ = 93F691401321913700F53A8A /* PBXTextBookmark */; - 93F691411321913700F53A8A /* PBXTextBookmark */ = 93F691411321913700F53A8A /* PBXTextBookmark */; - 93F691431321913700F53A8A /* XCBuildMessageTextBookmark */ = 93F691431321913700F53A8A /* XCBuildMessageTextBookmark */; - 93F691441321913700F53A8A /* PBXTextBookmark */ = 93F691441321913700F53A8A /* PBXTextBookmark */; - 93F691491321918C00F53A8A /* PBXTextBookmark */ = 93F691491321918C00F53A8A /* PBXTextBookmark */; - 93F6914E1321919200F53A8A /* PBXTextBookmark */ = 93F6914E1321919200F53A8A /* PBXTextBookmark */; - 93F6914F1321919A00F53A8A /* PBXTextBookmark */ = 93F6914F1321919A00F53A8A /* PBXTextBookmark */; - 93F691501321919A00F53A8A /* PBXTextBookmark */ = 93F691501321919A00F53A8A /* PBXTextBookmark */; - 93F69153132191B300F53A8A /* PBXTextBookmark */ = 93F69153132191B300F53A8A /* PBXTextBookmark */; - 93F69154132191B300F53A8A /* PBXTextBookmark */ = 93F69154132191B300F53A8A /* PBXTextBookmark */; - 93F69155132191B300F53A8A /* PBXTextBookmark */ = 93F69155132191B300F53A8A /* PBXTextBookmark */; - 93F69156132191B300F53A8A /* PBXTextBookmark */ = 93F69156132191B300F53A8A /* PBXTextBookmark */; - 93F69158132191B300F53A8A /* PBXTextBookmark */ = 93F69158132191B300F53A8A /* PBXTextBookmark */; - 93F691621321926D00F53A8A /* PBXTextBookmark */ = 93F691621321926D00F53A8A /* PBXTextBookmark */; - 93F69166132192F600F53A8A /* PBXTextBookmark */ = 93F69166132192F600F53A8A /* PBXTextBookmark */; - 93F6916A1321932400F53A8A /* PBXTextBookmark */ = 93F6916A1321932400F53A8A /* PBXTextBookmark */; - 93F6916C1321936400F53A8A /* PBXTextBookmark */ = 93F6916C1321936400F53A8A /* PBXTextBookmark */; - 93F6916F1321936B00F53A8A /* PBXTextBookmark */ = 93F6916F1321936B00F53A8A /* PBXTextBookmark */; - 93F691731321937600F53A8A /* PBXTextBookmark */ = 93F691731321937600F53A8A /* PBXTextBookmark */; - 93F69177132193A400F53A8A /* PBXTextBookmark */ = 93F69177132193A400F53A8A /* PBXTextBookmark */; - 93F691791321A01D00F53A8A /* PBXTextBookmark */ = 93F691791321A01D00F53A8A /* PBXTextBookmark */; - 93F6917A1321A01D00F53A8A /* PBXTextBookmark */ = 93F6917A1321A01D00F53A8A /* PBXTextBookmark */; - 93F6917B1321A01D00F53A8A /* PBXTextBookmark */ = 93F6917B1321A01D00F53A8A /* PBXTextBookmark */; - 93F6917C1321A02300F53A8A /* PBXTextBookmark */ = 93F6917C1321A02300F53A8A /* PBXTextBookmark */; - 93F6917D1321A15400F53A8A /* PBXTextBookmark */ = 93F6917D1321A15400F53A8A /* PBXTextBookmark */; - 93F6917E1321A21900F53A8A /* PBXTextBookmark */ = 93F6917E1321A21900F53A8A /* PBXTextBookmark */; - 93F6917F1321A23C00F53A8A /* PBXTextBookmark */ = 93F6917F1321A23C00F53A8A /* PBXTextBookmark */; - 93F691801321A44100F53A8A /* PBXTextBookmark */ = 93F691801321A44100F53A8A /* PBXTextBookmark */; - 93F6918D1321A60000F53A8A /* PBXTextBookmark */ = 93F6918D1321A60000F53A8A /* PBXTextBookmark */; - 93F6918F1321A60000F53A8A /* PBXTextBookmark */ = 93F6918F1321A60000F53A8A /* PBXTextBookmark */; - 93F691911321A60000F53A8A /* PBXTextBookmark */ = 93F691911321A60000F53A8A /* PBXTextBookmark */; - 93F691931321A60000F53A8A /* PBXTextBookmark */ = 93F691931321A60000F53A8A /* PBXTextBookmark */; - 93F691951321A60000F53A8A /* PBXTextBookmark */ = 93F691951321A60000F53A8A /* PBXTextBookmark */; - 93F691961321A60000F53A8A /* PBXTextBookmark */ = 93F691961321A60000F53A8A /* PBXTextBookmark */; - 93F691971321A7A500F53A8A /* PBXTextBookmark */ = 93F691971321A7A500F53A8A /* PBXTextBookmark */; - 93F6919C1321A82900F53A8A /* PBXTextBookmark */ = 93F6919C1321A82900F53A8A /* PBXTextBookmark */; - 93F6919D1321A8BA00F53A8A /* XCBuildMessageTextBookmark */ = 93F6919D1321A8BA00F53A8A /* XCBuildMessageTextBookmark */; - 93F6919E1321A8BA00F53A8A /* PBXTextBookmark */ = 93F6919E1321A8BA00F53A8A /* PBXTextBookmark */; - 93F6919F1321A96C00F53A8A /* PBXTextBookmark */ = 93F6919F1321A96C00F53A8A /* PBXTextBookmark */; - 93F691A01321A9E300F53A8A /* PBXTextBookmark */ = 93F691A01321A9E300F53A8A /* PBXTextBookmark */; - 93F691A51321AA9700F53A8A /* PBXTextBookmark */ = 93F691A51321AA9700F53A8A /* PBXTextBookmark */; - 93F691A81321AAD100F53A8A /* PBXTextBookmark */ = 93F691A81321AAD100F53A8A /* PBXTextBookmark */; - 93F691AD1321AB2000F53A8A /* PBXTextBookmark */ = 93F691AD1321AB2000F53A8A /* PBXTextBookmark */; - 93F691B41321AB9700F53A8A /* XCBuildMessageTextBookmark */ = 93F691B41321AB9700F53A8A /* XCBuildMessageTextBookmark */; - 93F691B51321AB9700F53A8A /* PBXTextBookmark */ = 93F691B51321AB9700F53A8A /* PBXTextBookmark */; - 93F691BE1321AC2900F53A8A /* PBXTextBookmark */ = 93F691BE1321AC2900F53A8A /* PBXTextBookmark */; - 93F691C01321AC3700F53A8A /* PBXTextBookmark */ = 93F691C01321AC3700F53A8A /* PBXTextBookmark */; - 93F691C31321AC6A00F53A8A /* PBXTextBookmark */ = 93F691C31321AC6A00F53A8A /* PBXTextBookmark */; - 93F691C61321ACE200F53A8A /* PBXTextBookmark */ = 93F691C61321ACE200F53A8A /* PBXTextBookmark */; - 93F691CA1321AD6500F53A8A /* PBXTextBookmark */ = 93F691CA1321AD6500F53A8A /* PBXTextBookmark */; - 93F691CE1321ADB600F53A8A /* PBXTextBookmark */ = 93F691CE1321ADB600F53A8A /* PBXTextBookmark */; - 93F691D21321B17B00F53A8A /* PBXTextBookmark */ = 93F691D21321B17B00F53A8A /* PBXTextBookmark */; - 93F691DA1321B1F400F53A8A /* PBXTextBookmark */ = 93F691DA1321B1F400F53A8A /* PBXTextBookmark */; - }; - sourceControlManager = 938563D5130E6093000F4333 /* Source Control */; - userBuildSettings = { - }; - }; - 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1222, 3354}}"; - sepNavSelRange = "{7233, 0}"; - sepNavVisRange = "{6240, 1745}"; - sepNavWindowFrame = "{{1, 57}, {1279, 721}}"; - }; - }; - 0259C57AFE90428111CA0C5A /* webkit_plugin_macView.h */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1222, 808}}"; - sepNavSelRange = "{301, 0}"; - sepNavVisRange = "{0, 419}"; - }; - }; - 32DBCF980370C29C00C91783 /* webkit-plugin-mac_Prefix.pch */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1222, 994}}"; - sepNavSelRange = "{190, 0}"; - sepNavVisRange = "{0, 278}"; - }; - }; - 8D1AC9600486D14A00FE50C9 /* webkit-plugin-mac */ = { - activeExec = 0; - }; - 8D1AC9730486D14A00FE50C9 /* Info.plist */ = { - uiCtxt = { - sepNavWindowFrame = "{{1111, 140}, {863, 1205}}"; - }; - }; - 8D1AC97B0486D23100FE50C9 /* English */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {982, 402}}"; - sepNavSelRange = "{0, 0}"; - sepNavVisRange = "{0, 96}"; - sepNavWindowFrame = "{{38, 347}, {863, 1205}}"; - }; - }; - 938563D5130E6093000F4333 /* Source Control */ = { - isa = PBXSourceControlManager; - fallbackIsa = XCSourceControlManager; - isSCMEnabled = 0; - scmConfiguration = { - repositoryNamesForRoots = { - "" = ""; - }; - }; - }; - 938563D6130E6093000F4333 /* Code sense */ = { - isa = PBXCodeSenseManager; - indexTemplatePath = ""; - }; - 938564A1130E6EC0000F4333 /* ocv_freenect.mm */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1459, 6240}}"; - sepNavSelRange = "{9736, 0}"; - sepNavVisRange = "{1702, 1365}"; - }; - }; - 938564A2130E6EC0000F4333 /* ocv_freenect.hpp */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1222, 831}}"; - sepNavSelRange = "{543, 0}"; - sepNavVisRange = "{0, 612}"; - sepNavWindowFrame = "{{1, 57}, {1279, 721}}"; - }; - }; - 938564A6130E6EE0000F4333 /* bg_fg_blobs.cpp */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {982, 3276}}"; - sepNavSelRange = "{0, 0}"; - sepNavVisRange = "{0, 0}"; - }; - }; - 938564A7130E6EE0000F4333 /* bg_fg_blobs.hpp */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {982, 402}}"; - sepNavSelRange = "{231, 0}"; - sepNavVisRange = "{0, 253}"; - }; - }; - 938DB81C130F4A2C008C37B1 /* Safari */ = { - isa = PBXExecutable; - activeArgIndices = ( - ); - argumentStrings = ( - ); - autoAttachOnCrash = 1; - breakpointsEnabled = 1; - configStateDict = { - "PBXLSLaunchAction-0" = { - PBXLSLaunchAction = 0; - PBXLSLaunchStartAction = 1; - PBXLSLaunchStdioStyle = 2; - PBXLSLaunchStyle = 0; - class = PBXLSRunLaunchConfig; - commandLineArgs = ( - ); - displayName = "Executable Runner"; - environment = { - }; - identifier = com.apple.Xcode.launch.runConfig; - remoteHostInfo = ""; - startActionInfo = ""; - }; - }; - customDataFormattersEnabled = 1; - dataTipCustomDataFormattersEnabled = 1; - dataTipShowTypeColumn = 1; - dataTipSortType = 0; - debuggerPlugin = GDBDebugging; - disassemblyDisplayState = 0; - dylibVariantSuffix = ""; - enableDebugStr = 1; - environmentEntries = ( - ); - executableSystemSymbolLevel = 0; - executableUserSymbolLevel = 0; - launchableReference = 938DB81D130F4A2C008C37B1 /* Safari.app */; - libgmallocEnabled = 0; - name = Safari; - savedGlobals = { - }; - showTypeColumn = 0; - sourceDirectories = ( - ); - variableFormatDictionary = { - }; - }; - 938DB81D130F4A2C008C37B1 /* Safari.app */ = { - isa = PBXFileReference; - lastKnownFileType = wrapper.application; - name = Safari.app; - path = /Applications/Safari.app; - sourceTree = ""; - }; - 93F690A71321783400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - comments = "Unused variable 'myWebView'"; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - rLen = 1; - rLoc = 46; - rType = 1; - }; - 93F690A81321783400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 35"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1212; - vrLoc = 362; - }; - 93F690BA1321786A00F53A8A /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - }; - 93F690BB1321786A00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 150"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1069; - vrLoc = 3983; - }; - 93F690BC1321786C00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 150"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2199; - vrLoc = 3094; - }; - 93F690C51321789600F53A8A /* DLog.h */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1222, 553}}"; - sepNavSelRange = "{263, 0}"; - sepNavVisRange = "{0, 353}"; - }; - }; - 93F690C61321789600F53A8A /* DLog.mm */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1459, 607}}"; - sepNavSelRange = "{1052, 0}"; - sepNavVisRange = "{0, 1209}"; - }; - }; - 93F690DC1321879000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 151"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2135; - vrLoc = 3365; - }; - 93F690DD1321879000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C61321789600F53A8A /* DLog.mm */; - name = "DLog.m: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 1227; - vrLoc = 0; - }; - 93F690DE1321879000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 32DBCF980370C29C00C91783 /* webkit-plugin-mac_Prefix.pch */; - name = "webkit-plugin-mac_Prefix.pch: 6"; - rLen = 0; - rLoc = 191; - rType = 0; - vrLen = 247; - vrLoc = 0; - }; - 93F690DF1321879000F53A8A /* XCBuildMessageTextBookmark */ = { - isa = PBXTextBookmark; - comments = "'NSString' has not been declared"; - fRef = 93F690C51321789600F53A8A /* DLog.h */; - fallbackIsa = XCBuildMessageTextBookmark; - rLen = 1; - rLoc = 19; - rType = 1; - }; - 93F690E01321879000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C51321789600F53A8A /* DLog.h */; - name = "DLog.h: 20"; - rLen = 0; - rLoc = 263; - rType = 0; - vrLen = 353; - vrLoc = 0; - }; - 93F690E9132187F000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C51321789600F53A8A /* DLog.h */; - name = "DLog.h: 20"; - rLen = 0; - rLoc = 263; - rType = 0; - vrLen = 353; - vrLoc = 0; - }; - 93F690EA132187F000F53A8A /* XCBuildMessageTextBookmark */ = { - isa = PBXTextBookmark; - comments = "In file included from /Users/aaron/eclipseWorkspace/depthjs/webkit-plugin-mac/webkit-plugin-mac_Prefix.pch"; - fRef = 32DBCF980370C29C00C91783 /* webkit-plugin-mac_Prefix.pch */; - fallbackIsa = XCBuildMessageTextBookmark; - rLen = 1; - rLoc = 13; - rType = 1; - }; - 93F690EB132187F000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 32DBCF980370C29C00C91783 /* webkit-plugin-mac_Prefix.pch */; - name = "webkit-plugin-mac_Prefix.pch: 9"; - rLen = 0; - rLoc = 269; - rType = 0; - vrLen = 252; - vrLoc = 0; - }; - 93F690F3132189E700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 32DBCF980370C29C00C91783 /* webkit-plugin-mac_Prefix.pch */; - name = "webkit-plugin-mac_Prefix.pch: 8"; - rLen = 0; - rLoc = 190; - rType = 0; - vrLen = 278; - vrLoc = 0; - }; - 93F690F4132189E700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690F5132189E700F53A8A /* NSURLHandle.h */; - name = "NSURLHandle.h: 50"; - rLen = 0; - rLoc = 2465; - rType = 0; - vrLen = 4223; - vrLoc = 0; - }; - 93F690F5132189E700F53A8A /* NSURLHandle.h */ = { - isa = PBXFileReference; - name = NSURLHandle.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h; - sourceTree = ""; - }; - 93F690F6132189E700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690F7132189E700F53A8A /* NSFileHandle.h */; - name = "NSFileHandle.h: 18"; - rLen = 0; - rLoc = 348; - rType = 0; - vrLen = 2299; - vrLoc = 0; - }; - 93F690F7132189E700F53A8A /* NSFileHandle.h */ = { - isa = PBXFileReference; - name = NSFileHandle.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileHandle.h; - sourceTree = ""; - }; - 93F690F8132189E700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C51321789600F53A8A /* DLog.h */; - name = "DLog.h: 20"; - rLen = 0; - rLoc = 263; - rType = 0; - vrLen = 353; - vrLoc = 0; - }; - 93F690F9132189E700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C61321789600F53A8A /* DLog.mm */; - name = "DLog.m: 36"; - rLen = 0; - rLoc = 1052; - rType = 0; - vrLen = 1209; - vrLoc = 0; - }; - 93F690FA132189E700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C61321789600F53A8A /* DLog.mm */; - name = "DLog.mm: 36"; - rLen = 0; - rLoc = 1052; - rType = 0; - vrLen = 1209; - vrLoc = 0; - }; - 93F690FB132189EB00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 176"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1368; - vrLoc = 3365; - }; - 93F690FC132189EB00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C61321789600F53A8A /* DLog.mm */; - name = "DLog.mm: 36"; - rLen = 0; - rLoc = 1052; - rType = 0; - vrLen = 1209; - vrLoc = 0; - }; - 93F690FF13218A0500F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C61321789600F53A8A /* DLog.mm */; - name = "DLog.mm: 36"; - rLen = 0; - rLoc = 1052; - rType = 0; - vrLen = 1209; - vrLoc = 0; - }; - 93F6910013218A0500F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 151"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1122; - vrLoc = 3611; - }; - 93F6910113218A0500F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 80"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1144; - vrLoc = 2090; - }; - 93F6910513218A0900F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 80"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1144; - vrLoc = 2090; - }; - 93F6910613218A0B00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 80"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1134; - vrLoc = 1881; - }; - 93F6910D13218AF600F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F690C61321789600F53A8A /* DLog.mm */; - name = "DLog.mm: 36"; - rLen = 0; - rLoc = 1052; - rType = 0; - vrLen = 1209; - vrLoc = 0; - }; - 93F6910E13218AF600F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 80"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1450; - vrLoc = 2002; - }; - 93F6911113218B1200F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 156"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2431; - vrLoc = 3203; - }; - 93F6911213218B3900F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 47"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1667; - vrLoc = 210; - }; - 93F6911713218B7600F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 39"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2723; - vrLoc = 3; - }; - 93F6911913218B7B00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 39"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2723; - vrLoc = 3; - }; - 93F6911A13218B7E00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 39"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2723; - vrLoc = 3; - }; - 93F6911C13218BBB00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 39"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1600; - vrLoc = 3; - }; - 93F6911D13218BC300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 39"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2726; - vrLoc = 0; - }; - 93F6911E13218ECD00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A2130E6EC0000F4333 /* ocv_freenect.hpp */; - name = "ocv_freenect.hpp: 34"; - rLen = 0; - rLoc = 548; - rType = 0; - vrLen = 616; - vrLoc = 0; - }; - 93F6911F13218ECD00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 477"; - rLen = 0; - rLoc = 14278; - rType = 0; - vrLen = 2635; - vrLoc = 2026; - }; - 93F6912013218ECD00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C57AFE90428111CA0C5A /* webkit_plugin_macView.h */; - name = "webkit_plugin_macView.h: 16"; - rLen = 0; - rLoc = 326; - rType = 0; - vrLen = 479; - vrLoc = 0; - }; - 93F6912113218ECD00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 173"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2337; - vrLoc = 3336; - }; - 93F6912213218ECD00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 113"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2374; - vrLoc = 3258; - }; - 93F6912313218F2700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 169"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2624; - vrLoc = 3286; - }; - 93F6913E1321913700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C57AFE90428111CA0C5A /* webkit_plugin_macView.h */; - name = "webkit_plugin_macView.h: 14"; - rLen = 0; - rLoc = 301; - rType = 0; - vrLen = 419; - vrLoc = 0; - }; - 93F6913F1321913700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 175"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1707; - vrLoc = 3722; - }; - 93F691401321913700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A2130E6EC0000F4333 /* ocv_freenect.hpp */; - name = "ocv_freenect.hpp: 34"; - rLen = 0; - rLoc = 543; - rType = 0; - vrLen = 612; - vrLoc = 0; - }; - 93F691411321913700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F691421321913700F53A8A /* MacTypes.h */; - name = "MacTypes.h: 220"; - rLen = 0; - rLoc = 7264; - rType = 0; - vrLen = 3169; - vrLoc = 5993; - }; - 93F691421321913700F53A8A /* MacTypes.h */ = { - isa = PBXFileReference; - name = MacTypes.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreServices.framework/Headers/../Frameworks/CarbonCore.framework/Headers/MacTypes.h; - sourceTree = ""; - }; - 93F691431321913700F53A8A /* XCBuildMessageTextBookmark */ = { - isa = PBXTextBookmark; - comments = "Compile /Users/aaron/eclipseWorkspace/depthjs/webkit-plugin-mac/ocv_freenect.mm"; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - fallbackIsa = XCBuildMessageTextBookmark; - rLen = 0; - rLoc = 472; - rType = 1; - }; - 93F691441321913700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 277"; - rLen = 5; - rLoc = 7296; - rType = 0; - vrLen = 1466; - vrLoc = 4745; - }; - 93F691491321918C00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 54"; - rLen = 0; - rLoc = 1220; - rType = 0; - vrLen = 1781; - vrLoc = 1115; - }; - 93F6914E1321919200F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 54"; - rLen = 0; - rLoc = 1220; - rType = 0; - vrLen = 1781; - vrLoc = 1115; - }; - 93F6914F1321919A00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 50"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1363; - vrLoc = 29; - }; - 93F691501321919A00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 54"; - rLen = 0; - rLoc = 1220; - rType = 0; - vrLen = 1422; - vrLoc = 1115; - }; - 93F69153132191B300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 54"; - rLen = 0; - rLoc = 1220; - rType = 0; - vrLen = 1455; - vrLoc = 0; - }; - 93F69154132191B300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C57AFE90428111CA0C5A /* webkit_plugin_macView.h */; - name = "webkit_plugin_macView.h: 14"; - rLen = 0; - rLoc = 301; - rType = 0; - vrLen = 419; - vrLoc = 0; - }; - 93F69155132191B300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 175"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1568; - vrLoc = 3722; - }; - 93F69156132191B300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 175"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2073; - vrLoc = 574; - }; - 93F69158132191B300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 175"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2073; - vrLoc = 574; - }; - 93F691621321926D00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 178"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2065; - vrLoc = 601; - }; - 93F69166132192F600F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 178"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2066; - vrLoc = 603; - }; - 93F6916A1321932400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 180"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1968; - vrLoc = 761; - }; - 93F6916C1321936400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 180"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1827; - vrLoc = 841; - }; - 93F6916F1321936B00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 180"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2066; - vrLoc = 762; - }; - 93F691731321937600F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 180"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1991; - vrLoc = 894; - }; - 93F69177132193A400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 180"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1980; - vrLoc = 1013; - }; - 93F691791321A01D00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 938564A1130E6EC0000F4333 /* ocv_freenect.mm */; - name = "ocv_freenect.mm: 347"; - rLen = 0; - rLoc = 9736; - rType = 0; - vrLen = 1365; - vrLoc = 1702; - }; - 93F6917A1321A01D00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - rLen = 0; - rLoc = 49; - rType = 1; - }; - 93F6917B1321A01D00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 193"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 1739; - vrLoc = 4826; - }; - 93F6917C1321A02300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 193"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2102; - vrLoc = 4770; - }; - 93F6917D1321A15400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 192"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2101; - vrLoc = 4713; - }; - 93F6917E1321A21900F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 196"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2178; - vrLoc = 4713; - }; - 93F6917F1321A23C00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 174"; - rLen = 0; - rLoc = 1059; - rType = 0; - vrLen = 2222; - vrLoc = 4713; - }; - 93F691801321A44100F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 14"; - rLen = 0; - rLoc = 269; - rType = 0; - vrLen = 2122; - vrLoc = 0; - }; - 93F6918D1321A60000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F6918E1321A60000F53A8A /* JavaScriptCore.h */; - name = "JavaScriptCore.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 1720; - vrLoc = 0; - }; - 93F6918E1321A60000F53A8A /* JavaScriptCore.h */ = { - isa = PBXFileReference; - name = JavaScriptCore.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers/JavaScriptCore.h; - sourceTree = ""; - }; - 93F6918F1321A60000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F691901321A60000F53A8A /* JSBase.h */; - name = "JSBase.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 3183; - vrLoc = 2473; - }; - 93F691901321A60000F53A8A /* JSBase.h */ = { - isa = PBXFileReference; - name = JSBase.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers/JSBase.h; - sourceTree = ""; - }; - 93F691911321A60000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F691921321A60000F53A8A /* JSContextRef.h */; - name = "JSContextRef.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 2029; - vrLoc = 764; - }; - 93F691921321A60000F53A8A /* JSContextRef.h */ = { - isa = PBXFileReference; - name = JSContextRef.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers/JSContextRef.h; - sourceTree = ""; - }; - 93F691931321A60000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 93F691941321A60000F53A8A /* JSObjectRef.h */; - name = "JSObjectRef.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 3808; - vrLoc = 9507; - }; - 93F691941321A60000F53A8A /* JSObjectRef.h */ = { - isa = PBXFileReference; - name = JSObjectRef.h; - path = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers/JSObjectRef.h; - sourceTree = ""; - }; - 93F691951321A60000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 12"; - rLen = 0; - rLoc = 263; - rType = 0; - vrLen = 2085; - vrLoc = 0; - }; - 93F691961321A60000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 218"; - rLen = 0; - rLoc = 7145; - rType = 0; - vrLen = 2176; - vrLoc = 5706; - }; - 93F691971321A7A500F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 221"; - rLen = 0; - rLoc = 6859; - rType = 0; - vrLen = 2328; - vrLoc = 6187; - }; - 93F6919C1321A82900F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 189"; - rLen = 0; - rLoc = 5367; - rType = 0; - vrLen = 2308; - vrLoc = 5700; - }; - 93F6919D1321A8BA00F53A8A /* XCBuildMessageTextBookmark */ = { - isa = PBXTextBookmark; - comments = "Cannot convert 'OpaqueJSValue*' to 'const OpaqueJSContext*' for argument '1' to 'OpaqueJSValue* JSContextGetGlobalObject(const OpaqueJSContext*)'"; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - fallbackIsa = XCBuildMessageTextBookmark; - rLen = 1; - rLoc = 212; - rType = 1; - }; - 93F6919E1321A8BA00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 215"; - rLen = 0; - rLoc = 6291; - rType = 0; - vrLen = 2264; - vrLoc = 5697; - }; - 93F6919F1321A96C00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 240"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2527; - vrLoc = 6185; - }; - 93F691A01321A9E300F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 241"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2649; - vrLoc = 6186; - }; - 93F691A51321AA9700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 216"; - rLen = 0; - rLoc = 6360; - rType = 0; - vrLen = 2567; - vrLoc = 5756; - }; - 93F691A81321AAD100F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 217"; - rLen = 10; - rLoc = 6408; - rType = 0; - vrLen = 2594; - vrLoc = 5756; - }; - 93F691AD1321AB2000F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 224"; - rLen = 22; - rLoc = 6955; - rType = 0; - vrLen = 2625; - vrLoc = 5756; - }; - 93F691B41321AB9700F53A8A /* XCBuildMessageTextBookmark */ = { - isa = PBXTextBookmark; - comments = "In passing argument 1 of 'NSString* jsRefToTypeString(const OpaqueJSContext*&, const OpaqueJSValue*&)'"; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - fallbackIsa = XCBuildMessageTextBookmark; - rLen = 1; - rLoc = 182; - rType = 1; - }; - 93F691B51321AB9700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 224"; - rLen = 10; - rLoc = 7007; - rType = 0; - vrLen = 2714; - vrLoc = 6077; - }; - 93F691BE1321AC2900F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 20"; - rLen = 0; - rLoc = 515; - rType = 0; - vrLen = 2100; - vrLoc = 3; - }; - 93F691C01321AC3700F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 246"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2726; - vrLoc = 6272; - }; - 93F691C31321AC6A00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 246"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2754; - vrLoc = 6309; - }; - 93F691C61321ACE200F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 249"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2855; - vrLoc = 6486; - }; - 93F691CA1321AD6500F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 249"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2766; - vrLoc = 6600; - }; - 93F691CE1321ADB600F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 251"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2235; - vrLoc = 5574; - }; - 93F691D21321B17B00F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 251"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 2251; - vrLoc = 5925; - }; - 93F691DA1321B1F400F53A8A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 0259C576FE90428111CA0C5A /* webkit_plugin_macView.mm */; - name = "webkit_plugin_macView.mm: 232"; - rLen = 0; - rLoc = 7233; - rType = 0; - vrLen = 1745; - vrLoc = 6240; - }; -} diff --git a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.perspectivev3 b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.perspectivev3 deleted file mode 100644 index a59896d..0000000 --- a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/aaron.perspectivev3 +++ /dev/null @@ -1,1497 +0,0 @@ - - - - - ActivePerspectiveName - Debug - AllowedModules - - - BundleLoadPath - - MaxInstances - n - Module - PBXSmartGroupTreeModule - Name - Groups and Files Outline View - - - BundleLoadPath - - MaxInstances - n - Module - PBXNavigatorGroup - Name - Editor - - - BundleLoadPath - - MaxInstances - n - Module - XCTaskListModule - Name - Task List - - - BundleLoadPath - - MaxInstances - n - Module - XCDetailModule - Name - File and Smart Group Detail Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXBuildResultsModule - Name - Detailed Build Results Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXProjectFindModule - Name - Project Batch Find Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCProjectFormatConflictsModule - Name - Project Format Conflicts List - - - BundleLoadPath - - MaxInstances - n - Module - PBXBookmarksModule - Name - Bookmarks Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXClassBrowserModule - Name - Class Browser - - - BundleLoadPath - - MaxInstances - n - Module - PBXCVSModule - Name - Source Code Control Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXDebugBreakpointsModule - Name - Debug Breakpoints Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCDockableInspector - Name - Inspector - - - BundleLoadPath - - MaxInstances - n - Module - PBXOpenQuicklyModule - Name - Open Quickly Tool - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugSessionModule - Name - Debugger - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugCLIModule - Name - Debug Console - - - BundleLoadPath - - MaxInstances - n - Module - XCSnapshotModule - Name - Snapshots Tool - - - BundlePath - /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources - Description - AIODescriptionKey - DockingSystemVisible - - Extension - perspectivev3 - FavBarConfig - - PBXProjectModuleGUID - 938563D1130E6093000F4333 - XCBarModuleItemNames - - XCBarModuleItems - - - FirstTimeWindowDisplayed - - Identifier - com.apple.perspectives.project.defaultV3 - MajorVersion - 34 - MinorVersion - 0 - Name - All-In-One - Notifications - - OpenEditors - - PerspectiveWidths - - 1520 - 1520 - - Perspectives - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - active-combo-popup - action - NSToolbarFlexibleSpaceItem - debugger-enable-breakpoints - build-and-go - com.apple.ide.PBXToolbarStopButton - get-info - NSToolbarFlexibleSpaceItem - com.apple.pbx.toolbar.searchfield - - ControllerClassBaseName - - IconName - WindowOfProject - Identifier - perspective.project - IsVertical - - Layout - - - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C37FBAC04509CD000000102 - 1C37FAAC04509CD000000102 - 1C37FABC05509CD000000102 - 1C37FABC05539CD112110102 - E2644B35053B69B200211256 - 1C37FABC04509CD000100104 - 1CC0EA4004350EF90044410B - 1CC0EA4004350EF90041110B - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CA23ED40692098700951B8B - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - yes - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 215 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 0259C574FE90428111CA0C5A - 32DBCF9E0370C38000C91783 - 32DBCF9F0370C38200C91783 - 0259C582FE90428111CA0C5A - 1ED78706FE9D4A0611CA0C5A - 2E58F364FFB232C311CA0CBA - 93F691811321A45600F53A8A - 93F691841321A45B00F53A8A - 1C37FBAC04509CD000000102 - 1C37FAAC04509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 3 - 1 - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {215, 1256}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - - - GeometryConfiguration - - Frame - {{0, 0}, {232, 1274}} - GroupTreeTableConfiguration - - MainColumn - 215 - - - Module - PBXSmartGroupTreeModule - Proportion - 232pt - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 938563CC130E6093000F4333 - PBXProjectModuleLabel - webkit_plugin_macView.mm - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 938563CD130E6093000F4333 - PBXProjectModuleLabel - webkit_plugin_macView.mm - _historyCapacity - 0 - bookmark - 93F691DA1321B1F400F53A8A - history - - 93F690F3132189E700F53A8A - 93F690F4132189E700F53A8A - 93F690F6132189E700F53A8A - 93F690F8132189E700F53A8A - 93F690FF13218A0500F53A8A - 93F691401321913700F53A8A - 93F691411321913700F53A8A - 93F69153132191B300F53A8A - 93F69154132191B300F53A8A - 93F6918D1321A60000F53A8A - 93F6918F1321A60000F53A8A - 93F691911321A60000F53A8A - 93F691931321A60000F53A8A - 93F691B41321AB9700F53A8A - - - SplitCount - 1 - - StatusBarVisibility - - XCSharingToken - com.apple.Xcode.CommonNavigatorGroupSharingToken - - GeometryConfiguration - - Frame - {{0, 0}, {1283, 888}} - - Module - PBXNavigatorGroup - Proportion - 888pt - - - Proportion - 381pt - Tabs - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EDF0692099D00951B8B - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{10, 27}, {1283, -27}} - - Module - XCDetailModule - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EE00692099D00951B8B - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{10, 27}, {1283, 632}} - - Module - PBXProjectFindModule - - - ContentConfiguration - - PBXCVSModuleFilterTypeKey - 1032 - PBXProjectModuleGUID - 1CA23EE10692099D00951B8B - PBXProjectModuleLabel - SCM Results - - GeometryConfiguration - - Frame - {{10, 27}, {1043, 591}} - - Module - PBXCVSModule - - - ContentConfiguration - - PBXProjectModuleGUID - XCMainBuildResultsModuleGUID - PBXProjectModuleLabel - Build Results - XCBuildResultsTrigger_Collapse - 1021 - XCBuildResultsTrigger_Open - 1011 - - GeometryConfiguration - - Frame - {{10, 27}, {1283, 354}} - - Module - PBXBuildResultsModule - - - - - Proportion - 1283pt - - - Name - Project - ServiceClasses - - XCModuleDock - PBXSmartGroupTreeModule - XCModuleDock - PBXNavigatorGroup - XCDockableTabModule - XCDetailModule - PBXProjectFindModule - PBXCVSModule - PBXBuildResultsModule - - TableOfContents - - 93F690BD1321786C00F53A8A - 1CA23ED40692098700951B8B - 93F690BE1321786C00F53A8A - 938563CC130E6093000F4333 - 93F690BF1321786C00F53A8A - 1CA23EDF0692099D00951B8B - 1CA23EE00692099D00951B8B - 1CA23EE10692099D00951B8B - XCMainBuildResultsModuleGUID - - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarConfiguration - xcode.toolbar.config.defaultV3 - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - active-combo-popup - NSToolbarFlexibleSpaceItem - debugger-enable-breakpoints - build-and-go - com.apple.ide.PBXToolbarStopButton - debugger-restart-executable - debugger-pause - debugger-step-over - debugger-step-into - debugger-step-out - NSToolbarFlexibleSpaceItem - servicesModulebreakpoints - debugger-show-console-window - - ControllerClassBaseName - PBXDebugSessionModule - IconName - DebugTabIcon - Identifier - perspective.debug - IsVertical - - Layout - - - ContentConfiguration - - PBXProjectModuleGUID - 1CCC7628064C1048000F2A68 - PBXProjectModuleLabel - Debugger Console - - GeometryConfiguration - - Frame - {{0, 0}, {1520, 376}} - RubberWindowFrame - 927 168 1520 1315 0 0 2560 1578 - - Module - PBXDebugCLIModule - Proportion - 376pt - - - ContentConfiguration - - Debugger - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {730, 254}} - {{730, 0}, {790, 254}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {1520, 254}} - {{0, 254}, {1520, 639}} - - - - LauncherConfigVersion - 8 - PBXProjectModuleGUID - 1CCC7629064C1048000F2A68 - PBXProjectModuleLabel - Debug - - GeometryConfiguration - - DebugConsoleVisible - None - DebugConsoleWindowFrame - {{200, 200}, {500, 300}} - DebugSTDIOWindowFrame - {{200, 200}, {500, 300}} - Frame - {{0, 381}, {1520, 893}} - PBXDebugSessionStackFrameViewKey - - DebugVariablesTableConfiguration - - Name - 120 - Value - 85 - Summary - 560 - - Frame - {{730, 0}, {790, 254}} - RubberWindowFrame - 927 168 1520 1315 0 0 2560 1578 - - RubberWindowFrame - 927 168 1520 1315 0 0 2560 1578 - - Module - PBXDebugSessionModule - Proportion - 893pt - - - Name - Debug - ServiceClasses - - XCModuleDock - PBXDebugCLIModule - PBXDebugSessionModule - PBXDebugProcessAndThreadModule - PBXDebugProcessViewModule - PBXDebugThreadViewModule - PBXDebugStackFrameViewModule - PBXNavigatorGroup - - TableOfContents - - 93F690C01321786C00F53A8A - 1CCC7628064C1048000F2A68 - 1CCC7629064C1048000F2A68 - 93F690C11321786C00F53A8A - 93F690C21321786C00F53A8A - 93F690C31321786C00F53A8A - 93F690C41321786C00F53A8A - 938563CC130E6093000F4333 - - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarConfiguration - xcode.toolbar.config.debugV3 - - - PerspectivesBarVisible - - ShelfIsVisible - - SourceDescription - file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' - StatusbarIsVisible - - TimeStamp - 0.0 - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarDisplayMode - 1 - ToolbarIsVisible - - ToolbarSizeMode - 1 - Type - Perspectives - UpdateMessage - - WindowJustification - 5 - WindowOrderList - - 93F6910313218A0500F53A8A - 93F6910413218A0500F53A8A - /Users/aaron/eclipseWorkspace/depthjs/webkit-plugin-mac/webkit-plugin-mac.xcodeproj - - WindowString - 927 168 1520 1315 0 0 2560 1578 - WindowToolsV3 - - - Identifier - windowTool.debugger - Layout - - - Dock - - - ContentConfiguration - - Debugger - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {317, 164}} - {{317, 0}, {377, 164}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {694, 164}} - {{0, 164}, {694, 216}} - - - - LauncherConfigVersion - 8 - PBXProjectModuleGUID - 1C162984064C10D400B95A72 - PBXProjectModuleLabel - Debug - GLUTExamples (Underwater) - - GeometryConfiguration - - DebugConsoleDrawerSize - {100, 120} - DebugConsoleVisible - None - DebugConsoleWindowFrame - {{200, 200}, {500, 300}} - DebugSTDIOWindowFrame - {{200, 200}, {500, 300}} - Frame - {{0, 0}, {694, 380}} - RubberWindowFrame - 321 238 694 422 0 0 1440 878 - - Module - PBXDebugSessionModule - Proportion - 100% - - - Proportion - 100% - - - Name - Debugger - ServiceClasses - - PBXDebugSessionModule - - StatusbarIsVisible - 1 - TableOfContents - - 1CD10A99069EF8BA00B06720 - 1C0AD2AB069F1E9B00FABCE6 - 1C162984064C10D400B95A72 - 1C0AD2AC069F1E9B00FABCE6 - - ToolbarConfiguration - xcode.toolbar.config.debugV3 - WindowString - 321 238 694 422 0 0 1440 878 - WindowToolGUID - 1CD10A99069EF8BA00B06720 - WindowToolIsVisible - 0 - - - Identifier - windowTool.build - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528F0623707200166675 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD052900623707200166675 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {500, 215}} - RubberWindowFrame - 192 257 500 500 0 0 1280 1002 - - Module - PBXNavigatorGroup - Proportion - 218pt - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - XCMainBuildResultsModuleGUID - PBXProjectModuleLabel - Build Results - - GeometryConfiguration - - Frame - {{0, 222}, {500, 236}} - RubberWindowFrame - 192 257 500 500 0 0 1280 1002 - - Module - PBXBuildResultsModule - Proportion - 236pt - - - Proportion - 458pt - - - Name - Build Results - ServiceClasses - - PBXBuildResultsModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAA5065D492600B07095 - 1C78EAA6065D492600B07095 - 1CD0528F0623707200166675 - XCMainBuildResultsModuleGUID - - ToolbarConfiguration - xcode.toolbar.config.buildV3 - WindowString - 192 257 500 500 0 0 1280 1002 - - - Identifier - windowTool.find - Layout - - - Dock - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CDD528C0622207200134675 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD0528D0623707200166675 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {781, 167}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXNavigatorGroup - Proportion - 781pt - - - Proportion - 50% - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528E0623707200166675 - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{8, 0}, {773, 254}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXProjectFindModule - Proportion - 50% - - - Proportion - 428pt - - - Name - Project Find - ServiceClasses - - PBXProjectFindModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C530D57069F1CE1000CFCEE - 1C530D58069F1CE1000CFCEE - 1C530D59069F1CE1000CFCEE - 1CDD528C0622207200134675 - 1C530D5A069F1CE1000CFCEE - 1CE0B1FE06471DED0097A5F4 - 1CD0528E0623707200166675 - - WindowString - 62 385 781 470 0 0 1440 878 - WindowToolGUID - 1C530D57069F1CE1000CFCEE - WindowToolIsVisible - 0 - - - Identifier - windowTool.snapshots - Layout - - - Dock - - - Module - XCSnapshotModule - Proportion - 100% - - - Proportion - 100% - - - Name - Snapshots - ServiceClasses - - XCSnapshotModule - - StatusbarIsVisible - Yes - ToolbarConfiguration - xcode.toolbar.config.snapshots - WindowString - 315 824 300 550 0 0 1440 878 - WindowToolIsVisible - Yes - - - Identifier - windowTool.debuggerConsole - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAAC065D492600B07095 - PBXProjectModuleLabel - Debugger Console - - GeometryConfiguration - - Frame - {{0, 0}, {700, 358}} - RubberWindowFrame - 149 87 700 400 0 0 1440 878 - - Module - PBXDebugCLIModule - Proportion - 358pt - - - Proportion - 358pt - - - Name - Debugger Console - ServiceClasses - - PBXDebugCLIModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C530D5B069F1CE1000CFCEE - 1C530D5C069F1CE1000CFCEE - 1C78EAAC065D492600B07095 - - ToolbarConfiguration - xcode.toolbar.config.consoleV3 - WindowString - 149 87 440 400 0 0 1440 878 - WindowToolGUID - 1C530D5B069F1CE1000CFCEE - WindowToolIsVisible - 0 - - - Identifier - windowTool.scm - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAB2065D492600B07095 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1C78EAB3065D492600B07095 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {452, 0}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - - Module - PBXNavigatorGroup - Proportion - 0pt - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD052920623707200166675 - PBXProjectModuleLabel - SCM - - GeometryConfiguration - - ConsoleFrame - {{0, 259}, {452, 0}} - Frame - {{0, 7}, {452, 259}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - TableConfiguration - - Status - 30 - FileName - 199 - Path - 197.09500122070312 - - TableFrame - {{0, 0}, {452, 250}} - - Module - PBXCVSModule - Proportion - 262pt - - - Proportion - 266pt - - - Name - SCM - ServiceClasses - - PBXCVSModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAB4065D492600B07095 - 1C78EAB5065D492600B07095 - 1C78EAB2065D492600B07095 - 1CD052920623707200166675 - - ToolbarConfiguration - xcode.toolbar.config.scmV3 - WindowString - 743 379 452 308 0 0 1280 1002 - - - Identifier - windowTool.breakpoints - IsVertical - 0 - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CE0B1FE06471DED0097A5F4 - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - no - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 168 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 1C77FABC04509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {168, 350}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - 0 - - GeometryConfiguration - - Frame - {{0, 0}, {185, 368}} - GroupTreeTableConfiguration - - MainColumn - 168 - - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - PBXSmartGroupTreeModule - Proportion - 185pt - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA1AED706398EBD00589147 - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{190, 0}, {554, 368}} - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - XCDetailModule - Proportion - 554pt - - - Proportion - 368pt - - - MajorVersion - 3 - MinorVersion - 0 - Name - Breakpoints - ServiceClasses - - PBXSmartGroupTreeModule - XCDetailModule - - StatusbarIsVisible - 1 - TableOfContents - - 1CDDB66807F98D9800BB5817 - 1CDDB66907F98D9800BB5817 - 1CE0B1FE06471DED0097A5F4 - 1CA1AED706398EBD00589147 - - ToolbarConfiguration - xcode.toolbar.config.breakpointsV3 - WindowString - 315 424 744 409 0 0 1440 878 - WindowToolGUID - 1CDDB66807F98D9800BB5817 - WindowToolIsVisible - 1 - - - Identifier - windowTool.debugAnimator - Layout - - - Dock - - - Module - PBXNavigatorGroup - Proportion - 100% - - - Proportion - 100% - - - Name - Debug Visualizer - ServiceClasses - - PBXNavigatorGroup - - StatusbarIsVisible - 1 - ToolbarConfiguration - xcode.toolbar.config.debugAnimatorV3 - WindowString - 100 100 700 500 0 0 1280 1002 - - - Identifier - windowTool.bookmarks - Layout - - - Dock - - - Module - PBXBookmarksModule - Proportion - 166pt - - - Proportion - 166pt - - - Name - Bookmarks - ServiceClasses - - PBXBookmarksModule - - StatusbarIsVisible - 0 - WindowString - 538 42 401 187 0 0 1280 1002 - - - Identifier - windowTool.projectFormatConflicts - Layout - - - Dock - - - Module - XCProjectFormatConflictsModule - Proportion - 100% - - - Proportion - 100% - - - Name - Project Format Conflicts - ServiceClasses - - XCProjectFormatConflictsModule - - StatusbarIsVisible - 0 - WindowContentMinSize - 450 300 - WindowString - 50 850 472 307 0 0 1440 877 - - - Identifier - windowTool.classBrowser - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - OptionsSetName - Hierarchy, all classes - PBXProjectModuleGUID - 1CA6456E063B45B4001379D8 - PBXProjectModuleLabel - Class Browser - NSObject - - GeometryConfiguration - - ClassesFrame - {{0, 0}, {369, 96}} - ClassesTreeTableConfiguration - - PBXClassNameColumnIdentifier - 208 - PBXClassBookColumnIdentifier - 22 - - Frame - {{0, 0}, {616, 353}} - MembersFrame - {{0, 105}, {369, 395}} - MembersTreeTableConfiguration - - PBXMemberTypeIconColumnIdentifier - 22 - PBXMemberNameColumnIdentifier - 216 - PBXMemberTypeColumnIdentifier - 94 - PBXMemberBookColumnIdentifier - 22 - - PBXModuleWindowStatusBarHidden2 - 1 - RubberWindowFrame - 597 125 616 374 0 0 1280 1002 - - Module - PBXClassBrowserModule - Proportion - 354pt - - - Proportion - 354pt - - - Name - Class Browser - ServiceClasses - - PBXClassBrowserModule - - StatusbarIsVisible - 0 - TableOfContents - - 1C78EABA065D492600B07095 - 1C78EABB065D492600B07095 - 1CA6456E063B45B4001379D8 - - ToolbarConfiguration - xcode.toolbar.config.classbrowser - WindowString - 597 125 616 374 0 0 1280 1002 - - - Identifier - windowTool.refactoring - IncludeInToolsMenu - 0 - Layout - - - Dock - - - BecomeActive - 1 - GeometryConfiguration - - Frame - {0, 0}, {500, 335} - RubberWindowFrame - {0, 0}, {500, 335} - - Module - XCRefactoringModule - Proportion - 100% - - - Proportion - 100% - - - Name - Refactoring - ServiceClasses - - XCRefactoringModule - - WindowString - 200 200 500 356 0 0 1920 1200 - - - - From a08998909d31de34d3ddc8556afa5632218b541a Mon Sep 17 00:00:00 2001 From: Aaron Zinman Date: Sat, 5 Mar 2011 08:32:05 +0800 Subject: [PATCH 07/19] Some code cleanup.. now Safari can properly quit without having an access violation (whoo hoo!) --- webkit-plugin-mac/ocv_freenect.hpp | 1 + webkit-plugin-mac/ocv_freenect.mm | 40 ++++----- webkit-plugin-mac/webkit_plugin_macView.mm | 96 +++++++++------------- 3 files changed, 58 insertions(+), 79 deletions(-) diff --git a/webkit-plugin-mac/ocv_freenect.hpp b/webkit-plugin-mac/ocv_freenect.hpp index c584a87..aa72931 100644 --- a/webkit-plugin-mac/ocv_freenect.hpp +++ b/webkit-plugin-mac/ocv_freenect.hpp @@ -33,5 +33,6 @@ using namespace cv; int initFreenect(); void* ocvFreenectThread(void *arg); void killOcvFreenect(); +BOOL isDead(); #endif // __DEPTHJS_OCV_FREENECT_HPP__ \ No newline at end of file diff --git a/webkit-plugin-mac/ocv_freenect.mm b/webkit-plugin-mac/ocv_freenect.mm index 351d338..a7d7660 100644 --- a/webkit-plugin-mac/ocv_freenect.mm +++ b/webkit-plugin-mac/ocv_freenect.mm @@ -11,30 +11,23 @@ #include "ocv_freenect.hpp" #include -pthread_t ocv_thread; -pthread_t freenect_thread; -volatile int die = 0; +static pthread_t freenect_thread = 0; +static int die = 0; +static BOOL dead = YES; -int g_argc; -char **g_argv; +static pthread_mutex_t buf_mutex = PTHREAD_MUTEX_INITIALIZER; -int window; +static Mat depthMat(cv::Size(640,480),CV_16UC1,Scalar(0)); +static Mat rgbMat(cv::Size(640,480),CV_8UC3,Scalar(0)); -pthread_mutex_t buf_mutex = PTHREAD_MUTEX_INITIALIZER; -Mat depthMat(cv::Size(640,480),CV_16UC1,Scalar(0)), -rgbMat(cv::Size(640,480),CV_8UC3,Scalar(0)); +static freenect_device *f_dev; +static int freenect_angle = 15; +static pthread_cond_t frame_cond = PTHREAD_COND_INITIALIZER; +static int got_frames = 0; -freenect_device *f_dev; -int freenect_angle = 15; -int freenect_led; - -pthread_cond_t frame_cond = PTHREAD_COND_INITIALIZER; -int got_frames = 0; - -uint16_t t_gamma[2048]; -freenect_context *f_ctx; +static freenect_context *f_ctx; void *freenect_threadfunc(void* arg); // void depth_cb(freenect_device *dev, void *depth, uint32_t timestamp); @@ -42,9 +35,9 @@ Mat depthMat(cv::Size(640,480),CV_16UC1,Scalar(0)), void send_event(const string& etype, const string& edata); void* freenect_threadfunc(void* arg) { //all this thread does is to fetch events from freenect - cout << "freenect thread"<= 0 ) {} - cout << "freenect die"< hc_stack(20); int hc_stack_ptr = 0; die = false; + dead = NO; while (!die) { fr++; @@ -464,9 +458,8 @@ Mat prevImg(frameMat.size(),CV_8UC1), } printf("-- done!\n"); - pthread_join(freenect_thread, NULL); - pthread_exit(NULL); + dead = YES; return NULL; } @@ -476,3 +469,6 @@ void killOcvFreenect() { die = true; } +BOOL isDead() { + return dead; +} diff --git a/webkit-plugin-mac/webkit_plugin_macView.mm b/webkit-plugin-mac/webkit_plugin_macView.mm index eeb01f9..fc8abfd 100644 --- a/webkit-plugin-mac/webkit_plugin_macView.mm +++ b/webkit-plugin-mac/webkit_plugin_macView.mm @@ -27,36 +27,29 @@ - (void) ocvMainLoop; // BRIDGE BACK FROM C++ LAND ----------------------------------------------------------------------- -static volatile webkit_plugin_macView* hostPlugin = nil; +static webkit_plugin_macView* hostPlugin = nil; bool SendEventToBrowser(const string& _eventJson) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Top-level pool - - NSString *eventJson = [NSString stringWithCString:_eventJson.c_str() encoding:[NSString defaultCStringEncoding]]; - DLog(@"Going to send the following eventJson nsstring: %@", eventJson); - - if (hostPlugin == nil) { - DLog(@"DepthJS Plugin: Ignoring event for uninit host"); return false; } - + + BOOL success = false; + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Top-level pool id pluginContainer = [[hostPlugin pluginArguments] objectForKey:WebPlugInContainerKey]; - if (pluginContainer) { - /* retrieve a reference to the webview */ + if (pluginContainer != nil) { WebView *myWebView = [[pluginContainer webFrame] webView]; + NSString *eventJson = [NSString stringWithCString:_eventJson.c_str() encoding:[NSString defaultCStringEncoding]]; NSString *js = [NSString stringWithFormat:@"if(DepthJS && DepthJS.npBackend)DepthJS.npBackend.receiveEvent(%@)", eventJson]; - - [[myWebView windowScriptObject] performSelectorOnMainThread:@selector(evaluateWebScript:) withObject:js waitUntilDone:YES]; - // [[myWebView windowScriptObject] evaluateWebScript:js]; - DLog(@"Sent to javascript"); - [pool release]; // Release the objects in the pool. - return true; + [[myWebView windowScriptObject] performSelectorOnMainThread:@selector(evaluateWebScript:) withObject:js waitUntilDone:NO]; + DLog(@"[DepthJS] Sent: %@", eventJson); + success = true; } else { - DLog(@"Could not find pluginContainer?!;"); - [pool release]; // Release the objects in the pool. + DLog(@"[DepthJS] Could not find pluginContainer?!;"); return false; } + [pool release]; // Release the objects in the pool. + return success; } @implementation webkit_plugin_macView @@ -97,38 +90,18 @@ - (void)webPlugInInitialize { DLog(@"webPlugInInitialize"); haveInitDevice = NO; ocvThread = nil; - hostPlugin = self; // TODO remove later after testing -} - -- (void)webPlugInStart { - // The plug-in usually begins drawing, playing sounds and/or animation in this method. - // You are not required to implement this method. It may safely be removed. - DLog(@"webPlugInStart"); -} - -- (void)webPlugInStop { - // The plug-in normally stop animations/sounds in this method. - // You are not required to implement this method. It may safely be removed. - DLog(@"webPlugInStop; killing ocv"); - killOcvFreenect(); + if (hostPlugin == nil) { + hostPlugin = self; + } } - (void)webPlugInDestroy { DLog(@"webPlugInDestroy"); - haveInitDevice = FALSE; -} - -- (void)webPlugInSetIsSelected:(BOOL)isSelected { - // This is typically used to allow the plug-in to alter its appearance when selected. - // You are not required to implement this method. It may safely be removed. - DLog(@"webPlugInSetIsSelected"); + [self ShutdownDepthJS]; + DLog(@"webPlugInDestroy finished"); } - (id)objectForWebScript { - // Returns the object that exposes the plug-in's interface. The class of this object can implement - // methods from the WebScripting informal protocol. - // You are not required to implement this method. It may safely be removed. - DLog(@"objectForWebScript"); return self; } @@ -173,6 +146,7 @@ - (id)_initWithArguments:(NSDictionary *)newArguments { - (void) ocvMainLoop { ocvThread = [NSThread currentThread]; + [ocvThread setName:@"ocvMainLoop"]; ocvFreenectThread(NULL); } @@ -199,11 +173,8 @@ @implementation webkit_plugin_macView (JsExposed) } } - -// This isn't really used... but it shows how the JavaScriptCore framework can be used if needed. - (void) CallbackTest { - DLog(@"CallbackTest"); - id pluginContainer = [[hostPlugin pluginArguments] objectForKey:WebPlugInContainerKey]; + id pluginContainer = [[self pluginArguments] objectForKey:WebPlugInContainerKey]; WebView *myWebView = [[pluginContainer webFrame] webView]; JSObjectRef globalObj = [[myWebView windowScriptObject] JSObject]; JSValueRef exception; @@ -228,32 +199,43 @@ - (void) CallbackTest { } - (void) InitDepthJS { - DLog(@"DepthJS Plugin: InitDepthJS"); + DLog(@"[DepthJS] InitDepthJS"); + // If the windowScriptObject is not first referenced from this thread, we will later get a thread + // exception. Even though this doesn't do anything. Yah. I have no idea either. + id pluginContainer = [[hostPlugin pluginArguments] objectForKey:WebPlugInContainerKey]; + WebView *myWebView = [[pluginContainer webFrame] webView]; + [myWebView windowScriptObject]; if (!haveInitDevice) { - DLog(@"DepthJS Plugin: Device not yet init; initing"); + DLog(@"[DepthJS] Device not yet init; initing"); + hostPlugin = self; int failed = initFreenect(); haveInitDevice = !failed; if (haveInitDevice) { - DLog(@"DepthJS Plugin: Successfully inited Kinect; Starting ocv thread"); - hostPlugin = self; + DLog(@"[DepthJS] Successfully inited Kinect; Starting ocv thread"); [NSThread detachNewThreadSelector:@selector(ocvMainLoop) toTarget:self withObject:nil]; } else { - DLog(@"DepthJS Plugin: Failed to init Kinect"); + DLog(@"[DepthJS] Failed to init Kinect"); + hostPlugin = nil; } } else { - DLog(@"DepthJS Plugin: Already init, ignoring"); + DLog(@"[DepthJS] Already init, ignoring"); } } - (void) ShutdownDepthJS { - DLog(@"DepthJS Plugin: ShutdownDepthJS"); - killOcvFreenect(); - DLog(@"DepthJS Plugin: ShutdownDepthJS complete"); + DLog(@"[DepthJS] ShutdownDepthJS"); haveInitDevice = false; if (hostPlugin == self) { hostPlugin = NULL; + killOcvFreenect(); + if (ocvThread != nil) [ocvThread cancel]; + ocvThread = nil; + while (!isDead()) { + [NSThread sleepForTimeInterval:0.01]; + } } + DLog(@"[DepthJS] ShutdownDepthJS complete"); } @end \ No newline at end of file From 46b1facd5c7e799de5f900198ba26010564c5bf7 Mon Sep 17 00:00:00 2001 From: Aaron Zinman Date: Sat, 5 Mar 2011 08:44:25 +0800 Subject: [PATCH 08/19] fixed content script; safari now properly gets events (now just need get the gesture algorithm working better, which we are...) --- .../DepthJS.safariextension/content_script/root.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/safari-extension-mac/DepthJS.safariextension/content_script/root.js b/safari-extension-mac/DepthJS.safariextension/content_script/root.js index 2caa7d7..cdc8aae 100644 --- a/safari-extension-mac/DepthJS.safariextension/content_script/root.js +++ b/safari-extension-mac/DepthJS.safariextension/content_script/root.js @@ -32,6 +32,7 @@ var DepthJS = { panner: {}, depthose: {}, browser: {}, + tabs: {}, MAX_HANDPLANE_WIDTH: 100, MAX_HANDPLANE_HEIGHT: 100 }; @@ -52,16 +53,16 @@ function print() { counts[msg.type] = counts[msg.type] + 1; lastByType[msg.type] = msg.data; }); - + var alphabeticalKeys = _.keys(counts).sort(); console.log("------" + (new Date() + "")); _.each(alphabeticalKeys, function(type) { console.log([" " + counts[type] + " " + type + "; last = ", lastByType[type]]); }); - + lastMessages = []; } setTimeout(print, 1000); })(); -} \ No newline at end of file +} From f8ad44d6db797a9221e9c3265d9180ea7437866a Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Sun, 6 Mar 2011 14:38:37 +0800 Subject: [PATCH 09/19] new gesture engine, still figuring stuff out, initial push --- new_cv/NewCV/FreenectDevice.h | 104 +++++ new_cv/NewCV/main.cpp | 419 ++++++++++++++++++ webkit-plugin-mac/FreenectDevice.h | 104 +++++ webkit-plugin-mac/gesture_engine.cpp | 377 ++++++++++++++++ webkit-plugin-mac/gesture_engine.hpp | 17 + webkit-plugin-mac/include/libfreenect.hpp | 158 +++++++ .../project.pbxproj | 8 + 7 files changed, 1187 insertions(+) create mode 100644 new_cv/NewCV/FreenectDevice.h create mode 100644 new_cv/NewCV/main.cpp create mode 100644 webkit-plugin-mac/FreenectDevice.h create mode 100644 webkit-plugin-mac/gesture_engine.cpp create mode 100644 webkit-plugin-mac/gesture_engine.hpp create mode 100644 webkit-plugin-mac/include/libfreenect.hpp diff --git a/new_cv/NewCV/FreenectDevice.h b/new_cv/NewCV/FreenectDevice.h new file mode 100644 index 0000000..8c889f8 --- /dev/null +++ b/new_cv/NewCV/FreenectDevice.h @@ -0,0 +1,104 @@ +/* + * FreenectDevice.h + * NewCV + * + * Created by Roy Shilkrot on 3/3/11. + * Copyright 2011 MIT. All rights reserved. + * + */ +#include "libfreenect.hpp" +#include +#include +#include +#include + +using namespace cv; + +#include +using namespace std; + +class Mutex { +public: + Mutex() { + pthread_mutex_init( &m_mutex, NULL ); + } + void lock() { + pthread_mutex_lock( &m_mutex ); + } + void unlock() { + pthread_mutex_unlock( &m_mutex ); + } +private: + pthread_mutex_t m_mutex; +}; + +class MyFreenectDevice : public Freenect::FreenectDevice { +public: + MyFreenectDevice(freenect_context *_ctx, int _index) + : Freenect::FreenectDevice(_ctx, _index), m_buffer_depth(FREENECT_DEPTH_11BIT_SIZE),m_buffer_rgb(FREENECT_VIDEO_RGB_SIZE), m_gamma(2048), m_new_rgb_frame(false), m_new_depth_frame(false), + depthMat(Size(640,480),CV_16UC1), rgbMat(Size(640,480),CV_8UC3,Scalar(0)), ownMat(Size(640,480),CV_8UC3,Scalar(0)) + { + for( unsigned int i = 0 ; i < 2048 ; i++) { + float v = i/2048.0; + v = std::pow(v, 3)* 6; + m_gamma[i] = v*6*256; + } + } + // Do not call directly even in child + void VideoCallback(void* _rgb, uint32_t timestamp) { +// std::cout << "RGB callback" << std::endl; + m_rgb_mutex.lock(); + uint8_t* rgb = static_cast(_rgb); + rgbMat.data = rgb; + m_new_rgb_frame = true; + m_rgb_mutex.unlock(); + }; + // Do not call directly even in child + void DepthCallback(void* _depth, uint32_t timestamp) { +// std::cout << "Depth callback" << std::endl; + m_depth_mutex.lock(); + uint16_t* depth = static_cast(_depth); + depthMat.data = (uchar*) depth; + m_new_depth_frame = true; + m_depth_mutex.unlock(); + } + + bool getVideo(Mat& output) { + m_rgb_mutex.lock(); + if(m_new_rgb_frame) { + cv::cvtColor(rgbMat, output, CV_RGB2BGR); + m_new_rgb_frame = false; + m_rgb_mutex.unlock(); + return true; + } else { + m_rgb_mutex.unlock(); + return false; + } + } + + bool getDepth(Mat& output) { + m_depth_mutex.lock(); + if(m_new_depth_frame) { + depthMat.copyTo(output); + m_new_depth_frame = false; + m_depth_mutex.unlock(); + return true; + } else { + m_depth_mutex.unlock(); + return false; + } + } + +private: + std::vector m_buffer_depth; + std::vector m_buffer_rgb; + std::vector m_gamma; + Mat depthMat; + Mat rgbMat; + Mat ownMat; + Mutex m_rgb_mutex; + Mutex m_depth_mutex; + bool m_new_rgb_frame; + bool m_new_depth_frame; +}; + diff --git a/new_cv/NewCV/main.cpp b/new_cv/NewCV/main.cpp new file mode 100644 index 0000000..a6ee422 --- /dev/null +++ b/new_cv/NewCV/main.cpp @@ -0,0 +1,419 @@ +#include "FreenectDevice.h" + +Scalar refineSegments(const Mat& img, + Mat& mask, + Mat& dst, + vector& contour, + vector& second_contour, + Point2i& previous) +{ + // int niters = 3; + + vector > contours; + vector hierarchy; + + Mat temp; + + blur(mask, temp, Size(11,11)); + temp = temp > 85.0; + + findContours( temp, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE ); + + if(dst.data==NULL) + dst = Mat::zeros(img.size(), CV_8UC1); + else + dst.setTo(Scalar(0)); + + if( contours.size() == 0 ) + return Scalar(-1,-1); + + // iterate through all the top-level contours, + // draw each connected component with its own random color + int idx = 0, largestComp = -1, secondlargest = -1; + double maxWArea = 0, maxJArea = 0; + vector justarea(contours.size()); + vector weightedarea(contours.size()); + + // for( ; idx >= 0; idx = hierarchy[idx][0] ) + for (; idx& c = contours[idx]; + Scalar _mean = mean(Mat(contours[idx])); + justarea[idx] = fabs(contourArea(Mat(c))); + weightedarea[idx] = fabs(contourArea(Mat(c))) / + ((previous.x >- 1) ? (1.0 + norm(Point(_mean[0],_mean[1])-previous)) : 1.0); //consider distance from last blob + } + for (idx = 0; idx maxWArea ) + { + maxWArea = weightedarea[idx]; + largestComp = idx; + } + } + for (idx = 0; idx < contours.size(); idx++) { + if ( justarea[idx] > maxJArea && idx != largestComp ) { + maxJArea = justarea[idx]; + secondlargest = idx; + } + } + + Scalar color( 255 ); + // cout << "largest cc " << largestComp << endl; + // drawContours( dst, contours, largestComp, color, CV_FILLED); //, 8, hierarchy ); + // for (idx=0; idx= 0) { + int num = contours[largestComp].size(); + Point* pts = &(contours[largestComp][0]); + fillPoly(dst, (const Point**)(&pts), &num, 1, color); + + Scalar b = mean(Mat(contours[largestComp])); + b[2] = justarea[largestComp]; + + contour.clear(); + contour = contours[largestComp]; + + second_contour.clear(); + if(secondlargest >= 0) { + second_contour = contours[secondlargest]; + b[3] = maxJArea; + } + + previous.x = b[0]; previous.y = b[1]; + return b; + } else + return Scalar(-1,-1); + +} + +#define LABEL_GARBAGE 0 +#define LABEL_OPEN 1 +#define LABEL_FIST 2 +#define LABEL_THUMB 3 + + +int main(int argc, char **argv) { + bool die(false); + string filename("snapshot"); + string suffix(".png"); + int i_snap(0),iter(0); + + Mat depthMat(Size(640,480),CV_16UC1); + Mat depthf (Size(640,480),CV_8UC1); + Mat rgbMat(Size(640,480),CV_8UC3,Scalar(0)); + Mat ownMat(Size(640,480),CV_8UC3,Scalar(0)); + + Freenect::Freenect freenect; + MyFreenectDevice& device = freenect.createDevice(0); + + bool registered = false; + Mat blobMaskOutput = Mat::zeros(Size(640,480),CV_8UC1),outC; + Point midBlob; + + int startX = 250, sizeX = 150, num_x_reps = 10, num_y_reps = 10; + double height_over_num_y_reps = 480/num_y_reps, + width_over_num_x_reps = sizeX/num_x_reps; + + + vector _d(num_x_reps * num_y_reps); //the descriptor + Mat descriptorMat(_d); + +// CvNormalBayesClassifier classifier; //doesnt work + CvKNearest classifier; +// CvSVM classifier; //doesnt work +// CvBoost classifier; //only good for 2 classes +// CvDTree classifier; + + + vector > training_data; + vector label_data; + PCA pca; + Mat labelMat, dataMat; + vector label_counts(4); + + bool trained = false, loaded = false; + + device.startVideo(); + device.startDepth(); + while (!die) { + device.getVideo(rgbMat); + device.getDepth(depthMat); +// cv::imshow("rgb", rgbMat); +// depthMat.convertTo(depthf, CV_8UC1, 255.0/2048.0); +// cv::imshow("depth",depthf); + + //interpolation & inpainting + { + Mat _tmp,_tmp1; // = (depthMat - 400.0); //minimum observed value is ~440. so shift a bit + Mat(depthMat - 400.0).convertTo(_tmp1,CV_64FC1); + _tmp.setTo(Scalar(2048), depthMat > 750.0); //cut off at 600 to create a "box" where the user interacts +// _tmp.convertTo(depthf, CV_8UC1, 255.0/1648.0); //values are 0-2048 (11bit), account for -400 = 1648 + + //quadratic interpolation +// cv::pow(_tmp,2.0,_tmp1); +// _tmp1 = _tmp1 * 4.0; + +// try { +// cv:log(_tmp,_tmp1); +// } +// catch (cv::Exception e) { +// cerr << e.what() << endl; +// exit(0); +// } + + Point minLoc; double minval,maxval; + minMaxLoc(_tmp1, &minval, &maxval, NULL, NULL); + _tmp1.convertTo(depthf, CV_8UC1, 255.0/maxval); + + Mat small_depthf; resize(depthf,small_depthf,Size(),0.2,0.2); + cv::inpaint(small_depthf,(small_depthf == 255),_tmp1,5.0,INPAINT_TELEA); + + resize(_tmp1, _tmp, depthf.size()); + _tmp.copyTo(depthf, (depthf == 255)); + } + + cvtColor(depthf, outC, CV_GRAY2BGR); + + Mat blobMaskInput = depthf < 120; //anything not white is "real" depth, TODO: inpainting invalid data + vector ctr,ctr2; + + //closest point to the camera + Point minLoc; double minval,maxval; + minMaxLoc(depthf, &minval, &maxval, &minLoc, NULL, blobMaskInput); + circle(outC, minLoc, 5, Scalar(0,255,0), 3); + + blobMaskInput = depthf < (minval + 18); + + Scalar blb = refineSegments(Mat(),blobMaskInput,blobMaskOutput,ctr,ctr2,midBlob); //find contours in the foreground, choose biggest +// if (blobMaskOutput.data != NULL) { +// imshow("first", blobMaskOutput); +// } + /////// blb : + //blb[0] = x, blb[1] = y, blb[2] = 1st blob size, blb[3] = 2nd blob size. + + + + if(blb[0]>=0 && blb[2] > 500) { //1st blob detected, and is big enough + //cvtColor(depthf, outC, CV_GRAY2BGR); + + Scalar mn,stdv; + meanStdDev(depthf,mn,stdv,blobMaskInput); + + //cout << "min: " << minval << ", max: " << maxval << ", mean: " << mn[0] << endl; + + //now refining blob by looking at the mean depth value it has... + blobMaskInput = depthf < (mn[0] + stdv[0]); + + blb = refineSegments(Mat(),blobMaskInput,blobMaskOutput,ctr,ctr2,midBlob); + + imshow("blob", blobMaskOutput); + + if(blb[0] >= 0 && blb[2] > 300) { + //draw contour + Scalar color(0,0,255); + for (int idx=0; idx 0) { //second blob detected + Scalar color2(255,0,255); + for (int idx=0; idx, <#const int *channels#>, <#const Mat mask#>, <#MatND hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>, <#bool uniform#>, <#bool accumulate#>) + */ + +// Mat _tmp(logPolar.size(),CV_8UC1); +// cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); +// imshow("descriptor", _tmp); +// imshow("logpolar", logPolar); + } + } + + if(trained) { + Mat results(1,1,CV_32FC1); + Mat samples; Mat(Mat(_d).t()).convertTo(samples,CV_32FC1); + + Mat samplesAfterPCA = pca.project(samples); + + classifier.find_nearest(&((CvMat)samplesAfterPCA), 1, &((CvMat)results)); +// ((float*)results.data)[0] = classifier.predict(&((CvMat)samples))->value; + + Mat lc(label_counts); lc *= 0.9; + +// label_counts[(int)((float*)results.data)[0]] *= 0.9; + label_counts[(int)((float*)results.data)[0]] += 0.1; + Point maxLoc; + minMaxLoc(lc, NULL, NULL, NULL, &maxLoc); + int res = maxLoc.y; + + stringstream ss; ss << "prediction: "; + if (res == LABEL_OPEN) { + ss << "Open hand"; + } + if (res == LABEL_FIST) { + ss << "Fist"; + } + if (res == LABEL_THUMB) { + ss << "Thumb"; + } + if (res == LABEL_GARBAGE) { + ss << "Garbage"; + } + putText(outC, ss.str(), Point(20,50), CV_FONT_HERSHEY_PLAIN, 3.0, Scalar(0,0,255), 2); + } + + imshow("blobs", outC); + + char k = cvWaitKey(5); + if( k == 27 ){ + break; + } + if( k == 8 ) { + std::ostringstream file; + file << filename << i_snap << suffix; + cv::imwrite(file.str(),rgbMat); + i_snap++; + } + if (k == 'g') { + //put into training as 'garbage' + training_data.push_back(_d); + label_data.push_back(LABEL_GARBAGE); + cout << "learn grabage" << endl; + } + if(k == 'o') { + //put into training as 'open' + training_data.push_back(_d); + label_data.push_back(LABEL_OPEN); + cout << "learn open" << endl; + } + if(k == 'f') { + //put into training as 'fist' + training_data.push_back(_d); + label_data.push_back(LABEL_FIST); + cout << "learn fist" << endl; + } + if(k == 'h') { + //put into training as 'thumb' + training_data.push_back(_d); + label_data.push_back(LABEL_THUMB); + cout << "learn thumb" << endl; + } + if (k=='t') { + //train model + cout << "train model" << endl; + if(loaded != true) { + dataMat = Mat(training_data.size(),_d.size(),CV_32FC1); //descriptors as matrix rows + for (uint i=0; i> dataMat; + fs["labels"] >> labelMat; + loaded = true; + fs.release(); + } else { + cerr << "can't open saved data" << endl; + } + } + } + + device.stopVideo(); + device.stopDepth(); + return 0; +} diff --git a/webkit-plugin-mac/FreenectDevice.h b/webkit-plugin-mac/FreenectDevice.h new file mode 100644 index 0000000..8c889f8 --- /dev/null +++ b/webkit-plugin-mac/FreenectDevice.h @@ -0,0 +1,104 @@ +/* + * FreenectDevice.h + * NewCV + * + * Created by Roy Shilkrot on 3/3/11. + * Copyright 2011 MIT. All rights reserved. + * + */ +#include "libfreenect.hpp" +#include +#include +#include +#include + +using namespace cv; + +#include +using namespace std; + +class Mutex { +public: + Mutex() { + pthread_mutex_init( &m_mutex, NULL ); + } + void lock() { + pthread_mutex_lock( &m_mutex ); + } + void unlock() { + pthread_mutex_unlock( &m_mutex ); + } +private: + pthread_mutex_t m_mutex; +}; + +class MyFreenectDevice : public Freenect::FreenectDevice { +public: + MyFreenectDevice(freenect_context *_ctx, int _index) + : Freenect::FreenectDevice(_ctx, _index), m_buffer_depth(FREENECT_DEPTH_11BIT_SIZE),m_buffer_rgb(FREENECT_VIDEO_RGB_SIZE), m_gamma(2048), m_new_rgb_frame(false), m_new_depth_frame(false), + depthMat(Size(640,480),CV_16UC1), rgbMat(Size(640,480),CV_8UC3,Scalar(0)), ownMat(Size(640,480),CV_8UC3,Scalar(0)) + { + for( unsigned int i = 0 ; i < 2048 ; i++) { + float v = i/2048.0; + v = std::pow(v, 3)* 6; + m_gamma[i] = v*6*256; + } + } + // Do not call directly even in child + void VideoCallback(void* _rgb, uint32_t timestamp) { +// std::cout << "RGB callback" << std::endl; + m_rgb_mutex.lock(); + uint8_t* rgb = static_cast(_rgb); + rgbMat.data = rgb; + m_new_rgb_frame = true; + m_rgb_mutex.unlock(); + }; + // Do not call directly even in child + void DepthCallback(void* _depth, uint32_t timestamp) { +// std::cout << "Depth callback" << std::endl; + m_depth_mutex.lock(); + uint16_t* depth = static_cast(_depth); + depthMat.data = (uchar*) depth; + m_new_depth_frame = true; + m_depth_mutex.unlock(); + } + + bool getVideo(Mat& output) { + m_rgb_mutex.lock(); + if(m_new_rgb_frame) { + cv::cvtColor(rgbMat, output, CV_RGB2BGR); + m_new_rgb_frame = false; + m_rgb_mutex.unlock(); + return true; + } else { + m_rgb_mutex.unlock(); + return false; + } + } + + bool getDepth(Mat& output) { + m_depth_mutex.lock(); + if(m_new_depth_frame) { + depthMat.copyTo(output); + m_new_depth_frame = false; + m_depth_mutex.unlock(); + return true; + } else { + m_depth_mutex.unlock(); + return false; + } + } + +private: + std::vector m_buffer_depth; + std::vector m_buffer_rgb; + std::vector m_gamma; + Mat depthMat; + Mat rgbMat; + Mat ownMat; + Mutex m_rgb_mutex; + Mutex m_depth_mutex; + bool m_new_rgb_frame; + bool m_new_depth_frame; +}; + diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp new file mode 100644 index 0000000..8bade3b --- /dev/null +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -0,0 +1,377 @@ +#include "FreenectDevice.h" + +Scalar _refineSegments(const Mat& img, + Mat& mask, + Mat& dst, + vector& contour, + vector& second_contour, + Point2i& previous) +{ + // int niters = 3; + + vector > contours; + vector hierarchy; + + Mat temp; + + blur(mask, temp, Size(11,11)); + temp = temp > 85.0; + + findContours( temp, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE ); + + if(dst.data==NULL) + dst = Mat::zeros(img.size(), CV_8UC1); + else + dst.setTo(Scalar(0)); + + if( contours.size() == 0 ) + return Scalar(-1,-1); + + // iterate through all the top-level contours, + // draw each connected component with its own random color + int idx = 0, largestComp = -1, secondlargest = -1; + double maxWArea = 0, maxJArea = 0; + vector justarea(contours.size()); + vector weightedarea(contours.size()); + + // for( ; idx >= 0; idx = hierarchy[idx][0] ) + for (; idx& c = contours[idx]; + Scalar _mean = mean(Mat(contours[idx])); + justarea[idx] = fabs(contourArea(Mat(c))); + weightedarea[idx] = fabs(contourArea(Mat(c))) / + ((previous.x >- 1) ? (1.0 + norm(Point(_mean[0],_mean[1])-previous)) : 1.0); //consider distance from last blob + } + for (idx = 0; idx maxWArea ) + { + maxWArea = weightedarea[idx]; + largestComp = idx; + } + } + for (idx = 0; idx < contours.size(); idx++) { + if ( justarea[idx] > maxJArea && idx != largestComp ) { + maxJArea = justarea[idx]; + secondlargest = idx; + } + } + + Scalar color( 255 ); + // cout << "largest cc " << largestComp << endl; + // drawContours( dst, contours, largestComp, color, CV_FILLED); //, 8, hierarchy ); + // for (idx=0; idx= 0) { + int num = contours[largestComp].size(); + Point* pts = &(contours[largestComp][0]); + fillPoly(dst, (const Point**)(&pts), &num, 1, color); + + Scalar b = mean(Mat(contours[largestComp])); + b[2] = justarea[largestComp]; + + contour.clear(); + contour = contours[largestComp]; + + second_contour.clear(); + if(secondlargest >= 0) { + second_contour = contours[secondlargest]; + b[3] = maxJArea; + } + + previous.x = b[0]; previous.y = b[1]; + return b; + } else + return Scalar(-1,-1); + +} + +#define LABEL_GARBAGE 0 +#define LABEL_OPEN 1 +#define LABEL_FIST 2 +#define LABEL_THUMB 3 + + +void* gesture_engine(void* _arg) { + bool die(false); + + Mat depthMat(Size(640,480),CV_16UC1); + Mat depthf (Size(640,480),CV_8UC1); + Mat rgbMat(Size(640,480),CV_8UC3,Scalar(0)); + Mat ownMat(Size(640,480),CV_8UC3,Scalar(0)); + + Freenect::Freenect freenect; + MyFreenectDevice& device = freenect.createDevice(0); + + bool registered = false; + Mat blobMaskOutput = Mat::zeros(Size(640,480),CV_8UC1),outC; + Point midBlob; + + //descriptor parameters + int startX = 250, sizeX = 150, num_x_reps = 10, num_y_reps = 10; + double height_over_num_y_reps = 480/num_y_reps, + width_over_num_x_reps = sizeX/num_x_reps; + + + vector _d(num_x_reps * num_y_reps); //the descriptor + Mat descriptorMat(_d); + + CvKNearest classifier; + + vector > training_data; + vector label_data; + PCA pca; + Mat labelMat, dataMat; + vector label_counts(4); + + bool trained = false, loaded = false; + + device.startVideo(); + device.startDepth(); + while (!die) { + device.getVideo(rgbMat); + device.getDepth(depthMat); + + //interpolation & inpainting + { + Mat _tmp,_tmp1; // = (depthMat - 400.0); //minimum observed value is ~440. so shift a bit + Mat(depthMat - 400.0).convertTo(_tmp1,CV_64FC1); + _tmp.setTo(Scalar(2048), depthMat > 750.0); //cut off at 600 to create a "box" where the user interacts + + Point minLoc; double minval,maxval; + minMaxLoc(_tmp1, &minval, &maxval, NULL, NULL); + _tmp1.convertTo(depthf, CV_8UC1, 255.0/maxval); + + Mat small_depthf; resize(depthf,small_depthf,Size(),0.2,0.2); + cv::inpaint(small_depthf,(small_depthf == 255),_tmp1,5.0,INPAINT_TELEA); + + resize(_tmp1, _tmp, depthf.size()); + _tmp.copyTo(depthf, (depthf == 255)); + } + + cvtColor(depthf, outC, CV_GRAY2BGR); + + Mat blobMaskInput = depthf < 120; //anything not white is "real" depth, TODO: inpainting invalid data + vector ctr,ctr2; + + //closest point to the camera + Point minLoc; double minval,maxval; + minMaxLoc(depthf, &minval, &maxval, &minLoc, NULL, blobMaskInput); + circle(outC, minLoc, 5, Scalar(0,255,0), 3); + + blobMaskInput = depthf < (minval + 18); + + Scalar blb = _refineSegments(Mat(),blobMaskInput,blobMaskOutput,ctr,ctr2,midBlob); //find contours in the foreground, choose biggest + /////// blb : + //blb[0] = x, blb[1] = y, blb[2] = 1st blob size, blb[3] = 2nd blob size. + if(blb[0]>=0 && blb[2] > 500) { //1st blob detected, and is big enough + //cvtColor(depthf, outC, CV_GRAY2BGR); + + Scalar mn,stdv; + meanStdDev(depthf,mn,stdv,blobMaskInput); + + //cout << "min: " << minval << ", max: " << maxval << ", mean: " << mn[0] << endl; + + //now refining blob by looking at the mean depth value it has... + blobMaskInput = depthf < (mn[0] + stdv[0]*.5); + + blb = _refineSegments(Mat(),blobMaskInput,blobMaskOutput,ctr,ctr2,midBlob); + + imshow("blob", blobMaskOutput); + + if(blb[0] >= 0 && blb[2] > 300) { + //draw contour + Scalar color(0,0,255); + for (int idx=0; idx 0) { //second blob detected + Scalar color2(255,0,255); + for (int idx=0; idx, <#const int *channels#>, <#const Mat mask#>, <#MatND hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>, <#bool uniform#>, <#bool accumulate#>) + */ + +// Mat _tmp(logPolar.size(),CV_8UC1); +// cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); +// imshow("descriptor", _tmp); +// imshow("logpolar", logPolar); + } + } + + if(trained) { + Mat results(1,1,CV_32FC1); + Mat samples; Mat(Mat(_d).t()).convertTo(samples,CV_32FC1); + + Mat samplesAfterPCA = pca.project(samples); + + classifier.find_nearest(&((CvMat)samplesAfterPCA), 1, &((CvMat)results)); +// ((float*)results.data)[0] = classifier.predict(&((CvMat)samples))->value; + + Mat lc(label_counts); lc *= 0.9; + +// label_counts[(int)((float*)results.data)[0]] *= 0.9; + label_counts[(int)((float*)results.data)[0]] += 0.1; + Point maxLoc; + minMaxLoc(lc, NULL, NULL, NULL, &maxLoc); + int res = maxLoc.y; + + stringstream ss; ss << "prediction: "; + if (res == LABEL_OPEN) { + ss << "Open hand"; + } + if (res == LABEL_FIST) { + ss << "Fist"; + } + if (res == LABEL_THUMB) { + ss << "Thumb"; + } + if (res == LABEL_GARBAGE) { + ss << "Garbage"; + } + putText(outC, ss.str(), Point(20,50), CV_FONT_HERSHEY_PLAIN, 3.0, Scalar(0,0,255), 2); + } + + imshow("blobs", outC); + + char k = cvWaitKey(5); + if( k == 27 ){ + break; + } + if (k == 'g') { + //put into training as 'garbage' + training_data.push_back(_d); + label_data.push_back(LABEL_GARBAGE); + cout << "learn grabage" << endl; + } + if(k == 'o') { + //put into training as 'open' + training_data.push_back(_d); + label_data.push_back(LABEL_OPEN); + cout << "learn open" << endl; + } + if(k == 'f') { + //put into training as 'fist' + training_data.push_back(_d); + label_data.push_back(LABEL_FIST); + cout << "learn fist" << endl; + } + if(k == 'h') { + //put into training as 'thumb' + training_data.push_back(_d); + label_data.push_back(LABEL_THUMB); + cout << "learn thumb" << endl; + } + if (k=='t') { + //train model + cout << "train model" << endl; + if(loaded != true) { + dataMat = Mat(training_data.size(),_d.size(),CV_32FC1); //descriptors as matrix rows + for (uint i=0; i> dataMat; + fs["labels"] >> labelMat; + loaded = true; + fs.release(); + } else { + cerr << "can't open saved data" << endl; + } + } + } + + device.stopVideo(); + device.stopDepth(); + return 0; +} diff --git a/webkit-plugin-mac/gesture_engine.hpp b/webkit-plugin-mac/gesture_engine.hpp new file mode 100644 index 0000000..9c3fb15 --- /dev/null +++ b/webkit-plugin-mac/gesture_engine.hpp @@ -0,0 +1,17 @@ +/* + * gesture_engine.hpp + * webkit-plugin-mac + * + * Created by Roy Shilkrot on 3/6/11. + * Copyright 2011 MIT. All rights reserved. + * + */ + +#ifndef _GESTURE_ENGINE_HPP +#define _GESTURE_ENGINE_HPP + + +int gesture_engine(void* _arg); + + +#endif \ No newline at end of file diff --git a/webkit-plugin-mac/include/libfreenect.hpp b/webkit-plugin-mac/include/libfreenect.hpp new file mode 100644 index 0000000..98b4e8a --- /dev/null +++ b/webkit-plugin-mac/include/libfreenect.hpp @@ -0,0 +1,158 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace Freenect { + class Noncopyable { + public: + Noncopyable() {} + ~Noncopyable() {} + private: + Noncopyable( const Noncopyable& ); + const Noncopyable& operator=( const Noncopyable& ); + }; + + class FreenectTiltState { + friend class FreenectDevice; + FreenectTiltState(freenect_raw_tilt_state *_state): + m_state(_state), m_code(_state->tilt_status) + {} + public: + void getAccelerometers(double* x, double* y, double* z) { + freenect_get_mks_accel(m_state, x, y, z); + } + double getTiltDegs() { + return freenect_get_tilt_degs(m_state); + } + public: + freenect_tilt_status_code m_code; + private: + freenect_raw_tilt_state *m_state; + }; + + class FreenectDevice : Noncopyable { + public: + FreenectDevice(freenect_context *_ctx, int _index) { + if(freenect_open_device(_ctx, &m_dev, _index) < 0) throw std::runtime_error("Cannot open Kinect"); + freenect_set_user(m_dev, this); + freenect_set_video_format(m_dev, FREENECT_VIDEO_RGB); + freenect_set_depth_format(m_dev, FREENECT_DEPTH_11BIT); + freenect_set_depth_callback(m_dev, freenect_depth_callback); + freenect_set_video_callback(m_dev, freenect_video_callback); + } + ~FreenectDevice() { + if(freenect_close_device(m_dev) < 0) throw std::runtime_error("Cannot shutdown Kinect"); + } + void startVideo() { + if(freenect_start_video(m_dev) < 0) throw std::runtime_error("Cannot start RGB callback"); + } + void stopVideo() { + if(freenect_stop_video(m_dev) < 0) throw std::runtime_error("Cannot stop RGB callback"); + } + void startDepth() { + if(freenect_start_depth(m_dev) < 0) throw std::runtime_error("Cannot start depth callback"); + } + void stopDepth() { + if(freenect_stop_depth(m_dev) < 0) throw std::runtime_error("Cannot stop depth callback"); + } + void setTiltDegrees(double _angle) { + if(freenect_set_tilt_degs(m_dev, _angle) < 0) throw std::runtime_error("Cannot set angle in degrees"); + } + void setLed(freenect_led_options _option) { + if(freenect_set_led(m_dev, _option) < 0) throw std::runtime_error("Cannot set led"); + } + void updateState() { + if (freenect_update_tilt_state(m_dev) < 0) throw std::runtime_error("Cannot update device state"); + } + FreenectTiltState getState() const { + return FreenectTiltState(freenect_get_tilt_state(m_dev)); + } + // Do not call directly even in child + virtual void VideoCallback(void *video, uint32_t timestamp) = 0; + // Do not call directly even in child + virtual void DepthCallback(void *depth, uint32_t timestamp) = 0; + private: + freenect_device *m_dev; + static void freenect_depth_callback(freenect_device *dev, void *depth, uint32_t timestamp) { + FreenectDevice* device = static_cast(freenect_get_user(dev)); + device->DepthCallback(depth, timestamp); + } + static void freenect_video_callback(freenect_device *dev, void *video, uint32_t timestamp) { + FreenectDevice* device = static_cast(freenect_get_user(dev)); + device->VideoCallback(video, timestamp); + } + }; + + template class Freenect : Noncopyable { + public: + Freenect() : m_stop(false) { + if(freenect_init(&m_ctx, NULL) < 0) throw std::runtime_error("Cannot initialize freenect library"); + if(pthread_create(&m_thread, NULL, pthread_callback, (void*)this) != 0) throw std::runtime_error("Cannot initialize freenect thread"); + } + ~Freenect() { + for(typename std::map::iterator it = m_devices.begin() ; it != m_devices.end() ; ++it) { + delete it->second; + } + m_stop = true; + pthread_join(m_thread, NULL); + if(freenect_shutdown(m_ctx) < 0) throw std::runtime_error("Cannot cleanup freenect library"); + } + T& createDevice(int _index) { + m_devices.insert(std::make_pair(_index, new T(m_ctx, _index))); + return *(m_devices[_index]); + } + void deleteDevice(int _index) { + m_devices.erase(_index); + } + int deviceCount() { + return freenect_num_devices(m_ctx); + } + // Do not call directly, thread runs here + void operator()() { + while(!m_stop) { + if(freenect_process_events(m_ctx) < 0) throw std::runtime_error("Cannot process freenect events"); + } + } + static void *pthread_callback(void *user_data) { + Freenect* freenect = static_cast*>(user_data); + (*freenect)(); + return NULL; + } + private: + freenect_context *m_ctx; + volatile bool m_stop; + pthread_t m_thread; + std::map m_devices; + }; + +} + diff --git a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj index 5ebd50a..654533f 100644 --- a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj +++ b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 938DB702130F43F0008C37B1 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 938DB701130F43F0008C37B1 /* Accelerate.framework */; }; 93F690C71321789600F53A8A /* DLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93F690C61321789600F53A8A /* DLog.mm */; }; 93F691821321A45600F53A8A /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F691811321A45600F53A8A /* JavaScriptCore.framework */; }; + D713093013235B55001594A0 /* gesture_engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D713092E13235B55001594A0 /* gesture_engine.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -70,6 +71,9 @@ 93F690C51321789600F53A8A /* DLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLog.h; sourceTree = ""; }; 93F690C61321789600F53A8A /* DLog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DLog.mm; sourceTree = ""; }; 93F691811321A45600F53A8A /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + D713092E13235B55001594A0 /* gesture_engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gesture_engine.cpp; sourceTree = ""; }; + D713092F13235B55001594A0 /* FreenectDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FreenectDevice.h; sourceTree = ""; }; + D713093213235BCB001594A0 /* gesture_engine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gesture_engine.hpp; sourceTree = ""; }; DD92D38A0106425D02CA0E72 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; /* End PBXFileReference section */ @@ -176,6 +180,9 @@ 32DBCF9F0370C38200C91783 /* Other Sources */ = { isa = PBXGroup; children = ( + D713093213235BCB001594A0 /* gesture_engine.hpp */, + D713092E13235B55001594A0 /* gesture_engine.cpp */, + D713092F13235B55001594A0 /* FreenectDevice.h */, 938564A1130E6EC0000F4333 /* ocv_freenect.mm */, 938564A2130E6EC0000F4333 /* ocv_freenect.hpp */, 938564A6130E6EE0000F4333 /* bg_fg_blobs.cpp */, @@ -269,6 +276,7 @@ 938564A3130E6EC0000F4333 /* ocv_freenect.mm in Sources */, 938564A8130E6EE0000F4333 /* bg_fg_blobs.cpp in Sources */, 93F690C71321789600F53A8A /* DLog.mm in Sources */, + D713093013235B55001594A0 /* gesture_engine.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From b39d34a16a8ef562bc2ed23f3201f562d79628ce Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Mon, 7 Mar 2011 12:43:11 +0800 Subject: [PATCH 10/19] gesture engine to more object oriented approach --- webkit-plugin-mac/gesture_engine.cpp | 377 ++++++++++++++++----------- 1 file changed, 222 insertions(+), 155 deletions(-) diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp index 8bade3b..8b42b67 100644 --- a/webkit-plugin-mac/gesture_engine.cpp +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -1,11 +1,91 @@ #include "FreenectDevice.h" -Scalar _refineSegments(const Mat& img, - Mat& mask, - Mat& dst, - vector& contour, - vector& second_contour, - Point2i& previous) +#define LABEL_GARBAGE 0 +#define LABEL_OPEN 1 +#define LABEL_FIST 2 +#define LABEL_THUMB 3 + +class GestureEngine { +private: + + bool die; + + Mat depthMat; + Mat depthf; + Mat rgbMat; + Mat ownMat; + + Freenect::Freenect freenect; + MyFreenectDevice& device; + + bool registered; + Mat blobMaskOutput; + Mat outC; + Point midBlob; + + //descriptor parameters + int startX, sizeX, num_x_reps, num_y_reps; + double height_over_num_y_reps,width_over_num_x_reps; + + + vector _d; //the descriptor + Mat descriptorMat; + + CvKNearest classifier; + + vector > training_data; + vector label_data; + PCA pca; + Mat labelMat, dataMat; + vector label_counts; + + bool trained; + bool loaded; + + Scalar _refineSegments(const Mat& img, + Mat& mask, + Mat& dst, + vector& contour, + vector& second_contour, + Point2i& previous); + void TrainModel(); + void SaveModelData(); + void LoadModelData(); + void InterpolateAndInpaint(); + void ComputeDescriptor(Scalar); + +public: + GestureEngine(): die(false), + depthMat(Mat(Size(640,480),CV_16UC1)), + depthf(Mat(Size(640,480),CV_8UC1)), + rgbMat(Mat(Size(640,480),CV_8UC3,Scalar(0))), + ownMat(Mat(Size(640,480),CV_8UC3,Scalar(0))), + device(freenect.createDevice(0)), + registered(false), + blobMaskOutput(Mat::zeros(Size(640,480),CV_8UC1)), + startX(250), + sizeX(150), + num_x_reps(10), + num_y_reps(10), + height_over_num_y_reps(480/num_y_reps), + width_over_num_x_reps(sizeX/num_x_reps), + _d(vector(num_x_reps * num_y_reps)), + descriptorMat(Mat(_d)), + label_counts(vector(4)), + trained(false), + loaded(false) + { + }; + + void RunEngine(); +}; + +Scalar GestureEngine::_refineSegments(const Mat& img, + Mat& mask, + Mat& dst, + vector& contour, + vector& second_contour, + Point2i& previous) { // int niters = 3; @@ -87,72 +167,148 @@ Scalar _refineSegments(const Mat& img, } -#define LABEL_GARBAGE 0 -#define LABEL_OPEN 1 -#define LABEL_FIST 2 -#define LABEL_THUMB 3 +void GestureEngine::TrainModel() { + cout << "train model" << endl; + if(loaded != true) { + dataMat = Mat(training_data.size(),_d.size(),CV_32FC1); //descriptors as matrix rows + for (uint i=0; i> dataMat; + fs["labels"] >> labelMat; + loaded = true; + fs.release(); + } else { + cerr << "can't open saved data" << endl; + } +} + +void GestureEngine::InterpolateAndInpaint() { + //interpolation & inpainting + Mat _tmp,_tmp1; // = (depthMat - 400.0); //minimum observed value is ~440. so shift a bit + Mat(depthMat - 400.0).convertTo(_tmp1,CV_64FC1); + _tmp.setTo(Scalar(2048), depthMat > 750.0); //cut off at 600 to create a "box" where the user interacts - Mat depthMat(Size(640,480),CV_16UC1); - Mat depthf (Size(640,480),CV_8UC1); - Mat rgbMat(Size(640,480),CV_8UC3,Scalar(0)); - Mat ownMat(Size(640,480),CV_8UC3,Scalar(0)); + Point minLoc; double minval,maxval; + minMaxLoc(_tmp1, &minval, &maxval, NULL, NULL); + _tmp1.convertTo(depthf, CV_8UC1, 255.0/maxval); - Freenect::Freenect freenect; - MyFreenectDevice& device = freenect.createDevice(0); + Mat small_depthf; resize(depthf,small_depthf,Size(),0.2,0.2); + cv::inpaint(small_depthf,(small_depthf == 255),_tmp1,5.0,INPAINT_TELEA); - bool registered = false; - Mat blobMaskOutput = Mat::zeros(Size(640,480),CV_8UC1),outC; - Point midBlob; + resize(_tmp1, _tmp, depthf.size()); + _tmp.copyTo(depthf, (depthf == 255)); +} - //descriptor parameters - int startX = 250, sizeX = 150, num_x_reps = 10, num_y_reps = 10; - double height_over_num_y_reps = 480/num_y_reps, - width_over_num_x_reps = sizeX/num_x_reps; +void GestureEngine::ComputeDescriptor(Scalar blb) { + Mat blobDepth,blobEdge; + depthf.copyTo(blobDepth,blobMaskOutput); + Laplacian(blobDepth, blobEdge, 8); + // equalizeHist(blobEdge, blobEdge);//just for visualization + + Mat logPolar(depthf.size(),CV_8UC1); + cvLogPolar(&((IplImage)blobEdge), &((IplImage)logPolar), Point2f(blb[0],blb[1]), 80.0); + // for (int i=0; i _d(num_x_reps * num_y_reps); //the descriptor - Mat descriptorMat(_d); + double total = 0.0; + + //histogram + for (int i=0; i, <#const int *channels#>, <#const Mat mask#>, <#MatND hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>, <#bool uniform#>, <#bool accumulate#>) + */ - vector > training_data; - vector label_data; - PCA pca; - Mat labelMat, dataMat; - vector label_counts(4); + // Mat _tmp(logPolar.size(),CV_8UC1); + // cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); + // imshow("descriptor", _tmp); + // imshow("logpolar", logPolar); - bool trained = false, loaded = false; - +} + +void GestureEngine::RunEngine() { device.startVideo(); device.startDepth(); + while (!die) { device.getVideo(rgbMat); device.getDepth(depthMat); - - //interpolation & inpainting - { - Mat _tmp,_tmp1; // = (depthMat - 400.0); //minimum observed value is ~440. so shift a bit - Mat(depthMat - 400.0).convertTo(_tmp1,CV_64FC1); - _tmp.setTo(Scalar(2048), depthMat > 750.0); //cut off at 600 to create a "box" where the user interacts - - Point minLoc; double minval,maxval; - minMaxLoc(_tmp1, &minval, &maxval, NULL, NULL); - _tmp1.convertTo(depthf, CV_8UC1, 255.0/maxval); - - Mat small_depthf; resize(depthf,small_depthf,Size(),0.2,0.2); - cv::inpaint(small_depthf,(small_depthf == 255),_tmp1,5.0,INPAINT_TELEA); - - resize(_tmp1, _tmp, depthf.size()); - _tmp.copyTo(depthf, (depthf == 255)); - } + + InterpolateAndInpaint(); cvtColor(depthf, outC, CV_GRAY2BGR); - Mat blobMaskInput = depthf < 120; //anything not white is "real" depth, TODO: inpainting invalid data + Mat blobMaskInput = depthf < 120; //take closer values vector ctr,ctr2; //closest point to the camera @@ -196,60 +352,8 @@ void* gesture_engine(void* _arg) { //blob center circle(outC, Point(blb[0],blb[1]), 50, Scalar(255,0,0), 3); - - Mat blobDepth,blobEdge; - depthf.copyTo(blobDepth,blobMaskOutput); - Laplacian(blobDepth, blobEdge, 8); -// equalizeHist(blobEdge, blobEdge);//just for visualization - - Mat logPolar(depthf.size(),CV_8UC1); - cvLogPolar(&((IplImage)blobEdge), &((IplImage)logPolar), Point2f(blb[0],blb[1]), 80.0); - -// for (int i=0; i, <#const int *channels#>, <#const Mat mask#>, <#MatND hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>, <#bool uniform#>, <#bool accumulate#>) - */ - -// Mat _tmp(logPolar.size(),CV_8UC1); -// cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); -// imshow("descriptor", _tmp); -// imshow("logpolar", logPolar); + + ComputeDescriptor(blb); } } @@ -317,61 +421,24 @@ void* gesture_engine(void* _arg) { cout << "learn thumb" << endl; } if (k=='t') { - //train model - cout << "train model" << endl; - if(loaded != true) { - dataMat = Mat(training_data.size(),_d.size(),CV_32FC1); //descriptors as matrix rows - for (uint i=0; i> dataMat; - fs["labels"] >> labelMat; - loaded = true; - fs.release(); - } else { - cerr << "can't open saved data" << endl; - } + LoadModelData(); } } device.stopVideo(); device.stopDepth(); - return 0; +} + + +void* gesture_engine(void* _arg) { + + GestureEngine ge; + ge.RunEngine(); + } From 6a58520b3f1de842835df221976613628e23991a Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Mon, 7 Mar 2011 14:32:23 +0800 Subject: [PATCH 11/19] license header --- webkit-plugin-mac/FreenectDevice.h | 17 ++++++++++++++++- webkit-plugin-mac/gesture_engine.cpp | 21 +++++++++++++++++++-- webkit-plugin-mac/gesture_engine.hpp | 17 ++++++++++++++++- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/webkit-plugin-mac/FreenectDevice.h b/webkit-plugin-mac/FreenectDevice.h index 8c889f8..d70f10d 100644 --- a/webkit-plugin-mac/FreenectDevice.h +++ b/webkit-plugin-mac/FreenectDevice.h @@ -1,9 +1,24 @@ /* + DepthJS + Copyright (C) 2010 Aaron Zinman, Doug Fritz, Roy Shilkrot, Greg Elliott + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + * * FreenectDevice.h * NewCV * * Created by Roy Shilkrot on 3/3/11. - * Copyright 2011 MIT. All rights reserved. * */ #include "libfreenect.hpp" diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp index 8b42b67..e92d6f7 100644 --- a/webkit-plugin-mac/gesture_engine.cpp +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -1,3 +1,20 @@ +/* + DepthJS + Copyright (C) 2010 Aaron Zinman, Doug Fritz, Roy Shilkrot, Greg Elliott + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ #include "FreenectDevice.h" #define LABEL_GARBAGE 0 @@ -28,8 +45,8 @@ class GestureEngine { double height_over_num_y_reps,width_over_num_x_reps; - vector _d; //the descriptor - Mat descriptorMat; + vector _d; //the descriptor + Mat descriptorMat; //as a matrix CvKNearest classifier; diff --git a/webkit-plugin-mac/gesture_engine.hpp b/webkit-plugin-mac/gesture_engine.hpp index 9c3fb15..add8753 100644 --- a/webkit-plugin-mac/gesture_engine.hpp +++ b/webkit-plugin-mac/gesture_engine.hpp @@ -1,9 +1,24 @@ /* + DepthJS + Copyright (C) 2010 Aaron Zinman, Doug Fritz, Roy Shilkrot, Greg Elliott + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + * gesture_engine.hpp * webkit-plugin-mac * * Created by Roy Shilkrot on 3/6/11. - * Copyright 2011 MIT. All rights reserved. * */ From 0d10884ba65b5856a99fc7f34c81953cc796902d Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Tue, 8 Mar 2011 09:51:45 +0800 Subject: [PATCH 12/19] gesture engine integradted, somehow registering is not working --- new_cv/NewCV/main.cpp | 22 +- webkit-plugin-mac/gesture_engine.cpp | 298 ++++++++++++++---- webkit-plugin-mac/gesture_engine.hpp | 4 +- .../project.pbxproj | 4 + webkit-plugin-mac/webkit_plugin_macView.mm | 16 +- 5 files changed, 259 insertions(+), 85 deletions(-) diff --git a/new_cv/NewCV/main.cpp b/new_cv/NewCV/main.cpp index a6ee422..a737901 100644 --- a/new_cv/NewCV/main.cpp +++ b/new_cv/NewCV/main.cpp @@ -140,8 +140,8 @@ int main(int argc, char **argv) { device.getVideo(rgbMat); device.getDepth(depthMat); // cv::imshow("rgb", rgbMat); -// depthMat.convertTo(depthf, CV_8UC1, 255.0/2048.0); -// cv::imshow("depth",depthf); + depthMat.convertTo(depthf, CV_8UC1, 255.0/2048.0); + cv::imshow("depth",depthf); //interpolation & inpainting { @@ -254,7 +254,7 @@ int main(int argc, char **argv) { ); int count = countNonZero(part); //TODO: use calcHist -// part.setTo(Scalar(count/10.0)); //for debug: show the value in the image + //part.setTo(Scalar(count/10.0)); //for debug: show the value in the image _d[i*num_x_reps + j] = count; total += count; @@ -275,10 +275,10 @@ int main(int argc, char **argv) { calcHist(, <#int nimages#>, <#const int *channels#>, <#const Mat mask#>, <#MatND hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>, <#bool uniform#>, <#bool accumulate#>) */ -// Mat _tmp(logPolar.size(),CV_8UC1); -// cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); -// imshow("descriptor", _tmp); -// imshow("logpolar", logPolar); + Mat _tmp(logPolar.size(),CV_8UC1); + cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); + imshow("descriptor", _tmp); + imshow("logpolar", logPolar); } } @@ -286,7 +286,7 @@ int main(int argc, char **argv) { Mat results(1,1,CV_32FC1); Mat samples; Mat(Mat(_d).t()).convertTo(samples,CV_32FC1); - Mat samplesAfterPCA = pca.project(samples); + Mat samplesAfterPCA = samples; //pca.project(samples); classifier.find_nearest(&((CvMat)samplesAfterPCA), 1, &((CvMat)results)); // ((float*)results.data)[0] = classifier.predict(&((CvMat)samples))->value; @@ -363,9 +363,9 @@ int main(int argc, char **argv) { Mat(label_data).convertTo(labelMat,CV_32FC1); } - pca = pca(dataMat,Mat(),CV_PCA_DATA_AS_ROW,15); - Mat dataAfterPCA; - pca.project(dataMat,dataAfterPCA); +// pca = pca(dataMat,Mat(),CV_PCA_DATA_AS_ROW,15); + Mat dataAfterPCA = dataMat; +// pca.project(dataMat,dataAfterPCA); classifier.train(&((CvMat)dataAfterPCA), &((CvMat)labelMat)); diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp index e92d6f7..267e7f4 100644 --- a/webkit-plugin-mac/gesture_engine.cpp +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -22,10 +22,11 @@ #define LABEL_FIST 2 #define LABEL_THUMB 3 +extern void send_event(const string& etype, const string& edata); + class GestureEngine { private: - - bool die; + bool running; Mat depthMat; Mat depthf; @@ -33,7 +34,7 @@ class GestureEngine { Mat ownMat; Freenect::Freenect freenect; - MyFreenectDevice& device; + MyFreenectDevice* device; bool registered; Mat blobMaskOutput; @@ -58,6 +59,20 @@ class GestureEngine { bool trained; bool loaded; + + int mode; + + int register_ctr,register_secondbloc_ctr; + + Point2i appear; double appearTS; + + Point2i lastMove; + + int hcr_ctr; + vector hc_stack; + int hc_stack_ptr; + + int pca_number_of_features; Scalar _refineSegments(const Mat& img, Mat& mask, @@ -65,36 +80,59 @@ class GestureEngine { vector& contour, vector& second_contour, Point2i& previous); - void TrainModel(); + int TrainModel(); void SaveModelData(); - void LoadModelData(); + int LoadModelData(const char* filename); void InterpolateAndInpaint(); void ComputeDescriptor(Scalar); + string GetStringForGestureCode(int); + void CheckRegistered(Scalar,int); + int GetMostLikelyGesture(); public: - GestureEngine(): die(false), - depthMat(Mat(Size(640,480),CV_16UC1)), - depthf(Mat(Size(640,480),CV_8UC1)), - rgbMat(Mat(Size(640,480),CV_8UC3,Scalar(0))), - ownMat(Mat(Size(640,480),CV_8UC3,Scalar(0))), - device(freenect.createDevice(0)), + bool die; + + GestureEngine(): running(false), registered(false), - blobMaskOutput(Mat::zeros(Size(640,480),CV_8UC1)), startX(250), sizeX(150), num_x_reps(10), num_y_reps(10), height_over_num_y_reps(480/num_y_reps), width_over_num_x_reps(sizeX/num_x_reps), - _d(vector(num_x_reps * num_y_reps)), - descriptorMat(Mat(_d)), label_counts(vector(4)), trained(false), - loaded(false) + loaded(false), + die(false), + mode(LABEL_GARBAGE), + pca_number_of_features(15) { + depthMat = Mat(Size(640,480),CV_16UC1); + depthf = Mat(Size(640,480),CV_8UC1); + rgbMat = Mat(Size(640,480),CV_8UC3,Scalar(0)); + ownMat = Mat(Size(640,480),CV_8UC3,Scalar(0)); + blobMaskOutput = Mat(Size(640,480),CV_8UC1,Scalar(0)); + + _d = vector(num_x_reps*num_y_reps); + descriptorMat = Mat(_d); + + register_ctr = register_secondbloc_ctr = 0; + registered = false; + + appear = Point2i(-1,-1); + appearTS = -1; + + midBlob = Point2i(-1,-1); + lastMove = Point2i(-1,-1); + + hcr_ctr = -1; + hc_stack = vector(20); + hc_stack_ptr = 0; }; void RunEngine(); + bool getRunning() { return running; } + int InitializeFreenect(const char* ); }; Scalar GestureEngine::_refineSegments(const Mat& img, @@ -184,7 +222,7 @@ Scalar GestureEngine::_refineSegments(const Mat& img, } -void GestureEngine::TrainModel() { +int GestureEngine::TrainModel() { cout << "train model" << endl; if(loaded != true) { dataMat = Mat(training_data.size(),_d.size(),CV_32FC1); //descriptors as matrix rows @@ -195,13 +233,20 @@ void GestureEngine::TrainModel() { Mat(label_data).convertTo(labelMat,CV_32FC1); } - pca = pca(dataMat,Mat(),CV_PCA_DATA_AS_ROW,15); - Mat dataAfterPCA; - pca.project(dataMat,dataAfterPCA); - - classifier.train(&((CvMat)dataAfterPCA), &((CvMat)labelMat)); + try { + pca = pca(dataMat,Mat(),CV_PCA_DATA_AS_ROW,pca_number_of_features); + Mat dataAfterPCA; + pca.project(dataMat,dataAfterPCA); + + classifier.train(&((CvMat)dataAfterPCA), &((CvMat)labelMat)); + + trained = true; + } catch (cv::Exception e) { + cerr << "Can't train model: " << e.what(); + return 0; + } - trained = true; + return 1; } void GestureEngine::SaveModelData() { @@ -226,9 +271,9 @@ void GestureEngine::SaveModelData() { } } -void GestureEngine::LoadModelData() { +int GestureEngine::LoadModelData(const char* filename) { FileStorage fs; - fs.open("data-samples-labels.yaml", CV_STORAGE_READ); + fs.open(filename, CV_STORAGE_READ); if (fs.isOpened()) { fs["samples"] >> dataMat; fs["labels"] >> labelMat; @@ -236,14 +281,16 @@ void GestureEngine::LoadModelData() { fs.release(); } else { cerr << "can't open saved data" << endl; + return 0; } + return 1; } void GestureEngine::InterpolateAndInpaint() { //interpolation & inpainting Mat _tmp,_tmp1; // = (depthMat - 400.0); //minimum observed value is ~440. so shift a bit Mat(depthMat - 400.0).convertTo(_tmp1,CV_64FC1); - _tmp.setTo(Scalar(2048), depthMat > 750.0); //cut off at 600 to create a "box" where the user interacts +// _tmp1.setTo(Scalar(2048-400.0), depthMat > 750.0); //cut off at 600 to create a "box" where the user interacts Point minLoc; double minval,maxval; minMaxLoc(_tmp1, &minval, &maxval, NULL, NULL); @@ -313,13 +360,141 @@ void GestureEngine::ComputeDescriptor(Scalar blb) { } +string GestureEngine::GetStringForGestureCode(int res) { + if (res == LABEL_OPEN) { + return "Open hand"; + } + if (res == LABEL_FIST) { + return "Fist"; + } + if (res == LABEL_THUMB) { + return "Thumb"; + } + if (res == LABEL_GARBAGE) { + return "Garbage"; + } + return "none"; +} + +void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture) { + register_ctr = MIN((register_ctr + 1),60); + + if(blb[3] > 5000) + register_secondbloc_ctr = MIN((register_secondbloc_ctr + 1),60); + + if (register_ctr > 30 && !registered) { + registered = true; + appear.x = -1; + lastMove.x = blb[0]; lastMove.y = blb[1]; + + cout << "blob size " << blb[2] << endl; + + if(register_secondbloc_ctr < 30) { + cout << "register pointer" << endl; + stringstream ss; ss << "\"mode\":\""<< GetStringForGestureCode(recognized_gesture) <<"\""; + send_event("Register", ss.str()); + } else { + cout << "register tab swithcer" << endl; + send_event("Register", "\"mode\":\"twohands\""); + } + } + + if(registered) { + stringstream ss; + ss << "\"x\":" << (int)floor(blb[0]*100.0/640.0) + << ",\"y\":" << (int)floor(blb[1]*100.0/480.0) + << ",\"z\":" << 100; //(int)(mn[0] * 2.0); + //cout << "move: " << ss.str() << endl; + send_event("Move", ss.str()); + + hc_stack.at(hc_stack_ptr) = hcr_ctr; + hc_stack_ptr = (hc_stack_ptr + 1) % hc_stack.size(); + + //if thumb recognized - send "hand click" + if (recognized_gesture == LABEL_THUMB) { + cout << "Hand click!" << endl; + send_event("HandClick", ""); + } + } else { + //not registered, look for gestures + if(appear.x<0) { + //first appearence of blob + appear = midBlob; + // update_bg_model = false; + appearTS = getTickCount(); + cout << "appear ("< .2 && timediff < 1.0) { + //enough time passed from appearence + line(outC, appear, cv::Point(blb[0],blb[1]), Scalar(0,0,255), 3); + if (appear.x - blb[0] > 100) { + cout << "right"< 100) { + cout << "up" << endl; appear.x = -1; + send_event("SwipeUp", ""); + register_ctr = 0; + } else if (appear.y - blb[1] < -100) { + cout << "down" << endl; appear.x = -1; + send_event("SwipeDown", ""); + register_ctr = 0; + } + } + if(timediff >= 1.0) { + cout << "a ghost..."<startVideo(); + device->startDepth(); + } + catch (std::runtime_error e) { + return 0; + } + if(!LoadModelData(data)) return 0; + if(!TrainModel()) return 0; + + return 1; +} + +int GestureEngine::GetMostLikelyGesture() { + Mat results(1,1,CV_32FC1); + Mat samples; Mat(Mat(_d).t()).convertTo(samples,CV_32FC1); + Mat samplesAfterPCA = pca.project(samples); + + classifier.find_nearest(&((CvMat)samplesAfterPCA), 1, &((CvMat)results)); + + Mat lc(label_counts); lc *= 0.9; + label_counts[(int)((float*)results.data)[0]] += 0.1; + Point maxLoc; + minMaxLoc(lc, NULL, NULL, NULL, &maxLoc); + return maxLoc.y; +} + void GestureEngine::RunEngine() { - device.startVideo(); - device.startDepth(); + + running = true; while (!die) { - device.getVideo(rgbMat); - device.getDepth(depthMat); + device->getVideo(rgbMat); + device->getDepth(depthMat); InterpolateAndInpaint(); @@ -370,49 +545,27 @@ void GestureEngine::RunEngine() { //blob center circle(outC, Point(blb[0],blb[1]), 50, Scalar(255,0,0), 3); - ComputeDescriptor(blb); - } - } - - if(trained) { - Mat results(1,1,CV_32FC1); - Mat samples; Mat(Mat(_d).t()).convertTo(samples,CV_32FC1); - - Mat samplesAfterPCA = pca.project(samples); - - classifier.find_nearest(&((CvMat)samplesAfterPCA), 1, &((CvMat)results)); -// ((float*)results.data)[0] = classifier.predict(&((CvMat)samples))->value; - - Mat lc(label_counts); lc *= 0.9; - -// label_counts[(int)((float*)results.data)[0]] *= 0.9; - label_counts[(int)((float*)results.data)[0]] += 0.1; - Point maxLoc; - minMaxLoc(lc, NULL, NULL, NULL, &maxLoc); - int res = maxLoc.y; - - stringstream ss; ss << "prediction: "; - if (res == LABEL_OPEN) { - ss << "Open hand"; - } - if (res == LABEL_FIST) { - ss << "Fist"; - } - if (res == LABEL_THUMB) { - ss << "Thumb"; - } - if (res == LABEL_GARBAGE) { - ss << "Garbage"; + if(trained) { + ComputeDescriptor(blb); + int gesture_code = GetMostLikelyGesture(); + + { //debug + stringstream ss; ss << "prediction: " << GetStringForGestureCode(gesture_code); + putText(outC, ss.str(), Point(20,50), CV_FONT_HERSHEY_PLAIN, 3.0, Scalar(0,0,255), 2); + } + + CheckRegistered(blb, gesture_code); + } } - putText(outC, ss.str(), Point(20,50), CV_FONT_HERSHEY_PLAIN, 3.0, Scalar(0,0,255), 2); } - + imshow("blobs", outC); char k = cvWaitKey(5); if( k == 27 ){ break; } + /* if (k == 'g') { //put into training as 'garbage' training_data.push_back(_d); @@ -446,16 +599,27 @@ void GestureEngine::RunEngine() { if(k=='l') { LoadModelData(); } + */ } - device.stopVideo(); - device.stopDepth(); + device->stopVideo(); + device->stopDepth(); + + running = false; } +GestureEngine ge; void* gesture_engine(void* _arg) { - GestureEngine ge; ge.RunEngine(); } + +void kill_gesture_engine() { + ge.die = true; +} + +bool is_gesture_engine_dead() { return !ge.getRunning(); } + +int init_gesture_engine(const char* data) { return ge.InitializeFreenect(data); } \ No newline at end of file diff --git a/webkit-plugin-mac/gesture_engine.hpp b/webkit-plugin-mac/gesture_engine.hpp index add8753..c3dbda7 100644 --- a/webkit-plugin-mac/gesture_engine.hpp +++ b/webkit-plugin-mac/gesture_engine.hpp @@ -27,6 +27,8 @@ int gesture_engine(void* _arg); - +void kill_gesture_engine(); +bool is_gesture_engine_dead(); +int init_gesture_engine(const char* data); #endif \ No newline at end of file diff --git a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj index 654533f..9face7e 100644 --- a/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj +++ b/webkit-plugin-mac/webkit-plugin-mac.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ 93F690C71321789600F53A8A /* DLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93F690C61321789600F53A8A /* DLog.mm */; }; 93F691821321A45600F53A8A /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F691811321A45600F53A8A /* JavaScriptCore.framework */; }; D713093013235B55001594A0 /* gesture_engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D713092E13235B55001594A0 /* gesture_engine.cpp */; }; + D7CC1ABA1325B7EC001FB6D2 /* data-samples-labels.yaml in Resources */ = {isa = PBXBuildFile; fileRef = D7CC1AB91325B7EC001FB6D2 /* data-samples-labels.yaml */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -74,6 +75,7 @@ D713092E13235B55001594A0 /* gesture_engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gesture_engine.cpp; sourceTree = ""; }; D713092F13235B55001594A0 /* FreenectDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FreenectDevice.h; sourceTree = ""; }; D713093213235BCB001594A0 /* gesture_engine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gesture_engine.hpp; sourceTree = ""; }; + D7CC1AB91325B7EC001FB6D2 /* data-samples-labels.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "data-samples-labels.yaml"; path = "../new_cv/NewCV/build/Debug/data-samples-labels.yaml"; sourceTree = SOURCE_ROOT; }; DD92D38A0106425D02CA0E72 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; /* End PBXFileReference section */ @@ -113,6 +115,7 @@ 0259C582FE90428111CA0C5A /* Resources */ = { isa = PBXGroup; children = ( + D7CC1AB91325B7EC001FB6D2 /* data-samples-labels.yaml */, 8D1AC9730486D14A00FE50C9 /* Info.plist */, 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */, ); @@ -246,6 +249,7 @@ files = ( 8D1AC9800486D23B00FE50C9 /* InfoPlist.strings in Resources */, 938563E3130E61AF000F4333 /* Info.plist in Resources */, + D7CC1ABA1325B7EC001FB6D2 /* data-samples-labels.yaml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/webkit-plugin-mac/webkit_plugin_macView.mm b/webkit-plugin-mac/webkit_plugin_macView.mm index fc8abfd..58ea774 100644 --- a/webkit-plugin-mac/webkit_plugin_macView.mm +++ b/webkit-plugin-mac/webkit_plugin_macView.mm @@ -10,7 +10,8 @@ #import #import #import -#include "ocv_freenect.hpp" +//#include "ocv_freenect.hpp" +#include "gesture_engine.hpp" // PRIVATE METHODS --------------------------------------------------------------------------------- @@ -147,7 +148,8 @@ - (id)_initWithArguments:(NSDictionary *)newArguments { - (void) ocvMainLoop { ocvThread = [NSThread currentThread]; [ocvThread setName:@"ocvMainLoop"]; - ocvFreenectThread(NULL); +// ocvFreenectThread(NULL); + gesture_engine(NULL); } @end @@ -209,8 +211,9 @@ - (void) InitDepthJS { if (!haveInitDevice) { DLog(@"[DepthJS] Device not yet init; initing"); hostPlugin = self; - int failed = initFreenect(); - haveInitDevice = !failed; + NSString* pathToData = [[NSBundle bundleWithIdentifier:@"edu.mit.media.depthjs"] pathForResource:@"data-samples-labels" ofType:@"yaml"]; + int success = init_gesture_engine([pathToData cStringUsingEncoding:NSASCIIStringEncoding]); + haveInitDevice = success; if (haveInitDevice) { DLog(@"[DepthJS] Successfully inited Kinect; Starting ocv thread"); [NSThread detachNewThreadSelector:@selector(ocvMainLoop) toTarget:self withObject:nil]; @@ -228,10 +231,11 @@ - (void) ShutdownDepthJS { haveInitDevice = false; if (hostPlugin == self) { hostPlugin = NULL; - killOcvFreenect(); +// killOcvFreenect(); + kill_gesture_engine(); if (ocvThread != nil) [ocvThread cancel]; ocvThread = nil; - while (!isDead()) { + while (!is_gesture_engine_dead()) { [NSThread sleepForTimeInterval:0.01]; } } From 81fb7787088c7e3630c5c567ff72190ed91aaafc Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Tue, 8 Mar 2011 11:58:07 +0800 Subject: [PATCH 13/19] gesture engine integrated and working, still a little buggy tho --- webkit-plugin-mac/gesture_engine.cpp | 167 +++++++++++++++------------ 1 file changed, 92 insertions(+), 75 deletions(-) diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp index 267e7f4..f7a4a6b 100644 --- a/webkit-plugin-mac/gesture_engine.cpp +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -105,7 +105,7 @@ class GestureEngine { loaded(false), die(false), mode(LABEL_GARBAGE), - pca_number_of_features(15) + pca_number_of_features(25) { depthMat = Mat(Size(640,480),CV_16UC1); depthf = Mat(Size(640,480),CV_8UC1); @@ -362,10 +362,10 @@ void GestureEngine::ComputeDescriptor(Scalar blb) { string GestureEngine::GetStringForGestureCode(int res) { if (res == LABEL_OPEN) { - return "Open hand"; + return "openhand"; } if (res == LABEL_FIST) { - return "Fist"; + return "theforce"; } if (res == LABEL_THUMB) { return "Thumb"; @@ -377,84 +377,101 @@ string GestureEngine::GetStringForGestureCode(int res) { } void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture) { - register_ctr = MIN((register_ctr + 1),60); - - if(blb[3] > 5000) - register_secondbloc_ctr = MIN((register_secondbloc_ctr + 1),60); - - if (register_ctr > 30 && !registered) { - registered = true; - appear.x = -1; - lastMove.x = blb[0]; lastMove.y = blb[1]; + if(recognized_gesture != LABEL_GARBAGE) { + register_ctr = MIN((register_ctr + 1),60); - cout << "blob size " << blb[2] << endl; + if(blb[3] > 5000) + register_secondbloc_ctr = MIN((register_secondbloc_ctr + 1),60); - if(register_secondbloc_ctr < 30) { - cout << "register pointer" << endl; - stringstream ss; ss << "\"mode\":\""<< GetStringForGestureCode(recognized_gesture) <<"\""; - send_event("Register", ss.str()); - } else { - cout << "register tab swithcer" << endl; - send_event("Register", "\"mode\":\"twohands\""); - } - } - - if(registered) { - stringstream ss; - ss << "\"x\":" << (int)floor(blb[0]*100.0/640.0) - << ",\"y\":" << (int)floor(blb[1]*100.0/480.0) - << ",\"z\":" << 100; //(int)(mn[0] * 2.0); - //cout << "move: " << ss.str() << endl; - send_event("Move", ss.str()); + if (register_ctr > 30 && !registered) { + registered = true; + appear.x = -1; + lastMove.x = blb[0]; lastMove.y = blb[1]; + + cout << "blob size " << blb[2] << endl; + + if(register_secondbloc_ctr < 30) { + cout << "register pointer" << endl; + stringstream ss; ss << "\"mode\":\""<< GetStringForGestureCode(recognized_gesture) <<"\""; + send_event("Register", ss.str()); - hc_stack.at(hc_stack_ptr) = hcr_ctr; - hc_stack_ptr = (hc_stack_ptr + 1) % hc_stack.size(); + mode = recognized_gesture; + } else { + cout << "register tab swithcer" << endl; + send_event("Register", "\"mode\":\"twohands\""); + } + } - //if thumb recognized - send "hand click" - if (recognized_gesture == LABEL_THUMB) { - cout << "Hand click!" << endl; - send_event("HandClick", ""); + if(registered) { + stringstream ss; + ss << "\"x\":" << (int)floor(blb[0]*100.0/640.0) + << ",\"y\":" << (int)floor(blb[1]*100.0/480.0) + << ",\"z\":" << 100; //(int)(mn[0] * 2.0); + //cout << "move: " << ss.str() << endl; + send_event("Move", ss.str()); + + hc_stack.at(hc_stack_ptr) = hcr_ctr; + hc_stack_ptr = (hc_stack_ptr + 1) % hc_stack.size(); + + //if thumb recognized - send "hand click" + if (mode == LABEL_FIST && recognized_gesture == LABEL_THUMB) { + cout << "Hand click!" << endl; + send_event("HandClick", ""); + } } } else { - //not registered, look for gestures - if(appear.x<0) { - //first appearence of blob - appear = midBlob; - // update_bg_model = false; - appearTS = getTickCount(); - cout << "appear ("< .2 && timediff < 1.0) { - //enough time passed from appearence - line(outC, appear, cv::Point(blb[0],blb[1]), Scalar(0,0,255), 3); - if (appear.x - blb[0] > 100) { - cout << "right"< 100) { - cout << "up" << endl; appear.x = -1; - send_event("SwipeUp", ""); - register_ctr = 0; - } else if (appear.y - blb[1] < -100) { - cout << "down" << endl; appear.x = -1; - send_event("SwipeDown", ""); - register_ctr = 0; + if(!registered) { + //not registered, look for gestures + if(appear.x<0) { + //first appearence of blob + appear = midBlob; + // update_bg_model = false; + appearTS = getTickCount(); + cout << "appear ("< .2 && timediff < 1.0) { + //enough time passed from appearence + line(outC, appear, cv::Point(blb[0],blb[1]), Scalar(0,0,255), 3); + if (appear.x - blb[0] > 100) { + cout << "right"< 100) { + cout << "up" << endl; appear.x = -1; + send_event("SwipeUp", ""); + register_ctr = 0; + } else if (appear.y - blb[1] < -100) { + cout << "down" << endl; appear.x = -1; + send_event("SwipeDown", ""); + register_ctr = 0; + } } - } - if(timediff >= 1.0) { - cout << "a ghost..."<= 1.0) { + cout << "a ghost..."<= 0 && blb[2] > 300) { //draw contour From 85a293bf9333bcdd2ec24fce220460a0e0b7624c Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Tue, 8 Mar 2011 12:19:13 +0800 Subject: [PATCH 14/19] introduced grace period of a second for the thumb-click --- webkit-plugin-mac/gesture_engine.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp index f7a4a6b..7ae6394 100644 --- a/webkit-plugin-mac/gesture_engine.cpp +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -86,7 +86,7 @@ class GestureEngine { void InterpolateAndInpaint(); void ComputeDescriptor(Scalar); string GetStringForGestureCode(int); - void CheckRegistered(Scalar,int); + void CheckRegistered(Scalar,int,Scalar); int GetMostLikelyGesture(); public: @@ -376,7 +376,7 @@ string GestureEngine::GetStringForGestureCode(int res) { return "none"; } -void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture) { +void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture, Scalar mn) { if(recognized_gesture != LABEL_GARBAGE) { register_ctr = MIN((register_ctr + 1),60); @@ -406,7 +406,7 @@ void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture) { stringstream ss; ss << "\"x\":" << (int)floor(blb[0]*100.0/640.0) << ",\"y\":" << (int)floor(blb[1]*100.0/480.0) - << ",\"z\":" << 100; //(int)(mn[0] * 2.0); + << ",\"z\":" << (int)(mn[0] * 2.0); //cout << "move: " << ss.str() << endl; send_event("Move", ss.str()); @@ -415,8 +415,19 @@ void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture) { //if thumb recognized - send "hand click" if (mode == LABEL_FIST && recognized_gesture == LABEL_THUMB) { - cout << "Hand click!" << endl; - send_event("HandClick", ""); + bool fireClick = false; + if (appearTS > 0) { + double timediff = ((double)getTickCount()-appearTS)/getTickFrequency(); + fireClick = (timediff > 1.0); + } else { + fireClick = true; + } + if(fireClick) { + cout << "Hand click!" << endl; + send_event("HandClick", ""); + + appearTS = getTickCount(); + } } } } else { @@ -571,7 +582,7 @@ void GestureEngine::RunEngine() { putText(outC, ss.str(), Point(20,50), CV_FONT_HERSHEY_PLAIN, 3.0, Scalar(0,0,255), 2); } - CheckRegistered(blb, gesture_code); + CheckRegistered(blb, gesture_code, mn); } } } From af992524f543e379ab876e91cc2407ba8e31715f Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Tue, 8 Mar 2011 15:11:50 +0800 Subject: [PATCH 15/19] new heuristic for selecting blobs, albeit a stuid one. changed histogram to use mean values. loading from file now includes the descriptor parameters. fixed grace period for thumb-click. generally now working better, but still not perfect --- new_cv/NewCV/main.cpp | 64 ++++++++++++++++++++++------ webkit-plugin-mac/gesture_engine.cpp | 60 +++++++++++++++++++++----- 2 files changed, 101 insertions(+), 23 deletions(-) diff --git a/new_cv/NewCV/main.cpp b/new_cv/NewCV/main.cpp index a737901..46c876f 100644 --- a/new_cv/NewCV/main.cpp +++ b/new_cv/NewCV/main.cpp @@ -64,15 +64,32 @@ Scalar refineSegments(const Mat& img, // line(dst, contours[largestComp][idx], contours[largestComp][idx+1], color, 2); // if(largestComp >= 0) { + //find top-left values + int maxx = -INT_MAX,miny = INT_MAX; int num = contours[largestComp].size(); - Point* pts = &(contours[largestComp][0]); + for (int i=0; i maxx) maxx = contours[largestComp][i].x; + if(contours[largestComp][i].y < miny) miny = contours[largestComp][i].y; + } + + //crop contour to 150x150 "window" + vector newblob; + int maxxp150 = MAX(maxx-200,0),minyp150 = MIN(miny+170,480); + + for (int i=0; i maxxp150 && _p.y < minyp150) newblob.push_back(_p); + } + + Point* pts = &(newblob[0]); + num = newblob.size(); fillPoly(dst, (const Point**)(&pts), &num, 1, color); - Scalar b = mean(Mat(contours[largestComp])); + Scalar b = mean(Mat(newblob)); b[2] = justarea[largestComp]; contour.clear(); - contour = contours[largestComp]; + contour = newblob; second_contour.clear(); if(secondlargest >= 0) { @@ -111,7 +128,7 @@ int main(int argc, char **argv) { Mat blobMaskOutput = Mat::zeros(Size(640,480),CV_8UC1),outC; Point midBlob; - int startX = 250, sizeX = 150, num_x_reps = 10, num_y_reps = 10; + int startX = 200, sizeX = 180, num_x_reps = 20, num_y_reps = 50; double height_over_num_y_reps = 480/num_y_reps, width_over_num_x_reps = sizeX/num_x_reps; @@ -236,11 +253,11 @@ int main(int argc, char **argv) { // for (int i=0; i, <#const int *channels#>, <#const Mat mask#>, <#MatND hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>, <#bool uniform#>, <#bool accumulate#>) */ - Mat _tmp(logPolar.size(),CV_8UC1); - cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); - imshow("descriptor", _tmp); - imshow("logpolar", logPolar); +// Mat _tmp(logPolar.size(),CV_8UC1); +// cvLogPolar(&((IplImage)logPolar), &((IplImage)_tmp),Point2f(blb[0],blb[1]), 80.0, CV_WARP_INVERSE_MAP); +// imshow("descriptor", _tmp); +// imshow("logpolar", logPolar); } } @@ -315,6 +336,9 @@ int main(int argc, char **argv) { putText(outC, ss.str(), Point(20,50), CV_FONT_HERSHEY_PLAIN, 3.0, Scalar(0,0,255), 2); } + stringstream ss; ss << "samples: " << training_data.size(); + putText(outC, ss.str(), Point(30,outC.rows - 30), CV_FONT_HERSHEY_PLAIN, 2.0, Scalar(0,0,255), 1); + imshow("blobs", outC); char k = cvWaitKey(5); @@ -393,6 +417,12 @@ int main(int argc, char **argv) { if (fs.isOpened()) { fs << "samples" << dataMat; fs << "labels" << labelMat; + + fs << "startX" << startX; + fs << "sizeX" << sizeX; + fs << "num_x_reps" << num_x_reps; + fs << "num_y_reps" << num_y_reps; + loaded = true; fs.release(); } else { @@ -400,11 +430,19 @@ int main(int argc, char **argv) { } } if(k=='l') { + cout << "try to load training data" << endl; FileStorage fs; fs.open("data-samples-labels.yaml", CV_STORAGE_READ); if (fs.isOpened()) { fs["samples"] >> dataMat; fs["labels"] >> labelMat; + fs["startX"] >> startX; + fs["sizeX"] >> sizeX; + fs["num_x_reps"] >> num_x_reps; + fs["num_y_reps"] >> num_y_reps; + height_over_num_y_reps = 480/num_y_reps; + width_over_num_x_reps = sizeX/num_x_reps; + loaded = true; fs.release(); } else { diff --git a/webkit-plugin-mac/gesture_engine.cpp b/webkit-plugin-mac/gesture_engine.cpp index 7ae6394..66cb24c 100644 --- a/webkit-plugin-mac/gesture_engine.cpp +++ b/webkit-plugin-mac/gesture_engine.cpp @@ -103,9 +103,9 @@ class GestureEngine { label_counts(vector(4)), trained(false), loaded(false), - die(false), mode(LABEL_GARBAGE), - pca_number_of_features(25) + pca_number_of_features(50), + die(false) { depthMat = Mat(Size(640,480),CV_16UC1); depthf = Mat(Size(640,480),CV_8UC1); @@ -199,15 +199,36 @@ Scalar GestureEngine::_refineSegments(const Mat& img, // line(dst, contours[largestComp][idx], contours[largestComp][idx+1], color, 2); // if(largestComp >= 0) { + + //find top-left values + int maxx = -INT_MAX,miny = INT_MAX; int num = contours[largestComp].size(); - Point* pts = &(contours[largestComp][0]); + for (int i=0; i maxx) maxx = contours[largestComp][i].x; + if(contours[largestComp][i].y < miny) miny = contours[largestComp][i].y; + } + + //crop contour to 150x150 "window" + vector newblob; + int maxxp150 = MAX(maxx-200,0),minyp150 = MIN(miny+170,480); + + circle(outC, Point(maxx,miny), 2, Scalar(0,255,0), 1); + circle(outC, Point(maxxp150,minyp150), 2, Scalar(0,255,0), 1); + + for (int i=0; i maxxp150 && _p.y < minyp150) newblob.push_back(_p); + } + + Point* pts = &(newblob[0]); + num = newblob.size(); fillPoly(dst, (const Point**)(&pts), &num, 1, color); - Scalar b = mean(Mat(contours[largestComp])); + Scalar b = mean(Mat(newblob)); b[2] = justarea[largestComp]; contour.clear(); - contour = contours[largestComp]; + contour = newblob; second_contour.clear(); if(secondlargest >= 0) { @@ -277,6 +298,14 @@ int GestureEngine::LoadModelData(const char* filename) { if (fs.isOpened()) { fs["samples"] >> dataMat; fs["labels"] >> labelMat; + fs["startX"] >> startX; + fs["sizeX"] >> sizeX; + fs["num_x_reps"] >> num_x_reps; + fs["num_y_reps"] >> num_y_reps; + height_over_num_y_reps = 480/num_y_reps; + width_over_num_x_reps = sizeX/num_x_reps; + _d = vector(num_x_reps*num_y_reps); + descriptorMat = Mat(_d); loaded = true; fs.release(); } else { @@ -331,11 +360,17 @@ void GestureEngine::ComputeDescriptor(Scalar blb) { Range(startX+i*width_over_num_x_reps,startX+(i+1)*width_over_num_x_reps) ); - int count = countNonZero(part); //TODO: use calcHist - // part.setTo(Scalar(count/10.0)); //for debug: show the value in the image +// int count = countNonZero(part); //TODO: use calcHist +// // part.setTo(Scalar(count/10.0)); //for debug: show the value in the image +// +// _d[i*num_x_reps + j] = count; +// total += count; + + Scalar mn = mean(part); + _d[i*num_x_reps + j] = mn[0]; + - _d[i*num_x_reps + j] = count; - total += count; + total += mn[0]; } } @@ -428,6 +463,8 @@ void GestureEngine::CheckRegistered(Scalar blb, int recognized_gesture, Scalar m appearTS = getTickCount(); } + } else { + appearTS = -1; } } } else { @@ -586,7 +623,10 @@ void GestureEngine::RunEngine() { } } } - + + stringstream ss; ss << "samples: " << dataMat.rows; + putText(outC, ss.str(), Point(30,outC.rows - 30), CV_FONT_HERSHEY_PLAIN, 2.0, Scalar(0,0,255), 1); + imshow("blobs", outC); char k = cvWaitKey(5); From 5e48364d99a2f9063a5aedafc0934ec4937f8530 Mon Sep 17 00:00:00 2001 From: Jeremy Lightsmith Date: Fri, 18 Mar 2011 14:07:07 -0700 Subject: [PATCH 16/19] use the events! --- .../content_script/event_handlers.js | 14 +++++++++++++- .../content_script/selector_box.js | 10 ++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/chrome-extension-mac/content_script/event_handlers.js b/chrome-extension-mac/content_script/event_handlers.js index 49078d7..b7e105b 100644 --- a/chrome-extension-mac/content_script/event_handlers.js +++ b/chrome-extension-mac/content_script/event_handlers.js @@ -30,16 +30,25 @@ console.log("DepthJS: Loading event handlers"); DepthJS.state = null; DepthJS.lastRegisterTime = null; +DepthJS.trigger = function(element, name) { + var event = document.createEvent("Events") + event.initEvent(name, true, true); //true for can bubble, true for cancelable + element.dispatchEvent(event); +} + DepthJS.eventHandlers.onSwipeLeft = function() { + DepthJS.trigger(window, "swipeLeft"); // history.back(); }; DepthJS.eventHandlers.onSwipeRight = function() { + DepthJS.trigger(window, "swipeRight"); // We interpret as "forward". // history.forward(); }; DepthJS.eventHandlers.onSwipeDown = function() { + DepthJS.trigger(window, "swipeDown"); // We interpret as "scroll down 75% of window". // var scrollAmount = Math.floor($(window).height() * 0.75); // $("html, body").animate({ @@ -48,6 +57,7 @@ DepthJS.eventHandlers.onSwipeDown = function() { }; DepthJS.eventHandlers.onSwipeUp = function() { + DepthJS.trigger(window, "swipeUp"); // We interpret as "scroll up 75% of window". // var scrollAmount = Math.floor($(window).height() * 0.75); // $("html, body").animate({ @@ -56,12 +66,14 @@ DepthJS.eventHandlers.onSwipeUp = function() { }; DepthJS.eventHandlers.onHandPointer = function(){ + DepthJS.trigger(window, "handPointer"); if (DepthJS.verbose) console.log("DepthJS. Hand Pointer"); DepthJS.eventHandlers.onUnregister(); DepthJS.state = "selectorBox"; }; DepthJS.eventHandlers.onHandOpen = function(){ + DepthJS.trigger(window, "handOpen"); if (DepthJS.verbose) console.log("DepthJS. Hand Open"); DepthJS.eventHandlers.onUnregister(); DepthJS.state = "panner"; @@ -83,7 +95,7 @@ DepthJS.eventHandlers.onSelectorBoxMode = function() { // POINTER ----------------------------------------------------------------------------------------- DepthJS.eventHandlers.onRegister = function(data) { if (DepthJS.verbose) console.log("DepthJS: User registered their hand"); - $(window).trigger("touchstart"); + DepthJS.trigger(window, "touchstart"); if (data.mode == "twohands") { console.log("Ignoring in two hands for now"); return; diff --git a/chrome-extension-mac/content_script/selector_box.js b/chrome-extension-mac/content_script/selector_box.js index 5ea7df7..7cd7e37 100644 --- a/chrome-extension-mac/content_script/selector_box.js +++ b/chrome-extension-mac/content_script/selector_box.js @@ -74,20 +74,14 @@ DepthJS.selectorBox.handleHover = function() { var lastElement = $('.depthjs-hover')[0]; var element = DepthJS.selectorBox.elementAtCursor(); - var trigger = function(element, name) { - var event = document.createEvent("Events") - event.initEvent(name, true, true); //true for can bubble, true for cancelable - element.dispatchEvent(event); - } - if (element == lastElement) { // same element // do nothing } else { if (lastElement) { - trigger($(lastElement).removeClass('depthjs-hover')[0], 'hoverOut'); + DepthJS.trigger($(lastElement).removeClass('depthjs-hover')[0], 'hoverOut'); } if (element) { - trigger($(element).addClass("depthjs-hover")[0], "hoverOver"); + DepthJS.trigger($(element).addClass("depthjs-hover")[0], "hoverOver"); } } }; From acf84552e3a06b50428c4ecff0ef99ac4520a5bd Mon Sep 17 00:00:00 2001 From: JB Brown Date: Mon, 21 Mar 2011 12:17:39 -0700 Subject: [PATCH 17/19] touchstart and touchend events --- chrome-extension-mac/content_script/event_handlers.js | 5 ++--- chrome-extension-mac/content_script/init.js | 11 ++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/chrome-extension-mac/content_script/event_handlers.js b/chrome-extension-mac/content_script/event_handlers.js index b7e105b..0c525c5 100644 --- a/chrome-extension-mac/content_script/event_handlers.js +++ b/chrome-extension-mac/content_script/event_handlers.js @@ -95,7 +95,7 @@ DepthJS.eventHandlers.onSelectorBoxMode = function() { // POINTER ----------------------------------------------------------------------------------------- DepthJS.eventHandlers.onRegister = function(data) { if (DepthJS.verbose) console.log("DepthJS: User registered their hand"); - DepthJS.trigger(window, "touchstart"); + DepthJS.trigger(window, "touchStart"); if (data.mode == "twohands") { console.log("Ignoring in two hands for now"); return; @@ -113,7 +113,6 @@ DepthJS.eventHandlers.onRegister = function(data) { DepthJS.lastRegisterTime = new Date(); DepthJS.state = DepthJS.registerMode; DepthJS[DepthJS.registerMode].show(); - $("#kinect-help").hide(); }; DepthJS.eventHandlers.onUnregister = function() { @@ -123,7 +122,7 @@ DepthJS.eventHandlers.onUnregister = function() { DepthJS.selectorBox.hide(); DepthJS.selectorBoxPopup.hide(); DepthJS.depthose.hide(); - $("#kinect-help").show(); + DepthJS.trigger(window, "touchStop"); }; DepthJS.eventHandlers.onHandClick = function() { diff --git a/chrome-extension-mac/content_script/init.js b/chrome-extension-mac/content_script/init.js index 6190c94..48a86f9 100644 --- a/chrome-extension-mac/content_script/init.js +++ b/chrome-extension-mac/content_script/init.js @@ -18,15 +18,8 @@ $(function() { left: "20px" }) .appendTo("body"); - $("
").text("move your hand closer until you see your hand on the screen") - .css({ - position: "fixed", - left: "55px", - bottom: "20px", - backgroundColor: "white", - padding: 4 - }) - .appendTo("body"); + + // console.log($("img")); From a1f48deeb9d5de1dc19a21609c2df7c75e2a87af Mon Sep 17 00:00:00 2001 From: Jeremy Lightsmith Date: Thu, 7 Apr 2011 16:36:15 -0700 Subject: [PATCH 18/19] let's mark the page as kinect is running --- chrome-extension-mac/content_script/init.js | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome-extension-mac/content_script/init.js b/chrome-extension-mac/content_script/init.js index 48a86f9..169b884 100644 --- a/chrome-extension-mac/content_script/init.js +++ b/chrome-extension-mac/content_script/init.js @@ -18,6 +18,7 @@ $(function() { left: "20px" }) .appendTo("body"); + $("body").addClass("depthjs-started"); // console.log($("img")); From fd2d4bd50502963937f950e5e8e07d6fbe30114d Mon Sep 17 00:00:00 2001 From: Jeremy Lightsmith Date: Mon, 11 Apr 2011 16:45:07 -0700 Subject: [PATCH 19/19] add depthjs loading event --- chrome-extension-mac/content_script/event_handlers.js | 2 ++ chrome-extension-mac/content_script/init.js | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/chrome-extension-mac/content_script/event_handlers.js b/chrome-extension-mac/content_script/event_handlers.js index 0c525c5..b63133c 100644 --- a/chrome-extension-mac/content_script/event_handlers.js +++ b/chrome-extension-mac/content_script/event_handlers.js @@ -36,6 +36,8 @@ DepthJS.trigger = function(element, name) { element.dispatchEvent(event); } +DepthJS.trigger(window, "depthjs-loading"); + DepthJS.eventHandlers.onSwipeLeft = function() { DepthJS.trigger(window, "swipeLeft"); // history.back(); diff --git a/chrome-extension-mac/content_script/init.js b/chrome-extension-mac/content_script/init.js index 169b884..8772047 100644 --- a/chrome-extension-mac/content_script/init.js +++ b/chrome-extension-mac/content_script/init.js @@ -18,11 +18,6 @@ $(function() { left: "20px" }) .appendTo("body"); - $("body").addClass("depthjs-started"); - - - // console.log($("img")); - var lastTime = null; function reloadChecker() {