CN115600620A - Code scanning method and device, electronic equipment and storage medium - Google Patents

Code scanning method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115600620A
CN115600620A CN202211594817.7A CN202211594817A CN115600620A CN 115600620 A CN115600620 A CN 115600620A CN 202211594817 A CN202211594817 A CN 202211594817A CN 115600620 A CN115600620 A CN 115600620A
Authority
CN
China
Prior art keywords
row
identification code
coordinates
identification codes
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211594817.7A
Other languages
Chinese (zh)
Other versions
CN115600620B (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.)
Shenzhen Smartmore Technology Co Ltd
Original Assignee
Shenzhen Smartmore Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Smartmore Technology Co Ltd filed Critical Shenzhen Smartmore Technology Co Ltd
Priority to CN202211594817.7A priority Critical patent/CN115600620B/en
Publication of CN115600620A publication Critical patent/CN115600620A/en
Application granted granted Critical
Publication of CN115600620B publication Critical patent/CN115600620B/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/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Toxicology (AREA)
  • Electromagnetism (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a code scanning method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining a scanning result graph obtained by scanning a plurality of identification codes; determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set; determining a comparison result of the relative position coordinate set and a preset coordinate set; and if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying the identification code information of the target identification code according to a preset display rule. When the batch scanning tasks are executed, the relative position coordinates of the identification codes in the scanning result graph are compared with a preset coordinate set, and when the relative position coordinates are the same as the preset coordinate set, the scanning task which is being executed is indicated to be the same as the scanning task which is executed for the first time, so that only the identification codes of the target identification codes are identified, and the identification code information of the target identification codes is displayed, so that the aim of filtering non-target identification codes is fulfilled, and the code scanning efficiency is improved.

Description

Code scanning method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of industrial technologies, and in particular, to a code scanning method and apparatus, an electronic device, and a storage medium.
Background
With the development of industrial technology, code scanners have emerged. The code scanner is a machine for reading identification code information, and is used for scanning the identification code, then reading out the information contained in the identification code and transmitting the read information to a computer or other equipment.
The development of a code scanning method is promoted by the appearance of a code scanner, and the traditional code scanning method is to scan a plurality of identification codes in a picture by the code scanner at the same time and output identification code information of all the identification codes at one time.
However, when the picture includes the useless identification code, the traditional code scanning method still performs recognition processing on the useless identification code, so that the code scanning efficiency is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a code scanning method, apparatus, electronic device and computer-readable storage medium capable of improving code scanning efficiency.
In a first aspect, the present application provides a code scanning method. The method comprises the following steps:
acquiring a scanning result graph obtained by scanning a plurality of identification codes;
determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set;
determining a comparison result of the relative position coordinate set and a preset coordinate set;
if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying identification code information of the target identification code according to a preset display rule; wherein the target identification code is an identification code satisfying a preset rule.
In one embodiment, the determining the relative position coordinates of the identification codes in the scan result map to obtain a set of relative position coordinates includes:
determining relative row coordinates of the identification codes in the scanning result image;
determining relative column coordinates of the identification codes in the scanning result image;
and obtaining the relative position coordinate set according to the relative row coordinate and the relative column coordinate of the identification code. In one embodiment, the determining the relative row coordinates of the identification code in the scan result map includes:
normalizing the actual row coordinate of the central point of the identification code to obtain a normalized row coordinate of the central point of the identification code;
clustering the central points of the identification codes according to the normalized row coordinates to obtain the central points of the same row;
and determining the row sequence among the rows to obtain the relative row coordinates of the identification codes based on the normalized row coordinates of the central points in the rows.
In one embodiment, the normalizing the actual row coordinate of the center point of the identification code to obtain the normalized row coordinate of the center point of the identification code includes:
determining the actual line coordinates of the central point of the identification code, the height of the minimum circumscribed rectangle of the target central point and the line coordinates of the boundary of the minimum circumscribed rectangle; the target central point is the central point of a minimum circumscribed rectangle including all the identification codes in the scanning result graph;
and obtaining the normalized row coordinate of the central point of the identification code according to the actual row coordinate of the central point of the identification code, the height of the minimum circumscribed rectangle and the row coordinate of the boundary of the minimum circumscribed rectangle.
In one embodiment, the clustering the center points of the identification codes according to the normalized row coordinates to obtain the center point of the same row includes:
calculating a distance difference value between the normalized row coordinates of the central points of the two identification codes aiming at any two identification codes;
if the distance difference is smaller than a distance threshold, determining that the row coordinates of the two identification codes are close;
determining the number of identification codes close to the row coordinate of the same identification code;
if the number of the identification codes close to the row coordinate of the same identification code is more than one, gradually adjusting the distance threshold, and re-executing the step of determining the number of the identification codes close to the row coordinate of the same identification code until the number of the identification codes close to the row coordinate is not more than one, and determining that the identification codes close to the row coordinate of the same identification code and the same identification code are in the same row.
In one embodiment, the determining the row order among the rows to obtain the relative row coordinate of each identification code based on the normalized row coordinate of the central point in each row includes:
calculating the average value of the normalized row coordinates of the central points of the identification codes in the same row to obtain the average value of the row coordinates;
and sequencing the row coordinate average value of each row identification code to determine the relative row coordinate of each row identification code in the scanning result graph.
In one embodiment, the determining the relative column coordinates of the identification codes in the scan result map includes:
determining actual column coordinates of the center points of the identification codes in the same row;
and sorting according to the size of the actual column coordinate to determine the relative column coordinate of the identification code of the same row in the scanning result graph.
In one embodiment, before the displaying the identification code information of the target identification code according to the preset display rule, the method further includes:
determining an invalid identification code specified from a plurality of identification codes in a primary scanning result map in response to an identification code specifying operation for the primary scanning result map; the primary scanning result graph is obtained by scanning a plurality of identification codes by performing a scanning task for the first time;
determining an invalid identification code coordinate set according to the relative position coordinates of the invalid identification codes;
the display method of the identification code information of the target identification code according to the preset display rule comprises the following steps:
displaying identification code information of the target identification code corresponding to the target relative position coordinates according to a preset display rule; the target relative position coordinates are relative position coordinates in the set of relative position coordinates other than the set of invalid identification code coordinates.
In a second aspect, the present application further provides a code scanning device. The device comprises:
the acquisition module is used for acquiring a scanning result image obtained by scanning a plurality of identification codes;
the determining module is used for determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set; determining a comparison result of the relative position coordinate set and a preset coordinate set;
the display module is used for displaying the identification code information of the target identification code according to a preset display rule if the comparison result shows that the relative position coordinate set is the same as the preset coordinate set; wherein the target identification code is an identification code satisfying a preset rule.
In a third aspect, the present application further provides an electronic device. The electronic device comprises a memory in which a computer program is stored and a processor which implements the steps of the above-described method when executing the computer program.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method described above.
According to the code scanning method, the code scanning device, the electronic equipment and the storage medium, a scanning result graph obtained by scanning a plurality of identification codes is obtained; determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set; determining a comparison result of the relative position coordinate set and a preset coordinate set; if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying the identification code information of the target identification code according to a preset display rule; wherein the target identification code is an identification code satisfying a preset rule. When a batch of scanning tasks are executed, the relative position coordinates of the identification codes in the scanning result graph are compared with a preset coordinate set, and when the relative position coordinates are the same as the preset coordinate set, the scanning task which is being executed is the same as the scanning task which is executed for the first time, so that only the identification processing is carried out on the target identification codes, and the identification code information of the target identification codes is displayed, so that the purpose of filtering the non-target identification codes is achieved, and the code scanning efficiency is improved.
Drawings
FIG. 1 is a flow diagram illustrating a code scanning method according to an embodiment;
FIG. 2 is a flow chart illustrating a code scanning method according to another embodiment;
FIG. 3a is a diagram illustrating the relationship between the positions of the identification codes in the scan result diagram according to an embodiment;
FIG. 3b is a diagram illustrating the determination of a set of coordinates of invalid identification codes in one embodiment;
FIG. 4 is a block diagram of an exemplary code scanning apparatus;
FIG. 5 is a block diagram of the structure of a determination module in one embodiment;
FIG. 6 is a diagram illustrating an internal structure of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
For ease of understanding, the following will describe in detail the scenarios in which the present invention is applied. In performing the scanning job, there are cases where a plurality of identification codes need to be scanned simultaneously. For example, the identification codes of the same product are scanned in batches at the same time, or the identification codes of a plurality of products are scanned in batches. And scanning the identification code, identifying the identification code, and displaying identification code information of the identification code. However, in some application scenarios, it is not necessary to perform the identification process on all the identification codes, and it is not necessary to display the identification code information of all the identification codes. Therefore, when the scanning task is executed for the first time, the user can select the invalid identification code (namely, the identification code is not identified and the identification code of the identification code information is not displayed), so that the identification code information of the invalid identification code is not displayed when the scanning task which is the same as the scanning task for the first time is executed subsequently. The code scanning method is high in code scanning efficiency and high in flexibility and adaptability to code scanning scenes.
In one embodiment, as shown in fig. 1, a code scanning method is provided, which is described by taking an example of applying the method to an electronic device, and includes the following steps:
step 101, obtaining a scanning result graph obtained by scanning a plurality of identification codes.
The identification code is a code which is used for uniquely identifying a certain product in certain data on the basis of element classification. The identification code may be a graphic identification code including, but not limited to, at least one of a one-dimensional barcode, a two-dimensional barcode, and the like.
The scanning result graph is obtained by scanning a plurality of identification codes when a scanning task is executed, namely the scanning result graph comprises images of the plurality of identification codes. It is understood that the scan result graph obtained by performing the scan task for the first time or the scan result graph obtained by performing the scan task for a non-first time may be referred to as the scan result graph.
Specifically, the electronic device executes a scanning task and scans a plurality of identification codes to obtain a scanning result graph.
In some embodiments, the scanning task may be to scan the identification codes of multiple products in batches, or to scan multiple identification codes of the same product in batches.
In some embodiments, the scan result map includes images of multiple identification codes for the same product.
In some embodiments, the scan result map includes images of identification codes of a plurality of products.
And 102, determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set.
The relative position coordinates refer to coordinates relative to a previous coordinate point. The relative position coordinates are used for representing the position relation of each identification code in the scanning result graph. For example, the coordinates of the identification code a are (1, 1), the coordinates of the identification code B are (6, 4), and the relative position coordinates of the coordinates of B with respect to the coordinates of a are (5, 3). It is understood that when a certain identification code in the scan result map is selected as a reference point, the relative position coordinates of the identification codes can be determined.
Specifically, after the electronic device determines the position of each identification code in the scanning result graph, the relative position coordinates of each identification code are determined according to the position relationship of each identification code, and a set formed by the relative position coordinates of each identification code is a relative position coordinate set.
In some embodiments, the electronic device locates each identification code in the scan result graph to obtain a location frame corresponding to each identification code, that is, an area where the location frame is located is an area where the identification code is located, and then determines the relative position coordinates of the location frame of each identification code according to the position relationship between the location frames corresponding to each identification code. It is understood that the positioning frame corresponding to each identification code is the area where the identification code is located, and therefore the relative position coordinates of the positioning frame can represent the relative position coordinates of the identification code.
In some embodiments, the electronic device determines the position of each identification code in the scan result map, i.e., locates each identification code in the scan result map. And taking the minimum circumscribed rectangle of each identification code as a positioning frame corresponding to each identification code, and taking the relative position coordinates of the central point of the positioning frame corresponding to the identification code as the relative position coordinates of the identification code.
In some embodiments, the relative position coordinates of the identification codes in the scan result map are as follows: the relative position coordinates of the first identification code in the first row are (1, 1), the relative position coordinates of the second identification code in the first row are (1, 2), the relative position coordinates of the first identification code in the second row are (2, 1), the relative position coordinates of the second identification code in the second row are (2, 2), and the relative position coordinates of the first identification code in the third row are (3, 1). The set of relative position coordinates is therefore { (1, 1), (1, 2), (2, 1), (2, 2), (3, 1) }. It will be appreciated that the relative positional relationship between the identification codes can be known by a set of relative positional coordinates.
And 103, determining a comparison result of the relative position coordinate set and a preset coordinate set.
The preset coordinate set is a preset relative position coordinate set. Specifically, when the scanning task is executed for the first time, the electronic device scans the plurality of identification codes to obtain a scanning result graph, namely an initial scanning result graph, and a relative position coordinate set of each identification code in the initial scanning result graph is a preset coordinate set.
Specifically, when the electronic device executes a scanning task, the relative position coordinate set and the preset coordinate set are compared to obtain a comparison result, and the comparison result is used for representing whether the scanning task being executed and the scanning task executed for the first time are the same scanning task.
It should be noted that, when the scanning task is executed for the first time, since the preset coordinate set is determined according to the primary scanning result map, steps 103 to 104 cannot be executed. Steps 103 to 104 are only performed if the scanning task is not performed for the first time.
104, if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying the identification code information of the target identification code according to a preset display rule; wherein the target identification code is an identification code satisfying a preset rule.
The preset display rule is a preset display rule. When the scanning task is executed, the preset display rule determines how to display the identification code information of the identification code.
The preset rule is a preset rule. That is, the preset rules determine which identification codes in the scan result chart become the target identification codes.
Specifically, the electronic device executes a scanning task, when the relative position coordinate set is the same as the preset coordinate set, it is indicated that the scanning task being executed is the same as the scanning task executed for the first time, and the identification code information of the target identification code is displayed according to a preset display rule.
In some embodiments, when the set of relative position coordinates is different from the set of preset coordinates, it is indicated that the executed scanning task is different from the scanning task executed for the first time, and the identification code information of all the identification codes is displayed according to a preset display rule.
It should be noted that the preset display rule may be set according to different application scenarios and adjusted according to requirements, which is not limited herein.
In the code scanning method, a scanning result graph obtained by scanning a plurality of identification codes is obtained; determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set; determining a comparison result of the relative position coordinate set and a preset coordinate set; if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying the identification code information of the target identification code according to a preset display rule; wherein the target identification code is an identification code satisfying a preset rule. When the batch scanning tasks are executed, the relative position coordinates of the identification codes in the scanning result graph are compared with a preset coordinate set, and when the relative position coordinates are the same as the preset coordinate set, the scanning task which is being executed is indicated to be the same as the scanning task which is executed for the first time, so that only the identification codes of the target identification codes are identified, and the identification code information of the target identification codes is displayed, so that the aim of filtering non-target identification codes is fulfilled, and the code scanning efficiency is improved.
In some embodiments, determining the relative position coordinates of the identification code in the scan result map to obtain a set of relative position coordinates includes: determining relative row coordinates of the identification codes in the scanning result image; determining relative column coordinates of the identification codes in the scanning result image; and obtaining a relative position coordinate set according to the relative row coordinate and the relative column coordinate of the identification code.
The relative row coordinates are relative row sequences among the identification codes of the rows and are used for representing the position relationship among the identification codes in different rows.
The relative column coordinates are relative column sequence between the identification codes in the same row and are used for representing the position relationship between the identification codes in the same row.
Specifically, the electronic equipment positions the identification codes according to the characteristics of the identification codes in the scanning result image, classifies the identification codes according to the actual coordinates of the identification codes according to rows to obtain the identification codes positioned in each row, and confirms the relative row coordinates and the relative column coordinates of the identification codes in each row. And finally, taking the relative row coordinates and the relative column coordinates of the identification codes as the relative position coordinates of the identification codes to obtain a relative position coordinate set of each identification code.
The actual coordinates of the identification codes are the coordinates of each identification code in the image coordinate system of the scanning result image. That is, the actual coordinates of each identification code indicate the position of each identification code in the scan result map.
In some embodiments, the minimum circumscribed rectangle of the identification code is taken as the positioning frame corresponding to the identification code, and the relative position coordinates of the center point of the positioning frame corresponding to the identification code are taken as the relative position coordinates of the identification code.
In some embodiments, the relative row coordinates of the identification codes in the same row are the same, and the relative row coordinates of the identification codes in different rows are different. For example, if there are three rows of identification codes, the relative row coordinates of all the identification codes in the first row are 1, the relative row coordinates of all the identification codes in the second row are 2, and the relative row coordinates of all the identification codes in the third row are 3.
In some embodiments, the relative column coordinates of the identification codes in the same row are different. For example, there are two rows of identification codes, the first row has 3 identification codes, the second row has 2 identification codes, and the coordinates of the first row from left to right relative to the column are 1,2, and 3, respectively. The relative column coordinates of the identification code of the second row from left to right are 1 and 2, respectively.
In the embodiment, the identification code can be quickly positioned through the relative row coordinate of the identification code and the relative column coordinate of the identification code, and the method is simple and efficient.
In some embodiments, determining relative row coordinates of the identification code in the scan result map comprises: normalizing the actual row coordinate of the central point of the identification code to obtain a normalized row coordinate of the central point of the identification code; clustering the central points of the identification codes according to the normalized row coordinates to obtain the central points of the same row; and determining the row sequence among the rows to obtain the relative row coordinates of the identification codes based on the normalized row coordinates of the central points in the rows.
And the actual line coordinate is the line coordinate of the pixel point corresponding to the central point of the identification code in the image coordinate system of the scanning result image.
The normalization processing is a data processing method for limiting the processed data to a certain range after the data is processed.
Clustering refers to a data processing method in which a data set is divided into different classes or clusters according to a certain specific standard, so that the similarity of data objects in the same cluster is as large as possible, and the difference of data objects not in the same cluster is also as large as possible.
The row sequence is the sequence between the identification codes of the rows.
Specifically, the actual row coordinate of the center point of the identification code is normalized, so that the value of the normalized row coordinate of the center point of the identification code falls within a certain range. And clustering the normalized line coordinates, and classifying the central points belonging to the same line into one type, namely that the central points corresponding to the normalized line coordinates classified into one type are in the same line. And determining the sequence of the identification codes of the rows by comparing the numerical values of the normalized row coordinates of the central points in the rows so as to obtain the relative row coordinates of the identification codes.
In some embodiments, the values of the normalized row coordinates fall within the [0,1] interval.
In the above embodiment, the normalized row coordinates are clustered to obtain the central point of the same row, and then the row sequence between the rows is determined according to the numerical value of the normalized row coordinates at the central point of the same row to obtain the relative row coordinates of each identification code, which is convenient and simple.
In some embodiments, normalizing the actual row coordinates of the center point of the identification code, and obtaining the normalized row coordinates of the center point of the identification code includes: determining the actual row coordinate of the central point of the identification code, the height of the minimum circumscribed rectangle of the target central point and the row coordinate of the boundary of the minimum circumscribed rectangle; the target central point is the central point of a minimum circumscribed rectangle comprising all the identification codes in the scanning result graph; and obtaining the normalized row coordinate of the central point of the identification code according to the actual row coordinate of the central point of the identification code, the height of the minimum circumscribed rectangle and the row coordinate of the boundary of the minimum circumscribed rectangle.
And the actual line coordinate is the line coordinate of the pixel point corresponding to the central point of the identification code in the image coordinate system of the scanning result image.
The target center point is the center point of the minimum bounding rectangle of all the identification codes in the scanning result image.
The minimum bounding rectangle is the smallest rectangle that can contain all the identification codes in the scan result map. Specifically, the electronic device extracts position areas of all the identification codes from the scanning result image, and determines a minimum circumscribed rectangle surrounding all the identification codes in the scanning result image based on the position areas of all the identification codes.
The row coordinate of the boundary of the minimum bounding rectangle refers to the row coordinate of the upper boundary of the minimum bounding rectangle.
Specifically, the electronic device determines a minimum bounding rectangle that includes all the identification codes in the scan result map, a center point of the minimum bounding rectangle, a height of the minimum bounding rectangle, and row coordinates of an upper boundary of the minimum bounding rectangle. And calculating the difference value between the actual row coordinate of the central point of the identification code and the actual row coordinate of the upper boundary of the minimum circumscribed rectangle, and obtaining the normalized row coordinate of the central point of the identification code by quotient of the difference value and the height of the minimum circumscribed rectangle.
In some embodiments, the normalization of the actual row coordinates of the center point of the identification code uses the following formula:
C i, y, norm =(C i, y - R y, top ) / R height,
wherein, C i, y Actual row coordinate, R, representing the center point Ci y, top Line coordinates, R, representing the upper boundary of the minimum bounding rectangle height, Height, C, representing the minimum bounding rectangle i, y, norm Representing the center point Ci normalizedThe transformed row coordinates.
In the above embodiment, the actual row coordinates of the center point of the identification code are normalized, so that the relative row coordinates of the center point of the identification code are calculated conveniently.
In some embodiments, clustering the center points of the identification codes according to the normalized row coordinates to obtain the center points of the same row includes: calculating the distance difference between the normalized row coordinates of the center points of the two identification codes according to any two identification codes; if the distance difference is smaller than the distance threshold, determining that the row coordinates of the two identification codes are similar; determining the number of identification codes close to the row coordinates of the same identification code; if the number of the identification codes close to the row coordinate of the same identification code is larger than one, the distance threshold is adjusted step by step, and the step of determining the number of the identification codes close to the row coordinate of the same identification code is executed again until the number of the identification codes close to the row coordinate is not larger than one, and the identification codes close to the row coordinate of the same identification code and the same identification code are determined to be in the same row.
The distance threshold is a critical value representing whether the row coordinates of the two identification codes are close or not. That is, when the distance difference between the two identification codes is smaller than the distance threshold, it indicates that the row coordinates of the two identification codes are close.
Specifically, the electronic device calculates a distance difference between the normalized row coordinates of the center points of any two identification codes, and judges whether the row coordinates of the two identification codes are close or not according to a comparison result of the distance difference and a distance threshold. If the distance difference is smaller than the distance threshold, the row coordinates of the two identification codes are close. Further, the number of the identification codes close to the row coordinate of the same identification code is determined, and when the number of the identification codes close to the row coordinate of the same identification code is more than one, the distance threshold value is adjusted step by step to obtain the adjusted distance threshold value. And comparing the adjusted distance threshold value with the distance difference value, judging the number of the identification codes close to the row coordinate of the same identification code, and dividing the identification codes close to the row coordinate of the same identification code into the same row when the number of the identification codes close to the row coordinate of the same identification code is not more than one, namely the relative row coordinates of the identification codes close to the row coordinate are the same.
In some embodiments, if the distance difference between the two identification codes is not less than the distance threshold, it indicates that the two identification codes are in different rows, i.e. the relative row coordinates of the two identification codes are different.
In some embodiments, the scan result map includes 3 identification codes, i.e., identification code a, identification code b, and identification code c, and the distance threshold is 10. The identification code a, the identification code b and the identification code c are called a, b and c respectively. The distance difference between a and b is 9, the distance difference between c and b is 8, the row coordinates of a and b are similar, the row coordinates of c and b are also similar, and the number of the identification codes similar to the row coordinate of b is 2. At this time, the distance threshold may be adjusted to be 8.5, and the adjusted distance threshold is compared with the distance difference, it is seen that the distance difference between a and b is greater than the adjusted distance threshold, the distance difference between c and b is smaller than the adjusted distance threshold, and the number of the identification codes close to the row coordinate of b is 1, so that it is determined that a and b are in different rows, and c and b are in the same row.
In some embodiments, the scan result map includes 3 identification codes, i.e., identification code d, identification code e, and identification code f, and the distance threshold is 5. Hereinafter, the identification code d is abbreviated as d, the identification code e is abbreviated as e, and the identification code f is abbreviated as f. The difference between the distances d and e is 4, and the difference between the distances d and f is also 4, the number of identification codes close to the row coordinate of d is 2. At this time, the distance threshold may be adjusted to be 3, the adjusted distance threshold is compared with the distance difference, the distance difference between d and e is greater than the adjusted distance threshold, the distance difference between d and f is also greater than the adjusted distance threshold, and the number of the identification codes close to the row coordinate of b is 0, so that it is determined that d, e, and f are in different rows.
It should be noted that, the distance threshold in the foregoing embodiment is merely for illustration and may be selected according to needs, and the embodiment is not limited herein.
In some embodiments, the following formula is used in solving the distance difference:
|C i,y,norm -C j,y,norm |<threshold
wherein, C i,y,norm Representing a central pointC i Normalized row coordinate, C j,y,norm Represents the center point C j Normalization
The normalized row coordinates, threshold, identify a distance threshold that lies between 0,1.
In the embodiment, the identification codes in the same row are determined by calculating the distance difference, so that the method is simple and efficient.
In some embodiments, determining the row order between the rows to obtain the relative row coordinates of the identification codes based on the normalized row coordinates of the center point within the rows comprises: calculating the average value of the normalized row coordinates of the center points of the identification codes in the same row to obtain the average value of the row coordinates; and sorting the average value of the row coordinates of the identification codes of each row to determine the relative row coordinates of the identification codes of each row in the scanning result graph.
Specifically, after classifying all the identification codes according to rows, the electronic device performs average processing on the normalized row coordinates of the center points of all the identification codes in each row to obtain a row coordinate average value. And determining the relative row coordinates of the row identification codes according to the sorting result of the row coordinate average value.
In some embodiments, the row coordinate average is calculated using the following formula:
Figure 194064DEST_PATH_IMAGE002
wherein Row k,y Mean value of line coordinates, N, representing the k-th line k Representing the number of center points of the k-th row, M representing the number of rows of center points, C j,y,norm Represents the center point C j Normalized row coordinates.
In some embodiments, the averaging process includes sorting the normalized row coordinates of the center points of all the identification codes in each row, eliminating the center points of the two identification codes with the maximum and minimum normalized row coordinates, and averaging the normalized row coordinates of the center points of the other identification codes.
In some embodiments, the row coordinate averages are sorted in descending order, that is, the larger the row coordinate average, the smaller the row coordinate. For example, there are 4 rows of identification codes, the row coordinate of all identification codes in the row with the largest row coordinate average is the smallest, and the row coordinate of all identification codes in the row with the smallest row coordinate average is the largest.
In some embodiments, the row coordinate averages are sorted in ascending order to determine the relative row coordinates of each row of identification codes. For example, there are 4 rows of identification codes in total, the row coordinate of all identification codes in the row with the largest row coordinate average is the largest, and the row coordinate of all identification codes in the row with the smallest row coordinate average is the smallest.
In the embodiment, the relative row coordinates of the identification codes of each row are determined by calculating the row coordinate average value of the identification codes of each row and according to the sorted result of the row coordinate average value, so that the method is convenient and simple.
In some embodiments, determining the relative column coordinates of the identification codes in the scan results map comprises: determining actual column coordinates of the central point of the identification codes in the same row; and sorting according to the size of the actual column coordinate to determine the relative column coordinate of the identification code of the same row in the scanning result graph.
The actual row coordinates of the identification code are coordinates of pixel points corresponding to the central point of the identification code in an image coordinate system of the scanning result image.
Specifically, the electronic equipment classifies the identification codes according to rows, obtains relative row coordinates of the identification codes of all rows, determines actual column coordinates of the center points of the identification codes in the same row, performs sorting processing on the actual column coordinates of the center points of the identification codes in the same row to obtain a sorting result, and determines the relative column coordinates of the identification codes in the same row in a scanning result graph according to the sorting result.
In one embodiment, the actual column coordinates of the identification codes of the same row are sorted in ascending order, and the larger the actual column coordinate is, the larger the relative column coordinate of the identification codes of the same row is. For example, the number of the identification codes in the same row is three, and the actual column coordinates of the identification codes from left to right increase in sequence, so the relative column coordinates of the identification codes from left to right increase.
In one embodiment, the actual column coordinates of the identification codes of the same row are sorted in descending order, and the larger the actual column coordinate is, the smaller the relative column coordinate of the identification codes of the same row is. For example, the number of the identification codes in the same row is three, and the actual column coordinates of the identification codes from left to right increase in turn, and the relative column coordinates of the identification codes from left to right decrease.
In the embodiment, the actual column coordinates of the identification codes in the same row are sorted, and the position relation of the identification codes is determined according to the actual column coordinates, so that the method is convenient and simple.
In some embodiments, before displaying the identification code information of the target identification code according to the preset display rule, the method further comprises: determining an invalid identification code designated from a plurality of identification codes in the scan result map in response to an identification code designating operation for the scan result map; the scanning result graph is obtained by scanning a plurality of identification codes by performing a scanning task for the first time; determining an invalid identification code coordinate set according to the relative position coordinates of the invalid identification codes; the identification code information of the target identification code is displayed according to the preset display rule, and the method comprises the following steps: displaying identification code information of the target identification code corresponding to the target relative position coordinates according to a preset display rule; the target relative position coordinates are relative position coordinates in the set of relative position coordinates other than the set of invalid identification code coordinates.
Wherein the invalid identification code is an identification code that does not require display of identification code information when the same scanning job as the scanning job is executed again. It can be understood that in some code scanning scenes, identification code information of part of the identification codes does not need to be displayed, and the electronic equipment does not need to identify the part of the identification codes. In order to improve the code scanning efficiency, the user is allowed to assign invalid identification codes by himself.
Specifically, the user performs an assignment operation of an invalid identification code on the scanning result image, the invalid identification code is assigned from the plurality of identification codes in the scanning result image, and the electronic device records the relative position coordinates of the invalid identification code in response to the assignment operation of the invalid identification code, so as to obtain an invalid identification code coordinate set. The unassigned identification code in the scan result image is the target identification code, which is the identification code required to display the identification code information when performing a scan job. The relative position coordinates of the targets are the relative position coordinates of the target identification codes, and the set formed by the relative position coordinates of the target identification codes is the target relative position coordinate set.
In the embodiment, the invalid identification codes can be filtered out by self-assigning of the invalid identification codes by the user, so that the code scanning efficiency is higher. Meanwhile, the applicable scene is more flexible, and the code scanning requirement of a complex industrial scene can be met.
In an embodiment, as shown in fig. 2, a flow diagram of a code scanning method is provided, which specifically includes the following steps:
step 201, obtaining a scanning result graph obtained by scanning a plurality of identification codes.
Step 202, determining a central point of each identification code, and representing the actual coordinates of each identification code by using the actual coordinates of the central point.
The actual coordinate of the central point is the coordinate of the central point in the image coordinate system of the scanning result graph. The actual coordinates include actual row coordinates and actual column coordinates.
Step 203, normalizing the actual row coordinate of the central point of the identification code to obtain the normalized row coordinate of the central point of the identification code.
And 204, clustering the central points of the identification codes according to the normalized row coordinates to obtain the central points of the same row.
And step 205, calculating the average value of the normalized line coordinates of the central points of the identification codes in the same line.
And step 206, sequencing the average values of the row coordinates of the identification codes of all rows to determine the relative row coordinates of the identification codes of all rows in the scanning result chart.
And step 207, sorting the actual column coordinates of the central points of the identification codes in the same row to determine the relative column coordinates of the identification codes in the same row in the scanning result chart.
And 208, obtaining a relative position coordinate set according to the relative row coordinate and the relative column coordinate of the identification code.
In some embodiments, as shown in fig. 3a, a map of the position relationship of the identification codes in the scan result map is provided. The set of relative position coordinates obtained from the scan result diagram of figure 3a is as follows,
T={{C 1 :(0,0)},{C 2 :(0,1)},{C 3 :(2,0)},{C 4 :(2,1)},{C 5 :(3,0)},{C 6 :(4,0)}}。
wherein, C 1 Center point, C, representing identification code 1 2 The central point, C, of the identification code 2 3 Center point, C, representing identification code 3 4 The central point, C, of the identification code 4 5 The center point, C, of the identification code 5 6 Representing the central point of the identification code 6. T denotes a relative position coordinate set.
Illustratively, the coordinates (0, 0) are coordinates of a center point of the first identification code in the scan result map, which correspond to the identification code of the first row and the first column in the scan result map.
It should be noted that, when the batch scanning task is executed, no matter the scanning task is executed for the first time, or the scanning tasks are executed for the second time and the third time \8230, the step 201 to 208 are executed for the nth scanning task to obtain the relative position coordinate set corresponding to each identification code in the scanning result diagram.
Before step 209 is performed, a preset coordinate set obtained from the primary scanning result map is obtained.
And step 209, determining a comparison result of the relative position coordinate set and a preset coordinate set.
Determining an invalid identification code designated from among the plurality of identification codes in the primary scan result map in response to an identification code designating operation with respect to the primary scan result map before performing step 210; the primary scanning result graph is obtained by scanning a plurality of identification codes by firstly executing a scanning task; and determining an invalid identification code coordinate set according to the relative position coordinates of the invalid identification codes.
Step 210, if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying the identification code information of the target identification code corresponding to the target relative position coordinate according to a preset display rule; the target relative position coordinates are relative position coordinates in the set of relative position coordinates other than the set of invalid identification code coordinates.
In some embodiments, as shown in figure 3b, a schematic diagram of determining a set of coordinates of an invalid identification code is provided. The identification codes 4 and 6 are designated as invalid identification codes, the coordinates of the identification code 4 are (2, 1), and the coordinates of the identification code 6 are (4, 0), and the sets of the coordinates of the invalid identification codes are { (2, 1) and (4, 0) }.
In some embodiments, in the case that the scanning task is being performed, if the relative position coordinate set is the same as the preset coordinate set, that is, the coordinates of all the identification codes in the relative position coordinate set and the preset coordinate set are all the same. For example, the set of relative position coordinates and the set of preset coordinates are both { { C 1 :(0,0)},{C 2 :(1,0)},{C 3 :(2,0)},{C 4 :(2,1)},{C 5 :(3,0)},{C 6 (4, 0) }), only the object identification code C is displayed 1 :(0,0),C 2 :(1,0) ,C 3 :(2,0),C 5 (3, 0) the identification code information of the located identification code, i.e., the identification code information of only the identification code 1, the identification code 2, the identification code 3 and the identification code 5 is displayed, and the invalid identification code C is not displayed 4 (2, 1) and C 6 (4, 0) the located identification code 4 and the identification code information of the identification code 6.
In the code scanning method, a scanning result graph obtained by scanning a plurality of identification codes is obtained; determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set; determining a comparison result of the relative position coordinate set and a preset coordinate set; if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying the identification code information of the target identification code according to a preset display rule; wherein the target identification code is an identification code satisfying a preset rule. When a batch of scanning tasks are executed, the relative position coordinates of the identification codes in the scanning result graph are compared with a preset coordinate set, and when the relative position coordinates are the same as the preset coordinate set, the scanning tasks which are being executed are indicated to be the same as the scanning tasks, so that only the target identification codes are identified, and the identification code information of the target identification codes is displayed, thereby achieving the purpose of filtering non-target identification codes and improving the code scanning efficiency.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a code scanning device for implementing the above related code scanning method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above method, so the specific limitations in one or more embodiments of the code scanning apparatus provided below can be referred to the limitations on the code scanning method in the foregoing, and details are not described here.
In one embodiment, as shown in fig. 4, there is provided a code scanning apparatus, including: an obtaining module 401, a determining module 402 and a displaying module 403, wherein:
the obtaining module 401 is configured to obtain a scan result map obtained by scanning a plurality of identification codes.
A determining module 402, configured to determine a relative position coordinate of the identifier in the scanning result map, to obtain a relative position coordinate set; and determining a comparison result of the relative position coordinate set and a preset coordinate set.
The display module 403 is configured to display the identifier information of the target identifier according to a preset display rule if the comparison result is that the relative position coordinate set is the same as the preset coordinate set; wherein the target identification code is an identification code satisfying a preset rule.
In one embodiment, the determining module 402 is configured to determine relative row coordinates of the identification codes in the scan result map; determining relative column coordinates of the identification codes in the scanning result image; and obtaining the relative position coordinate set according to the relative row coordinate and the relative column coordinate of the identification code.
In an embodiment, as shown in fig. 5, a block diagram of a determining module 402 is provided, which specifically includes:
the normalization processing unit 4021 is configured to perform normalization processing on the actual row coordinate of the center point of the identification code to obtain a normalized row coordinate of the center point of the identification code.
And the clustering unit 4022 is configured to cluster the center points of the identification codes according to the normalized row coordinates to obtain the center points of the same row.
The determining unit 4023 is configured to determine a row order between the rows to obtain a relative row coordinate of each identification code based on the normalized row coordinates of the center point in each row.
In one embodiment, the normalization processing unit 4021 is specifically configured to determine actual row coordinates of a center point of the identification code, a height of a minimum bounding rectangle of the target center point, and row coordinates of a boundary of the minimum bounding rectangle; the target central point is the central point of a minimum circumscribed rectangle comprising all the identification codes in the scanning result graph; and obtaining the normalized row coordinate of the central point of the identification code according to the actual row coordinate of the central point of the identification code, the height of the minimum circumscribed rectangle and the row coordinate of the boundary of the minimum circumscribed rectangle.
In an embodiment, the clustering unit 4022 is specifically configured to calculate a distance difference between the normalized row coordinates of the center points of the two identification codes for any two identification codes; if the distance difference is smaller than the distance threshold, determining that the row coordinates of the two identification codes are similar; determining the number of identification codes close to the row coordinate of the same identification code; if the number of the identification codes close to the row coordinate of the same identification code is more than one, gradually adjusting the distance threshold value, and re-executing the step of determining the number of the identification codes close to the row coordinate of the same identification code until the number of the identification codes close to the row coordinate is not more than one, and determining that the identification codes close to the row coordinate of the same identification code and the same identification code are in the same row.
In an embodiment, the determining unit 4023 is specifically configured to calculate an average value of the normalized row coordinates of the center points of the identification codes in the same row, to obtain an average value of the row coordinates; and sorting the average value of the row coordinates of each row of the identification codes to determine the relative row coordinates of each row of the identification codes in the scanning result image.
In one embodiment, the determining module 402 is configured to determine actual column coordinates of a center point of the positioning boxes in the same row; and sorting according to the size of the actual column coordinate to determine the relative column coordinate of the positioning frames in the same row in the scanning result graph.
In one embodiment, the determining module 402 is further configured to determine an invalid identification code assigned from the plurality of identification codes in the scan result graph in response to the identification code assignment operation for the scan result graph; the scanning result graph is obtained by scanning a plurality of identification codes by performing a scanning task for the first time; determining an invalid identification code coordinate set according to the relative position coordinates of the invalid identification codes; displaying identification code information of the target identification code corresponding to the target relative position coordinates according to a preset display rule; the target relative position coordinates are relative position coordinates in the set of relative position coordinates other than the set of invalid identification code coordinates.
The modules in the code scanning device can be wholly or partially realized by software, hardware and a combination thereof. The modules may be embedded in a hardware form or may be independent of a processor in the electronic device, or may be stored in a memory in the electronic device in a software form, so that the processor calls and executes operations corresponding to the modules.
In one embodiment, an electronic device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 6. The electronic device includes a processor, a memory, a communication interface, and a display screen connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The communication interface of the electronic device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a code scanning method. The display of the electronic device may be a liquid crystal display or an electronic ink display.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is a block diagram of only a portion of the structure associated with the present application, and does not constitute a limitation on the electronic device to which the present application applies, and that a particular electronic device may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include a Read-Only Memory (ROM), a magnetic tape, a floppy disk, a flash Memory, an optical Memory, a high-density embedded nonvolatile Memory, a resistive Random Access Memory (ReRAM), a Magnetic Random Access Memory (MRAM), a Ferroelectric Random Access Memory (FRAM), a Phase Change Memory (PCM), a graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases involved in the embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the various embodiments provided herein may be, without limitation, general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, or the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (11)

1. A method for scanning codes, the method comprising:
acquiring a scanning result graph obtained by scanning a plurality of identification codes;
determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set;
determining a comparison result of the relative position coordinate set and a preset coordinate set;
if the comparison result is that the relative position coordinate set is the same as the preset coordinate set, displaying identification code information of the target identification code according to a preset display rule; wherein the target identification code is an identification code satisfying a preset rule.
2. The method of claim 1, wherein the determining the relative position coordinates of the identification code in the scan result map to obtain a set of relative position coordinates comprises:
determining relative row coordinates of the identification codes in the scanning result image;
determining relative column coordinates of the identification codes in the scanning result image;
and obtaining the relative position coordinate set according to the relative row coordinate and the relative column coordinate of the identification code.
3. The method of claim 2, wherein determining relative row coordinates of the identification code in the scan result map comprises:
normalizing the actual row coordinate of the central point of the identification code to obtain a normalized row coordinate of the central point of the identification code;
clustering the central points of the identification codes according to the normalized row coordinates to obtain the central points of the same row;
and determining the row sequence among the rows to obtain the relative row coordinates of the identification codes based on the normalized row coordinates of the central points in the rows.
4. The method of claim 3, wherein the normalizing the actual row coordinates of the center point of the identification code to obtain normalized row coordinates of the center point of the identification code comprises:
determining the actual row coordinate of the center point of the identification code, the height of the minimum circumscribed rectangle of the target center point and the row coordinate of the boundary of the minimum circumscribed rectangle; the target central point is the central point of a minimum circumscribed rectangle comprising all the identification codes in the scanning result image;
and obtaining the normalized row coordinate of the central point of the identification code according to the actual row coordinate of the central point of the identification code, the height of the minimum circumscribed rectangle and the row coordinate of the boundary of the minimum circumscribed rectangle.
5. The method of claim 3, wherein clustering the center points of the identification codes according to the normalized row coordinates to obtain the center points of the same row comprises:
calculating a distance difference value between the normalized row coordinates of the central points of the two identification codes aiming at any two identification codes;
if the distance difference is smaller than a distance threshold, determining that the row coordinates of the two identification codes are close;
determining the number of identification codes close to the row coordinate of the same identification code;
if the number of the identification codes close to the row coordinate of the same identification code is more than one, gradually adjusting the distance threshold, and re-executing the step of determining the number of the identification codes close to the row coordinate of the same identification code until the number of the identification codes close to the row coordinate is not more than one, and determining that the identification codes close to the row coordinate of the same identification code and the same identification code are in the same row.
6. The method of claim 3, wherein determining the row order between the rows based on the normalized row coordinates of the center point within each row to obtain the relative row coordinates of each identification code comprises:
calculating the average value of the normalized row coordinates of the center points of the identification codes in the same row to obtain the average value of the row coordinates;
and sequencing the row coordinate average value of each row identification code to determine the relative row coordinate of each row identification code in the scanning result graph.
7. The method of claim 2, wherein determining the relative column coordinates of the identification codes in the scan result map comprises:
determining actual column coordinates of the center points of the identification codes in the same row;
and sorting according to the size of the actual column coordinate to determine the relative column coordinate of the identification code of the same row in the scanning result graph.
8. The method according to any one of claims 1 to 7, characterized in that before the displaying the identification code information of the target identification code according to the preset display rule, the method further comprises:
determining an invalid identification code assigned from a plurality of identification codes in a primary scanning result map in response to an identification code assignment operation for the primary scanning result map; the primary scanning result graph is obtained by scanning a plurality of identification codes for the first time;
determining an invalid identification code coordinate set according to the relative position coordinates of the invalid identification codes;
the identification code information of the target identification code is displayed according to the preset display rule, and the method comprises the following steps:
displaying identification code information of the target identification code corresponding to the target relative position coordinates according to a preset display rule; the target relative position coordinates are relative position coordinates in the set of relative position coordinates other than the set of invalid identification code coordinates.
9. A code scanning device, comprising:
the acquisition module is used for acquiring a scanning result graph obtained by scanning a plurality of identification codes;
the determining module is used for determining the relative position coordinates of the identification codes in the scanning result graph to obtain a relative position coordinate set; determining a comparison result of the relative position coordinate set and a preset coordinate set;
the display module is used for displaying the identification code information of the target identification code according to a preset display rule if the comparison result shows that the relative position coordinate set is the same as the preset coordinate set; wherein the target identification code is an identification code satisfying a preset rule.
10. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202211594817.7A 2022-12-13 2022-12-13 Code scanning method, device, electronic equipment and storage medium Active CN115600620B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211594817.7A CN115600620B (en) 2022-12-13 2022-12-13 Code scanning method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211594817.7A CN115600620B (en) 2022-12-13 2022-12-13 Code scanning method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115600620A true CN115600620A (en) 2023-01-13
CN115600620B CN115600620B (en) 2023-06-02

Family

ID=84854192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211594817.7A Active CN115600620B (en) 2022-12-13 2022-12-13 Code scanning method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115600620B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10105641A (en) * 1996-09-30 1998-04-24 Toshiba Corp Method and device for detecting machine code
JP2006252491A (en) * 2005-02-09 2006-09-21 Fuji Electric Systems Co Ltd Tag for image identification and image identification system
CN106650731A (en) * 2016-12-23 2017-05-10 中山大学 Robust license plate and logo recognition method
CN107992793A (en) * 2017-10-20 2018-05-04 深圳华侨城卡乐技术有限公司 A kind of indoor orientation method, device and storage medium
KR20180135532A (en) * 2017-06-13 2018-12-21 이미지랩409(주) Method and system for providing Story-board
CN111008540A (en) * 2019-11-29 2020-04-14 联想(北京)有限公司 Bar code identification method and equipment and computer storage medium
CN111444916A (en) * 2020-03-26 2020-07-24 中科海微(北京)科技有限公司 License plate positioning and identifying method and system under unconstrained condition
CN112468546A (en) * 2020-11-12 2021-03-09 北京锐安科技有限公司 Account position determining method, account position determining device, server and storage medium
CN114022888A (en) * 2022-01-06 2022-02-08 上海朝阳永续信息技术股份有限公司 Method, apparatus and medium for identifying PDF form
CN114170451A (en) * 2021-12-03 2022-03-11 京东科技信息技术有限公司 Text recognition method and device
CN115203665A (en) * 2022-06-17 2022-10-18 丰巢网络技术有限公司 Intelligent cabinet code scanning verification method and device, computer equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10105641A (en) * 1996-09-30 1998-04-24 Toshiba Corp Method and device for detecting machine code
JP2006252491A (en) * 2005-02-09 2006-09-21 Fuji Electric Systems Co Ltd Tag for image identification and image identification system
CN106650731A (en) * 2016-12-23 2017-05-10 中山大学 Robust license plate and logo recognition method
KR20180135532A (en) * 2017-06-13 2018-12-21 이미지랩409(주) Method and system for providing Story-board
CN107992793A (en) * 2017-10-20 2018-05-04 深圳华侨城卡乐技术有限公司 A kind of indoor orientation method, device and storage medium
CN111008540A (en) * 2019-11-29 2020-04-14 联想(北京)有限公司 Bar code identification method and equipment and computer storage medium
CN111444916A (en) * 2020-03-26 2020-07-24 中科海微(北京)科技有限公司 License plate positioning and identifying method and system under unconstrained condition
CN112468546A (en) * 2020-11-12 2021-03-09 北京锐安科技有限公司 Account position determining method, account position determining device, server and storage medium
CN114170451A (en) * 2021-12-03 2022-03-11 京东科技信息技术有限公司 Text recognition method and device
CN114022888A (en) * 2022-01-06 2022-02-08 上海朝阳永续信息技术股份有限公司 Method, apparatus and medium for identifying PDF form
CN115203665A (en) * 2022-06-17 2022-10-18 丰巢网络技术有限公司 Intelligent cabinet code scanning verification method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN115600620B (en) 2023-06-02

Similar Documents

Publication Publication Date Title
CN109977943B (en) Image target recognition method, system and storage medium based on YOLO
CN110427970B (en) Image classification method, apparatus, computer device and storage medium
CN111353512B (en) Obstacle classification method, obstacle classification device, storage medium and computer equipment
EP2528017B1 (en) Image identification device, image identification method, image identification program, and recording medium
US8855368B2 (en) Image identification device, image identification method, and recording medium
CN109214403B (en) Image recognition method, device and equipment and readable medium
CN110717366A (en) Text information identification method, device, equipment and storage medium
CN112036400B (en) Method for constructing network for target detection and target detection method and system
CN108229232B (en) Method and device for scanning two-dimensional codes in batch
CN115759148B (en) Image processing method, device, computer equipment and computer readable storage medium
CN111160169A (en) Face detection method, device, equipment and computer readable storage medium
CN114299363A (en) Training method of image processing model, image classification method and device
CN113297870A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN108960246B (en) Binarization processing device and method for image recognition
CN112749576B (en) Image recognition method and device, computing equipment and computer storage medium
KR101961462B1 (en) Object recognition method and the device thereof
CN111652011B (en) Method and device for reading two-dimensional code
CN109657083B (en) Method and device for establishing textile picture feature library
CN110807342B (en) Bar code positioning method, bar code positioning device, computer equipment and storage medium
CN115880362B (en) Code region positioning method, device, computer equipment and computer readable storage medium
CN115600620B (en) Code scanning method, device, electronic equipment and storage medium
CN111914890A (en) Image block matching method between images, image registration method and product
CN116168377A (en) License plate recognition method, license plate recognition device, computer equipment and storage medium
CN114758384A (en) Face detection method, device, equipment and storage medium
CN114677578A (en) Method and device for determining training sample data

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