We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoded_data = encode('A', size='10x10') print(encoded_data.width) print(encoded_data.height)
Returns
70 70
While I have set it to be 10x10.
The text was updated successfully, but these errors were encountered:
The width and height of the resulting image is 70x70 pixels.
The datamatrix itself is 10x10 cells.
The border around the encoded datamatrix is 10 pixels, so 20 in total. That leaves us with 50 pixels, 5 pixels per cell.
If you want to somehow modify this you can cut off the border and resize as needed.
from PIL import Image import numpy as np import cv2 img = Image.frombytes('RGB', (encoded_data.width, encoded_data.height), encoded_data.pixels) img_cv2 = np.array(img) resized = cv2.resize(img_cv2 , (14,14), interpolation = cv2.INTER_CUBIC) resized = cv2.resize(img_cv2 , (14,14), interpolation = cv2.INTER_CUBIC)
Result:
Sorry, something went wrong.
No branches or pull requests
Returns
While I have set it to be 10x10.
The text was updated successfully, but these errors were encountered: