[go: up one dir, main page]

CN107358138B - Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device - Google Patents

Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device Download PDF

Info

Publication number
CN107358138B
CN107358138B CN201710424250.1A CN201710424250A CN107358138B CN 107358138 B CN107358138 B CN 107358138B CN 201710424250 A CN201710424250 A CN 201710424250A CN 107358138 B CN107358138 B CN 107358138B
Authority
CN
China
Prior art keywords
pixel
lines
ean
thinning
correcting
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.)
Expired - Fee Related
Application number
CN201710424250.1A
Other languages
Chinese (zh)
Other versions
CN107358138A (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.)
South China University of Technology SCUT
Guangdong Zhengye Technology Co Ltd
Original Assignee
South China University of Technology SCUT
Guangdong Zhengye Technology 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 South China University of Technology SCUT, Guangdong Zhengye Technology Co Ltd filed Critical South China University of Technology SCUT
Priority to CN201710424250.1A priority Critical patent/CN107358138B/en
Publication of CN107358138A publication Critical patent/CN107358138A/en
Application granted granted Critical
Publication of CN107358138B publication Critical patent/CN107358138B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1452Methods for optical code recognition including a method step for retrieval of the optical code detecting bar code edges
    • 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/146Methods for optical code recognition the method including quality enhancement steps

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (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)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a correction method of nonlinear distortion EAN bar codes, a mobile terminal and a storage device. The correction method comprises the following steps: step S1, sequentially carrying out binarization processing and reverse color processing on the nonlinear distortion EAN barcode image to obtain a reverse color image containing a background area and a foreground area; s2, screening and extracting the stripes in the foreground area according to a specific screening rule, and then refining the retained stripes by utilizing a skeleton extraction technology to obtain a single-pixel refined line set; s3, carrying out parallel correction on the thinning lines of the adjacent single pixels pairwise in sequence to obtain a parallel thinning line set; and step S4, performing area correction on the parallel thinning lines by adopting block sampling and bilinear interpolation technology to obtain EAN bar code corrected images with the same size. The EAN bar code correction method adopts the block sampling and interpolation technology to gradually correct, and has high stability and precision and small calculated amount.

Description

Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device
Technical Field
The invention relates to the field of graphic image processing, in particular to a correction method of nonlinear distortion EAN bar codes, a mobile terminal and a storage device.
Background
Ean (european Article Number Bar code) is a Bar code for goods formulated by the international association for coding articles, and is widely used in many fields such as goods circulation, book management, transportation, medical treatment and health, financial banking, etc. In practical application environments, the quality of a barcode image is reduced due to the influence of a shooting angle, the deformation of a barcode attachment surface and the like on the barcode captured by a camera, so that the accuracy of barcode identification is seriously reduced.
The EAN barcode distortion correction technique is a process of correcting nonlinear geometric distortions such as angular rotation and local distortion after separating out a barcode region.
The existing barcode distortion correction technology mainly has two types: (1) a bar code correction method based on straight line detection. By means of line detection methods such as Hough transformation and the like, the spatial distribution statistical characteristics of black and white stripes of the bar code are utilized to correct linear distortion bar codes such as rotational deformation or affine deformation. (2) A bar code correction method based on geometric space transformation. The distorted bar code is corrected by collecting a plurality of control point pairs and solving the solution of an equation set and then utilizing a space transformation matrix.
The existing bar code correction method has the following defects: (1) the linear detection method can only process linear distortions such as rigid body transformation or affine transformation introduced due to different shooting angles, cannot process nonlinear distortions such as local distortion, and has a limited application range. (2) The geometric space transformation method solves the equation set by using a matrix operation mode, and the solving calculation amount is large and complex. Under certain specific environments, the equation set itself may have no solution or infinite solutions, which results in low reliability and poor real-time performance.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a method for correcting an EAN barcode with nonlinear distortion, a mobile terminal and a storage device, which are intended to solve the problems that the prior art cannot handle nonlinear distortion such as local distortion, and is not highly reliable and poor in real-time performance.
The technical scheme of the invention is as follows:
a method for correcting nonlinear distortion EAN bar code comprises the following steps:
step S1, sequentially carrying out binarization processing and reverse color processing on the nonlinear distortion EAN barcode image to obtain a reverse color image containing a background area and a foreground area;
s2, screening and extracting the stripes in the foreground area according to a specific screening rule, and then refining the retained stripes by utilizing a skeleton extraction technology to obtain a single-pixel refined line set;
s3, carrying out parallel correction on the thinning lines of the adjacent single pixels pairwise in sequence to obtain a parallel thinning line set;
and step S4, performing area correction on the parallel thinning lines by adopting block sampling and bilinear interpolation technology to obtain EAN bar code corrected images with the same size.
The method for correcting the nonlinear distorted EAN barcode, wherein in step S1, the binarization processing method is a global binarization algorithm or a local adaptive binarization algorithm.
The method for correcting the nonlinear distorted EAN barcode, wherein in step S1, the process of the inverse color processing specifically includes: the light and dark stripes in the binarized image correspond to pixel values 0 and 255 respectively, the region corresponding to the pixel value 0 is called a background region, and the region corresponding to the pixel value 255 is called a foreground region.
The method for correcting the nonlinear distorted EAN barcode, wherein in step S2, the screening rule is: and calculating the pixel area of each foreground region, if the area of a single region is larger than the average value of the areas of all the foreground regions, reserving the foreground region, and if not, deleting the foreground region.
The method for correcting the nonlinear distorted EAN barcode, wherein the step S3 specifically includes:
step S31, sequentially selecting two adjacent thinning lines of single pixel, and respectively recording the thinning lines as LleftAnd LrightCalculating the statistical distance between the thinning lines of the single pixel by adopting a Hausdorff distance measurement method:
Figure BDA0001315833890000021
wherein l1,l2Respectively represent LleftAnd LrightUpper point, d (,) represents a two-dimensional euclidean distance;
step S32, drawing the thinning lines of the single pixels into straight line segments, wherein the distance between adjacent straight line segments is D (L) in the step S31left,Lright);
And S33, repeating the step S31 and the step S32, and sequentially and parallelly correcting the thinned stripes of the rest single pixels in sequence to obtain a parallel thinned stripe set.
The method for correcting the nonlinear distorted EAN barcode, wherein the step S4 specifically includes:
step S41, connecting the corresponding sampling points on two adjacent parallel thinning lines one by one, and mapping the pixel points on the connecting lines to the corresponding connecting lines between the corresponding parallel straight line segments by adopting a bilinear interpolation technology;
step S42, repeating the above process from top to bottom in a pixel-by-pixel traversing manner, correcting the pixels at all positions between the two adjacent thinning lines, and then traversing all the adjacent thinning lines in sequence to finish the correction of the pixels at all positions between the middle lines;
and step S43, performing single-line sampling area correction on the starting thinning line and the ending thinning line.
In the step S41, the point mapping relationship between the pixel point on the connecting line and the parallel straight line segment is as follows:
Figure BDA0001315833890000031
Figure BDA0001315833890000032
wherein (x)left,yleft) Is a point P on the left thin lineleft(x) of (C)right,yright) For the corresponding point P on the right thin lineright(x) of (C)S,yS) Is PleftAnd PrightThe coordinate (x, y) of a certain pixel point on the connecting line is the coordinate of the corresponding point between the parallel straight line segments.
The method for correcting the nonlinear distorted EAN barcode, wherein the step S43 specifically includes: calculating the normal direction of the sampling points on the edge lines, calculating the Euclidean distance between the intersection point of the normal line and the image boundary and the sampling points, and horizontally extending the Euclidean distance from the point corresponding to the sampling points on the straight line segment to the image boundary direction to obtain corresponding mapping boundary points, thereby completing the region correction of the initial thinning lines and the final thinning lines.
A mobile terminal comprising a processor and a memory communicatively coupled to the processor, the memory storing a computer program that, when executed by the processor, implements a method of correcting a non-linearly distorted EAN barcode as described above; the processor is used for calling a computer program in the memory to execute any one of the above correction methods for the nonlinear distorted EAN barcode.
A storage device storing a computer program capable of loading and executing a method of correcting a non-linearly distorted EAN barcode as described in any of the above.
Has the advantages that: the invention provides a correction method of nonlinear distortion EAN bar codes, a mobile terminal and a storage device. In addition, the invention adopts the block sampling and interpolation technology to gradually correct, has high stability and precision and small calculated amount.
Drawings
Fig. 1 is a flowchart of a method for correcting a non-linear distorted EAN barcode according to the present invention.
Fig. 2a is a schematic diagram of point extraction on adjacent refined lines in the adjacent line region correction step of the present invention.
FIG. 2b is a schematic diagram of corresponding point selection on parallel line segments in the adjacent line region correction step according to the present invention.
FIG. 3a is a schematic diagram of the calculation of the normal direction of the curve in the single line region calibration step according to the present invention.
FIG. 3b is a schematic diagram of the mapping of the sampling points to the calibrated image in the single line area calibration step of the present invention.
Fig. 4 is a functional schematic block diagram of a mobile terminal based on a nonlinear distortion EAN barcode correction method of the present invention.
Fig. 5 is a diagram illustrating the effect of binarization and inverse color processing on a nonlinear distortion EAN barcode image in the nonlinear distortion EAN barcode correction method of the present invention.
Fig. 6 is a diagram illustrating the effect of the nonlinear distortion EAN barcode image after screening and thinning processing in the nonlinear distortion EAN barcode correction method of the present invention.
Fig. 7 is a diagram showing the effect of the correction result on the adjacent thinned line region in the nonlinear distortion EAN barcode correction method of the present invention.
FIG. 8 is a diagram illustrating the final correction result of the nonlinear distortion EAN barcode correction method of the present invention.
Detailed Description
The invention provides a method for correcting nonlinear distorted EAN bar codes, a mobile terminal and a storage device, and further detailed description is given below to make the purpose, technical scheme and effect of the invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a preferred embodiment of a correction method of nonlinear distortion EAN bar codes, the correction flow is shown as figure 1, and the correction steps comprise:
and step S1, sequentially carrying out binarization processing and reverse color processing on the nonlinear distortion EAN barcode image to obtain a reverse color image containing a background area and a foreground area.
Specifically, first, binarization processing is performed on the barcode image. According to the collection quality of the actual barcode image, the binarization algorithm can select a global binarization algorithm or a local self-adaptive binarization algorithm such as a fixed threshold method or the Otsu method. And then, performing reverse color processing on the obtained binary image. After the reverse color, the original light and dark stripes correspond to pixel values 0 and 255, respectively. In general, the region corresponding to pixel 0 is referred to as the background region, and the region corresponding to pixel 255 is referred to as the foreground region.
And step S2, screening and extracting the stripes in the foreground area according to a specific screening rule, and then refining the retained stripes by utilizing a skeleton extraction technology to obtain a single-pixel refined line set.
Specifically, Freeman chain code technology is adopted for extractionThe boundary contour of the foreground region and the pixel area (denoted as S) of each isolated foreground region are calculatediI 1,2,3, …) and the average pixel area of all foreground regions (denoted as S)0) If S isi≥S0The foreground area is reserved, otherwise, the foreground area is deleted. Thus, the streak screening step is completed.
From the screening rules, the reserved foreground region sets are all stripes with relatively large areas and non-single-pixel widths, so that the foreground regions are refined by utilizing a skeleton extraction technology, and finally, a single-pixel-width line set is obtained.
It should be noted that the narrow stripes corresponding to the foreground regions smaller than the average pixel area of all the foreground regions are not extracted, so that a large error is prevented from being generated in the extraction process, the final correction precision is influenced, the narrow stripes are directly corrected in the subsequent region correction step, and the conventional processing methods for linear distortion, such as rigid body transformation or affine transformation, cannot respectively process the wide stripes and the thin stripes by different methods.
And step S3, carrying out parallel correction on the thinning lines of the adjacent single pixels pairwise in sequence to obtain a parallel thinning line set.
After the single-pixel refined line set is obtained, a group of straight line segments with the same size as the single-pixel refined stripes is additionally created. Specifically, two adjacent thinning lines are selected in sequence (from left to right or from right to left, the "sequence" in the present invention should be understood as such), and are respectively marked as LleftAnd Lright. Line L due to the influence of nonlinear distortionleftAnd LrightAre no longer parallel line segments. Calculating the statistical distance between lines by adopting a Hausdorff distance measurement method:
Figure BDA0001315833890000061
wherein l1,l2Respectively represent lines LleftAnd LrightPoint (c) above. d (, x) represents the two-dimensional euclidean distance.
Assuming that the horizontal direction is the x direction and the vertical direction is the y direction, the following rule is adoptedThe corrected vertical line segment CL is drawnleftAnd CLrightBelow with CLleftFor the sake of example:
first, CLleftIs defined as a line LleftThe horizontal x-coordinate average of all points in (1). The vertical y coordinate of the upper end point is defined as a line LleftVertical direction y coordinate of the upper end point of (a).
In the second step, the vertical y coordinate value of the lower end point is defined as CLleftCoordinate value of upper end point in vertical direction y and line LleftIs given as the sum of the pixel lengths (total number of 255 pixels).
Third step, CLleftThe pixel values of the line segments sequentially use L from top to bottomleftIs assigned.
CLrightIs defined as CLleftX coordinate plus D (L) in the horizontal directionleft,Lright). Other coordinate information definition method and CLleftAre completely consistent.
Drawing the single-pixel thinned lines into straight lines with the same length according to the steps, sequentially correcting all the thinned lines into parallel thinned lines, wherein the distance between the adjacent parallel lines is D (L) as described aboveleft,Lright)。
And step S4, performing area correction on the parallel thinning lines by adopting block sampling and bilinear interpolation technology to obtain EAN bar code corrected images with the same size.
Firstly, carrying out double-line area correction, namely correspondingly taking sampling points on two adjacent thinning lines, connecting the sampling points in a one-to-one correspondence manner, for example, connecting LleftLast first pixel and LrightLast first pixel point line, LleftUpper second pixel and LrightUpper second pixel point connecting line, LleftUpper third pixel and LrightAnd connecting the upper third pixel point, and so on. And mapping the pixel points on the connecting lines to the corresponding connecting lines between the corresponding parallel straight line segments by adopting a bilinear interpolation technology.
In particular, for exampleStarting from the left, two adjacent refinement lines L are selectedleftAnd LrightLet the corresponding corrected parallel straight line segment be CLleftAnd CLright。LleftAnd CLleftAre equal in length, LrightAnd CLrightAre equal in Length and are respectively marked as LengthleftAnd Lengthright. Suppose PleftIs LleftSort the kth coordinate point from top to bottom, then it is at LrightCorresponding point P onrightIs defined as being ordered from top to bottom as
Figure BDA0001315833890000071
The coordinate point of (2). PleftAnd PrightCorresponding point CP on the corrected imageleftAnd CPrightDefined as being ordered from top to bottom as k and
Figure BDA0001315833890000072
the coordinate point of (2). As shown in fig. 2a and 2 b.
The area correction process between adjacent refined lines is as follows:
suppose PleftHas the coordinates of (x)left,yleft),PrightHas the coordinates of (x)right,yright),CPleftHas the coordinates of (cx)left,cyleft),CPrightHas the coordinates of (cx)right,cyright). Line segment CPleftCPrightAny point CP (x, y) on the original image with the corresponding coordinate P (x)S,yS) Calculated by the following formula:
Figure BDA0001315833890000073
Figure BDA0001315833890000074
the pixel value of CP (x, y) is assigned P (x)S,yS) The pixel value of (2).
The above process is repeated from top to bottom pixel by pixel traversal, so that the pixels at all positions between two adjacent line regions can be corrected. All the adjacent lines are traversed in sequence by the method, and the correction of all the position pixels among the lines can be completed.
The correction method described above is directed to correction of the intermediate region, and includes not only correction of the streak that has been extracted but also direct correction of the streak that has not been extracted. However, the area to the left of the leftmost line and the area to the right of the rightmost line where the starting line and the ending line are located are not included, and single-line sampling area correction needs to be performed on two thinning lines at the edge. The correction method comprises the steps of calculating the normal direction of sampling points on the edge lines, calculating the Euclidean distance between the intersection point of the normal line and the image boundary and the sampling points, and horizontally extending the Euclidean distance from the point corresponding to the sampling points on the straight line segment to the image boundary direction to obtain corresponding mapping boundary points.
The method for correcting the single-line sampling region is described below by taking the rightmost line as an example.
Unlike the double line, the single line has no right-side corresponding side. As defined in the previous step, assume PleftHas the coordinates of (x)left,yleft),CPleftHas the coordinates of (cx)left,cyleft). The following gives the virtual PrightThe method of coordinates of (3) is shown in fig. 3a and 3 b.
First calculate point PleftThe specific method for calculating the curve normal direction is as follows: the given curves are sorted in ascending order according to the size of the y coordinate, and are marked as { Curve [ i [ ]]1, 2. Any point P on the curve with the serial number P is divided into two cases:
(1) the point P falls in the head or tail area of the curve, i.e. the serial number P of P is less than or equal to 5 or P is more than or equal to N-4. Taking the example that the point P falls on the head, the sampling point set Curve [0], Curve [1],. and Curve [ P +5] is taken. The set data is fitted to a straight line fitL, the direction of the fitL is taken as the tangent of the point, and then the normal direction toward the right side is calculated as the approximate normal direction of the point P.
(2) Point P falls in the middle of the curve. The set of sampling points is Curve [ p-5],. The remaining calculation is the same as in step (1). And will not be described in detail herein.
Then, a ray is taken along the normal direction, and the intersection point of the ray and the image boundary is marked as Pright. Calculate its Euclidean distance Lengthleft. Due to CLleftIs itself a vertical line segment, so CPrightIs taken as CPleftExtend distance to rightleftThe coordinates of (a). To this end, Pleft,PrightCP corresponding theretoleftAnd CPrightHave all been obtained. According to this calculation process, the area to the right of the rightmost line can be corrected. Similarly, the area to the left of the leftmost line can be corrected.
The present invention also provides a mobile terminal, as shown in fig. 4, the mobile terminal includes: a processor (processor)10, a memory (memory)20, a communication Interface (Communications Interface)30, and a bus 40. The processor 10, the memory 20 and the communication interface 30 complete mutual communication through the bus 40; the communication interface 30 is used for information transmission between communication devices of the mobile terminal; the processor 10 is used for calling the computer program in the memory 20 to execute the method provided by the above method embodiments.
When the system is started, the mobile terminal acquires a nonlinear distortion EAN barcode image, and performs binarization processing and reverse color processing in sequence to obtain a reverse color image containing a background area and a foreground area, wherein the processed effect is shown in FIG. 5; then, screening and extracting the stripes in the foreground region according to a specific screening rule, and refining the retained stripes by utilizing a skeleton extraction technology to obtain a single-pixel refined line set, as shown in fig. 6; and then, performing parallel correction on every two adjacent thinning lines of the single pixel in sequence to obtain a parallel thinning line set, and finally performing area correction on the parallel thinning lines by adopting block sampling and bilinear interpolation technology to obtain EAN barcode correction images with the same size, as shown in fig. 7 and 8.
The invention also provides a storage device, wherein the storage device stores a computer program which can be executed to realize the correction method of the nonlinear distorted EAN barcode.
In summary, the invention provides a correction method of a nonlinear distortion EAN barcode, a mobile terminal and a storage device, the correction method of the EAN barcode of the invention is based on the extraction of the shape characteristics of the barcode itself, no limitation is made on the distortion type, any nonlinear distortion deformation can be processed, and the universality is high. In addition, the invention adopts the block sampling and interpolation technology to gradually correct, has high stability and precision and small calculated amount.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (8)

1. A method for correcting nonlinear distortion EAN bar code is characterized by comprising the following steps:
step S1, sequentially carrying out binarization processing and reverse color processing on the nonlinear distortion EAN barcode image to obtain a reverse color image containing a background area and a foreground area;
s2, screening and extracting the stripes in the foreground area according to a specific screening rule, and then refining the retained stripes by utilizing a skeleton extraction technology to obtain a single-pixel refined line set;
s3, carrying out parallel correction on the thinning lines of the adjacent single pixels pairwise in sequence to obtain a parallel thinning line set;
s4, performing area correction on the parallel thinning lines by adopting block sampling and bilinear interpolation technology to obtain EAN bar code corrected images with the same size;
in step S2, the filtering rule is: calculating the pixel area of each foreground region, if the area of a single region is larger than the average value of the areas of all the foreground regions, reserving the foreground region, and if not, deleting the foreground region;
the step S3 specifically includes:
step S31, sequentially selecting two adjacent thinning lines of single pixel, and respectively recording the thinning lines as LleftAnd LrightCalculating the statistical distance between the thinning lines of the single pixel by adopting a Hausdorff distance measurement method:
Figure FDA0002210841490000011
wherein l1,l2Respectively represent LleftAnd LrightUpper point, d (,) represents a two-dimensional euclidean distance;
step S32, drawing the thinning lines of the single pixels into straight line segments, wherein the distance between adjacent straight line segments is D (L) in the step S31left,Lright);
And S33, repeating the step S31 and the step S32, and sequentially and parallelly correcting the thinned stripes of the rest single pixels in sequence to obtain a parallel thinned stripe set.
2. The method for correcting the nonlinear distorted EAN barcode according to claim 1, wherein in the step S1, the binarization processing method is a global binarization algorithm or a local adaptive binarization algorithm.
3. The method for correcting the nonlinear distorted EAN barcode according to claim 1, wherein in the step S1, the process of the reverse color processing specifically comprises: the light and dark stripes in the binarized image correspond to pixel values 0 and 255 respectively, the region corresponding to the pixel value 0 is called a background region, and the region corresponding to the pixel value 255 is called a foreground region.
4. The method for correcting the nonlinear distorted EAN barcode according to claim 1, wherein the step S4 specifically comprises:
step S41, connecting the corresponding sampling points on two adjacent parallel thinning lines one by one, and mapping the pixel points on the connecting lines to the corresponding connecting lines between the corresponding parallel straight line segments by adopting a bilinear interpolation technology;
step S42, repeating step S41 from top to bottom in a pixel-by-pixel traversing manner, correcting the pixels at all positions between the two adjacent thinning lines, and then traversing all the adjacent thinning lines in sequence to finish the correction of the pixels at all positions between the middle lines;
and step S43, performing single-line sampling area correction on the starting thinning line and the ending thinning line.
5. The method for correcting the nonlinear distorted EAN barcode as recited in claim 4, wherein in the step S41, the mapping relationship between the pixel points on the connecting line and the corresponding points between the parallel straight line segments is:
Figure FDA0002210841490000021
Figure FDA0002210841490000022
wherein (x)left,yleft) Is a point P on the left thin lineleft(x) of (C)right,yright) For the corresponding point P on the right thin lineright(x) of (C)S,yS) Is PleftAnd PrightThe coordinate (x, y) of a certain pixel point on the connecting line is the coordinate of the corresponding point between the parallel straight line segments.
6. The method for correcting the nonlinear distorted EAN barcode according to claim 4, wherein the step S43 is specifically as follows: calculating the normal direction of the sampling points on the edge lines, calculating the Euclidean distance between the intersection point of the normal line and the image boundary and the sampling points, and horizontally extending the Euclidean distance from the point corresponding to the sampling points on the straight line segment to the image boundary direction to obtain corresponding mapping boundary points, thereby completing the region correction of the initial thinning lines and the final thinning lines.
7. A mobile terminal comprising a processor and a memory communicatively coupled to the processor, the memory storing a computer program that, when executed by the processor, implements the method of correcting a non-linearly distorted EAN barcode according to any of claims 1 to 6; the processor is configured to call a computer program in the memory to perform the method for correcting a non-linearly distorted EAN barcode as claimed in any of the preceding claims 1 to 6.
8. A storage device storing a computer program capable of loading and executing the method of correcting a non-linearly distorted EAN barcode according to any of claims 1 to 6.
CN201710424250.1A 2017-06-07 2017-06-07 Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device Expired - Fee Related CN107358138B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710424250.1A CN107358138B (en) 2017-06-07 2017-06-07 Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710424250.1A CN107358138B (en) 2017-06-07 2017-06-07 Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device

Publications (2)

Publication Number Publication Date
CN107358138A CN107358138A (en) 2017-11-17
CN107358138B true CN107358138B (en) 2020-03-24

Family

ID=60273532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710424250.1A Expired - Fee Related CN107358138B (en) 2017-06-07 2017-06-07 Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device

Country Status (1)

Country Link
CN (1) CN107358138B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113592782B (en) * 2021-07-07 2023-07-28 山东大学 Method and system for extracting X-ray image defects of composite material carbon fiber core rod
CN116804532B (en) * 2023-08-24 2023-11-28 苏州中科行智智能科技有限公司 3D measurement method for distance between parallel line segments

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096795A (en) * 2010-11-25 2011-06-15 西北工业大学 Method for recognizing worn two-dimensional barcode image
CN102799850A (en) * 2012-06-30 2012-11-28 北京百度网讯科技有限公司 Bar code recognition method and device
CN102156970B (en) * 2011-04-14 2013-04-10 复旦大学 Fisheye image correction method based on distorted straight slope calculation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PE20100769A1 (en) * 2009-04-02 2010-11-25 Sicpa Holding Sa IDENTIFICATION AND AUTHENTICATION USING MARKINGS OF POLYMERIC LIQUID CRYSTAL MATERIAL

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096795A (en) * 2010-11-25 2011-06-15 西北工业大学 Method for recognizing worn two-dimensional barcode image
CN102156970B (en) * 2011-04-14 2013-04-10 复旦大学 Fisheye image correction method based on distorted straight slope calculation
CN102799850A (en) * 2012-06-30 2012-11-28 北京百度网讯科技有限公司 Bar code recognition method and device

Also Published As

Publication number Publication date
CN107358138A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN110866924B (en) Line structured light center line extraction method and storage medium
CN109409366B (en) Distorted image correction method and device based on angular point detection
CN104700062B (en) A method and device for identifying two-dimensional codes
CN108596166A (en) A kind of container number identification method based on convolutional neural networks classification
CN110119741B (en) Card image information identification method with background
CN106682629B (en) Identification algorithm for identity card number under complex background
CN114529459B (en) Method, system and medium for enhancing image edge
CN111680690B (en) Character recognition method and device
CN110348264B (en) QR two-dimensional code image correction method and system
CN111311497B (en) A barcode image angle correction method and device
CN103543277A (en) Blood type result recognition algorithm based on grey level analysis and type recognition
CN105975894B (en) A kind of one-dimension code recognizer based on auto-adaptable image edge detection and mapping model
CN113421210B (en) Surface point Yun Chong construction method based on binocular stereoscopic vision
CN113557520A (en) Character processing and character recognition method, storage medium and terminal device
CN107358138B (en) Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device
CN112419207A (en) Image correction method, device and system
CN114444565A (en) Image tampering detection method, terminal device and storage medium
CN108197624A (en) The recognition methods of certificate image rectification and device, computer storage media
CN106778766A (en) A kind of rotary digital recognition methods and system based on anchor point
CN112668578A (en) Pointer instrument reading method and device, computer equipment and storage medium
CN115147389B (en) Image processing method, device and computer readable storage medium
CN111178111A (en) Two-dimensional code detection method, electronic device, storage medium and system
CN113643290B (en) Straw counting method and device based on image processing and storage medium
CN114022856B (en) A method for identifying a drivable area on an unstructured road, an electronic device and a medium
CN110633705A (en) Low-illumination imaging license plate recognition method and device

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200324

CF01 Termination of patent right due to non-payment of annual fee