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
86
ココがダメだよWebCamTexture
イケてないと悪評高いUnityのWebCamTextureを使ってみたので、ダメな部分を紹介します。
Masaya Yashiro
June 21, 2017
Tweet
Share
More Decks by Masaya Yashiro
See All by Masaya Yashiro
拡大期を迎えたプロダクトに起きたこと - Android編
yashims
0
490
How useful Kotlin/Native in Kotlin 1.3
yashims
0
410
UX design trend 2019
yashims
5
1.5k
Kotlin/MPP getting started and troubles
yashims
0
3.9k
C# code refactoring with Scope Functions
yashims
0
2.8k
Introduction of MaterialDesign for engineer
yashims
0
94
Other Decks in Technology
See All in Technology
panicを深ぼってみる
kworkdev
PRO
2
150
Amazon Aurora バージョンアップについて、改めて理解する ~バージョンアップ手法と文字コードへの影響~
smt7174
1
250
CloudWatch Container Insightsを使ったAmazon ECSのリソース監視
umekou
1
120
生成AIを活用した機能を、顧客に提供するまでに乗り越えた『4つの壁』
toshiblues
1
210
AWSエンジニアに捧ぐLangChainの歩き方
tsukuboshi
0
220
ハンズオンで学ぶ Databricks - Databricksにおけるデータエンジニアリング
taka_aki
1
2.1k
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
10
120k
Japan AWS Jr. Championsがお届けするre:Invent2024のハイライト ~ラスベガスで見てきた景色~
fukuchiiinu
0
1.1k
ソフトウェア開発現代史:製造業とソフトウェアは本当に共存できていたのか?品質とスピードを問い直す
takabow
15
5.3k
地方企業がクラウドを活用するヒント
miu_crescent
PRO
1
110
例外処理を理解して、設計段階からエラーを「見つけやすく」「起こりにくく」する
kajitack
12
3.8k
[JAWS-UG栃木]地方だからできたクラウドネイティブ事例大公開! / jawsug_tochigi_tachibana
biatunky
0
130
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
520
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Writing Fast Ruby
sferik
628
61k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
270
Six Lessons from altMBA
skipperchong
27
3.6k
BBQ
matthewcrist
85
9.4k
How GitHub (no longer) Works
holman
312
140k
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ΛೖΕͨ΄͏͕ྑ͍ɻ