BarCodeScanner Class¶
Header: #include "easyar/barcode.hpp"
Inherits: RefBase
Description¶
BarCodeScanner is used for barcode recognition.
Currently only QR code is enabled. You need to call attachCamera to attach a CameraDevice to BarCodeScanner first, then the images from the CameraDevice are used for the recognition. You can call start/stop to enable/disable the scan process. start and stop are very lightweight calls.
You can get a Frame by Augmenter::newFrame which contains current camera image and recognized code string.
Public Functions¶
BarCodeScanner()¶
Creates a BarCodeScanner object.
virtual ~BarCodeScanner()¶
Destroys the BarCodeScanner object.
virtual bool attachCamera(const CameraDevice& obj)¶
Attach CameraDevice to the BarCodeScanner. BarCodeScanner will not scan until a CameraDevice is attached.
virtual bool detachCamera(const CameraDevice& obj)¶
Detach CameraDevice from the BarCodeScanner. After detach, the BarCodeScanner will not accept images from the CameraDevice anymore and the scan will stop if no CameraDevice is attached.
virtual bool start()¶
Starts the scan. The scan will not actually start until a CameraDevice is attached.
virtual bool stop()¶
Stops the scan. Call start to start the scan again.