If your issue is related to observed behavior, rather than API usage, please include information about the specific device (even if the device is an emulator).
Questions tagged [android-camerax]
807 questions
7
votes
1 answer
Jetpack's Camerax - is there functionality for taking burst of images, or saving DNG file?
I have read tutorial for camerax(https://developer.android.com/training/camerax), and also some documentation(https://developer.android.com/reference/androidx/camera/core/ImageCapture). But I didn't found part responsible for taking burst of images,…

404pio
- 1,080
- 1
- 12
- 32
7
votes
2 answers
java.lang.IllegalStateException: CameraX not initialized yet
Im following this Google Codelab about CameraX
And when I get to the part of adding a Camera preview, I do it like this:
val previewConfig = PreviewConfig.Builder().apply {
setTargetAspectRatio(Rational(1, 1))
…

Alfredo Bejarano
- 548
- 1
- 8
- 22
7
votes
1 answer
Does the new CameraX api provide multi-camera support for processing dual camera streams separately?
I want to build an application for taking photos with both cameras of a dual cam at the same time and wanted to ask if someone knows if the new camerax api allows me to process both camera streams separately.

lukger
- 404
- 3
- 11
6
votes
2 answers
camerax sample: Unresolved reference: WindowManager
I'm trying to compile the sample cameraxbasic but I get this error:
Unresolved reference: WindowManager
I checked gradle files and there is that dependency.

Marco Piccirilli
- 61
- 2
6
votes
1 answer
Android CameraX How to implement Wide Angle / Zoom Out
I tried to implement wide angle option for my in-app camera using CameraX api but ran into an issue - CameraControl.setZoomRatio allows to set zoom between ZoomState.getMinZoomRatio() and ZoomState.getMaxZoomRatio(), where on phones I tested it…

xinaiz
- 7,744
- 6
- 34
- 78
6
votes
1 answer
ImageAnalyzer ML Kit bounding box mislined
I've got a simple layout:

Jenej Fjrjdn
- 337
- 2
- 13
6
votes
1 answer
Java: How to draw on CameraX previewView?
Can anybody show me how to draw a rectangle over cameraX preview? I tried implementing a custom view as suggested by past stack overflow answers that were written in kotlin but it does not seemed to be working for me when I attempted to convert it…

Howden
- 61
- 1
- 3
6
votes
0 answers
Setting target resolution on ImageCapture.Builder is not working on some Huawei devices
Let's say we want to capture only portrait (not landscape) photos with the target resolution of 1200x1600 pixels.
According to the documentation of setTargetResolution method in ImageCapture.Builder:
The resolution should be expressed at the use…

Nominalista
- 4,632
- 11
- 43
- 102
6
votes
1 answer
Android CameraX - dynamically attach ImageAnalysis.Analyzer
I have implemented my own subclass of ImageAnalysis.Analyzer and it works as expected. Now I want to "attach/detach" this analyzer to the ImageAnalysis class dynamically (based on some user actions). From the ImageAnalysis API it looks like it is…

Billda
- 5,707
- 2
- 25
- 44
6
votes
1 answer
Why does zoomRatio display the error Unresolved reference when I use camerax "1.0.0-alpha06"?
I have read the artical. https://proandroiddev.com/android-camerax-tap-to-focus-pinch-to-zoom-zoom-slider-eb88f3aa6fc6
I add Code A to the office camerx sample. https://github.com/android/camera-samples/tree/master/CameraXBasic
The sample code use…

HelloCW
- 843
- 22
- 125
- 310
6
votes
3 answers
How do we detect the Orientation of Image captured using CameraX if Application's default orientation is set to Portrait Mode
Basically, My camera app is set to Portrait Mode. However, user can take photos in Potrait or landscape by rotating the phone accordingly (The app doesnt rotate).
So my question is, how can we find the captured image orientation?
I tried using…

arungiri_10
- 988
- 1
- 11
- 23
6
votes
2 answers
Compile error while setting imageAnalysis.setAnalyzer()
I'm creating a tool to capture every frame from preview using cameraX (for face recognition purpose)
I found that using ImageAnalysis was the way to go.
Until I tried using the code as recommended :
val imageAnalysisConfig =…

Sebastien Ferrand
- 93
- 1
- 6
6
votes
1 answer
How to use ZXing with android CameraX to decode Barcode and QR Codes
How can I integrate ZXing library in order to use it with new Android Jetpack CameraX?
I know that I've to build an ImageAnalyzer and inside it I've to use ZXing to decode QR Codes and Barcodes

shadowsheep
- 14,048
- 3
- 67
- 77
6
votes
3 answers
Android CameraX Analyzer Image with format YUV_420_888 to OpenCV Mat
With Android CameraX Analyzer ImageProxy uses ImageReader under the hood with a default YUV_420_888 image format.
I'd like to convert it in OpenCV Mat in order to use OpenCV inside my analyzer:
override fun analyze(imageProxy: ImageProxy,…

shadowsheep
- 14,048
- 3
- 67
- 77
6
votes
2 answers
Get CameraX final resolution
Just created a camera preview in Android with CameraX with the following configuration:
PreviewConfig previewConfig = new PreviewConfig.Builder()
.setLensFacing(CameraX.LensFacing.FRONT)
.setTargetResolution(new Size(720,…

Fran Marzoa
- 4,293
- 1
- 37
- 53