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
昭和の職場からアジャイルの世界へ
kumagoro95
1
380
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
110
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
120
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
390
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
110
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
140
Writing documentation can be fun with plugin system
okuramasafumi
0
120
CI改善もDatadogとともに
taumu
0
120
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
320
仕様変更に耐えるための"今の"DRY原則を考える / Rethinking the "Don't repeat yourself" for resilience to specification changes
mkmk884
0
200
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
37
14k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Producing Creativity
orderedlist
PRO
344
39k
Automating Front-end Workflow
addyosmani
1368
200k
Fireside Chat
paigeccino
34
3.2k
GraphQLとの向き合い方2022年版
quramy
44
13k
Typedesign – Prime Four
hannesfritz
40
2.5k
GitHub's CSS Performance
jonrohan
1030
460k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
Building Applications with DynamoDB
mza
93
6.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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