Pattern code recognition method, pattern code recognition device, and electronic device

CN115358251BActive Publication Date: 2026-10-27VIVO MOBILE COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211042387.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2026-10-27
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

[0003]本申请实施例的目的是提供一种图形码识别方法、图形码识别装置和电子设备,能够解决单图片多图形码的识别情景下用户操作步骤繁杂的问题

Benefits of technology

[0010]在本申请实施例中,通过自动识别多个图形码中与第一输入所在的第一区域距离最近的图形码,并显示该图形码对应的识别内容,在单图像多图形码的识别情景下,无需用户手动选择需识别的图形码即可自动识别与用户输入位置最接近的图形码,显著减少了用户的操作步骤,提高了识别效率,操作简单快捷且易于实现,有助于提高用户的使用体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115358251B_ABST
    Figure CN115358251B_ABST
Patent Text Reader

Abstract

The application discloses a pattern code recognition method, a pattern code recognition device and an electronic device, and belongs to the field of image processing. The pattern code recognition method comprises the following steps: receiving a first input of a first region on a to-be-recognized image, wherein the to-be-recognized image comprises a plurality of pattern codes; in response to the first input, displaying recognition content corresponding to a first target pattern code in the plurality of pattern codes; wherein the first target pattern code is a pattern code closest to the first region in the plurality of pattern codes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, specifically relating to a graphic code recognition method, graphic code recognition device, and electronic device. Background Technology

[0002] In daily life, we often encounter situations requiring image barcode recognition. A common scenario involves recognizing multiple image barcodes within a single image. In related technologies, the user long-presses the image to trigger a scan menu, the electronic device recognizes multiple image barcodes in the image, and the user then selects the desired barcode from these. The electronic device then scans the selected barcode and displays the result. This method involves numerous user actions, making the process cumbersome and negatively impacting the user experience. Summary of the Invention

[0003] The purpose of this application is to provide a graphic code recognition method, graphic code recognition device, and electronic device that can solve the problem of complicated user operation steps in the scenario of recognizing multiple graphic codes in a single image.

[0004] In a first aspect, embodiments of this application provide a graphic code recognition method, the method comprising: Receive a first input on a first region of an image to be identified, wherein the image to be identified includes multiple graphic codes; In response to the first input, the recognition content corresponding to the first target graphic code among the plurality of graphic codes is displayed; The first target graphic code is the graphic code that is closest to the first region among the plurality of graphic codes.

[0005] Secondly, embodiments of this application provide a graphic code recognition device, the device comprising: The first receiving module is used to receive a first input on a first region of an image to be recognized, wherein the image to be recognized includes multiple graphic codes; The first processing module is configured to respond to the first input and display the recognition content corresponding to the first target graphic code among the plurality of graphic codes; The first target graphic code is the graphic code that is closest to the first region among the plurality of graphic codes.

[0006] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions that can run on the processor, and the programs or instructions, when executed by the processor, implement the method as described in the first aspect.

[0007] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the method described in the first aspect.

[0008] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0009] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0010] In this embodiment of the application, by automatically identifying the graphic code that is closest to the first area where the first input is located among multiple graphic codes, and displaying the recognition content corresponding to the graphic code, in the scenario of recognizing multiple graphic codes in a single image, the graphic code that is closest to the user's input position can be automatically identified without the user having to manually select the graphic code to be recognized. This significantly reduces the user's operation steps, improves recognition efficiency, and is simple, fast and easy to implement, which helps to improve the user experience. Attached Figure Description

[0011] Figure 1 This is one of the flowcharts illustrating the graphic code recognition method provided in the embodiments of this application; Figure 2 This is a second schematic flowchart of the graphic code recognition method provided in the embodiments of this application; Figure 3 This is one of the interface diagrams of the graphic code recognition method provided in the embodiments of this application; Figure 4 This is a second schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 5 This is the third schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 6 This is the fourth schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 7 This is the fifth schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 8 This is the sixth schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 9 This is the seventh schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 10 This is the eighth schematic diagram of the interface of the graphic code recognition method provided in the embodiments of this application; Figure 11 This is a schematic diagram of the structure of the graphic code recognition device provided in the embodiments of this application; Figure 12 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application; Figure 13 This is a hardware schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

[0012] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0013] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0014] The graphic code recognition method, graphic code recognition device, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0015] The graphic code recognition method can be applied to electronic devices, specifically executed by the hardware or software within the electronic device.

[0016] The electronic device includes, but is not limited to, mobile phones or tablets and other portable communication devices with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the electronic device may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).

[0017] The following embodiments describe electronic devices including a display and a touch-sensitive surface. However, it should be understood that the electronic device may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.

[0018] The graphic code recognition method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the graphic code recognition method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, wearable devices, etc. The graphic code recognition method provided in this application embodiment is described below using an electronic device as the execution subject.

[0019] like Figure 1 As shown, the graphic code recognition method includes steps 110 and 120.

[0020] Step 110: Receive the first input on the first region 330 of the image to be recognized, the image to be recognized includes multiple graphic codes; In this step, the graphic code can include one-dimensional codes, two-dimensional codes, multi-dimensional codes, barcodes, and any other recognizable graphic codes.

[0021] The image to be identified can be an image stored in an electronic device, an image received from a server or other device, or an image acquired by an image sensor.

[0022] The image to be identified includes multiple graphic codes, each corresponding to different content.

[0023] The following explanation uses a graphic code as an example to illustrate this step.

[0024] like Figure 3 As shown, the image to be recognized includes corresponding QR codes A310 and B320. Recognizing QR code A310 will redirect to the display interface, and recognizing QR code B320 will also redirect to the display interface.

[0025] The first region 330 is the region where the user makes the first input. It can be understood that, in the actual execution process, the user can make the first input in any region of the image to be recognized.

[0026] The first input is used to determine the first target graphic code from multiple graphic codes.

[0027] The first target graphic code is the graphic code that is closest to the first region 330 among multiple graphic codes.

[0028] The first input can be in at least one of the following ways: Firstly, the first input can be a touch operation, including but not limited to click, swipe, and press operations.

[0029] In this embodiment, receiving the user's first input can be receiving the user's touch operation on the display area of ​​the terminal screen.

[0030] For example, when the image to be recognized is displayed, the first input can be set to a long press on the first area 330, or it can be set to a series of taps on the first area 330 within a target time interval.

[0031] Secondly, the first input can be a physical button input.

[0032] In this embodiment, the terminal is equipped with corresponding physical buttons on its body to receive the user's first input. This can be receiving the user's first input by pressing the corresponding physical button; the first input can also be a combination operation of pressing multiple physical buttons simultaneously.

[0033] like Figure 2 As shown, in some embodiments, the first input may include: a first sub-input and a second sub-input, and step 110 may include: Receive the first sub-input of the first region 330 on the image to be recognized; In response to the first sub-input, display the first target control 370; Receive the second sub-input to the first target control 370.

[0034] In this embodiment, the first target control 370 is a control used to enter the smart QR code scanning menu scenario.

[0035] It should be noted that when entering the smart scanning menu scenario, the electronic device responds to the second sub-input and can directly execute step 120. When the electronic device recognizes multiple graphic codes, the user does not need to manually select the graphic code to be recognized, and the electronic device can automatically recognize the corresponding graphic code. When entering a non-intelligent barcode scanning menu scenario, if the electronic device recognizes multiple graphic codes, the user needs to manually select the graphic code to be recognized, and then the electronic device will recognize the graphic code selected by the user.

[0036] The first sub-input is used to determine the first region 330 and trigger the display of the first target control 370.

[0037] In some embodiments, the first sub-input is further used to trigger the display of a third target control 380, wherein the third target control 380 is a control used to enter a non-smart QR code scanning menu scenario, such as... Figure 3 The control corresponding to "Select Scan Menu" shown.

[0038] The first sub-input can be the same as the first input, such as touch input or physical button input, which will not be elaborated here.

[0039] The second sub-input is used to determine the scenario for entering the smart QR code scanning menu.

[0040] The second sub-input can be the same touch input or physical button input as the first input, or it can be voice input. For example, an electronic device can trigger the second sub-input when it receives a voice message such as "select the smart scan menu".

[0041] In other embodiments, when entering a non-intelligent QR code scanning menu scenario, such as when the user clicks... Figure 3 When the control corresponding to "Select Scan Menu" is shown, or when the electronic device receives a voice message such as "Select Scan Menu", the electronic device will perform the regular scanning steps, and the user will manually select the graphic code to be recognized. The specific implementation process will not be described in detail here.

[0042] For example, in actual implementation, users want to identify things like... Figure 3 If the QR code A310 in the image to be recognized is shown, then long press the area near QR code A310 to achieve the first sub-input; The electronic device responds to the first sub-input and displays the first target control 370, such as the control corresponding to "Select Smart Scan Menu".

[0043] Users can click the control corresponding to "Select Smart Scan Menu" to enable the second sub-input.

[0044] The graphic code recognition method provided in the embodiments of this application offers multiple scanning scenarios (intelligent scanning menu scenario and non-intelligent scanning menu scenario), allowing users to select the desired scanning scenario based on their actual needs, thus exhibiting high flexibility and universality.

[0045] Step 120: In response to the first input, display the recognition content corresponding to the first target graphic code among multiple graphic codes.

[0046] In this step, the first target graphic code is the graphic code that is closest to the first region 330 among multiple graphic codes.

[0047] The identified content can be the detailed content corresponding to the first target graphic code; it can also be the core content or a brief summary of the detailed content corresponding to the first target graphic code.

[0048] In response to the first input, the electronic device identifies the graphic code closest to the first region 330 among multiple graphic codes on the image to be recognized as the first target graphic code, automatically recognizes the first target graphic code, and displays the recognition content corresponding to the first target graphic code.

[0049] For example, continue to refer to Figure 3 In actual implementation, when a user wants to recognize QR code A310, the user long-presses the area near QR code A310 to achieve the first input.

[0050] The electronic device responds to the first input, identifies the area that the user long-presses as the first area 330, identifies the QR code A310 as the first target graphic code, and automatically recognizes the QR code A310 and displays the recognition content corresponding to the QR code A310.

[0051] For example, such as Figure 2 As shown, in actual execution, the user wants to identify, for example... Figure 3 If the QR code A310 in the image to be recognized is shown, then long press the area near QR code A310 to achieve the first sub-input; The electronic device responds to the first sub-input and displays the first target control 370, such as the control corresponding to "Select Smart Scan Menu".

[0052] Users can click the control corresponding to "Select Smart Scan Menu" to enable the second sub-input.

[0053] The electronic device responds to the second sub-input, enters the smart scanning menu scenario, identifies the area long-pressed by the user as the first area 330, identifies QR code A310 as the first target graphic code, and automatically recognizes QR code A310 and displays the recognition content corresponding to QR code A310.

[0054] It should be noted that, in some embodiments, displaying the identification content corresponding to the first target graphic code may include: jumping to a new display interface and displaying the identification content corresponding to the first target graphic code.

[0055] In this embodiment, the identification content corresponding to the first target graphic code displayed on the new display interface can be the detailed content corresponding to the first target graphic code.

[0056] By directly displaying the recognition content corresponding to the first target graphic code in response to the first input, the user's operation steps can be reduced, thereby improving the recognition speed and efficiency and helping to improve the user experience.

[0057] In other embodiments, displaying the identification content corresponding to the first target graphic code may include: displaying the identification content corresponding to the first target graphic code in the form of a pop-up or split screen on the current display interface.

[0058] In this embodiment, the identification content corresponding to the first target graphic code displayed in the form of a pop-up or split screen can be the core content or content summary corresponding to the first target graphic code, or it can be the detailed content corresponding to the first target graphic code.

[0059] When displaying the core content or a brief description of the content corresponding to the first target graphic code, after step 120, the method may further include: Receive third input; In response to the third input, display the details corresponding to the first target graphic code.

[0060] In this embodiment, the third input is used to display detailed information.

[0061] The third input can be the same as the second sub-input, such as touch input, physical button input, voice input, or motion gesture input, which will not be elaborated here.

[0062] For example, in actual operation, the user can click on the area where the pop-up or split screen is located to achieve the third input; the electronic device responds to the third input, jumps to the new display interface, and displays the detailed content corresponding to the first target graphic code.

[0063] In some embodiments, when the identification content corresponding to the first target graphic code is displayed in the form of a pop-up or split screen, the display interface may include at least two display areas, one of which includes the identification content corresponding to the first target graphic code, and the other display areas include other content, such as the graphic code itself or other option information. Each display area corresponds to a pop-up or split screen, which is not limited in this application.

[0064] like Figure 4 An example of a display interface is provided, which includes a first display area 350 and a third display area 390, wherein the first display area 350 includes the recognition content corresponding to the first target graphic code; and the third display area 390 includes the first target graphic code, such as QR code A310.

[0065] In other embodiments, displaying the identification content corresponding to the first target graphic code among a plurality of graphic codes may include: displaying a first display area 350 and a second display area 360, wherein the first display area 350 includes the identification content corresponding to the first target graphic code, and the second display area 360 is used to indicate the identification of other graphic codes.

[0066] In this embodiment, the second display area 360 is an area used to identify other graphic codes.

[0067] For example, the second display area 360 may include a second target control for indicating the identification of other graphic codes.

[0068] The first display area 350 is the area that includes the recognition content corresponding to the first target graphic code.

[0069] In this embodiment, while displaying the recognition content corresponding to the first target graphic code, the function of recognizing other graphic codes is also activated.

[0070] like Figure 5An example of a display interface is provided, which includes a first display area 350 and a second display area 360, wherein the first display area 350 includes recognition content corresponding to a first target graphic code; and the second display area 360 includes a second target control for indicating the recognition of QR code B320, such as a control corresponding to the "Recognize Other Graphic Codes Menu".

[0071] According to the graphic code recognition method provided in the embodiments of this application, by simultaneously displaying a first display area 350 including the recognition content corresponding to the first target graphic code and a second display area 360 for indicating the recognition of other graphic codes, the recognition content corresponding to the first target graphic code is displayed to the user, while also providing the user with an entry point to recognize other graphic codes. This not only facilitates the user's subsequent recognition of other graphic codes but also effectively solves problems such as misrecognition operations, helping to improve the accuracy and flexibility of graphic code recognition results. In addition, it avoids the need for the user to exit the current recognition interface and repeat the above recognition operations when they need to recognize other graphic codes, significantly simplifying the operation steps, improving recognition efficiency, and making the operation simple and fast.

[0072] Continue to refer to Figure 5 In some embodiments, displaying the identification content corresponding to the first target graphic code among multiple graphic codes may further include: displaying a first display area 350, a second display area 360, and a third display area 390.

[0073] In this embodiment, the first display area 350 includes the recognition content corresponding to the first target graphic code; the second display area 360 includes a second target control for indicating the recognition of QR code B320, such as the control corresponding to the "Recognize other graphic codes menu"; the third display area 390 includes the first target graphic code and other graphic codes, that is, QR code A310 and QR code B320, and the first target graphic code is in an unselectable state.

[0074] According to the graphic code recognition method provided in the embodiments of this application, by automatically identifying the graphic code that is closest to the first input area 330 among multiple graphic codes, and displaying the recognition content corresponding to the graphic code, in the scenario of recognizing multiple graphic codes in a single image, the graphic code that is closest to the user's input position can be automatically recognized in one step without the user having to manually select the graphic code to be recognized. This significantly reduces the user's operation steps, improves recognition efficiency, and is simple, fast and easy to implement, which helps to improve the user experience.

[0075] It is understandable that misidentification may occur during actual implementation, meaning that the first target graphic code identified by the electronic device is not the graphic code that the user wants to identify; or after the first target graphic code is identified, the user still needs to identify other graphic codes.

[0076] Then continue to refer to Figure 2 In some embodiments, after displaying the first display area 350 and the second display area 360, the method may further include: Receive a second input to the second display area 360; In response to the second input, the recognition content corresponding to the second target graphic code among multiple graphic codes is displayed. The second target graphic code is the graphic code that is 330 from the first region and is second only to the first target graphic code among multiple graphic codes.

[0077] In this embodiment, the second display area 360 is an area that includes a second target control for indicating the identification of other graphic codes besides the first target graphic code.

[0078] The second target graphic code is the graphic code that is 330 units away from the first region and is second only to the first target graphic code among multiple graphic codes.

[0079] The second input is used to display the recognition content corresponding to the second target graphic code.

[0080] The second input can be in at least one of the following ways: Firstly, the second input can be a touch operation, including but not limited to click, swipe, and press operations.

[0081] In this embodiment, in order to reduce the user's error rate, the effective area of ​​the second input can be limited to a specific area, such as the middle part of the second display area 360.

[0082] Alternatively, while the second display area 360 is displayed, a second target control can be set within the second display area 360. Touching the second target control will enable a second input; for example, Figure 5 As shown, a control corresponding to the "Recognize Other Graphic Codes Menu" is set in the second display area 360. When the user touches the control corresponding to the "Recognize Other Graphic Codes Menu", the second input can be realized.

[0083] Alternatively, the second input can be set to a series of taps on the second display area 360 within a target time interval.

[0084] Secondly, the second input can be physical button input.

[0085] In this embodiment, the terminal is equipped with corresponding physical buttons to receive the user's second input. This can be receiving the user's second input by pressing the corresponding physical button; the second input can also be a combination operation of pressing multiple physical buttons simultaneously.

[0086] Third, the second input can be voice input.

[0087] In this implementation, the terminal can trigger a second input when it receives a voice message such as "Recognize other graphic code menus".

[0088] Of course, in other embodiments, the second input may also be in other forms, including but not limited to motion-sensing gesture input, etc., which can be determined according to actual needs, and this application embodiment does not limit it.

[0089] In some embodiments, in response to a second input, displaying the identification content corresponding to a second target graphic code among a plurality of graphic codes may further include: in response to a second input, displaying the identification content corresponding to a second target graphic code among a plurality of graphic codes, and canceling the display of the identification content corresponding to a first target graphic code.

[0090] It is understood that, in this embodiment, upon receiving a second input, the electronic device can automatically mask the previously identified graphic code and identify other graphic codes to display the corresponding identification content.

[0091] For example, continue to refer to Figure 5 The electronic device displays a first display area 350 and a second display area 360. The first display area 350 includes the recognition content corresponding to QR code A310. The second display area 360 includes a second target control for indicating the recognition of QR code B320, such as the control corresponding to the "Recognize other graphic codes menu".

[0092] In the event of a user error and the user needs to display the recognition content corresponding to QR code B320, the user can click the control corresponding to the "Recognize Other Graphic Codes Menu" to achieve a second input.

[0093] The electronic device responds to the second input, identifies QR code B320 as the second target graphic code, automatically recognizes QR code B320, and displays the recognition content corresponding to QR code B320.

[0094] Similarly, displaying the recognition content corresponding to the second target graphic code among multiple graphic codes can be done by: jumping to a new display interface and displaying the recognition content corresponding to the second target graphic code; or by displaying the recognition content corresponding to the second target graphic code in the current display interface in the form of a pop-up or split screen.

[0095] When the identification content corresponding to the second target graphic code is displayed in the form of a pop-up or split screen, the display interface may include at least two display areas, one of which includes the identification content corresponding to the second target graphic code, and the other display areas include other content, such as graphic codes or displaying other option information, which is not limited in this application.

[0096] like Figure 6An example of a display interface is provided, which includes a first display area 350 and a third display area 390, wherein the first display area 350 includes the recognition content corresponding to the second target graphic code; and the third display area 390 includes the second target graphic code, such as QR code B320.

[0097] In some embodiments, when the number of graphic codes in the image to be recognized is at least three, such as QR code A310, QR code B320, QR code C and QR code D, the display interface may include a first display area 350, a second display area 360 and a third display area 390.

[0098] In this embodiment, the first display area 350 includes the identification content corresponding to the second target graphic code; the second display area 360 includes a control for indicating the identification of other QR codes besides QR code A310 and QR code B320, that is, a control for indicating the identification of QR code C or QR code D; the third display area 390 includes the first target graphic code, the second target graphic code, and other graphic codes besides the first target graphic code and the second target graphic code, that is, QR code A310, QR code B320, QR code C, and QR code D.

[0099] According to the graphic code recognition method provided in the embodiments of this application, by automatically recognizing the recognition content corresponding to the second target graphic code based on the user's second input when displaying the first display area 350 and the second display area 360, the user can recognize other graphic codes without exiting the current recognition interface and repeating the recognition operation. This effectively solves the problem of misrecognition operation and improves the accuracy and flexibility of graphic code recognition results. In addition, it significantly simplifies the operation steps, improves the recognition efficiency, and makes the operation simple and fast.

[0100] The implementation of step 120 will be explained in detail from two perspectives below.

[0101] I. Determined by scanning the region radius In some embodiments, step 120 may include: In response to the first input, a target region 340 is determined with the center point of the first region 330 as the center, and the radius of the target region 340 gradually increases; If the target area 340 completely covers one of the multiple graphic codes for the first time, the graphic code that is completely covered will be identified as the first target graphic code. Display the recognition content corresponding to the first target graphic code.

[0102] In this embodiment, the target region 340 is a circular region with the center point of the first region 330 as the center and the radius gradually increasing from 0, such as... Figure 7 The area shown is indicated by the circular dashed line.

[0103] In some embodiments, determining the target region 340 with the center point of the first region 330 as the center may include: determining the target region 340 with the center point of the first region 330 as the center and the target length as the radius, wherein the target length increases based on the unit increase in length.

[0104] In this embodiment, the target length is the current radius of the target region 340.

[0105] The target length is a variable value.

[0106] The unit increment is the target length increment for each step. The specific value can be user-defined or automatically determined by the electronic device based on the screen size or the size of the image to be recognized.

[0107] In actual implementation, the length can be increased in multiple increments, such as by increasing the length by a unit based on the previous radius at a fixed time interval, in order to ensure the operational efficiency of the electronic equipment.

[0108] For example, if a user wants to recognize QR code A310, the user long-presses as shown. Figure 7 Select the area near QR code A310 in the image to be recognized and choose the Smart Scan menu to perform the first input.

[0109] The electronic device responds to the first input, identifies the area that the user long-presses as the first region 330, and determines the coordinates (x, y) of the center point O of the first region 330. The electronic device is established with center point O as the center. Figure 7 The target area 340 is shown, and the radius of the target area 340 is gradually increased from 0 to gradually increase the area of ​​the target area 340; For example, the radius of the target area is increased by 340 in n steps, and the length is increased by r in each step, where n is a positive integer and r is greater than 0.

[0110] That is, the first search range is (x+r, y+r), the second search range is (x+2r, y+2r), and so on.

[0111] As the target area 340 increases, the electronic device judges the content covered by the target area 340 in real time until a complete graphic code is identified; if the target area 340 is determined to cover a graphic code for the first time, then the graphic code is identified as the first target graphic code.

[0112] like Figure 7 As shown, as the target area 340 gradually increases, the area where QR code A310 is located is the first to be completely covered, so QR code A310 is determined as the first target graphic code.

[0113] The electronic device automatically recognizes QR code A310 and displays the corresponding content, such as... Figure 5 As shown, the first display area 350 includes a QR code A310, and the second display area 360 includes a second target control for indicating the recognition of the QR code B320.

[0114] In some embodiments, after QR code A310 is displayed, if the user finds that the recognition content corresponding to QR code B320 needs to be displayed, they can click as shown. Figure 5 The second display area 360 shown is used to implement the second input.

[0115] In response to the second input, the electronic device continues to increase the radius of the target area 340 based on the determination of the first target graphic code, and judges the content covered by the target area 340 in real time until the second complete graphic code is recognized. If a target area 340 is determined to cover a certain graphic code for the second time, then that graphic code is identified as the second target graphic code.

[0116] like Figure 8 As shown, as the target area 340 gradually increases, it first covers the area where QR code A310 is located, and then covers the area where QR code B320 is located. Then, QR code B320 is identified as the second target graphic code.

[0117] The electronic device automatically recognizes QR code B320 and displays the corresponding content, such as... Figure 6 As shown, the first display area 350 includes a QR code B320.

[0118] Understandably, in the actual execution process, the center point of the first area 330 corresponding to the user's first input is used as the origin to establish a target area 340 with a gradually increasing radius to scan the screen, and the situation of the graphic code covered by the target area 340 is judged in real time. The graphic code covered for the first time is determined as the first target graphic code, the graphic code covered for the second time is determined as the second target graphic code, and so on, until the recognition content corresponding to the graphic code required by the user is displayed, and then the recognition stops.

[0119] In some embodiments, during the process of continuously expanding the target area 340, there may be a situation where the boundary of the target area 340 exceeds the screen boundary. In this case, determining the target area 340 with the center point of the first area 330 as the center may include: Based on the coordinates of the center of the circle and the length of the target, determine the boundary coordinates of the target area 340; If the boundary coordinates of the target region 340 exceed the boundary coordinates of the screen, continue to increase the target length and determine the boundary coordinates of the target region 340 as the boundary coordinates of the screen.

[0120] In this embodiment, a coordinate system can be established with the center point of the screen of the electronic device as the origin of the coordinate axis, and the x-axis and y-axis are parallel to a certain boundary of the screen.

[0121] like Figure 9 As shown, the origin of the coordinate system is (0,0), the intersection points of the screen boundary and the x-axis are (a,0) and (-a,0) respectively; the intersection points of the screen boundary and the y-axis are (0,b) and (0,-b) respectively, where a and b are both greater than 0.

[0122] The coordinates of the center point O of the target region 340 are (x, y), and the radius is nr, where n is the number of increments and r is the unit increment length, where n is a positive integer and r is greater than 0.

[0123] If any of the following conditions are met: x+nr>a, x-nr<-a, y+nr>b, and y-nr<-b, the electronic device continues to expand the target region 340 by increasing the radius by a unit length, and updates the boundary coordinates of the target region 340 that exceed the screen boundary to the screen boundary coordinates.

[0124] For example, if x+nr>a, the horizontal coordinate of the next displayed point will be the screen boundary coordinate 'a', and the vertical coordinate will still be the boundary coordinate of the target area 340, thus ensuring the normal calculation and display functions of the electronic device.

[0125] According to the graphic code recognition method provided in the embodiments of this application, the first target graphic code is determined by scanning the region radius. This method involves a small amount of computation and has low hardware requirements, which helps to improve the calculation speed and recognition efficiency.

[0126] II. Determined by the distance between center points In some embodiments, step 120 may include: In response to the first input, obtain the center coordinates of each graphic code among multiple graphic codes; Determine the distance between the center coordinates of each graphic code and the center point of the first region 330; The graphic code corresponding to the shortest distance is determined as the first target graphic code; Display the recognition content corresponding to the first target graphic code.

[0127] In this embodiment, for example, if a user wants to recognize QR code A310, the user long-presses as follows: Figure 10The area near QR code A310 in the image to be recognized is used as the first input.

[0128] The electronic device responds to the first input, identifies the area that the user long-presses as the first region 330, and determines the coordinates (x, y) of the center point O of the first region 330. At the same time, the electronic device will also determine the center coordinates of each graphic code in the image to be recognized. The center coordinates of QR code A310 are (x1, y1), and the center coordinates of QR code B320 are (x2, y2).

[0129] After obtaining the coordinates (x, y) of the center point O of the first region 330, the center coordinates (x1, y1) of QR code A310, and the center coordinates (x2, y2) of QR code B320, the electronic device calculates the distance d1 between the center coordinates of QR code A310 and the center point O of the first region 330, and the distance d2 between the center coordinates of QR code B320 and the center point O of the first region 330, respectively.

[0130] Then compare the sizes of d1 and d2; if d1 is the shortest, then the QR code A310 corresponding to d1 is determined as the first target graphic code.

[0131] The electronic device automatically recognizes QR code A310 and displays the recognition content corresponding to QR code A310. The first display area 350 includes QR code A310, and the second display area 360 includes a second target control for indicating the recognition of QR code B320.

[0132] In some embodiments, after QR code A310 is displayed, if the user finds that the recognition content corresponding to QR code B320 needs to be displayed, then click the second display area 360 to realize the second input.

[0133] In response to the second input, the electronic device, based on the determination of the first target graphic code, determines the graphic code whose distance from the center point of the first region 330 is only higher than the distance corresponding to the first target graphic code as the second target graphic code.

[0134] Taking the above embodiment as an example, if d2 is determined to be the second shortest distance, then the QR code B320 corresponding to d2 is directly determined as the second target graphic code.

[0135] The electronic device automatically recognizes the QR code B320 and displays the recognized content corresponding to the QR code B320, wherein the first display area 350 includes the QR code B320.

[0136] Understandably, in the actual execution process, the distance between the center point of the first region 330 corresponding to the user's first input and the center coordinates of each graphic code is calculated. The graphic code corresponding to the shortest distance is determined as the first target graphic code, the graphic code corresponding to the second shortest distance is determined as the second target graphic code, and so on, until the recognition content corresponding to the graphic code required by the user is displayed, and then the recognition stops.

[0137] The graphic code recognition method provided in the embodiments of this application determines the first target graphic code by comparing the distance between center points. This method has high computational accuracy and precision, which helps to improve the accuracy and precision of the recognition results, thereby improving the graphic code recognition effect.

[0138] The graphic code recognition method provided in this application can be executed by a graphic code recognition device. This application uses a graphic code recognition device executing the graphic code recognition method as an example to illustrate the graphic code recognition device provided in this application.

[0139] This application also provides a graphic code recognition device.

[0140] like Figure 11 As shown, the graphic code recognition device includes a first receiving module 1110 and a first processing module 1120.

[0141] The first receiving module 1110 is used to receive a first input on a first region of an image to be recognized, the image to be recognized including multiple graphic codes; The first processing module 1120 is used to respond to the first input and display the recognition content corresponding to the first target graphic code among multiple graphic codes; Among them, the first target graphic code is the graphic code that is closest to the first region among multiple graphic codes. According to the graphic code recognition device provided in the embodiments of this application, by automatically recognizing the graphic code that is closest to the first area where the first input is located among multiple graphic codes, and displaying the recognition content corresponding to the graphic code, in the scenario of recognizing multiple graphic codes in a single image, the graphic code that is closest to the user's input position can be automatically recognized without the user having to manually select the graphic code to be recognized, which significantly reduces the user's operation steps, improves recognition efficiency, and is simple, fast and easy to implement, which helps to improve the user experience.

[0142] In some embodiments, the first processing module 1120 may also be used to: display a first display area and a second display area, wherein the first display area includes the identification content corresponding to the first target graphic code, and the second display area is used to indicate the identification of other graphic codes.

[0143] In some embodiments, the device may further include: The second receiving module is used to receive a second input to the second display area after the first display area and the second display area have been displayed; The second processing module is used to respond to the second input and display the recognition content corresponding to the second target graphic code among multiple graphic codes. The second target graphic code is the graphic code that is second only to the first target graphic code in distance from the first region among multiple graphic codes.

[0144] In some embodiments, the first processing module 1120 may also be used for: In response to the first input, the target region is determined with the center point of the first region as the center, and the radius of the target region gradually increases; If the target area completely covers one of the multiple graphic codes for the first time, the graphic code that is completely covered is identified as the first target graphic code. Display the recognition content corresponding to the first target graphic code.

[0145] In some embodiments, the first processing module 1120 may also be used to: determine a target region with the center point of the first region as the center and the target length as the radius, wherein the target length increases based on the unit increase in length.

[0146] In some embodiments, the first processing module 1120 may also be used for: Determine the boundary coordinates of the target area based on the coordinates of the center and the target length; If the boundary coordinates of the target area exceed the boundary coordinates of the screen, continue to increase the target length and determine the boundary coordinates of the target area as the boundary coordinates of the screen.

[0147] In some embodiments, the first processing module 1120 may also be used for: In response to the first input, obtain the center coordinates of each graphic code among multiple graphic codes; Determine the distance between the center coordinates of each graphic code and the center point of the first region; The graphic code corresponding to the shortest distance is determined as the first target graphic code; Display the recognition content corresponding to the first target graphic code.

[0148] The graphic code recognition device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0149] The graphic code recognition device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0150] The graphic code recognition device provided in this application embodiment can achieve... Figures 1 to 10 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0151] Optionally, such as Figure 12 As shown, this application embodiment also provides an electronic device 1200, including a processor 1201, a memory 1202, and a program or instructions stored in the memory 1202 and executable on the processor 1201. When the program or instructions are executed by the processor 1201, they implement the various processes of the above-described graphic code recognition method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0152] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0153] Figure 13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0154] The electronic device 1300 includes, but is not limited to, components such as: radio frequency unit 1301, network module 1302, audio output unit 1303, input unit 1304, sensor 1305, display unit 1306, user input unit 1307, interface unit 1308, memory 1309, and processor 1310.

[0155] Those skilled in the art will understand that the electronic device 1300 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 13 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0156] The user input unit 1307 is used to receive a first input on a first region of an image to be recognized, the image to be recognized including multiple graphic codes; Processor 1310 is configured to respond to a first input and display the recognition content corresponding to a first target graphic code among a plurality of graphic codes; Among them, the first target graphic code is the graphic code that is closest to the first region among multiple graphic codes.

[0157] The electronic device provided in the embodiments of this application automatically identifies the graphic code that is closest to the first area where the first input is located among multiple graphic codes, and displays the recognition content corresponding to the graphic code. In the scenario of recognizing multiple graphic codes in a single image, the graphic code that is closest to the user's input position can be automatically recognized without the user having to manually select the graphic code to be recognized. This significantly reduces the user's operation steps, improves recognition efficiency, and is simple, fast and easy to implement, which helps to improve the user experience.

[0158] Optionally, the processor 1310 is also configured to display a first display area and a second display area, the first display area including the identification content corresponding to the first target graphic code, and the second display area being used to indicate the identification of other graphic codes.

[0159] Optionally, the user input unit 1307 is further configured to receive a second input to the second display area after displaying the first display area and the second display area; The processor 1310 is also configured to, in response to the second input, display the identification content corresponding to the second target graphic code among a plurality of graphic codes, wherein the second target graphic code is the graphic code that is second only to the first target graphic code in distance from the first region among the plurality of graphic codes.

[0160] Optionally, the processor 1310 is also used for: In response to the first input, the target region is determined with the center point of the first region as the center, and the radius of the target region gradually increases; If the target area completely covers one of the multiple graphic codes for the first time, the graphic code that is completely covered is identified as the first target graphic code. Display the recognition content corresponding to the first target graphic code.

[0161] Optionally, the processor 1310 is also configured to: determine a target region with the center point of the first region as the center and the target length as the radius, wherein the target length increases based on the unit increase in length.

[0162] Optionally, the processor 1310 is also used for: Determine the boundary coordinates of the target area based on the coordinates of the center and the target length; If the boundary coordinates of the target area exceed the boundary coordinates of the screen, continue to increase the target length and determine the boundary coordinates of the target area as the boundary coordinates of the screen.

[0163] Optionally, the processor 1310 is also used for: In response to the first input, obtain the center coordinates of each graphic code among multiple graphic codes; Determine the distance between the center coordinates of each graphic code and the center point of the first region; The graphic code corresponding to the shortest distance is determined as the first target graphic code; Display the recognition content corresponding to the first target graphic code.

[0164] It should be understood that, in this embodiment, the input unit 1304 may include a graphics processing unit (GPU) 13041 and a microphone 13042. The GPU 13041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1306 may include a display panel 13061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1307 includes a touch panel 13071 and at least one of other input devices 13072. The touch panel 13071 is also called a touch screen. The touch panel 13071 may include a touch detection device and a touch controller. Other input devices 13072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0165] The memory 1309 can be used to store software programs and various data. The memory 1309 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1309 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1309 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0166] Processor 1310 may include one or more processing units; optionally, processor 1310 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1310.

[0167] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described graphic code recognition method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0168] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0169] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described graphic code recognition method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0170] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0171] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes shown in the above-described method embodiments, and can achieve the same technical effects. To avoid repetition, it will not be described again here.

[0172] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0174] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for recognizing graphic codes, characterized in that, include: The system receives a first sub-input on a first region of the image to be recognized, and in response to the first sub-input, displays a first target control and a third target control. The first target control is a control for entering a smart barcode scanning menu scenario, and the third target control is a control for entering a non-smart barcode scanning menu scenario. The image to be recognized includes multiple graphic codes. The system receives a second sub-input to the first target control and, in response to the second sub-input, displays a first display area and a second display area. The first display area includes the recognition content corresponding to the first target graphic code, and the second display area is used to indicate the recognition of other graphic codes. In response to the first input, the center coordinates of each graphic code among the plurality of graphic codes are obtained, and the distance between the center coordinates of each graphic code and the center point of the first region is determined respectively. The first input includes the first sub-input and the second sub-input. The graphic code corresponding to the shortest distance is determined as the first target graphic code, and the recognition content corresponding to the first target graphic code is displayed; Based on the determination of the first target graphic code, the graphic code whose distance from the center point of the first region is only higher than the distance corresponding to the first target graphic code is determined as the second target graphic code, and the recognition content corresponding to the second target graphic code is displayed; or, A target region is defined with the center point of the first region as the center, and the radius of the target region gradually increases; If the target area completely covers one of the multiple graphic codes for the first time, the completely covered graphic code is identified as the first target graphic code, and the identification content corresponding to the first target graphic code is displayed in the first display area; wherein, the first target graphic code is the graphic code that is closest to the first area among the multiple graphic codes; Based on the determination of the first target graphic code, the radius of the target area is increased until a second complete graphic code is identified. The second complete graphic code is identified as the second target graphic code, and the identification content corresponding to the second target graphic code is displayed. If the radius of the target area is increased and the boundary coordinates of the target area exceed the boundary coordinates of the screen, the boundary coordinates of the target area are identified as the boundary coordinates of the screen.

2. The graphic code recognition method according to claim 1, characterized in that, After displaying the first display area and the second display area, the method includes: Receive a second input to the second display area; In response to the second input, the identification content corresponding to the second target graphic code among the plurality of graphic codes is displayed, wherein the second target graphic code is the graphic code among the plurality of graphic codes that is second only to the first target graphic code in distance from the first region.

3. The graphic code recognition method according to claim 1, characterized in that, The step of determining the target region with the center point of the first region as the center includes: The target region is defined with the center point of the first region as the center and the target length as the radius, wherein the target length increases with each unit increase in length.

4. The graphic code recognition method according to claim 3, characterized in that, The step of defining the target region with the center point of the first region as the center and the target length as the radius includes: Based on the coordinates of the center of the circle and the target length, determine the boundary coordinates of the target region; If the boundary coordinates of the target area exceed the boundary coordinates of the screen, the target length is increased further, and the boundary coordinates of the target area are determined as the boundary coordinates of the screen.

5. A graphic code recognition device, characterized in that, include: The first receiving module is used to receive the first sub-input of the first region on the image to be recognized; The first processing module is used to respond to the first sub-input and display a first target control and a third target control. The first target control is a control for entering the smart barcode scanning menu scenario, and the third target control is a control for entering the non-smart barcode scanning menu scenario. The image to be recognized includes multiple graphic codes. The first receiving module is configured to receive a second sub-input to the first target control; The first processing module is configured to respond to the second sub-input by displaying a first display area and a second display area, wherein the first display area includes the recognition content corresponding to the first target graphic code, and the second display area is used to indicate the recognition of other graphic codes; The first processing module is used for: A target region is defined with the center point of the first region as the center, and the radius of the target region gradually increases; If the target area completely covers one of the multiple graphic codes for the first time, the completely covered graphic code is identified as the first target graphic code, and the identification content corresponding to the first target graphic code is displayed in the first display area; wherein, the first target graphic code is the graphic code that is closest to the first area among the multiple graphic codes; Based on the determination of the first target graphic code, the radius of the target area is further increased until a second complete graphic code is identified. The second complete graphic code is identified as the second target graphic code, and the identification content corresponding to the second target graphic code is displayed. If the radius of the target area is increased and the boundary coordinates of the target area exceed the boundary coordinates of the screen, the boundary coordinates of the target area are identified as the boundary coordinates of the screen. or, The first processing module is used for: In response to the first input, the center coordinates of each graphic code among the plurality of graphic codes are obtained, and the distance between the center coordinates of each graphic code and the center point of the first region is determined respectively. The first input includes the first sub-input and the second sub-input. The graphic code corresponding to the shortest distance is determined as the first target graphic code, and the recognition content corresponding to the first target graphic code is displayed; Based on the determination of the first target graphic code, the graphic code whose distance from the center point of the first region is only higher than the distance corresponding to the first target graphic code is determined as the second target graphic code, and the recognition content corresponding to the second target graphic code is displayed.

6. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the graphic code recognition method as described in any one of claims 1-4.

7. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the graphic code recognition method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Coded image recognition method and electronic equipment

    CN111274842A

  • Method and device for reading two-dimensional code

    CN111652011A

  • Graphic code processing method and device

    CN113867863A