MCPcopy Create free account
hub / github.com/devilsen/CZXing / QR_Extractor

Class QR_Extractor

python/QR_Extractor.py:8–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class QR_Extractor:
9 # Src: github.com/lessthanoptimal/PyBoof/blob/master/examples/qrcode_detect.py
10 def __init__(self):
11 self.detector = pb.FactoryFiducial(np.uint8).qrcode()
12
13 def extract(self, img_path):
14 if not os.path.isfile(img_path):
15 print('File not found:', img_path)
16 return None
17 image = pb.load_single_band(img_path, np.uint8)
18 self.detector.detect(image)
19 qr_codes = []
20 for qr in self.detector.detections:
21 qr_codes.append({
22 'text': qr.message,
23 'points': qr.bounds.convert_tuple()
24 })
25 return qr_codes

Callers 2

__init__Method · 0.90
decode_qr_odeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected