CN113139394A - Code reading method, electronic device and storage medium - Google Patents

Code reading method, electronic device and storage medium Download PDF

Info

Publication number
CN113139394A
CN113139394A CN202010055004.5A CN202010055004A CN113139394A CN 113139394 A CN113139394 A CN 113139394A CN 202010055004 A CN202010055004 A CN 202010055004A CN 113139394 A CN113139394 A CN 113139394A
Authority
CN
China
Prior art keywords
user
identification
code
electronic device
code reading
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
CN202010055004.5A
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.)
Hongfujin Precision Electronics Chengdu Co Ltd
Original Assignee
Hongfujin Precision Electronics Chengdu 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 Hongfujin Precision Electronics Chengdu Co Ltd filed Critical Hongfujin Precision Electronics Chengdu Co Ltd
Priority to CN202010055004.5A priority Critical patent/CN113139394A/en
Publication of CN113139394A publication Critical patent/CN113139394A/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
    • 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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/10861Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices sensing of data fields affixed to objects or articles, e.g. coded labels
    • 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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/1098Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices the scanning arrangement having a modular construction

Abstract

A code reading method is applied to an electronic device, and the method comprises the following steps: providing a human-computer interaction interface for a user to select an identification type, wherein the identification type comprises a two-dimensional code identification and a CNC dot code identification; acquiring a workpiece image shot by a camera device, wherein the workpiece image comprises an identifier; according to the operation of a user on a human-computer interaction interface, confirming the identification type selected by the user; and identifying the two-dimensional code mark on the obtained industrial image according to a first image processing method or identifying the CNC dot matrix code mark on the obtained industrial image according to a second image processing method. The invention also provides an electronic device and a storage medium for executing the code reading method.

Description

Code reading method, electronic device and storage medium
Technical Field
The invention relates to a code reading method, an electronic device and a storage medium.
Background
In the process of manufacturing workpieces, in order to trace the quality of the workpieces, the workpieces need to be printed with marks at each process. The marks typically include machine numbers, jig cavity numbers, etc., and are in different formats according to the requirements of the respective processes, for example, a dot code is typically used in a CNC process, and a bar code or a two-dimensional code is typically used in a surface and assembly process. At present, the industry reads the identification of a workpiece through a code scanning gun, and as code scanning software of the code scanning gun is solidified in hardware, inconvenience is brought to identification of the workpiece when the identification is changed.
Disclosure of Invention
In view of the above, it is desirable to provide a code reading method, an electronic device and a storage medium, which are suitable for reading different identifiers.
A code reading method is applied to an electronic device and comprises the following steps: providing a human-computer interaction interface for a user to select an identification type, wherein the identification type comprises a two-dimensional code identification and a CNC dot code identification; acquiring a workpiece image shot by a camera device, wherein the workpiece image comprises an identifier; according to the operation of a user on a human-computer interaction interface, confirming the identification type selected by the user; and identifying the two-dimensional code mark on the obtained industrial image according to a first image processing method or identifying the CNC dot matrix code mark on the obtained industrial image according to a second image processing method.
An electronic device comprises a processor and a memory, wherein a plurality of program modules are stored in the memory, and the program modules are loaded by the processor and execute the code reading method.
A storage medium having stored thereon at least one computer instruction, the instruction being loaded by a processor and executing the code reading method described above.
The code reading method, the electronic device and the storage medium can identify different types of identifiers according to the selected identifier types, and are convenient to operate and high in applicability.
Drawings
FIG. 1 is a flow chart of a code reading method of the present invention.
Fig. 2 is a schematic structural diagram of an electronic device provided in the present invention.
Fig. 3 is a schematic structural diagram of a code reading system provided by the present invention.
Description of the main elements
Figure BDA0002372500990000021
Figure BDA0002372500990000031
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
The present invention will be described in further detail below with reference to the accompanying drawings.
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention, and the described embodiments are merely a subset of the embodiments of the present invention, rather than a complete embodiment. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Referring to fig. 1, the present invention provides a code reading method, which is applied to an electronic device 10 communicatively connected to a camera device 20, for reading a mark on a workpiece photographed by the camera device 10. The electronic device 10 may be a production machine or a computer device. The camera device 20 may be an industrial camera. The code reading method comprises the following steps.
Step S101: and providing a user verification interface according to the response operation and verifying whether the user is a legal user or not according to the information input in the user verification interface.
Step S102: and when the user is a legal user, providing a human-computer interaction interface for the user to select the identification type, wherein the identification type comprises a two-dimensional code identification and a CNC dot matrix code identification. In an embodiment, the step S101 may not be included, and the human-machine interaction interface is directly provided.
Step S103: a workpiece image captured by the camera 20 is acquired, the workpiece image including a logo.
Step S104: and confirming the identification type selected by the user according to the operation of the user on the man-machine interaction interface.
Step S105: and identifying the two-dimensional code mark on the obtained industrial image according to a first image processing method or identifying the CNC dot matrix code mark on the obtained industrial image according to a second image processing method.
In an embodiment, the human-computer interaction interface is further configured to set basic information of the image reference parameter and the identifier. The basic information of the mark includes, but is not limited to, the position and size of the mark to be located on the workpiece. In an embodiment, the basic information of the identifier is obtained by loading a text file, and the text file is stored in a preset address. In another embodiment, the identified basic information is set through an input box displayed on the human-computer interaction interface. The image reference parameters include the spacing between marker points in the markers. In the two-dimensional code identification, the mark points refer to pixel points in the two-dimensional code identification. In the CNC dot matrix code identification, the mark points refer to sunken points in the CNC dot matrix code, and the CNC dot matrix code identification is formed by a plurality of sunken points processed through CNC.
In step S105, identification recognition on the industrial image is performed by applying the first image processing method or the second image processing method according to the image reference parameter and the basic information of the identification set on the human-computer interaction interface. In one embodiment, the valid users include a general user and an administrative user, and whether the user is the general user or the administrative user is verified according to information input by the user verification interface. When the verification user is a management user, the human-computer interaction interface allows the setting of the basic information of the image reference parameters and the identification, and when the verification user is a general user, the human-computer interaction interface does not allow the setting of the basic information of the image reference parameters and the identification, but displays the default basic information of the image reference parameters and the identification.
Specifically, when the confirmed identification type is the two-dimensional code identification, a figure limited area on the acquired workpiece image is determined according to the position and the size of the two-dimensional code identification on the workpiece, the determined figure limited area is subjected to image processing to determine the minimum value and the maximum value range of matrix points and the maximum value and the minimum value range of the intervals between the matrix points in the figure limited area, and the size of black and white pixel points and the intervals between the pixel points in the matrix space are determined through a figure pixel proportion coefficient. And finally, processing by adopting an international universal coding and decoding principle, and extracting the information in the image limited area to obtain the composition information of the two-dimensional code identifier. In addition, the appearance color of the workpiece can brighten or darken the graphic background of the two-dimensional code identification, the appearance color of the workpiece can be set on a human-computer interaction interface, and the background in the workpiece image is subjected to denoising processing before the identification through reading the appearance color information of the workpiece, so that the identification accuracy of the two-dimensional code identification is improved.
When the confirmed identification type is the CNC dot matrix code identification, determining a figure limited area on the acquired workpiece image according to the position and the size of the CNC dot matrix code identification on the workpiece, carrying out image processing on the determined figure limited area to determine the range of the minimum value and the maximum value of matrix points and the range of the maximum value and the minimum value of the space between the matrix points in the figure limited area, and determining the size of the matrix points and the space between the matrix points through the figure pixel proportionality coefficient. Then, according to the dotting direction in the CNC process, carrying out direction sequencing on the CNC dot matrix codes (for example, a mode that 3 rows and 11 columns carry out direction sequencing from right to left and from top to bottom), and presetting the maximum image scaling and the minimum image scaling, and identifying the marking points of the industrial image. Then, similarity judgment is carried out on the identified images of the marking points according to parameters such as point outlines, shapes, sizes and the like. If the similarity value is larger than the set value, the mark point is confirmed to be an effective point, and the coordinate position information of the effective point is recorded. And finally, compiling the identified effective points according to the encoding principle of the lattice structure, and analyzing the composition information of the CNC lattice code identifier, such as the composition information consisting of coordinates [0,5], [1,0], [1,2], [1,4], [1,9], [2,0], [2,1], [2,3] and [2,9 ].
Step S106: displaying information of the identified logo.
Step S107: storing an identification record to a predetermined address, the identification record including information of the identified identification. In one embodiment, the predetermined address is set by a path setting operation on the human-computer interaction interface. In another embodiment, the predetermined address is a default address. The predetermined address may be an address in the electronic device or an address in a server communicatively connected to the electronic device. The mark record can also comprise workpiece information and standard information of the mark, wherein the workpiece information comprises the name of the workpiece and the manufacturing process of the mark, such as assembly, sand blasting, station milling and the like, and the standard information comprises a standard position and a standard size which the mark should have.
Please refer to fig. 2 for a schematic structural diagram of an electronic device 10 according to the present invention and fig. 3 for a block diagram of a code reading system 30 according to the present invention.
The electronic device 10 is connected in communication with the camera device 20, and is configured to receive the workpiece image acquired by the camera device 20. The electronic device 10 includes, but is not limited to, a processor 12, a memory 14, and a computer program 16 stored in the memory 14 and executable on the processor 12, the computer program 16 including a code-reading program. The processor 12, when executing the computer program 16, implements steps S101 to S107 of the code reading method shown in fig. 1. Alternatively, the processor 12, when executing the computer program 16, implements the functionality of the code reading system 30 shown in fig. 3.
It will be understood by those skilled in the art that the schematic diagram is merely an example of the electronic apparatus 10, and does not constitute a limitation of the electronic apparatus 10, and may include more or less components than those shown, or combine some components, or different components, for example, the electronic apparatus 10 may further include input and output devices, network access devices, buses, and the like.
The Processor 12 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor 12 may be any conventional processor or the like, the processor 12 being the control center of the electronic device 10 and connecting the various parts of the overall electronic device 10 using various interfaces and lines.
The memory 14 may be used for storing the computer program 16 and/or the module/unit, and the processor 12 may implement various functions of the electronic device 10 by running or executing the computer program and/or the module/unit stored in the memory 14 and calling data stored in the memory 14. The memory 14 may include high speed random access memory and may also include non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The code reading system 30 operates in the electronic device 10. The code reading system 30 may comprise a plurality of functional modules comprised of program code segments. The program code of the various program segments of the code reading system 30 may be stored in the memory 14 of the electronic device 10 and executed by the at least one processor 12 to implement the code reading.
In this embodiment, the code reading system 30 is divided into a plurality of functional modules according to the functions performed by the code reading system, and the functional modules include an interface display module 31, a verification module 32, an image acquisition module 33, an identifier type confirmation module 34, an identification module 35, an information display module 36, and a storage module 37. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory 14. It will be appreciated that in other embodiments, the modules may also be program instructions or firmware (firmware) that are resident in the processor 12.
The interface display module 31 is configured to provide a user authentication interface in response to an operation. The verification module 32 is configured to verify whether the user is a valid user according to the information input in the user verification interface. The interface display module 31 is further configured to provide a human-computer interaction interface for the user to select an identifier type when the user is a valid user, where the identifier type includes a two-dimensional code identifier and a CNC dot matrix code identifier. The image acquiring module 33 is configured to acquire a workpiece image captured by the image capturing device, where the workpiece image includes an identifier. The identification type confirming module 34 is used for confirming the identification type selected by the user according to the operation of the user on the man-machine interaction interface. The recognition module 35 is configured to recognize the two-dimensional code identifier on the obtained industrial image according to a first image processing method or recognize the CNC dot matrix code identifier on the obtained industrial image according to a second image processing method. The information display module 36 is configured to display information of the identified identifier. The storage module 37 is configured to store an identifier record to a predetermined address, where the identifier record includes information of the identified identifier.
The integrated modules/units of the electronic device 10, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and which, when executed by a processor, may implement the steps of the above-described embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
The code reading method, the electronic device and the storage medium can identify different types of identifiers according to the selected identifier types, and are convenient to operate and high in applicability.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. Several units or means recited in the apparatus claims may also be embodied by one and the same item or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A code reading method is applied to an electronic device, and is characterized in that: the method comprises the following steps:
providing a human-computer interaction interface for a user to select an identification type, wherein the identification type comprises a two-dimensional code identification and a CNC dot code identification;
acquiring a workpiece image shot by a camera device, wherein the workpiece image comprises an identifier;
according to the operation of a user on a human-computer interaction interface, confirming the identification type selected by the user; and
and identifying the two-dimensional code mark on the obtained industrial image according to a first image processing method or identifying the CNC dot matrix code mark on the obtained industrial image according to a second image processing method.
2. The code reading method of claim 1, wherein before the step of providing a human-computer interaction interface for a user to select the identification type, further comprising the steps of:
providing a user verification interface in response to the operation and verifying whether the user is a legal user according to information input in the user verification interface;
and entering the step of providing a human-computer interaction interface for the user to select the identification type when the user is a legal user.
3. The code reading method according to claim 1, further comprising the steps of:
displaying information of the identified logo.
4. The code reading method according to claim 1, further comprising the steps of:
storing an identification record to a predetermined address, the identification record including information of the identified identification.
5. The code reading method according to claim 4, wherein the predetermined address is set by a path setting operation on the human-machine interaction interface.
6. The code reading method according to claim 4, wherein the predetermined address is an address in a server communicatively connected to the electronic device.
7. The code reading method of claim 4, wherein the mark record further comprises workpiece information and standard information of the mark, the workpiece information comprises a name of the workpiece and a manufacturing process in which the workpiece is located, and the standard information comprises a standard position and a standard size which the mark should have.
8. An electronic device comprising a processor and a memory, wherein the memory stores a plurality of program modules, and the program modules are loaded by the processor and execute the code reading method according to any one of claims 1 to 7.
9. The electronic device of claim 8, wherein the electronic device is a production tool.
10. A storage medium having stored thereon at least one computer instruction, wherein the instruction is loaded by a processor and executes a method of reading code according to any one of claims 1 to 7.
CN202010055004.5A 2020-01-17 2020-01-17 Code reading method, electronic device and storage medium Pending CN113139394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010055004.5A CN113139394A (en) 2020-01-17 2020-01-17 Code reading method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010055004.5A CN113139394A (en) 2020-01-17 2020-01-17 Code reading method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN113139394A true CN113139394A (en) 2021-07-20

Family

ID=76809533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010055004.5A Pending CN113139394A (en) 2020-01-17 2020-01-17 Code reading method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113139394A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114330404A (en) * 2021-12-28 2022-04-12 易唯思智能自动化装备无锡有限公司 Two-dimensional code engraving effect verification method, system and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114330404A (en) * 2021-12-28 2022-04-12 易唯思智能自动化装备无锡有限公司 Two-dimensional code engraving effect verification method, system and storage medium

Similar Documents

Publication Publication Date Title
CN109977935B (en) Text recognition method and device
CN109886928B (en) Target cell marking method, device, storage medium and terminal equipment
CN110751682B (en) Method, device, terminal equipment and storage medium for extracting and identifying image
CN110675940A (en) Pathological image labeling method and device, computer equipment and storage medium
CN108805519B (en) Electronic generation method and device for paper schedule and electronic schedule generation method
CN102779264A (en) Method and device for realizing barcode recognition
JP7076772B2 (en) Authentication system and authentication method
CN112308046A (en) Method, device, server and readable storage medium for positioning text region of image
CN115131741A (en) Method and device for detecting code carving quality, computer equipment and storage medium
CN113139394A (en) Code reading method, electronic device and storage medium
US20240127404A1 (en) Image content extraction method and apparatus, terminal, and storage medium
CN111144160B (en) Full-automatic material cutting method and device and computer readable storage medium
CN113920038A (en) Cut contour extraction method, device system and medium
CN111598090B (en) Method, device, equipment and storage medium for identifying marks on printed circuit board
CN113420756A (en) Certificate image recognition method and device, storage medium and electronic device
CN111898171A (en) Method and device for determining machining drawing of excess material, electronic equipment and storage medium
CN111325106A (en) Method and device for generating training data
CN114299481A (en) Vehicle identification code identification method and device and computer equipment
CN111401365B (en) OCR image automatic generation method and device
CN114398920A (en) Code reading method, and code reading apparatus
CN109919111B (en) Method, device, container and system for determining container area corresponding to camera
CN113850100A (en) Method and device for correcting two-dimensional code
JP5313946B2 (en) Midpoint calculation device, method, and program for imprint image
JP2016099830A (en) Character information reading device and program
CN113474786A (en) Electronic purchase order identification method and device and terminal 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