Barcode detection method, device, equipment and medium
By preprocessing and feature recognition of GS1-128 barcodes, we can determine whether the encoding features comply with standard encoding rules, and solve the reliability and standardization problems of existing systems when reading GS1-128 barcodes, and achieve efficient and accurate barcodes Data reading.
Patent Information
- Application Number
- CN202411516876.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-29
AI Technical Summary
When reading GS1-128 barcode barcode, the existing barcode detection system may fail or read errors due to barcode quality, scanning environment or data format, and lack judgment on whether the barcode is compliant, so it cannot guarantee the standardization of the barcode. .
By acquiring the barcode image, preprocessing is performed to obtain the preprocessed barcode image, and then feature recognition is performed on the preprocessed image to obtain the encoding features and barcode types. Based on the barcode type, whether the encoding features comply with the standard encoding rules, if so, Read barcode data.
The standardization of barcode data is achieved, ensuring the reliability and accuracy of reading barcode data is ensured, and reading errors caused by barcode quality or environmental factors are avoided.
Smart Images

Figure CN119445229A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a barcode detection method, device, equipment and medium. Background Art
[0002] With the continuous advancement of technology, the types and encoding methods of barcodes are also constantly developing, from the initial one-dimensional barcode to the later two-dimensional barcode, and then to the more advanced automatic identification technologies such as RFID, barcode technology has become an indispensable part of modern supply chain management. In the field of automatic identification technology, one-dimensional barcodes such as UPC and EAN have been widely used, but with the increase in data volume and complexity, these traditional barcodes have gradually revealed their limitations.
[0003] At present, GS1-128 barcodes, as an extension and upgrade of one-dimensional barcodes, have gradually become the mainstream of the market with their larger storage capacity, support for alphanumeric data, and global standardization. However, there are still some shortcomings in the detection of GS1-128 barcodes. For example, when reading GS1-128 barcodes, traditional barcode scanners may fail to read or read incorrectly due to factors such as barcode quality, scanning environment, or data format. In addition, existing barcode detection systems often lack the ability to judge whether barcodes are compliant and cannot guarantee the standardization of barcodes. Summary of the invention
[0004] The present invention provides a barcode detection method, device, equipment and medium, which can realize the standardization of barcode data by judging whether the encoding characteristics of the barcode conform to the prescribed standard encoding rules, thereby ensuring the reliability and accuracy of reading the barcode data.
[0005] According to one aspect of the present invention, there is provided a barcode detection method, comprising:
[0006] Get the barcode image;
[0007] Preprocessing the barcode image to obtain a preprocessed barcode image;
[0008] Performing feature recognition on the preprocessed barcode image to obtain coding features and barcode types;
[0009] Determining whether the encoding feature complies with standard encoding rules based on the barcode type;
[0010] If the coding feature complies with the standard coding rule, the target barcode data of the barcode image is read.
[0011] Optionally, determining whether the encoding feature complies with standard encoding rules based on the barcode type includes:
[0012] Determine the corresponding standard encoding rule according to the barcode type;
[0013] Determine whether the encoding feature complies with the standard encoding rule.
[0014] Optionally, determining whether the coding feature complies with the standard coding rule includes:
[0015] Determining whether the coding feature includes a setting symbol;
[0016] If the coding feature does not include the setting symbol, segmenting the coding feature to obtain segmented coding features;
[0017] Analyzing the segmented coding features to obtain a target identifier;
[0018] It is determined whether the target identifier conforms to a standard identifier.
[0019] Optionally, if the coding feature does not include a setting symbol, segmenting the coding feature to obtain segmented coding features includes:
[0020] If the coding feature does not include a setting symbol, reading a segmentation symbol in the coding feature;
[0021] The coding feature is segmented according to the segmentation symbol to obtain the segmented coding feature.
[0022] Optionally, analyzing the segmented coding features to obtain a target identifier includes:
[0023] Extracting the beginning identifier of the first number from the segmented coding features;
[0024] Determine whether the beginning identifier of the first number conforms to the first identification data range;
[0025] If the beginning identifier of the first number does not conform to the first identification data range, determining whether the beginning identifier of the first number conforms to the second identification data range;
[0026] If the beginning identifier of the first number is consistent with the second identification data range, the beginning identifier of the second number is intercepted from the segmented coding feature as the target identifier.
[0027] Optionally, also include:
[0028] If the beginning identifier of the first number does not conform to the second identification data range, determining whether the beginning identifier of the first number conforms to the third identification data range;
[0029] If the beginning identifier of the first number is consistent with the third identification data range, the beginning identifier of the third number is intercepted from the segmented coding feature as the target identifier.
[0030] Optionally, if the coding feature conforms to a standard coding rule, reading target barcode data of the barcode image includes:
[0031] If the target identifier conforms to the standard identifier, the target barcode data of the barcode image is read based on the target identifier.
[0032] According to another aspect of the present invention, there is provided a barcode detection device, comprising:
[0033] An image acquisition module, used for acquiring a barcode image;
[0034] An image preprocessing module, used to preprocess the barcode image to obtain a preprocessed barcode image;
[0035] A feature recognition module is used to perform feature recognition on the preprocessed barcode image to obtain coding features and barcode types;
[0036] A feature judgment module, used to determine whether the coding feature conforms to the standard coding rule based on the barcode type;
[0037] The data reading module is used to read the target barcode data of the barcode image if the coding feature conforms to the standard coding rule.
[0038] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0039] at least one processor; and
[0040] a memory communicatively connected to the at least one processor; wherein,
[0041] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the barcode detection method described in any embodiment of the present invention.
[0042] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the barcode detection method described in any embodiment of the present invention when executed.
[0043] The technical solution of the embodiment of the present invention is to obtain a barcode image; preprocess the barcode image to obtain a preprocessed barcode image; perform feature recognition on the preprocessed barcode image to obtain coding features and barcode type; determine whether the coding features comply with standard coding rules based on the barcode type; if the coding features comply with standard coding rules, read the target barcode data of the barcode image. This technical solution can standardize barcode data by determining whether the coding features of a barcode comply with prescribed standard coding rules, thereby ensuring the reliability and accuracy of reading barcode data.
[0044] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 is a flow chart of a barcode detection method provided according to Embodiment 1 of the present invention;
[0047] Figure 2 is a flow chart of a barcode detection method provided according to Embodiment 2 of the present invention;
[0048] Figure 3 is a structural schematic diagram of a barcode detection device provided according to Embodiment 3 of the present invention;
[0049] Figure 4 1 is a schematic diagram of the structure of an electronic device provided according to a fourth embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0051] It should be noted that the terms "first", "second" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0052] Embodiment 1
[0053] Figure 1 This is a flow chart of a barcode detection method provided according to the first embodiment of the present invention. This embodiment is applicable to the case of detecting a barcode. The method can be executed by a barcode detection device. The barcode detection device can be implemented in the form of hardware and / or software. The barcode detection device can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:
[0054] S110, obtaining a barcode image.
[0055] The barcode image can be understood as a GS1 barcode image. In this embodiment, high-definition cameras or professional scanners and other precision equipment can be used to capture high-quality images of the GS1 code to be read. These devices not only have high sensitivity, but also can maintain the clarity and stability of the image in complex light environments, laying a solid foundation for subsequent processing. This embodiment can ensure that each capture can capture a complete and clear GS1 barcode image through precise alignment and rapid response.
[0056] S120: preprocess the barcode image to obtain a preprocessed barcode image.
[0057] The preprocessing may include denoising and binarization of the barcode image. The preprocessed barcode image may be a binarized image obtained by binarization. In this embodiment, the collected barcode image may be denoised and binarized to obtain the preprocessed barcode image.
[0058] Specifically, in this embodiment, the barcode image can be filtered to remove noise, and the barcode image can also be smoothed, and then the barcode image can be made clearer through sharpening, etc.; then the barcode image after the denoising operation is binarized to obtain a corresponding binary image, that is, the pre-processed image.
[0059] The preprocessing operation in this embodiment can improve the accuracy of subsequent reading. It can be used to remove random noise points in the image through denoising technology, improve the signal-to-noise ratio of the image, and create good conditions for fine processing. Subsequently, the binarization process simplifies the barcode image into black and white, highlighting the structural features of the GS1 code, which is convenient for subsequent edge detection and feature extraction. The edge detection algorithm can further enhance the edge contour of the code, making the structure of the code more distinct, providing strong support for accurate recognition.
[0060] S130, performing feature recognition on the preprocessed barcode image to obtain coding features and barcode type.
[0061] Among them, feature recognition can be an operation of identifying coding features and barcode types on the preprocessed barcode image. The coding features can include the code value structure features of the barcode identified by the barcode image. The barcode type can be the type corresponding to the barcode. In this embodiment, according to different barcode types, it can be determined that the barcode type corresponds to different coding rules and information capacity. In this embodiment, the barcode type can be a GS1-128 barcode.
[0062] In this embodiment, the pre-processed barcode image enters the structural analysis stage to deeply analyze the structural characteristics of the GS1 code. In this embodiment, the pre-processed barcode image can be analyzed by advanced image analysis technology to obtain key parameters such as barcode type, size and encoding characteristics.
[0063] S140. Determine whether the encoding feature complies with standard encoding rules based on the barcode type.
[0064] The standard coding rule may be a GS1 international standard rule. In this embodiment, when the barcode type is a GS1-128 barcode, the corresponding GS1 international standard rule can be determined, and the coding feature is compared with the GS1 international standard rule to determine whether the coding feature complies with the GS1 international standard rule. In this embodiment, the coding feature is compared with the GS1 international standard to further ensure the accuracy and standardization of the barcode.
[0065] S150: If the coding feature complies with the standard coding rule, the target barcode data of the barcode image is read.
[0066] The target barcode data may include commodity information and logistics information contained in the barcode. In this embodiment, if the coding features of the barcode image are determined to conform to the standard coding rules, the commodity information and logistics information contained in the barcode image may be read.
[0067] Furthermore, in this embodiment, the GS1 target barcode data content can be sent to the corresponding application system for further processing and utilization. This process is implemented through standardized data interfaces and communication protocols, ensuring seamless data flow and efficient integration. Whether it is the listing of goods on the e-commerce platform, the inventory update of the inventory management system, or the logistics tracking of the logistics management system, accurate and timely information support can be obtained through this process, thereby promoting the overall optimization and upgrading of supply chain management.
[0068] Furthermore, the technical solution of this embodiment can be executed by the GS1-128 barcode reader module. As an indispensable key component in the modern supply chain management system, the GS1-128 barcode reader module integrates the industry's leading technology and innovative thinking, and sets a new benchmark for efficient and accurate data collection and analysis. The core of this module lies in its high-performance barcode scanning engine, which not only represents the pinnacle of hardware technology, but also integrates the most cutting-edge image processing technology and intelligent algorithms to achieve high-speed and accurate recognition of complex barcode types such as GS1-128. GS1-128 barcodes play a vital role in logistics tracking, inventory management, product traceability and other fields with their rich information and special structure.
[0069] In order to ensure the integrity and accuracy of data information, the GS1-128 barcode reader module has a built-in advanced parsing engine that can automatically identify and accurately parse each application identifier (AI) in the barcode and its corresponding data field. This process not only requires a high degree of technical precision, but also reflects a deep understanding and compliance with GS1 international standards, thereby ensuring seamless docking and efficient flow of data exchange. In order to further improve the compatibility and interoperability of the system, the module adopts a standardized data interface design and a universal communication protocol. This move enables the GS1-128 barcode reader system to be easily integrated into various supply chain management systems, whether it is a complex ERP system of a large multinational company or a basic management software of a small and medium-sized enterprise, it can achieve seamless docking, greatly broaden the application scenarios, and reduce the system integration cost. At the algorithm level, the GS1-128 barcode reader module continuously optimizes the detection algorithm, and through the comprehensive use of image processing technology, pattern recognition algorithms and advanced machine learning methods, it performs fine preprocessing, feature extraction and efficient classification and recognition of barcode images. This process not only significantly improves the reading speed and accuracy, but also effectively reduces the misreading rate through the built-in error detection and correction mechanism, ensuring the reliability and accuracy of the data. Finally, during the system integration and testing phase, the GS1-128 barcode reading module underwent rigorous functional and performance testing. Through deep integration with the existing supply chain management system, the module has been extensively verified in a variety of practical scenarios to ensure its stability and reliability in different working environments. This series of tests not only verifies the technical strength of the module, but also provides customers with a solid confidence guarantee, making the GS1-128 barcode reading module an important force in promoting the digital transformation of supply chain management.
[0070] In this embodiment, the reading operation of the GS1-128 barcode reading module significantly improves the overall efficiency and accuracy of supply chain management. Through high-speed and accurate barcode recognition, enterprises can quickly process information such as inventory flow and logistics tracking, effectively reduce human errors, and significantly reduce operating costs. At the same time, the module strengthens the full-chain traceability of products from production to consumption, ensuring that enterprises can respond quickly to market demand and fully comply with the traceability requirements of industry regulations. In addition, it also promotes the standardization process of barcode technology, enhances the interoperability between systems, lays a solid foundation for the modernization and transformation of supply chain management, and leads the industry to a more efficient, intelligent, and compliant direction.
[0071] The technical solution of the embodiment of the present invention is to obtain a barcode image; preprocess the barcode image to obtain a preprocessed barcode image; perform feature recognition on the preprocessed barcode image to obtain coding features and barcode type; determine whether the coding features comply with standard coding rules based on the barcode type; if the coding features comply with standard coding rules, read the target barcode data of the barcode image. This technical solution can standardize barcode data by determining whether the coding features of the barcode comply with the prescribed standard coding rules, thereby ensuring the reliability and accuracy of reading barcode data.
[0072] Embodiment 2
[0073] Figure 2 1 is a flowchart of a barcode detection method according to the second embodiment of the present invention. This embodiment is optimized based on the above embodiment. The specific optimization is: determining whether the encoding feature conforms to the standard encoding rules based on the barcode type, including: determining the corresponding standard encoding rules according to the barcode type; judging whether the encoding feature conforms to the standard encoding rules. Figure 2 As shown, the method includes:
[0074] S210: Obtain a barcode image.
[0075] S220: preprocess the barcode image to obtain a preprocessed barcode image.
[0076] S230: Perform feature recognition on the preprocessed barcode image to obtain coding features and barcode type.
[0077] S240. Determine the corresponding standard encoding rule according to the barcode type.
[0078] This embodiment can determine different standard encoding rules according to different barcode types. Specifically, if the barcode type in this embodiment is GS1-128, the standard encoding rules of GS1 code are determined; if it is other barcode types, other barcode type rules can be determined for subsequent judgment and processing.
[0079] S250: Determine whether the coding feature complies with standard coding rules.
[0080] In this embodiment, the coding features obtained by performing feature recognition on the preprocessed barcode image can be compared with the standard coding features to determine whether the coding features comply with the standard coding rules.
[0081] In this embodiment, optionally, determining whether the coding feature complies with standard coding rules includes: determining whether the coding feature includes a set symbol; if the coding feature does not include a set symbol, segmenting the coding feature to obtain a segmented coding feature; analyzing the segmented coding feature to obtain a target identifier; and determining whether the target identifier complies with the standard identifier.
[0082] Among them, the setting symbol can be understood as a bracket. The segmentation process can be a corresponding segmentation operation according to the segmentation method of the coding feature. In this embodiment, the segmentation method can be a segmentation process according to the segmentation symbol contained in the coding feature structure, or it can be a segmentation process according to the data set with a fixed length. The target identifier can be understood as an identifier obtained by character interception analysis of the segmented coding feature. The segmented coding feature can be understood as different coding data obtained by segmenting the coding feature according to the segmentation method. In this embodiment, the segmented coding feature can include multiple groups of coding data. The standard identifier can be various standard identifiers contained in the standard encoding of the GS1 code. For example, the standard identifier can be a fixed-length identifier.
[0083] In this embodiment, it can be determined whether the coding feature contains bracket symbols. If the coding feature contains bracket symbols, a prompt message such as "the coding content does not comply with the GS1 code specification" can be popped up. It can be understood that the prompt message popped up in this embodiment can be set according to actual needs. If the coding feature does not contain bracket symbols, the coding feature can be segmented according to the segmentation symbol or fixed-length data included therein to obtain the segmented coding feature.
[0084] In this embodiment, the coding feature can be segmented in a segmentation manner according to the segmentation symbols contained in the coding feature to obtain multiple groups of coding data, and then the multiple groups of coding data are analyzed and processed respectively to obtain the target identifier, and it is determined whether the target identifier meets the standard identifier of the GS1 code.
[0085] Through such a setting in this embodiment, corresponding segmentation processing and analysis operations can be performed according to the standard coding rules corresponding to the barcode to determine whether the coding features comply with the prescribed standard coding rules, thereby improving the compliance and reliability of the barcode image.
[0086] In this embodiment, optionally, if the coding feature does not include a setting symbol, the coding feature is segmented to obtain a segmented coding feature, including: if the coding feature does not include a setting symbol, reading the segmentation symbol in the coding feature; segmenting the coding feature according to the segmentation symbol to obtain a segmented coding feature.
[0087] The segmentation symbol may be an invisible separator included in the coding feature, which is used to segment the coding feature. In this embodiment, the coding feature includes an invisible separator, and the coding feature can be segmented according to the invisible separator. Exemplarily, the invisible separator can be represented as char29.
[0088] In this embodiment, if the coding feature does not include brackets, the segmentation symbol contained in the coding feature can be read, and the coding feature can be segmented into multiple groups of different coding data according to the segmentation symbol to obtain the segmented coding feature.
[0089] Through such a setting in this embodiment, the coding feature data can be processed in blocks according to the invisible segmentation symbols contained in the coding feature to facilitate analysis and processing, thereby improving the efficiency and accuracy of barcode detection.
[0090] In this embodiment, optionally, the segmented coding features are analyzed to obtain a target identifier, including: intercepting the beginning identifier of the first number from the segmented coding features; judging whether the beginning identifier of the first number conforms to a first identification data range; if the beginning identifier of the first number does not conform to the first identification data range, judging whether the beginning identifier of the first number conforms to a second identification data range; if the beginning identifier of the first number conforms to the second identification data range, intercepting the beginning identifier of the second number from the segmented coding features as the target identifier.
[0091] Among them, the beginning identifier of the first number can be understood as the characters of the first two numbers of the encoded feature data as the identifier of the variable i. The first identification data range can be a set data range. In this embodiment, the first identification data range and the second identification data range can be set according to actual needs, and the third identification data range can also be set. It can be set according to actual needs, and this embodiment is not limited to this. The beginning identifier of the second number can be understood as the characters of the first three numbers of the encoded feature data as the identifier of the variable i. Specifically, the first identification data range can be a data range of i<23 or i=30,37 or 90≤i≤99. The second identification data range can be a data range of i=24,25,40,41,42,71 or 31≤i≤39. The target identifier can be understood as
[0092] In this embodiment, the data of the first two characters of the segmented coding feature are intercepted as the variable i identifier, and then the variable i of the first two characters intercepted is checked to see if it meets the set first identification data range. If the variable i of the first two characters intercepted meets the set first identification data range, that is, it is within the set first identification data range, then the variable i of the first two characters is the target identifier, and it is further judged whether the target identifier meets the set prescribed identifier. If it is judged that the target identifier meets the set prescribed identifier, it can be determined whether the prescribed identifier belongs to a fixed-length identifier. If it meets the fixed-length identifier, it can be truncated according to the length specified by the fixed-length identifier, and the characters obtained after truncation are used as the identification content. If the variable i of the first two characters intercepted does not meet the set first identification data range, that is, it is not within the set first identification data range, then it can be judged whether the variable i of the first two characters intercepted meets the set second identification data range, that is, whether it is within the set second identification data range. If the variable i of the first two characters intercepted is within the set second identification data range, the first three characters of the segmented coding feature are intercepted and reset to the identifier i, that is, it can be considered that the identifier i that is intercepted and reset to the first three characters is the target identifier. If the variable i of the first two characters intercepted is not within the set second identification data range, it can also be judged whether it meets the set third identification data range.
[0093] In this embodiment, by such a setting, the target identifier is determined by intercepting the first character of the data and setting the data range to determine whether the data conforms to the standard data specification, thereby improving the standardization of the barcode image data.
[0094] In this embodiment, optionally, it also includes: if the beginning identifier of the first number does not conform to the second identification data range, then determining whether the beginning identifier of the first number conforms to the third identification data range; if the beginning identifier of the first number conforms to the third identification data range, then intercepting the beginning identifier of the third number as the target identifier of the segmented coding feature.
[0095] The third identification data range may be a set data range, specifically, the third identification data range may be i=70, 80, 81, 82. The third number's leading identifier may be understood as the characters of the first four numbers of the encoding feature data as the variable i identifier.
[0096] In this embodiment, if the starting identifier of the first number does not conform to the second identification data range, that is, if the variable i of the first two characters intercepted does not conform to the second identification data range, then continue to judge whether the variable i of the first two characters intercepted conforms to the set third identification data range; if the variable i of the first two characters intercepted conforms to the third identification data range, then the first four characters of the data intercepted from the segmented coding feature are used as the variable i identifier as the target identifier.
[0097] Through such a setting in this embodiment, the beginning characters of the data can be judged, and different numbers of identifiers can be intercepted as target identifiers according to different data ranges to further determine whether the encoding characteristics meet the standard data specifications, thereby improving the standardization of the barcode image data.
[0098] S260: If the coding feature complies with the standard coding rule, the target barcode data of the barcode image is read.
[0099] In this embodiment, optionally, if the encoding feature conforms to the standard encoding rule, then the target barcode data of the barcode image is read, including: if the target identifier conforms to the standard identifier, then the target barcode data of the barcode image is read based on the target identifier.
[0100] In this embodiment, if the target identifier meets the prescribed identifier, and different data reading operations can be performed according to the different standard identifiers in the prescribed identifier. Specifically, if the target identifier is a fixed-length identifier, the characters of length x after i are intercepted from the length x specified by the fixed-length identifier as the identification content of the group of data, that is, the target barcode data; in this embodiment, the target identifier is a fixed-length identifier. After determining the target identification content, it is also possible to remove i+x characters of the group of data and then determine whether there is remaining data. If there is remaining data, the judgment step of taking the first 2 characters of the intercepted data as the variable i is executed cyclically. If there is no remaining data, the next group of data after segmentation can be processed and analyzed. If the target identifier does not belong to a fixed-length identifier, all the remaining characters are used as the identification content of the group of data, that is, the target barcode data, and the next group of data after segmentation can be analyzed and processed.
[0101] Through such a configuration in this embodiment, the target barcode data of the barcode image can be read according to the determined target identifier, thereby improving the accuracy of the read target barcode data.
[0102] The technical solution of the embodiment of the present invention is to obtain a barcode image; preprocess the barcode image to obtain a preprocessed barcode image; perform feature recognition on the preprocessed barcode image to obtain coding features and barcode type; determine the corresponding standard coding rules according to the barcode type; determine whether the coding features comply with the standard coding rules; if the coding features comply with the standard coding rules, read the target barcode data of the barcode image. This technical solution can achieve standardization of barcode data by determining whether the coding features of the barcode comply with the prescribed standard coding rules, thereby ensuring the reliability and accuracy of reading barcode data.
[0103] Embodiment 3
[0104] Figure 3 It is a structural schematic diagram of a barcode detection device provided according to Embodiment 3 of the present invention.
[0105] like Figure 3 As shown, the device comprises:
[0106] An image acquisition module 310 is used to acquire a barcode image;
[0107] The image preprocessing module 320 is used to preprocess the barcode image to obtain a preprocessed barcode image;
[0108] The feature recognition module 330 is used to perform feature recognition on the pre-processed barcode image to obtain the coding feature and the barcode type;
[0109] A feature determination module 340 is used to determine whether the coding feature conforms to the standard coding rules based on the barcode type;
[0110] The data reading module 350 is used to read the target barcode data of the barcode image if the coding feature meets the standard coding rule.
[0111] Optionally, the feature determination module 340 includes:
[0112] A standard coding rule determination unit, used to determine the corresponding standard coding rule according to the barcode type;
[0113] The judging unit is used to judge whether the coding feature complies with the standard coding rules.
[0114] Optionally, the judging unit comprises:
[0115] A setting symbol determination subunit is used to determine whether the coding feature includes a setting symbol;
[0116] A segmentation processing subunit, used for segmenting the coding feature to obtain a segmented coding feature if the coding feature does not include the set symbol;
[0117] A feature analysis subunit, used for analyzing the segmented coding features to obtain a target identifier;
[0118] The identifier judgment subunit is used to judge whether the target identifier conforms to the standard identifier.
[0119] Optionally, the segmentation processing subunit is specifically used to read the segmentation symbol in the coding feature if the coding feature does not include the set symbol; and segment the coding feature according to the segmentation symbol to obtain the segmented coding feature.
[0120] Optionally, a feature analysis subunit is specifically used to intercept the beginning identifier of the first number in the segmented coding feature; determine whether the beginning identifier of the first number conforms to the first identification data range; if the beginning identifier of the first number does not conform to the first identification data range, determine whether the beginning identifier of the first number conforms to the second identification data range; if the beginning identifier of the first number conforms to the second identification data range, intercept the beginning identifier of the second number in the segmented coding feature as the target identifier.
[0121] Optionally, it also includes: an identifier judgment subunit, which is used to judge whether the beginning identifier of the first number conforms to the third identification data range if the beginning identifier of the first number does not conform to the second identification data range; if the beginning identifier of the first number conforms to the third identification data range, the beginning identifier of the third number is intercepted from the segmented coding features as the target identifier.
[0122] Optionally, the data reading module 350 is specifically configured to read the target barcode data of the barcode image based on the target identifier if the target identifier conforms to the standard identifier.
[0123] A barcode detection device provided in an embodiment of the present invention can execute a barcode detection method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0124] Embodiment 4
[0125] Figure 4 1 is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0126] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0127] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0128] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a barcode detection method.
[0129] In some embodiments, the barcode detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the barcode detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the barcode detection method in any other appropriate manner (e.g., by means of firmware).
[0130] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0131] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0132] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0133] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0134] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0135] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0136] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0137] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A barcode detection method, characterized in that: include: Get the barcode image; Preprocessing the barcode image to obtain a preprocessed barcode image; Performing feature recognition on the preprocessed barcode image to obtain coding features and barcode types; Determining whether the encoding feature complies with standard encoding rules based on the barcode type; If the coding feature complies with the standard coding rule, the target barcode data of the barcode image is read.
2. The method according to claim 1, characterized in that Determining whether the encoding feature complies with standard encoding rules based on the barcode type includes: Determine the corresponding standard encoding rule according to the barcode type; Determine whether the encoding feature complies with the standard encoding rule.
3. The method according to claim 2, characterized in that Determining whether the coding feature complies with the standard coding rule includes: Determining whether the coding feature includes a setting symbol; If the coding feature does not include the setting symbol, segmenting the coding feature to obtain segmented coding features; Analyzing the segmented coding features to obtain a target identifier; It is determined whether the target identifier conforms to a standard identifier.
4. The method according to claim 3, characterized in that: If the coding feature does not include the setting symbol, the coding feature is segmented to obtain the segmented coding feature, including: If the coding feature does not include a setting symbol, reading a segmentation symbol in the coding feature; The coding feature is segmented according to the segmentation symbol to obtain the segmented coding feature.
5. The method according to claim 3, characterized in that: Analyzing the segmented coding features to obtain a target identifier includes: Extracting the beginning identifier of the first number from the segmented coding features; Determine whether the beginning identifier of the first number conforms to the first identification data range; If the beginning identifier of the first number does not conform to the first identification data range, determining whether the beginning identifier of the first number conforms to the second identification data range; If the beginning identifier of the first number is consistent with the second identification data range, the beginning identifier of the second number is intercepted from the segmented coding feature as the target identifier.
6. The method according to claim 5, characterized in that Also includes: If the beginning identifier of the first number does not conform to the second identification data range, determining whether the beginning identifier of the first number conforms to the third identification data range; If the beginning identifier of the first number is consistent with the third identification data range, the beginning identifier of the third number is intercepted from the segmented coding feature as the target identifier.
7. The method according to claim 3, characterized in that If the coding feature conforms to the standard coding rule, then reading the target barcode data of the barcode image includes: If the target identifier conforms to the standard identifier, the target barcode data of the barcode image is read based on the target identifier.
8. A barcode detection device, characterized in that: include: An image acquisition module, used for acquiring a barcode image; An image preprocessing module, used to preprocess the barcode image to obtain a preprocessed barcode image; A feature recognition module is used to perform feature recognition on the preprocessed barcode image to obtain coding features and barcode types; A feature judgment module, used to determine whether the coding feature conforms to the standard coding rule based on the barcode type; The data reading module is used to read the target barcode data of the barcode image if the coding feature conforms to the standard coding rule.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the barcode detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the barcode detection method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Face and bar code dual-reading method and device
CN111311237A
Sample identification code reading method and device, electronic equipment and storage medium
CN112989861A
Method and system for identifying identity and automatically logging in application based on neural network
CN116055211A
Character segmentation method and device and electronic equipment
CN117671689A
Supply chain management method
CN118536725A