METHOD AND SYSTEM FOR DECODING TWO-DIMENSIONAL CODE USING WEIGHTED AVERAGE GRAY-SCALE ALGORITHM
First Claim
1. A method for decoding two-dimensional code using weighted average gray-scale algorithm, characterized by comprising:
- segmenting a received two-dimensional code image into bit regions each containing one bit data;
presetting a shifting threshold, and shifting four original boundary lines of the bit region outwards by a distance of the shifting threshold to obtain four preset boundary lines;
calculating an average gray-scale value of the bit region using the weighted average algorithm by taking an overlapping area between pixels inside the four preset boundary lines and the bit region as a weight;
binarizing the two-dimensional code image according to the average gray-scale value of the bit region; and
decoding the binarized two-dimensional code image.
3 Assignments
0 Petitions
Accused Products
Abstract
The invention provides a method and system for decoding two-dimensional code using weighted average gray-scale algorithm. The method comprises: segmenting a received two-dimensional code image into bit regions each containing one bit data; presetting a shifting threshold, and shifting four original boundary lines of the bit region outwards by a distance of the shifting threshold to obtain four preset boundary lines; calculating an average gray-scale value of the bit region using the weighted average algorithm by taking an overlapping area between pixels inside the four preset boundary lines and the bit region as a weight; binarizing the two-dimensional code image according to the average gray-scale value of the bit region; and decoding the two-dimensional code image. The influence of the pixels which have an overlapping area with the bit region on the average gray-scale value of the bit region is considered, and the decoding accuracy and success rate are high.
3 Citations
9 Claims
-
1. A method for decoding two-dimensional code using weighted average gray-scale algorithm, characterized by comprising:
-
segmenting a received two-dimensional code image into bit regions each containing one bit data; presetting a shifting threshold, and shifting four original boundary lines of the bit region outwards by a distance of the shifting threshold to obtain four preset boundary lines; calculating an average gray-scale value of the bit region using the weighted average algorithm by taking an overlapping area between pixels inside the four preset boundary lines and the bit region as a weight; binarizing the two-dimensional code image according to the average gray-scale value of the bit region; and decoding the binarized two-dimensional code image. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system for decoding two-dimensional code using weighted average gray-scale algorithm, characterized by comprising:
-
a segmenting module which is configured for segmenting a received two-dimensional code image into bit regions each containing only one bit data; a shifting module which is configured for shifting four original boundary lines of the bit region outwards by a distance of the shifting threshold to obtain four preset boundary lines; a calculating module which is configured for calculating an average gray-scale value of the bit region using the weighted average algorithm by taking the overlapping area between pixels inside the four preset boundary lines and the bit region as a weight; a binarizing module which is configured for binarizing the two-dimensional code image according to the average gray-scale value of the bit region; and a decoding module which is configured for decoding the binarized two-dimensional code image.
-
Specification