well, sure, but maybe everything would work better if adam weren't such an idiot
parent
8f47a041a4
commit
3abb62ee78
|
@ -21,10 +21,13 @@ def parse(code):
|
|||
def _qr_helper(im):
|
||||
best = None
|
||||
for scale in [1, 3 / 4, 2 / 3, 0.5, 1 / 3, 1 / 4]:
|
||||
scaledim = (
|
||||
im.resize((int(im.width * scale), int(im.height * scale)))
|
||||
if scale != 1
|
||||
else im
|
||||
)
|
||||
for sharpness in [1, 1.25, 0.75, 1.5, 0.5, 1.75, 0.25, 2, 0]:
|
||||
newim = ImageEnhance.Sharpness(
|
||||
im.resize((int(im.width * scale), int(im.height * scale)))
|
||||
).enhance(sharpness)
|
||||
newim = ImageEnhance.Sharpness(scaledim).enhance(sharpness)
|
||||
qrinfo = pyzbar.decode(newim)
|
||||
|
||||
if len(qrinfo) == 2:
|
||||
|
|
Loading…
Reference in New Issue