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 :: how to print random in python 
Python :: python if in list 
Python :: list count python 
Python :: python numpy how to empty array cycle 
Python :: zip() python 
Python :: argparse type 
Python :: How to Loop Through Tuples using for loop in python 
Python :: split strings around given separator/delimiter 
Python :: python index for all matches 
Python :: django login required as admin 
Python :: quicksort algorithm in python 
Python :: Print statement with multiple variables 
Python :: run python module from command line 
Python :: hexdigest python 
Python :: atoi in python code 
Python :: django make new application folder 
Python :: python append value to column 
Python :: how to loop through an array in python 
Python :: How to find the maximum subarray sum in python? 
Python :: django get admin url 
Python :: flask form options 
Python :: simple python program for beginners 
Python :: comentar codigo en python 
Python :: append element to list py 
Python :: e in python 
Python :: google youtuve api 
Python :: how to get the length of a string in python stack overflow 
Python :: index in python 
Python :: input() function in python 
Python :: python int to ascii string 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =