CN112598100A - Method for determining specification of dot matrix type DM two-dimensional code and related device - Google Patents

Method for determining specification of dot matrix type DM two-dimensional code and related device Download PDF

Info

Publication number
CN112598100A
CN112598100A CN202011542536.8A CN202011542536A CN112598100A CN 112598100 A CN112598100 A CN 112598100A CN 202011542536 A CN202011542536 A CN 202011542536A CN 112598100 A CN112598100 A CN 112598100A
Authority
CN
China
Prior art keywords
point
points
dimensional code
determining
target
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.)
Pending
Application number
CN202011542536.8A
Other languages
Chinese (zh)
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.)
DeepBlue AI Chips Research Institute Jiangsu Co Ltd
Original Assignee
DeepBlue AI Chips Research Institute Jiangsu 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 DeepBlue AI Chips Research Institute Jiangsu Co Ltd filed Critical DeepBlue AI Chips Research Institute Jiangsu Co Ltd
Priority to CN202011542536.8A priority Critical patent/CN112598100A/en
Publication of CN112598100A publication Critical patent/CN112598100A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The application provides a lattice DM two-dimensional code specification determining method and a related device, the lattice DM two-dimensional code comprises a real edge of an L type and a virtual edge of the L type, the virtual edge comprises a transverse part and a vertical part, and the method comprises the following steps: acquiring image information of the dot matrix DM two-dimensional code; determining the number of points of the transverse part and the vertical part according to the image information of the dot-matrix D M two-dimensional code; and determining the specification of the dot matrix DM two-dimensional code according to the number of the dots of the horizontal part and the vertical part. The point information of the L-shaped virtual edge can be acquired according to the image information of the dot-matrix DM two-dimensional code, so that the specification of the dot-matrix D M two-dimensional code is determined.

Description

Method for determining specification of dot matrix type DM two-dimensional code and related device
Technical Field
The application relates to the technical field of two-dimensional codes, in particular to a method for determining specifications of a dot matrix type DM two-dimensional code and a related device.
Background
With the rapid development of science and technology, the application of the two-dimensional code is popularized in various aspects of life, work, production and the like. The DM (DataMatrix) code is a matrix two-dimensional barcode, and is characterized by high density, and the minimum size is the smallest code among all barcodes at present. Due to the excellent error correction capability of the DM code, the DM code has become the mainstream technology of the industrial two-dimensional barcode.
However, in actual industrial production, the two-dimensional code on the surface of the chip is printed to cause chipping or excessive noise interference, which makes it difficult to determine the specification of the chip.
Disclosure of Invention
The application aims to provide a method and a related device for determining the specification of a dot matrix DM two-dimensional code, which can acquire point information of an L-shaped virtual edge according to image information of the dot matrix DM two-dimensional code, so as to determine the specification of the dot matrix DM two-dimensional code.
The purpose of the application is realized by adopting the following technical scheme:
in a first aspect, the present application provides a method for determining a specification of a dot matrix DM two-dimensional code, where the dot matrix DM two-dimensional code includes a real edge of an L type and a virtual edge of the L type, the virtual edge includes a horizontal portion and a vertical portion, and the method includes: acquiring image information of the dot matrix DM two-dimensional code; determining the number of points of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code; and determining the specification of the dot matrix DM two-dimensional code according to the number of the dots of the horizontal part and the vertical part. The technical scheme has the beneficial effects that the point information of the L-shaped virtual edge can be acquired according to the image information of the dot matrix DM two-dimensional code, so that the specification of the dot matrix DM two-dimensional code is determined.
In some optional embodiments, the determining the number of points of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code includes: with the horizontal portion and the vertical portion as target portions, respectively, performing the following processing on the target portions: acquiring the number of undetermined points of the target part according to the image information of the dot matrix DM two-dimensional code; detecting whether the target part has point number deviation or not according to the number of points to be fixed of the target part; and when the target part has point deviation, acquiring the correction point of the target part as the point of the target part. The technical scheme has the beneficial effects that on one hand, whether point number deviation exists in a target part can be detected according to the number of undetermined points; on the other hand, when the target part has point deviation, the number of the fixed points can be corrected to obtain the number of the corrected points, so that the actual specification of the dot matrix DM two-dimensional code is determined according to the number of the corrected points.
In some optional embodiments, the determining the number of points of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code further includes: and when the target part has no point deviation, determining the number of undetermined points of the target part as the point number of the target part. The technical scheme has the beneficial effects that when the target part has no point deviation, the number of points to be determined does not need to be corrected, and the specification of the dot matrix type DM two-dimensional code can be directly determined according to the number of the points to be determined.
In some optional embodiments, the detecting whether there is a point deviation in the target portion includes: acquiring position information of each point of the target part; calculating the distance between every two adjacent points of the target part to obtain a plurality of distances; obtaining the average value and the median value of the plurality of distances; when the average value is larger than the median value, determining that point number deviation exists in the target part and the deviation type is few points; when the average value is smaller than the median value, determining that the target part has point number deviation and the deviation type is multipoint. The technical scheme has the beneficial effects that on one hand, whether point deviation exists or not can be judged by comparing the average value and the median value of a plurality of distances, the point deviation does not exist when the average value and the median value are equal, and the point deviation exists when the average value and the median value are not equal; on the other hand, the type of the point number deviation can be judged, when the average value is larger than the median value, the deviation type is few points, and when the average value is smaller than the median value, the deviation type is multiple points.
In some optional embodiments, the obtaining the correction point number of the target portion as the point number of the target portion includes: when the deviation type is few points, supplementing missing points in the target part to obtain the correct point number of the target part; and when the deviation type is multi-point, removing redundant points from the target part to obtain the correct point number of the target part. The technical scheme has the advantages that the number of the target part can be correspondingly corrected according to the type of the number deviation to obtain the correct number, so that the specification of the dot matrix type DM two-dimensional code is determined according to the correct number.
In some optional embodiments, the complementing the missing points in the target portion comprises: for each two adjacent points of the target portion, respectively detecting whether a distance between the two adjacent points is greater than the average value; when the distance between the two adjacent points is greater than the average value, a point is inserted between the two adjacent points. The technical scheme has the beneficial effects that by comparing the distance and the average value between every two adjacent points, on one hand, whether point number deviation exists between every two adjacent points can be judged, when the distance and the average value between every two adjacent points are equal, the point number deviation does not exist between every two adjacent points, and when the distance and the average value between every two adjacent points are not equal, the point number deviation exists between every two adjacent points; on the other hand, when the distance between two adjacent points is greater than the average value, it may be determined that there is a few points between the two adjacent points, and a point may be inserted between the two adjacent points, thereby completing the correction of the number of points.
In some optional embodiments, the removing of the unwanted points from the target portion comprises: for each two adjacent points of the target portion, respectively detecting whether the distance between the two adjacent points is less than the average value; when the distance between the two adjacent points is smaller than the average value, putting the two adjacent points into an alternative group; sorting all points in the alternative group in order of each point in a first direction, the first direction being used for indicating a direction in which one end point of the target portion points to another end point; removing from the target portion the points in the alternative set that are ranked in the intermediate position. The technical scheme has the beneficial effects that on one hand, by comparing the distance between every two adjacent points with the average value, when the distance between the two adjacent points is smaller than the average value, the multipoint condition between the two adjacent points can be determined; on the other hand, the correction of the number of points can be completed by removing the point of the candidate group located at the middle position and removing one point with a deviation in position from two adjacent points whose distance is smaller than the average value.
In some optional embodiments, the determining the specification of the lattice-type DM two-dimensional code according to the number of points of the horizontal portion and the vertical portion includes: acquiring position information of each point of the transverse part and the vertical part; and determining the specification of the dot matrix type DM two-dimensional code according to the number of the horizontal parts and the vertical parts and the position information of each point of the horizontal parts and the vertical parts. The technical scheme has the advantages that the specification of the dot matrix type DM two-dimensional code can be judged by acquiring the position information of each point of the transverse part and the vertical part and combining the number of the transverse part and the vertical part and the position information of the corresponding point.
In a second aspect, the present application provides a device is confirmed to dot matrix DM two-dimensional code specification, dot matrix DM two-dimensional code includes the real limit of L type and the virtual limit of L type, virtual limit includes horizontal part and vertical part, the device includes: the information acquisition module is used for acquiring the image information of the dot matrix DM two-dimensional code; the point number determining module is used for determining the point number of the transverse part and the vertical part according to the image information of the dot matrix DM two-dimensional code; and the specification determining module is used for determining the specification of the dot matrix type DM two-dimensional code according to the number of the dots of the horizontal part and the vertical part.
In some optional embodiments, the point number determining module is configured to perform the following processing on the target portion with the horizontal portion and the vertical portion as target portions, respectively: acquiring the number of undetermined points of the target part according to the image information of the dot matrix DM two-dimensional code; detecting whether the target part has point number deviation or not according to the number of points to be fixed of the target part; and when the target part has point deviation, acquiring the correction point of the target part as the point of the target part.
In some optional embodiments, the point number determining module is further configured to determine, when there is no point number deviation in the target portion, a number of pending points of the target portion as the point number of the target portion.
In some optional embodiments, the points determining module comprises: a first position acquisition unit for acquiring position information of each point of the target portion; a distance calculation unit for calculating a distance between each two adjacent points of the target portion to obtain a plurality of distances; a two-value acquisition unit for acquiring an average value and a median value of the plurality of distances; a few-point determining unit, configured to determine that there is a point number deviation and a deviation type is a few point in the target portion when the average value is greater than the median; and the multipoint determining unit is used for determining that point number deviation exists in the target part and the deviation type is multipoint when the average value is smaller than the median value.
In some optional embodiments, the point determination module further comprises: a few-point complementing unit, configured to complement, when the deviation type is a few point, a missing point in the target portion, and obtain a correct number of points of the target portion; and the multipoint removing unit is used for removing redundant points from the target part to obtain the correct point number of the target part when the deviation type is multipoint.
In some optional embodiments, the few point complementing unit comprises: a first distance detection subunit, configured to, for each two adjacent points of the target portion, respectively detect whether a distance between the two adjacent points is greater than the average value; a point inserting subunit, configured to insert a point between the two adjacent points when the distance between the two adjacent points is greater than the average value.
In some optional embodiments, the multipoint removal unit comprises: a second distance detection subunit, configured to, for each two adjacent points of the target portion, respectively detect whether a distance between the two adjacent points is smaller than the average value; an alternative group subunit, configured to place the two adjacent points into an alternative group when the distance between the two adjacent points is smaller than the average value; a point sorting subunit, configured to sort all the points in the alternative group according to an order of each point in a first direction, where the first direction is used to indicate a direction in which one end point of the target portion points to another end point; a point removal subunit, configured to remove, from the target portion, the point sorted in the intermediate position in the alternative group.
In some optional embodiments, the specification determination module comprises: a second position acquisition unit for acquiring position information of each point of the lateral part and the vertical part; and the specification acquisition unit is used for determining the specification of the lattice type DM two-dimensional code according to the number of the transverse parts and the vertical parts and the position information of each point of the transverse parts and the vertical parts.
In a third aspect, the present application provides an electronic device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of any of the above methods when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the steps of any of the methods described above.
Drawings
The present application is further described below with reference to the drawings and examples.
Fig. 1 is a schematic flowchart of a method for determining a specification of a dot matrix DM two-dimensional code according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of determining the number of dots according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of detecting a point deviation according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of obtaining correction points according to an embodiment of the present disclosure;
fig. 5 is a schematic flow chart of completion points provided in the embodiment of the present application;
FIG. 6 is a schematic diagram of a process for removing points according to an embodiment of the present disclosure;
FIG. 7 is a schematic flow chart illustrating a process for determining the number of dots according to an embodiment of the present disclosure;
FIG. 8 is a schematic flow chart of determining a specification according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a device for determining specification of a dot matrix DM two-dimensional code according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a point determination module according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a point determination module according to an embodiment of the present application;
FIG. 12 is a schematic structural diagram of a few-point complementing unit provided in the embodiment of the present application;
fig. 13 is a schematic structural diagram of a multi-point removing unit according to an embodiment of the present disclosure;
FIG. 14 is a block diagram of a specification determination module according to an embodiment of the present disclosure;
fig. 15 is a block diagram of an electronic device according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of a program product for implementing a method for determining specification of a dot matrix DM two-dimensional code according to an embodiment of the present application.
Detailed Description
The present application is further described with reference to the accompanying drawings and the detailed description, and it should be noted that, in the present application, the embodiments or technical features described below may be arbitrarily combined to form a new embodiment without conflict.
Referring to fig. 1, an embodiment of the present application provides a method for determining a specification of a dot matrix DM two-dimensional code, where the dot matrix DM two-dimensional code includes a real edge of an L type and an imaginary edge of the L type, the imaginary edge includes a horizontal portion and a vertical portion, the real edge may be used to locate the dot matrix DM two-dimensional code, and the imaginary edge may be used to determine a specification of the two-dimensional code.
The method includes steps S101 to S103.
Step S101: and acquiring the image information of the dot matrix DM two-dimensional code.
Step S102: and determining the point number of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code.
Referring to fig. 2, in a specific embodiment, the step S102 may include steps S201 to S203.
Step S201: and respectively taking the horizontal part and the vertical part as target parts, and acquiring the number of undetermined points of the target parts according to the image information of the dot matrix type DM two-dimensional code. The number of the to-be-determined points can be directly obtained according to the image information of the dot matrix DM two-dimensional code, and the target part can have the defects of the points or redundant noise interference due to reasons such as printing, powder dropping and the like, so that the number of the to-be-determined points is deviated.
Step S202: and detecting whether the target part has point number deviation or not according to the number of points to be fixed of the target part.
Referring to fig. 3, in a specific embodiment, the step S202 may include steps S301 to S305.
Step S301: position information of each point of the target portion is acquired.
Step S302: and calculating the distance between every two adjacent points of the target part to obtain a plurality of distances.
Step S303: and acquiring the average value and the median value of the plurality of distances.
For example, the following steps are carried out: the plurality of distances may be K distances, K being a positive integer. Arranging K distances according to the size sequence, wherein when K is an odd number, the median value is the distance at the middle position; when K is an even number, the median is the average of the 2 distances at the middle position.
Step S304: when the average value is larger than the median value, determining that the target part has point number deviation and the deviation type is few points.
For example, the following steps are carried out: the number of points of the vertical part in the target part is 4, the distances between every two adjacent points are respectively 3mm, 6mm and 3mm, the average value is 4mm, the median value is 3mm, the target part has point number deviation, the average value is larger than the median value, and the deviation type is few points.
Step S305: when the average value is smaller than the median value, determining that the target part has point number deviation and the deviation type is multipoint.
For example, the following steps are carried out: the number of points of the vertical part in the target part is 6, the distances between every two adjacent points are respectively 3mm, 1.4mm, 1.6mm, 3mm and 3mm, then the average value is 2.4mm, the median value is 3mm, the target part has point number deviation, the average value is smaller than the median value, and the deviation type is multipoint.
Therefore, by comparing the average value and the median value of a plurality of distances, on one hand, whether point number deviation exists or not can be judged, when the average value and the median value are equal, the point number deviation does not exist, and when the average value and the median value are not equal, the point number deviation exists; on the other hand, the type of the point number deviation can be judged, when the average value is larger than the median value, the deviation type is few points, and when the average value is smaller than the median value, the deviation type is multiple points.
Step S203: and when the target part has point deviation, acquiring the correction point of the target part as the point of the target part. Specifically, the point number deviation may be target portion multipoint or target portion multipoint.
Therefore, on one hand, whether point deviation exists in the target part can be detected according to the number of the undetermined points; on the other hand, when the target part has point deviation, the number of the fixed points can be corrected to obtain the number of the corrected points, so that the actual specification of the dot matrix DM two-dimensional code is determined according to the number of the corrected points.
Referring to fig. 4, in a specific embodiment, the step S203 may include steps S401 to S402.
Step S401: and when the deviation type is few points, complementing the missing points in the target part to obtain the correct point number of the target part.
Referring to fig. 5, in a specific embodiment, the step S401 may include steps S501 to S502.
Step S501: for each two adjacent points of the target portion, respectively detecting whether a distance between the two adjacent points is greater than the average value.
Step S502: when the distance between the two adjacent points is greater than the average value, a point is inserted between the two adjacent points.
Therefore, by comparing the distance and the average value between every two adjacent points, on one hand, whether point number deviation exists between every two adjacent points can be judged, when the distance and the average value between every two adjacent points are equal, the point number deviation does not exist between every two adjacent points, and when the distance and the average value between every two adjacent points are not equal, the point number deviation exists between every two adjacent points; on the other hand, when the distance between two adjacent points is greater than the average value, it may be determined that there is a few points between the two adjacent points, and a point may be inserted between the two adjacent points, thereby completing the correction of the number of points.
Step S402: and when the deviation type is multi-point, removing redundant points from the target part to obtain the correct point number of the target part.
Therefore, the number of the points of the target part can be correspondingly corrected according to the type of the point deviation to obtain the correct number of the points, and the specification of the lattice type DM two-dimensional code is determined according to the correct number of the points.
Referring to fig. 6, in a specific embodiment, the step S402 may include steps S601 to S604.
Step S601: for each two adjacent points of the target portion, respectively detecting whether a distance between the two adjacent points is less than the average value.
Step S602: and when the distance between the two adjacent points is smaller than the average value, putting the two adjacent points into an alternative group.
Step S603: and sorting all the points in the alternative group according to the sequence of each point in a first direction, wherein the first direction is used for indicating the direction that one end point of the target part points to the other end point.
Step S604: removing from the target portion the points in the alternative set that are ranked in the intermediate position.
For example, the following steps are carried out: the number of points of the vertical part in the target part is 6, the distance between every two adjacent points is respectively 3mm, 1.4mm, 1.6mm, 3mm and 3mm, the average value is 2.4mm, two pairs of adjacent points, namely 3 points, with the distance between the adjacent points being 1.4mm and 1.6mm can be placed into an alternative group, the 3 points can be sequenced in the first direction, and the points in the middle position are removed. After the operation of removing points is carried out, 5 points are remained, the distance between every two adjacent points is respectively 3mm, 3mm and 3mm, and the point number deviation does not exist.
Thus, on the one hand, by comparing the distance between each two adjacent points with the average value, when the distance between the two adjacent points is smaller than the average value, it can be determined that a multi-point condition exists between the two adjacent points; on the other hand, the correction of the number of points can be completed by removing the point of the candidate group located at the middle position and removing one point with a deviation in position from two adjacent points whose distance is smaller than the average value.
Referring to fig. 7, in a specific embodiment, the step S102 may further include a step S204.
Step S204: and when the target part has no point deviation, determining the number of undetermined points of the target part as the point number of the target part.
Therefore, when the target part has no point deviation, the number of points to be determined does not need to be corrected, and the specification of the dot matrix type DM two-dimensional code can be directly determined according to the number of the points to be determined.
Step S103: and determining the specification of the dot matrix DM two-dimensional code according to the number of the dots of the horizontal part and the vertical part.
In a specific embodiment, the number of the horizontal portions is M, the number of the vertical portions is N, M, N are positive integers, and the specification of the lattice DM two-dimensional code is 2N rows × 2M columns.
For example, the following steps are carried out: the number of points of the transverse part is 9, the number of points of the vertical part is 4, and the specification of the dot matrix DM two-dimensional code is 8 rows by 18 columns.
Therefore, point information of the L-shaped virtual edge can be acquired according to the image information of the dot-matrix DM two-dimensional code, and the specification of the dot-matrix DM two-dimensional code is determined.
Referring to fig. 8, in a specific embodiment, the step S103 may include steps S701 to S702.
Step S701: position information of each point of the lateral portion and the vertical portion is acquired.
Step S702: and determining the specification of the dot matrix type DM two-dimensional code according to the number of the horizontal parts and the vertical parts and the position information of each point of the horizontal parts and the vertical parts.
Therefore, the specification of the dot matrix type DM two-dimensional code can be judged by acquiring the position information of each point of the horizontal part and the vertical part and combining the number of the horizontal part and the vertical part and the position information of the corresponding point.
Referring to fig. 9, an embodiment of the present application further provides a device for determining specifications of a dot matrix DM two-dimensional code, where a specific implementation manner of the device is consistent with the implementation manner and the achieved technical effect described in the embodiment of the foregoing method, and details of a part of the implementation manner are not repeated. The dot matrix DM two-dimensional code comprises an L-shaped real edge and an L-shaped virtual edge, and the virtual edge comprises a transverse part and a vertical part.
The device comprises: an information obtaining module 101, configured to obtain image information of the dot matrix DM two-dimensional code; a point number determining module 102, configured to determine the point numbers of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code; and the specification determining module 103 is configured to determine the specification of the dot matrix DM two-dimensional code according to the number of dots of the horizontal portion and the vertical portion.
In a specific embodiment, the point determining module 102 may be configured to take the horizontal portion and the vertical portion as target portions, respectively, and perform the following processing on the target portions: acquiring the number of undetermined points of the target part according to the image information of the dot matrix DM two-dimensional code; detecting whether the target part has point number deviation or not according to the number of points to be fixed of the target part; and when the target part has point deviation, acquiring the correction point of the target part as the point of the target part.
In a specific embodiment, the point number determining module 102 may be further configured to determine the number of pending points of the target portion as the point number of the target portion when there is no point number deviation in the target portion.
Referring to FIG. 10, in a specific embodiment, the points determination module 102 may include: a first position obtaining unit 1021, which may be configured to obtain position information of each point of the target portion; a distance calculating unit 1022, configured to calculate a distance between every two adjacent points of the target portion, resulting in a plurality of distances; a two-value obtaining unit 1023, which can be used to obtain the average value and the median value of the plurality of distances; a few-point determining unit 1024, configured to determine that there is a point number deviation and a deviation type is few points in the target portion when the average value is greater than the median; the multipoint determining unit 1025 may be configured to determine that there is a point number deviation in the target portion and the deviation type is multipoint when the average value is smaller than the median value.
Referring to fig. 11, in a specific embodiment, the point determining module 102 may further include: a few-point complementing unit 1026, configured to complement, when the deviation type is a few point, a missing point in the target portion, so as to obtain a correct number of points of the target portion; a multi-point removing unit 1027, configured to remove redundant points from the target portion to obtain the correct number of points of the target portion when the deviation type is multi-point.
Referring to fig. 12, in an embodiment, the few point supplement unit 1026 may include: a first distance detecting subunit 1026a, configured to detect, for each two adjacent points of the target portion, whether a distance between the two adjacent points is greater than the average value; a point inserting sub-unit 1026b may be configured to insert a point between the two adjacent points when the distance between the two adjacent points is greater than the average value.
Referring to fig. 13, in a specific embodiment, the multi-point removal unit 1027 may include: a second distance detecting subunit 1027a, configured to detect, for each two adjacent points of the target portion, whether a distance between the two adjacent points is smaller than the average value; an alternative group subunit 1027b, configured to put the two neighboring points into an alternative group when the distance between the two neighboring points is smaller than the average value; a point sorting subunit 1027c, configured to sort all points in the alternative group in an order of each point in a first direction, where the first direction may be a direction indicating that one end point of the target portion points to another end point; a point removal subunit 1027d may be configured to remove points from the target portion that are sorted in the middle of the alternate group.
Referring to fig. 14, in a specific embodiment, the specification determining module 103 may include: a second position acquisition unit 1031 that can be used to acquire position information of each point of the lateral portion and the vertical portion; the specification obtaining unit 1032 may be configured to determine the specification of the dot matrix DM two-dimensional code according to the number of dots of the horizontal part and the vertical part and the position information of each dot of the horizontal part and the vertical part.
Referring to fig. 15, an embodiment of the present application further provides an electronic device 200, where the electronic device 200 includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.
The memory 210 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)211 and/or cache memory 212, and may further include Read Only Memory (ROM) 213.
The memory 210 further stores a computer program, and the computer program can be executed by the processor 220, so that the processor 220 executes the steps of the method for determining the specification of the dot matrix DM two-dimensional code in the embodiment of the present application, and a specific implementation manner of the method is consistent with the implementation manner and the achieved technical effect described in the embodiment of the method, and some details are not repeated.
Memory 210 may also include a program/utility 214 having a set (at least one) of program modules 215, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Accordingly, processor 220 may execute the computer programs described above, as well as may execute programs/utilities 214.
Bus 230 may be a local bus representing one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or any other type of bus structure.
The electronic device 200 may also communicate with one or more external devices 240, such as a keyboard, pointing device, Bluetooth device, etc., and may also communicate with one or more devices capable of interacting with the electronic device 200, and/or with any devices (e.g., routers, modems, etc.) that enable the electronic device 200 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 250. Also, the electronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
The embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used for storing a computer program, and when the computer program is executed, the steps of the method for determining a specification of a dot matrix DM two-dimensional code in the embodiment of the present application are implemented, and a specific implementation manner of the method is consistent with the implementation manner and the achieved technical effect described in the embodiment of the foregoing method, and some contents are not described again.
Fig. 16 shows a program product 300 for implementing the method provided by the embodiment, which may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, the program product 300 of the present invention is not so limited, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Program product 300 may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing. Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The foregoing description and drawings are only for purposes of illustrating the preferred embodiments of the present application and are not intended to limit the present application, which is, therefore, to the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the present application.

Claims (18)

1. A method for determining the specification of a dot matrix DM two-dimensional code, which is characterized in that the dot matrix DM two-dimensional code comprises an L-shaped real edge and an L-shaped virtual edge, wherein the virtual edge comprises a horizontal part and a vertical part, and the method comprises the following steps:
acquiring image information of the dot matrix DM two-dimensional code;
determining the number of points of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code;
and determining the specification of the dot matrix DM two-dimensional code according to the number of the dots of the horizontal part and the vertical part.
2. The method for determining specification of a dot matrix DM two-dimensional code according to claim 1, wherein the determining the number of dots of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code comprises:
with the horizontal portion and the vertical portion as target portions, respectively, performing the following processing on the target portions:
acquiring the number of undetermined points of the target part according to the image information of the dot matrix DM two-dimensional code;
detecting whether the target part has point number deviation or not according to the number of points to be fixed of the target part;
and when the target part has point deviation, acquiring the correction point of the target part as the point of the target part.
3. The method for determining specification of a dot matrix DM two-dimensional code according to claim 2, wherein the determining the number of dots of the horizontal part and the vertical part according to the image information of the dot matrix DM two-dimensional code further comprises:
and when the target part has no point deviation, determining the number of undetermined points of the target part as the point number of the target part.
4. The method for determining specification of lattice type DM two-dimensional code according to claim 2, wherein the detecting whether there is a point deviation in the target portion comprises:
acquiring position information of each point of the target part;
calculating the distance between every two adjacent points of the target part to obtain a plurality of distances;
obtaining the average value and the median value of the plurality of distances;
when the average value is larger than the median value, determining that point number deviation exists in the target part and the deviation type is few points;
when the average value is smaller than the median value, determining that the target part has point number deviation and the deviation type is multipoint.
5. The method for determining specification of lattice type DM two-dimensional code according to claim 4, wherein the obtaining of the number of correction points of the target portion as the number of points of the target portion comprises:
when the deviation type is few points, supplementing missing points in the target part to obtain the correct point number of the target part;
and when the deviation type is multi-point, removing redundant points from the target part to obtain the correct point number of the target part.
6. The method for determining specification of lattice type DM two-dimensional code according to claim 5, wherein the complementing the missing points in the target portion comprises:
for each two adjacent points of the target portion, respectively detecting whether a distance between the two adjacent points is greater than the average value;
when the distance between the two adjacent points is greater than the average value, a point is inserted between the two adjacent points.
7. The method of claim 5, wherein the removing of redundant dots from the target portion comprises:
for each two adjacent points of the target portion, respectively detecting whether the distance between the two adjacent points is less than the average value;
when the distance between the two adjacent points is smaller than the average value, putting the two adjacent points into an alternative group;
sorting all points in the alternative group in order of each point in a first direction, the first direction being used for indicating a direction in which one end point of the target portion points to another end point;
removing from the target portion the points in the alternative set that are ranked in the intermediate position.
8. The method for determining specification of a lattice type DM two-dimensional code according to claim 1, wherein the determining specification of the lattice type DM two-dimensional code according to the number of points of the horizontal part and the vertical part comprises:
acquiring position information of each point of the transverse part and the vertical part;
and determining the specification of the dot matrix type DM two-dimensional code according to the number of the horizontal parts and the vertical parts and the position information of each point of the horizontal parts and the vertical parts.
9. The utility model provides a device is confirmed to dot matrix DM two-dimensional code specification, its characterized in that, dot matrix DM two-dimensional code includes the real limit of L type and the virtual limit of L type, virtual limit includes horizontal part and vertical part, the device includes:
the information acquisition module is used for acquiring the image information of the dot matrix DM two-dimensional code;
the point number determining module is used for determining the point number of the transverse part and the vertical part according to the image information of the dot matrix DM two-dimensional code;
and the specification determining module is used for determining the specification of the dot matrix type DM two-dimensional code according to the number of the dots of the horizontal part and the vertical part.
10. The device for determining specification of a lattice DM two-dimensional code according to claim 9, wherein the point number determining module is configured to perform the following processing on the target portion with the horizontal portion and the vertical portion as the target portion respectively:
acquiring the number of undetermined points of the target part according to the image information of the dot matrix DM two-dimensional code;
detecting whether the target part has point number deviation or not according to the number of points to be fixed of the target part;
and when the target part has point deviation, acquiring the correction point of the target part as the point of the target part.
11. The device for determining specification of lattice DM two-dimensional code according to claim 10, wherein the point number determining module is further configured to determine the number of undetermined points of the target portion as the point number of the target portion when there is no point number deviation in the target portion.
12. The device for determining specification of lattice DM two-dimensional code according to claim 10, wherein the point number determining module comprises:
a first position acquisition unit for acquiring position information of each point of the target portion;
a distance calculation unit for calculating a distance between each two adjacent points of the target portion to obtain a plurality of distances;
a two-value acquisition unit for acquiring an average value and a median value of the plurality of distances;
a few-point determining unit, configured to determine that there is a point number deviation and a deviation type is a few point in the target portion when the average value is greater than the median;
and the multipoint determining unit is used for determining that point number deviation exists in the target part and the deviation type is multipoint when the average value is smaller than the median value.
13. The device for determining specification of lattice DM two-dimensional code according to claim 12, wherein the point number determining module further comprises:
a few-point complementing unit, configured to complement, when the deviation type is a few point, a missing point in the target portion, and obtain a correct number of points of the target portion;
and the multipoint removing unit is used for removing redundant points from the target part to obtain the correct point number of the target part when the deviation type is multipoint.
14. The apparatus of claim 13, wherein the few-dot complementing unit comprises:
a first distance detection subunit, configured to, for each two adjacent points of the target portion, respectively detect whether a distance between the two adjacent points is greater than the average value;
a point inserting subunit, configured to insert a point between the two adjacent points when the distance between the two adjacent points is greater than the average value.
15. The device for determining specification of lattice DM two-dimensional code according to claim 13, wherein the multi-point removing unit comprises:
a second distance detection subunit, configured to, for each two adjacent points of the target portion, respectively detect whether a distance between the two adjacent points is smaller than the average value;
an alternative group subunit, configured to place the two adjacent points into an alternative group when the distance between the two adjacent points is smaller than the average value;
a point sorting subunit, configured to sort all the points in the alternative group according to an order of each point in a first direction, where the first direction is used to indicate a direction in which one end point of the target portion points to another end point;
a point removal subunit, configured to remove, from the target portion, the point sorted in the intermediate position in the alternative group.
16. The device for determining specification of lattice type DM two-dimensional code according to claim 9, wherein the specification determining module comprises:
a second position acquisition unit for acquiring position information of each point of the lateral part and the vertical part;
and the specification acquisition unit is used for determining the specification of the lattice type DM two-dimensional code according to the number of the transverse parts and the vertical parts and the position information of each point of the transverse parts and the vertical parts.
17. An electronic device, characterized in that the electronic device comprises a memory storing a computer program and a processor implementing the steps of the method according to any of claims 1-8 when the processor executes the computer program.
18. 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 8.
CN202011542536.8A 2020-12-23 2020-12-23 Method for determining specification of dot matrix type DM two-dimensional code and related device Pending CN112598100A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011542536.8A CN112598100A (en) 2020-12-23 2020-12-23 Method for determining specification of dot matrix type DM two-dimensional code and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011542536.8A CN112598100A (en) 2020-12-23 2020-12-23 Method for determining specification of dot matrix type DM two-dimensional code and related device

Publications (1)

Publication Number Publication Date
CN112598100A true CN112598100A (en) 2021-04-02

Family

ID=75200470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011542536.8A Pending CN112598100A (en) 2020-12-23 2020-12-23 Method for determining specification of dot matrix type DM two-dimensional code and related device

Country Status (1)

Country Link
CN (1) CN112598100A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114372547A (en) * 2021-12-22 2022-04-19 广西柳钢东信科技有限公司 Two-dimensional bar code design method for steel serial number identification

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106485183A (en) * 2016-07-14 2017-03-08 深圳市华汉伟业科技有限公司 A kind of Quick Response Code localization method and system
CN109086644A (en) * 2018-07-27 2018-12-25 广东奥普特科技股份有限公司 The localization method of the DataMatrix two dimensional code of sub-pixel precision
CN110414649A (en) * 2019-07-29 2019-11-05 广州柔视智能科技有限公司 Localization method, device, terminal and the storage medium of DM code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106485183A (en) * 2016-07-14 2017-03-08 深圳市华汉伟业科技有限公司 A kind of Quick Response Code localization method and system
CN109086644A (en) * 2018-07-27 2018-12-25 广东奥普特科技股份有限公司 The localization method of the DataMatrix two dimensional code of sub-pixel precision
CN110414649A (en) * 2019-07-29 2019-11-05 广州柔视智能科技有限公司 Localization method, device, terminal and the storage medium of DM code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘志等: "DPM码快速定位关键技术研究", 《浙江工业大学学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114372547A (en) * 2021-12-22 2022-04-19 广西柳钢东信科技有限公司 Two-dimensional bar code design method for steel serial number identification
CN114372547B (en) * 2021-12-22 2023-10-13 广西柳钢东信科技有限公司 Two-dimensional bar code design method for steel numbering identification

Similar Documents

Publication Publication Date Title
CN108664374B (en) Fault alarm model creating method and device and fault alarm method and device
JP6099234B2 (en) Parallel touchpoint detection using processor graphics
CN108985066B (en) Intelligent contract security vulnerability detection method, device, terminal and storage medium
CN110489423B (en) Information extraction method and device, storage medium and electronic equipment
CN112732567B (en) Mock data testing method and device based on ip, electronic equipment and storage medium
CN112598100A (en) Method for determining specification of dot matrix type DM two-dimensional code and related device
CN112528633A (en) Text error correction method and device, electronic equipment and computer readable storage medium
CN114116013B (en) Data processing method and device, electronic equipment and storage medium
US11165665B2 (en) Apparatus and method to improve precision of identifying a range of effects of a failure in a system providing a multilayer structure of services
EP2541468B1 (en) Method of and device for identifying the direction of characters in an image block
CN109978211B (en) Method and device for predicting flight arrival and departure rate
CN115660540B (en) Cargo tracking method, cargo tracking device, computer equipment and storage medium
CN102890784A (en) Method and device for identifying directions of characters in image blocks
CN109861863B (en) Method and device for determining connection fault of data center, electronic equipment and medium
CN116137061A (en) Training method and device for quantity statistical model, electronic equipment and storage medium
CN105825250A (en) Method and device for counting poor display panels
US10288547B2 (en) Facility state analysis device, analysis method for facility state, storage medium, and facility management system
CN114201729A (en) Method, device and equipment for selecting matrix operation mode and storage medium
CN115187999A (en) Text recognition method and device, electronic equipment and computer readable storage medium
CN113538558B (en) Volume measurement optimization method, system, equipment and storage medium based on IR diagram
CN110297989B (en) Test method, device, equipment and medium for anomaly detection
CN112966671A (en) Contract detection method and device, electronic equipment and storage medium
CN114881913A (en) Image defect detection method and device, electronic equipment and storage medium
CN112989193A (en) Data processing method and device, electronic equipment and computer storage medium
CN112288206A (en) Resource allocation method and device, computer storage medium and electronic equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210402

RJ01 Rejection of invention patent application after publication