CN108629219B - Method and device for identifying one-dimensional code - Google Patents

Method and device for identifying one-dimensional code Download PDF

Info

Publication number
CN108629219B
CN108629219B CN201711336626.XA CN201711336626A CN108629219B CN 108629219 B CN108629219 B CN 108629219B CN 201711336626 A CN201711336626 A CN 201711336626A CN 108629219 B CN108629219 B CN 108629219B
Authority
CN
China
Prior art keywords
dimensional code
code image
target
original
point
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.)
Active
Application number
CN201711336626.XA
Other languages
Chinese (zh)
Other versions
CN108629219A (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.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer 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 PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201711336626.XA priority Critical patent/CN108629219B/en
Publication of CN108629219A publication Critical patent/CN108629219A/en
Application granted granted Critical
Publication of CN108629219B publication Critical patent/CN108629219B/en
Active 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/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14131D bar codes

Abstract

The invention is suitable for the technical field of one-dimensional code identification, and provides a method, a device and terminal equipment for identifying a one-dimensional code. The method comprises the following steps: acquiring image information of an original one-dimensional code; judging whether the original one-dimensional code image is inclined or not based on the image information; if so, performing point fetching on the original one-dimensional code image, and generating a target one-dimensional code image based on coordinates of the fetched points; and identifying the target one-dimensional code image to obtain an identification result. The invention realizes that the identification can be completed when the terminal equipment and the one-dimensional code have a certain angle, avoids the step of adjusting the terminal equipment and improves the identification efficiency.

Description

Method and device for identifying one-dimensional code
Technical Field
The invention belongs to the technical field of one-dimensional code identification, and particularly relates to a method and a device for identifying a one-dimensional code and terminal equipment.
Background
At present, a common scanning and identifying mode is point-to-plane or plane-to-plane scanning, that is, identification can be completed only by directly (horizontally or vertically) facing a terminal device (e.g., a POS machine) to a one-dimensional code, identification fails if the scanning device and the one-dimensional code have a certain angle, and identification can be completed only by adjusting the angle between the terminal device and the one-dimensional code, which causes low identification efficiency.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for identifying a one-dimensional code, so as to solve the problem of the method for identifying a one-dimensional code in the prior art.
A first aspect of an embodiment of the present invention provides a method for identifying a one-dimensional code, including:
acquiring image information of an original one-dimensional code;
judging whether the original one-dimensional code image is inclined or not based on the image information;
if so, performing point fetching on the original one-dimensional code image, and generating a target one-dimensional code image based on coordinates of the fetched points;
and identifying the target one-dimensional code image to obtain an identification result.
Optionally, the point fetching of the original one-dimensional code image, and the generating of the target one-dimensional code image based on the coordinates of the fetched point includes:
determining a line segment needing to take a point;
acquiring a point-taking coordinate of the line segment;
and combining the point coordinates to obtain a target one-dimensional code image.
Optionally, before combining the point coordinates to obtain the target one-dimensional code image, the method further includes:
determining the height of the target one-dimensional code image according to the number of the point coordinates;
and acquiring the width and the height of the original one-dimensional code image, and taking the larger value of the width and the height as the width of the target one-dimensional code image.
Optionally, identifying the target one-dimensional code image, and acquiring an identification result includes:
acquiring the width ratio of black and white stripes in the target one-dimensional code image;
decoding the target one-dimensional code image based on the width ratio.
A second aspect of an embodiment of the present invention provides an apparatus for identifying a one-dimensional code, including:
the acquisition module is used for acquiring the image information of the original one-dimensional code;
the judging module is used for judging whether the original one-dimensional code image is inclined or not based on the image information;
the point taking module is used for taking points of the original one-dimensional code image if the original one-dimensional code image is in the original one-dimensional code image and generating a target one-dimensional code image based on coordinates of the taken points;
and the identification module is used for identifying the target one-dimensional code image and acquiring an identification result.
Optionally, the point taking module includes:
the determining unit is used for determining a line segment needing to take a point;
the first acquisition unit is used for acquiring point-taking coordinates of the line segment;
and the combination unit is used for combining the point-taking coordinates to obtain a target one-dimensional code image.
Optionally, the apparatus for identifying a one-dimensional code further includes:
the determining module is used for determining the height of the target one-dimensional code image according to the number of the point-taking coordinates;
and the obtaining module is used for obtaining the width and the height of the original one-dimensional code image and taking the larger value of the width and the height as the width of the target one-dimensional code image.
Optionally, the identification module comprises:
the second acquisition unit is used for acquiring the width ratio of black and white stripes in the target one-dimensional code image;
a decoding unit for decoding the target one-dimensional code image based on the width ratio.
A third aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps in the method of the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of the first aspect.
In the embodiment of the invention, the image information of the original one-dimensional code is obtained, whether the original one-dimensional code image is inclined or not is judged based on the image information, if yes, the original one-dimensional code image is subjected to point fetching, a target one-dimensional code image is generated based on the coordinates of the fetched points, the target one-dimensional code image is identified, and an identification result is obtained, so that the identification can be completed when the terminal equipment and the one-dimensional code have a certain angle, the step of adjusting the terminal equipment is avoided, and the identification efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a method for identifying a one-dimensional code according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of step 103 according to an embodiment of the present invention;
FIG. 3 is a schematic illustration of point taking in an embodiment of the invention;
fig. 4 is a schematic flow chart illustrating an implementation of a method for identifying a one-dimensional code according to a second embodiment of the present invention;
FIG. 5 is a flowchart illustrating an implementation of step 104 according to an embodiment of the present invention;
fig. 6 is a block diagram of an apparatus for identifying a one-dimensional code according to a third embodiment of the present invention;
fig. 7 is a schematic diagram of a terminal device according to a fourth embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when … …" or "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Example one
Fig. 1 is a schematic diagram illustrating an implementation flow of a method for identifying a one-dimensional code according to an embodiment of the present invention. As shown in fig. 1, the method for identifying a one-dimensional code specifically includes the following steps 101 to 102.
Step 101: and acquiring image information of the original one-dimensional code.
The original one-dimensional code is the one-dimensional code itself, that is, the one-dimensional code includes black stripes and white stripes. Generally, an original one-dimensional code is photographed (or scanned) by a camera on a terminal device, and image information of the original one-dimensional code is acquired.
Step 102: and judging whether the original one-dimensional code image is inclined or not based on the image information, if so, executing a step 103, and if not, normally scanning and identifying.
Illustratively, whether the original one-dimensional code is tilted is determined by comparing whether the image information is in a preset region, if the original one-dimensional code is tilted, step 103 is executed, and if the original one-dimensional code is not tilted, that is, the terminal device faces the original one-dimensional code, the identification is completed by normal scanning according to a method in the prior art.
Step 103: and taking points of the original one-dimensional code image, and generating a target one-dimensional code image based on the coordinates of the taken points.
Illustratively, as shown in fig. 2, the point-fetching of the original one-dimensional code image, and the generating of the target one-dimensional code image based on the coordinates of the fetched point includes:
step 201: and determining the line segment needing to take the point.
Illustratively, the point to be taken is represented in the form of coordinates (x, y), and the line segment requiring the point to be taken is first determined before the point is taken.
Step 202: and acquiring the point-taking coordinates of the line segment.
For example, as shown in fig. 3, in an image with a white area of 640 × 480, performing line segment point extraction to obtain a coordinate array, and for convenience of representation, a value set of x and a value set of y are respectively shown as follows: x ═ 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 98, 98, 99, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 125, 128, 127, 127, 130, 131, 129, 143, 133, 133, 133, 143, 142, 139, 139, 146, 146, 147, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 158, 159, 160, 160, 161, 162, 163, 164, 165, 166, 167, 167, 168, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 192, 193, 194, 194, 195, 196, 197, 198, 199, 200, 200, 201, 202, 203, 204, 205, 206, 207, 208, 208, 209, 210, 211, 212, 213, 214, 215, 215, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 225, 226, 227, 228, 228, 229, 230, 231, 232, 233, 234, 235, 235, 236, 237, 238, 239, 240, 241, 241, 242, 243, 244, 245, 246, 247, 248, 248, 249, 250, 251, 252, 253, 254, 255, 255, 256, 257, 258, 259, 260, 261, 262, 262, 263, 264, 265, 266, 267, 268, 268, 269, 270, 271, 272, 273, 274, 275, 276, 276, 277, 278, 279, 280, 281, 282, 282, 283, 284, 285, 286, 287, 288, 289, 289, 290, 291, 292, 293, 294, 295, 296, 296, 297, 298, 299, 300, 301, 302, 303, 303, 304, 305, 306, 307, 308, 309, 310, 310, 311, 312, 313, 314, 315, 316, 317, 317, 318, 319, 320, 321, 322, 323, 323, 324, 325, 326, 327, 328, 329, 330, 330, 331, 332, 333, 334, 335, 336, 336, 337, 338, 339, 340, 341, 342, 343, 344, 344, 345, 346, 347, 348, 349, 350, 351, 351, 352, 353, 354, 355, 356, 357, 357, 358, 359, 360, 361, 362, 363, 364, 364, 365, 366, 367, 368, 369, 370, 371, 371, 372, 373, 374, 375, 376, 377, 378, 378, 379, 380, 381, 382, 383, 384, 385, 386, 386, 387, 388, 389, 390, 391, 392, 392, 393, 394, 395, 396, 397, 398, 399, 399, 400, 401, 402, 403, 404, 405, 405, 406, 407, 408, 409, 410, 411, 412, 412, 413, 414, 415, 416, 417, 418, 419, 419, 429, 420, 421, 422, 423, 424, 425, 426, 426, 427, 428, 429, 430, 431, 432, 432, 433, 434, 435, 436, 437, 438, 447, 439, 440, 440, 441, 442, 443, 444, 445, 446, 447, 447, 448, 449, 450 };
y={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476}。
step 203: and combining the point coordinates to obtain a target one-dimensional code image.
Corresponding the values in the value set of x and the value set of y in step 202 to the { x, y } coordinates of the constituent points, that is, taking one line of the target one-dimensional code image, according to the above description that the width of the target one-dimensional code image is 640, taking 477 points in the current image, and directly filling 0 in the ordinate y of the remaining 123 points. And establishing a plurality of linear coordinates of the points, and sequentially taking out the points in the original one-dimensional code image according to the coordinates to obtain a target one-dimensional code image.
Step 104: and identifying the target one-dimensional code image to obtain an identification result.
Since the target one-dimensional code image obtained by taking the point has the same characteristics as the original one-dimensional code image, the recognition result can be obtained by recognizing the target one-dimensional code image.
In the embodiment of the invention, the image information of the original one-dimensional code is obtained, whether the original one-dimensional code image is inclined or not is judged based on the image information, if yes, the original one-dimensional code image is subjected to point fetching, a target one-dimensional code image is generated based on the coordinates of the fetched points, the target one-dimensional code image is identified, and an identification result is obtained, so that the identification can be completed when the terminal equipment and the one-dimensional code have a certain angle, the step of adjusting the terminal equipment is avoided, and the identification efficiency is improved.
Example two
Fig. 4 is a schematic flow chart illustrating an implementation of the method for identifying a one-dimensional code according to the second embodiment of the present invention. As shown the method may comprise the steps of:
step 301: and determining the line segment needing to take the point.
Step 302: and acquiring the point-taking coordinates of the line segment.
Step 303: and determining the height of the target one-dimensional code image according to the number of the point coordinates.
The number of point coordinates is the number of actual points, or the number of points is 477 in the first embodiment, so the height of the target one-dimensional code image is 477 (millimeters).
Step 304: and acquiring the width and the height of the original one-dimensional code image, and taking the larger value of the width and the height as the width of the target one-dimensional code image.
When the width of the original one-dimensional code image is larger than the height, taking the width of the original one-dimensional code image as the width of the target one-dimensional code image; and when the height of the original one-dimensional code image is larger than the width, taking the height of the original one-dimensional code image as the width of the target one-dimensional code image.
Step 305: and combining the point coordinates to obtain a target one-dimensional code image.
The steps 301, 302, and 305 are respectively the same as the steps 201 to 203, and reference may be specifically made to the related descriptions of the steps 201 to 203, which are not repeated herein.
On the basis of the embodiment of the present invention, as a preferred implementation of the present invention, as shown in fig. 5, identifying the target one-dimensional code image, and acquiring an identification result includes:
step 401: and acquiring the width ratio of black and white stripes in the target one-dimensional code image.
Step 402: decoding the target one-dimensional code image based on the width ratio.
For steps 401 to 402, since the width ratio of the black-and-white stripes in the target one-dimensional code image is the same as the width ratio of the black-and-white stripes in the original one-dimensional code image, the original one-dimensional code image can be decoded indirectly by obtaining the width ratio of the black-and-white stripes in the target one-dimensional code image, so as to achieve the purpose of identifying the original one-dimensional code image.
In the embodiment of the invention, the width and the height of the target one-dimensional code image are obtained according to the actual condition of point extraction, the number of the point extraction can be adjusted according to actual needs to adjust the precision of the target one-dimensional code image, and the operation is flexible.
EXAMPLE III
Referring to fig. 6, a block diagram of an apparatus for identifying a one-dimensional code according to a third embodiment of the present invention is shown. The apparatus 50 for recognizing a one-dimensional code includes: an acquisition module 51, a judgment module 52, a point taking module 53 and an identification module 54. The specific functions of each module are as follows:
an obtaining module 51, configured to obtain image information of an original one-dimensional code;
a judging module 52, configured to judge whether the original one-dimensional code image is tilted based on the image information;
a point fetching module 53, configured to, if yes, perform point fetching on the original one-dimensional code image, and generate a target one-dimensional code image based on coordinates of the fetched points;
and the identifying module 54 is configured to identify the target one-dimensional code image and obtain an identification result.
Optionally, the point taking module 53 includes:
the determining unit is used for determining a line segment needing to take a point;
the first acquisition unit is used for acquiring point-taking coordinates of the line segment;
and the combination unit is used for combining the point-taking coordinates to obtain a target one-dimensional code image.
Optionally, the apparatus 50 for identifying a one-dimensional code further comprises:
the determining module is used for determining the height of the target one-dimensional code image according to the number of the point-taking coordinates;
and the obtaining module is used for obtaining the width and the height of the original one-dimensional code image and taking the larger value of the width and the height as the width of the target one-dimensional code image.
Optionally, the identification module 54 comprises:
the second acquisition unit is used for acquiring the width ratio of black and white stripes in the target one-dimensional code image;
a decoding unit for decoding the target one-dimensional code image based on the width ratio.
According to the device for identifying the one-dimensional code, provided by the embodiment of the invention, the image information of the original one-dimensional code is obtained, whether the image of the original one-dimensional code is inclined or not is judged based on the image information, if yes, the image of the original one-dimensional code is subjected to point picking, the target one-dimensional code image is generated based on the coordinates of the picked point, the target one-dimensional code image is identified, and the identification result is obtained, so that the identification can be finished when the terminal equipment and the one-dimensional code have a certain angle, the step of adjusting the terminal equipment is avoided, and the identification efficiency is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example four
Fig. 7 is a schematic diagram of a terminal device according to a fifth embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62, such as a method program for identifying a one-dimensional code, stored in said memory 61 and executable on said processor 60. The processor 60, when executing the computer program 62, implements the steps in the above-described embodiments of the method for identifying a one-dimensional code, such as the steps 101 to 104 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules in the above-described device embodiments, such as the functions of the modules 51 to 54 shown in fig. 6.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the terminal device 6. For example, the computer program 62 may be divided into an acquisition unit and an analysis unit, the specific functions of each unit being as follows:
the terminal device 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device and is not limiting and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input output devices, network access devices, buses, etc.
The processor 60 may be a Central Processing Unit (CPU), other general purpose processor, a Digital signal processor (DP), an Application specific Integrated Circuit (AIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart Memory Card (MC), a secure Digital (D) Card, a flash memory Card (Flah Card), and the like, which are equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing the computer program and other programs and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A method of identifying a one-dimensional code, comprising:
acquiring image information of an original one-dimensional code;
judging whether the original one-dimensional code image is inclined or not based on the image information;
if so, performing point fetching on the original one-dimensional code image, and generating a target one-dimensional code image based on coordinates of the fetched points;
identifying the target one-dimensional code image to obtain an identification result;
the point fetching of the original one-dimensional code image and the generation of the target one-dimensional code image based on the coordinates of the fetched point comprise the following steps:
determining a line segment needing to take a point;
acquiring a point-taking coordinate of the line segment;
and combining the point coordinates to obtain a target one-dimensional code image.
2. The method for identifying one-dimensional code according to claim 1, wherein before combining the coordinates of the sampling points to obtain the target one-dimensional code image, the method further comprises:
determining the height of the target one-dimensional code image according to the number of the point coordinates;
and acquiring the width and the height of the original one-dimensional code image, and taking the larger value of the width and the height as the width of the target one-dimensional code image.
3. The method for recognizing a one-dimensional code according to claim 2, wherein the recognizing the target one-dimensional code image and obtaining the recognition result comprises:
acquiring the width ratio of black and white stripes in the target one-dimensional code image;
decoding the target one-dimensional code image based on the width ratio.
4. An apparatus for recognizing a one-dimensional code, comprising:
the acquisition module is used for acquiring the image information of the original one-dimensional code;
the judging module is used for judging whether the original one-dimensional code image is inclined or not based on the image information;
the point taking module is used for taking points of the original one-dimensional code image if the original one-dimensional code image is in the original one-dimensional code image and generating a target one-dimensional code image based on coordinates of the taken points;
the identification module is used for identifying the target one-dimensional code image to obtain an identification result;
the point taking module comprises:
the determining unit is used for determining a line segment needing to take a point;
the first acquisition unit is used for acquiring point-taking coordinates of the line segment;
and the combination unit is used for combining the point-taking coordinates to obtain a target one-dimensional code image.
5. The apparatus for recognizing a one-dimensional code according to claim 4, further comprising:
the determining module is used for determining the height of the target one-dimensional code image according to the number of the point-taking coordinates;
and the obtaining module is used for obtaining the width and the height of the original one-dimensional code image and taking the larger value of the width and the height as the width of the target one-dimensional code image.
6. The apparatus for recognizing a one-dimensional code according to claim 5, wherein said recognition module comprises:
the second acquisition unit is used for acquiring the width ratio of black and white stripes in the target one-dimensional code image;
a decoding unit for decoding the target one-dimensional code image based on the width ratio.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 3 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN201711336626.XA 2017-12-14 2017-12-14 Method and device for identifying one-dimensional code Active CN108629219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711336626.XA CN108629219B (en) 2017-12-14 2017-12-14 Method and device for identifying one-dimensional code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711336626.XA CN108629219B (en) 2017-12-14 2017-12-14 Method and device for identifying one-dimensional code

Publications (2)

Publication Number Publication Date
CN108629219A CN108629219A (en) 2018-10-09
CN108629219B true CN108629219B (en) 2021-04-23

Family

ID=63705901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711336626.XA Active CN108629219B (en) 2017-12-14 2017-12-14 Method and device for identifying one-dimensional code

Country Status (1)

Country Link
CN (1) CN108629219B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753839A (en) * 2019-01-16 2019-05-14 上海龙旗科技股份有限公司 Two dimensional code identifies optimization method and equipment
CN112819118A (en) * 2020-12-31 2021-05-18 上海思岚科技有限公司 Coded radar marker and identification method and equipment thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1776708A (en) * 2004-11-20 2006-05-24 三星电子株式会社 Method and apparatus for reading a barcode
CN101840496A (en) * 2010-06-01 2010-09-22 福建新大陆电脑股份有限公司 One-dimensional barcode decoding chip
CN101901328A (en) * 2009-05-29 2010-12-01 株式会社东芝 Barcode processing apparatus and barcode processing method
CN104067296A (en) * 2011-12-23 2014-09-24 康耐视公司 Methods and apparatus for one-dimensional signal extraction
CN105956509A (en) * 2016-04-26 2016-09-21 昂纳自动化技术(深圳)有限公司 Method and device for one-dimensional bar code detection based on clustering algorithm
CN107392078A (en) * 2017-06-14 2017-11-24 深圳市百富智能新技术有限公司 Method, terminal device and the computer-readable recording medium of multi-angle scanning

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9230140B1 (en) * 2014-12-30 2016-01-05 Hand Held Products, Inc. System and method for detecting barcode printing errors

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1776708A (en) * 2004-11-20 2006-05-24 三星电子株式会社 Method and apparatus for reading a barcode
CN101901328A (en) * 2009-05-29 2010-12-01 株式会社东芝 Barcode processing apparatus and barcode processing method
CN101840496A (en) * 2010-06-01 2010-09-22 福建新大陆电脑股份有限公司 One-dimensional barcode decoding chip
CN104067296A (en) * 2011-12-23 2014-09-24 康耐视公司 Methods and apparatus for one-dimensional signal extraction
CN105956509A (en) * 2016-04-26 2016-09-21 昂纳自动化技术(深圳)有限公司 Method and device for one-dimensional bar code detection based on clustering algorithm
CN107392078A (en) * 2017-06-14 2017-11-24 深圳市百富智能新技术有限公司 Method, terminal device and the computer-readable recording medium of multi-angle scanning

Also Published As

Publication number Publication date
CN108629219A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
CN110660066B (en) Training method of network, image processing method, network, terminal equipment and medium
CN111178250B (en) Object identification positioning method and device and terminal equipment
CN109166156B (en) Camera calibration image generation method, mobile terminal and storage medium
CN109002820B (en) License plate recognition method and device and related equipment
CN109117773B (en) Image feature point detection method, terminal device and storage medium
CN109886928B (en) Target cell marking method, device, storage medium and terminal equipment
WO2020252920A1 (en) Picture correction method and apparatus, computer device and computer-readable storage medium
CN108090486B (en) Image processing method and device in billiard game
CN112348765A (en) Data enhancement method and device, computer readable storage medium and terminal equipment
CN111860489A (en) Certificate image correction method, device, equipment and storage medium
CN112348778B (en) Object identification method, device, terminal equipment and storage medium
CN111860060A (en) Target detection method and device, terminal equipment and computer readable storage medium
US20230214989A1 (en) Defect detection method, electronic device and readable storage medium
CN111882565B (en) Image binarization method, device, equipment and storage medium
CN111290684B (en) Image display method, image display device and terminal equipment
CN114638294A (en) Data enhancement method and device, terminal equipment and storage medium
CN108629219B (en) Method and device for identifying one-dimensional code
CN108960246B (en) Binarization processing device and method for image recognition
CN109389628B (en) Image registration method, apparatus and storage medium
CN110738204A (en) Method and device for positioning certificate areas
CN112966719B (en) Method and device for recognizing instrument panel reading and terminal equipment
KR102421604B1 (en) Image processing methods, devices and electronic devices
CN111222446B (en) Face recognition method, face recognition device and mobile terminal
CN110969640A (en) Video image segmentation method, terminal device and computer-readable storage medium
CN112418089A (en) Gesture recognition method and device and terminal

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