scanCodes
Synchronously detects Barcodes in the given frame.
All coordinates in the Barcode are relative to the Frame's coordinate system.
You can convert Barcode coordinates to Camera coordinates using Frame.convertFramePointToCameraPoint, and then convert the Camera coordinates to Preview View coordinates using the preview view's convertCameraPointToViewPoint.
val barcodes = scanner.scanCodes(frame)
for (barcode in barcodes) {
println("Barcode value: ${barcode.rawValue}")
for (point in barcode.cornerPoints) {
val cameraPoint = frame.convertFramePointToCameraPoint(point)
val previewPoint = previewView.convertCameraPointToViewPoint(cameraPoint)
println("Corner Point: $previewPoint")
}
}Content copied to clipboard