(self, img_path)
| 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 |
no test coverage detected