Invention content
In view of problem above, the present invention proposes a kind of method and system carrying out anti-copying processing to Quick Response Code, makes
Obtaining Quick Response Code has the function of anti-copying.
First aspect of the present invention it is proposed a kind of method carrying out anti-copying processing to Quick Response Code, including following step
Suddenly:Obtain pending two-dimension code pattern;A part of black coding unit in the two-dimension code pattern is selected to carry out gray value
Adjustment, to be different from the gray value of other black coding units;Record is changed the position of the black coding unit of gray value;It will
Two-dimension code pattern that treated prints original paper for printing to form Quick Response Code.Using this method, Quick Response Code printed matter may make
Has the function of anti-copying processing.
In an alternative embodiment, the quantity of a part of black coding unit is at least complete in the two-dimension code pattern
The a quarter of the quantity of portion's black coding unit.This can promote the effect of the anti-copying function of Quick Response Code printed matter.
In an alternative embodiment, the gray value after the adjustment of a part of black coding unit is at most the ash before adjustment
3/5ths of angle value.This becomes apparent from and distinguishes before may make the gray value of the black coding unit after adjustment and adjustment.
In an alternative embodiment, a part of black coding unit in the selected two-dimension code pattern uniformly divides
Different zones of the cloth in the two-dimension code pattern.The anti-copying attribute of two-dimension code pattern can be improved in this.
In the second aspect of the present invention, it is proposed that a kind of Quick Response Code on printed article carries out the side of duplicate judgement
Method includes the following steps:
Utilize the position that the black coding unit for being changed gray value recorded is obtained according to method as discussed above;
Obtain the figure of the Quick Response Code printing original paper of printing;
The gray value that the black coding unit in the figure of original paper is printed for the Quick Response Code executes data acquisition, with shape
At comparison normal data;
Obtain the figure of the Quick Response Code to be determined on the printed article;
Data acquisition is executed to form data to be compared for the gray value of the figure of the Quick Response Code to be determined;
Data to be compared are compared with normal data is compared, to judge the Quick Response Code to be determined on the printed article
Whether it is duplicate.
In an alternative embodiment, the data acquisition specifically includes:It is compiled according to the black for being changed gray value recorded
Code unit position, the gray value of the known black coding unit for being changed gray value is extracted one by one, and select and
The black coding unit of the gray value being currently the changed adjacent black coding unit for not changing gray value does not change described in extraction
The gray value for becoming the black coding unit of gray value, to form the multipair black coding unit with different gray values;It calculates every
The gray scale difference value of a pair of of black coding unit;Calculate the average value and standard deviation of all gray scale difference values.
In an alternative embodiment, what selection was adjacent with the black coding unit of gray value being currently changed does not change gray scale
The black coding unit of value includes the following steps:Centered on the position of black coding unit for currently having changed gray value, seek
Look for a nearest black coding unit for not changing gray value.
In an alternative embodiment, it is described extraction include multiple sample points are acquired in the space of single encoded unit, and
Arithmetic average is carried out to obtain the gray value of the single encoded unit to the gray value of the multiple sample point.
In an alternative embodiment, data to be compared are compared with normal data is compared, it is described to be determined to judge
The step for whether figure of Quick Response Code is duplicate specifically includes:
When the average value of the gray scale difference value in the data to be compared is much smaller than the gray scale difference value compared in normal data
Average value, and when the standard deviation that compares gray scale difference value in the standard deviation and normal data of the gray scale difference value in data is close,
Judge that the two-dimension code pattern to be determined is duplicate.
In an alternative embodiment, the average value of the gray scale difference value in the data to be compared is much smaller than in comparison normal data
The average value of gray scale difference value refer to:The average value of gray scale difference value in data to be compared is less than or equal to the ash in normal data
Spend the 1/2 of the average value of difference;
The standard deviation of gray scale difference value in the standard deviation and normal data of gray scale difference value in data to be compared is close to refer to:
The standard deviation of gray scale difference value in data to be compared is greater than or equal to the 2/3 of the standard deviation of the gray scale difference value in normal data.
The third aspect of the present invention is related to a kind of computer readable storage medium, is stored thereon with one or more computer journeys
Sequence, which is characterized in that one or more computer programs, which are subsequently can by computer when device executes, implements method as discussed above.
The fourth aspect of the present invention is related to a kind of computing device, including processor, and the processor is configured as:Acquisition waits for
The two-dimension code pattern of processing;A part of black coding unit in the two-dimension code pattern is selected to carry out gray value adjustment, with area
Not in the gray value of other black coding units;Record is changed the position of the black coding unit of gray value;By treated
Two-dimension code pattern prints original paper for printing to form Quick Response Code.
Using the above example of the present invention, the anti-copying function of Quick Response Code may be implemented, and can be right as needed
The Quick Response Code of printing carries out duplicate (i.e. folder duplicate) and identifies or judge.
Specific implementation mode
In the following detailed description, refer to the attached drawing, the attached drawing form a part for detailed description, and by wherein can be real
The illustrative specific embodiment of the present invention is trampled to show.It is patrolled it should be understood that other embodiment can be utilized or can be made
It collects and changes, without departing from the scope of the present invention.Therefore described in detail below to be used in limiting sense, and this
The range of invention is defined by the following claims.
Fig. 1 diagrammatically illustrates a kind of method carrying out anti-copying processing to Quick Response Code.This method may include following steps:
S1, pending two-dimension code pattern is obtained.The two-dimension code pattern of acquisition can be generated according to various existing methods
Common two-dimension code pattern data.The two-dimension code pattern based on chequered with black and white color lump it is arranged combination and formed, color
Block is the basic unit of Quick Response Code coding.The color lump of black is known as black coding unit below.And the color lump of white is referred to as white
Color coding unit.
A part of black coding unit in S2, the selection two-dimension code pattern carries out gray value adjustment, to be different from it
The gray value of his black coding unit.The selection can according to predetermined criteria or rule selects, or can randomly choose.
In one example, the quantity of a part of black coding unit is at least the coding of whole black in the two-dimension code pattern
The a quarter of the quantity of unit.The quantity of a part of black coding unit cannot be very little, so as not to influence following judgement or
Differentiate operation.
And the adjustment may include tuning up or turning down the gray value of a part of black coding unit.The adjustment is it is required that adjust
The gray value of black coding unit after whole and the gray value of other unadjusted black coding units distinguish.Certain real
It applies in example, the gray value after the adjustment of a part of black coding unit is at most 3/5ths of the gray value before adjustment,
To which the front and back gray value of adjustment be differentiated.Certainly, the amplitude of adjustment be also not necessarily limited to more than amplitude.
S3, record are changed the position of the black coding unit of gray value.It is adjusted the black coding unit of gray value
Position needs to be recorded, and in order to following duplicate judgement or differentiates.
S4, by treated, two-dimension code pattern prints original paper for printing to form Quick Response Code.By the Quick Response Code after adjustment
Figure is printed, and the Quick Response Code of original print can be formed, i.e. Quick Response Code prints original paper.
The Quick Response Code, which prints original paper, will have good anti-copying attribute, because if Quick Response Code printing original paper is carried out
When the duplications such as duplicating operation, due to printing net-point diffusion etc., the gray scale difference of two categories black border unit in duplicate
Value can change, this to change with general and stability, can be detected and perceive.It is discussed in detail below and is detected
Method.
In specific example, a part of black coding unit in the selected two-dimension code pattern is uniformly distributed
In the different zones of the two-dimension code pattern.This can prevent from following causing due to local illumination is excessive, too small, reflective etc.
Difference is distorted, and influences the accuracy differentiated.
Fig. 2 diagrammatically illustrates a kind of method that the Quick Response Code on printed article carries out duplicate judgement, and this method includes
Following steps:
D1, the position that the black coding unit for being changed gray value recorded is obtained according to method as discussed above is utilized
It sets.The position for being changed the black coding unit of gray value represents scheduled Codes and Standards.
D2, the Quick Response Code for obtaining printing print the figure of original paper.The Quick Response Code printing original paper of printing indicates that the Quick Response Code is
The Quick Response Code printed for the first time, rather than the Quick Response Code for being replicated or duplicating.
D3, the gray value execution data acquisition for the black coding unit in the figure of Quick Response Code printing original paper,
Normal data is compared to be formed.Before duplicate judgement, need first to acquire comparison normal data, i.e. the criterion numeral for comparing
According to.
In specific example, the data acquisition may include:According to the black coding for being changed gray value recorded
The gray value of the known black coding unit for being changed gray value is extracted in the position of unit one by one, and selects and work as
Before the adjacent black coding unit for not changing gray value of the black coding unit of gray value that is changed, and described in extracting not
The gray value for changing the black coding unit of gray value, to form the multipair black coding unit with different gray values;It calculates
Per the gray scale difference value of a pair of black coding unit;Calculate the average value and standard deviation of all gray scale difference values.To utilize
Average value and standard deviation (alternatively referred to as standard variance) are used as the variation characteristic of gray scale difference value.It is, of course, also possible to using other
Method for feature analysis in pattern-recognition acquires to be used for data.
It should be appreciated that multiple average values and standard deviation can be acquired using multiple two-dimension code pattern original papers, to reduce
The error generated when acquisition.
And in specific example, it selects adjacent with the black coding unit of gray value being currently changed not change gray scale
The black coding unit of value may comprise steps of:During position currently to have changed the black coding unit of gray value is
The heart finds a nearest black coding unit for not changing gray value.
In further alternative example, the extraction includes that multiple samples are acquired in the space of single encoded unit
Point, and arithmetic average is carried out to obtain the gray value of the single encoded unit to the gray value of the multiple sample point.This can
Reduce error.
D4, the figure for obtaining Quick Response Code to be determined on the printed article.The figure of the Quick Response Code of the acquisition is to wait sentencing
Fixed two-dimension code pattern.
D5, for the Quick Response Code to be determined figure gray value execute data acquire to form data to be compared.
For the two-dimension code pattern to be determined, data collection steps as above are executed again.
D6, data to be compared are compared with normal data is compared, to judge to be determined two on the printed article
Tie up whether code is duplicate.If data to be compared differ larger with normal data is compared, it can determine that Quick Response Code is duplicate.
It in one example, will be to be compared when using variation characteristic to treat as gray scale difference value of average value and standard deviation
Data are compared with normal data is compared, the step for whether figure of the Quick Response Code to be determined is duplicate judged
It may particularly include:When the average value of the gray scale difference value in the data to be compared is much smaller than the gray scale difference value compared in normal data
Average value, and the standard deviation for comparing gray scale difference value in the standard deviation and normal data of the gray scale difference value in data is close
When, judge that the two-dimension code pattern to be determined is duplicate.
The average value of gray scale difference value in the wherein described data to be compared is much smaller than the gray scale difference value compared in normal data
Average value indicate that for the two-dimension code pattern since printing net-point is spread, gray scale difference value will become much smaller.Further optional
Example in, when the gray scale difference value that the average value of gray scale difference value in data to be compared is less than or equal in normal data being averaged
Value 1/2 when, can assert that average value in data to be compared is much smaller than the average value of normal data.It is of course also possible to according to reality
Border situation is adjusted with upper threshold value.
In further example, the gray scale difference value in the standard deviation and normal data of the gray scale difference value in data to be compared
Standard deviation close to referring to:The standard deviation of gray scale difference value in data to be compared is greater than or equal to the gray scale difference value in normal data
Standard deviation 2/3.Standard deviation is the dispersion of collecting sample data difference and sample data difference average value, for being answered
The important method and foundation of property determination whether system.
And when standard deviation is relatively large, it indicates that data acquisition errors are too big, needs to resurvey sample data.
Certainly, the embodiment of the present invention further relates to a kind of device carrying out anti-copying processing to Quick Response Code.The device can be with
It is a kind of computing device (such as server, computer and mobile intelligent terminal), including processor 10, the processor are configured as holding
Step in row above method.The processor can be a kind of IC chip (such as microprocessor (central
Processing unit, CPU)), for executing computer program.The computing device may include computer readable storage medium
(or memory).It is stored with computer program in the medium.The computer program includes the journey for executing above method step
Sequence module (or software module).
It should be appreciated that the processor can also be digital signal processor (digital signal processor,
DSP), application-specific integrated circuit (application specific integrated circuit, ASIC), ready-made programmable gate
Array (field-programmable gate array, FPGA) or other programmable logic device.
In other embodiments, the present invention can be embodied in computer-readable storage medium 11 (such as CD, flash memory
(flash memory) and read-only memory (ROM, read-only memory)) in.For executing the soft of above method step
Part module can be stored in the storage medium.
Using the above example of the present invention, the anti-copying function of Quick Response Code may be implemented, and can be right as needed
The Quick Response Code of printing carries out duplicate (i.e. folder duplicate) and identifies or judge.
Although the principle of the present invention is described in detail above in conjunction with the preferred embodiment of the present invention, this field skill
Art personnel are it should be understood that above-described embodiment is only the explanation to the exemplary implementation of the present invention, not to present invention packet
Restriction containing range.Details in embodiment is simultaneously not meant to limit the scope of the invention, without departing substantially from the present invention spirit and
In the case of range, any equivalent transformation, simple replacement based on technical solution of the present invention etc. obviously changes, and all falls within
Within the scope of the present invention.