CN108229232A - The method of batch scanning Quick Response Code and the device of batch scanning Quick Response Code - Google Patents

The method of batch scanning Quick Response Code and the device of batch scanning Quick Response Code Download PDF

Info

Publication number
CN108229232A
CN108229232A CN201611191258.XA CN201611191258A CN108229232A CN 108229232 A CN108229232 A CN 108229232A CN 201611191258 A CN201611191258 A CN 201611191258A CN 108229232 A CN108229232 A CN 108229232A
Authority
CN
China
Prior art keywords
quick response
response code
image
cluster centre
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611191258.XA
Other languages
Chinese (zh)
Other versions
CN108229232B (en
Inventor
吴文亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201611191258.XA priority Critical patent/CN108229232B/en
Publication of CN108229232A publication Critical patent/CN108229232A/en
Application granted granted Critical
Publication of CN108229232B publication Critical patent/CN108229232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

A kind of method and device of batch scanning Quick Response Code, the method in one embodiment include:Image is acquired, obtains image to be detected;Binary conversion treatment is carried out to image to be detected, obtains binary image;Binary image is scanned according to predetermined Quick Response Code barcode scanning pattern, obtains Quick Response Code mode point;Quick Response Code mode point is clustered, each cluster centre point after being clustered;It calculates respectively and determines each cluster centre point and the lowest distance value of the distance of other each cluster centre points other than itself;Average distance between cluster centre point is determined according to the corresponding lowest distance value of each cluster centre point;Determine that Quick Response Code shears the length of side according to average distance between cluster centre point;The length of side is sheared according to Quick Response Code and cluster centre point shears described image to be detected, each Quick Response Code topography for including single Quick Response Code respectively after being sheared.The present embodiment can accurately position each Quick Response Code, improve the accuracy of Quick Response Code positioning and shearing.

Description

The method of batch scanning Quick Response Code and the device of batch scanning Quick Response Code
Technical field
The present invention relates to technical field of information processing, more particularly to a kind of method and one kind of batch scanning Quick Response Code The device of batch scanning Quick Response Code.
Background technology
Current planar bar code technology has been obtained for more universal realization and application, is determined at present by Quick Response Code All be to carry out positioning according to the registration pattern of Quick Response Code to find the position of Quick Response Code during bit scan, for example, QR codes (two-dimensional bar code It is a kind of) " returning " shape registration pattern.
With the development that Quick Response Code is applied, batch scanning is carried out to Quick Response Code and also progresses into the public visual field, is carrying out two It is to determine in the obtained image of scanning each corresponding item of Quick Response Code using the mode that Quick Response Code position when tieing up the batch scanning of code Code region, then " returns " shape frame to position Quick Response Code for each bar code region recognition again, however, working as multiple Quick Response Codes together During identification, multiple " time " shape frames are there may be situation about interfering with each other, so as to not be that the region of Quick Response Code is mistakenly considered Two-dimension code area so that Quick Response Code positioning is inaccurate, cuts out non-two-dimension code area and is decoded.
Invention content
Based on this, it is necessary to can not position a variety of Quick Response Codes and can be accidentally fixed when being positioned to multiple Quick Response Codes for existing The problem of position, provide a kind of method of batch scanning Quick Response Code and a kind of device of batch scanning Quick Response Code.
In order to achieve the above objectives, the present embodiment uses following technical scheme:
A kind of method of batch scanning Quick Response Code, including step:
Image is acquired, obtains image to be detected;
Binary conversion treatment is carried out to described image to be detected, obtains binary image;
The binary image is scanned according to predetermined Quick Response Code barcode scanning pattern, obtains Quick Response Code mode point;
The Quick Response Code mode point is clustered, each cluster centre point after being clustered;
Distance of each cluster centre point respectively with other each cluster centre points other than itself is calculated respectively, is determined each Cluster centre point and the lowest distance value of the distance of other each cluster centre points other than itself;
Average distance between cluster centre point is determined according to the corresponding lowest distance value of each cluster centre point;
Determine that Quick Response Code shears the length of side according to average distance between the cluster centre point;
The length of side and cluster centre point are sheared according to the Quick Response Code, described image to be detected is sheared, is obtained Each Quick Response Code topography for including single Quick Response Code respectively after must shearing.
A kind of device of batch scanning Quick Response Code, including:
Image capture module for acquiring image, obtains image to be detected;
First image processing module for carrying out binary conversion treatment to described image to be detected, obtains binary image;
Response Code scan module for being scanned according to predetermined Quick Response Code barcode scanning pattern to the binary image, obtains Obtain Quick Response Code mode point;
Cluster module, for being clustered to the Quick Response Code mode point, each cluster centre point after being clustered;
Cluster centre apart from determining module, for calculate respectively each cluster centre point respectively with other other than itself The distance of each cluster centre point determines the distance of each cluster centre point and other each cluster centre points other than itself most Small distance value, and average distance between cluster centre point is determined according to the corresponding lowest distance value of each cluster centre point;
Length of side determining module is sheared, for determining that Quick Response Code shears the length of side according to average distance between the cluster centre point;
Shear module, for shearing the length of side and cluster centre point according to the Quick Response Code, to the mapping to be checked As being sheared, each Quick Response Code topography for including single Quick Response Code respectively after being sheared.
The scheme of above-described embodiment after image is acquired, carries out image binary conversion treatment, and based on predetermined Quick Response Code Barcode scanning pattern is scanned the image after binary conversion treatment, and carrying out cluster to the Quick Response Code mode point that scanning obtains obtains each gather Class central point, and based on cluster centre point distance determine Quick Response Code shear the length of side, then in conjunction with Quick Response Code shear the length of side and Cluster centre point shears collected image to be detected, obtains each Quick Response Code topography for including single Quick Response Code, It determines the Quick Response Code shearing length of side, and combine Quick Response Code and shear by way of cluster, based on the distance between cluster centre point The length of side and cluster centre point are sheared, and so as to accurately be positioned to each Quick Response Code, improve Quick Response Code positioning and shearing Accuracy.
Description of the drawings
Fig. 1 is the schematic diagram of an application environment of this embodiment scheme;
Fig. 2 is the schematic diagram of the composition structure of the terminal in one embodiment;
Fig. 3 is the flow diagram of the method for the batch scanning Quick Response Code in one embodiment;
Fig. 4 is the schematic diagram of the two-dimensional code scanning pattern after being initialized in a concrete application example;
Fig. 5 is the schematic diagram of the object to be detected in a concrete application example;
Fig. 6 is the binary image schematic diagram of object to be detected shown in fig. 5 in a concrete application example;
Fig. 7 is the schematic diagram of Quick Response Code mode point scanned to binary image shown in fig. 6;
Fig. 8 is to Quick Response Code mode point duplicate removal shown in Fig. 7 treated schematic diagram;
Fig. 9 is the schematic diagram of the distance between the cluster centre point obtained to the Quick Response Code mode point in Fig. 8;
Figure 10 is the Quick Response Code topography that the object to be detected based on Fig. 9 midpoints 1 to 6 couples of Fig. 5 of point is sheared Schematic diagram;
Figure 11 is the flow diagram for determining predetermined Quick Response Code barcode scanning step-length in a specific example;
Figure 12 is the schematic diagram of the single Quick Response Code template image of the acquisition in a concrete application example;
Figure 13 is the schematic diagram of the binary image of the single Quick Response Code template image shown in Figure 12;
Figure 14 is the schematic diagram of the black picture element histogram of the binary image shown in Figure 13;
Figure 15 is the flow diagram that denoising is carried out to histogram in a specific example;
Figure 16 is to divide the schematic diagram after equal portions in an example to the black picture element histogram shown in Figure 14;
Figure 17 is to black picture element histogram after the denoising that is obtained after the black picture element histogram denoising shown in Figure 16 Schematic diagram;
Figure 18 is the schematic diagram of topography's block obtained after black picture element Histogram Mapping after the denoising of Figure 17;
Figure 19 is the flow diagram that image item sampling is carried out to local image block in a specific example;
Figure 20 is the schematic diagram of row image stick obtained in an example to topography's block sampling of Figure 18;
Figure 21 is the schematic diagram of row image stick obtained in an example to topography's block sampling of Figure 18;
Figure 22 is the schematic diagram for determining Quick Response Code barcode scanning step-length in an example based on local sampled images block;
Figure 23 is the schematic diagram of the statistics with histogram figure of the row image stick shown in Figure 20 in a specific example;
Figure 24 is the schematic diagram of the statistics with histogram figure of the row image stick shown in Figure 21 in a specific example;
Figure 25 is the structure diagram of the device of the batch scanning Quick Response Code in one embodiment;
Figure 26 is the structure diagram of the Quick Response Code barcode scanning step-length determining module in a specific example;
Figure 27 is the structure diagram of the shear module in a specific example.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention more comprehensible, with reference to the accompanying drawings and embodiments, to this Invention is described in further detail.It should be appreciated that the specific embodiments described herein are only used to explain the present invention, Do not limit protection scope of the present invention.
Fig. 1 shows the working environment schematic diagram in one embodiment of the invention, as shown in Figure 1, its working environment is related to Treat the terminal that can carry out two-dimensional code scanning of picture pick-up device, which may be mobile terminal 101 shown in Fig. 1, notes This computer 102, the terminal 103 with video camera 1030, it is possible to understand that, it is also possible to it is other other kinds of with video camera Terminal.Terminal carries out image frame to the scene comprising multiple Quick Response Codes by the camera that it is carried and shoots, and therefrom It is partitioned into each image in 2 D code and carries out Quick Response Code identification, so as to fulfill the batch scanning to Quick Response Code.The present embodiments relate to Be the image for including multiple Quick Response Codes taken to camera, be therefrom partitioned into the mode of each Quick Response Code.
The structure diagram of the terminal of image of the scanning comprising multiple Quick Response Codes in one embodiment is as shown in Figure 2.It should Terminal includes the processor, storage medium, communication interface, power interface and the memory that are connected by system bus.Wherein, terminal Storage medium is stored with a kind of device of batch scanning Quick Response Code, which is used to implement a kind of side of batch scanning Quick Response Code Method.For connecting and communicating with the network equipment (such as background server), the power interface of terminal is used for the communication interface of terminal It is connect with external power supply, external power supply is powered by the power interface to terminal.Terminal can be that any one can be clapped The equipment taken the photograph, such as mobile terminal, tablet computer, personal computer etc.;Can also be other equipment with above structure.
The flow diagram of the method for the batch scanning Quick Response Code in one embodiment is shown in Fig. 3.As shown in figure 3, The method of batch scanning Quick Response Code in the embodiment includes:
Step S31:Image is acquired, obtains image to be detected;
Step S32:Binary conversion treatment is carried out to described image to be detected, obtains binary image;
Step S33:The binary image is scanned according to predetermined Quick Response Code barcode scanning pattern, obtains two-dimentional pattern Point;
Step S34:The Quick Response Code mode point is clustered, each cluster centre point after being clustered;
Step S35:Calculate respectively each cluster centre point respectively with other each cluster centre points other than itself away from From determining each cluster centre point and the lowest distance value of the distance of other each cluster centre points other than itself;
Step S36:Average distance between cluster centre point is determined according to the corresponding lowest distance value of each cluster centre point;
Step S37:Determine that Quick Response Code shears the length of side according to average distance between the cluster centre point;
Step S38:The length of side and cluster centre point are sheared according to the Quick Response Code, described image to be detected is carried out Shearing, each Quick Response Code topography for including single Quick Response Code respectively after being sheared.
Scheme in above-described embodiment after image is acquired, carries out image binary conversion treatment, and based on predetermined two dimension Code barcode scanning step-length is scanned the image after binary conversion treatment, and carrying out cluster to the Quick Response Code mode point that scanning obtains obtains respectively Cluster centre point, and based on cluster centre point distance determine Quick Response Code shear the length of side, then in conjunction with Quick Response Code shear the length of side with And cluster centre point shears collected image to be detected, obtains each Quick Response Code Local map for including single Quick Response Code By way of cluster, the Quick Response Code shearing length of side is determined, and cut with reference to Quick Response Code based on the distance between cluster centre point for picture Trimming length and cluster centre point are sheared, and so as to accurately be positioned to each Quick Response Code, are improved Quick Response Code positioning and are cut The accuracy cut.
It is in order to which Quick Response Code is identified, therefore, such as it is understood that being partitioned into the purpose of each image in 2 D code Shown in Fig. 3, after above-mentioned steps S38, it can also include:
Step S39:Each Quick Response Code topography is decoded respectively, obtains decoded each 2 D code information.
Any side for having and being likely to occur later at present may be used in the mode being specifically decoded to Quick Response Code Formula carries out.
For ease of understanding this programme in more detail, illustrated below in conjunction with one of concrete application example.This implementation Example scheme is to carry out Image Acquisition based on two-dimensional code scanning pattern when implementing, therefore, can be advanced before specifically acquiring image The initialization of line-scan mode.
When being initialized, it can be after the Quick Response Code barcode scanning step-length is taken, be walked according to the predetermined Quick Response Code barcode scanning The initialization of progress line-scan mode.With reference to shown in Fig. 4, the initialization of the scan pattern can include:Test point is pixel value For 255 white point, each at neighbouring two pixel of test point there are one the white point that pixel value is 255, distance inspections Respectively there is auxiliary magnet described in measuring point at predetermined Quick Response Code barcode scanning step-length, the auxiliary magnet is the black color dots that pixel value is 0, on auxiliary magnet Under each at adjacent two pixels there are one the black color dots that pixel value is 0.Two dimension after being initialized in one concrete application example For the schematic diagram of code scan pattern as shown in figure 4, in shown in Fig. 4, predetermined Quick Response Code barcode scanning step-length is 6.
After the initialization of scan pattern is completed according to predetermined Quick Response Code barcode scanning step-length, entire scanning system has initialized Into, you can carry out the process of acquisition image and the batch scanning analyzed below.
The schematic diagram of object to be detected for acquiring in a specific example and being obtained after image is shown in Fig. 5, it can by Fig. 5 See, include multiple Quick Response Codes in the object to be detected.Then image procossing is carried out to the object to be detected and obtains corresponding two Value image, specific image procossing include gray proces, binary conversion treatment etc., specific gray proces, binary conversion treatment Mode may be used current existing mode and carry out.For the object to be detected shown in Fig. 5, obtained binary image is as schemed Shown in 6.
Then, you can Quick Response Code mode point detection is carried out according to Quick Response Code barcode scanning pattern to binary image, for bigger The detection two-dimension code area of range improves the ability of detection Quick Response Code, based on above-mentioned predetermined Quick Response Code barcode scanning step-length, reality into When row Quick Response Code mode point detects, predetermined Quick Response Code barcode scanning step-length can be extended to multiple barcode scanning step-lengths.Shown in Fig. 4 Predetermined Quick Response Code barcode scanning step-length can be 6 pixel-expansions from scanning step be 3,6,12 pixels for for 6 pixels, As long as the barcode scanning pattern for meeting any one step-length that step-length is 3 or step-length is 6 or step-length is 12 all thinks that the point is Quick Response Code Mode point.It is understood that can also be 6 pixel-expansions by scanning step being other pixel step lengths, such as 4 pixels Point, 9 pixels or other number pixels etc., specific extended mode can combine actual techniques application and be set It is fixed.
By taking predetermined Quick Response Code barcode scanning step-length is 6 pixel as an example, Quick Response Code is carried out to the binary image shown in Fig. 6 After Mode scans, obtained Quick Response Code mode point is as shown in Figure 7.As seen from Figure 7, collected Quick Response Code mode point some places Intensive, some places are sparse, and data skew impacts cluster result in order to prevent, therefore can be in a specific example Duplicate removal processing is carried out to Quick Response Code mode point obtained above, any possible side may be used in the mode of specific duplicate removal processing Formula carries out, and treated that Quick Response Code mode point is as shown in Figure 8 for the duplicate removal in a specific example.
Then above-mentioned Quick Response Code mode point is clustered, each cluster centre point after being clustered, specific cluster point Analysis mode may be used any possible mode and carry out, such as adaptive k-means clusters.For Quick Response Code mould shown in Fig. 8 Formula point, finally obtains 6 cluster centre points, and the coordinate of each cluster centre point is respectively:Point 1 (132,376), point 2 (246,89), 3 (278,396) of point, 4 (334,233) of point, 5 (453,103) of point, 6 (506,341) of point.
Based on apart from calculation (such as Euclidean distance calculation), each cluster centre point and its can be calculated successively The distance between his each cluster centre point (other each cluster centre points i.e. other than itself), and therefrom determine minimum Distance value.It is shown in Fig. 9 in the cluster centre point 1 that Quick Response Code mode point shown in Fig. 8 obtains to other respectively distances The schematic diagram of the distance of heart point, with reference to shown in Fig. 9, the distance of point 1 and point 2,3,4,5,6 is respectively 308.8,147.3,247.5, 421.4th, 375.6, so as to cluster centre point 1 and the lowest distance value of the distance of other each cluster centre points other than itself It is 147.3.
Accordingly, the lowest distance value between each cluster centre point during Fig. 9 is shown can be as shown in table 1 below.
Table 1
Point 1 Point 2 Point 3 Point 4 Point 5 Point 6
Point 1 0 308.81 147.36 247.49 421.39 375.63
Point 2 308.81 0 308.66 168.76 207.47 362.08
Point 3 147.36 308.66 0 172.35 341.28 234.54
Point 4 247.49 168.76 172.35 0 176.24 203.1
Point 5 421.39 207.47 341.28 176.24 0 243.83
Point 6 375.63 362.08 234.54 203.1 243.83 0
Take the average value of the corresponding lowest distance value of each cluster centre point, you can determine average departure between cluster centre point From then having:
AvgDist=(minDist1+minDist2+...+minDistn)/n
=(147.3+168.7+147.3+168.7+176.2+203.1)/6=168.55
In formula, avgDist represents average distance between cluster centre point, and minDist1 represents that cluster centre point 1 is corresponding most Small distance value, minDistn represents the corresponding lowest distance values of cluster centre point n, so as to the cluster obtained in example shown in Figure 10 Average distance is 168 between central point.
Then, you can determine that Quick Response Code shears the length of side, and based on determining two based on the cluster centre point average distance Dimension code sheared edge length is sheared.
When determining that Quick Response Code shears the length of side based on the cluster centre point average distance, can combine to ensure to shear The pre-set shear length of side threshold value that the length of side is set in normal range (NR) carries out.It is if for example, 2 times of average distance small between cluster centre point In or equal to pre-set shear length of side threshold value, the length of side is sheared using 2 times of average distance between cluster centre point as the Quick Response Code; If 2 times of average distance are more than the pre-set shear length of side threshold value between cluster centre point, the pre-set shear length of side threshold value is made The length of side is sheared for the Quick Response Code.
In a specific example, the Quick Response Code shearing length of side can include shear height and shearing width, specifically carry out During shearing, following manner progress may be used:
The first abscissa value after the abscissa of cluster centre point is subtracted the half of the shearing width is as waiting to shear The abscissa origin coordinates of topography;
Using the abscissa of cluster centre point plus the second abscissa value after the half of the shearing width as waiting to shear The abscissa end coordinate of topography;
The first ordinate value after the ordinate of cluster centre point is subtracted the half of the shear height is as waiting to shear The ordinate origin coordinates of topography;
Using the ordinate of cluster centre point plus the second ordinate value after the half of the shear height as waiting to shear The ordinate end coordinate of topography;
To in described image to be detected the abscissa origin coordinates, abscissa end coordinate, ordinate origin coordinates, Segment between ordinate end coordinate is sheared, and obtains the Quick Response Code topography for including single Quick Response Code.
With reference to shown in Fig. 9, in specific application, the value of shear height and width can be set according to the characteristic of Quick Response Code It is equal, is worth for a, i.e., it is identical with the value of shearing width includes shear height for the Quick Response Code shearing length of side.Gathered based on above-mentioned determining Class central point average distance r, using cluster centre point average distance r=168 as radius, acquires a=2*r, then a=236.In order to Ensure that the shearing length of side in normal range (NR), compares length of side a=236 is sheared with the length of side max-thresholds maxLenTh set Compared with if shearing length of side a takes a=maxLenTh more than maxLenTh;If shearing length of side a is less than maxLenTh, then a is protected Hold the constant hypothesis of initial value.In the present example it is assumed that maxLenTh=230, so as to obtain the length of side value of final height and width It is 230.
Shear height value is denoted as height, shearing width value is denoted as width, and the coordinate of cluster centre point is (x, y), base In as described above, it is located at rising in whole image so as to obtain topography's block to be sheared on x-axis (abscissa) direction Beginning coordinate:XBegin=x-width*0.5;The origin coordinates being located on y-axis (ordinate) direction in whole image:yBegin =y-height*0.5;The end coordinate being located in the direction of the x axis in whole image:XEnd=x+width*0.5;In y-axis side End coordinate in whole image upwards:YEnd=y+height*0.5.
Origin coordinates crosses the border in order to prevent, can be set as origin coordinates when the origin coordinates calculated is less than 0 0 value.Even the first abscissa value is less than 0 (xBegin<0) abscissa origin coordinates, is set as 0 (xBegin=0), if first Ordinate value is less than 0 (yBegin<0) ordinate origin coordinates, is set as 0 (yBegin=0).
End coordinate is crossed the border in order to prevent, can exceed artwork maximum height and width value in the end coordinate calculated When, by the past Forward of starting point coordinate.Assuming that entire original image height is rawHeight, original image width is rawWidth, then Have:If the second abscissa value is more than the picture traverse (xEnd of image to be detected>It rawWidth), then will be before abscissa origin coordinates Move the distance (i.e. xBegin=xBegin- (xEnd- of the difference of the picture traverse of the second abscissa value and image to be detected rawWidth));If the second ordinate value is more than the picture altitude (yEnd of image to be detected>RawHeight), then by ordinate Origin coordinates the second ordinate value of Forward and distance (the i.e. yBegin=of the difference of the picture altitude of described image to be detected yBegin-(yEnd-rawHeight))。
Then, to abscissa origin coordinates, abscissa end coordinate, ordinate origin coordinates, vertical from image to be detected Image block between coordinate end coordinate is sheared, and obtains the 230*230 image blocks for including Quick Response Code.Fig. 5 is treated accordingly The point 1 sheared of detection object to the Quick Response Code topography of point 6 schematic diagram respectively successively as the 10-1 of Figure 10, Shown in 10-2,10-3,10-4,10-5,10-6.
After each Quick Response Code topography is obtained, you can successively to each Quick Response Code topography carry out Quick Response Code decoding, two The information obtained after dimension code decoding can be stored.It, can also be to decoding by taking Quick Response Code is directed to the information of commodity as an example Obtained information write-in database, completes the typing of the 2 D code information of commodity.The commodity two dimension of typing in one specific example Code information is as shown in table 2 below.
Table 2
Commodity id Trade name Commodity classification Merchandise news Date of entry Typing personnel
id1 Title 1 Class1 Information 1 Date 1 Personnel 1
id2 Title 2 Type 2 Information 2 Date 2 Personnel 2
id3 Title 3 Type 3 Information 3 Date 3 Personnel 3
id4 Title 4 Type 4 Information 4 Date 4 Personnel 4
id5 Title 5 Type 5 Information 5 Date 5 Personnel 5
... ... ... ... ... ...
So far, the detection and shearing for the batch Quick Response Code not being only completed also complete the solution of multiple commodity image in 2 D code The work such as code, data input realize the function of multiple image in 2 D code data input databases.
It, can be with when being scanned in above-mentioned steps S33 according to predetermined Quick Response Code barcode scanning pattern to the binary image It is the scanning that predetermined Quick Response Code barcode scanning pattern is carried out based on scheduled Quick Response Code barcode scanning step-length.Accordingly, as shown in figure 3, above-mentioned Before S31, step can also be included:
Step S30:Determine the predetermined Quick Response Code barcode scanning step-length under the present level of image capture device.
Above-mentioned predetermined Quick Response Code barcode scanning step-length, can be empirically determined by technical staff's combination technology.The one of the present embodiment In a concrete application example, the predetermined Quick Response Code barcode scanning step-length can be determined by trained mode.
The flow diagram that predetermined Quick Response Code barcode scanning step-length is determined in an example is shown in Figure 11, as shown in figure 11, Step S30 determines that the mode of predetermined Quick Response Code barcode scanning step-length includes the following steps S301 to step S307.
Step S301:It under the present level of image capture device, scans and makes a reservation for single Quick Response Code template, obtain single two Tie up code mask image.
Can fix image capture device during concrete application, its distance with desktop is made to keep certain, that is, is being schemed As the present level of collecting device, the image in 2 D code on a single two-dimentional code mask, a concrete application example are first acquired In acquisition single Quick Response Code template image schematic diagram it is as shown in figure 12.
Step S302:Binary conversion treatment is carried out to the single Quick Response Code template image, obtains binaryzation two dimension code mask Image.The concrete mode of binary conversion treatment may be used current existing any mode and carry out, the single Quick Response Code shown in Figure 12 The binary image of template image is as shown in figure 13.
Step S303:Count the black picture element histogram of the binaryzation Quick Response Code template image.The side of statistic histogram Formula may be used any mode for having and being likely to occur later at present and carry out, and the binary image of Figure 13 is counted Black picture element histogram is as shown in figure 14.As shown in figure 14, when carrying out statistics with histogram, can be by row and by row respectively into Row, i.e., black picture element histogram obtained above can include row black picture element histogram and row black picture element histogram.
Step S304:Denoising is carried out to black picture element histogram, obtains black picture element histogram after denoising.
Figure 15 shows the flow diagram that denoising is carried out to histogram in a specific example, such as Figure 15 institutes Show, the mode for carrying out denoising includes step S3041 to step S3045.
Step S3041:The black picture element histogram is divided into predetermined equal portions, what is specifically divided waits numbers that can tie Actual needs is closed to be set.For waiting numbers n=10, after dividing equal portions to the black picture element histogram shown in Figure 14 Schematic diagram is as shown in figure 16.
Step S3042:Each equal portions are divided into two parts according to identical row/column direction respectively, count each equal portions The part statistical value of two parts and the initial statistical value of each equal portions.
With reference to shown in Figure 16, it is assumed that each equal portions are divided into left and right two halves, by 10 equal portions of the histogram on the left of Figure 16 From left to right it is labeled as:Equal portions 1, equal portions 2, equal portions 3, equal portions 4 ..., equal portions 10.After statistics, equal portions 1, equal portions 2, etc. Parts 3, the part statistical value of left-half of equal portions 4...... equal portions 10, the statistical value of right half part, maximum value, minimum value this Four numerical value are followed successively by respectively:606、0、3340;0、0、0、0;0、0、0、0;0、0、0、0;0、0、0、0;0、662、80、0; 2016、1950、87、41;1830、2071、88、26;228、131、35、3;105、739、53、3.
So as to which the initial statistical value from left to right of the histogram in left side in Figure 16 is respectively:
606、0、0、0、0、622、3966、3901、359、844。
With reference to shown in Figure 16, it is assumed that each equal portions are divided into left and right two halves, by 10 equal portions of the histogram on the right side of Figure 16 from Under to it is upper label for:Equal portions 1, equal portions 2, equal portions 3, equal portions 4...... equal portions 10.After statistics, equal portions 1, equal portions 2, equal portions 3, etc. This four the part statistical value of left-half of part 4...... equal portions 10, the statistical value of right half part, maximum value, minimum value values It is followed successively by respectively:694、510、81、0;11、16、1、0;17、13、1、0;66、1480、75 0;1402、1476、75、45; 1502、1490、78、48;703、178、64、3;242、130、12、1;23、31、2、1;116、198、8、3.
So as to which the initial statistical value from top to bottom of the histogram on right side in Figure 16 is respectively:
1204、27、30、1546、2878、2992、881、372、54、314。
Step S3043:When the big value in two part statistical values of any one equal portions and two parts of the equal portions are united When the ratio of small value in evaluation is more than the first fractional threshold or the ratio of maxima and minima in the equal portions is more than the During two fractional thresholds, the statistical value of such in one's duty all histograms is set as 0.
Part statistical value of the histogram equal portions per the right half part in portion is represented with rightHistSum, LeftHistSum represents part statistical value of the histogram equal portions per the left-half in portion, and histogram etc. is represented with maxHist Part is per the maximum value in portion, and minHist represents histogram equal portions per the minimum value in portion, and a represents the first proportion threshold value, b Represent the second proportion threshold value.
Then assume rightHistSum>LeftHistSum, if (rightHistSum-leftHistSum)
/leftHistSum>A-1, in other words rightHistSum/leftHistSum>A, then will be such in one's duty all Statistics with histogram value is set as 0.Or when maxHist/minHist is more than or equal to b, then in one's duty all histogram systems will be waited Evaluation is set as 0.
Step S3044:It, will be such in one's duty all when the statistical value of two adjacent equal portions of any one equal portions is 0 The statistical value of histogram is set as 0.
Assuming that the equal portions that statistical values all in 10 equal portions can be set 0 are labeled as ' 1 ', all statistics of former statistical data are kept It is worth constant equal portions labeled as ' 0 ', then in step S3044, meets the histogram equal portions that marking mode is ' 101 ' existing When, it needs label in ' 101 ' being also required to its equal portions for 0 ' equal portions (equal portions for keeping statistics with histogram data originally) Interior all statistical values are set to 0.
Step S3045:Calculate the equal portions that each statistical value is not 0 with adjacent statistical value for the initial statistical value of 0 equal portions Initial statistical value ratio, by the maximum corresponding statistical value of ratio for except 0 equal portions other etc. it is in one's duty all The statistical value of histogram is set as 0, obtains black picture element histogram after the denoising.
With reference to described above, it is assumed that the equal portions that 0 can be set in 10 equal portions are labeled as 1, keep the equal portions of former statistical data Labeled as 0.
Accordingly, the label result of equal portions 1 from left to right to the equal portions 10 of the histogram on the left of Figure 16 is respectively:
1 1 1 1 1 1 0 0 1 1
There is no 101 pattern in the label, do not need to then remove independent block statistical chart.Last remaining statistical value is not Equal portions for 0 include equal portions 7, equal portions 8, and the equal portions that adjacent statistical value is 0 are respectively equal portions 6, equal portions 9.So as to equal portions 7 with The ratio (signal-to-noise ratio) of the initial statistical value of equal portions 6 is:Z1=3966/622=6.37, the initial statistical value of equal portions 8 and equal portions 9 Ratio (signal-to-noise ratio) be:Z2=3901/359=10.87.
Maximum value in z1, z2 is z2=10.87, so as to which the statistical value of the corresponding equal portions 7 of z1 is also configured as 0, that is, is adopted With above-mentioned mark mode, the label of equal portions 7 is also labeled as 1.
Similarly, the label result of equal portions 1 from top to bottom to the equal portions 10 of the histogram on the right side of Figure 16 is respectively:
1 1 1 1 0 0 1 1 1 1
There is no 101 pattern in the label, do not need to then remove independent block statistical chart.Last remaining statistical value is not Equal portions for 0 include equal portions 5, equal portions 6, and the equal portions that adjacent statistical value is 0 are respectively equal portions 4, equal portions 7.So as to equal portions 5 with The ratio (signal-to-noise ratio) of the initial statistical value of equal portions 4 is:Z1=2878/1546=1.86, the initial statistical of equal portions 6 and equal portions 7 The ratio (signal-to-noise ratio) of value is:Z2=2992/881=3.39.
Maximum value in z1, z2 is z2=3.39, so as to which the statistical value of the corresponding equal portions 5 of z1 is also configured as 0, that is, is used Above-mentioned mark mode, the label of equal portions 5 are also labeled as 1.
Obtain accordingly to black picture element Nogata after the denoising that is obtained after the black picture element histogram denoising shown in Figure 16 The schematic diagram of figure is as shown in figure 17, including row black picture element histogram after denoising and denoising rank rear black picture element histogram.Figure It is actually the region unit of maximum signal to noise ratio (maximum ratio as described above) retained after denoising in shown in 17, Figure 17 is left Side retain row scope of statistics be:The row scope of statistics of reservation is on the right side of 384~509, Figure 17:192~287.
Step S305:Black picture element histogram procession coordinate after the denoising is mapped, acquisition is mapped as binaryzation Topography's block after image.
For black picture element histogram after the denoising shown in Figure 17, after mapping its procession coordinate, it is mapped as Topography's block after binary image is as shown in figure 18.
Step S306:Image item sampling is carried out to topography's block, obtains local sampled images block.
Figure 19 shows the flow diagram that image item sampling is carried out to local image block in a specific example, such as schemes Shown in 19, including step S3061 to step S3064.
Step S3061:It is fast that the first row image item is intercepted at the half of the line direction of topography's block, the first row Width of the width of image stick for image in borderline region, a height of first intended pixel height threshold.
For topography's block shown in Figure 18, the first row image stick of interception is as shown in the 20-1 of Figure 20.Figure 20 20-1 shown in, be by the first intended pixel height threshold to be sampled for 10 pixels, it will be understood that this first Intended pixel height threshold can be adjusted, and can also be set as other values.
Step S3062:At a quarter of the line direction of topography's block and at 3/4ths, is intercepted respectively Two row image items are fast, the third line image stick, the second row image stick, the third line image stick width be the borderline region The width of interior image, a height of second intended pixel height threshold.
For topography's block shown in Figure 18, the second row image stick of interception, the third line image stick are respectively such as Shown in 20-2,20-3 of Figure 20.It is using the second intended pixel height threshold as 20 pixels in shown in 20-2,20-3 of Figure 20 It is sampled for point, it is to be understood that the second intended pixel height threshold can be adjusted, and can also be set as it He is worth.
Step S3063:It is fast that first row image item is intercepted at the half of the column direction of topography's block, the first row The width of image stick is the first intended pixel width threshold value, the height of image in a height of borderline region.
For topography's block shown in Figure 18, the first row image stick of interception is as shown in the 21-1 of Figure 21.Figure 21 21-1 shown in, be to be sampled for 10 pixels by the first intended pixel width threshold value, it is to be understood that should First intended pixel width threshold value can be adjusted, and can also be set as other values.Wherein, the first intended pixel width threshold Value can be set as identical value under normal conditions with above-mentioned first intended pixel height threshold.
Step S3064:At a quarter of the column direction of topography's block and at 3/4ths, is intercepted respectively Two row image sticks, third row image stick, the secondary series image stick, third row image stick width be the second intended pixel Width threshold value, the height of image in a height of borderline region.
For topography's block shown in Figure 18, the secondary series image stick of interception, third row image stick are respectively such as Shown in 21-2,21-3 of Figure 21.It is using the second intended pixel width threshold value as 20 pixels in shown in 21-2,21-3 of Figure 21 It is sampled for point, it is to be understood that the second intended pixel width threshold value can be adjusted, and can also be set as it He is worth.Wherein, which can set under normal conditions with above-mentioned second intended pixel height threshold For identical value.
So as to which, the local sampled images block finally obtained includes above-mentioned the first row image stick, the second row image stick, the Three row image sticks, first row image stick, secondary series image stick and third row image stick.
It is understood that the execution of above-mentioned steps S3061 to step S3064 can not limit sequence, it can be any Sequence performs, and can also be performed simultaneously, as long as above-mentioned 3 row images stick can be obtained, 3 row image sticks amount to 6 figures Slice block.It certainly, can also be based on needing to extract other image sticks by number in actual techniques application.
Step S307:Statistics with histogram is carried out to each local sampled images block, obtains statistics with histogram as a result, simultaneously root The predetermined Quick Response Code barcode scanning step-length is determined according to statistics with histogram result.
Figure 22 shows that the flow for determining Quick Response Code barcode scanning step-length based on local sampled images block in a specific example is shown It is intended to, with reference to shown in Figure 22, step S307 can include the following steps S3071 to step S3074.
Step S3071:Respectively to the first row image stick, the second row image stick, the third line image stick black picture Element carries out statistics with histogram, obtains each row image stick histogram, and by each row image stick Histogram Mapping to abscissa, really Surely it is mapped to the length along path angle value for each line segment being linked to be after abscissa.
Statistics with histogram is carried out to the row image stick shown in Figure 20 successively, obtained statistics with histogram figure schematic diagram is as schemed Shown in 23.For the statistics with histogram figure shown in Figure 23, the length along path angle value of the histogram of left, center, right three is respectively:5、5、5; 3、9、5、5;7、6、6.
Step S3072:Respectively to first row image stick, the secondary series image stick, the third row image stick Black picture element carry out statistics with histogram, obtain each row image stick histogram, and each row image stick Histogram Mapping is arrived Ordinate determines to be mapped to the length along path angle value for each line segment being linked to be after ordinate.
Statistics with histogram is carried out to the row image stick shown in Figure 21 successively, obtained statistics with histogram figure schematic diagram is as schemed Shown in 24.For the statistics with histogram figure shown in Figure 24, the length along path angle value of the histogram of left, center, right three is respectively:6、5、5、 10;11、10;3、5、9、5、11.
Step S3073:In the length along path angle value for determining to be mapped to each line segment after abscissa and ordinate, each line segment length The line segment number sum of all length along path angle value in the range of first predetermined radii of value, obtains the corresponding line of each length along path angle value Hop count mesh.
For example, it is assumed that the number for the line segment that length along path angle value is L is a, and the first predetermined radii ranging from 2, length along path angle value The number of line segment for L-1, L+1 is respectively b, c, and length along path angle value is that the number of the line segment of L-2, L+2 is respectively d, e, so as to In this example, the corresponding line segment numbers of length along path angle value L are a+b+c+d+e.
Accordingly, the length along path angle value of the statistics with histogram figure with reference to shown in Figure 23, Figure 24, it is assumed that the first predetermined radii range It is 2, each length along path angle value 3 of acquisition, 5,6,7,9,10,11 corresponding line segment numbers are respectively 11,15,13,15,7,6,6.
Step S3074:Calculate the corresponding line segment number of each length along path angle value, the second predetermined radii with the length along path angle value In the range of the corresponding line segment number of all length along path angle value and value, and according to maximum and be worth the corresponding length along path angle value Determine the predetermined Quick Response Code barcode scanning step-length.
For example, it is assumed that it is K1 that length along path angle value, which is the corresponding line segment numbers of L, and the second predetermined radii ranging from 1, line segment length It is K2 to be worth for the corresponding line segment numbers of L-1, and length along path angle value is that the corresponding line segment numbers of L+1 are K3, so as in this example, be somebody's turn to do Length along path angle value L is corresponding and value is K1+K2+K3.
With reference to the line segment number shown in upper table 3, it is assumed that the second predetermined radii ranging from 1, can acquire length along path angle value 6 with It is maximum at a distance of the corresponding line segment number of 5,7 three length along path angle value of the length along path angle value and value 15+13+15=48 for 1 Value.So as to determine Quick Response Code barcode scanning step-length according to length along path angle value 6.
It, can be directly using the length along path angle value as Quick Response Code barcode scanning step-length when determining Quick Response Code barcode scanning step-length.Having In the technology application of body, for larger range of detection two-dimension code area, improve the ability of detection Quick Response Code or be based on The length along path angle value is extended, and determines multiple Quick Response Code barcode scanning step-lengths, i.e., the value of above-mentioned Quick Response Code barcode scanning step-length is included extremely It is one few.Specific extended mode can combine actual needs setting.
It is understood that in specifically using example, after the height of vision facilities is changed, can hold again The row above process redefines above-mentioned Quick Response Code barcode scanning step-length.
Based on thought same as mentioned above, the present embodiment also provides a kind of device of batch scanning Quick Response Code.
The structure diagram of the device of the batch scanning Quick Response Code in one embodiment is shown in Figure 25, such as Figure 25 institutes Show, the device in the embodiment includes:
Image capture module 251 for acquiring image, obtains image to be detected;
First image processing module 252 for carrying out binary conversion treatment to image to be detected, obtains binary image;
Response Code scan module 253, for being scanned according to predetermined Quick Response Code barcode scanning pattern to the binary image, Obtain Quick Response Code mode point;
Cluster module 254, for being clustered to Quick Response Code mode point, each cluster centre point after being clustered;
Cluster centre apart from determining module 255, for calculate respectively each cluster centre point respectively with other than itself The distance of other each cluster centre points determines the distance of each cluster centre point and other each cluster centre points other than itself Lowest distance value, and average distance between cluster centre point is determined according to the corresponding lowest distance value of each cluster centre point;
Length of side determining module 256 is sheared, for determining Quick Response Code sheared edge according to average distance between the cluster centre point It is long;
Shear module 257, for shearing the length of side and cluster centre point according to the Quick Response Code, to described to be detected Image is sheared, each Quick Response Code topography for including single Quick Response Code respectively after being sheared.
Scheme in above-described embodiment after image is acquired, carries out image binary conversion treatment, and based on predetermined two dimension Code barcode scanning step-length is scanned the image after binary conversion treatment, and carrying out cluster to the Quick Response Code mode point that scanning obtains obtains respectively Cluster centre point, and based on cluster centre point distance determine Quick Response Code shear the length of side, then in conjunction with Quick Response Code shear the length of side with And cluster centre point shears collected image to be detected, obtains each Quick Response Code Local map for including single Quick Response Code By way of cluster, the Quick Response Code shearing length of side is determined, and cut with reference to Quick Response Code based on the distance between cluster centre point for picture Trimming length and cluster centre point are sheared, and so as to accurately be positioned to each Quick Response Code, are improved Quick Response Code positioning and are cut The accuracy cut.
Above-mentioned shearing length of side determining module 256, can between the cluster centre point 2 times of average distance be less than or wait When pre-set shear length of side threshold value, the length of side is sheared using 2 times of average distance between the cluster centre point as the Quick Response Code, and When 2 times of average distance are more than the pre-set shear length of side threshold value between the cluster centre point, by the pre-set shear length of side Threshold value shears the length of side as the Quick Response Code.
It is in order to which Quick Response Code is identified, therefore, such as it is understood that being partitioned into the purpose of each image in 2 D code Shown in Figure 25, in a specific example, the device in the present embodiment can also include:
Decoder module 258 for being decoded respectively to each Quick Response Code topography, obtains decoded each two dimension Code information.
Any side for having and being likely to occur later at present may be used in the mode being specifically decoded to Quick Response Code Formula carries out.
When Response Code scan module 253 is scanned the binary image according to predetermined Quick Response Code barcode scanning pattern, Can be the scanning that predetermined Quick Response Code barcode scanning pattern is carried out based on scheduled Quick Response Code barcode scanning step-length.Accordingly, specifically show at one In example, as shown in figure 25, the device in the present embodiment further includes Quick Response Code barcode scanning step-length determining module 250, to determine image Above-mentioned Quick Response Code barcode scanning step-length under the present level of collecting device.
Figure 26 shows the structure diagram of the Quick Response Code barcode scanning step-length determining module in a specific example, such as Figure 26 institutes Show, which includes:
Image scanning module 2501, under the present level of image capture device, scanning and making a reservation for single Quick Response Code mould Plate obtains single Quick Response Code template image;
Second image processing module 2502 for carrying out binary conversion treatment to the single Quick Response Code template image, obtains Binaryzation Quick Response Code template image;
Statistics with histogram module 2503, for counting the black picture element histogram of binaryzation Quick Response Code template image;
Denoising module 2504 for carrying out denoising to the black picture element histogram, obtains black picture element after denoising Histogram;
Mapping block 2505 for mapping black picture element histogram procession coordinate after the denoising, is mapped For topography's block after binary image;
Local decimation blocks 2506 for carrying out image item sampling to topography's block, obtain local sampled images Block;
Step-length determining module 2507 for carrying out statistics with histogram to each local sampled images block, obtains histogram Statistical result, and the predetermined Quick Response Code barcode scanning step-length is determined according to statistics with histogram result.
In a concrete application example, which can include:
Equal portions division module, for the black picture element histogram to be divided into predetermined equal portions;
Quantity statistics module, for each equal portions to be divided into two parts according to identical row/column direction respectively, statistics is each The part statistical value of two parts of equal portions and the initial statistical value of each equal portions;
First denoising module, for the big value and the equal portions in two part statistical values of any one equal portions When the ratio of small value in two part statistical values is more than the first fractional threshold or maxima and minima in the equal portions When ratio is more than the second fractional threshold, the statistical value of such in one's duty all histograms is set as 0;
Second denoising module, for the statistical value of two adjacent equal portions of any one equal portions be 0 when, will be such The statistical value of in one's duty all histograms is set as 0;
Third denoising module, for calculating the initial statistical value for the equal portions that each statistical value is not 0 and adjacent statistics Be worth the ratio of the initial statistical value of the equal portions for 0, by the maximum corresponding statistical value of ratio for except 0 equal portions other etc. The statistical value of in one's duty all histograms is set as 0, obtains black picture element histogram after the denoising.
In a concrete application example, which can include:
The first module of row part sampling, for intercepting the first row at the half of the line direction of topography's block Image item is fast, the width of the width of the first row image stick for image in borderline region, a height of first intended pixel height threshold;
The second module of row part sampling, at a quarter of the line direction of topography's block and at 3/4ths, Intercept that the second row image item is fast, the third line image stick respectively, the second row image stick, the third line image stick width be institute State the width of image in borderline region, a height of second intended pixel height threshold;
The first module of row part sampling, for intercepting first row at the half of the column direction of topography's block Image item is fast, and the width of the first row image stick is the first intended pixel width threshold value, the height of image in a height of borderline region;
The second module of row part sampling, at a quarter of the column direction of topography's block and at 3/4ths, Interception secondary series image stick, third row image stick respectively, the secondary series image stick, third row image stick width be the Two intended pixel width threshold values, the height of image in a height of borderline region;
The part sampled images block includes above-mentioned the first row image stick, the second row image stick, the third line image item Block, first row image stick, secondary series image stick and third row image stick.
In a concrete application example, which can include:
Row stick statistical module, for respectively to the first row image stick, the second row image stick, described The black picture elements of three row image sticks carries out statistics with histogram, obtains each row image stick histogram, and by each row image stick Histogram Mapping determines to be mapped to the length along path angle value for each line segment being linked to be after abscissa to abscissa;
Row stick statistical module, for respectively to the first row image stick, the secondary series image stick, described The black picture elements of three row image sticks carries out statistics with histogram, obtains each row image stick histogram, and by each row image stick Histogram Mapping determines to be mapped to the length along path angle value for each line segment being linked to be after ordinate to ordinate;
Line segment number determining module, for determining to be mapped to the length along path angle value of each line segment after abscissa and ordinate In, the line segment number sum of all length along path angle value in the range of the first predetermined radii of each length along path angle value obtains each line segment The corresponding line segment number of length value;
Step-length module is determined with value, for calculating the corresponding line segment number of each length along path angle value, with the length along path angle value The corresponding line segment number of all length along path angle value and value in the range of second predetermined radii, and according to maximum corresponding with value The length along path angle value determines the predetermined Quick Response Code barcode scanning step-length.
In a particular technique is applied and value determines that step-length module can be by the maximum and corresponding line segment of value Length value is determined as the Quick Response Code barcode scanning step-length.
In another particular technique is applied and value determines that step-length module can be according to the maximum corresponding line with value Length value, default fluctuation range, determine the predetermined Quick Response Code barcode scanning step-length, the value packet of the predetermined Quick Response Code barcode scanning step-length It includes at least one.
In a particular technique example, the device of the present embodiment can also include two-dimensional code scanning initialization module, use In obtaining the predetermined Quick Response Code barcode scanning step-length, and the initialization of pattern is scanned according to predetermined Quick Response Code barcode scanning step-length.Tool The initialization of the scan pattern of body includes:Test point is the white point that pixel value is 255, neighbouring two picture of test point Each at element there are one the white points that pixel value is 255, respectively have auxiliary magnet at Quick Response Code barcode scanning step-length predetermined described in test point, The auxiliary magnet is the black color dots that pixel value is 0, at two neighbouring pixels of auxiliary magnet it is each there are one pixel value be 0 it is black Color dot.
In a particular technique example, the device of the present embodiment can also include deduplication module, for the two dimension Each Quick Response Code mode point that code scan module obtains carries out duplicate removal processing.At this point, above-mentioned cluster module 254 is to removing molality Treated that Quick Response Code mode point is clustered for block duplicate removal.Specific duplicate removal processing mode, may be used at present have and with Any mode being likely to occur afterwards carries out.
Figure 27 shows the structure diagram of the shear module in a specific example, as shown in figure 27, the shear module 257 include:
Abscissa origin coordinates determining module 2571, for the abscissa of cluster centre point to be subtracted the shearing width Abscissa origin coordinates of first abscissa value as topography to be sheared after half;
Abscissa end coordinate determining module 2572, for the abscissa of cluster centre point to be added the shearing width Abscissa end coordinate of second abscissa value as topography to be sheared after half;
Ordinate origin coordinates determining module 2573, for the ordinate of cluster centre point to be subtracted the shear height Ordinate origin coordinates of first ordinate value as topography to be sheared after half;
Ordinate end coordinate determining module, for the ordinate of cluster centre point to be added to the half of the shear height Ordinate end coordinate of the second ordinate value afterwards as 2574 topographies to be sheared;
Segment shear module 2575, for the abscissa origin coordinates, the abscissa knot in described image to be detected Segment between beam coordinate, ordinate origin coordinates, ordinate end coordinate is sheared, and acquisition includes the two of single Quick Response Code Wei Ma topographies.The Quick Response Code shearing length of side includes shear height and shearing width.
Wherein, abscissa origin coordinates determining module 2571, can also be when first abscissa value be less than 0, by institute It states abscissa origin coordinates and is set as 0, and when second abscissa value is more than the picture traverse of described image to be detected, it will The distance of the abscissa origin coordinates Forward second abscissa value and the difference of the picture traverse of described image to be detected.
Ordinate origin coordinates determining module 2572, can also be when first ordinate value be less than 0, by the vertical seat Mark origin coordinates is set as 0;It, will be described vertical and when second ordinate value is more than the picture altitude of described image to be detected Coordinate origin coordinates Forward second ordinate value and the distance of the difference of the picture altitude of described image to be detected.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, it is non-volatile computer-readable that the program can be stored in one It takes in storage medium, in the embodiment of the present invention, which can be stored in the storage medium of computer system, and be calculated by this At least one of machine system processor performs, to realize the flow for including the embodiment such as above-mentioned each method.Wherein, it is described Storage medium can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, it is all considered to be the range of this specification record.
Embodiment described above only expresses the several embodiments of the present invention, and description is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that those of ordinary skill in the art are come It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention Range.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

  1. A kind of 1. method of batch scanning Quick Response Code, which is characterized in that including step:
    Image is acquired, obtains image to be detected;
    Binary conversion treatment is carried out to described image to be detected, obtains binary image;
    The binary image is scanned according to predetermined Quick Response Code barcode scanning pattern, obtains Quick Response Code mode point;
    The Quick Response Code mode point is clustered, each cluster centre point after being clustered;
    Distance of each cluster centre point respectively with other each cluster centre points other than itself is calculated respectively, determines each cluster Central point and the lowest distance value of the distance of other each cluster centre points other than itself;
    Average distance between cluster centre point is determined according to the corresponding lowest distance value of each cluster centre point;
    Determine that Quick Response Code shears the length of side according to average distance between the cluster centre point;
    The length of side and cluster centre point are sheared according to the Quick Response Code, described image to be detected is sheared, is cut Each Quick Response Code topography for including single Quick Response Code respectively after cutting.
  2. 2. the method for batch scanning Quick Response Code according to claim 1, which is characterized in that according between the cluster centre point Average distance determines that the mode of the Quick Response Code shearing length of side includes:
    If 2 times of average distance are less than or equal to pre-set shear length of side threshold value between the cluster centre point, will be in the cluster 2 times of conducts of average distance Quick Response Code shearing length of side between heart point;
    If 2 times of average distance are more than the pre-set shear length of side threshold value between the cluster centre point, by the pre-set shear side Long threshold value shears the length of side as the Quick Response Code.
  3. 3. the method for batch scanning Quick Response Code according to claim 1, which is characterized in that the Quick Response Code shears length of side packet Include shear height and shearing width;
    The length of side and cluster centre point are sheared according to the Quick Response Code, described image to be detected is sheared, is cut The mode of each Quick Response Code topography comprising single Quick Response Code respectively after cutting includes:
    The first abscissa value after the abscissa of cluster centre point is subtracted the half of the shearing width is local as waiting to shear The abscissa origin coordinates of image;
    The abscissa of cluster centre point is local as waiting to shear plus the second abscissa value after the half of the shearing width The abscissa end coordinate of image;
    The first ordinate value after the ordinate of cluster centre point is subtracted the half of the shear height is local as waiting to shear The ordinate origin coordinates of image;
    The ordinate of cluster centre point is local as waiting to shear plus the second ordinate value after the half of the shear height The ordinate end coordinate of image;
    To the abscissa origin coordinates, abscissa end coordinate, ordinate origin coordinates, the vertical seat in described image to be detected Segment between mark end coordinate is sheared, and obtains the Quick Response Code topography for including single Quick Response Code.
  4. 4. the method for batch scanning Quick Response Code according to claim 3, which is characterized in that in including following items at least One:
    If first abscissa value is less than 0, the abscissa origin coordinates is set as 0;
    If second abscissa value is more than the picture traverse of described image to be detected, by abscissa origin coordinates Forward institute State the distance of the second abscissa value and the difference of the picture traverse of described image to be detected;
    If first ordinate value is less than 0, the ordinate origin coordinates is set as 0;
    If second ordinate value is more than the picture altitude of described image to be detected, by ordinate origin coordinates Forward institute State the second ordinate value and the distance of the difference of the picture altitude of described image to be detected.
  5. 5. the method for batch scanning Quick Response Code according to any one of claims 1 to 4, it is characterised in that:
    Before acquisition image obtains image to be detected, step is further included:It determines pre- under the present level of image capture device Determine Quick Response Code barcode scanning step-length;
    When being scanned according to predetermined Quick Response Code barcode scanning pattern to the binary image, according to the predetermined Quick Response Code barcode scanning Step-length is scanned the binary image, obtains the Quick Response Code mode point;
    Determine that the mode of the predetermined Quick Response Code barcode scanning step-length under the present level of image capture device includes:
    Under the present level of image capture device, scan and make a reservation for single Quick Response Code template, obtain single Quick Response Code template image;
    Binary conversion treatment is carried out to the single Quick Response Code template image, obtains binaryzation Quick Response Code template image;
    Count the black picture element histogram of the binaryzation Quick Response Code template image;
    Denoising is carried out to the black picture element histogram, obtains black picture element histogram after denoising;
    Black picture element histogram procession coordinate after the denoising is mapped, acquisition is mapped as the Local map after binary image As block;
    Image item sampling is carried out to topography's block, obtains local sampled images block;
    Statistics with histogram is carried out to each local sampled images block, obtains statistics with histogram as a result, and according to statistics with histogram As a result the predetermined Quick Response Code barcode scanning step-length is determined.
  6. 6. a kind of device of batch scanning Quick Response Code, which is characterized in that including:
    Image capture module for acquiring image, obtains image to be detected;
    First image processing module for carrying out binary conversion treatment to described image to be detected, obtains binary image;
    Response Code scan module for being scanned according to predetermined Quick Response Code barcode scanning pattern to the binary image, obtains two Tie up pattern point;
    Cluster module, for being clustered to the Quick Response Code mode point, each cluster centre point after being clustered;
    Cluster centre apart from determining module, for calculate respectively each cluster centre point respectively with other than itself other are each poly- The distance of class central point determines each cluster centre point and the most narrow spacing of the distance of other each cluster centre points other than itself Average distance between cluster centre point is determined from value, and according to the corresponding lowest distance value of each cluster centre point;
    Length of side determining module is sheared, for determining that Quick Response Code shears the length of side according to average distance between the cluster centre point;
    Shear module, for shearing the length of side and cluster centre point according to the Quick Response Code, to described image to be detected into Row shearing, each Quick Response Code topography for including single Quick Response Code respectively after being sheared.
  7. 7. the device of batch scanning Quick Response Code according to claim 6, it is characterised in that:
    The shearing length of side determining module, 2 times of average distance are less than or equal to pre-set shear between the cluster centre point During length of side threshold value, the length of side is sheared, and in the cluster using 2 times of average distance between the cluster centre point as the Quick Response Code When 2 times of average distance are more than the pre-set shear length of side threshold value between central point, using the pre-set shear length of side threshold value as institute State the Quick Response Code shearing length of side.
  8. 8. the device of batch scanning Quick Response Code according to claim 6, which is characterized in that the Quick Response Code shears length of side packet Include shear height and shearing width;
    The shear module includes:
    Abscissa origin coordinates determining module, after the abscissa of cluster centre point is subtracted the half of the shearing width Abscissa origin coordinates of first abscissa value as topography to be sheared;
    Abscissa end coordinate determining module, after by the abscissa of cluster centre point plus the half of the shearing width Abscissa end coordinate of second abscissa value as topography to be sheared;
    Ordinate origin coordinates determining module, after the ordinate of cluster centre point is subtracted the half of the shear height Ordinate origin coordinates of first ordinate value as topography to be sheared;
    Ordinate end coordinate determining module, after by the ordinate of cluster centre point plus the half of the shear height Ordinate end coordinate of second ordinate value as topography to be sheared;
    Segment shear module, for the abscissa origin coordinates, abscissa end coordinate, vertical in described image to be detected Segment between coordinate origin coordinates, ordinate end coordinate is sheared, and obtains the Quick Response Code part comprising single Quick Response Code Image.
  9. 9. the device of batch scanning Quick Response Code according to claim 8, which is characterized in that in including following items at least One:
    The abscissa origin coordinates determining module, when first abscissa value is less than 0, by the abscissa origin coordinates 0 is set as, and when second abscissa value is more than the picture traverse of described image to be detected, the abscissa is originated and is sat The distance of mark Forward second abscissa value and the difference of the picture traverse of described image to be detected;
    The ordinate origin coordinates determining module, when first ordinate value is less than 0, by the ordinate origin coordinates It is set as 0;And when second ordinate value is more than the picture altitude of described image to be detected, the ordinate is originated and is sat Mark Forward second ordinate value and the distance of the difference of the picture altitude of described image to be detected.
  10. 10. the device of the batch scanning Quick Response Code according to claim 6 to 9 any one, which is characterized in that the two dimension Code scan module is swept when being scanned according to predetermined Quick Response Code barcode scanning pattern to the binary image according to predetermined Quick Response Code Code step-length is scanned the binary image, obtains the Quick Response Code mode point;
    Described device further includes the Quick Response Code barcode scanning step-length determining module under the present level of determining image capture device, and described two Dimension code barcode scanning step-length determining module includes:
    Image scanning module under the present level of image capture device, scanning and making a reservation for single Quick Response Code template, obtains single A Quick Response Code template image;
    Second image processing module for carrying out binary conversion treatment to the single Quick Response Code template image, obtains binaryzation two Tie up code mask image;
    Statistics with histogram module, for counting the black picture element histogram of the binaryzation Quick Response Code template image;
    Denoising module for carrying out denoising to the black picture element histogram, obtains black picture element histogram after denoising;
    Mapping block, for mapping black picture element histogram procession coordinate after the denoising, acquisition is mapped as binaryzation Topography's block after image;
    Local decimation blocks for carrying out image item sampling to topography's block, obtain local sampled images block;
    Step-length determining module, for carrying out statistics with histogram to each local sampled images block, obtain statistics with histogram as a result, And the predetermined Quick Response Code barcode scanning step-length is determined according to statistics with histogram result.
CN201611191258.XA 2016-12-21 2016-12-21 Method and device for scanning two-dimensional codes in batch Active CN108229232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611191258.XA CN108229232B (en) 2016-12-21 2016-12-21 Method and device for scanning two-dimensional codes in batch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611191258.XA CN108229232B (en) 2016-12-21 2016-12-21 Method and device for scanning two-dimensional codes in batch

Publications (2)

Publication Number Publication Date
CN108229232A true CN108229232A (en) 2018-06-29
CN108229232B CN108229232B (en) 2021-02-19

Family

ID=62650870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611191258.XA Active CN108229232B (en) 2016-12-21 2016-12-21 Method and device for scanning two-dimensional codes in batch

Country Status (1)

Country Link
CN (1) CN108229232B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109934038A (en) * 2019-03-18 2019-06-25 阿里巴巴集团控股有限公司 Two dimensional code bearing calibration, device and equipment
CN110399760A (en) * 2019-07-23 2019-11-01 广东工业大学 A kind of batch two dimensional code localization method, device, electronic equipment and storage medium
CN112183148A (en) * 2020-09-18 2021-01-05 内江师范学院 Batch bar code positioning method and identification system
CN112580383A (en) * 2020-12-29 2021-03-30 科大讯飞(苏州)科技有限公司 Two-dimensional code identification method and device, electronic equipment and storage medium
CN115375625A (en) * 2022-07-25 2022-11-22 北京数美时代科技有限公司 Two-dimensional code detection decoding method, system, electronic device and medium
US11799418B2 (en) 2019-03-04 2023-10-24 Huawei Digital Power Technologies Co., Ltd. Method, apparatus, and system for obtaining electronic layout applied to photovoltaic array

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702019A (en) * 2009-11-26 2010-05-05 上海电机学院 Method for extracting residential areas in SAR image
CN102446264A (en) * 2010-10-15 2012-05-09 航天信息股份有限公司 Printing and scanning recognition method and system for two-dimensional code of special value-added tax invoice
CN102880850A (en) * 2012-09-19 2013-01-16 腾讯科技(深圳)有限公司 Batch scanning method of two-dimensional codes, and scanning equipment
CN103955660A (en) * 2014-04-22 2014-07-30 广州闪购软件服务有限公司 Method for recognizing batch two-dimension code images
US9314190B1 (en) * 2006-05-11 2016-04-19 Great Lakes Neurotechnologies Inc. Movement disorder recovery system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9314190B1 (en) * 2006-05-11 2016-04-19 Great Lakes Neurotechnologies Inc. Movement disorder recovery system and method
CN101702019A (en) * 2009-11-26 2010-05-05 上海电机学院 Method for extracting residential areas in SAR image
CN102446264A (en) * 2010-10-15 2012-05-09 航天信息股份有限公司 Printing and scanning recognition method and system for two-dimensional code of special value-added tax invoice
CN102880850A (en) * 2012-09-19 2013-01-16 腾讯科技(深圳)有限公司 Batch scanning method of two-dimensional codes, and scanning equipment
CN103955660A (en) * 2014-04-22 2014-07-30 广州闪购软件服务有限公司 Method for recognizing batch two-dimension code images

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11799418B2 (en) 2019-03-04 2023-10-24 Huawei Digital Power Technologies Co., Ltd. Method, apparatus, and system for obtaining electronic layout applied to photovoltaic array
CN109934038A (en) * 2019-03-18 2019-06-25 阿里巴巴集团控股有限公司 Two dimensional code bearing calibration, device and equipment
CN109934038B (en) * 2019-03-18 2021-12-07 创新先进技术有限公司 Two-dimensional code correction method, device and equipment
CN110399760A (en) * 2019-07-23 2019-11-01 广东工业大学 A kind of batch two dimensional code localization method, device, electronic equipment and storage medium
CN112183148A (en) * 2020-09-18 2021-01-05 内江师范学院 Batch bar code positioning method and identification system
CN112580383A (en) * 2020-12-29 2021-03-30 科大讯飞(苏州)科技有限公司 Two-dimensional code identification method and device, electronic equipment and storage medium
CN112580383B (en) * 2020-12-29 2023-08-29 科大讯飞(苏州)科技有限公司 Two-dimensional code identification method and device, electronic equipment and storage medium
CN115375625A (en) * 2022-07-25 2022-11-22 北京数美时代科技有限公司 Two-dimensional code detection decoding method, system, electronic device and medium

Also Published As

Publication number Publication date
CN108229232B (en) 2021-02-19

Similar Documents

Publication Publication Date Title
CN108229232A (en) The method of batch scanning Quick Response Code and the device of batch scanning Quick Response Code
EP3493101B1 (en) Image recognition method, terminal, and nonvolatile storage medium
US20210366122A1 (en) Method and apparatus for segmenting G-banded adhered chromosome based on geometrical characteristic and regional fusion, and chromosome karyotype analysis device
CN108960011B (en) Partially-shielded citrus fruit image identification method
CN110619333B (en) Text line segmentation method, text line segmentation device and electronic equipment
Bell et al. Assessment of ZooImage as a tool for the classification of zooplankton
CN107220647B (en) Crop center point positioning method and system under blade crossing condition
Fuchs et al. Computational pathology analysis of tissue microarrays predicts survival of renal clear cell carcinoma patients
CN109598271B (en) Character segmentation method and device
CN104036292A (en) Medical imaging digital film text area extracting method and system
CN104951440B (en) Image processing method and electronic equipment
CN105869122A (en) Image processing method and apparatus
CN107016417A (en) A kind of method and device of character recognition
CN111507119B (en) Identification code recognition method, identification code recognition device, electronic equipment and computer readable storage medium
CN111598090B (en) Method, device, equipment and storage medium for identifying marks on printed circuit board
CN116071348B (en) Workpiece surface detection method and related device based on visual detection
CN115880362B (en) Code region positioning method, device, computer equipment and computer readable storage medium
US20100142751A1 (en) Method and apparatus for analyzing panicle structure
CN109919863B (en) Full-automatic colony counter, system and colony counting method thereof
CN111047617B (en) Rectangle recognition optimization method, device and equipment
CN113553980A (en) Method, system and device for generating trademark graphic element codes of pictures
CN108416346A (en) The localization method and device of characters on license plate
CN109325910B (en) Computer data receiving and transmitting platform
CN111582286A (en) Method and device for determining homogeneity of printed circuit board
CN112541471A (en) Shielded target identification method based on multi-feature fusion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant