CameraObjectOutput

The CameraObjectOutput scans objects (codes, faces, bodies…) with the platform's built-in detectors. iOS only: on Android, use the barcode module (ML Kit) on a CameraFrameOutput instead.

val objectOutput = VisionCamera.createObjectOutput(ObjectOutputOptions(listOf(ScannedObjectType.QR)))
objectOutput.setOnObjectsScannedCallback { objects ->
objects.filterIsInstance<ScannedCode>().forEach { println(it.value) }
}

See also

Properties

Link copied to clipboard
abstract val currentResolution: Size?

The resolution this output is currently streaming at, or null if it is not connected yet.

Link copied to clipboard
abstract val mediaType: MediaType

The MediaType of this output.

Link copied to clipboard

The orientation of the content produced by this output.

Functions

Link copied to clipboard
open override fun close()

Same as dispose, to use a CameraOutput with use { }.

Link copied to clipboard
abstract fun dispose()

Eagerly disposes the native resources this output holds (its threads, analyzers, delegates, sounds...), like VisionCamera's HybridObject.dispose().

Link copied to clipboard
abstract fun setOnObjectsScannedCallback(onObjectsScanned: (objects: List<ScannedObject>) -> Unit?)

Sets the callback called with the objects scanned in each frame, or removes it with null.