CN116050390A - Text processing method and electronic equipment - Google Patents

Text processing method and electronic equipment Download PDF

Info

Publication number
CN116050390A
CN116050390A CN202211055901.1A CN202211055901A CN116050390A CN 116050390 A CN116050390 A CN 116050390A CN 202211055901 A CN202211055901 A CN 202211055901A CN 116050390 A CN116050390 A CN 116050390A
Authority
CN
China
Prior art keywords
electronic device
text information
text
image
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211055901.1A
Other languages
Chinese (zh)
Inventor
宋新超
韩佳
丁一晏
黄文丽
刘瀚然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211055901.1A priority Critical patent/CN116050390A/en
Publication of CN116050390A publication Critical patent/CN116050390A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a text processing method and electronic equipment, and relates to the field of terminals, wherein the method comprises the following steps: the electronic device may extract one or more pieces of text information from the image, the one or more pieces of text information including the first text information. The electronic device may perform a first operation corresponding to the first text information in response to an input acting on the first text information display area. The electronic device may display content corresponding to a result of the first operation through the preview window. If the preview window displays the error prompt text information, the electronic device may modify the first text information in response to a user modification operation for the first text information.

Description

Text processing method and electronic equipment
Technical Field
The application relates to the field of terminals, in particular to a text processing method and electronic equipment.
Background
With the popularization of electronic devices and the development of terminal technology, users are increasingly accustomed to using electronic devices to handle various daily transactions. In a daily use scenario, an electronic device may often identify and extract text on an image in response to a user operation, and the user may copy, paste, modify, etc. the text extracted from the image.
However, based on current text recognition technology, electronic devices often recognize text on wrong images, that is, text recognized and extracted based on images tends to be inconsistent with the original text on the images. Thus, the electronic device needs to perform text correction on the text extracted from the image. However, the currently adopted text correction algorithm (for example, text correction algorithm based on neural network) has the problems of lower text correction accuracy, lower efficiency of correcting the error text into the correct text and higher calculation complexity.
Disclosure of Invention
The text processing method and the electronic device are capable of improving the error correction accuracy of the text, improving the efficiency of correcting the error text into the correct text, being lower in computational complexity and more convenient to operate, enabling the electronic device 100 to rapidly respond to input of a user, and achieving intention of the user based on the correct entity text.
In a first aspect, the present application provides a text processing method, including: the electronic device displays a first interface, wherein the first interface includes a first image including one or more pieces of text content including a first piece of text content. The electronic device extracts and displays one or more pieces of text information from the first image, wherein the extracted one or more pieces of text information comprise first text information. The first text information is text information which is identified and extracted at the position of the first image based on the first text content. In response to a first input acting on a display area of the first text information, the electronic device performs a first operation corresponding to the first text information and displays a second interface. When the electronic equipment displays error prompt text information in the second interface, responding to modification operation for the first text information, the electronic equipment simultaneously displays an editing window and an editing box, wherein the first text information and a confirmation control are displayed in the editing box, and the first text information is compared with the first text content in the first image. In response to an editing input acting in the editing window, the electronic device modifies the first text information in the editing box to second text information based on the first text content. Wherein the content of the second text information is the same as the first text information. In response to a second input acting on the confirmation control, the electronic device performs a second operation. And responding to the second operation, and displaying the content corresponding to the second text information in the second interface by the electronic equipment.
In one possible implementation, before the electronic device displays the first interface, the method further includes: the electronic device displays a desktop that includes icons of one or more applications, the icons of the one or more applications including icons of a first application. In response to a third input acting on an icon of the first application, the electronic device displays a preview of one or more images, the preview of one or more images including a preview of the first image. The electronic device displays the first interface in response to a fourth input acting on the preview of the first image.
In one possible implementation manner, the first interface includes a text recognition control, the electronic device extracts and displays one or more pieces of text information from the first image, and the extracted one or more pieces of text information include first text information, which specifically includes: in response to a fifth input on the text recognition control, the electronic device extracts and displays one or more pieces of text information from the first image via an OCR algorithm, the extracted one or more pieces of text information including the first text information.
In one possible implementation, before the electronic device performs the first operation corresponding to the first text information and displays the second interface in response to the first input acting on the display area of the first text information, the method further includes: the electronic device determines and displays a text type of the first text information.
In one possible implementation manner, in response to the second operation, the electronic device displays content corresponding to the second text information in the second interface, and specifically includes: the second interface includes a preview window. And responding to the second operation, and displaying the content corresponding to the second text information in the preview window by the electronic equipment.
In one possible implementation manner, in response to the second operation, the electronic device displays content corresponding to the second text information in the second interface, where the method further includes: in response to a sixth input acting on the preview window, the electronic device displays a third interface. Wherein the content displayed in the third interface includes content displayed in the preview window.
In a second aspect, an embodiment of the present application provides an electronic device, including: one or more processors, one or more memories, and a display screen. The one or more memories are coupled with one or more processors, the one or more memories being operable to store computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of the possible implementations of the first aspect.
In a third aspect, embodiments of the present application provide a computer-readable storage medium comprising computer instructions that, when run on an electronic device, cause the electronic device to perform the method of any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a chip or chip system, including a processing circuit and an interface circuit for receiving code instructions and transmitting to the processing circuit, the processing circuit for executing the code instructions to perform a method in any one of the possible implementations of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product, which when run on an electronic device, causes the electronic device to perform the method of any one of the possible implementations of the first aspect.
Drawings
FIGS. 1A-1I are a set of user interface diagrams provided in embodiments of the present application;
FIGS. 2A-2G are a set of user interface diagrams provided in an embodiment of the present application;
FIG. 2H is a flowchart of a highlighting/magnifying display according to an embodiment of the present application;
FIG. 2I is a schematic diagram of a user interface provided in an embodiment of the present application;
Fig. 3A is a specific flow diagram of a text processing method according to an embodiment of the present application;
FIG. 3B is a schematic flow chart for identifying and extracting one or more pieces of text information according to an embodiment of the present application;
fig. 4 is a schematic hardware structure of an electronic device 100 according to an embodiment of the present application;
fig. 5 is a schematic software framework of the electronic device 100 according to the embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application to the specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this application is meant to encompass any or all possible combinations of one or more of the listed items. In the present embodiments, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In some embodiments, when the electronic device performs recognition and extraction of text from an image in response to user input, the electronic device may recognize text in the image that has a particular meaning, such as: a person name, place name, organization, date, web address, telephone number, etc., this type of text recognition may be referred to as entity recognition, and the above text having a specific meaning may be referred to as entity text. The electronic device may then perform corresponding operations based on the entity text extracted by the entity recognition, such as: displaying the related content of the text, jumping to the web page corresponding to the website, and the like.
However, when the electronic device performs entity recognition, entity text on the wrong image is often recognized, that is, entity text extracted from the image often does not match original entity text on the image, so that the electronic device cannot perform corresponding operations based on the entity recognition extracted entity text, for example: the related content of the text cannot be displayed, the web page corresponding to the website cannot be jumped to, and the like.
Accordingly, the present application provides a text processing method. The method can be applied to electronic equipment such as mobile phones, tablet computers and the like. The electronic device 100 is subsequently used in a unified manner to represent the above-described electronic device.
Not limited to a cell phone, tablet computer, electronic device 100 may also be a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular telephone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) device, a Virtual Reality (VR) device, an artificial intelligence (artificial intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device, and/or a smart city device, and the specific type of electronic device 100 is not particularly limited in the embodiments of the present application.
Specifically, when the electronic device 100 displays the image a (may also be referred to as a first image), and in response to a user text recognition input for the image a, the electronic device 100 may recognize and extract text in the image a, and the text recognized and extracted from the image a may include solid text. When the electronic device 100 cannot perform a corresponding operation (e.g., cannot jump to a web page corresponding to a web address, display an introduction related to an organization, etc.) based on the extracted entity text, that is, the extracted entity text has an error, the electronic device 100 may display an editing window in a user interface that displays part or all of the content of the image a. The electronic device 100 may modify the incorrect entity text to the correct entity text, i.e. coinciding with the original entity text in image a, in response to the user acting on the editing input in the editing window. The electronic device 100 may perform a corresponding operation (e.g., skip to a web page corresponding to a web site, display an organization-related introduction, etc.) based on the correct entity text. For the description of the entity text, reference may be made to the foregoing description, and no further description is given here.
From the above flow, it can be seen that the text processing method provided by the present application can improve the correction accuracy of the text, improve the efficiency of correcting the error text into the correct text, and have lower calculation complexity and more convenient operation, so that the electronic device 100 can quickly respond to the input of the user, and realize the intention of the user based on the correct entity text.
An application scenario of the text processing method provided in the embodiment of the present application is described below with reference to the user interfaces exemplarily shown in fig. 1A to 1I.
As shown in fig. 1A, the electronic device 100 may display a desktop 10. The desktop 10 may display one or more application icons. The one or more application icons may include, among other things, a weather application icon, a stock application icon, a calculator application icon, a settings application icon, a mail application icon, a video application icon, a calendar application icon, and a gallery application icon 101. Optionally, the desktop 10 may also display status bars, page indicators, and tray icon areas. The status bar may include, among other things, one or more signal strength indicators of a mobile communication signal (which may also be referred to as a cellular signal), a signal strength indicator of a wireless fidelity (wireless fidelity, wi-Fi) signal, a battery status indicator, a time indicator, and so forth. The page indicator may be used to indicate the positional relationship of the currently displayed page with other pages. The tray icon area includes a plurality of tray icons (e.g., a dial application icon, an information application icon, a contact application icon, a camera application icon, etc.) that remain displayed when the page is switched. The page may also include a plurality of application icons and page indicators, which may be separate from the page, and the tray icons may also be optional, which is not limited in this embodiment of the present application.
In response to a touch operation (which may also be referred to as a third input, e.g., a click) acting on gallery application icon 101, electronic device 100 may display a gallery interface.
As shown in fig. 1B, the electronic device 100 may display a library interface 110. The gallery interface 110 may include a preview of one or more images. The preview of the one or more images may include a preview of image 111 (i.e., image a described above).
In response to a touch operation (which may also be referred to as a fourth input, e.g., a click) acting on the preview of the image 111, the electronic device 100 may display an image interface (which may also be referred to as a first interface).
As shown in fig. 1C, the electronic device 100 may display an image interface 120. Image interface 120 may include one or more pieces of textual content in image 111. For example, image interface 120 may display text content included in image 111: "19:24", "account and security", "account", "cell phone number", "password" and "http:// www.***.com" (which may also be referred to as first text content), etc. It will be appreciated that the area of image 111 displayed in image interface 120 is larger than the preview area of image 111 in gallery interface 110. A control 121 may also be included in the image interface 120 for receiving a touch operation (e.g., a click) acted upon by a user such that the electronic device 100 may identify and extract a corresponding piece or pieces of text information from the image 111 based on the piece or pieces of text content of the image 111 in response to the touch operation.
In response to a touch operation (which may also be referred to as a fifth input, e.g., click) acting on control 121 (which may also be referred to as a text recognition control), electronic device 100 may recognize and extract one or more pieces of text information from image 111.
As shown in fig. 1D, the electronic device 100 may display a text recognition interface 130. The text recognition interface 130 may include text information that the electronic device 100 recognizes and extracts from the image 111, such as: "19:24", "account and security", "account", "toll-Roxie", "cell phone number", "189283726354", "password", "set", "sound lock", "unset", "contact us", "http:// www.baidv.com", and "login device management", etc. The text information may be highlighted in the text recognition interface 130, for example. An area 131 comprising the text "http:// www.baidv.com" (which may also be referred to as first text information) may be highlighted in the text recognition interface 130. Where the text "http:// www.baidv.com" is a web address, i.e. the entity text as described above, the electronic device 100 may set a first identifier for it, which may be underlined, as indicated by the text recognition interface 130. In some examples, the first identifier may also be other symbols, such as a star symbol, a box symbol, or a circle symbol, to which the present application is not limited. It should be noted that, in the embodiment of the present application, the electronic device 100 may identify and extract one or more pieces of text information from the image 111 through an optical character recognition (optical character recognition, OCR) algorithm. The specific implementation will be described in detail later, and will not be described in detail here. It will be appreciated that before the electronic device 100 displays the text information identified and extracted from the image 111, the electronic device 100 may correct the form error in the extracted one or more pieces of text information by using a specified algorithm, and the detailed implementation will be described later.
In response to a touch operation (e.g., clicking) acting on the region 131, the electronic device 100 may access a corresponding web page based on the web address "http:// www.baidv.com" and display corresponding content based on the result of the web page access.
As shown in FIG. 1E, the electronic device 100 may display the preview interface 140 when accessing a corresponding web page based on the web address "http:// www.baidv.com". In the preview interface 140, the electronic device 100 may display a preview window 141. The preview window 141 may include the results of the electronic device 100 accessing the web page based on the web address described above. For example, in some examples, when the electronic device 100 successfully accesses a corresponding web page based on "http:// www.baidv.com," the electronic device 100 may display the content of the web page in the preview window 141. In still other examples, when the electronic device 100 fails to access the web page based on the web address "http:// www.baidv.com", the electronic device 100 may display the error prompt text information in the preview window 141.
For example, taking a web page access failure as shown in fig. 1E, when the electronic device 100 fails to access a web page based on the website "http:// www.baidv.com", the web page corresponding to the website does not exist, so that the electronic device 100 cannot display the web page in the preview window 141, the electronic device 100 may display error prompt text information, such as "404 noticable" and "web page does not exist", in the preview window 141. It should be noted that when the electronic device 100 fails to access the web page based on the web address "http:// www.baidv.com", the web address may be referred to as erroneous entity text. In particular, the touch operation acting on the area 131 may be an operation of clicking on the first mark (i.e., underlining). In other examples, the touch operation applied to the area 131 may be an operation of touching an arbitrary position of the area 131, which is not limited in this application.
As shown in FIG. 1F, when the electronic device 100 fails to access the web page based on the web address "http:// www.baidv.com", the electronic device 100 may display an operation window 142 on the preview interface 140. The operations window 142 may display a website "http:// www.baidv.com", one or more options (e.g., an "open in browser" option, a "collect the website" option, a "save to memo" option, a "copy" option, and a "share option", etc.), and an edit control 142A, etc.
It will be appreciated that in addition to the absence of a web page corresponding to a web site, failure to access the web page may be for other reasons, such as: access to the web page corresponding to the web address is prohibited, which is not limited in this application.
In some examples, when electronic device 100 may successfully access a web page based on a web address identified and extracted from image a (e.g., image 111) and may display the web page in a preview window (e.g., preview window 141 described previously), electronic device 100 may not necessarily display an operation window (e.g., operation window 142 described previously) in a preview interface (e.g., preview interface 140 described previously).
In response to a touch operation (e.g., clicking) on the edit control 142A, the electronic device 100 can display an edit window and an edit box in the image interface. The image interface is the user interface that displays part or all of the content of the image a.
It should be noted that a touch operation (e.g., click) acting on the editing control 142A may be referred to as a modification operation for the first text information.
As shown in fig. 1G, the electronic device 100 may display an edit window 122 and an edit box 122A in the image interface 120. The edit window 122 and edit box 122A may be displayed below the original web site "http:// www.baid u.com" area in the image 111. Among other things, the web site "http:// www.baidv.co m", cursor 122C, and confirmation control 122D identified and extracted from image 111 based on the display area of text content "http:// www.***.com" in image 111 may be displayed in edit box 122A. The editing window 122 may be used to receive input from a user acting on one or more character keys thereon (e.g., a "1" character key, a "2" character key, a "q" character key, a "w" character key, etc.). The electronic device 100 may display the corresponding character in the edit box 122A in response to the user's input to one or more character keys.
In response to the edit input acting in the edit window 122, the electronic device 100 may modify the incorrect entity text "http:// www.baidv.com" in the edit box 122A to the correct entity text "http:// www.***.com".
As shown in fig. 1H, the electronic device 100 may receive input for one or more character keys on the editing window 122. In response to the above-described input, the electronic device 100 may display the corresponding character in the edit box 122A, modifying the incorrect entity text "http:// www.baidv.com" to the correct entity text "http:// www.***.com". The correct physical text "http:// www.***.com" coincides with the original web site "http:// ww w.***.com" shown in the image 111. At this time, the cursor 122C may be located in the middle of the character "u" and the character "". Wherein an input to one or more character keys on the editing window 122 may be referred to as an editing input.
In response to a touch operation (e.g., clicking) on the confirmation control 122D, the electronic device 100 may access the corresponding web page based on the correct entity text "http:// www.***.com" and display the corresponding content based on the results of the web page access.
As shown in FIG. 1I, the electronic device 100 may display the preview interface 140 when accessing a corresponding web page based on the correct physical text "http:// www.***.com". The preview interface 140 may include a preview window 141 and an operation window 142. For descriptions of the preview window 141 and the operation window 142, reference may be made to the foregoing descriptions, and no further description is given here. When the electronic device 100 can successfully access the corresponding web page based on the correct entity text "http:// www.***.com", the preview window 141 can display the corresponding web page content. At this time, the correct entity text "http:// www.***.com" may also be displayed in the operation window 142.
It should be noted that the above-described series of user interfaces are merely exemplary for explaining the embodiments of the present application, and do not limit the present application in any way.
Next, another application scenario of the text processing method provided in the embodiment of the present application will be described in conjunction with the user interfaces partially illustrated in fig. 1A to 1I and the user interfaces exemplarily illustrated in fig. 2A to 2I.
The electronic device 100 may display a desktop. The table top may be the table top 10 of fig. 1A described above. For a description of the desktop 10 and related content, reference may be made to the foregoing description, which is not repeated herein.
In response to a touch operation (e.g., a click) on gallery application icon 101 in fig. 1A, electronic device 100 may display a gallery interface.
The gallery interface may be the gallery interface 110 of fig. 1B described above. For the description of the gallery interface 110 and related content, reference may be made to the foregoing description, which is not repeated herein.
In response to a touch operation (e.g., a click) acting on the preview of the image 111 in fig. 1B, the electronic device 100 may display an image interface.
The image interface may be the image interface 120 of fig. 1C described previously. For the description of the image interface 120 and related content, reference may be made to the foregoing description, and the description is omitted herein.
In response to a touch operation (e.g., clicking) on control 121 in fig. 1C, electronic device 100 can identify and extract one or more pieces of text information from image 111.
The electronic device 100 may display the one or more pieces of text information identified and extracted from the image 111 at the text recognition interface 130 in fig. 1D. The text recognition interface 130 and the description of the related content can refer to the foregoing description, and will not be repeated here.
In response to a touch operation (e.g., clicking) acting on the region 131 in fig. 1D, the electronic device 100 may access a corresponding web page based on the web address "http:// www.baidv.com" and display corresponding content based on the result of the web page access.
As shown in FIG. 2A, the electronic device 100 may display the preview interface 200 when accessing a corresponding web page based on the web address "http:// www.baidv.com". The preview interface 200 may include a preview window 201 and an edit box 202. For the description of the preview window 201, reference may be made to the description of the preview window 141 in fig. 1E, which is not repeated here. The edit box 202 may display the website "http:// www.baidv.com". The edit box 202 may include a validation control 202A. When the electronic device 100 fails to access the web page based on the website "http:// www.baidv.com", the web page corresponding to the website does not exist, so that the electronic device 100 cannot display the web page in the preview window 201, the electronic device 100 may display error prompt text information, such as "404 notified" and "web page does not exist", in the preview window 201. The preview window 201 may be displayed below the original web site "http:// www.***.com" area in the image 111. It should be noted that when the electronic device 100 fails to access the web page based on the web address "http:// www.baidv.com", the web address may be referred to as erroneous entity text.
When the electronic device 100 fails to access the web page based on the web address "http:// www.baidv.com", the electronic device 100 may receive a touch operation (e.g., double click) on the edit box 202.
As shown in fig. 2B, in response to the above touch operation, the electronic apparatus 100 may enlarge and display the edit box 202 in the preview interface 200 and display the edit window 203 in the preview interface 200. The edit box 202 may display a cursor 202B. The edit window 203 may be displayed below the region of the edit box 202, and the edit box 202 may be displayed below the region of the original website "http:// www.***.com" in the image 111. For the description of the editing window 203, reference may be made to the foregoing description of the editing window 122, which is not repeated here. It is understood that the preview interface 200 is the aforementioned user interface that displays part or all of the content of the image a.
It should be noted that a touch operation (e.g., double click) acting on the edit box 202 may be referred to as a modification operation for the first text information.
In response to the editing input acting in the editing window 203, the electronic device 100 may modify the incorrect entity text "http:// www.baidv.com" in the editing box 202 to the correct entity text "http:// www.***.com".
As shown in fig. 2C, the electronic device 100 may receive input acting on one or more character keys on the editing window 203. In response to the above-described input, the electronic device 100 may display the corresponding character in the edit box 202, modifying the erroneous entity text "http:// www.baidv.com" to the correct entity text "http:// www.***.com". The correct physical text "http:// www.***.com" coincides with the original web site "http:// ww w.***.com" shown in the image 111. At this point, cursor 202B may be located in the middle of character "u" and character "". Wherein an input to one or more character keys on the editing window 203 may be referred to as an editing input.
In response to a touch operation (e.g., clicking) on the confirmation control 202A, the electronic device 100 may access a corresponding web page based on the correct entity text "http:// www.***.com" and display corresponding content based on the results of the web page access.
As shown in fig. 2D, when the electronic device 100 can successfully access a corresponding web page based on the correct entity text "http:// www.***.com", the preview window 201 can display the corresponding web page content. At this point, the correct physical text "http:// www.***.com" may be displayed in the edit box 202.
It should be noted that the above-described series of user interfaces are merely exemplary for explaining the embodiments of the present application, and do not limit the present application in any way.
In some examples, when the electronic device 100 may successfully access the web page, the electronic device 100 may display a web page interface (may also be referred to as a third interface) in response to a touch operation (may also be referred to as a sixth input) acting on the preview window. The content displayed on the web page interface may include content displayed in a preview window.
For example, when the electronic device 100 may successfully access the corresponding web page based on the correct entity text "http:// www.b aid.com" as shown in fig. 2D, and the preview window 201 displays the corresponding web page content, the electronic device 100 may respond to a touch operation (e.g., click) acting on the preview window 201 as shown in fig. 2E. In response to the touch operation, as shown in fig. 2F, the electronic device 100 may display a web page interface 210. The content displayed in the web interface 210 may include content displayed in the preview window 201, among others.
In some examples, when electronic device 100 identifies and extracts one or more pieces of text information from image a via an OCR algorithm, where the one or more pieces of text information include first text information, electronic device 100 may obtain a confidence level for each character and/or symbol in the first text information. When the confidence level of the character is below a specified threshold B (e.g., 0.6, 0.7, etc.), the electronic device 100 may highlight and/or zoom in to display the character.
As shown in FIG. 2G, when the electronic device 100 recognizes and extracts one or more pieces of text information from the image 111 through an OCR algorithm, the electronic device 100 may obtain a confidence level for each character and/or symbol in the first text information "http:// www.baidv.com". When the confidence levels of the characters "B", "a", "i", "d", "v" are all below a specified threshold B (e.g., 0.6, 0.7, etc.), the electronic device 100 may highlight "baidv".
In some examples, when electronic device 100 recognizes and extracts one or more pieces of text information from image a through an OCR algorithm, electronic device 100 may obtain coordinates of each character in the text information. Based on the coordinates of each character, electronic device 100 may obtain the location of each character in the image. Accordingly, the electronic device 100 may obtain the coordinates of each character in the first text information, and obtain the position of each character in the first text information in the image a based on the coordinates of each character in the first text information. When the first text information and the cursor are displayed in the edit box, the electronic device 100 may obtain a character corresponding to the position of the cursor in the edit box, and based on coordinates of the character, perform enlarged display and/or highlight display on a corresponding position area in the image a. The electronic device 100 may then modify the first text information based on content included in the enlarged display and/or the highlighted location.
Illustratively, as shown in FIG. 2H, the electronic device 100 displays a first text message and a cursor through an edit box, the first text message including one or more characters, the one or more characters including a first character. The electronic device 100 may obtain a character corresponding to the position of the cursor in the edit box, where the character is the first character. Since the electronic device 100 may acquire the coordinates of the first character at the time of the aforementioned extraction of the first text information, the electronic device 100 may acquire the position of the first character in the image a based on the coordinates of the first character. The electronic device 100 may zoom in and/or highlight the location. The electronic device 100 may then modify the first text information based on content included in the enlarged display and/or the highlighted location.
As shown in fig. 2I, when the electronic device 100 recognizes and extracts one or more pieces of text information from the image 111 through the OCR algorithm, the electronic device 100 may acquire coordinates of each character in the text information. Based on the coordinates of each character, electronic device 100 may obtain the location of each character in image 111. Thus, the electronic device 100 may obtain the coordinates of each character in the first text message "http:// www.baidv.com" and obtain the position of each character in the first text message in the image 111 based on the coordinates of each character in the first text message. When the first text information "http:// www.baidv.com" and the cursor 122C are displayed in the edit box 122A, the electronic device 100 may obtain that the character corresponding to the position of the cursor 122C in the edit box 122A is "v". The electronic device 100 has acquired the coordinates of the character "v", and acquires the position of the character "v" in the image a as the position of the character "u" based on the coordinates (that is, the electronic device 100 recognizes the character "v" based on the character "u"), and the electronic device 100 may display the position of the character "u" in an enlarged manner. The electronic device 100 may then modify the first text information based on content included in the location of the enlarged display.
Next, a specific flow of the text processing method provided in the embodiment of the present application is described in conjunction with the foregoing user interface example.
Referring to fig. 3A, fig. 3A schematically illustrates a specific flow chart of a text processing method according to an embodiment of the present application.
As shown in fig. 3A, the specific flow of the method may be as follows:
s301. the electronic device 100 displays an image interface, which includes an image a, where the image a includes one or more pieces of text content, and the one or more pieces of text content include a first text content.
The first text content may be an entity text, and the description of the entity text may refer to the foregoing description and is not repeated herein. Here, taking the example that the first text content is a web address as an example, a specific flow of the text processing method provided in the embodiment of the present application will be described.
Illustratively, in connection with the user interface example described above, the image interface may be the image interface 120 described above and illustrated in fig. 1C, the image a may be the image 111 described above and illustrated in fig. 1C, and the one or more pieces of text content included in the image a may be the text content included in the image 111 described above and illustrated in fig. 1C, for example: "19:24", "account and security", "account", "cell phone number" and "password", etc. The first text content included in the one or more pieces of text content may be "http:// www.***.com".
S302, the electronic device 100 may identify and extract one or more pieces of text information from the image A based on a location of the one or more pieces of text content in the image A, where the one or more pieces of text information include the first text information.
The electronic device 100 may identify and extract one or more pieces of text information from the image a based on where the one or more pieces of text content are located in the image a through an OCR algorithm. The first text information may also be a solid text, and the first text information is text information that the electronic device 100 recognizes and extracts based on the location of the aforementioned first text content in the image a. Here, taking the example that the first text message is a web address as an example, a specific flow of the text processing method provided in the embodiment of the present application will be described. Illustratively, in connection with the user interface examples described above, the electronic device 100 may identify and extract one or more pieces of text information from the image 111 (i.e., image a) in response to a touch operation on the control 121. The first text information may be "http:// www.baidv.com" as shown in fig. 1D above.
Specifically, as shown in fig. 3B, the following describes an implementation manner in which the electronic device 100 recognizes and extracts one or more pieces of text information from the image a through the OCR algorithm:
1) The electronic device 100 pre-processes the image a.
First, when the image a is a color image, the electronic device 100 may perform binarization processing on the image a so that the image a exhibits a black-and-white effect. The binarization processing refers to: the gray value of the pixel point on the image a is set to 0 or 255. Specifically, the electronic device 100 may perform binarization processing on the image a by a global threshold (global method) algorithm or a local threshold (localmethod) algorithm.
Next, the electronic device 100 may perform image denoising on the binarized image a to obtain a clear image a. Wherein, image denoising refers to: removing noise (which may also be referred to as noise) on image a. Noise refers to: the random, discrete, isolated pixels appearing on image a are typically significantly different from their neighboring pixels, e.g., white pixels in the black region, black pixels in the white region, etc. The appearance of noise may cause image a to exhibit a more blurred visual effect. Specifically, the electronic device 100 may perform image denoising on the image a by using a median filter, an adaptive wiener filter, or non-local self-similarity (NSS), or the like.
Then, since there is an operation of causing text on the image a to tilt from the center horizontal line of the image a during scanning or photographing the image a, the electronic device 100 may perform tilt correction processing on the image a subjected to image denoising such that the text direction on the image a is parallel to the center horizontal line of the image a. Specifically, the electronic apparatus 100 may perform tilt correction on the image a by means of a hough transform algorithm, a pull (Randon) transform algorithm, or a method based on principal component analysis (principal compon ent analysis, PCA), or the like.
2) The electronic device 100 performs text detection on the preprocessed image a.
Wherein, text detection refers to: the display area of the text content in the image a is detected, that is, all positions where the text content appears in the image a are detected. Specifically, the electronic device 100 may perform text detection on the preprocessed image a by connecting to a dominant text extraction network (connectionist text proposal network, CTPN) algorithm, a Seglink algorithm, or a high-efficiency accurate scene text (efficientand accuracy scene text, EAST) algorithm.
3) The electronic device 100 recognizes and extracts one or more pieces of text information based on the text-detected image a.
Specifically, the electronic device 100 may identify and extract one or more pieces of text information from the display area of the text content in the image a detected in the above steps by means of a neural network based time series class classification (conectionisttemporal c lassification, CTC) text recognition algorithm, a Sequence-to-Sequence (2 Sequence) text recognition algorithm, or an attention mechanism (attention) text recognition algorithm. Meanwhile, when the electronic device 100 recognizes and extracts one or more pieces of text information, the electronic device 100 may obtain a confidence level of each character and/or symbol in the text information.
It should be understood that the implementation of the electronic device 100 to identify and extract one or more pieces of text information from the image a through the OCR algorithm is merely used to exemplarily explain the present application, and in practical applications, the electronic device 100 may also identify and extract one or more pieces of text information from the image a through other manners, which is not limited in this application.
S303, optionally, the electronic device 100 may detect a form error included in the first text information through a specified algorithm, and modify the form error in the first text information.
First, the first mapping table may be stored in the electronic device 100 in advance. Wherein the first mapping table may be used for recording: one or more form error types, and a modification mode corresponding to each form error type. The first mapping table may be as shown in table 1:
TABLE 1
Figure BDA0003825323290000111
Based on the description in table 1, the specific form error type and the corresponding modification manner of each form error type:
1) The first text information includes a specified symbol, the electronic device 100 deletes the specified symbol.
For example, if the first text message "http:// www.***.com/main. Html" includes a space, the electronic device 100 deletes the space; if the first text information "http:// www.***.com/main. Html" includes a TAB symbol, the electronic device 100 deletes the TAB symbol; if the first text information "http:// αβγδ www.***.com/main. Html" includes the special symbol "αβγδ", the electronic device 100 deletes the special symbol. The above-described space, TAB symbol, and special symbol are only examples, and the specified symbol may also include other symbols, which are not particularly limited in this application.
2) The first text information includes a full character, the electronic device 100 modifies the full character to a half character.
For example, if the first text information is "http:// www.***. com/main. Html "includes full angle characters. The electronic device 100 modifies the full character to a half character "".
3) If the key characters and/or key symbols in the first text information are in wrong form, the electronic device 100 modifies the key characters in wrong form into correct key characters and/or modifies the key symbols into correct key symbols.
For example, if the key character "wxw" in the first text information "http:// wxw.***.com/main.html" has a formal error, the electronic device 100 modifies the formal error key character "wxw" to the correct key character "www"; if the key symbol "\" in the first text information "http:// wxw.***.com\main.html" has a formal error, the electronic device 100 modifies the formal error key symbol "\" to the correct key symbol "/".
It should be noted that the foregoing types of form errors and corresponding modifications of the types of form errors are merely used to exemplarily explain the present application, and in a specific implementation manner, the first mapping table may further include other types of form errors and corresponding modifications, which are not limited in this application.
Specifically, after the electronic device 100 recognizes and extracts one or more pieces of text information based on the image a, the electronic device 100 may segment and cut the one or more pieces of text information, and then, the electronic device 100 may match the text information of each piece with a preset first regular expression. After the electronic device 100 determines that the first text information may be successfully matched with the first regular expression, the electronic device 100 may detect whether the first text information includes a formal error type in the first mapping table. It should be noted that, in the embodiment of the present application, taking the regular expression that the first regular expression is used to identify whether the first text information is a website as an example, after the first text information can be successfully matched with the first regular expression, the electronic device 100 may determine that the first text information is a website.
Next, when the electronic device 100 detects that the form error type in the first text information is included in the first mapping table, the electronic device 100 may modify the form error in the first text information based on the modification manner corresponding to the form error type in table 1.
S304. the electronic device 100 displays a text recognition interface, where the text recognition interface may include one or more pieces of text information identified and extracted from the image a, where the one or more pieces of text information include the first text information.
Illustratively, in connection with the user interface example described above, the text recognition interface may be the text recognition interface 130 described above and shown in FIG. 1D; image a may be image 111 in the user interface example previously described; the one or more pieces of text information identified and extracted from the image a by the electronic device 100 may be "19:24", "account and security", "account" and "Chill-Roxie" in the text identification interface 130 shown in FIG. 1D, etc.; the first text information displayed in the text recognition interface may be "http:// www.baidv.com" as previously described with respect to the text recognition interface 130 of FIG. 1D.
S305, the electronic device 100 determines and displays the text type of the first text information.
Specifically, after the electronic device 100 identifies and extracts one or more pieces of text information from the image a, the electronic device 100 may segment and cut the one or more pieces of text information, and then, the electronic device 100 may match each piece of text with a preset first regular expression. When the electronic device 100 determines that the first text information can be successfully matched with the first regular expression, the electronic device 100 may display a corresponding first identifier at a location where the first text information is located. It should be noted that, in the embodiment of the present application, taking the regular expression of the first regular expression for identifying whether the first text information is a website as an example, when the first text information can be successfully matched with the first regular expression, the electronic device 100 may determine that the first text information is the website, and then the electronic device 100 may display a corresponding first identifier, for example, an underline, at the location where the first text information is located.
Text types may include: web addresses, and/or numbers, and/or english letters, etc.
For example, in connection with the foregoing user interface example, after the electronic device 100 identifies and extracts one or more pieces of text information from the image 111 (i.e., the image a), the electronic device 100 may segment the one or more pieces of text information, and then, the electronic device 100 may match each piece of text information with a preset first regular expression. The preset first regular expression can be used for searching a website in the text information. When the electronic device 100 determines that the first text message "http:// www.baidv.com" can be successfully matched with the first regular expression, the electronic device 100 may determine that the first text message is a web address, and thus, the electronic device 100 may display a corresponding first identifier at a location of the first text message, where the first identifier may be an underline as shown in fig. 1D.
It can be appreciated that the electronic device 100 may perform line cutting on the one or more pieces of text information identified and extracted from the image a, or, in other words, the cutting manner of the text by the electronic device 100 is not limited in this embodiment of the present application.
S306. in response to the first input acting on the display area of the first text information, the electronic device 100 performs a first operation corresponding to the first text information.
Preferably, the first text information may be a web address, the first input acting on the display area of the first text information may be an operation of clicking on the first identifier, and the first operation may be an operation of causing the electronic device 100 to access a corresponding web page based on the first text information. It will be appreciated that the above preferred examples are for illustrative purposes only and are not meant to be limiting in any way.
Illustratively, in connection with the user interface example described above, the first text message may be "http:// www.baidv.com" as shown in the text recognition interface 130 of FIG. 1D described above. The display area of the first text information may be the area 131 shown in fig. 1D, and the first input acting on the display area of the first text information may be an operation of clicking on an underline (i.e., a first logo) in the area 131 shown in fig. 1D. In response, the electronic device 100 may access the corresponding web page based on "http:// www.baidv.com".
S307. when the electronic device 100 performs the first operation, the electronic device 100 may display a preview interface (may also be referred to as a second interface). The electronic device 100 displays content corresponding to the result of the first operation in the preview interface based on the result of the first operation.
Preferably, the preview interface may include a preview window. When the first text information is a web address and the first operation is that the electronic device 100 accesses a corresponding web page based on the first text information, the result of the electronic device 100 performing the first operation may be as follows: the corresponding web page content is successfully accessed, or the web page access fails. Accordingly, displaying the corresponding content in the preview window may be as follows: displaying the content of the corresponding webpage or displaying error prompt text information for prompting the user that the webpage access fails. For a description of failure to access a web page, reference may be made to the foregoing description, which is not repeated here. It is to be understood that the preferred examples are for illustrative purposes only and are not to be construed as limiting the present application in any way.
Illustratively, in connection with the user interface example described above, taking the example that the web page based on the web address "http:// www.baidv.com" fails to be accessed as a result of the electronic device 100 performing the first operation, the web page corresponding to the web address does not exist. The preview interface may be the preview interface 140 shown in fig. 1E, the preview window may be the preview window 141 shown in fig. 1E, and when the electronic device 100 fails to access a web page based on the website "http:// www.baidv.com", the web page corresponding to the website does not exist, the content displayed in the preview window may be the error prompt text information displayed in the preview window 141 shown in fig. 1E: "404Notfound" and "web page not present".
It should be noted that, the electronic device 100 may display the corresponding content in other forms besides the preview window.
S308, when error prompt text information is displayed in the preview interface, in response to a modification operation of the user on the first text information, the electronic device 100 may enable an editing window and an editing box to be displayed at the same time, and the first text information and the confirmation control may be displayed in the editing box.
Preferably, in order to allow the first text information to be collated with the first text content, an editing window and an editing box may be displayed below the first text display area in the image a. In other examples, the editing window and the editing box may be displayed in the left, right, upper, etc. directions of the first text display area in the image a, which is not limited in this application.
Specifically, the electronic device 100 may obtain the position of the first text content display area in the image a. In some examples, when the electronic device 100 is performing the text detection on the preprocessed image a, the electronic device 100 may obtain the location of the first text content in the image a. In other examples, the electronic device 100 may also obtain the location of the first text content in the image a in other manners, which is not limited in this application. Then, based on the current position of the first text content in the image a, the electronic device 100 may cause the display positions of the editing window and the editing box to be located below the position of the first text content in the image a.
For example, the electronic device 100 may display an edit box and an edit window in a fixed area on a display screen (e.g., a bottom area of the display screen). When the electronic device 100 determines that the display area positions of the edit box and the edit window and the current position of the first text content in the image a overlap, that is, the edit box and the edit window block the first text, the electronic device 100 may slide the image a upward, so that the first text content in the image a is located above the edit box and the edit window. When the electronic device 100 determines that the display area positions of the edit box and the edit window and the current position of the first text content display area in the image a do not overlap, that is, the edit box and the edit window do not block the first text, the electronic device 100 may not need to slide the image a upward, and the first text content in the image a is located above the edit box and the edit window.
Illustratively, in connection with the foregoing user interface example, the user modification operation for the first text information may be: a touch operation (e.g., a click) on the edit control 142A as shown in fig. 1F, or a touch operation (e.g., a double click) on the edit box 202 as shown in fig. 2A. The editing window may be: such as editing window 122 shown in fig. 1G, or editing window 203 shown in fig. 2B. The edit box may be: such as edit box 122A shown in fig. 1G, or edit box 202 shown in fig. 2B. The validation control may be: a confirmation control 122D in the edit box 122A as shown in fig. 1G, or a confirmation control 202A in the edit box 202 as shown in fig. 2A. The first text information displayed in the edit box may be the website "http:// www.baidv.com".
S309. in response to the editing input acting in the editing window, the electronic device 100 may modify the first text information in the editing box to the second text information.
Illustratively, in connection with the user interface examples described above, the editing input that is effected in the editing window may be: the input of one or more character keys on the editing window 122 as shown in fig. 1H, or the input of one or more character keys on the editing window 203 as shown in fig. 2C. The first text information may be the website "http:// www.baidv.com" and the second text information may be the website "http:// www.***.com" in the modified edit box. At this time, the content of the second text information is the same as the first text content. In some examples, the content of the second text information may also be different from the first text content.
S310, in response to a second input acting on the confirmation control, the electronic device 100 executes a second operation corresponding to the second text information.
Preferably, the second text information may be a web address, and the second operation may be an operation for causing the electronic device 100 to access a corresponding web page based on the second text information. It will be appreciated that the above preferred examples are for illustrative purposes only and are not meant to be limiting in any way.
Illustratively, in connection with the user interface example previously described, the second input acting on the validation control may be: a touch operation (e.g., a click) on the confirmation control 122D as shown in fig. 1H, or a touch operation (e.g., a click) on the confirmation control 202A as shown in fig. 2C.
S311, based on the result of executing the second operation, the electronic device 100 may display content corresponding to the result of the second operation in the preview interface.
Preferably, the preview interface may include a preview window. When the second text information is a web address and the second operation is that the electronic device 100 accesses a corresponding web page based on the second text information, the result of the electronic device 100 performing the second operation may be as follows: the corresponding web page content is successfully accessed, or the web page access fails. Accordingly, displaying the corresponding content in the preview window may be as follows: displaying the content of the corresponding webpage or displaying error prompt text information for prompting the user that the webpage access fails. For a description of failure to access a web page, reference may be made to the foregoing description, which is not repeated here. It is to be understood that the preferred examples are for illustrative purposes only and are not to be construed as limiting the present application in any way.
Illustratively, in connection with the user interface example described above, taking as an example that the result of the electronic device 100 performing the second operation is based on the web address "http:// www.***.com" successfully accessing the corresponding web page. The electronic device 100 may display the corresponding web content through the preview window 141 as shown in fig. 1I or the electronic device 100 may display the corresponding web content through the preview window 201 as shown in fig. 2D.
It should be noted that, the electronic device 100 may display the corresponding content in other forms besides the preview window.
In some examples, when the electronic device 100 fails to access the web page as a result of the second operation, the electronic device 100 may display error prompt text information for prompting the user that the web page access fails in the preview window. This occurs, i.e. the electronic device 100 does not modify the first text information correctly, e.g. the electronic device 100 modifies the first text information to third text information, the content of which is different from the content of the first text information. The electronic device 100 may modify the third text information displayed in the edit box to fourth text information in response to the modification operation for the third text information, where the content of the fourth text information is the same as the content of the first text, and the detailed description thereof will refer to the foregoing steps and will not be repeated herein.
Next, a hardware structure of the electronic device 100 provided in the embodiment of the present application is described.
Referring to fig. 4, fig. 4 schematically illustrates a hardware structure of an electronic device 100 according to an embodiment of the present application.
As shown in fig. 4, the electronic device 100 may include a processor 401, a memory 402, a wireless communication module 403, a display screen 404, a camera 405, an audio module 406, a microphone 407, and a sensor module 408.
It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may also include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 401 may include one or more processor units, for example, the processor 401 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 401 for storing instructions and data. In some embodiments, the memory in the processor 401 is a cache memory. The memory may hold instructions or data that has just been used or recycled by the processor 401. If the processor 401 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 401 is reduced, thus improving the efficiency of the system.
In some embodiments, the processor 401 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a USB interface, among others.
A memory 402 is coupled to the processor 401 for storing various software programs and/or sets of instructions. In particular implementations, memory 402 may include volatile memory (RAM), such as Random Access Memory (RAM); non-volatile memory (non-volatile memory) such as ROM, flash memory (flash memory), hard Disk Drive (HDD) or solid state Disk (Solid State Drives, SSD) may also be included; memory 402 may also include a combination of the above types of memory. The memory 402 may also store some program code such that the processor 401 invokes the program code stored in the memory 402 to implement the method of implementing the embodiments of the present application in the electronic device 100. The memory 402 may store an operating system, such as an embedded operating system, for example uCOS, vxWorks, RTLinux.
The wireless communication module 403 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the electronic device 100. The wireless communication module 403 may be one or more devices integrating at least one communication processing module. The wireless communication module 403 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 401. The wireless communication module 403 may also receive a signal to be transmitted from the processor 401, frequency modulate and amplify the signal, and convert the signal to electromagnetic waves through an antenna to radiate. In some embodiments, the electronic device 100 may also probe or scan for devices in the vicinity of the electronic device 100 by transmitting signals through a bluetooth module (not shown in fig. 4), a WLAN module (not shown in fig. 4) in the wireless communication module 403, and establish a wireless communication connection with the nearby devices to transmit data. The bluetooth module may provide a solution including one or more bluetooth communications of classical bluetooth (BR/EDR) or bluetooth low energy (bluetooth low energy, BLE), and the WLAN module may provide a solution including one or more WLAN communications of Wi-Fi direct, wi-Fi LAN, or Wi-Fi softAP, among others.
The display 404 may be used to display images, video, etc. The display 404 may include a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, electronic device 100 may include 1 or N displays 404, N being a positive integer greater than 1.
The camera 405 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 may include 1 or N cameras 405, N being a positive integer greater than 1.
The audio module 406 may be used to convert digital audio information to an analog audio signal output, and may also be used to convert an analog audio input to a digital audio signal. The audio module 406 may also be used to encode and decode audio signals. In some embodiments, the audio module 406 may also be provided in the processor 401, or part of the functional modules of the audio module 406 may be provided in the processor 401.
The microphone 407, which may also be referred to as a "microphone" or "microphone", may be used to collect a sound signal in the environment surrounding the electronic device, then convert the sound signal into an electrical signal, and then subject the electrical signal to a series of processes, such as analog-to-digital conversion, to obtain an audio signal in a digital form that may be processed by the processor 401 of the electronic device. When making a call or transmitting voice information, the user can sound near the microphone 407 through the mouth, inputting a sound signal to the microphone 407. The electronic device 100 may be provided with at least one microphone 407. In other embodiments, the electronic device 100 may be provided with two microphones 407, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 407 to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The sensor module 408 may include a plurality of sensing devices, such as touch sensors (not shown), and the like. Touch sensors may also be referred to as "touch devices". The touch sensor may be disposed on the display screen 404, and the touch sensor and the display screen 404 form a touch screen, which is also referred to as a "touch screen". The touch sensor may be used to detect touch operations acting on or near it.
Note that, the electronic device 100 shown in fig. 4 is merely for exemplarily explaining a hardware structure of the electronic device provided in the present application, and does not constitute a specific limitation of the present application.
Next, a software framework structure of the electronic device 100 provided in the embodiment of the present application is described.
Referring to fig. 5, fig. 5 schematically illustrates a software framework of the electronic device 100 according to an embodiment of the present application.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Taking an Android system with a layered architecture as an example, the embodiment of the application illustrates a software framework structure of the electronic device 100.
The layered architecture divides the software into several layers. Each layer has a clear role and division of work. The layers communicate with each other through a software interface. In some examples, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages, such as: calendar, memo, weather, gallery, camera, logic processing module, text recognition module, interactive presentation module, etc. In some examples, a context awareness module may also be included.
Wherein:
the gallery and/or camera may provide images to the logic processing module for implementing the text processing methods provided by embodiments of the present application; the image a is provided to the interactive display module such that the display position of the editing window and the editing box is located below or otherwise in the image a, such that the first text information may be compared to the first text content, etc.
The logic processing module may be configured to, based on the image a and according to the specific flow of the text processing method provided in the foregoing embodiment, for example, invoke the text recognition module to recognize and extract one or more pieces of text information from the image a, invoke the interactive display module to display a user interface such as a preview window, an edit box, and an edit window, and so on. In some examples, the logic processing module may invoke a context awareness module or the like.
The text recognition module may be configured to recognize and extract one or more pieces of text information via an OCR algorithm based on the gallery and/or the camera-provided image, detect and modify formal errors in the first text information, and modify formal errors in the first text information based on the first mapping table. The specific implementation may refer to the specific flow of the text processing method provided in the foregoing embodiment.
The interactive display module may be configured to display the preview window, so that the preview window may display corresponding content based on results of the first operation and the second operation performed by the electronic device 100; and may also be used to present an edit window and an edit box such that the electronic device 100 is capable of, in response to a modification operation for the first text information, collating the first text information in the edit box with the first text content in image a and modifying the first text information in the edit box to the second text information. The specific implementation may refer to the specific flow of the text processing method provided in the foregoing embodiment.
In some examples, the logic processing module may also invoke the context awareness module so that the context awareness module may be configured to obtain the cursor position and the character corresponding to the cursor position from the application framework layer, and then the interactive presentation module may highlight and/or enlarge the location area corresponding to the character in image a based on the cursor position and the character corresponding to the cursor position.
The application framework layer may include: a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, etc.
The window manager may be used to manage window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider may be used to store and retrieve data and make such data accessible to applications. Such data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system may include visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager may be used to provide communication functions for the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager may provide various resources to the application program, such as localization strings, icons, pictures, layout files, video files, and so forth.
The notification manager allows the application to display notification messages in the status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to detection …" depending on the context. Similarly, the phrase "at the time of determination …" or "if detected (a stated condition or event)" may be interpreted to mean "if determined …" or "in response to determination …" or "at the time of detection (a stated condition or event)" or "in response to detection (a stated condition or event)" depending on the context.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.

Claims (10)

1. A text processing method, comprising:
the electronic device displays a first interface, wherein the first interface comprises a first image, the first image comprises one or more pieces of text content, and the one or more pieces of text content comprise first text content;
the electronic equipment extracts and displays one or more pieces of text information from the first image, wherein the extracted one or more pieces of text information comprise first text information; the first text information is text information which is identified and extracted based on the position of the first text content in the first image;
responding to a first input acted on a display area of the first text information, executing a first operation corresponding to the first text information by the electronic equipment, and displaying a second interface;
When the electronic equipment displays error prompt text information in the second interface, responding to modification operation for the first text information, displaying an editing window and an editing box by the electronic equipment, wherein the first text information and a confirmation control are displayed in the editing box, and the first text information is compared with the first text content in the first image;
in response to an editing input acting in the editing window, the electronic device modifies the first text information in the editing box into second text information based on the first text content; wherein the content of the second text information is the same as the first text information;
in response to a second input acting on the confirmation control, the electronic device performs a second operation;
and responding to the second operation, and displaying the content corresponding to the second text information in the second interface by the electronic equipment.
2. The method of claim 1, wherein before the electronic device displays the first interface, the method further comprises:
the electronic device displays a desktop, the desktop including icons of one or more applications, the icons of the one or more applications including icons of a first application;
In response to a third input acting on an icon of the first application, the electronic device displays a preview of one or more images, the preview of one or more images including a preview of the first image;
the electronic device displays the first interface in response to a fourth input acting on a preview of the first image.
3. The method according to claim 1, wherein the first interface includes a text recognition control, and the electronic device extracts and displays one or more pieces of text information from the first image, and the extracted one or more pieces of text information include first text information, and specifically includes:
in response to a fifth input on the text recognition control, the electronic device extracts and displays one or more pieces of text information from the first image by an OCR algorithm, the extracted one or more pieces of text information including the first text information.
4. The method of claim 1, wherein before the electronic device performs a first operation corresponding to the first text information and displays a second interface in response to a first input acting on a display area of the first text information, the method further comprises:
The electronic device determines and displays a text type of the first text information.
5. The method according to claim 1, wherein in response to the second operation, the electronic device displays content corresponding to the second text information in the second interface, specifically including:
the second interface comprises a preview window;
and responding to the second operation, and displaying the content corresponding to the second text information in the preview window by the electronic equipment.
6. The method of claim 5, wherein in response to the second operation, the electronic device displays content corresponding to the second text information in the second interface, the method further comprising:
in response to a sixth input acting on the preview window, the electronic device displays a third interface; the content displayed in the third interface comprises content displayed in the preview window.
7. An electronic device, comprising: one or more processors, one or more memories, and a display screen; the one or more memories are coupled with one or more processors, the one or more memories being configured to store computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-6.
8. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-6.
9. A chip or chip system comprising processing circuitry and interface circuitry, the interface circuitry to receive code instructions and to transmit to the processing circuitry, the processing circuitry to execute the code instructions to perform the method of any of claims 1-6.
10. A computer program product, characterized in that the computer program product, when run on an electronic device, causes the electronic device to perform the method of any of claims 1-6.
CN202211055901.1A 2022-08-31 2022-08-31 Text processing method and electronic equipment Pending CN116050390A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211055901.1A CN116050390A (en) 2022-08-31 2022-08-31 Text processing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211055901.1A CN116050390A (en) 2022-08-31 2022-08-31 Text processing method and electronic equipment

Publications (1)

Publication Number Publication Date
CN116050390A true CN116050390A (en) 2023-05-02

Family

ID=86120627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211055901.1A Pending CN116050390A (en) 2022-08-31 2022-08-31 Text processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116050390A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103714333A (en) * 2012-08-27 2014-04-09 三星电子株式会社 Apparatus and method for recognizing a character in terminal equipment
CN110401766A (en) * 2019-05-22 2019-11-01 华为技术有限公司 A kind of image pickup method and terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103714333A (en) * 2012-08-27 2014-04-09 三星电子株式会社 Apparatus and method for recognizing a character in terminal equipment
CN110401766A (en) * 2019-05-22 2019-11-01 华为技术有限公司 A kind of image pickup method and terminal

Similar Documents

Publication Publication Date Title
CN110111787B (en) Semantic parsing method and server
US9104261B2 (en) Method and apparatus for notification of input environment
US11914850B2 (en) User profile picture generation method and electronic device
WO2021115091A1 (en) Text recognition method and apparatus
US20130283260A1 (en) Image guided method for installing application software
US12010257B2 (en) Image classification method and electronic device
CN111881315A (en) Image information input method, electronic device, and computer-readable storage medium
US20230252778A1 (en) Formula recognition method and apparatus
CN113806473A (en) Intention recognition method and electronic equipment
CN111507122A (en) Graphic code identification method and device, storage medium and terminal
CN113051950A (en) Multi-code identification method and related equipment
CN116431044A (en) Method and device for starting application program and terminal equipment
WO2023222128A1 (en) Display method and electronic device
CN115131789A (en) Character recognition method, character recognition equipment and storage medium
US11308317B2 (en) Electronic device and method for recognizing characters
WO2022179471A1 (en) Card text recognition method and apparatus, and storage medium
CN116050390A (en) Text processing method and electronic equipment
CN117197811A (en) Text recognition method and electronic equipment
KR102292595B1 (en) Apparatus for recognizing watermark using image integrating QR code and watermark and method thereof
EP4163774A1 (en) Prompting method and terminal device
WO2021218452A1 (en) Input method, input device and mobile terminal
CN116204254A (en) Annotating page generation method, electronic equipment and storage medium
CN113111894A (en) Number classification method and device
WO2023222097A1 (en) Text recognition method and related apparatus
WO2022267696A1 (en) Content recognition method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination