Bar code positioning method and device, electronic equipment and storage medium

By performing grayscale processing, feature segmentation and scale space reduction on the original color image, the target barcode area image is generated, which solves the problem of slowing recognition speed caused by high-definition cameras in traditional technology, and achieves efficient barcode recognition.

CN119886182APending Publication Date: 2025-04-25GUANGZHOU THINKER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411900358.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In traditional barcode batch recognition technology, the high resolution of high-definition cameras leads to slowing down the recognition speed and requires more computing power support.

Method used

A barcode positioning method is proposed, including obtaining the original color image, performing grayscale processing and feature segmentation, performing scale space reduction processing, generating a target barcode area image, and determining the barcode position.

Benefits of technology

By extracting the significant features of the barcode and capturing different scale features, the barcode recognition ability is enhanced, and the calculation amount of subsequent image processing is reduced, thereby improving the recognition speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886182A_ABST
    Figure CN119886182A_ABST
Patent Text Reader

Abstract

The invention discloses a bar code positioning method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring an original color image; the original color image is an image containing a plurality of bar codes; performing gray processing on the original color image to obtain a to-be-processed gray image; performing feature segmentation processing on the to-be-processed grayscale image to obtain a feature segmentation image group; performing scale space reduction processing on the feature segmentation image group to obtain a scale space reduction image group; generating a target bar code area image based on the scale space reduced graph group; and determining positions of a plurality of bar codes in the original color image according to the target bar code area image. According to the method, the characteristics of the bar code under different scales can be effectively captured, so that the recognition capability of the bar code is enhanced, meanwhile, the calculation amount of subsequent image processing can be reduced through scale space reduction processing, the bar code recognition speed is increased, and the method can be widely applied to the technical field of image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a barcode positioning method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of camera technology, barcodes have been widely used in the fields of logistics and product traceability. Moreover, with the emergence of high-definition cameras, it has become possible to recognize large quantities of barcodes at the same time. However, the higher the camera resolution of traditional barcode batch recognition technology, the slower the barcode recognition speed, and more computing power is required to support barcode recognition.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention

[0004] The embodiments of the present application aim to solve at least one of the technical problems in the related art to a certain extent. To this end, the main purpose of the embodiments of the present application is to propose a barcode positioning method, device, electronic device and storage medium, which can enhance the recognition ability of barcodes and reduce the calculation amount of subsequent image processing, thereby speeding up the barcode recognition speed.

[0005] To achieve the above object, an embodiment of the present application provides a barcode positioning method, which includes the following steps:

[0006] Acquire an original color image; wherein the original color image is an image containing a plurality of barcodes;

[0007] Performing grayscale processing on the original color image to obtain a grayscale image to be processed;

[0008] Performing feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group;

[0009] Performing scale space reduction processing on the feature segmentation graph group to obtain a scale space reduction graph group;

[0010] Based on the scale-space reduction graph group, generating a target barcode region image;

[0011] The positions of the plurality of barcodes in the original color image are determined according to the target barcode area image.

[0012] In some embodiments, performing feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group includes:

[0013] Using a preset convolution kernel to perform feature segmentation processing on the grayscale image to be processed according to a number of preset segmentation angles to obtain a number of candidate segmentation images; wherein the image size of the candidate segmentation images is the same as the image size of the grayscale image to be processed;

[0014] Performing absolute value processing on the pixel values ​​of each of the candidate segmented images to obtain a plurality of target segmented images;

[0015] The feature segmentation map group is constructed based on each of the target segmentation images.

[0016] In some embodiments, performing scale space reduction processing on the feature segmentation graph group to obtain the scale space reduced graph group includes:

[0017] Performing summation operation on the pixel values ​​of each target segmentation image in the feature segmentation image group according to a preset summation operation rule to obtain a first candidate reduction image group;

[0018] Performing Gaussian blur processing on the first candidate reduced image group to obtain a first smoothed reduced image group;

[0019] Performing a summation operation on the pixel values ​​of each target smoothed image in the first smoothed reduced image group according to a preset summation operation rule to obtain a second candidate reduced image group;

[0020] If the image sizes of several second candidate reduced images in the second candidate reduced image group meet a preset image size threshold, the second candidate reduced image group is used as the scale-space reduced image group.

[0021] In some embodiments, the method further comprises:

[0022] If the image sizes of some of the second candidate reduced images in the second candidate reduced image group do not meet the preset image size threshold, the second candidate reduced image group is used as the first candidate reduced image group, and the step of performing Gaussian blur processing on the first candidate reduced image group to obtain a first smoothed reduced image group is returned to be executed until a second candidate reduced image group that meets the preset image size threshold is obtained.

[0023] In some embodiments, generating a target barcode region image based on the scale space reduction graph group includes:

[0024] generating a differential angle image group based on the scale space reduced images whose image angles are perpendicular to each other in the scale space reduced image group;

[0025] Performing maximum value processing on pixel values ​​of a plurality of differential angle images in the differential angle image group to obtain a maximum value pixel image group;

[0026] Generate a candidate barcode region image based on a plurality of maximum value pixel images in the maximum value pixel image group;

[0027] The pixel values ​​of the candidate barcode area image are filtered according to a preset filtering threshold to obtain the target barcode area image.

[0028] In some embodiments, generating a differential angle image group based on scale space reduced images whose image angles are perpendicular to each other in the scale space reduced image group includes:

[0029] Subtracting pixel values ​​of scale space reduced images whose image angles are perpendicular to each other in the scale space reduced image group to obtain a pixel value difference calculation result;

[0030] Absolute value processing is performed on the pixel value difference calculation result to obtain the difference angle map group.

[0031] In some embodiments, determining the positions of the plurality of barcodes in the original color image according to the target barcode area image includes:

[0032] Scanning the target barcode region image to obtain a candidate barcode region group;

[0033] Restoring the candidate barcode region group according to a preset image restoration ratio to obtain a target barcode region group;

[0034] A barcode scanning algorithm is called to scan the target barcode area group to obtain the positions of several barcodes in the original color image.

[0035] To achieve the above object, another aspect of the embodiment of the present application provides a barcode positioning device, the device comprising the following modules:

[0036] The original color image acquisition module is used to acquire the original color image; wherein the original color image is an image containing a plurality of barcodes;

[0037] An image grayscale processing module is used to perform grayscale processing on the original color image to obtain a grayscale image to be processed;

[0038] An image feature segmentation module is used to perform feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group;

[0039] An image scale space reduction module is used to perform scale space reduction processing on the feature segmentation image group to obtain a scale space reduction image group;

[0040] A barcode region image generation module, used to generate a target barcode region image based on the scale space reduction image group;

[0041] The barcode position determination module is used to determine the positions of several barcodes in the original color image according to the target barcode area image.

[0042] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.

[0043] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0044] The embodiments of the present application include at least the following beneficial effects: the present application provides a barcode positioning method, device, electronic device and storage medium, the scheme is through obtaining an original color image; wherein the original color image is an image containing a plurality of barcodes; grayscale processing is performed on the original color image to obtain a grayscale image to be processed; feature segmentation processing is performed on the grayscale image to be processed to obtain a feature segmentation map group; scale space reduction processing is performed on the feature segmentation map group to obtain a scale space reduction map group; based on the scale space reduction map group, a target barcode area image is generated; according to the target barcode area image, the positions of the plurality of barcodes in the original color image are determined. The embodiment of the present application can effectively extract the significant features of the barcode by performing feature segmentation processing on the grayscale image, thereby improving the subsequent barcode recognition accuracy; by performing scale space reduction processing on the image after feature segmentation, it can effectively capture the features of the barcode at different scales, thereby enhancing the recognition ability of the barcode. At the same time, the scale space reduction processing can reduce the amount of calculation for subsequent image processing, thereby speeding up the barcode recognition speed; the target barcode area image generated based on the scale space reduction graph group can quickly and accurately determine the position of the barcode in the original image. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flowchart of the steps of a barcode positioning method provided in an embodiment of the present application;

[0046] Figure 2 is a schematic diagram of a barcode of an original packaging box provided in an embodiment of the present application;

[0047] Figure 3 is a schematic diagram of a barcode area provided in an embodiment of the present application;

[0048] Figure 4 It is a flowchart of a barcode positioning method provided in an embodiment of the present application;

[0049] Figure 5 It is a structural schematic diagram of a barcode positioning device provided in an embodiment of the present application;

[0050] Figure 6 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0052] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0053] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0055] With the continuous development of camera technology, barcodes have been widely used in the fields of logistics and product traceability. Moreover, with the emergence of high-definition cameras, it has become possible to recognize large quantities of barcodes at the same time. However, the higher the camera resolution of traditional barcode batch recognition technology, the slower the barcode recognition speed, and more computing power is required to support barcode recognition.

[0056] In view of this, a barcode positioning method, device, electronic device and storage medium are provided in an embodiment of the present application. The scheme obtains an original color image; wherein the original color image is an image containing a plurality of barcodes; grayscale processing is performed on the original color image to obtain a grayscale image to be processed; feature segmentation processing is performed on the grayscale image to be processed to obtain a feature segmentation map group; scale space reduction processing is performed on the feature segmentation map group to obtain a scale space reduction map group; based on the scale space reduction map group, a target barcode area image is generated; and according to the target barcode area image, the positions of the plurality of barcodes in the original color image are determined. The embodiment of the present application can effectively extract the significant features of the barcode by performing feature segmentation processing on the grayscale image, thereby improving the subsequent barcode recognition accuracy; by performing scale space reduction processing on the image after feature segmentation, it can effectively capture the features of the barcode at different scales, thereby enhancing the recognition ability of the barcode. At the same time, the scale space reduction processing can reduce the amount of calculation for subsequent image processing, thereby speeding up the barcode recognition speed; the target barcode area image generated based on the scale space reduction graph group can quickly and accurately determine the position of the barcode in the original image.

[0057] The barcode positioning method provided in the embodiment of the present application relates to the field of image processing technology. The barcode positioning method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms and other basic cloud computing services. The cloud server, the server can also be a node server in the blockchain network; the software can be an application that implements the barcode positioning method, etc., but is not limited to the above forms.

[0058] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs (Personal Computers, personal computers), minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0059] See also Figure 1 , Figure 1 is an optional step flow chart of a barcode positioning method provided in an embodiment of the present application, Figure 1 The method may include but is not limited to steps S101 to S106.

[0060] Step S101, obtaining an original color image; wherein the original color image is an image containing a plurality of barcodes;

[0061] Among them, the original color image refers to an image including several barcodes. The original color image is an image presented in color without any processing or modification. The original color image is usually obtained through image capture devices such as digital cameras, mobile phone cameras, scanners, etc., which directly reflects the color information and details at the time of shooting or scanning. The embodiments of this application will not be elaborated here.

[0062] A barcode, also known as a barcode, is a mark composed of bars and spaces of a specific width arranged according to certain coding rules. Among them, the barcode in the original color image is the core object of the recognition processing of the embodiment of the present application.

[0063] See also Figure 2 , Figure 2 is a schematic diagram of an original packaging box barcode provided in an embodiment of the present application; Figure 2 As shown, Figure 2 The 200 in represents the original color image. Figure 2 201 to 214 in the figure represent individual packaging boxes in the original color image obtained by shooting (example), and each individual packaging box contains a barcode (such as Figure 2 barcode 1 to barcode 14 in the table).

[0064] Step S102, performing grayscale processing on the original color image to obtain a grayscale image to be processed;

[0065] Grayscale processing is also called grayscale or decolorization, which is an image processing technology that aims to convert a color image into a grayscale image. In a grayscale image, each pixel contains only brightness information but not color information, that is, the three color channels of red, green, and blue (RGB) in the original color image will be merged into a single brightness channel to form a grayscale image.

[0066] The grayscale image to be processed is a grayscale image that does not contain color information and is obtained after the original color image is grayscale processed. The grayscale image to be processed will be used as the input of the subsequent image processing process for feature segmentation, scale space reduction, barcode recognition and other processing.

[0067] In the embodiment of the present application, only the grayscale of the image needs to be processed, so it is necessary to read the grayscale from the original color image P0 to form a grayscale image P1 to be processed. Specifically, when extracting the grayscale image P1, the RGB to Y formula can be used directly to extract the grayscale value. If a red light source is used, the R component can be used directly as the grayscale value. If a green light source is used, the G component can be used directly as the grayscale value. If a blue light source is used, the B component can be used directly as the grayscale value. It should be noted that for the selection of the RGB to Y formula and its implementation principle, those skilled in the art can select and apply the formula in the relevant technology according to actual conditions, and the embodiment of the present application does not limit this.

[0068] It is worth mentioning that if the original image size is too large, you can extract pixels at alternate points and rows to reduce the size of the grayscale image and reduce the amount of calculation.

[0069] Step S103, performing feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group;

[0070] In some embodiments, step S103 may include: using a preset convolution kernel to perform feature segmentation processing on the grayscale image to be processed according to several preset segmentation angles to obtain several candidate segmented images; wherein the image size of the candidate segmented images is the same as the image size of the grayscale image to be processed; performing absolute value processing on the pixel values ​​of each candidate segmented image to obtain several target segmented images; and constructing a feature segmentation map group based on each target segmented image.

[0071] Among them, feature segmentation processing refers to the process of using a convolution kernel to convolve a grayscale image to extract image features. It is not image segmentation in the traditional sense, but extracts image features in different directions through convolution operations. This process does not change the size of the image, but generates a feature map of the same size as the original image.

[0072] For the preset convolution kernel, it is a convolution kernel set corresponding to the preset segmentation angle. For example, assuming that the segmentation angle adopts a 0 degree segmentation angle, a 90 degree segmentation angle, a 45 degree segmentation angle, and a 135 degree segmentation angle, the convolution kernel K0 of the 0 degree segmentation angle can be set to The convolution kernel K1 with a segmentation angle of 90 degrees is The convolution kernel K2 with a segmentation angle of 45 degrees is The convolution kernel K3 with a segmentation angle of 135 degrees is Regarding the settings of the image segmentation angle and the convolution kernel, those skilled in the art may make settings according to actual application conditions, and the embodiments of the present application do not impose any limitation on this.

[0073] The candidate segmented image refers to the image obtained by performing feature segmentation processing on the grayscale image to be processed using a preset convolution kernel according to several preset segmentation angles. The image size of the candidate segmented image is the same as the image size of the grayscale image to be processed. As for the target segmented image, it is the target image obtained by performing absolute value processing on the pixel value of each pixel point in the candidate segmented image.

[0074] The feature segmentation map group is constructed based on each target segmentation image, that is, each target segmentation image included in the feature segmentation map group is a candidate segmentation image whose absolute value is taken.

[0075] In a specific implementation, a convolution kernel is first used to perform a convolution operation with a step size of 1 on the grayscale image P1 to be processed, so as to obtain a temporary image of the same size. Then, the absolute value of each pixel in the temporary image is taken to obtain an image in which each pixel value is a non-negative integer. The image in which each pixel value is a non-negative integer is used as the target segmentation image. Finally, a feature segmentation map group G1 is constructed based on each target segmentation image. Among them, the feature segmentation map group G1 is an array, and each element in the feature segmentation map group G1 is a picture. For example, it is assumed that the feature segmentation map group G1 contains four elements (G1[0], G1[1], G1[2], G1[3]). Before obtaining the feature segmentation map group G1, it is assumed that the segmentation angles of the feature segmentation map group G1 are 0 degree segmentation angle, 90 degree segmentation angle, 45 degree segmentation angle and 135 degree segmentation angle. The convolution kernel K0 for the 0 degree segmentation angle is The convolution kernel K1 with a segmentation angle of 90 degrees is The convolution kernel K2 with a segmentation angle of 45 degrees is The convolution kernel K3 with a segmentation angle of 135 degrees is Then G1[0] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K0 of a segmentation angle of 0 degrees; G1[1] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K1 of a segmentation angle of 90 degrees; G1[2] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K2 of a segmentation angle of 45 degrees; G1[3] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K3 of a segmentation angle of 135 degrees. After segmentation at four angles, feature maps of four angles can be extracted from the grayscale image P1 to be processed. Then, the absolute values ​​of the pixels of the feature maps of these four angles are taken to obtain the target segmentation images of the four angles. Finally, the feature segmentation map group G1 is constructed based on the four target segmentation images.

[0076] In the embodiment of the present application, a segmentation map of the barcode is obtained by adopting a method of segmenting at different angles, so that the segmentation map retains the characteristics of the barcode, providing accurate data for subsequent barcode positioning.

[0077] Step S104, performing scale space reduction processing on the feature segmentation image group to obtain a scale space reduced image group;

[0078] In some embodiments, step S104 may include: performing a summing operation on the pixel values ​​of each target segmented image in the feature segmentation image group according to a preset summing operation rule to obtain a first candidate reduced image group; performing a Gaussian blur process on the first candidate reduced image group to obtain a first smooth reduced image group; performing a summing operation on the pixel values ​​of each target smoothed image in the first smooth reduced image group according to a preset summing operation rule to obtain a second candidate reduced image group; if the image sizes of several second candidate reduced images in the second candidate reduced image group meet the preset image size threshold, the second candidate reduced image group is used as the scale space reduced image group.

[0079] In some embodiments, the method may further include: if the image sizes of several second candidate reduced images in the second candidate reduced image group do not meet the preset image size threshold, the second candidate reduced image group is used as the first candidate reduced image group, and the step of performing Gaussian blur processing on the first candidate reduced image group to obtain a first smooth reduced image group is returned until a second candidate reduced image group that meets the preset image size threshold is obtained.

[0080] The preset summation operation rule is used to perform a specific mathematical operation on the pixel values ​​of the image. In the embodiment of the present application, the preset summation operation rule is to perform a 2×2 summation operation on the image with a step size of 2, that is, a process of adding 4 adjacent points. It should be noted that in actual applications, the preset summation operation rule can be set according to the actual application situation, and the embodiment of the present application does not limit this.

[0081] As for the scale space reduction processing, it is an image processing process combining summation operation and Gaussian blur.

[0082] The first candidate reduced image group is an image group G2 obtained by summing the pixel values ​​of each target segmented image in the feature segmentation image group G1 according to a preset summation operation rule. Exemplarily, a 2×2 summation operation with a step length of 2 is performed on each image in the feature segmentation image group G1, that is, 4 adjacent points are added together to obtain a new group of small images G2 (i.e., the first candidate reduced image group), and the pixels of the image group G2 are one quarter of those of the image group G1.

[0083] The first smooth reduced image group is obtained by performing Gaussian blur processing on the first candidate reduced image group. Specifically, each image in the first candidate reduced image group G2 is Gaussian blurred to obtain a new image group G3 (i.e., the first smooth reduced image group).

[0085] Core For the target smoothed image, it is the image in the first smoothed reduced image set.

[0087] The second candidate reduced image group G4 is obtained by summing the pixel values ​​of each target smoothed image in the first smooth reduced image group G3 according to a preset summation operation rule, wherein the image sizes of several second candidate reduced images in the second candidate reduced image group G4 meet the preset image size threshold. The preset image size threshold is a threshold of the image size. The scale space reduced image group is a second candidate reduced image group that meets the preset image size threshold, and can also be represented by G4.

[0088] In a specific implementation, first, a 2×2 summation operation with a step length of 2 is performed on each image in the first smooth reduction image group G3, that is, 4 adjacent points are added to obtain a new group of small images G4 (i.e., the second candidate reduction image group), and the pixels of the second candidate reduction image group G4 are one-fourth of the first smooth reduction image group G3; then, the second candidate reduction image group G4 is used to replace the first candidate reduction image group G2, and the first candidate reduction image group G2 is repeatedly iterated to perform Gaussian blur processing to obtain the first smooth reduction image group G3, until the second candidate reduction image group G4 that meets the preset image size threshold is obtained, that is, a group of smaller image groups G4 (i.e., scale space reduction image groups) are finally obtained. It should be noted that the number of repeated executions can be determined according to the original image. The larger the image, the greater the number of repeated iterations, and the smaller the reduced image, but the image will lose the barcode information if it is too small. Therefore, when it is detected that the image side length is less than 256, the loop process is stopped. Exemplarily, for an image with a resolution of 2560×1920, the number of iterations is preferably 2.

[0089] In the embodiment of the present application, by blurring and reducing the segmentation map of the barcode, the characteristic information of the barcode can be retained and the computing power can be reduced.

[0090] Step S105, generating a target barcode region image based on the scale space reduction image group;

[0091] In some embodiments, step S105 may include: generating a differential angle image group based on scale space reduced images whose image angles are mutually perpendicular in the scale space reduced image group; performing maximum value processing on the pixel values ​​of several differential angle images in the differential angle image group to obtain a maximum value pixel image group; generating a candidate barcode area image based on several maximum value pixel images in the maximum value pixel image group; and filtering the pixel values ​​of the candidate barcode area image according to a preset filtering threshold to obtain a target barcode area image.

[0092] In some specific embodiments, a differential angle graph group is generated based on scale space reduced images whose image angles are mutually perpendicular in the scale space reduction graph group, including: subtracting pixel values ​​of scale space reduced images whose image angles are mutually perpendicular in the scale space reduction graph group to obtain pixel value difference calculation results; performing absolute value processing on the pixel value difference calculation results to obtain a differential angle graph group.

[0093] The difference angle graph group is obtained by subtracting the pixel values ​​of the scale space reduction images whose image angles are perpendicular to each other in the scale space reduction graph group to obtain the pixel value difference calculation result, and then performing absolute value processing on the pixel value difference calculation result. The difference angle graph group is represented by G5.

[0094] In the specific implementation, the pixel values ​​in the two mutually perpendicular segmentation images in the scale space reduction image group G4 are first subtracted, and then the absolute value of the subtraction difference is calculated to obtain the differential angle image group G5. Exemplarily, the segmentation images obtained by 0-degree segmentation and 90-degree segmentation are mutually perpendicular segmentation images; the segmentation images obtained by 45-degree segmentation and 135-degree segmentation are mutually perpendicular segmentation images. Specifically, the pixel values ​​with the same coordinates in the two mutually perpendicular segmentation images are subtracted, and then the absolute value of the difference is calculated. Finally, the absolute value is filled in the corresponding coordinates of a new image, and the angle is saved together (the angle of the image with the larger pixel value is selected) as an angle attribute of this point. All the images obtained through this operation form a new image array G5 (i.e., the differential angle image group). For example, assuming that the pixel value (or eigenvalue) at the 0 degree [0,0] point is 1000 and the pixel value at the 90 degree [0,0] point is 900, the new pixel value is 100 and the angle is 0 degrees; the pixel value (or eigenvalue) at the 0 degree [1,0] point is 900 and the pixel value at the 90 degree [1,0] point is 1000, the new pixel value is also 100, but the angle is 90 degrees.

[0095] The maximum value pixel image group is an image group obtained by performing maximum value processing on the pixel values ​​of several differential angle images in the differential angle image group, that is, the maximum value pixel image group is composed of differential angle images with maximum pixel values. Among them, the maximum value pixel image is a picture element in the maximum value pixel image group.

[0096] For the candidate barcode area image, it is constructed based on several maximum pixel images in the maximum pixel image group. Among them, the candidate barcode area image is represented by P2. Exemplarily, the values ​​of the image pixels in the differential angle image group G5 are traversed, the maximum value is taken, and the maximum value is filled into the same coordinates of the new image P2, and the corresponding angle is saved in the new image P2.

[0097] The preset filtering threshold is a threshold used to remove pixels with small pixel values ​​in the candidate barcode region image, which can be selected according to the actual application. For example, the threshold of the minimum pixel value is first set, and the threshold can be set as the maximum pixel value in the candidate barcode region image P2 divided by 8 as the threshold; then each pixel value in the candidate barcode region image P2 is traversed, and if the pixel value is less than the threshold, the pixel value is set to 0.

[0098] The target barcode region image is obtained by filtering the pixel values ​​of the candidate barcode region image according to the preset filtering threshold. The target barcode region image is represented by P3. Figure 3 , Figure 3 is a schematic diagram of a barcode area provided in an embodiment of the present application; Figure 3 As shown, Figure 3 is the target barcode area image, Figure 3 The rectangular box in the middle is the area where the barcode is located, that is, the corresponding Figure 2 Barcode 1 to barcode 14 in the original color image.

[0099] Step S106, determining the positions of the plurality of barcodes in the original color image according to the target barcode region image.

[0100] In some embodiments, step S106 may include: scanning the target barcode area image to obtain a candidate barcode area group; restoring the candidate barcode area group according to a preset image restoration ratio to obtain a target barcode area group; calling a barcode scanning algorithm to scan the target barcode area group to obtain the positions of several barcodes in the original color image.

[0101] The candidate barcode region group is represented by R1, and the candidate barcode region group R1 is a barcode rectangular frame (such as Figure 3 The rectangular box in the figure is scanned and processed.

[0102] The target barcode region group is obtained by restoring the candidate barcode region group R1 according to a preset image restoration ratio, and the target barcode region group is denoted as R2.

[0103] The barcode scanning algorithm is an algorithm that can identify and decode information in a barcode image. It identifies the type and encoding information of the barcode by analyzing the pixel pattern in the barcode area. In this process, the algorithm also records the position of each successfully identified barcode in the original color image. It should be noted that the selection of the barcode scanning algorithm can refer to the technical solutions in the relevant technology, and the embodiments of the present application do not limit this.

[0104] The position of the barcode refers to the specific position of the barcode in the original color image, and the position of the barcode is crucial for subsequent processing (such as extraction of barcode information, identification of goods, etc.).

[0105] In a specific implementation, first scan the rectangle (such as Figure 3 The candidate barcode region group R1 is obtained by multiplying the candidate barcode region group R1 by a certain ratio, and then the target barcode region group R2 of the original color image P0 can be restored. Then the barcode scanning algorithm is called to scan the pixels of each region in the target barcode region group R2 to obtain the corresponding barcode value, that is, the position of the barcode in the original color image. Specifically, the target barcode region image P3 is scanned using the method of finding rectangular contours, and all barcode rectangular regions (such as Figure 3 The obtained rectangular areas constitute the candidate barcode area group R1. Then, after the candidate barcode area group R1 is obtained, it can be restored to the target barcode area group R2 of the original color image by multiplying a ratio.

[0106] For the restoration ratio, specifically, assuming that the feature segmentation map group G1 is reduced 3 times, the restoration ratio of each area of ​​the target barcode area group R2 and each area of ​​the candidate barcode area group R1 is 2×2×2=8. For example, assuming that an area in the candidate barcode area group R1 is (10, 10, 20, 3), the area of ​​the target barcode area group R2 converted according to the restoration ratio is (80, 80, 160, 24), wherein the first two numbers (such as 80, 80) are the coordinates of the upper left corner, the third number (such as 160) is the length, and the fourth number (such as 24) is the height.

[0107] Steps S101 to S106 shown in the embodiment of the present application are performed by acquiring an original color image; wherein the original color image is an image containing several barcodes; grayscale processing is performed on the original color image to obtain a grayscale image to be processed; feature segmentation processing is performed on the grayscale image to be processed to obtain a feature segmentation graph group; scale space reduction processing is performed on the feature segmentation graph group to obtain a scale space reduction graph group; based on the scale space reduction graph group, a target barcode area image is generated; according to the target barcode area image, the positions of several barcodes in the original color image are determined. The embodiment of the present application can effectively extract the significant features of the barcode by performing feature segmentation processing on the grayscale image, thereby improving the recognition accuracy of the subsequent barcode; by performing scale space reduction processing on the image after feature segmentation, the features of the barcode at different scales can be effectively captured, thereby enhancing the recognition ability of the barcode. At the same time, the scale space reduction processing can reduce the amount of calculation of the subsequent image processing, thereby speeding up the barcode recognition speed; the target barcode area image generated based on the scale space reduction graph group can quickly and accurately determine the position of the barcode in the original image.

[0108] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0109] See also Figure 4 , Figure 4 is a flow chart of a barcode positioning method provided in an embodiment of the present application; Figure 4 As shown, the overall process of the barcode positioning method includes the following steps A to E, which are as follows:

[0110] Step A, read the grayscale image.

[0111] In the specific implementation, the grayscale is read from the original color image P0 to form a grayscale image P1 to be processed. Specifically, when extracting the grayscale image P1, the RGB to Y formula can be directly used to extract the grayscale value. If a red light source is used, the R component can be directly used as the grayscale value. If a green light source is used, the G component can be directly used as the grayscale value. If a blue light source is used, the B component can be directly used as the grayscale value.

[0112] Step B, segment the image.

[0113] In the specific implementation, the grayscale image P1 is segmented to obtain a feature map, and then the absolute value of each pixel of the feature map is calculated to obtain a new set of feature segmentation map groups G1. Specifically, the convolution kernel is first used to perform a convolution operation with a step size of 1 on the grayscale image P1 to be processed, so that a temporary image of the same size can be obtained, and then the absolute value of each pixel in the temporary image is taken to obtain a picture in which each pixel value is a non-negative integer, and the picture in which each pixel value is a non-negative integer is used as the target segmentation image, and finally the feature segmentation map group G1 is constructed based on each target segmentation image. Among them, the feature segmentation map group G1 is an array, and each element in the feature segmentation map group G1 is a picture. For example, assuming that the feature segmentation map group G1 contains four elements (G1[0], G1[1], G1[2], G1[3]), before obtaining the feature segmentation map group G1, assuming that the segmentation angles of the feature segmentation map group G1 are 0 degree segmentation angle, 90 degree segmentation angle, 45 degree segmentation angle and 135 degree segmentation angle, the convolution kernel K0 of the 0 degree segmentation angle is The convolution kernel K1 with a segmentation angle of 90 degrees is The convolution kernel K2 with a segmentation angle of 45 degrees is The convolution kernel K3 with a segmentation angle of 135 degrees is Then G1[0] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K0 of a segmentation angle of 0 degrees; G1[1] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K1 of a segmentation angle of 90 degrees; G1[2] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K2 of a segmentation angle of 45 degrees; G1[3] is the image obtained by operating the grayscale image P1 to be processed with the convolution kernel K3 of a segmentation angle of 135 degrees. After segmentation at four angles, feature maps of four angles can be extracted from the grayscale image P1 to be processed. Then, the absolute values ​​of the pixels of the feature maps of these four angles are taken to obtain the target segmentation images of the four angles. Finally, the feature segmentation map group G1 is constructed based on the four target segmentation images.

[0114] Step C, shrink the image.

[0115] In a specific implementation, the feature segmentation map group G1 is scale-space reduced to obtain the scale-space reduced map group G4.

[0116] C1. Perform a 2×2 summation operation with a step size of 2 on each image in the feature segmentation image group G1, that is, add the 4 adjacent points to obtain a new group of small images G2 (that is, the first candidate reduced image group). The pixels of the image group G2 are one quarter of those of the image group G1.

[0117] C2. Perform Gaussian blur on each image in the first candidate reduced image group G2 to obtain a new image group G3 (ie, the first smooth reduced image group).

[0118] C3, performing a 2×2 summation operation with a step length of 2 on each image in the first smooth reduced image group G3, that is, adding 4 adjacent points, to obtain a new group of small images G4 (i.e., the second candidate reduced image group). The pixels of the second candidate reduced image group G4 are one quarter of the pixels of the first smooth reduced image group G3;

[0119] C4, using the second candidate reduced image group G4 to replace the first candidate reduced image group G2, repeating the iteration steps C3 and C4 until a second candidate reduced image group G4 that meets the preset image size threshold is obtained, that is, a smaller image group G4 (i.e., scale space reduced image group) is finally obtained. It should be noted that the number of repeated executions can be determined according to the original image. The larger the image, the greater the number of repeated iterations, and the smaller the reduced image. However, if the image is too small, the barcode information will be lost. Therefore, when it is detected that the image side length is less than 256, the loop process is stopped.

[0120] Step D, merge the images.

[0121] In a specific implementation, the second candidate reduced image group G4 is merged to obtain a new image P3 (ie, the target barcode region image).

[0122] D1. First, the pixel values ​​in the two mutually perpendicular segmentation images in the scale space reduction image group G4 are subtracted, and then the absolute value of the subtracted difference is calculated to obtain the differential angle image group G5.

[0123] Specifically, subtract the pixel values ​​with the same coordinates in the two perpendicular segmented images, then calculate the absolute value of the difference, and finally fill the absolute value into the corresponding coordinates of a new image, and save the angle together (select the angle of the image with the larger pixel value) as an angle attribute of this point. All the images obtained through this operation form a new image array G5 (i.e., differential angle image group). For example, assuming that the pixel value (or eigenvalue) of the 0 degree [0,0] point is 1000 and the pixel value of the 90 degree [0,0] point is 900, then the new pixel value is 100 and the angle is 0 degrees; the pixel value (or eigenvalue) of the 0 degree [1,0] point is 900 and the pixel value of the 90 degree [1,0] point is 1000, then the new pixel value is also 100, but the angle is 90 degrees.

[0124] D2. Find the maximum value of the images in the differential angle image group G5 to obtain a new image P2 (i.e., the candidate barcode region image).

[0125] Specifically, the values ​​of all the pixel points in the differential angle graph group G5 are traversed, the maximum value is taken, and the maximum value is filled into the same coordinates of the new graph P2, and the corresponding angle is saved in the new graph P2.

[0126] D3. Filter the candidate barcode region image P2 according to a pre-configured threshold value, remove points with small pixel values, and obtain a new image P3 (ie, the target barcode region image).

[0127] Step E, searching for the barcode area, that is, determining the position of the barcode in the original color image.

[0128] In a specific implementation, first scan the rectangle (such as Figure 3 The candidate barcode region group R1 is obtained by multiplying the candidate barcode region group R1 by a certain ratio, and then the target barcode region group R2 of the original color image P0 can be restored. Then the barcode scanning algorithm is called to scan the pixels of each region in the target barcode region group R2 to obtain the corresponding barcode value, that is, the position of the barcode in the original color image. Specifically, the target barcode region image P3 is scanned using the method of finding rectangular contours, and all barcode rectangular regions (such as Figure 3 The obtained rectangular areas constitute the candidate barcode area group R1. Then, after the candidate barcode area group R1 is obtained, it can be restored to the target barcode area group R2 of the original color image by multiplying a ratio.

[0129] The embodiment of the present application provides a method for quickly locating barcodes, making it possible to use an ultra-high-definition camera to scan the barcode, so that less computing power is used when locating the barcode, that is, the computing power of large-scale barcode recognition will not increase too much due to the increase in image resolution, and more barcodes can be scanned at one time. Specifically, first, a large grayscale image is converted into several small images, and these small images do not lose the location information of the barcode; then these small images are merged into a small image, which is the final image that records the barcode location information. Since the resolution of this small image is very small, less computing power is required to find the barcode in this small image. After finding the area of ​​the barcode, it only needs to be multiplied by a specific ratio to convert it into the area of ​​the original image.

[0130] It should be noted that this embodiment only briefly illustrates the overall process of the barcode positioning method. The detailed description of each step can refer to the relevant content in the aforementioned embodiment and will not be repeated here. It can be understood that the present invention is not limited to this.

[0131] The embodiment of the present application obtains an original color image; wherein the original color image is an image containing several barcodes; grayscale processing is performed on the original color image to obtain a grayscale image to be processed; feature segmentation processing is performed on the grayscale image to be processed to obtain a feature segmentation graph group; scale space reduction processing is performed on the feature segmentation graph group to obtain a scale space reduction graph group; based on the scale space reduction graph group, a target barcode area image is generated; according to the target barcode area image, the positions of several barcodes in the original color image are determined. The embodiment of the present application can effectively extract the significant features of the barcode by performing feature segmentation processing on the grayscale image, thereby improving the subsequent barcode recognition accuracy; by performing scale space reduction processing on the image after feature segmentation, the features of the barcode at different scales can be effectively captured, thereby enhancing the recognition ability of the barcode. At the same time, the scale space reduction processing can reduce the amount of calculation of subsequent image processing, thereby speeding up the barcode recognition speed; the target barcode area image generated based on the scale space reduction graph group can quickly and accurately determine the position of the barcode in the original image.

[0132] See also Figure 5 The embodiment of the present application further provides a barcode positioning device 500, which can implement the above-mentioned barcode positioning method, and the device includes the following modules:

[0133] The original color image acquisition module 501 is used to acquire an original color image; wherein the original color image is an image containing a plurality of barcodes;

[0134] An image grayscale processing module 502 is used to perform grayscale processing on the original color image to obtain a grayscale image to be processed;

[0135] An image feature segmentation module 503 is used to perform feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group;

[0136] An image scale space reduction module 504 is used to perform scale space reduction processing on the feature segmentation image group to obtain a scale space reduction image group;

[0137] A barcode region image generation module 505, configured to generate a target barcode region image based on the scale space reduction image group;

[0138] The barcode position determination module 506 is used to determine the positions of the barcodes in the original color image according to the target barcode region image.

[0139] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0140] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above barcode positioning method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0141] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0142] See also Figure 6 , Figure 6 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0143] The processor 601 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0144] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 602, and the processor 601 calls and executes the barcode positioning method of the embodiment of this application;

[0145] Input / output interface 603, used to implement information input and output;

[0146] Communication interface 604, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0147] Bus 605 , which transmits information between various components of the device (e.g., processor 601 , memory 602 , input / output interface 603 , and communication interface 604 );

[0148] The processor 601 , the memory 602 , the input / output interface 603 and the communication interface 604 are connected to each other in communication within the device via a bus 605 .

[0149] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned barcode positioning method when executed by a processor.

[0150] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0151] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] The barcode positioning method, barcode positioning device, electronic device and storage medium provided in the embodiment of the present application are obtained by obtaining an original color image; wherein the original color image is an image containing several barcodes; grayscale processing is performed on the original color image to obtain a grayscale image to be processed; feature segmentation processing is performed on the grayscale image to be processed to obtain a feature segmentation graph group; scale space reduction processing is performed on the feature segmentation graph group to obtain a scale space reduction graph group; based on the scale space reduction graph group, a target barcode area image is generated; according to the target barcode area image, the positions of several barcodes in the original color image are determined. The embodiment of the present application can effectively extract the significant features of the barcode by performing feature segmentation processing on the grayscale image, thereby improving the recognition accuracy of the subsequent barcode; by performing scale space reduction processing on the image after feature segmentation, the features of the barcode at different scales can be effectively captured, thereby enhancing the recognition ability of the barcode. At the same time, the scale space reduction processing can reduce the calculation amount of subsequent image processing, thereby accelerating the speed of barcode recognition; the target barcode area image generated based on the scale space reduction graph group can quickly and accurately determine the position of the barcode in the original image.

[0153] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0154] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0155] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0156] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0157] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0158] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0160] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0163] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.

Claims

1. A barcode positioning method, characterized in that: The method comprises the following steps: Acquire an original color image; wherein the original color image is an image containing a plurality of barcodes; Performing grayscale processing on the original color image to obtain a grayscale image to be processed; Performing feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group; Performing scale space reduction processing on the feature segmentation graph group to obtain a scale space reduction graph group; Based on the scale-space reduction graph group, generating a target barcode region image; The positions of the plurality of barcodes in the original color image are determined according to the target barcode area image.

2. The method according to claim 1, characterized in that The step of performing feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group includes: Using a preset convolution kernel to perform feature segmentation processing on the grayscale image to be processed according to a number of preset segmentation angles to obtain a number of candidate segmentation images; wherein the image size of the candidate segmentation images is the same as the image size of the grayscale image to be processed; Performing absolute value processing on the pixel values ​​of each of the candidate segmented images to obtain a plurality of target segmented images; The feature segmentation map group is constructed based on each of the target segmentation images.

3. The method according to claim 1, characterized in that The step of performing scale space reduction processing on the feature segmentation graph group to obtain a scale space reduced graph group includes: Performing summation operation on the pixel values ​​of each target segmentation image in the feature segmentation image group according to a preset summation operation rule to obtain a first candidate reduction image group; Performing Gaussian blur processing on the first candidate reduced image group to obtain a first smoothed reduced image group; Performing a summation operation on the pixel values ​​of each target smoothed image in the first smoothed reduced image group according to a preset summation operation rule to obtain a second candidate reduced image group; If the image sizes of several second candidate reduced images in the second candidate reduced image group meet a preset image size threshold, the second candidate reduced image group is used as the scale-space reduced image group.

4. The method according to claim 3, characterized in that The method further comprises: If the image sizes of some of the second candidate reduced images in the second candidate reduced image group do not meet the preset image size threshold, the second candidate reduced image group is used as the first candidate reduced image group, and the step of performing Gaussian blur processing on the first candidate reduced image group to obtain a first smoothed reduced image group is returned to be executed until a second candidate reduced image group that meets the preset image size threshold is obtained.

5. The method according to claim 1, characterized in that: The step of generating a target barcode region image based on the scale space reduction graph group comprises: generating a differential angle image group based on the scale space reduced images whose image angles are perpendicular to each other in the scale space reduced image group; Performing maximum value processing on pixel values ​​of a plurality of differential angle images in the differential angle image group to obtain a maximum value pixel image group; Generate a candidate barcode region image based on a plurality of maximum value pixel images in the maximum value pixel image group; The pixel values ​​of the candidate barcode area image are filtered according to a preset filtering threshold to obtain the target barcode area image.

6. The method according to claim 5, characterized in that The step of generating a differential angle image group based on scale space reduced images whose image angles are perpendicular to each other in the scale space reduced image group comprises: Subtracting pixel values ​​of scale space reduced images whose image angles are perpendicular to each other in the scale space reduced image group to obtain a pixel value difference calculation result; Absolute value processing is performed on the pixel value difference calculation result to obtain the difference angle map group.

7. The method according to claim 1, characterized in that The step of determining the positions of the plurality of barcodes in the original color image according to the target barcode region image comprises: Scanning the target barcode region image to obtain a candidate barcode region group; Restoring the candidate barcode region group according to a preset image restoration ratio to obtain a target barcode region group; A barcode scanning algorithm is called to scan the target barcode area group to obtain the positions of several barcodes in the original color image.

8. A barcode positioning device, characterized in that: The device comprises the following modules: The original color image acquisition module is used to acquire the original color image; wherein the original color image is an image containing a plurality of barcodes; An image grayscale processing module, used for performing grayscale processing on the original color image to obtain a grayscale image to be processed; An image feature segmentation module is used to perform feature segmentation processing on the grayscale image to be processed to obtain a feature segmentation graph group; An image scale space reduction module is used to perform scale space reduction processing on the feature segmentation image group to obtain a scale space reduction image group; A barcode region image generation module, used for generating a target barcode region image based on the scale space reduction image group; The barcode position determination module is used to determine the positions of several barcodes in the original color image according to the target barcode area image.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.