Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

qr code scanner

    import cv2
    decoder = cv2.QRCodeDetector()
    data, points, _ = decoder.detectAndDecode(img) # size 250 * 250 np.array
    qr_code = data
    print('Decoded data: ' + data)
    if points is not None:
        print('Decoded data: ' + data)
    
        points = points[0]
        for i in range(len(points)):
            pt1 = [int(val) for val in points[i]]
            pt2 = [int(val) for val in points[(i + 1) % 4]]
            cv2.line(img, pt1, pt2, color=(255, 0, 0), thickness=3)
    
        cv2.imshow('Detected QR code', img)
Comment

PREVIOUS NEXT
Code Example
Python :: topological sort 
Python :: How to delete a file or folder in Python? 
Python :: convert hex rgb to matplotlib color 
Python :: python strip() 
Python :: django prevent duplicate entries 
Python :: Accessing Elements from Dictionary 
Python :: model checkpoint 
Python :: cv2 assertion failed 
Python :: plot scattered dataframe 
Python :: numpy argsort 
Python :: server in python 
Python :: add vertical line in plot python 
Python :: install pyimagesearch python3 
Python :: python foreach 2d array 
Python :: negative slicing in python 
Python :: matplotlib multiple bar plot 
Python :: how to split a string by colon in python 
Python :: request foucus tkinter widget 
Python :: loading bar in python 
Python :: python list comprehensions 
Python :: convert a list to tuple 
Python :: python list comprehension with filter 
Python :: torch.utils.data.random_split(dataset, lengths) 
Python :: slack notification pytthon 
Python :: Sort index values with pandas 
Python :: python repr() 
Python :: js choice function 
Python :: sparse matrix multiplication in python 
Python :: python merge list no duplicates 
Python :: python linkedin api 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =