Scan ISBN from book cover with Pyzbar and OpenCV

205 Views Asked by At

Hello I'm having issues while parsing image using Python an CV2 + Pyzbar

Example image

While using other code I'm able to target the codebar within the image, however when parsing the image with the code below is not able to recognize

import cv2
import pyzbar.pyzbar as pyzbar
from pyzbar.wrapper import ZBarSymbol

img_file = 'Cover.jpg'
img = cv2.imread(img_file)

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
barcodes = pyzbar.decode(gray, [ZBarSymbol.EAN13])

for barcode in barcodes:
    print('{}: {}'.format(barcode.type, barcode.data))

Basically I've a bunch of covers that I need to scan but cropping the resolution seems is not good enough for him to recognize them

0

There are 0 best solutions below