Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroyuki committed Jan 31, 2023
1 parent 658576b commit 8c2cf0a
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 46 deletions.
10 changes: 0 additions & 10 deletions HandTracking.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

8 changes: 4 additions & 4 deletions HandTrackingApp/HandTrackingApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
649A928F293A32AB0033D6C3 /* HandTracker.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 649A9286293A2E7C0033D6C3 /* HandTracker.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
649A929A293A3C2A0033D6C3 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 649A9299293A3C2A0033D6C3 /* libc++.tbd */; };
649A929C293A3C340033D6C3 /* libresolv.9.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 649A929B293A3C330033D6C3 /* libresolv.9.tbd */; };
64EF18682988EA5700ED9E79 /* libNDIWrapper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64EF18672988EA5700ED9E79 /* libNDIWrapper.a */; };
64FCE6082988F5EB00089ADD /* libNDIWrapper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64FCE6072988F5EA00089ADD /* libNDIWrapper.a */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -53,7 +53,7 @@
649A928B293A316A0033D6C3 /* HandTrackingApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HandTrackingApp-Bridging-Header.h"; sourceTree = "<group>"; };
649A9299293A3C2A0033D6C3 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; };
649A929B293A3C330033D6C3 /* libresolv.9.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.9.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libresolv.9.tbd; sourceTree = DEVELOPER_DIR; };
64EF18672988EA5700ED9E79 /* libNDIWrapper.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libNDIWrapper.a; path = frameworks/libNDIWrapper.a; sourceTree = "<group>"; };
64FCE6072988F5EA00089ADD /* libNDIWrapper.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libNDIWrapper.a; path = frameworks/libNDIWrapper.a; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -62,7 +62,7 @@
buildActionMask = 2147483647;
files = (
649A928E293A32AB0033D6C3 /* HandTracker.framework in Frameworks */,
64EF18682988EA5700ED9E79 /* libNDIWrapper.a in Frameworks */,
64FCE6082988F5EB00089ADD /* libNDIWrapper.a in Frameworks */,
649A929C293A3C340033D6C3 /* libresolv.9.tbd in Frameworks */,
649A929A293A3C2A0033D6C3 /* libc++.tbd in Frameworks */,
);
Expand Down Expand Up @@ -111,7 +111,7 @@
children = (
649A929B293A3C330033D6C3 /* libresolv.9.tbd */,
649A9299293A3C2A0033D6C3 /* libc++.tbd */,
64EF18672988EA5700ED9E79 /* libNDIWrapper.a */,
64FCE6072988F5EA00089ADD /* libNDIWrapper.a */,
649A9286293A2E7C0033D6C3 /* HandTracker.framework */,
);
name = Frameworks;
Expand Down
Binary file not shown.
20 changes: 20 additions & 0 deletions NDIWrapper/NDIWrapper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
643841B02988E5550086CB7B /* NDIWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 643841AF2988E5550086CB7B /* NDIWrapper.m */; };
643841B12988E5550086CB7B /* NDIWrapper.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 643841AE2988E5550086CB7B /* NDIWrapper.h */; };
64FCE6062988F39400089ADD /* libndi_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64FCE6052988F39400089ADD /* libndi_ios.a */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -28,13 +29,15 @@
643841AB2988E5550086CB7B /* libNDIWrapper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNDIWrapper.a; sourceTree = BUILT_PRODUCTS_DIR; };
643841AE2988E5550086CB7B /* NDIWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NDIWrapper.h; sourceTree = "<group>"; };
643841AF2988E5550086CB7B /* NDIWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NDIWrapper.m; sourceTree = "<group>"; };
64FCE6052988F39400089ADD /* libndi_ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libndi_ios.a; path = "../../../../../../Library/NDI SDK for Apple/lib/iOS/libndi_ios.a"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
643841A82988E5550086CB7B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
64FCE6062988F39400089ADD /* libndi_ios.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -46,6 +49,7 @@
children = (
643841AD2988E5550086CB7B /* NDIWrapper */,
643841AC2988E5550086CB7B /* Products */,
64FCE6042988F39400089ADD /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -66,6 +70,14 @@
path = NDIWrapper;
sourceTree = "<group>";
};
64FCE6042988F39400089ADD /* Frameworks */ = {
isa = PBXGroup;
children = (
64FCE6052988F39400089ADD /* libndi_ios.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -246,6 +258,10 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 269JVN67JT;
HEADER_SEARCH_PATHS = NDIWrapper/wrapper/include;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LOCAL_LIBRARY_DIR)/NDI\\ SDK\\ for\\ Apple/lib/iOS",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -259,6 +275,10 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 269JVN67JT;
HEADER_SEARCH_PATHS = NDIWrapper/wrapper/include;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LOCAL_LIBRARY_DIR)/NDI\\ SDK\\ for\\ Apple/lib/iOS",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
Binary file not shown.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
layout: default
title: Home
nav_order: 1
---
# Swift Hands Tracking App with NDI for iOS

## description
<br>

![yuki](yuki.gif)

<p>Hand and Fingers detection by iOS using mediapipe.
Video and finger locations is sent via NDI.
finger locations are in NDI header infomation.</p>

<br>

## builds
1. build NDIWrapper
1. donwload [NDI® Software Developer Kit](https://www.ndi.tv/sdk/)<br><br>
![copy_to_include](copy_include.gif)
<br><br>
2. add **NDI SDK for Apple/lib/iOS/libndi_ios.a** to *Link Binary With Libraries* in *Build Phases*
<br><br>![add_library](linkBinary.png)<br><br>
3. build NDIWrapper for Any iOS Device ( make sure libNDIWrapper.a is made)

2. build and run HandTrackingApp
1. locate *libNDIWrapper.a* in HandTrackingApp/HandTrackingApp/frameworks
2. Run app on your device

## how to use

### *deta format*
Hand landmarks are sent in below xml format in NDI metadata.
```
<data><hand><landmark pos="0.60732925,0.58144265,3.1151734e-07"/><landmark pos="0.56505203,0.5484998,-0.026531346"/><landmark pos="0.53898305,0.48046944,-0.04208244"/><landmark pos="0.5248321,0.4197938,-0.05130074"/><landmark pos="0.5058341,0.3753905,-0.06021262"/><landmark pos="0.5713198,0.5101056,-0.06720933"/><landmark pos="0.5786612,0.43286845,-0.08973161"/><landmark pos="0.5812495,0.37290922,-0.09897546"/><landmark pos="0.5825366,0.32097232,-0.104899675"/><landmark pos="0.6041319,0.5113575,-0.06205117"/><landmark pos="0.61320466,0.4342699,-0.0859013"/><landmark pos="0.6148655,0.36760756,-0.09575798"/><landmark pos="0.61550075,0.31264222,-0.10418468"/><landmark pos="0.6300065,0.50398815,-0.05633123"/><landmark pos="0.64312637,0.4320633,-0.07859816"/><landmark pos="0.64444613,0.3698348,-0.08830163"/><landmark pos="0.6432977,0.31684417,-0.09494085"/><landmark pos="0.6491669,0.49379665,-0.05142842"/><landmark pos="0.67157316,0.4330202,-0.07058002"/><landmark pos="0.6806075,0.3894968,-0.08145813"/><landmark pos="0.6846357,0.34753588,-0.08993589"/></hand><hand><landmark pos="0.29522935,0.5531608,5.0964144e-07"/><landmark pos="0.33462214,0.52856797,-0.051297676"/><landmark pos="0.3543931,0.47887927,-0.08544916"/><landmark pos="0.36223465,0.4163285,-0.10823246"/><landmark pos="0.36018062,0.3578093,-0.12927766"/><landmark pos="0.2921996,0.5006597,-0.110017546"/><landmark pos="0.29103804,0.4231209,-0.14609502"/><landmark pos="0.2935743,0.36224845,-0.16357006"/><landmark pos="0.29744747,0.31039178,-0.17399871"/><landmark pos="0.26014832,0.49040753,-0.09522014"/><landmark pos="0.24517626,0.41736266,-0.13510267"/><landmark pos="0.24691854,0.34613279,-0.15370512"/><landmark pos="0.2501962,0.28764582,-0.1658249"/><landmark pos="0.24150153,0.4729464,-0.079436235"/><landmark pos="0.2206634,0.40784913,-0.11368167"/><landmark pos="0.22248489,0.34175086,-0.13125065"/><landmark pos="0.22528772,0.29054138,-0.14177324"/><landmark pos="0.23182774,0.45406643,-0.06571928"/><landmark pos="0.20536342,0.41055784,-0.09075743"/><landmark pos="0.19167638,0.37093514,-0.10560181"/><landmark pos="0.18038131,0.33602852,-0.11593651"/></hand></data>
```
<br>
Each landmarks are in this media pipe order.
![finger order](https://mediapipe.dev/images/mobile/hand_landmarks.png)

<br>

### *video loop back for debuging porpose*

when ViewController's USER_CAMERA is false, app load video.MOV instead of device camera.

```
let USE_CAMERA = false
```

<br>

## dependency
[forked mediapipe ](https://github.com/P-A-N/mediapipeForHandTrackerBuild) to make HandTracker.framework - ref [this](https://qiita.com/noppefoxwolf/items/99cb1da63c093f668d71)

<br>

## special thanks to
[noppefoxwolf](https://github.com/noppefoxwolf)<br>
[Dentsu Craft Tokyo](https://dentsucraft.tokyo)<br>
[Qosmo](https://qosmo.jp)<br>
[BigYuki](https://www.instagram.com/bigyuki/)
Binary file added copy_include.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added linkBinary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added yuki.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8c2cf0a

Please sign in to comment.