A BN code (an initialism for Boon code) is a type of data storage as an image that design for low resolution work with low data quality. in this version it can be store 32 bit or 4 bytes that can store number from 0 upto 4,294,967,295
BN code is detected by a 2-dimensuinal digital image sensor and program.
Normal QRcode |
BNcode version 1, 8x8 pixel |
Input Mode | Max. Capacity |
---|---|
Numeric | 0 - 4,294,967,295 |
Character | 4 characters (8 bit per char) |
The format information records two things: bit data and ref bit. bit data is your data and bit ref is bit that the scanner will compare with the bit data.
border section |
data section |
mirror blocking |
color black and white refer to 0,1 in binary the decoder will read color on image from top-down,left to right
why mirror blocking is important because BNcode store binary directly to image the flipped image with cause a worng data reading
read the encoding section ---
pip install bncode
Read and write
from bncode import create, scan
import cv2
cv2.imwrite("bncode.png",create(123456)) # create image
print(scan(cv2.imread('bncode.png'))) # scan image
Scan from camera
from bncode import create, scan
import cv2
cam = cv2.VideoCapture(0)
while True:
c,img = cam.read() # read image from camera
print(scan(img)) # scan image
cv2.waitKey(1)