diff --git a/Assets/Gesture/Gesture.cs b/Assets/Gesture/Gesture.cs index 548ad93a86c3b944cbbae032318d73c24a29cec8..b47df829407db9879d1a59d643ddf33304e54162 100644 --- a/Assets/Gesture/Gesture.cs +++ b/Assets/Gesture/Gesture.cs @@ -150,21 +150,14 @@ public class Gesture timestampVariance += (gesture.states [i].timestamp - gestureMean.states [i].timestamp) * (gesture.states [i].timestamp - gestureMean.states [i].timestamp); - positionVariance.x += (gesture.states [i].position.x - gestureMean.states [i].position.x) * - (gesture.states [i].position.x - gestureMean.states [i].position.x); - positionVariance.y += (gesture.states [i].position.y - gestureMean.states [i].position.y) * - (gesture.states [i].position.y - gestureMean.states [i].position.y); - positionVariance.z += (gesture.states [i].position.z - gestureMean.states [i].position.z) * - (gesture.states [i].position.z - gestureMean.states [i].position.z); - - rotationVariance.x += (gesture.states [i].rotation.x - gestureMean.states [i].rotation.x) * - (gesture.states [i].rotation.x - gestureMean.states [i].rotation.x); - rotationVariance.y += (gesture.states [i].rotation.y - gestureMean.states [i].rotation.y) * - (gesture.states [i].rotation.y - gestureMean.states [i].rotation.y); - rotationVariance.z += (gesture.states [i].rotation.z - gestureMean.states [i].rotation.z) * - (gesture.states [i].rotation.z - gestureMean.states [i].rotation.z); - rotationVariance.w += (gesture.states [i].rotation.w - gestureMean.states [i].rotation.w) * - (gesture.states [i].rotation.w - gestureMean.states [i].rotation.w); + positionVariance.x += Mathf.Abs(gesture.states [i].position.x - gestureMean.states [i].position.x); + positionVariance.y += Mathf.Abs(gesture.states [i].position.y - gestureMean.states [i].position.y); + positionVariance.z += Mathf.Abs(gesture.states [i].position.z - gestureMean.states [i].position.z); + + rotationVariance.x += Mathf.Abs(gesture.states [i].rotation.x - gestureMean.states [i].rotation.x); + rotationVariance.y += Mathf.Abs(gesture.states [i].rotation.y - gestureMean.states [i].rotation.y); + rotationVariance.z += Mathf.Abs(gesture.states [i].rotation.z - gestureMean.states [i].rotation.z); + rotationVariance.w += Mathf.Abs(gesture.states [i].rotation.w - gestureMean.states [i].rotation.w); gestureCount ++; } diff --git a/Assets/Record/Recorded/gesture/variance.txt b/Assets/Record/Recorded/gesture/variance.txt index 11e5f345faf968704b62c0fe1eac4b7b7872d2c6..4a01f02f77ebf9f13e835b0200103a6a11ee6b76 100644 --- a/Assets/Record/Recorded/gesture/variance.txt +++ b/Assets/Record/Recorded/gesture/variance.txt @@ -1,126 +1,126 @@ Gesture: gesture; Author: none -21.81904 0.000175022 1.585061E-05 6.103652E-05 0.0006363117 0.0008802614 0.0002413064 0.0003604455 0 0 0 0 0 0 0 -21.81866 0.0001678585 1.631533E-05 5.902816E-05 0.000596108 0.0008454087 0.0002413528 0.0003565787 0 0 0 0 0 0 0 -21.81824 0.0001631274 1.658935E-05 5.74226E-05 0.0005752567 0.0008216696 0.0002346992 0.0003521797 0 0 0 0 0 0 0 -21.81845 0.0001617758 1.688404E-05 5.617857E-05 0.000573042 0.0008134407 0.0002298527 0.0003446643 0 0 0 0 0 0 0 -21.81842 0.0001625182 1.690524E-05 5.534355E-05 0.0006112047 0.000808492 0.0002200081 0.0003420123 0 0 0 0 0 0 0 -21.81764 0.0001660646 1.73351E-05 5.536872E-05 0.0006043165 0.0008189348 0.0002315335 0.0003457388 0 0 0 0 0 0 0 -21.81858 0.0001728629 1.818416E-05 5.589895E-05 0.0006453947 0.0008652193 0.0002425329 0.0003572562 0 0 0 0 0 0 0 -21.8183 0.000182236 1.974386E-05 5.694184E-05 0.0006876974 0.0009105167 0.0002446707 0.0003665615 0 0 0 0 0 0 0 -21.82009 0.0001931009 2.132203E-05 5.857288E-05 0.0007420738 0.0009707119 0.0002651074 0.0003884459 0 0 0 0 0 0 0 -21.82013 0.0002084679 2.378835E-05 5.962215E-05 0.0007987209 0.001055969 0.0002598836 0.0004006081 0 0 0 0 0 0 0 -21.81948 0.0002196685 2.488581E-05 6.092323E-05 0.0008585799 0.001150099 0.000287016 0.0004363575 0 0 0 0 0 0 0 -21.8183 0.0002351945 2.678834E-05 6.207537E-05 0.001027152 0.001302282 0.0003251506 0.0004543757 0 0 0 0 0 0 0 -21.8192 0.0002518051 2.869299E-05 6.25154E-05 0.001154693 0.00145324 0.0003194606 0.0004245338 0 0 0 0 0 0 0 -21.81841 0.0002707597 3.142689E-05 6.282413E-05 0.001380835 0.001650173 0.0003137461 0.0003796543 0 0 0 0 0 0 0 -21.81934 0.0002803646 3.18649E-05 6.401201E-05 0.001504348 0.001842007 0.0002736144 0.0003272779 0 0 0 0 0 0 0 -21.81997 0.0002784765 3.144292E-05 6.576317E-05 0.001749486 0.002055393 0.0002343851 0.0002732207 0 0 0 0 0 0 0 -21.81733 0.0002725009 3.006257E-05 6.752197E-05 0.001935846 0.002216386 0.0002274803 0.0002235727 0 0 0 0 0 0 0 -21.81997 0.0002629237 2.840325E-05 6.890734E-05 0.00222268 0.002348466 0.0003118307 0.0001992549 0 0 0 0 0 0 0 -21.81702 0.0002473101 2.426133E-05 7.052805E-05 0.002432087 0.002408494 0.0003702289 0.0002160528 0 0 0 0 0 0 0 -21.81856 0.000234488 2.063633E-05 7.266256E-05 0.002699315 0.00254036 0.0004364235 0.0002140128 0 0 0 0 0 0 0 -21.81781 0.0002276594 1.828348E-05 7.481168E-05 0.00307798 0.00267484 0.0005078348 0.0002326385 0 0 0 0 0 0 0 -21.81789 0.0002352403 2.221791E-05 7.201617E-05 0.003008914 0.002752692 0.0005337254 0.0002497883 0 0 0 0 0 0 0 -21.81858 0.0002438134 2.437408E-05 7.188958E-05 0.003220951 0.002809096 0.0006614568 0.0002920811 0 0 0 0 0 0 0 -21.81866 0.0002567426 2.674291E-05 7.248548E-05 0.003206868 0.002738896 0.0007156974 0.0003097123 0 0 0 0 0 0 0 -21.81869 0.00027226 2.890439E-05 7.27058E-05 0.00330406 0.002723263 0.0007817104 0.0003756444 0 0 0 0 0 0 0 -21.81877 0.0002961385 3.604213E-05 7.547908E-05 0.003586376 0.00274808 0.0008182405 0.0004088017 0 0 0 0 0 0 0 -21.81714 0.0003224867 4.412579E-05 7.704437E-05 0.003986564 0.002772699 0.0008303615 0.0004923159 0 0 0 0 0 0 0 -21.81769 0.0003570499 5.19827E-05 7.997039E-05 0.004432815 0.002821035 0.0009041944 0.0005608358 0 0 0 0 0 0 0 -21.81931 0.0003794596 5.47062E-05 8.520243E-05 0.004717643 0.002864672 0.001124244 0.0006465498 0 0 0 0 0 0 0 -21.8202 0.00041249 5.934891E-05 9.04734E-05 0.00509027 0.00292309 0.0012015 0.0006711358 0 0 0 0 0 0 0 -21.8187 0.0004438411 7.393742E-05 9.548332E-05 0.005523283 0.002997916 0.00142148 0.0007597061 0 0 0 0 0 0 0 -21.81836 0.0004870891 8.833133E-05 9.918388E-05 0.006106389 0.002954372 0.001868054 0.0008333423 0 0 0 0 0 0 0 -21.81851 0.0005295706 0.0001030692 0.0001046284 0.006770466 0.00286077 0.002273201 0.0009273569 0 0 0 0 0 0 0 -21.81089 0.0005565398 0.0001171988 0.0001122447 0.007376221 0.002701961 0.002729257 0.001099962 0 0 0 0 0 0 0 -21.81065 0.0005825916 0.0001407127 0.0001180282 0.007957257 0.00249505 0.003553406 0.001294692 0 0 0 0 0 0 0 -21.80795 0.0006238879 0.000172647 0.0001231315 0.007854181 0.002333785 0.004259904 0.001390056 0 0 0 0 0 0 0 -21.8083 0.0006521728 0.0001995912 0.0001291686 0.008252958 0.002109253 0.004783649 0.001453972 0 0 0 0 0 0 0 -21.8105 0.0006732024 0.0002221519 0.000136434 0.008494129 0.001825087 0.004839614 0.001285562 0 0 0 0 0 0 0 -21.80968 0.000685216 0.000239924 0.000146666 0.008831119 0.001698412 0.004630105 0.001150825 0 0 0 0 0 0 0 -21.81063 0.0006997315 0.0002547317 0.0001610944 0.008487496 0.001557413 0.00412857 0.001023141 0 0 0 0 0 0 0 -21.81055 0.000715378 0.0002574821 0.0001742505 0.008291655 0.0015124 0.003626641 0.001002564 0 0 0 0 0 0 0 -21.81191 0.0007393794 0.0002685687 0.0001878938 0.007891959 0.001494806 0.003215945 0.001038826 0 0 0 0 0 0 0 -21.81176 0.000775013 0.0002803786 0.0002026846 0.007725919 0.001413399 0.002634197 0.0009176713 0 0 0 0 0 0 0 -21.81149 0.0007910244 0.0003034534 0.0002185011 0.006976169 0.001284747 0.00232962 0.0008833199 0 0 0 0 0 0 0 -21.81157 0.0008073943 0.0003001972 0.0002310197 0.006178112 0.001191618 0.001876073 0.0009819927 0 0 0 0 0 0 0 -21.8115 0.0008237747 0.000306914 0.0002523326 0.005413962 0.001109941 0.001654532 0.001035485 0 0 0 0 0 0 0 -21.81169 0.0008354824 0.0003143042 0.0002734065 0.005568296 0.001003481 0.001389873 0.0009851506 0 0 0 0 0 0 0 -21.8115 0.0008349502 0.0003293237 0.0002978719 0.005540694 0.0008445505 0.001102775 0.0009644227 0 0 0 0 0 0 0 -21.81022 0.0008499644 0.000362036 0.0003074887 0.00561469 0.0007008436 0.001017332 0.0009295186 0 0 0 0 0 0 0 -21.81099 0.0008687756 0.0004040784 0.0002984687 0.005526579 0.0006014294 0.0007880912 0.0009120386 0 0 0 0 0 0 0 -21.81192 0.000894799 0.0004343703 0.0002924811 0.00533136 0.0005111355 0.000833032 0.0008997485 0 0 0 0 0 0 0 -21.81157 0.000918491 0.0004586697 0.0002901136 0.005123953 0.0004886048 0.0009876786 0.0009434748 0 0 0 0 0 0 0 -21.81045 0.0009158785 0.0004812291 0.0002879563 0.005264211 0.0004413515 0.001266456 0.0009716981 0 0 0 0 0 0 0 -21.80978 0.0009120101 0.0005090396 0.0002814789 0.005505262 0.000446621 0.001783629 0.001097352 0 0 0 0 0 0 0 -21.81143 0.0009037229 0.0005416098 0.0002758169 0.005951782 0.0004839982 0.002413028 0.00128366 0 0 0 0 0 0 0 -21.81261 0.0009012628 0.0005796385 0.0002616353 0.006614884 0.0005700217 0.002626218 0.001398385 0 0 0 0 0 0 0 -21.81118 0.0008921711 0.0006087854 0.0002493869 0.007248226 0.0006198334 0.00322099 0.001527305 0 0 0 0 0 0 0 -21.8123 0.0008888971 0.0006324368 0.0002395209 0.007578657 0.0007565608 0.003830251 0.001691377 0 0 0 0 0 0 0 -21.81156 0.0008801051 0.0006535163 0.000223949 0.008218502 0.0008644828 0.005006426 0.001940618 0 0 0 0 0 0 0 -21.81044 0.0008549397 0.0006601081 0.0002123286 0.008351707 0.0009164017 0.005202764 0.002020933 0 0 0 0 0 0 0 -21.81141 0.0008335857 0.0006580636 0.0002037266 0.00833557 0.000991711 0.005515978 0.002139886 0 0 0 0 0 0 0 -21.81099 0.0008060625 0.0006500355 0.0001942632 0.008387004 0.0009880395 0.005981957 0.002228368 0 0 0 0 0 0 0 -21.81274 0.0007742709 0.0006489271 0.0001780691 0.008835866 0.001011442 0.006573573 0.002387819 0 0 0 0 0 0 0 -21.81309 0.0007549659 0.000649645 0.0001593002 0.009428809 0.00104818 0.007181543 0.002558285 0 0 0 0 0 0 0 -21.87134 0.0006859591 0.0006095908 0.0001130901 0.009771124 0.001078772 0.007871385 0.002801465 0 0 0 0 0 0 0 -21.87132 0.0006368949 0.0006100548 0.0001000221 0.01047815 0.001032996 0.008532641 0.00298438 0 0 0 0 0 0 0 -21.87168 0.0006117459 0.000614294 9.172904E-05 0.01162236 0.001033425 0.008952641 0.003212182 0 0 0 0 0 0 0 -21.89366 0.000594111 0.0006396795 8.324156E-05 0.01315643 0.001027618 0.009952274 0.003875108 0 0 0 0 0 0 0 -21.89345 0.0005970187 0.0006461519 7.643045E-05 0.01402407 0.001026022 0.01030242 0.004009646 0 0 0 0 0 0 0 -21.89488 0.00059787 0.0006569892 6.964163E-05 0.01447565 0.001020077 0.01126377 0.004208419 0 0 0 0 0 0 0 -21.8939 0.0006040072 0.0006507722 6.591988E-05 0.01518282 0.001039365 0.01151852 0.004278352 0 0 0 0 0 0 0 -21.8933 0.0005856265 0.0006454226 6.163685E-05 0.01532796 0.001011894 0.01157931 0.004161851 0 0 0 0 0 0 0 -21.89366 0.0005857223 0.0006441714 5.670666E-05 0.01583354 0.001018834 0.01148152 0.0041141 0 0 0 0 0 0 0 -21.89624 0.0005694324 0.0006297249 5.216222E-05 0.01617486 0.0009465836 0.01176115 0.004174276 0 0 0 0 0 0 0 -21.8947 0.000563149 0.0005999125 4.951033E-05 0.01626152 0.0009088082 0.01214533 0.004353223 0 0 0 0 0 0 0 -21.89497 0.0005460274 0.0005759324 4.810537E-05 0.01615861 0.000866194 0.01264546 0.004494037 0 0 0 0 0 0 0 -21.89355 0.0005204216 0.0005290814 4.836312E-05 0.01498657 0.0007647003 0.01187907 0.004383849 0 0 0 0 0 0 0 -21.89322 0.000496812 0.0005128303 4.93799E-05 0.01427186 0.0007321007 0.01124427 0.004297104 0 0 0 0 0 0 0 -21.89402 0.0004780426 0.0004830892 4.91721E-05 0.01123101 0.0007276624 0.01181363 0.004036386 0 0 0 0 0 0 0 -21.89451 0.0004624757 0.0004426432 4.818949E-05 0.00967346 0.0007511912 0.01140265 0.003985323 0 0 0 0 0 0 0 -21.89572 0.0004364334 0.0004043372 4.719498E-05 0.008901004 0.0007263213 0.009436093 0.003892734 0 0 0 0 0 0 0 -21.89384 0.0004112953 0.0003699624 4.805266E-05 0.007410506 0.0007274499 0.009090881 0.003813409 0 0 0 0 0 0 0 -21.89515 0.0003706896 0.0003313937 4.85632E-05 0.006312952 0.0006662903 0.008142089 0.003684679 0 0 0 0 0 0 0 -21.89318 0.0003308139 0.0002900627 4.933208E-05 0.005475461 0.0006689496 0.007206282 0.003478774 0 0 0 0 0 0 0 -21.89366 0.0003035151 0.0002535441 4.985737E-05 0.004753907 0.0006064585 0.006517821 0.003221593 0 0 0 0 0 0 0 -21.89288 0.0002836542 0.0002215333 4.972267E-05 0.004551669 0.0005942671 0.005694925 0.002897009 0 0 0 0 0 0 0 -21.89437 0.0002525716 0.0001837058 4.893759E-05 0.004158609 0.0005512014 0.004834322 0.002650167 0 0 0 0 0 0 0 -22.45671 0.0002533917 0.0001646671 5.476304E-05 0.003182237 0.0006600635 0.003884522 0.002180984 0 0 0 0 0 0 0 -21.42387 0.0002877697 0.0001406734 2.601168E-05 0.002639717 0.0008575858 0.003091494 0.001600479 0 0 0 0 0 0 0 -21.42677 0.0002827031 0.0001120139 2.452047E-05 0.002241196 0.0009619902 0.002326926 0.001232787 0 0 0 0 0 0 0 -21.42684 0.0002846233 9.356603E-05 2.346165E-05 0.001980689 0.001051306 0.001945067 0.001018749 0 0 0 0 0 0 0 -21.42675 0.0002934794 7.571642E-05 2.246237E-05 0.00175387 0.001148936 0.001668052 0.0008498176 0 0 0 0 0 0 0 -21.42493 0.0002896131 5.681553E-05 2.172572E-05 0.00150365 0.001207466 0.001494555 0.0007355593 0 0 0 0 0 0 0 -21.42538 0.0002930896 4.742779E-05 2.230816E-05 0.001580524 0.001283699 0.001316302 0.0006985996 0 0 0 0 0 0 0 -21.42518 0.0002800266 3.628997E-05 2.363E-05 0.001465543 0.001240907 0.001072191 0.0006191624 0 0 0 0 0 0 0 -21.42628 0.0002657313 2.624201E-05 2.373249E-05 0.001342134 0.001239551 0.0008461963 0.0005839411 0 0 0 0 0 0 0 -21.42577 0.0002592796 2.400715E-05 2.502301E-05 0.001280424 0.001210764 0.0007967535 0.0006082033 0 0 0 0 0 0 0 -21.42581 0.0002547574 2.055757E-05 2.583791E-05 0.001342059 0.001212597 0.0007109035 0.0005882823 0 0 0 0 0 0 0 -21.42689 0.0002615594 2.07901E-05 2.748384E-05 0.001449731 0.001240788 0.000645722 0.0005582142 0 0 0 0 0 0 0 -21.42457 0.0002737876 2.140577E-05 2.763297E-05 0.00164432 0.001235656 0.000696526 0.000592926 0 0 0 0 0 0 0 -21.42433 0.0002939682 2.218713E-05 2.777311E-05 0.001815219 0.001267101 0.0007597448 0.0006033716 0 0 0 0 0 0 0 -21.42686 0.0003179164 2.486211E-05 2.771968E-05 0.002015416 0.001317172 0.0008004227 0.0005921773 0 0 0 0 0 0 0 -21.42539 0.0003455797 2.800522E-05 2.776551E-05 0.00219125 0.001404872 0.0008639955 0.0006158536 0 0 0 0 0 0 0 -21.42741 0.0003681981 3.015434E-05 2.769305E-05 0.002481243 0.001472764 0.0008919234 0.0006889074 0 0 0 0 0 0 0 -21.78121 0.0004287437 3.366541E-05 3.209518E-05 0.002762485 0.001640274 0.0009104499 0.000767379 0 0 0 0 0 0 0 -23.45938 0.0003077213 3.244403E-05 8.407581E-06 0.003207298 0.001180273 0.001184798 0.0008978218 0 0 0 0 0 0 0 -23.4603 0.0003367745 3.58296E-05 8.628076E-06 0.003459408 0.001242997 0.001188322 0.0009396456 0 0 0 0 0 0 0 -23.45721 0.0003593372 3.82949E-05 9.442562E-06 0.00362965 0.00130105 0.001203959 0.0009697073 0 0 0 0 0 0 0 -23.585 0.0003759254 3.993534E-05 1.031993E-05 0.003704786 0.001360015 0.001184985 0.0009363533 0 0 0 0 0 0 0 -36.92585 0.0006283089 6.609345E-05 1.519797E-05 0.006257421 0.002134121 0.001549948 0.001435452 0 0 0 0 0 0 0 -4.634685 9.714951E-06 8.975863E-06 1.094725E-05 2.297827E-05 1.293788E-06 0.0003578658 0.0004447691 0 0 0 0 0 0 0 -6.209151 1.364245E-05 1.225753E-05 1.449532E-05 2.663482E-05 4.018665E-06 0.0005593597 0.0007210795 0 0 0 0 0 0 0 -2.096355 7.190964E-06 6.095309E-06 9.239858E-06 7.02846E-06 6.106501E-07 3.232643E-05 3.48203E-05 0 0 0 0 0 0 0 -2.094985 6.714111E-06 5.852753E-06 9.891251E-06 5.339282E-06 7.143803E-07 4.709409E-05 4.559768E-05 0 0 0 0 0 0 0 -2.095638 6.147752E-06 6.845584E-06 1.0517E-05 1.632387E-06 7.311817E-07 5.208232E-05 5.134555E-05 0 0 0 0 0 0 0 -2.095038 5.545756E-06 6.769398E-06 1.079761E-05 4.137273E-07 2.257813E-06 6.063361E-05 5.27858E-05 0 0 0 0 0 0 0 -2.096182 4.438134E-06 6.502385E-06 1.125695E-05 2.861261E-07 3.566716E-07 5.563996E-05 4.673275E-05 0 0 0 0 0 0 0 -4.143071 4.959128E-06 1.047618E-05 2.228393E-05 2.077518E-07 6.213928E-07 0.0001688545 0.0001198527 0 0 0 0 0 0 0 -0.0002822375 1.08439E-07 8.618887E-09 1.371085E-08 8.988685E-10 1.361401E-06 3.441747E-08 1.061694E-06 0 0 0 0 0 0 0 -0.0002666612 1.197813E-07 1.10041E-08 1.320267E-08 3.758104E-09 1.202741E-06 3.833813E-10 6.780504E-07 0 0 0 0 0 0 0 -0.0002782145 7.940891E-08 1.522302E-08 4.069403E-09 1.163905E-10 4.260181E-07 1.056174E-06 1.828743E-06 0 0 0 0 0 0 0 -0.0002913786 1.07714E-07 8.926624E-09 1.394917E-08 8.202514E-08 1.061326E-06 8.396098E-07 1.832775E-06 0 0 0 0 0 0 0 -0.0002547437 5.153095E-08 2.095817E-09 2.114277E-08 1.677747E-07 6.82081E-07 7.410068E-08 1.884291E-08 0 0 0 0 0 0 0 -0.0002889743 3.111694E-08 6.522269E-09 2.869514E-08 6.865554E-08 9.419026E-08 5.698562E-10 1.638912E-07 0 0 0 0 0 0 0 -0.0002598838 4.277316E-09 3.402191E-08 3.519028E-08 8.881784E-10 2.892784E-08 1.86199E-07 2.580746E-07 0 0 0 0 0 0 0 +21.81904 0.01058082 0.003406518 0.006268829 0.02232804 0.02526871 0.01374408 0.01636094 0 0 0 0 0 0 0 +21.81866 0.0101787 0.0035325 0.006157371 0.02146006 0.02426768 0.01364662 0.01617037 0 0 0 0 0 0 0 +21.81824 0.009771742 0.003577116 0.006056513 0.02047667 0.02336831 0.01328476 0.01597853 0 0 0 0 0 0 0 +21.81845 0.009392443 0.003608391 0.005956273 0.01971387 0.0228198 0.01289155 0.01563941 0 0 0 0 0 0 0 +21.81842 0.009109169 0.003604396 0.005859341 0.02020855 0.02221996 0.01297227 0.01551375 0 0 0 0 0 0 0 +21.81764 0.009051888 0.003691912 0.005845887 0.01990261 0.02171717 0.01340001 0.01542722 0 0 0 0 0 0 0 +21.81858 0.009612466 0.003808493 0.005841457 0.02006787 0.02180966 0.01393878 0.0155966 0 0 0 0 0 0 0 +21.8183 0.01014111 0.004017684 0.005907327 0.02054325 0.02160133 0.01418176 0.01606974 0 0 0 0 0 0 0 +21.82009 0.01076571 0.004214346 0.005977686 0.0214674 0.02173898 0.01459292 0.01686221 0 0 0 0 0 0 0 +21.82013 0.01144998 0.00442755 0.006006171 0.02228748 0.02296677 0.01415758 0.01672648 0 0 0 0 0 0 0 +21.81948 0.01198154 0.004522726 0.006060183 0.02320965 0.02428495 0.014035 0.01740497 0 0 0 0 0 0 0 +21.8183 0.01257073 0.004636109 0.006114783 0.02533508 0.02645261 0.01408417 0.01743539 0 0 0 0 0 0 0 +21.8192 0.01312583 0.004685444 0.00614692 0.0270669 0.02829674 0.0134732 0.01657816 0 0 0 0 0 0 0 +21.81841 0.0137273 0.0047738 0.006181344 0.02946531 0.03106974 0.01333582 0.01536804 0 0 0 0 0 0 0 +21.81934 0.01399445 0.004711946 0.006274685 0.03032853 0.03405434 0.01294502 0.0141721 0 0 0 0 0 0 0 +21.81997 0.01401295 0.004599889 0.006389769 0.03315601 0.03683935 0.01223996 0.01390504 0 0 0 0 0 0 0 +21.81733 0.01388493 0.004435531 0.006476898 0.03673589 0.03908848 0.01188569 0.01195999 0 0 0 0 0 0 0 +21.81997 0.01341998 0.004161774 0.006532956 0.04024976 0.04066531 0.01273261 0.01055276 0 0 0 0 0 0 0 +21.81702 0.01277086 0.003724928 0.006597647 0.04195428 0.04130352 0.01530187 0.01063321 0 0 0 0 0 0 0 +21.81856 0.01227127 0.003343309 0.006648713 0.0436851 0.04160937 0.01750341 0.01164018 0 0 0 0 0 0 0 +21.81781 0.01193743 0.003281675 0.006744489 0.04598344 0.04152898 0.01852863 0.0124894 0 0 0 0 0 0 0 +21.81789 0.011434 0.003912782 0.006677213 0.04488375 0.04058414 0.01869701 0.01339186 0 0 0 0 0 0 0 +21.81858 0.01105812 0.004405607 0.006713844 0.04652969 0.03941461 0.02010481 0.01476432 0 0 0 0 0 0 0 +21.81866 0.01111933 0.004709118 0.00689577 0.0465327 0.03916109 0.02073758 0.01457847 0 0 0 0 0 0 0 +21.81869 0.01217655 0.00461394 0.007036324 0.04704208 0.03843401 0.02370231 0.01655822 0 0 0 0 0 0 0 +21.81877 0.01302829 0.004947797 0.007319525 0.04895434 0.0376753 0.02452955 0.01801877 0 0 0 0 0 0 0 +21.81714 0.01384059 0.005382053 0.007508599 0.0518844 0.03667682 0.02554186 0.01924804 0 0 0 0 0 0 0 +21.81769 0.01469485 0.005925007 0.00779914 0.0535519 0.03692127 0.02630046 0.02011407 0 0 0 0 0 0 0 +21.81931 0.01508617 0.005837548 0.008204856 0.05256205 0.03737529 0.02912349 0.02237372 0 0 0 0 0 0 0 +21.8202 0.01584684 0.006157473 0.008506085 0.05441473 0.03847156 0.02986016 0.02240144 0 0 0 0 0 0 0 +21.8187 0.01645658 0.006729274 0.008755846 0.05602295 0.03948373 0.03216704 0.02219394 0 0 0 0 0 0 0 +21.81836 0.01747296 0.007376526 0.00894276 0.05604351 0.03995524 0.03738027 0.02414353 0 0 0 0 0 0 0 +21.81851 0.01833227 0.007982625 0.009133215 0.05725887 0.04072043 0.04126769 0.02628888 0 0 0 0 0 0 0 +21.81089 0.01859944 0.008664167 0.009458612 0.05766693 0.03993154 0.04567161 0.02882655 0 0 0 0 0 0 0 +21.81065 0.01920657 0.009398719 0.009638743 0.05996907 0.03789089 0.05315876 0.03134516 0 0 0 0 0 0 0 +21.80795 0.02032987 0.01027072 0.009746443 0.05848285 0.03713053 0.05718362 0.03337729 0 0 0 0 0 0 0 +21.8083 0.02109347 0.01053088 0.009844258 0.05898293 0.0347927 0.05959495 0.03524608 0 0 0 0 0 0 0 +21.8105 0.02164423 0.01134634 0.009947984 0.06339153 0.03219118 0.05920536 0.03414913 0 0 0 0 0 0 0 +21.80968 0.02225429 0.01207642 0.01005959 0.06734985 0.03009822 0.0559301 0.03296867 0 0 0 0 0 0 0 +21.81063 0.02280923 0.01258464 0.01047763 0.0662981 0.02886281 0.05294696 0.03094199 0 0 0 0 0 0 0 +21.81055 0.02339036 0.01250496 0.01085443 0.06662316 0.02717119 0.04992849 0.03023253 0 0 0 0 0 0 0 +21.81191 0.02398521 0.01276601 0.01125674 0.06677145 0.02896228 0.04734492 0.02955543 0 0 0 0 0 0 0 +21.81176 0.02456105 0.01239025 0.01159932 0.06837188 0.02912811 0.04009322 0.02576611 0 0 0 0 0 0 0 +21.81149 0.024962 0.01336338 0.01199132 0.06770193 0.02841511 0.04071422 0.02413426 0 0 0 0 0 0 0 +21.81157 0.02498817 0.01362689 0.01223963 0.06432591 0.02784717 0.03520337 0.02728851 0 0 0 0 0 0 0 +21.8115 0.0252359 0.01418505 0.01266782 0.06076492 0.02705033 0.03557031 0.02835741 0 0 0 0 0 0 0 +21.81169 0.02533408 0.01464694 0.01310331 0.06286465 0.02609811 0.0341879 0.0286742 0 0 0 0 0 0 0 +21.8115 0.02559561 0.01544724 0.01367763 0.06566567 0.02400069 0.02938652 0.02860211 0 0 0 0 0 0 0 +21.81022 0.02607371 0.01648731 0.01388177 0.06648261 0.0209333 0.02673598 0.0276559 0 0 0 0 0 0 0 +21.81099 0.02648714 0.01744282 0.01364359 0.06362281 0.01752839 0.02012658 0.02603842 0 0 0 0 0 0 0 +21.81192 0.02699098 0.01799184 0.01344641 0.06115991 0.01499453 0.02265879 0.02444602 0 0 0 0 0 0 0 +21.81157 0.02746969 0.01851952 0.01337001 0.06103693 0.01396538 0.02697931 0.02354195 0 0 0 0 0 0 0 +21.81045 0.0274652 0.01898782 0.01341671 0.06447923 0.01351573 0.03148205 0.0240625 0 0 0 0 0 0 0 +21.80978 0.02747974 0.01957728 0.01333792 0.06734624 0.01397565 0.03689848 0.02534975 0 0 0 0 0 0 0 +21.81143 0.02740106 0.02008533 0.01317414 0.06918604 0.01550633 0.041203 0.0279898 0 0 0 0 0 0 0 +21.81261 0.02743946 0.02053791 0.01294206 0.07233351 0.01649305 0.04004388 0.0290825 0 0 0 0 0 0 0 +21.81118 0.02739519 0.02107601 0.01276069 0.07741331 0.0173257 0.04491359 0.0305174 0 0 0 0 0 0 0 +21.8123 0.02743937 0.02192975 0.01250883 0.08026318 0.02037816 0.049468 0.03245365 0 0 0 0 0 0 0 +21.81156 0.02743603 0.02267817 0.01212388 0.08361665 0.02099929 0.05488939 0.03426856 0 0 0 0 0 0 0 +21.81044 0.02708813 0.02317082 0.0118497 0.08345561 0.02085419 0.05662599 0.03490226 0 0 0 0 0 0 0 +21.81141 0.02675406 0.02339702 0.01162988 0.08182972 0.02111397 0.05864638 0.03571049 0 0 0 0 0 0 0 +21.81099 0.02633606 0.02328484 0.01140683 0.07989439 0.02117842 0.05956822 0.03642748 0 0 0 0 0 0 0 +21.81274 0.02583018 0.02324772 0.0110433 0.08190046 0.02091233 0.06221443 0.03790106 0 0 0 0 0 0 0 +21.81309 0.02553029 0.02368012 0.01042524 0.08503152 0.02182399 0.06473217 0.03922512 0 0 0 0 0 0 0 +21.87134 0.02449771 0.02254608 0.008941387 0.08237203 0.02281077 0.06921641 0.04079178 0 0 0 0 0 0 0 +21.87132 0.0235704 0.02235123 0.008366127 0.08595341 0.02258034 0.07295864 0.04248832 0 0 0 0 0 0 0 +21.87168 0.0230641 0.02244424 0.007963917 0.09085103 0.0226626 0.07333648 0.04386689 0 0 0 0 0 0 0 +21.89366 0.02245752 0.02235438 0.007510287 0.09249501 0.02245006 0.07848566 0.04873494 0 0 0 0 0 0 0 +21.89345 0.02224562 0.02230947 0.007066045 0.09479038 0.02245731 0.08116318 0.04973183 0 0 0 0 0 0 0 +21.89488 0.02187561 0.02202205 0.006551483 0.09171593 0.02364359 0.08615343 0.05072069 0 0 0 0 0 0 0 +21.8939 0.02185128 0.02155883 0.0061621 0.089854 0.02535255 0.08444855 0.04992807 0 0 0 0 0 0 0 +21.8933 0.02138011 0.02095464 0.005840157 0.08785606 0.0253495 0.08388173 0.04915116 0 0 0 0 0 0 0 +21.89366 0.02159024 0.02077842 0.005636456 0.08919071 0.02691436 0.0811073 0.04880903 0 0 0 0 0 0 0 +21.89624 0.02114804 0.02045602 0.005694243 0.09124678 0.02702716 0.08111571 0.04883105 0 0 0 0 0 0 0 +21.8947 0.0211003 0.02004623 0.005737287 0.0899602 0.02699759 0.0816766 0.05057665 0 0 0 0 0 0 0 +21.89497 0.02068435 0.01960197 0.005904641 0.08840766 0.02586712 0.0813598 0.05125646 0 0 0 0 0 0 0 +21.89355 0.01991775 0.01859373 0.006069243 0.08566631 0.02312993 0.08038263 0.05151803 0 0 0 0 0 0 0 +21.89322 0.0196262 0.01810255 0.006239499 0.08322383 0.02199663 0.08074047 0.05227837 0 0 0 0 0 0 0 +21.89402 0.01947712 0.01765202 0.006349702 0.07626985 0.02113481 0.07889574 0.05120724 0 0 0 0 0 0 0 +21.89451 0.01922575 0.0166433 0.006319542 0.07084522 0.0230446 0.0771632 0.05221026 0 0 0 0 0 0 0 +21.89572 0.01870554 0.01575666 0.006339186 0.06775685 0.02277677 0.07157532 0.05207227 0 0 0 0 0 0 0 +21.89384 0.01794095 0.01518679 0.0064294 0.06100077 0.02352795 0.06851168 0.05158489 0 0 0 0 0 0 0 +21.89515 0.01710821 0.01450297 0.006488753 0.05641184 0.02346841 0.06475051 0.05114112 0 0 0 0 0 0 0 +21.89318 0.01640135 0.01345945 0.006523471 0.05279081 0.02440808 0.05981243 0.0499835 0 0 0 0 0 0 0 +21.89366 0.01549788 0.01259621 0.006479812 0.04772296 0.02327799 0.05768626 0.04922087 0 0 0 0 0 0 0 +21.89288 0.01472539 0.01163062 0.006399882 0.04692142 0.02275435 0.05341189 0.04667505 0 0 0 0 0 0 0 +21.89437 0.01380652 0.01048355 0.006225101 0.0458646 0.02111009 0.04931524 0.04454303 0 0 0 0 0 0 0 +22.45671 0.01390056 0.01038541 0.005888816 0.04242533 0.02190854 0.04828594 0.04285332 0 0 0 0 0 0 0 +21.42387 0.01507482 0.009181667 0.004320234 0.03496661 0.02413055 0.0424079 0.03675042 0 0 0 0 0 0 0 +21.42677 0.01512739 0.008058719 0.004189367 0.03331405 0.02558194 0.0372888 0.03189579 0 0 0 0 0 0 0 +21.42684 0.01505043 0.007146631 0.004061932 0.03192813 0.02558482 0.03455713 0.02848732 0 0 0 0 0 0 0 +21.42675 0.01504377 0.006726131 0.003904199 0.03130936 0.02598882 0.03273715 0.02615389 0 0 0 0 0 0 0 +21.42493 0.01426394 0.005913972 0.003729902 0.03245113 0.02655122 0.03085889 0.02423968 0 0 0 0 0 0 0 +21.42538 0.01399668 0.005478928 0.003629682 0.03437279 0.02706089 0.03003412 0.0231649 0 0 0 0 0 0 0 +21.42518 0.01365691 0.004776245 0.003601648 0.03546106 0.02873795 0.02828007 0.02048331 0 0 0 0 0 0 0 +21.42628 0.01302902 0.00411312 0.00361187 0.03498297 0.03054464 0.02541632 0.01787021 0 0 0 0 0 0 0 +21.42577 0.01241211 0.00385646 0.003855986 0.03403756 0.0316907 0.02436216 0.01698362 0 0 0 0 0 0 0 +21.42581 0.01241145 0.003519886 0.004004717 0.03363738 0.03295479 0.02303479 0.01718862 0 0 0 0 0 0 0 +21.42689 0.01301405 0.003507797 0.004180667 0.0336518 0.0341586 0.0218465 0.01745937 0 0 0 0 0 0 0 +21.42457 0.01355654 0.003257073 0.004144336 0.03388228 0.03415411 0.02194802 0.01842471 0 0 0 0 0 0 0 +21.42433 0.0139449 0.003566613 0.004046266 0.03636793 0.03389275 0.0227176 0.01820891 0 0 0 0 0 0 0 +21.42686 0.014589 0.003981716 0.003868816 0.03834124 0.0329676 0.02376165 0.01735655 0 0 0 0 0 0 0 +21.42539 0.01588291 0.004313048 0.003657314 0.0405318 0.03353492 0.02447588 0.01781808 0 0 0 0 0 0 0 +21.42741 0.01675855 0.004552599 0.003536249 0.04262588 0.03497522 0.02434488 0.01874835 0 0 0 0 0 0 0 +21.78121 0.01658564 0.004658807 0.0039455 0.04222123 0.03256539 0.0245181 0.02174719 0 0 0 0 0 0 0 +23.45938 0.01394627 0.004183879 0.002219418 0.04389154 0.02666806 0.02923266 0.02296903 0 0 0 0 0 0 0 +23.4603 0.01477559 0.004360393 0.002163103 0.04661107 0.02795699 0.02925411 0.02414941 0 0 0 0 0 0 0 +23.45721 0.01543127 0.004508967 0.002175126 0.04719176 0.0289074 0.02834539 0.0240515 0 0 0 0 0 0 0 +23.585 0.01564824 0.004653617 0.002281457 0.04976024 0.03168527 0.02826089 0.02390205 0 0 0 0 0 0 0 +36.92585 0.01448497 0.005789551 0.003569055 0.04272655 0.02367438 0.03078784 0.03073829 0 0 0 0 0 0 0 +4.634685 0.002806365 0.002678346 0.003014336 0.003991296 0.0009403328 0.0171019 0.01932693 0 0 0 0 0 0 0 +6.209151 0.003430729 0.003287463 0.003670067 0.00421677 0.001248866 0.01692929 0.01926128 0 0 0 0 0 0 0 +2.096355 0.00261385 0.00246368 0.003039099 0.001900509 0.0007758141 0.005161405 0.005754501 0 0 0 0 0 0 0 +2.094985 0.002499796 0.00240944 0.003144503 0.001926452 0.0007335544 0.006500438 0.00666979 0 0 0 0 0 0 0 +2.095638 0.0024058 0.00260767 0.003242202 0.001131803 0.0008542985 0.007209599 0.007089347 0 0 0 0 0 0 0 +2.095038 0.00226865 0.002586864 0.003284805 0.0005528927 0.001400903 0.007778391 0.007203519 0 0 0 0 0 0 0 +2.096182 0.00203605 0.002546841 0.003354952 0.0004875511 0.0005840957 0.007420346 0.006826878 0 0 0 0 0 0 0 +4.143071 0.001863748 0.002468316 0.003370255 0.0004431456 0.0007779598 0.009452909 0.007984936 0 0 0 0 0 0 0 +0.0002822375 0.0003293008 9.283796E-05 0.0001170933 2.998114E-05 0.001166791 0.0001855195 0.001030385 0 0 0 0 0 0 0 +0.0002666612 0.0003460944 0.0001049004 0.0001149029 6.130338E-05 0.001096696 1.958013E-05 0.0008234382 0 0 0 0 0 0 0 +0.0002782145 0.0002817959 0.0001233816 6.379187E-05 1.078844E-05 0.0006527007 0.001027703 0.00135231 0 0 0 0 0 0 0 +0.0002913786 0.0003281981 9.448081E-05 0.0001181066 0.0002864003 0.001030207 0.0009163022 0.0013538 0 0 0 0 0 0 0 +0.0002547437 0.0002270043 4.578009E-05 0.0001454055 0.0004096031 0.000825882 0.0002722144 0.0001372695 0 0 0 0 0 0 0 +0.0002889743 0.0001763999 8.076057E-05 0.0001693964 0.000262022 0.0003069043 2.387166E-05 0.0004048347 0 0 0 0 0 0 0 +0.0002598838 6.54012E-05 0.0001844503 0.0001875907 2.980232E-05 0.0001700819 0.0004315078 0.0005080104 0 0 0 0 0 0 0 diff --git a/Assets/Record/Recorded/gesture/variance.txt.meta b/Assets/Record/Recorded/gesture/variance.txt.meta index 4bd96ff22af070b33e43834c561e317010d0a0f6..3513523e641b4f56385c5cfcf13a3e47fe350d65 100644 --- a/Assets/Record/Recorded/gesture/variance.txt.meta +++ b/Assets/Record/Recorded/gesture/variance.txt.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 761c35c7651e4d24a8e2c0172ee58f86 -timeCreated: 1515946978 +timeCreated: 1515950200 licenseType: Free TextScriptImporter: externalObjects: {} diff --git a/Assets/Replay/LiveComparer.cs b/Assets/Replay/LiveComparer.cs index 45293987bfeb1e0b19e81b12ae7534a0488a28ca..e9c0dc291d8cf209677038c0349eab97c9ab4153 100644 --- a/Assets/Replay/LiveComparer.cs +++ b/Assets/Replay/LiveComparer.cs @@ -11,6 +11,7 @@ public class LiveComparer : MonoBehaviour public GameObject totalScoreLabel = null; public Replay replay = null; public LeapServiceProvider LeapService = null; + public float scoreOffset = 70.0f; float acceptableScore = 150.0f; float totalScore = 0.0f; @@ -30,17 +31,6 @@ public class LiveComparer : MonoBehaviour totalScore = 0.0f; frameScore = 0.0f; sumScore = 0.0f; - - UpdateOffsetPosition (); - } - - void UpdateOffsetPosition () - { - if (replay.currentFrame >= 0 && replay.currentFrame < 100) - { - FetchPalmsCoordinates (); - offsetPosition = leftPalmPosition - replay.gestureToReplay.states [replay.currentFrame].position; - } } void Update () @@ -48,6 +38,10 @@ public class LiveComparer : MonoBehaviour if (replay.currentFrame >= 0 && replay.currentFrame < 100) { FetchPalmsCoordinates (); + + if (replay.currentFrame == 0) + UpdateOffsetPosition (); + ComputeFrameScore (); if (replay.currentFrame != lastFrame) @@ -60,49 +54,26 @@ public class LiveComparer : MonoBehaviour } } + void UpdateOffsetPosition () + { + offsetPosition = replay.gestureToReplay.states [replay.currentFrame].position - leftPalmPosition; + } + void ComputeFrameScore() { //for now we only consider the left hand - frameScore = 100.0f; - acceptableScore = 100.0f; - - float generalFactor = 1; - - float positionFactor = 15.0f; - float rotationFactor = 15.0f; - - Vector3 differencePosition = offsetPosition + leftPalmPosition - - replay.gestureToReplay.states [replay.currentFrame].position; - Vector4 differenceRotation = leftPalmRotation - - replay.gestureToReplay.states [replay.currentFrame].rotation; - - float absoluteDifferencePosition = Mathf.Abs(generalFactor * differencePosition.x) + - Mathf.Abs(generalFactor * differencePosition.y) + - Mathf.Abs(generalFactor * differencePosition.z) * positionFactor; - float absoluteDifferenceRotation = Mathf.Abs(generalFactor * differenceRotation.x) + - Mathf.Abs(generalFactor * differenceRotation.y) + - Mathf.Abs(generalFactor * differenceRotation.z) + - Mathf.Abs(generalFactor * differenceRotation.w) * rotationFactor; - - //use variance - Vector3 variancePosition = leftPalmPosition - - replay.gestureVariance.states [replay.currentFrame].position; - Vector4 varianceRotation = leftPalmRotation - - replay.gestureVariance.states [replay.currentFrame].rotation; - float absoluteDifferencePositionVariance = Mathf.Abs(generalFactor * variancePosition.x) + - Mathf.Abs(generalFactor * variancePosition.y) + - Mathf.Abs(generalFactor * variancePosition.z); - float absoluteDifferenceRotationVariance = Mathf.Abs(generalFactor * varianceRotation.x) + - Mathf.Abs(generalFactor * varianceRotation.y) + - Mathf.Abs(generalFactor * varianceRotation.z) + - Mathf.Abs(generalFactor * varianceRotation.w); - - //compute score based on difference with variance - float scorePosition = absoluteDifferencePositionVariance - absoluteDifferencePosition; - float scoreRotation = absoluteDifferenceRotation - absoluteDifferenceRotationVariance; - - - frameScore -= scorePosition + scoreRotation; + frameScore = scoreOffset; + float scoreFactor = 100.0f; + + Vector3 differencePosition = offsetPosition + leftPalmPosition - replay.gestureToReplay.states [replay.currentFrame].position; + Vector4 differenceRotation = leftPalmRotation - replay.gestureToReplay.states [replay.currentFrame].rotation; + Vector3 variancePosition = replay.gestureVariance.states [replay.currentFrame].position; + Vector4 varianceRotation = replay.gestureVariance.states [replay.currentFrame].rotation; + + float scorePosition = variancePosition.magnitude - differencePosition.magnitude; + float scoreRotation = varianceRotation.magnitude - differenceRotation.magnitude; + + frameScore += (scorePosition + scoreRotation) * scoreFactor; } void ComputeTotalScore() @@ -145,12 +116,12 @@ public class LiveComparer : MonoBehaviour else { //Debug.Log ("[UpdateScoreLabels] acc: " + acceptableScore); - if (frameScore > acceptableScore) + if (frameScore > 0) frameScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.7f, 0.0f); else frameScoreLabel.GetComponent<Text> ().color = new Color (0.7f, 0.0f, 0.0f); - if (totalScore > acceptableScore) + if (totalScore > 0) totalScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.7f, 0.0f); else totalScoreLabel.GetComponent<Text> ().color = new Color (0.7f, 0.0f, 0.0f);