Hi,
Are you looking for the same FOV on Preview & ImageCapture?
You have a try on the ViewPort feature to produce the same crop rect in a WYSIWYG.
While using the CameraXBasic sample code, you can replace the bindToLifeCycle with
/////////////////////////////////////
val viewPort: ViewPort = ViewPort.Builder(
Rational(
viewFinder.width,
viewFinder.height
),
viewFinder.display.rotation
).setScaleType(ViewPort.FILL_CENTER).build()
val useCaseGroupBuilder: UseCaseGroup.Builder = UseCaseGroup.Builder().setViewPort(
viewPort
)
useCaseGroupBuilder.addUseCase(preview!!)
useCaseGroupBuilder.addUseCase(imageCapture!!)
useCaseGroupBuilder.addUseCase(imageAnalyzer!!)
camera = cameraProvider.bindToLifecycle(
this, cameraSelector,
useCaseGroupBuilder.build()
)
/////////////////////////////////////
If you are focusing on the output resolution, you can try to use setTargetResolution() on use cases to limit the resolution of the output size.