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
CameraX
Search
Moyuru Aizawa
May 21, 2019
Programming
2
2.3k
CameraX
CameraX
Moyuru Aizawa
May 21, 2019
Tweet
Share
More Decks by Moyuru Aizawa
See All by Moyuru Aizawa
BLUETOOTH_SCAN and iBeacon
lvla
1
56
graphicsLayer
lvla
0
180
BluetoothDevice.getName()に裏切られた話
lvla
0
290
Jetpack Composeで画像クロップ機能を実装する
lvla
0
1k
Jetpack Compose drag gesture and pinch gesture
lvla
1
3.4k
Jetpack Compose Layout API
lvla
1
620
BLEを使ったアプリを継続的に開発するために
lvla
0
950
RecyclerView.ItemAnimator
lvla
1
290
RecycledViewPool
lvla
1
180
Other Decks in Programming
See All in Programming
ARA Ansible for the teams
kksat
0
150
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
Honoとフロントエンドの 型安全性について
yodaka
7
1.1k
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
740
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
550
color-scheme: light dark; を完全に理解する
uhyo
3
280
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
Immutable ActiveRecord
megane42
0
140
チームリードになって変わったこと
isaka1022
0
200
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.2k
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
220
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Writing Fast Ruby
sferik
628
61k
KATA
mclloyd
29
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Adopting Sorbet at Scale
ufuk
74
9.2k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Transcript
CameraX
MoyuruAizawa Moyuru Aizawa A Software House Pairs Div. Eureka Inc.
FRESH LIVE Div CyberAgent Inc. CATS Div. CyberAgent Inc. https://moyuru.io https://cinematic.fm
CameraX uses Camera2 API
API 21+
Consistent across devices
‣Automated CameraX test lab ‣Google tests hundreds of devices across
all OS layers. ‣Tests run 24 hours a day, seven days a week.
‣This test suite is open sourced. ‣You can benchmark …
‣Photo capture latency ‣Startup/shutdown latency ‣…
Easy to use
‣Provide a use case based API ‣Displays up on screen
‣Gives high quality frames to analyze ‣Takes a picture or a video ‣Lifecycle aware
‣Reduced device specific testing ‣75% reduction in lines of code
‣Easier to read code ‣Smaller apk size In case of Camera360 https://play.google.com/store/apps/details?id=vStudio.Android.Camera360
val previewConfig = PreviewConfig.Builder().build() val preview = Preview(previewConfig) preview.setOnPreviewOutputUpdateListener {
output -> textureView.surfaceTexture = output.surfaceTexture } CameraX.bindToLifecycle(this as LifecycleOwner, preview)
val imageAnalysisConfig = ImageAnalysisConfig.Builder() .setTargetResolution(Size(1280, 720)) .build val imageAnalysis =
ImageAnalysis(imageAnalysisConfig) imageAnalysis.setAnalyzer { image, rotationDegrees -> // analyze } CameraX.bindToLifecycle(this as LifecycleOwner, imageAnalysis, preview)
val imageCaptureConfig = ImageCaptureConfig.Builder() .setTargetRotation(windowManager.defaultDisplay.rotation) .build() val imageCapture = ImageCapture(imageCaptureConfig)
CameraX.bindToLifecycle(this as LifecycleOwner, imageCapture, imageAnalysis, preview)
val file = File(...) imageCapture.takePicture(file, object: ImageCapture.OnImageSavedListener { override fun
onError( error: ImageCapture.UseCaseError, message: String, e: Throwable?) { } override fun onImageSaved(file: File) { } } )
CameraX Extensions
Portrait
Portrait Night
Portrait Night HDR
Portrait Night HDR Beauty
None
Thank you https://www.youtube.com/watch?v=kuv8uK-5CLY