-
-
Save DUMA042/009b758ec5bbfaf44eb0420531e860cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cameraController.setImageAnalysisAnalyzer( | |
ContextCompat.getMainExecutor(ctx), // Use the main thread for analysis | |
MlKitAnalyzer( | |
listOf(barcodeScanner), // Pass the barcode scanner | |
ImageAnalysis.COORDINATE_SYSTEM_VIEW_REFERENCED, // Use view-referenced coordinates | |
ContextCompat.getMainExecutor(ctx) // Use the main thread for results | |
) { result: MlKitAnalyzer.Result? -> | |
// Process the barcode scanning results | |
val barcodeResults = result?.getValue(barcodeScanner) | |
if (!barcodeResults.isNullOrEmpty()) { | |
// Handle detected barcodes | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment