Created
August 21, 2016 08:52
-
-
Save Lukse/2d3dc8e6698ac5a6c4a12769ef6f2348 to your computer and use it in GitHub Desktop.
Generate QRcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qrcode | |
import cv2 | |
import numpy | |
import PIL as Image | |
qr = qrcode.QRCode( | |
version=1, | |
error_correction=qrcode.constants.ERROR_CORRECT_M, # 15 | |
box_size=20, | |
border=1, | |
) | |
qr.add_data('http://www.kurokesu.com') | |
qr.make(fit=True) | |
img = qr.make_image() | |
imcv = numpy.asarray(img.convert('L')) | |
cv2.imshow("im", imcv) | |
cv2.imwrite("code_qr.png", imcv) | |
cv2.waitKey(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment