ScanDetector Class
class ScanDetector : ScanningSdkLibrary.Instance
A loaded detection model, used to work out which way up a page is.
Load one from the model file you ship, then hand it to ScanPicture.detectOrientation. Loading is the expensive part, so keep a detector alive across the pages of a scan rather than creating one per page.
Holds the loaded model in native memory. Call close — or use Kotlin’s use { } — when done to release it immediately; an unclosed instance is only reclaimed when garbage collection happens to run. Confine an instance to one thread, as with every SDK native handle.
See also
Constructors
ScanDetector
constructor(storage: File)
Loads a detection model from disk.
Functions
close
@Synchronized open override fun close()
Releases the native memory held by this instance immediately instead of waiting for the garbage collector.