Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PIL import Image
- from pydmtx import DataMatrix
- if __name__ == '__main__':
- dmtx_image = Image.open(sys.argv[1])
- (width, height) = dmtx_image.size
- dm_read = DataMatrix()
- dmtx_code = dm_read.decode (width, height, buffer(dmtx_image.tostring()))
- if dmtx_code is not None:
- print "Found Datamatrix code '%s' in %s" % (dmtx_code, sys.argv[1])
- else:
- print "No Datamatrix code found in %s" % (sys.argv[1])
Add Comment
Please, Sign In to add comment