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.2k
CameraX
CameraX
Moyuru Aizawa
May 21, 2019
Tweet
Share
More Decks by Moyuru Aizawa
See All by Moyuru Aizawa
graphicsLayer
lvla
0
150
BluetoothDevice.getName()に裏切られた話
lvla
0
210
Jetpack Composeで画像クロップ機能を実装する
lvla
0
870
Jetpack Compose drag gesture and pinch gesture
lvla
1
2.9k
Jetpack Compose Layout API
lvla
1
580
BLEを使ったアプリを継続的に開発するために
lvla
0
870
RecyclerView.ItemAnimator
lvla
1
280
RecycledViewPool
lvla
1
150
Hack RecyclerView.ItemDecoration
lvla
5
570
Other Decks in Programming
See All in Programming
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
410
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
130
XStateでReactに秩序を与えたい
gizm000
0
710
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
500
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
190
dotfiles について話したい #湘なんか
stefafafan
2
300
Understand the mechanism! Let's do screenshots tests of Compose Previews with various variations / 仕組みから理解する!Composeプレビューを様々なバリエーションでスクリーンショットテストしよう
sumio
3
480
1人で挑むSwiftコンパイラ 〜型システム入門編〜
s_shimotori
0
340
LangChainの現在とv0.3にむけて
os1ma
4
840
New Order in Cascade Sorting Order
mugi_uno
3
2.6k
ブラウザ互換の重要性 - あらゆるユーザーに価値を届けるために必要なこと
yamanoku
0
110
Swiftコードバトル必勝法
toshi0383
0
150
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
242
11k
Typedesign – Prime Four
hannesfritz
39
2.3k
Statistics for Hackers
jakevdp
793
220k
How GitHub (no longer) Works
holman
310
140k
Build your cross-platform service in a week with App Engine
jlugia
228
18k
Building a Scalable Design System with Sketch
lauravandoore
458
32k
The Cost Of JavaScript in 2023
addyosmani
42
5.2k
Ruby is Unlike a Banana
tanoku
96
11k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
How to name files
jennybc
75
98k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
36
6.8k
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