Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ココがダメだよWebCamTexture
Search
Masaya Yashiro
June 21, 2017
Technology
0
77
ココがダメだよWebCamTexture
イケてないと悪評高いUnityのWebCamTextureを使ってみたので、ダメな部分を紹介します。
Masaya Yashiro
June 21, 2017
Tweet
Share
More Decks by Masaya Yashiro
See All by Masaya Yashiro
拡大期を迎えたプロダクトに起きたこと - Android編
yashims
0
470
How useful Kotlin/Native in Kotlin 1.3
yashims
0
400
UX design trend 2019
yashims
5
1.5k
Kotlin/MPP getting started and troubles
yashims
0
3.8k
C# code refactoring with Scope Functions
yashims
0
2.8k
Introduction of MaterialDesign for engineer
yashims
0
91
Other Decks in Technology
See All in Technology
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
TypeScript、上達の瞬間
sadnessojisan
46
13k
いざ、BSC討伐の旅
nikinusu
2
780
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
190
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
380
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
SSMRunbook作成の勘所_20241120
koichiotomo
2
140
強いチームと開発生産性
onk
PRO
34
11k
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
270
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Faster Mobile Websites
deanohume
305
30k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Practical Orchestrator
shlominoach
186
10k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Visualization
eitanlees
145
15k
Ruby is Unlike a Banana
tanoku
97
11k
The World Runs on Bad Software
bkeepers
PRO
65
11k
We Have a Design System, Now What?
morganepeng
50
7.2k
Transcript
ίί͕μϝͩΑ WebCamTexture @yashims85
ήʔϜҎ֎ͰUnity
ήʔϜҎ֎ͰUnity "OESPJEJ04྆ରԠ 6*ΤσΟλ σόΠεػೳ
ͳΜ͔ͩΜͩ ήʔϜҎ֎࡞Γ͍͢
ΧϝϥΞϓϦ
WebCamTextureͱ
WebCamTexture • Unityඪ४ͷσόΠεΧϝϥAPI • Χϝϥͷө૾͕Ϩϯμʔ͞ΕΔTextureͷࢠΫϥε • Android/iOS/Editor্Ͱͳ͘ಈ͘ • ྑ͍ᷚฉ͔ͳ͍ •
ΧϝϥΞηοτങ͏ʹͯ͠ɺҰWebCamTexture ͬͯΈͳ͍ͱͲ͏͍͏ͷ͕ཉ͍͔͔͠Βͳ͍
͍ํ private struct Fhd { public const int Width =
1920; public const int Height = 1080; } private int Fps = 30; private WebCamTexture WebCam { get; set; } void Start() { WebCam = new WebCamTexture( WebCamTexture.devices[0].name, Fhd.Width, Fhd.Height, Fps ); WebCam.Play(); } private void OnDestroy() { WebCam.Stop(); Destroy(WebCam); }
؆୯ͩʔ
ͳΜ͔ΊͬͪΌॏ͍ (ϊʔϚϧͷΧϝϥΞϓϦͱൺͯ)
ͳΜ͔ΊͬͪΌॏ͍ private struct Fhd { public const int Width =
1920; public const int Height = 1080; } private int Fps = 8; private WebCamTexture WebCam { get; set; } void Start() { WebCam = new WebCamTexture( WebCamTexture.devices[0].name, Fhd.Width, Fhd.Height, Fps ); WebCam.Play(); }
·ͩʹΑͬͯॏ͍
·ͩʹΑͬͯॏ͍ private struct Hd { public const int Width =
1280; public const int Height = 720; } private int Fps = 8; private WebCamTexture WebCam { get; set; } void Start() { WebCam = new WebCamTexture( WebCamTexture.devices[0].name, Hd.Width, Hd.Height, Fps ); WebCam.Play(); }
ͳΜ͔Portraitͷ࣌ө૾͕ߥ͍
ͳΜ͔Portraitͷ࣌ө૾͕ߥ͍ private struct Hd { public const int Width =
720; public const int Height = 1280; } private int Fps = 8; private WebCamTexture WebCam { get; set; } void Start() { WebCam = new WebCamTexture( WebCamTexture.devices[0].name, Hd.Width, Hd.Height, Fps ); WebCam.Play(); }
औಘग़དྷΔΞεൺ͕ มΘΒͳ͍ΜͰ͕͢
มΘΒͳ͍Ξεൺ ཉ͍͠Ξεൺ ฦͬͯ͘Δө૾ͷΞεൺ Y ԣ')% Y ԣ')% Y ॎ')% Y
ԣ')% Y ')%ล Y ԣ')% Y )%ล Y ԣ)%
LandscapeͰ͔͠ը૾͕औΕ ͳ͍ͷͰCenterCrop͢Δ͠ ͔ͳ͍
LandscapeͰ͔͠ը૾͕औΕ ͳ͍ͷͰCenterCrop͢Δ͠ ͔ͳ͍
࠷ऴతͳPortraitͷղ૾ • VGA: 640x480 QY QY ࢀߟ
WebCamTextureΫι͞·ͱΊ • VGAҎԼΛ֮ޛ • 15FPS(ྲྀੴʹϠόΠͷͰεϖແࢹ͠ ͯͪΐͬͱͨ͠) • ి৯͏
ͦ͏ͩ AssetΛങ͓͏
NatCamΛങͬͨ • https://www.assetstore.unity3d.com/jp/#!/content/52154 • ͑ͯͳ͍͚Ͳɺ৭ʑߴػೳ • iOS/AndroidରԠ • FaceTrackingͰ͖Δ •
Texture2Dͷอଘαϙʔτ • MovieՄ
݁ՌɺͲ͏͔ͩͬͨ
Ͱ͖ͨ • FPS্͕ • ߴղ૾Ͱॏ͘ͳΒͳ͍ • ফඅిྗݮ
Ͱ͖ͳ͔ͬͨ • औಘղ૾ࢦఆ • 16:9ղ૾͔͠ϓϦηοτͰ༻ҙ͞Εͯͳ ͍ • มߋग़དྷΔ͔ະݕূ
͋Δఔͷ࣭UP
·ͱΊ WebCamTextureΛϞόΠϧͰ͏߹ɺੑ ೳ໘ͰͭΒΈ͕͋Δɻ ͓·͚Ͱ͏ͳΒྑ͍͕ɺओཁػೳͷ߹ AssetΛೖΕͨ΄͏͕ྑ͍ɻ