Skip to content

Instantly share code, notes, and snippets.

@pengj
Created March 30, 2021 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pengj/00b9c29f67b10086ab773cea4e8d346d to your computer and use it in GitHub Desktop.
Save pengj/00b9c29f67b10086ab773cea4e8d346d to your computer and use it in GitHub Desktop.
Image Analysis setup in CameraX
val imageAnalysis = ImageAnalysis.Builder()
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
.build()
.apply {
setAnalyzer(executor,analyzer)
}
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
imageAnalysis,
preview
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment