A method and device for identifying barcodes in pictures

By generating QR code pictures with different resolutions and using convolutional neural network to merge candidate box information, determining the selected box information and re-acquisition of the pictures, the problem that the terminal camera unit fails to fully include feature points when collecting QR code pictures, and successfully identifying the QR code is achieved.

CN110490022BActive Publication Date: 2025-06-17JINGDONG TECH HLDG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910784481.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-23
Publication Date
2025-06-17
Estimated Expiration
2039-08-23

AI Technical Summary

Technical Problem

When identifying the QR code, the QR code pictures collected by the terminal's camera unit may not fully include the available QR code feature point information due to the distance, resulting in the inability to recognize the QR code in the picture.

Method used

By receiving the first picture, a plurality of second pictures of different resolution sizes are generated, barcode candidate boxes are obtained in each second picture, multiple candidate boxes are merged to obtain candidate box information, barcode selection box information is determined based on this information, and the first picture is re-acquisitioned to ensure that the recognizable barcode information is included. This method uses a convolutional neural network for processing.

Benefits of technology

By positioning the barcode in the barcode picture, the re-collectioned picture completely includes available recognized barcode feature point information, realizing the barcode, thereby successfully identifying the barcode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110490022B_ABST
    Figure CN110490022B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for identifying barcodes in pictures. Embodiments of the present invention receive a first picture; during the process of identifying barcodes, multiple second pictures with different resolution sizes are generated based on the first picture, barcode candidate boxes are obtained in each second picture, and the obtained multiple barcode candidate boxes are merged to obtain barcode candidate box information; based on the barcode candidate box information, barcode selected box information is determined, so that the barcodes in the first picture collected again based on the barcode selected box information can be identified. In this way, through the positioning of the barcodes in the barcode pictures, the first picture collected again completely includes the barcode feature point information that can be used for the application identification of the pictures to be identified, realizing the identification of barcodes, and thus successfully identifying the barcodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly to a method and device for identifying barcodes in pictures. Background Art

[0002] With the rapid development and application of mobile Internet and barcode technology, especially two-dimensional code technology, various types of barcodes are used in a large number of Internet online and offline scenarios. In particular, two-dimensional codes are used as information storage, transmission, and identification technologies. Hereinafter, the two-dimensional code is taken as an example for illustration. The main application scenarios of two-dimensional code technology include obtaining information such as business cards, maps, Internet passwords or materials, website jumping, advertising promotion, mobile e-commerce, anti-counterfeiting traceability, preferential promotion, membership management, and / or terminal payment. Two-dimensional code technology began in the late 1980s and includes collection, identification, and generation technologies. Before the vigorous development of mobile Internet, collection was obtained by scanning with a dedicated scanning device, such as a two-dimensional code scanning gun, which quickly scanned the two-dimensional code through near-distance two-dimensional imaging technology, with a fast scanning speed and accurate subsequent identification. With the development of mobile Internet technology, various application providers of terminals, especially e-commerce applications and payment applications, have provided the function of collecting two-dimensional codes using the camera unit set in the terminal itself, greatly improving the usage rate of two-dimensional codes and expanding the usage scenarios of two-dimensional codes, making various two-dimensional codes appear on shopping malls, streets, and public transportation vehicle bodies for collection and subsequent identification, facilitating the shopping mall to promote its products and also facilitating users to use various mobile applications in mobile scenarios.

[0003] When identifying a two-dimensional code, after the camera unit of the terminal collects a picture with a two-dimensional code, the two-dimensional code in the picture is directly identified to obtain the meaning represented by the two-dimensional code.

[0004] However, there are disadvantages in collecting and identifying two-dimensional codes in the above manner: Since the camera unit set in the terminal itself may be restricted by objective conditions such as a long distance when collecting a two-dimensional code picture, the obtained two-dimensional code picture does not completely include the available two-dimensional code feature point information that can be identified, and the identification of the two-dimensional code in the picture cannot be achieved. Summary of the Invention

[0005] In view of this, an embodiment of the present invention provides a method for identifying barcodes in pictures, which can successfully identify barcodes in pictures.

[0006] An embodiment of the present invention further provides a device for identifying barcodes in pictures, which can successfully identify barcodes in pictures.

[0007] The embodiment of the present invention is implemented as follows:

[0008] A method for identifying barcodes in pictures, the method comprising:

[0009] Receiving a first picture;

[0010] Generating multiple second pictures with different resolution sizes based on the first picture, obtaining barcode candidate boxes in each second picture, and merging the obtained multiple barcode candidate boxes to obtain barcode candidate box information;

[0011] Based on the barcode candidate box information, determining barcode selected box information, and re-acquiring the first picture based on the barcode selected box information, so that the re-acquired first picture has barcode information that can be recognized.

[0012] The obtained barcode candidate box information is obtained by using a set convolutional neural network;

[0013] The determining of the barcode selected box information is determined by using a set convolutional neural network.

[0014] The convolutional neural network is set in the application of identifying pictures, and when the application of identifying pictures identifies barcodes in pictures, it calls the convolutional neural network to execute.

[0015] Before the method, it further comprises:

[0016] The application of identifying pictures identifies the first picture;

[0017] The application of identifying pictures determines whether barcode information is recognized from the first picture. If so, the method ends. If not, it calls the convolutional neural network to execute.

[0018] The convolutional neural network is a three-layer convolutional neural network;

[0019] The convolutional neural network is trained based on a set first picture.

[0020] The calling the convolutional neural network to execute includes:

[0021] The convolutional neural network scales the received first picture and scales it into multiple second pictures with different resolution sizes according to the set different resolutions;

[0022] The first layer convolutional neural network in the convolutional neural network obtains multiple second pictures and processes them, generates multiple barcode candidate boxes of the second pictures and merges them, and outputs the merged multiple barcode candidate box information to the second layer convolutional neural network in the convolutional neural network;

[0023] The second convolutional neural network in the convolutional neural network determines accurate candidate box information in the barcode image according to the merged information of multiple barcode candidate boxes, and outputs it to the third convolutional neural network in the convolutional neural network;

[0024] The third convolutional neural network in the convolutional neural network determines barcode selection box information from the accurate candidate box information in the barcode image.

[0025] The first convolutional neural network in the convolutional neural network processes as follows: generating images with a first pixel value from multiple images of different resolution sizes;

[0026] The second convolutional neural network in the convolutional neural network determining accurate candidate box information in the barcode image further includes:

[0027] Generating images with a second pixel value from multiple images of different resolution sizes, determining accurate candidate box information in the barcode image based on the images with the second pixel value and the merged information of multiple barcode candidate boxes, and the resolution of the second pixel value is greater than that of the first pixel value;

[0028] The third convolutional neural network in the convolutional neural network determining barcode selection box information further includes:

[0029] Generating images with a third pixel value from multiple images of different resolution sizes, determining barcode selection box information based on the images with the third pixel value and the accurate candidate box information in the barcode image, and the resolution of the third pixel value is greater than that of the second pixel value.

[0030] A device for identifying barcodes in an image includes: an image acquisition unit and a detection unit, wherein,

[0031] The image acquisition unit is used to receive a first image;

[0032] The detection unit is used to generate multiple second images of different resolution sizes based on the first image, obtain barcode candidate boxes in each second image, merge the obtained multiple barcode candidate boxes to obtain barcode candidate box information; determine barcode selection box information based on the barcode candidate box information, and re-acquire the first image based on the barcode selection box information, so that the re-acquired first image has barcode information that can be recognized.

[0033] A device for identifying barcodes in an image includes:

[0034] A memory; and a processor coupled to the memory, the processor being configured to execute the method for identifying barcodes in an image as described in any one of the above based on instructions stored in the memory.

[0035] A computer-readable storage medium has a computer program stored thereon, characterized in that when the program is executed by a processor, it implements the method for identifying barcodes in a picture as described in any one of the above.

[0036] As can be seen above, in the embodiment of the present invention, a first picture is received; during the process of identifying barcodes, multiple second pictures with different resolution sizes are generated based on the first picture, barcode candidate boxes are obtained in each second picture, and the multiple obtained barcode candidate boxes are merged to obtain barcode candidate box information; based on the barcode candidate box information, barcode selected box information is determined, so that the barcodes in the first picture collected again based on the barcode selected box information can be identified. In this way, through the positioning of the barcodes in the barcode picture, the first picture collected again completely includes the barcode feature point information that can be used for the application recognition of the recognized picture, realizing the recognition of barcodes, and thus successfully identifying barcodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flowchart of a method for identifying two-dimensional codes provided by the prior art;

[0038] Figure 2 It is a flowchart of a method for identifying barcodes in a picture provided by an embodiment of the present invention;

[0039] Figure 3 It is a flowchart of an implementation method of a convolutional neural network provided by an embodiment of the present invention;

[0040] Figure 4 It is a schematic diagram of the processing process of the first layer of convolutional neural network in the convolutional neural network provided by an embodiment of the present invention;

[0041] Figure 5 It is a schematic diagram of the processing process of the second layer of convolutional neural network in the convolutional neural network provided by an embodiment of the present invention;

[0042] Figure 6 It is a schematic diagram of the processing process of the third layer of convolutional neural network in the convolutional neural network provided by an embodiment of the present invention;

[0043] Figure 7 It is a flowchart of a specific example of a method for identifying barcodes in a picture provided by an embodiment of the present invention;

[0044] Figure 8 It is a schematic diagram of the structure of a device for identifying barcodes in a picture provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] To make the objectives, technical solutions and advantages of the present invention more clearly understood, the following examples are given with reference to the accompanying drawings to further elaborate on the present invention in detail.

[0046] Using the background technology to identify bar code technology may lead to inaccurate identification of the bar code information in the captured bar code pictures. In the background technology, the technology of collecting and identifying two-dimensional codes is mainly based on the set identification picture application. For example, this application is an open-source two-dimensional scanning open-source database (such as the ZXing) algorithm package. After loading the ZXing algorithm package on the terminal, the ZXing algorithm package calls the camera unit of the terminal to collect two-dimensional code pictures and then identifies the two-dimensional codes therein.

[0047] The following takes the two-dimensional code as an example of the bar code. Of course, the bar code can also be a one-dimensional code, a three-dimensional code or other types of bar codes, which are not limited here.

[0048] Specifically, as Figure 1 shown, Figure 1 is a flowchart of the method for identifying two-dimensional codes provided by the prior art, and its specific steps are as follows:

[0049] Step 101, initialize the camera unit set by the terminal itself;

[0050] In this step, initialize and turn on the camera unit, specifically the camera, set the viewfinder of the camera, and prompt the user to place the two-dimensional code to be collected into the viewfinder to collect the two-dimensional code;

[0051] Step 102, the camera unit processes the video stream;

[0052] In this step, process the video stream obtained by the camera and extract each frame of picture in the video stream;

[0053] Step 103, the camera unit performs focus detection to determine whether the picture in the obtained video stream is in focus. If so, execute step 104; if not, adjust the position of the camera unit, perform re-focusing, and then return to step 103;

[0054] Step 104, the camera unit performs binarization processing on the focused picture to form a black and white picture;

[0055] Step 105, the ZXing algorithm package set by the terminal identifies the two-dimensional code in the black and white picture;

[0056] In this step, the ZXing algorithm package will call the recognition algorithm to scan the black and white picture line by line and identify three feature points of the two-dimensional code in the black and white picture, namely the three black feature points in the upper left, lower left and upper right;

[0057] Step 106, the ZXing algorithm package of the terminal determines whether the three feature points in the black and white picture are successfully recognized. If so, execute step 107; if not, return to step 105 and wait to process the next black and white picture;

[0058] Step 107: The ZXing algorithm package of the terminal calls the set parsing algorithm to parse the QR code information in the black-and-white picture.

[0059] Step 108: The ZXing algorithm package of the terminal determines whether the parsing is successful. If so, step 109 is executed; if not, it returns to step 105 to wait for the next black-and-white picture to be processed.

[0060] Step 109: Output the QR code information in the black-and-white picture.

[0061] Figure 1 The method for identifying QR code information described above has many drawbacks. One of the drawbacks is caused by the function of using the camera unit set in the terminal itself for QR code collection. In the past, devices for collecting QR codes, such as QR code scanners, needed to be close to the QR code to collect the content of the QR code faster and more accurately. However, when using the camera unit set in the terminal itself to collect QR codes, in most scenarios, it is necessary to use the camera unit to take pictures of QR codes at a relatively long distance, such as QR codes posted on the walls of stores, QR codes posted on carriage advertisements, QR codes displayed on a remote large screen, etc. In these scenarios, because the QR code is far from the lens, if the directly collected QR code picture is recognized using the ZXing algorithm package, the three feature points in the QR code picture cannot be recognized, and thus the QR code information cannot be successfully parsed. Although the camera unit set in the terminal itself has a focusing function, it needs to be based on an instruction, that is, to locate the position of the QR code in the QR code picture. And the terminal does not provide this function when collecting QR code pictures, which is the problem to be solved in the embodiments of the present invention.

[0062] Therefore, in the background art, the ZXing algorithm package of the terminal does not provide the function of QR code detection and positioning in the QR code picture, resulting in the situation that when the QR code is far from the camera unit set in the terminal, the ZXing algorithm package of the terminal cannot detect the three feature points of the QR code from the collected QR code picture, and thus cannot correctly identify the QR code information, while the embodiments of the present invention can solve this problem.

[0063] To solve the problems in the background art, the method adopted in the embodiments of the present invention is: receiving a first picture; during the process of identifying a barcode, generating multiple second pictures with different resolution sizes based on the first picture, obtaining barcode candidate frames in each second picture, merging the obtained multiple barcode candidate frames to obtain barcode candidate frame information; and determining barcode selected frame information based on the barcode candidate frame information, so that the barcode in the first picture collected again based on the barcode selected frame information can be recognized.

[0064] In this way, through the positioning of the barcode in the barcode picture, the first picture collected again completely includes the barcode feature point information for application recognition of the available picture to be recognized, realizing the recognition of the barcode, and thus successfully recognizing the barcode.

[0065] Figure 2 The following is a flowchart of the method for recognizing the barcode in the picture provided by the embodiment of the present invention, and the specific steps are as follows:

[0066] Step 201: Receive the first picture;

[0067] Step 202: Generate multiple second pictures with different resolution sizes based on the first picture, obtain barcode candidate boxes in each second picture, and merge the obtained multiple barcode candidate boxes to obtain barcode candidate box information;

[0068] Step 203: Determine barcode selected box information based on the barcode candidate box information;

[0069] Step 204: Re-collect the first picture based on the barcode selected box information, so that the re-collected first picture has barcode information that can be recognized.

[0070] In the embodiment of the present invention, the obtained barcode candidate box information is obtained by using a set convolutional neural network; the determination of the barcode selected box information is determined by using a set convolutional neural network.

[0071] In the embodiment of the present invention, the convolutional neural network is set in the application for recognizing pictures, for example, set in the ZXing algorithm package. When the ZXing algorithm package recognizes the first picture, it calls this convolutional neural network to detect and locate the barcode in the first picture.

[0072] The embodiment of the present invention draws on the fact that the convolutional neural network based on deep learning can realize the functions of picture detection and object positioning in pictures, such as face detection and positioning functions. In the whole process of face detection and positioning, the face detection algorithm is used to monitor whether there is a face in a picture, and the face positioning algorithm is used to position the face after detecting that the picture includes a face, specifically, the position of the face is framed with a rectangle, and the coordinates of the rectangle in the picture are output. The embodiment of the present invention uses this idea to detect and locate the barcode in the first picture. Specifically, it first detects whether the picture contains a barcode, and then frames the position of the barcode with a rectangle, and outputs the selected box information as the positioning information, so that the first picture collected subsequently based on this positioning information must include barcode information, enabling the application for recognizing pictures to recognize it.

[0073] In the embodiments of the present invention, a convolutional neural network is specifically constructed using a multi-task convolutional neural network (MTCNN), which is a multi-task barcode detection and localization algorithm framework. It cascades three layers of convolutional neural networks to realize the detection and localization process of the entire barcode image.

[0074] The following takes the two-dimensional code as an example of the barcode for detailed description.

[0075] Figure 3 The flowchart of the implementation method of the convolutional neural network provided by the embodiments of the present invention specifically includes:

[0076] Step 301: The convolutional neural network scales the obtained two-dimensional code picture and scales it into multiple pictures with different resolution sizes according to different set resolutions.

[0077] Step 302: The first layer of convolutional neural network in the convolutional neural network obtains multiple pictures with different resolution sizes, processes them, generates multiple two-dimensional code candidate boxes in the two-dimensional code picture and merges them, and outputs the information of the merged multiple two-dimensional code candidate boxes to the second layer of convolutional neural network in the convolutional neural network.

[0078] Step 303: The second layer of convolutional neural network in the convolutional neural network determines the accurate candidate box information in the two-dimensional code picture according to the information of the merged multiple two-dimensional code candidate boxes and outputs it to the third layer of convolutional neural network in the convolutional neural network.

[0079] Step 304: The third layer of convolutional neural network in the convolutional neural network determines the selected two-dimensional code box information from the accurate candidate box information in the two-dimensional code picture and outputs it.

[0080] In Figure 3 Step 301, it is to add the understanding of depth in three dimensions in the two-dimensional space. For example, when the object in the picture is far away, the possible scale is in centimeters as the unit, and when the object in the picture is very close, it needs to be measured in millimeters. However, for the convolutional neural network, it cannot determine what scale is used to measure each obtained two-dimensional code picture. Therefore, the obtained two-dimensional code picture, that is, the first picture, is processed to obtain multiple pictures with different resolution sizes.

[0081] In Figure 3In step 302, specifically, multiple pictures of different resolution sizes are scaled to generate a picture with a first pixel value, and then it is detected whether a two-dimensional code is included in the picture with the pixel size of the first pixel value. If it is included, two-dimensional code candidate box information is generated. Here, the obtained result is relatively rough and will include many two-dimensional code candidate boxes. By using the set merging algorithm, multiple generated two-dimensional code candidate boxes can be merged to form the input data of the second convolutional neural network in the convolutional neural network, as Figure 4 shown, drawing on the network model of face recognition, Figure 4 is a schematic diagram of the processing process of the first convolutional neural network in the convolutional neural network provided by an embodiment of the present invention.

[0082] In Figure 3 step 303, specifically, the second convolutional neural network in the convolutional neural network generates pictures with a second pixel value from the pictures of different resolution sizes set respectively, and then determines the accurate candidate box information in the two-dimensional code picture according to the merged multiple two-dimensional code candidate box information, and outputs it to the third convolutional neural network in the convolutional neural network. The resolution of the second pixel value is greater than that of the first pixel value. As Figure 5 shown, drawing on the network model of face recognition, Figure 5 is a schematic diagram of the processing process of the second convolutional neural network in the convolutional neural network provided by an embodiment of the present invention.

[0083] In Figure 3 step 304, specifically, the third convolutional neural network in the convolutional neural network generates pictures with a third pixel size from the pictures of different resolution sizes set respectively, and then determines the selected box information of the two-dimensional code according to the accurate candidate box information determined in the two-dimensional code picture, and outputs it. As Figure 6 shown, drawing on the network model of face recognition, the resolution of the third pixel value is greater than that of the second pixel value. Figure 6 is a schematic diagram of the processing process of the third convolutional neural network in the convolutional neural network provided by an embodiment of the present invention.

[0084] Here, the first pixel value can be set to 12×12 pixels, the second pixel value can be set to 24×24 pixels, and the third pixel value can be set to 48×48 pixels. The following takes specific pixel values as examples for illustration.

[0085] It can be seen that the convolutional neural network is constructed using MTCNN. The convolutional neural network contains three layers of convolutional neural networks. Before applying this convolutional neural network, it needs to be trained with QR code images. The training process is the same as the steps of applying this convolutional neural network. Adjust the three layers of convolutional neural networks in the convolutional neural network according to the training results until the final training result is accurate. After the convolutional neural network is trained with QR code images, use the trained convolutional neural network to monitor the QR code images and locate the QR code.

[0086] The embodiment of the present invention can integrate the above-mentioned convolutional neural network and the functions related to QR code recognition into the application for recognizing pictures set, such as in the Zxing algorithm package, so that running the Zxing algorithm package can realize the entire QR code recognition process, specifically as Figure 7 described, Figure 7 is the flowchart of the method for recognizing QR codes provided by the embodiment of the present invention, and its specific steps are as follows:

[0087] Step 701: Run the set Zxing algorithm package. The Zxing algorithm package triggers the camera unit set by the terminal to open and intercept each frame of QR code image in the video stream;

[0088] Step 702: The function of recognizing QR codes set in the Zxing algorithm package recognizes the QR code information in the picture. If the QR code information is recognized, the QR code information is returned and the camera unit is closed. If the QR code information is not detected, the QR code picture is sent to the convolutional neural network in the Zxing algorithm package;

[0089] Step 703: The convolutional neural network in the Zxing algorithm package scales the QR code picture into multiple pictures with different resolution sizes;

[0090] Step 704: The first layer of convolutional neural network in the convolutional neural network in the Zxing algorithm package processes the received multiple pictures to obtain a picture with 12*12 pixel points, generates multiple QR code candidate boxes in the QR code picture based on the picture with 12*12 pixel points and merges them according to the set merging algorithm, and outputs the information of the merged multiple QR code candidate boxes to the second layer of convolutional neural network in the convolutional neural network;

[0091] Step 705: The second layer of convolutional neural network in the convolutional neural network in the Zxing algorithm package processes multiple pictures with different resolution sizes to obtain a picture with 24*24 pixel points, determines the accurate candidate box information in the QR code picture according to the information of the merged multiple QR code candidate boxes and the obtained picture with 24*24 pixel points, and outputs it to the third layer of convolutional neural network in the convolutional neural network;

[0092] Step 706: The third convolutional neural network in the convolutional neural network in the Zxing algorithm package processes multiple pictures with different resolution sizes to obtain a picture with 48*48 pixel points. Based on the accurate candidate frame information in the QR code picture and the obtained picture with 48*48 pixel points, the QR code selection frame information is determined and output to the Zxing algorithm package. If the QR code selection frame information is not obtained, it directly returns to Step 701;

[0093] Step 707: Based on the QR code selection frame information, the Zxing algorithm package calls the camera unit set by the terminal to perform a zoom operation to enlarge the image of the QR code picture area, and then returns to Step 701 for execution.

[0094] Figure 8 The schematic diagram of the barcode recognition device in the embodiment of the present invention includes: a picture acquisition unit and a detection unit, where,

[0095] The picture acquisition unit is used to receive the first picture;

[0096] The detection unit is used to generate multiple second pictures with different resolution sizes based on the first picture, obtain barcode candidate frames in each second picture, merge the obtained multiple barcode candidate frames to obtain barcode candidate frame information; based on the barcode candidate frame information, determine the barcode selection frame information, and re-acquire the first picture based on the barcode selection frame information so that the re-acquired first picture has barcode information that can be recognized.

[0097] The embodiment of the present invention also provides a barcode recognition device in a picture, including:

[0098] A memory; and a processor coupled to the memory, the processor is configured to execute the above barcode recognition method in a picture based on instructions stored in the memory.

[0099] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the above barcode recognition method in a picture.

[0100] It can be seen from the embodiment of the present invention that the embodiment of the present invention trains a convolutional neural network based on the set convolutional neural network and the barcode picture self-acquired by the terminal, and sets the convolutional neural network in the application of recognizing pictures. When using the application of recognizing pictures to recognize barcodes, it helps to complete the barcode detection and positioning functions in the barcode picture, so that the application of recognizing pictures can adjust the camera unit set by the terminal according to the output result of the convolutional neural network to obtain barcode information, improving the barcode recognition accuracy.

[0101] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for identifying barcodes in pictures, characterized in that, The method includes the following steps: A. Receive a first picture; B. Determine whether barcode information is recognized from the first picture; if so, execute step F; otherwise, execute step C; C. Generate multiple second pictures with different resolution sizes based on the first picture, obtain barcode candidate boxes in each second picture, and merge the obtained multiple barcode candidate boxes to obtain barcode candidate box information; based on the barcode candidate box information, determine barcode selected box information; wherein, the barcode selected box information is determined by using a set convolutional neural network; the convolutional neural network is a three-layer convolutional neural network; D. Determine whether barcode selected box information is obtained; if so, execute step E; otherwise, execute step A; E. Based on the barcode selected box information, call the camera unit to perform a zoom operation, zoom in on the image of the barcode picture area to re-collect the first picture, so that the re-collected first picture has barcode information that can be recognized; execute step A; F. Return the QR code information and turn off the camera unit.

2. The method according to claim 1, characterized in that, The convolutional neural network is set in the application of recognizing pictures, and when the application of recognizing pictures recognizes barcodes in pictures, it calls the convolutional neural network to execute.

3. The method according to claim 1, characterized in that, The convolutional neural network is trained based on the set first picture.

4. The method according to claim 2, characterized in that, The calling the convolutional neural network to execute includes: The convolutional neural network scales the received first picture and scales it into multiple second pictures with different resolution sizes according to the set different resolutions; The first layer convolutional neural network in the convolutional neural network obtains and processes multiple second pictures, generates and merges multiple barcode candidate boxes of the second pictures, and outputs the merged multiple barcode candidate box information to the second layer convolutional neural network in the convolutional neural network; The second layer convolutional neural network in the convolutional neural network determines the accurate candidate box information in the barcode picture according to the merged multiple barcode candidate box information and outputs it to the third layer convolutional neural network in the convolutional neural network; The third layer convolutional neural network in the convolutional neural network determines the barcode selected box information from the accurate candidate box information in the barcode picture.

5. The method according to claim 4, characterized in that, The processing of the first layer convolutional neural network in the convolutional neural network is: generating a picture with a first pixel value from multiple pictures with different resolution sizes; The second layer convolutional neural network in the convolutional neural network determining the accurate candidate box information in the barcode picture further includes: Generating a picture with a second pixel value from multiple pictures with different resolution sizes, and determining the accurate candidate box information in the barcode picture based on the picture with the second pixel value and the merged multiple barcode candidate box information, and the resolution of the second pixel value is greater than that of the first pixel value; The third layer convolutional neural network in the convolutional neural network determining the barcode selected box information further includes: Generating a picture with a third pixel value from multiple pictures with different resolution sizes, and determining the barcode selected box information based on the picture with the third pixel value and the accurate candidate box information in the barcode picture, and the resolution of the third pixel value is greater than that of the second pixel value.

6. A device for identifying barcodes in pictures, characterized in that, Including: An image acquisition unit and a detection unit, wherein, The image acquisition unit is configured to receive a first image; The detection unit is configured to determine whether barcode information is recognized from the first image; if so, return QR code information and turn off the camera unit; otherwise, generate multiple second images of different resolution sizes based on the first image, obtain barcode candidate frames in each second image, merge the obtained multiple barcode candidate frames to obtain barcode candidate frame information; determine barcode selection frame information based on the barcode candidate frame information; wherein, the barcode selection frame information is determined by using a set convolutional neural network; the convolutional neural network is a three-layer convolutional neural network; determine whether barcode selection frame information is obtained; if so, call the camera unit based on the barcode selection frame information to perform a zoom operation to magnify the image of the barcode picture area and re-acquire the first image so that the re-acquired first image has barcode information that can be recognized; and trigger the image acquisition unit to receive the first image; otherwise, directly trigger the image acquisition unit to receive the first image.

7. A device for identifying barcodes in pictures, characterized in that, Comprising: A memory; And a processor coupled to the memory, the processor being configured to execute the method for identifying barcodes in images according to any one of claims 1-5 based on instructions stored in the memory.

8. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, it implements the method for identifying barcodes in images according to any one of claims 1-5.

Citation Information

Patent Citations

  • QR code data processing method and device and mobile terminal

    CN108121931A