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
80
ココがダメだよWebCamTexture
イケてないと悪評高いUnityのWebCamTextureを使ってみたので、ダメな部分を紹介します。
Masaya Yashiro
June 21, 2017
Tweet
Share
More Decks by Masaya Yashiro
See All by Masaya Yashiro
拡大期を迎えたプロダクトに起きたこと - Android編
yashims
0
480
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
Kubernetes環境のオブザーバビリティの次の一歩をOpenTelemetryで実現すると何がどうなるの? - CloudNative Days Winter 2024
katzchang
0
120
IVRyエンジニア忘年LT大会2024 クリティカルユーザージャーニーの整理
abnoumaru
0
140
大規模サーバ移行を成功に導くための事前調査フェーズの工夫事例
fukuchiiinu
2
120
re:Inventで発表された Bedrockの新機能を色々使って、マルチRAGエージェントにクラウド選定させてみた件
minorun365
PRO
4
280
2000年てづくりキーボードの旅
tagomoris
1
170
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
1
110
Ruby on Browser - RubyWorld Conference 2024
tmtms
1
130
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
2
1.2k
AWS re:Invent 2024 re:Cap CloudFront編
yoshimi0227
0
230
My Generation 年配者がこの先生きのこるには (Developers CAREER Boost 2024 Edition)/My Generation How elder engineers can survive
kwappa
3
390
新機能Amazon GuardDuty Extended Threat Detectionはネ申って話
cmusudakeisuke
0
350
最近のUplift Modeling手法にRでトライ
hskksk
0
230
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.8k
Embracing the Ebb and Flow
colly
84
4.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Designing Experiences People Love
moore
138
23k
Producing Creativity
orderedlist
PRO
341
39k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Designing for humans not robots
tammielis
250
25k
Scaling GitHub
holman
458
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
160
Code Review Best Practice
trishagee
65
17k
Gamification - CAS2011
davidbonilla
80
5.1k
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ΛೖΕͨ΄͏͕ྑ͍ɻ