WO2022111582A1 - Text extraction method and apparatus - Google Patents

Text extraction method and apparatus Download PDF

Info

Publication number
WO2022111582A1
WO2022111582A1 PCT/CN2021/133172 CN2021133172W WO2022111582A1 WO 2022111582 A1 WO2022111582 A1 WO 2022111582A1 CN 2021133172 W CN2021133172 W CN 2021133172W WO 2022111582 A1 WO2022111582 A1 WO 2022111582A1
Authority
WO
WIPO (PCT)
Prior art keywords
touch
text information
text
touch point
area
Prior art date
Application number
PCT/CN2021/133172
Other languages
French (fr)
Chinese (zh)
Inventor
缪丹
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022111582A1 publication Critical patent/WO2022111582A1/en

Links

Images

Classifications

    • 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/04842Selection of displayed objects or displayed text elements
    • 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
    • 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/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Definitions

  • the present disclosure relates to the field of Optical Character Recognition (OCR) in the field of terminal artificial intelligence (Artificial Intelligence, AI), and in particular, to a text extraction method and device.
  • OCR Optical Character Recognition
  • AI Artificial Intelligence
  • OCR technology and control word extraction technology are two common ways to obtain text information.
  • OCR technology can read out the characters on pictures or paper and convert them into computer text.
  • OCR technology cannot accurately recognize characters that are difficult for human eyes to distinguish, for example, OCR cannot accurately distinguish lowercase L (ie l) and uppercase i (ie I).
  • OCR technology can not accurately identify the characters and password characters in the link.
  • the text obtained by the control word extraction technology is completely consistent with the original text, the control word extraction technology obtains all the text in the entire control, which requires the user to find the desired part, which is cumbersome to operate.
  • a text extraction method and device are proposed, which can conveniently, quickly and accurately obtain the text information required by the user.
  • an embodiment of the present disclosure provides a text extraction method, including: a terminal device, in response to a touch operation on a touch screen, acquires a touch area, and extracts text information in the touch area through OCR technology, and records is the first text message.
  • the terminal device determines a target control that matches the previously acquired touch area from one or more textual controls on the touch screen that can obtain text content, and obtains text information from the target control, which is recorded as second text information.
  • the terminal device adjusts the first text information based on the second text information to obtain final third text information. In this way, by adjusting the first text information with accurate text position based on the second text information with correct text content, the third text information with accurate position and correct content can be obtained conveniently and quickly.
  • the terminal device may acquire the intersection ratio of each textual control displayed on the touch screen and the touch area; based on the intersection ratio , and determine the target control. In this way, the control from which the user wants to extract the text information can be more accurately determined, thereby improving the accuracy of the text content of the finally acquired text information.
  • the first text information is adjusted based on the second text information to obtain
  • the third text information may include: comparing the characters corresponding to the same position on the touch screen in the first text information and the second text information; comparing the first text information with the characters in the second text information The character corresponding to the same position and inconsistent content on the touch screen is determined as the target character; the target character in the first text information is replaced with the target character corresponding to the second text information on the touch screen at the same position characters in, the third text information is obtained.
  • the text information extracted by the OCR technology can be made into text information with more accurate text content.
  • the characters in the second text information of the position may include: determining a matching rate according to the number of the target characters and the number of characters in the first text information; in the case that the matching rate is greater than the first threshold, the first A target character in a piece of text information is replaced with a character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information. In this way, the correctness can be improved by performing character replacement when the matching rate is high.
  • the first text information is adjusted based on the second text information to obtain
  • the third text information may include: detecting whether a character set satisfying a preset format exists in the second text information; if there is a character set satisfying the preset format in the second text information, from the A character set satisfying the preset format is extracted from the second text information; the first text information is replaced with the extracted character set to obtain the third text information.
  • OCR technology is used to determine the control to which the link or password belongs, and then the link or password is automatically extracted from the control, which can not only ensure the integrity and location accuracy of the link or password, but also ensure the correctness of the link or password, and the operation is fast and convenient. .
  • the terminal device may provide a service corresponding to the character set in the preset format according to the third text information. In this way, service efficiency can be improved, and user satisfaction can be improved.
  • the acquiring a touch area in response to a touch operation may include: in response to the touch operation, obtain the position information of the start touch point and the position information of the end touch point; determine the touch area according to the position information of the start touch point and the position information of the end touch point . In this way, the position where the user needs to acquire the text information can be determined effectively and accurately.
  • the text extraction method may also The method includes: loading an area selection marking layer in response to the touch operation; and determining the touch area based on a confirming operation of the area selection marking layer. In this way, the selection of the touch area can be made more accurate, thereby further improving the accuracy of the position of the text information.
  • the determining according to the position information of the start touch point and the position information of the end touch point may include: in the case that the start touch point and the end touch point correspond to the same text line, according to the first touch point between the start touch point and the end touch point. an area, determining the touch area. In this way, text information can be accurately obtained within the same text line.
  • the touch area may include: in the case that the start touch point and the end touch point correspond to adjacent text lines, according to the difference between the start touch point and the right border of the touch screen.
  • the determining according to the position information of the start touch point and the position information of the end touch point includes: when the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, according to the start touch point and the touch screen.
  • the fourth area between the right borders, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the end touch point and the left border of the touch screen The sixth area between them determines the touch area. In this way, text information can be accurately acquired in a large range.
  • the position information according to the starting touch point and the position information of the end touch point, determining the touch area may include: moving the start touch point to the positive y-axis and negative x-axis of the touch screen by a first distance, and obtaining the adjusted move the end touch point to the positive x-axis and negative y-axis of the touch screen by a second distance to obtain the adjusted end touch point;
  • the position information of the point and the adjusted position information of the end touch point are used to determine the touch area.
  • the touch area can be slightly enlarged, the influence of missing text selection caused by the inconsistency between the user's visual touch point and the actual touch point can be reduced, and the accuracy of the position marking can be improved.
  • a text extraction device including: a first acquisition module, used for acquiring a touch area in response to a touch operation on a touch screen; and an extraction module, used for optical character recognition (OCR)
  • OCR optical character recognition
  • the technology extracts the first text information in the touch area acquired by the first acquisition module; the determination module is used to determine the target matching the touch area from one or more textual controls displayed on the touch screen a control; a second acquisition module for acquiring second text information from the target control determined by the determination module; an adjustment module for extracting the text information extracted by the extraction module based on the second text information acquired by the second acquisition module
  • the first text information is adjusted to obtain third text information.
  • the determining module includes: a first acquiring unit, configured to acquire the relationship between each textual control displayed on the touch screen and the touch area cross-merger ratio; a first determining unit, configured to determine the target control based on the cross-merger ratio.
  • the adjustment module includes: a comparison unit, configured to compare the first text information with the all The characters in the second text information corresponding to the same position on the touch screen are compared; the second determination unit is used to compare the characters in the first text information and the second text information corresponding to the same characters on the touch screen. A character whose position and content are inconsistent is determined as a target character; a first replacement unit is used to replace the target character in the first text information with the target character in the second text information corresponding to the same position on the touch screen. character to obtain the third text information.
  • the first replacement unit is further configured to: according to the number of the target characters and the amount of the first text information The number of characters to determine the matching rate; when the matching rate is greater than the first threshold, replace the target character in the first text information with the second text information corresponding to the target character at the same position on the touch screen characters in, the third text information is obtained.
  • the adjustment module further includes: a detection unit configured to detect the second text information in the Whether there is a character set that meets the preset format; an extraction unit, configured to extract a character set that meets the preset format from the second text information when there is a character set that meets the preset format in the second text information. A character set in a preset format; and a second replacement unit, configured to replace the first text information with the extracted character set to obtain the third text information.
  • the apparatus further includes: a service module, configured to provide and the preset according to the third text information The character set of the format corresponds to the service.
  • the first acquiring module includes: a second acquiring unit, configured to respond to the For touch operation, the position information of the start touch point and the position information of the end touch point are obtained; the third determination unit is used for obtaining the position information of the start touch point and the end touch point according to the position information of the start touch point and the end touch point. to determine the touch area.
  • the first acquiring module It also includes: a loading unit for loading the area selection marking layer in response to the touch operation; and a fourth determining unit for determining the touch area based on the confirmation operation of the area selection marking layer. .
  • the third determining unit is further configured to: select between the start touch point and the end touch point In the case of corresponding to the same text line, the touch area is determined according to the first area between the start touch point and the end touch point.
  • the third determining unit is further configured to: at the start touch point and the end touch point In the case of corresponding adjacent text lines, according to the second area between the start touch point and the right border of the touch screen, and the third area between the end touch point and the left border of the touch screen area to determine the touch area.
  • the third determining unit is further configured to: at the start touch point and the end touch point When the corresponding text lines are separated by one or more text lines, according to the fourth area between the starting touch point and the right border of the touch screen, the text line corresponding to the starting touch point and the The end touch point corresponds to the fifth area between the text lines, and the sixth area between the end touch point and the left border of the touch screen, to determine the touch area.
  • the third determining unit is further configured to: Move the starting touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted starting touch point; move the ending touch point to the positive and negative x-axis of the touch screen The y-axis is moved in the negative direction by a second distance to obtain the adjusted end touch point; the touch area is determined according to the adjusted position information of the start touch point and the adjusted position information of the end touch point.
  • an embodiment of the present disclosure provides a terminal device, which can execute the first aspect or one or more of the text extraction methods in multiple possible implementations of the first aspect.
  • embodiments of the present disclosure provide a computer program product, comprising computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in an electronic
  • the processor in the electronic device executes the first aspect or one or more of the text extraction methods in the multiple possible implementation manners of the first aspect.
  • the first text information with the correct text position is accurately extracted by the OCR technology
  • the second text information with the correct text content is obtained by the control word extraction technology
  • the text is analyzed based on the second text information with the correct text content.
  • FIG. 1 shows a schematic diagram of an implementation environment of a text extraction method provided by an embodiment of the present disclosure
  • Fig. 2a, Fig. 2b and Fig. 2c respectively show exemplary schematic diagrams of the application interface displayed by the touch screen;
  • Fig. 3a, Fig. 3b, Fig. 3c, Fig. 3d and Fig. 3e show exemplary schematic diagrams of the touch area, respectively;
  • FIG. 4 shows a schematic structural diagram of a terminal device 200 according to an embodiment of the present disclosure
  • FIG. 5 shows a flowchart of a text extraction method according to an embodiment of the present disclosure
  • FIG. 6 shows a schematic structural diagram of a text extraction apparatus according to an embodiment of the present disclosure.
  • FIG. 1 shows a schematic diagram of an implementation environment of a text extraction method provided by an embodiment of the present disclosure.
  • the implementation environment includes a touch medium 100 and a terminal device 200 .
  • the touch medium may include a stylus 101, a user's finger 102, and the like.
  • the terminal device 200 can be any terminal device with a touch screen, and the terminal device 200 includes but is not limited to mobile phones, tablet computers, notebook computers, televisions, laptop computers, desktop computers, mobile phones, multimedia players, e-readers, Smart vehicle devices, smart home appliances, artificial intelligence devices, wearable electronic devices (such as smart watches, etc.), IoT devices, virtual reality/augmented reality/mixed reality devices, etc.
  • the terminal device 200 can install various applications, such as instant messaging applications, e-commerce applications, game applications, social networking applications, community applications, news applications, audio playback applications, video playback applications, live broadcast applications, browser applications, travel applications, and financial applications. , sports application, shooting application, image processing application, audio and video processing reference, reading application, takeaway application, recipe application, navigation application, traffic ticketing application, information recording application, mailbox application, health care application, resource management application, etc.
  • the application installed on the terminal device 200 may be an independent application or an embedded application, that is, a small program.
  • the touch screen of the terminal device 200 may display an application interface, and the application interface may include one or more textual controls.
  • the textual control may be used to represent a control that can obtain text content, for example, a text display control, a text input control, and the like.
  • the textual control can be a chat box in an instant messaging application, an input box in an information recording application, an area for displaying e-books in a reading application, an area for displaying the text content of a recipe in a recipe application, and an area for displaying text in a news application. content, the area where the text content is displayed in the browser application, etc.
  • the text information extracted from the textual controls includes but is not limited to user names, passwords, links, words, sentences, paragraphs, articles and other contents.
  • the text information extracted from the textual controls includes but is not limited to the forms of symbols, numbers, Chinese, English, Japanese, Korean, Spanish, German, French, and the like.
  • the embodiments of the present disclosure do not limit the applications displayed in the terminal device 200, the textual controls included in the applications, and the textual information extracted from the textual controls.
  • Fig. 2a, Fig. 2b and Fig. 2c respectively show exemplary schematic diagrams of application interfaces displayed on the touch screen.
  • the touch screen of the terminal device 200 may display the interface of the instant messaging application shown in FIG. 2a.
  • the textual controls in the interface of the instant messaging application may include a chat information display box and a chat information input box.
  • the text content obtained from the chat information display box can include "I bought a ticket for the drama on the 10th, let's watch it together", “Okay, okay”, “Who are the actors?", "The above The link has a detailed introduction, please take a look", etc.; the text information obtained from the chat information input box can include "OK, let me take a look” and so on.
  • the touch screen of the terminal device 200 may display the interface of the community application shown in FIG. 2b. Referring to Fig. 2b, the textual controls in the interface of the community application may include a text display area and a search box in the display box.
  • the text information obtained from the search box may include "Hangzhou Travel Notes” (not shown) and the like.
  • the touch screen of the terminal device 200 may display the interface of the browser application shown in FIG. 2c. Referring to Fig. 2c, the textual controls in the interface of the browser application may include a text display area.
  • the text information obtained from the text display area may include "XL... adjustable” and "chip introduction".
  • the user may perform touch operations (for example, operations such as clicking, double-clicking, sliding, two-finger pressing, etc.) on the touch screen of the terminal device 200 through touch media such as the stylus 101 and the user's finger 102 .
  • touch operations for example, operations such as clicking, double-clicking, sliding, two-finger pressing, etc.
  • the terminal device 200 may include acquiring the touch area in response to the above touch operation.
  • 3a, 3b, 3c, 3d, and 3e show exemplary schematic diagrams of the touch area, respectively.
  • the touch operation performed by the user may be used to determine the start touch point and the end touch point, and the terminal device may determine the touch area based on the start touch point and the end touch point.
  • the user can perform a two-finger pressing operation on the touch screen of the terminal device 200 with a finger.
  • the terminal device 200 can acquire position information of two touch points (referred to as the start touch point and the end touch point).
  • the terminal device 200 divides the interface into multiple text lines through the OCR technology.
  • the terminal device 200 can determine the text line corresponding to the starting touch point (denoted as the first text line) and the text line corresponding to the ending touch point (denoted as the first text line) according to the position information of the start touch point and the position information of the end touch point. for the second line of text).
  • the first text line and the second text line are the same text line, and the terminal device 200 may determine the touch area according to the area between the start touch point and the end touch point (referred to as the first area).
  • the user can perform a sliding operation on the touch screen of the terminal device 200 with a finger.
  • the terminal device 200 may determine the start touch point and the end touch point according to the start point and end point of the sliding operation, and determine the first text line and the second text line. As shown in FIG. 3b, the first text line and the second text line are the same text line, and the terminal device 200 may determine the touch area according to the first area between the start touch point and the end touch point.
  • the user can perform two clicks (single-click or double-click, etc.) operations on the touch screen of the terminal device 200 with a finger.
  • the terminal device 200 may determine the start touch point and the end touch point according to the detected two click points, and determine the first text line and the second text line.
  • the first text line and the second text line are adjacent text lines, and the terminal device 200 can end the touch according to the area between the starting touch point and the right border of the touch screen (referred to as the second area) and ending the touch
  • the area between the point and the left border of the touch screen determines the touch area.
  • the user can perform a sliding operation on the touch screen of the terminal device 200 with a finger.
  • the terminal device 200 may determine the start touch point and the end touch point according to the start point and end point of the sliding operation, and determine the first text line and the second text line.
  • two text lines are separated between the first text line and the second text line. Refer to the second area), the area between the first text line and the second text line (marked as the fifth area), and the area between the end touch point and the left border of the touch screen (marked as the sixth area, refer to The third area) determines the touch area.
  • the first area, the second area, the third area, the fourth area, the fifth area and the sixth area may be rectangular areas.
  • the first to sixth regions may also be regions of other shapes, such as elliptical regions, trapezoidal regions, hexagonal regions, and octagonal regions, which are not limited in the present disclosure.
  • the start touch point and the end touch point are determined based on their relative positions on the touch screen, which are consistent with the order of the text content. For example, when the first text line and the second text line are the same text line, the start touch point is located to the left of the end touch point; when the first text line and the second text line are different text lines , the start touch point is above the end touch point.
  • the touch operation can also be used to trigger area selection.
  • the terminal device may load the area selection marker layer, and determine the touch area based on the confirmation operation of the area selection marker layer.
  • the terminal device 200 displays the area selection marker layer in response to touch operations such as long-pressing the screen and triggering the marker control.
  • the user can adjust the position of the region selection marker layer. After the adjustment is completed, the user can click the " ⁇ " control to perform the confirmation operation of selecting the mark layer in the confirmation area.
  • the terminal device 300 may determine the touch area according to the position of the area selection marker layer. In this way, the selection of the touch area can be made more accurate, thereby further improving the accuracy of the position of the text information.
  • the touch screen of the terminal device 200 may display one textual control, or may simultaneously display multiple textual controls.
  • the terminal device 200 may determine all textual controls currently displayed on the touch screen when detecting a touch operation on the touch screen. Afterwards, the terminal device 200 may determine a target control matching the touch area from these textual controls. In one example, the terminal device 200 may acquire the intersection ratio of each textual control displayed on the touch screen and the touch area, and determine the target control based on the intersection ratio. For example, the textual control with the largest corresponding union ratio is determined as the target control. It can be understood that, the position of the textual control displayed on the touch screen of the terminal device 200 can be obtained from the application currently displayed on the touch screen.
  • the first text information in the touch area can be extracted by using the OCR technology.
  • the terminal device 200 can directly acquire the second text information from the target widget. Since the first text information has more accurate location information, and the second text information has more accurate text content, the terminal device 200 can adjust the first text information based on the second text information, and update the first text information that is not very accurate. accurate part, so as to obtain the third text information with accurate position and accurate content.
  • the terminal device 200 extracts the first text information "Integrated MOSFET switching power of 100mQ", and obtains the second text information "XL 1509-3.3E1 5G base station power chip features 2A continuous output current 8-
  • the 30V wide operating voltage input integrates a 100m ⁇ MOSFET switching power tube and the output is adjustable from 18-28V".
  • the terminal device 200 uses the second text information to adjust the first text information, and obtains the third text information "Integrated MOSFET switching power of 100 m ⁇ ".
  • FIG. 4 shows a schematic structural diagram of a terminal device 200 according to an embodiment of the present disclosure.
  • the terminal device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 251, and a wireless communication module 252 , audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 and so on.
  • the sensor module 280 may include a touch sensor 280K, (of course, the terminal device 200 may also include other sensors, such as a gyroscope sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an environmental sensor light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
  • sensors such as a gyroscope sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an environmental sensor light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
  • the processor 210 may include one or more processing units, for example, the processor 210 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), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the terminal device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 may execute the text extraction method provided by the embodiment of the present disclosure, so as to conveniently, quickly and accurately extract the text information required by the user.
  • the processor 210 may include different devices. For example, when a CPU and a GPU are integrated, the CPU and the GPU may cooperate to execute the text extraction method provided by the embodiments of the present disclosure. for faster processing efficiency.
  • Display screen 294 is used to display images, videos, and the like.
  • Display screen 294 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the terminal device 200 may include one or N display screens 294 , where N is a positive integer greater than one.
  • the display screen 294 may be used to display information entered by or provided to the user as well as various graphical user interfaces (GUIs).
  • GUIs graphical user interfaces
  • display 294 may display photos, videos, web pages, or documents, and the like.
  • display 294 may display a graphical user interface.
  • the GUI includes a status bar, a hideable navigation bar, a time and weather widget, and an application icon, such as a browser icon.
  • the status bar includes operator name (eg China Mobile), mobile network (eg 4G), time and remaining battery.
  • the navigation bar includes a back button icon, a home button icon, and a forward button icon.
  • the status bar may further include a Bluetooth icon, a Wi-Fi icon, an external device icon, and the like.
  • the graphical user interface may further include a Dock bar, and the Dock bar may include commonly used application icons and the like.
  • the display screen 294 may be an integrated flexible display screen, or a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens, etc. Do limit.
  • the terminal device 200 can control the display screen 294 to display a corresponding graphical user interface, such as the application interface shown in FIG. 2a, FIG. 2b, and FIG. 3b, the touch area shown in FIG. 3c and FIG. 3d, and the area selection marking layer shown in FIG. 3e.
  • a corresponding graphical user interface such as the application interface shown in FIG. 2a, FIG. 2b, and FIG. 3b, the touch area shown in FIG. 3c and FIG. 3d, and the area selection marking layer shown in FIG. 3e.
  • Camera 293 front or rear camera, or a camera that can be both front and rear camera
  • the camera 293 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex or concave) for collecting the light signal reflected by the object to be photographed, and transmitting the collected light signal to the image sensor .
  • the image sensor generates an original image of the object to be photographed according to the light signal.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the terminal device 200 by executing the instructions stored in the internal memory 221 .
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area may store operating system, code of application programs (such as camera application, WeChat application, etc.), and the like.
  • the storage data area may store data created during the use of the terminal device 200 (such as images and videos captured by the camera application) and the like.
  • the internal memory 221 may also store one or more computer programs 1310 corresponding to the text extraction method provided by the embodiment of the present disclosure.
  • the one or more computer programs 1304 are stored in the aforementioned memory 221 and configured to be executed by the one or more processors 210, and the one or more computer programs 1310 include instructions that may be used to perform the execution of FIG.
  • the computer program 1310 may include a first acquisition module, an extraction module, a determination module, a second acquisition module and an adjustment module, wherein the first acquisition module is used to respond to touch operations on the touch screen , obtains the touch area; the extraction module is used to extract the first text information in the touch area obtained by the first acquisition module through the optical character recognition OCR technology; the determination module is used to extract the textual information displayed on the touch screen from the Among the controls, a target control that matches the touch area obtained by the first obtaining module is determined, and the textual control is used to represent a control that can obtain text content; the second obtaining module is used for obtaining from the determining module.
  • the first acquisition module is used to respond to touch operations on the touch screen , obtains the touch area
  • the extraction module is used to extract the first text information in the touch area obtained by the first acquisition module through the optical character recognition OCR technology
  • the determination module is used to extract the textual information displayed on the touch screen from the Among the controls, a target control that matches the touch area obtained by
  • the second text information is obtained from the determined target control; the adjustment module is configured to adjust the first text information extracted by the extraction module based on the second text information obtained by the second obtaining module to obtain third text information.
  • the processor 210 may control the display screen to display third text information.
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • non-volatile memory such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the code of the text extraction method provided by the embodiment of the present disclosure may also be stored in an external memory.
  • the processor 210 may execute the code of the text extraction method stored in the external memory through the external memory interface 220 .
  • the functions of the touch sensor 280K in the sensor module 280 are described below.
  • Touch sensor 280K also called “touch panel”.
  • the touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen”.
  • the touch sensor 280K is used to detect touch operations on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided via display screen 294 .
  • the user can perform the touch operations shown in FIGS. 3 a , 3 b , 3 c and 3 d on the touch screen, and the processor can obtain the touch area according to these touch operations.
  • the display screen 294 of the terminal device 200 displays a main interface, and the main interface includes icons of multiple applications (such as instant messaging applications, browser applications, etc.).
  • the display screen 294 displays an interface of an instant communication application, such as a login interface or a chat interface.
  • the wireless communication function of the terminal device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 251, the wireless communication module 252, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 251 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the terminal device 200 .
  • the mobile communication module 251 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 251 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 251 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 251 may be provided in the processor 210 .
  • At least part of the functional modules of the mobile communication module 251 may be provided in the same device as at least part of the modules of the processor 210 .
  • the mobile communication module 251 may also be used for information interaction with other terminal devices.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 .
  • the modem processor may be a stand-alone device.
  • the modulation and demodulation processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 251 or other functional modules.
  • the wireless communication module 252 can provide applications on the terminal device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 252 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 252 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 252 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
  • the wireless communication module 252 is configured to transmit data with other terminal devices under the control of the processor 210.
  • the processor 210 executes the text extraction method provided by the embodiment of the present disclosure
  • the processor can control the The wireless communication module 252 sends a service request to other terminal devices, and can also receive service results provided by other terminal devices based on the above-mentioned service request. For example, sending a web page access request to other terminal devices, and receiving web page content provided by other terminal devices.
  • the terminal device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. Such as music playback, recording, etc.
  • the terminal device 200 may include more or less components than those shown in FIG. 4 , which is not limited by the embodiment of the present disclosure.
  • the illustrated terminal device 200 is only an example, and the terminal device 200 may have more or fewer components than those shown in the figures, may combine two or more components, or may have a different configuration of components.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the workflow of the software and hardware of the terminal device 200 is exemplarily described below with reference to the application interface shown in FIG. 3a.
  • the touch sensor 280K receives the touch operation, and the corresponding Hardware terminals are sent to the kernel layer.
  • the kernel layer processes touch operations into raw input events (including touch coordinates, timestamps of touch operations, etc.). Raw input events are stored at the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer, and identifies the application corresponding to the input event.
  • the text extraction application invokes the interface of the application framework layer to start the text extraction application.
  • the text extraction application acquires the touch area shown in FIG.
  • FIG. 5 shows a flowchart of a text extraction method according to an embodiment of the present disclosure.
  • the method may be performed by a terminal device, such as the terminal device 200 shown in FIG. 4 .
  • the method may include:
  • Step S601 in response to a touch operation on the touch screen, obtain a touch area.
  • Step S602 extracting the first text information in the touch area by using an optical character recognition (OCR) technology.
  • OCR optical character recognition
  • Step S603 determining a target control matching the touch area from one or more textual controls displayed on the touch screen.
  • the textual control is used to represent a control that can obtain text content.
  • Step S604 acquiring second text information from the target control.
  • Step S605 Adjust the first text information based on the second text information to obtain third text information.
  • the first text information with the correct text position is accurately extracted by the OCR technology
  • the second text information with the correct text content is obtained by the control word extraction technology
  • the text is analyzed based on the second text information with the correct text content.
  • the touch operation may include a click operation, a sliding operation, and a pressing operation.
  • the click operation may include two click operations, two double click operations, one click operation and one double click operation, or one double click operation and one click operation, and the like.
  • the sliding operation may include a single-finger sliding operation, a multi-finger sliding operation, and the like.
  • the pressing operation may include a single-finger pressing operation, a multi-finger pressing operation (eg, a two-finger pressing operation), and the like.
  • the touch operation may be performed by a stylus, a user's finger, or a user's knuckle, or the like.
  • the terminal device can acquire the touch area in response to the touch operation on the touch screen.
  • the touch area can accurately mark the position of the text information that the user needs to obtain.
  • the touch area may include one or more rectangular areas.
  • the touch area can also be other areas that can accurately mark the position.
  • step S601 may include: in response to the touch operation, acquiring the position information of the start touch point and the position information of the end touch point; according to the position of the start touch point information and the position information of the end touch point to determine the touch area.
  • a touch operation may generate two or more touch points.
  • the start touch point and the end touch point need to be determined from the two or more touch points.
  • the start touch point may be used to mark the start point of the text information that the user wants to obtain
  • the end touch point may be used to mark the end point of the text information that the user wants to obtain.
  • the starting touch point and the ending touch point are determined according to the order of the text content in the text information, not the order in which the touch points are generated. For a sliding operation that slides from bottom left to top right, the starting touch point is the last touch point generated by the sliding operation, and the ending touch point is the first touch point generated by the sliding operation.
  • the terminal device determines the distance between the text line corresponding to each touch point generated by the touch operation and the upper boundary of the touch screen, and determines the touch point with the smallest distance as the first touch point. Similarly, the terminal device determines the distance between the text line corresponding to each touch point generated by the touch operation and the lower boundary of the touch screen, and determines the touch point with the smallest distance as the second touch point. In the case that there is one first touch point, the terminal device may determine the first touch point as the starting touch point; in the case that there are multiple first touch points, the terminal device may determine the first touch point with the left border of the touch screen The smallest first touch point is determined as the initial touch point.
  • the terminal device can determine the second touch point as the end touch point; in the case that there are multiple second touch points, the terminal device can determine the distance from the right border of the touch screen The smallest second touch point is determined as the end touch point.
  • the position information of the start touch point and the position information of the end touch point are determined based on the touch screen.
  • the lower left corner of the touch screen may be determined as the coordinate origin
  • the positive right side of the coordinate origin may be used as the positive direction of the x-axis
  • the positive left side of the coordinate origin may be used as the negative direction of the y-axis
  • the positive side of the coordinate origin may be used as the positive direction of the y-axis.
  • the positive direction of the y-axis the negative direction of the y-axis is directly below the origin of the coordinates. In this way, the position information of the starting touch point and the position information of the ending touch point can be represented by x and y.
  • the terminal device can an area, determining the touch area. Taking the first area as a rectangular area as an example, the terminal device can determine the left boundary of the first area according to the starting touch point, determine the right boundary of the first area according to the ending touch point, and determine the rectangle area according to the lines divided by the OCR technology. The upper and lower boundaries are determined, and the determined rectangular area between the upper, lower, left and right boundaries is determined as the touch area.
  • the terminal device can The second area, and the third area between the end touch point and the left border of the touch screen, determine the touch area.
  • the manner of determining the second area and the third area may refer to the manner of determining the first area, which will not be repeated here. It can be understood that the text information in the second area should be arranged before the text information in the third area. In one example, the touch area can be obtained by splicing the third area after the second area.
  • the terminal device can The fourth area between the right border of the touch screen, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the end touch point and the left side of the touch screen.
  • the sixth area between the boundaries determines the touch area.
  • the manner of determining the fourth area, the fifth area and the sixth area may refer to the manner of determining the first area, which will not be repeated here.
  • the fifth area may be divided into one or more sub-areas, and each sub-area corresponds to a text line. Then, the sub-regions of the fifth region are sequentially spliced after the fourth region, and the sixth region is spliced after the sub-regions corresponding to the last text line of the fifth region to obtain a touch-sensitive region.
  • the position of the text information that the user needs to acquire can be accurately marked by the above method.
  • the terminal device may first adjust the positions of the start touch point and the end touch point.
  • the terminal device may move the starting touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted starting touch point; move the ending touch point by a first distance.
  • the control point is moved a second distance in the positive direction of the x-axis and the negative direction of the y-axis of the touch screen to obtain the adjusted end touch point.
  • the terminal device may determine the touch area according to the adjusted position information of the start touch point and the adjusted position information of the end touch point.
  • the first distance may include a first x-axis distance and a first y-axis distance.
  • the first x-axis distance and the first y-axis distance may be the same or different.
  • the first x-axis distance and the first y-axis distance may be set as required, for example, may be determined according to one or more of the size of the touch screen, the height of the text line, and the size of the text, which is not limited in the present disclosure.
  • the first x-axis distance may be 0.5 cm
  • the first y-axis distance may be 0.5 cm.
  • the second distance can refer to the first distance, which will not be repeated here.
  • the touch can be slightly enlarged. area, reduce the impact of missing text selection caused by the inconsistency between the user's visual touch point and the actual touch point, and improve the accuracy of the position mark.
  • the terminal device may take an area of an additional text line up and down, respectively, and add it to the touch area .
  • the touch area can be effectively expanded, so as to better reduce the influence of missing text selection caused by the inconsistency between the user's visual touch point and the actual touch point, and improve the accuracy of the position mark.
  • the effect of touch operations performed by fingers or knuckles is more pronounced.
  • the first text information may represent the text information in the touch area extracted by the OCR technology.
  • the terminal device can perform binarization processing, noise removal, tilt correction, line branch processing, character segmentation, character recognition, and panel restoration on the touch area (even if the text content is recognized, it is still in accordance with the original touch area)
  • the text content displayed in the text is arranged in the same way, keeping the paragraphs of the text unchanged, the position unchanged, and the order unchanged).
  • the textual control may be used to indicate a space where text content can be obtained.
  • textual controls may include text presentation controls and text entry controls.
  • the textual control can be a short message display box, an instant messaging message display box, a memo, a notepad, and the like.
  • One or more textual controls can be displayed simultaneously on the touch screen. It should be noted that the textual controls displayed on the touch screen include textual controls that are not fully displayed on the touch screen.
  • the terminal device may acquire the intersection ratio of each textual control displayed on the touch screen and the touch area; and determine the target control based on the intersection ratio.
  • the terminal device may determine the textual control with the largest intersection ratio with the touch area as the target control.
  • the terminal device may determine a textual control whose intersection ratio with the touch area is the largest and whose intersection ratio is greater than a specified threshold as the target control.
  • the specified threshold can be set as required, for example, can be set to 85%, 90%, etc., which is not limited in the present disclosure.
  • step S604 since the target control is a control that can obtain text content. Therefore, the terminal device can directly acquire the second text information from the target control.
  • the second text information may be stored in attribute information of the target control.
  • step S605 the terminal device may adjust the first text information based on the second text information, so that the incorrect text content in the first text information becomes the correct text content. Because the text position of the first text information itself is accurate. Therefore, the position of the text in the third text information obtained after the adjustment of the first text information is accurate, and the text content is correct.
  • step S605 may include: comparing the characters in the first text information and the second text information corresponding to the same position on the touch screen; , and the characters in the second text information correspond to the characters in the same position on the touch screen and the contents are inconsistent, and are determined as target characters; replace the target characters in the first text information with the characters corresponding to the target characters on the touch screen. Characters in the second text information at the same position to obtain the third text information.
  • the first text information and the second text information are aligned first, and characters in the first text information and the second text information that correspond to the same position on the touch screen are found.
  • the first character of the first text information may be aligned with the first character of the second text information, and then the subsequent characters are compared in sequence to determine the matching rate (for example, the number of the same characters accounts for the percentage of the different characters). Quantity ratio); align the first character of the first text information with the second character of the second text information, and determine the matching rate again.
  • the last matching rate is determined. Find the alignment position with the largest matching rate as the final alignment position.
  • a matching rate greater than a certain threshold (which can be set as required, for example, can be set to 95%, 90%, etc.) may be determined, the alignment position corresponding to the matching rate may be used as the final alignment position , no further operations are to be performed. Then, the characters corresponding to the same position on the touch screen in the first text information and the second text information are compared. Based on the comparison results, replacement processing is performed for inconsistent situations. For example, based on Fig.
  • the terminal device 200 extracts the first text information "Integrated MOSFET switching power of 100mQ", and obtains the second text information "XL 1509-3.3E1 5G base station power chip features 2A continuous output current 8-
  • the 30V wide operating voltage input integrates a 100m ⁇ MOSFET switching power tube and the output is adjustable from 18 to 28V.”
  • the terminal device can determine that the characters in the first text message "Integrated 100mQ MOSFET switching power" are in turn with the first text. 2.
  • Each character in the text message "Integrated MOSFET switching power of 100m ⁇ " corresponds to the same position.
  • the terminal device may compare the characters in the same position in the first text information and the second text information.
  • the terminal device finds that the character "Q" in the first text information corresponding to the same position is different from the character " ⁇ " in the second text information. At this time, the terminal device can determine the character "Q" as the target character, so that the target character "Q” in the first text message "Integrated MOSFET switching power of 100mQ” is replaced with the character in the same position in the second text message" ⁇ " to get the final third text message "Integrated MOSFET switching work of 100m ⁇ ".
  • the text extraction method provided by the embodiments of the present disclosure can improve the correctness of the extracted text content.
  • the text extraction method provided by the embodiment of the present disclosure can improve the accuracy of the extracted text position, and saves the process of the user searching for the required text in the extraction result. That is to say, the text extraction method provided by the embodiments of the present disclosure can conveniently, quickly and accurately obtain the text information required by the user.
  • the matching rate may be determined according to the number of the target characters and the number of characters in the first text information. Then, when the matching rate is greater than the first threshold, the terminal device replaces the target character in the first text information with a character in the second text information corresponding to the target character at the same position on the touch screen, The third text information is obtained.
  • the matching rate may be a ratio of the number of characters other than the target character in the first text information to the number of characters in the first text information.
  • the first threshold may be set as required, for example, the first threshold may be 92%, 95%, etc., which is not limited in this embodiment of the present disclosure.
  • the matching rate is greater than the first threshold, it indicates that there is a small amount of wrongly extracted text content in the first text information, and the correctness of the first text information can be improved after adjustment. Therefore, when the matching rate is greater than the first threshold, the terminal device then replaces the target character in the first text information with a character in the second text information corresponding to the target character at the same position on the touch screen, to obtain the third text information.
  • the terminal device may re-align the first text information and the second text information or re-acquire the first text information and the second text information.
  • step S605 may include: detecting whether a character set satisfying a preset format exists in the second text information; and a character set satisfying the preset format exists in the second text information In the case of , extract a character set that satisfies the preset format from the second text information; replace the first text information with the extracted character set to obtain the third text information.
  • the character set of the preset format may include a password or a link, etc., and the embodiment of the present disclosure does not limit the preset format.
  • the terminal device may detect and extract a character set in a preset format for the second text information by using a regular expression or a natural language processing (Natural Language Processing, NLP) technology.
  • NLP Natural Language Processing
  • the text extraction method can determine the control to which a link or a password belongs by using OCR technology, and then automatically extract the link or password from the control, which can not only ensure the integrity and location accuracy of the link or password, but also can Ensure the correctness of the link or password, and operate quickly and easily.
  • the extracted character set is used to replace the first text information, and after obtaining the third text information, the terminal device may further provide the preset text information according to the third text information
  • the character set of the format corresponds to the service. For example, the terminal device can jump to the webpage corresponding to the link, and can also open the application corresponding to the password and jump to the corresponding details page, or copy the password and automatically jump to the corresponding details page when the corresponding application is opened.
  • FIG. 6 shows a schematic structural diagram of a text extraction apparatus according to an embodiment of the present disclosure.
  • the apparatus 80 may include:
  • a first acquiring module 81 configured to acquire a touch area in response to a touch operation on the touch screen
  • the extraction module 82 is used for extracting the first text information in the touch area obtained by the first obtaining module 81 through the optical character recognition OCR technology;
  • a determining module 83 configured to determine a target control matching the touch area from one or more textual controls displayed on the touch screen;
  • the second obtaining module 84 is configured to obtain second text information from the target control determined by the determining module 83;
  • the adjustment module 85 is configured to adjust the first text information extracted by the extraction module 82 based on the second text information acquired by the second acquisition module 84 to obtain third text information.
  • the first text information with the correct text position is accurately extracted by the OCR technology
  • the second text information with the correct text content is obtained by the control word extraction technology
  • the text is analyzed based on the second text information with the correct text content.
  • the determining module includes: a first acquiring unit, configured to acquire the intersection ratio of each textual control displayed on the touch screen and the touch area; the first determining unit, using The target control is determined based on the cross-union ratio.
  • the adjustment module includes: a comparison unit, configured to compare the characters corresponding to the same position on the touch screen in the first text information and the second text information; the second a determining unit, configured to determine the characters in the first text information and the characters in the second text information that correspond to the same position on the touch screen and have inconsistent contents as target characters; the first replacement unit is configured to replace the first A target character in a piece of text information is replaced with a character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information.
  • the first replacement unit is further configured to: determine a matching rate according to the number of the target characters and the number of characters in the first text information; when the matching rate is greater than the first In the case of the threshold value, the target character in the first text information is replaced with a character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information.
  • the adjustment module further includes: a detection unit for detecting whether a character set satisfying a preset format exists in the second text information; an extraction unit for When there is a character set that satisfies the preset format in the information, extract the character set that satisfies the preset format from the second text information; the second replacement unit is used to replace the character set with the extracted character set
  • the third text information is obtained from the first text information.
  • the apparatus further includes: a service module, configured to provide a service corresponding to the character set in the preset format according to the third text information.
  • the first obtaining module includes: a second obtaining unit, configured to obtain the position information of the starting touch point and the position information of the ending touch point in response to the touch operation; A third determining unit, configured to determine the touch area according to the position information of the start touch point and the position information of the end touch point.
  • the first obtaining module further includes: a loading unit, configured to load a region selection marker layer in response to the touch operation; and a fourth determination unit, configured to select a marker based on the region The confirmation operation of the layer determines the touch area.
  • the third determining unit is further configured to: in the case that the start touch point and the end touch point correspond to the same text line, according to the start touch point and the first area between the end touch point to determine the touch area.
  • the third determining unit is further configured to: in the case that the start touch point and the end touch point correspond to adjacent text lines, according to the start touch point
  • the touch area is determined by a second area between the point and the right border of the touch screen, and a third area between the end touch point and the left border of the touch screen.
  • the third determining unit is further configured to: in the case that the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, according to The fourth area between the start touch point and the right border of the touch screen, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the A sixth area between the end touch point and the left border of the touch screen is used to determine the touch area.
  • the third determining unit is further configured to: move the initial touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted starting touch point; moving the ending touch point to the positive x-axis and negative y-axis of the touch screen by a second distance to obtain the adjusted ending touch point; according to the adjusted starting touch point and the adjusted position information of the end touch point to determine the touch area.
  • Embodiments of the present disclosure provide a text extraction apparatus, comprising: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions.
  • Embodiments of the present disclosure provide a non-volatile computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the above method when executed by a processor.
  • Embodiments of the present disclosure provide a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
  • a computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device.
  • Computer-readable storage media include, but are not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing, for example.
  • Computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (Electrically Programmable Read-Only-Memory, EPROM or flash memory), static random access memory (Static Random-Access Memory, SRAM), portable compact disk read-only memory (Compact Disc Read-Only Memory, CD - ROM), Digital Video Disc (DVD), memory sticks, floppy disks, mechanically encoded devices, such as punch cards or raised structures in grooves on which instructions are stored, and any suitable combination of the foregoing .
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read-only memory
  • EPROM Errically Programmable Read-Only-Memory
  • SRAM static random access memory
  • portable compact disk read-only memory Compact Disc Read-Only Memory
  • CD - ROM Compact Disc Read-Only Memory
  • DVD Digital Video Disc
  • memory sticks floppy disks
  • Computer readable program instructions or code described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • the computer program instructions for carrying out the operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or in one or more source or object code written in any combination of programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages.
  • the computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer may be connected to the user's computer through any kind of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or, may be connected to an external computer (eg, use an internet service provider to connect via the internet).
  • electronic circuits such as programmable logic circuits, Field-Programmable Gate Arrays (FPGA), or Programmable Logic Arrays (Programmable Logic Arrays), are personalized by utilizing state information of computer-readable program instructions.
  • Logic Array, PLA the electronic circuitry can execute computer-readable program instructions to implement various aspects of the present disclosure.
  • These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in hardware (eg, circuits or ASICs (Application) that perform the corresponding functions or actions. Specific Integrated Circuit, application-specific integrated circuit)), or can be implemented by a combination of hardware and software, such as firmware.

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)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present disclosure relates to a text extraction method and apparatus, which are applied to the field of optical character recognition (OCR) in the field of artificial intelligence (AI). The method comprises: in response to a touch-control operation on a touch screen, acquiring a touch-control area; extracting first text information in the touch-control area by means of OCR technology; determining, from one or more textual controls displayed on the touch screen, a target control matching the touch-control area; acquiring second text information from the target control; and adjusting the first text information on the basis of the second text information, so as to obtain third text information. By means of the text extraction method and apparatus provided in the present disclosure, text information required by a user can be conveniently, quickly and accurately acquired.

Description

文本提取方法及装置Text extraction method and device
本申请要求于2020年11月27日提交中国专利局、申请号为202011362776.X、申请名称为“文本提取方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011362776.X and the application name "Text Extraction Method and Apparatus" filed with the China Patent Office on November 27, 2020, the entire contents of which are incorporated into this application by reference .
技术领域technical field
本公开涉及终端人工智能(Artificial Intelligence,AI)领域中的光学字符识别(Optical Character Recognition,OCR)领域,尤其涉及一种文本提取方法及装置。The present disclosure relates to the field of Optical Character Recognition (OCR) in the field of terminal artificial intelligence (Artificial Intelligence, AI), and in particular, to a text extraction method and device.
背景技术Background technique
在生活中,文字无处不在,文字是人们感知世界的重要手段。人工智能技术可以模拟、延伸和扩展人的意识和思维。获取文字信息是人工智能技术中的重要环节。In life, words are everywhere, and words are an important means for people to perceive the world. Artificial intelligence technology can simulate, extend and expand human consciousness and thinking. Obtaining text information is an important part of artificial intelligence technology.
OCR技术和控件取词技术是两种常见的获取文字信息的方式。OCR技术可以将图片或者纸张上的字符读取出来,并转换成计算机文字。然而,OCR技术对于人眼难以区分的文字无法准确地识别,例如OCR无法准确区分小写的L(即l)和大写的i(即I)。OCR技术对链接中的字符和口令类字符也无法准确的识别。控件取词技术获取到的文字虽然与原文完全一致,但是控件取词取到的是整个控件中的全部文本,需要用户在其中查找需要的部分,操作繁琐。OCR technology and control word extraction technology are two common ways to obtain text information. OCR technology can read out the characters on pictures or paper and convert them into computer text. However, OCR technology cannot accurately recognize characters that are difficult for human eyes to distinguish, for example, OCR cannot accurately distinguish lowercase L (ie l) and uppercase i (ie I). OCR technology can not accurately identify the characters and password characters in the link. Although the text obtained by the control word extraction technology is completely consistent with the original text, the control word extraction technology obtains all the text in the entire control, which requires the user to find the desired part, which is cumbersome to operate.
发明内容SUMMARY OF THE INVENTION
有鉴于此,提出了一种文本提取方法及装置,可以方便、快捷的以及准确地获取到用户需要的文本信息。In view of this, a text extraction method and device are proposed, which can conveniently, quickly and accurately obtain the text information required by the user.
第一方面,本公开的实施例提供了一种文本提取方法,包括:终端设备响应于触摸屏上的触控操作,获取触控区域,并通过OCR技术提取该触控区域内的文本信息,记为第一文本信息。终端设备从触摸屏上一个或多个能够获取到文字内容的文本性控件中,确定出与之前获取的触控区域匹配的目标控件,并从目标控件中获取文本信息,记为第二文本信息。终端设备基于第二文本信息对第一文本信息进行调整,得到最终的第三文本信息。这样,基于文字内容正确的第二文本信息对文字位置准确的第一文本信息进行调整,可以方便、快捷的获得位置准确、且内容正确的第三文字信息。In a first aspect, an embodiment of the present disclosure provides a text extraction method, including: a terminal device, in response to a touch operation on a touch screen, acquires a touch area, and extracts text information in the touch area through OCR technology, and records is the first text message. The terminal device determines a target control that matches the previously acquired touch area from one or more textual controls on the touch screen that can obtain text content, and obtains text information from the target control, which is recorded as second text information. The terminal device adjusts the first text information based on the second text information to obtain final third text information. In this way, by adjusting the first text information with accurate text position based on the second text information with correct text content, the third text information with accurate position and correct content can be obtained conveniently and quickly.
根据第一方面,在所述文本提取方法的第一种实现方式中,终端设备可以获取所述触摸屏上显示的各文本性控件与所述触控区域的交并比;基于所述交并比,确定出所述目标控件。这样,可以较为准确的确定出用户想要提取文本信息的控件,从而提升最终获取的文本信息在文字内容上的准确性。According to the first aspect, in the first implementation manner of the text extraction method, the terminal device may acquire the intersection ratio of each textual control displayed on the touch screen and the touch area; based on the intersection ratio , and determine the target control. In this way, the control from which the user wants to extract the text information can be more accurately determined, thereby improving the accuracy of the text content of the finally acquired text information.
根据第一方面,或者第一方面的第一种实现方式,在所述文本提取方法的第二种实现方式中,所述基于所述第二文本信息对所述第一文本信息进行调整,获得第三文本信息可以包括:对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比;将所述第一文本信息中,与第二文本信息中的字符对应于所述触摸屏上同一位置且内容不一致的字符,确定为目标字符;将第一文本信息中的目标字符替换为与所述目标字符对应 于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。这样,可以使OCR技术提取的文本信息成为文字内容更加正确的文本信息。According to the first aspect, or the first implementation manner of the first aspect, in a second implementation manner of the text extraction method, the first text information is adjusted based on the second text information to obtain The third text information may include: comparing the characters corresponding to the same position on the touch screen in the first text information and the second text information; comparing the first text information with the characters in the second text information The character corresponding to the same position and inconsistent content on the touch screen is determined as the target character; the target character in the first text information is replaced with the target character corresponding to the second text information on the touch screen at the same position characters in, the third text information is obtained. In this way, the text information extracted by the OCR technology can be made into text information with more accurate text content.
根据第一方面的第二种实现方式,在所述文本提取方法的第三种实现方式中,所述将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符可以包括:根据所述目标字符的数量与所述第一文本信息中字符的数量,确定匹配率;在所述匹配率大于第一阈值的情况下,将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。这样,通过在匹配率较大的情况下,进行字符替换,可以提高正确性。According to a second implementation manner of the first aspect, in a third implementation manner of the text extraction method, replacing the target character in the first text information with the target character corresponding to the same one on the touch screen The characters in the second text information of the position may include: determining a matching rate according to the number of the target characters and the number of characters in the first text information; in the case that the matching rate is greater than the first threshold, the first A target character in a piece of text information is replaced with a character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information. In this way, the correctness can be improved by performing character replacement when the matching rate is high.
根据第一方面,或者第一方面的第一种实现方式,在所述文本提取方法的第四种实现方式中,所述基于所述第二文本信息对所述第一文本信息进行调整,获得第三文本信息可以包括:检测所述第二文本信息中是否存在满足预设格式的字符集;在所述第二文本信息中存在满足所述预设格式的字符集的情况下,从所述第二文本信息中提取出满足所述预设格式的字符集;采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息。通过OCR技术确定链接或者口令所属的控件,然后自动从控件中提取出链接或者口令,既可以保证链接或者口令的完整性和位置准确性,又能够保证链接或者口令的正确性,同时操作快捷方便。According to the first aspect, or the first implementation manner of the first aspect, in a fourth implementation manner of the text extraction method, the first text information is adjusted based on the second text information to obtain The third text information may include: detecting whether a character set satisfying a preset format exists in the second text information; if there is a character set satisfying the preset format in the second text information, from the A character set satisfying the preset format is extracted from the second text information; the first text information is replaced with the extracted character set to obtain the third text information. OCR technology is used to determine the control to which the link or password belongs, and then the link or password is automatically extracted from the control, which can not only ensure the integrity and location accuracy of the link or password, but also ensure the correctness of the link or password, and the operation is fast and convenient. .
根据第一方面的第四种实现方式,在所述文本提取方法的第五种实现方式中,终端设备可以根据所述第三文本信息,提供与所述预设格式的字符集对应的服务。这样,可以提高服务效率,有利于提升用户满意度。According to a fourth implementation manner of the first aspect, in a fifth implementation manner of the text extraction method, the terminal device may provide a service corresponding to the character set in the preset format according to the third text information. In this way, service efficiency can be improved, and user satisfaction can be improved.
根据第一方面,或者以上第一方面的任意一种实现方式,在所述文本提取方法的第六种实现方式中,所述响应于触控操作,获取触控区域可以包括:响应于所述触控操作,获取起始触控点的位置信息和结束触控点的位置信息;根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域。这样,可以有效、准确地确定出用户需要获取文本信息的位置。According to the first aspect, or any implementation manner of the above first aspect, in a sixth implementation manner of the text extraction method, the acquiring a touch area in response to a touch operation may include: in response to the touch operation, obtain the position information of the start touch point and the position information of the end touch point; determine the touch area according to the position information of the start touch point and the position information of the end touch point . In this way, the position where the user needs to acquire the text information can be determined effectively and accurately.
根据所述第一方面,或者根据第一方面的第二种实现方式至第五种实现方式中的任意一种,在所述文本提取方法的第七种实现方式中,该文本提取方法还可以包括:响应于所述触控操作,加载区域选择标记层;基于所述区域选择标记层的确认操作,确定所述触控区域。这样,可以使得触控区域的选择更加准确,从而进一步提高了文本信息位置的准确性。According to the first aspect, or according to any one of the second implementation manner to the fifth implementation manner of the first aspect, in the seventh implementation manner of the text extraction method, the text extraction method may also The method includes: loading an area selection marking layer in response to the touch operation; and determining the touch area based on a confirming operation of the area selection marking layer. In this way, the selection of the touch area can be made more accurate, thereby further improving the accuracy of the position of the text information.
根据第一方面的第六种实现方式,在所述文本提取方法的第八种实现方式中,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域可以包括:在所述起始触控点与所述结束触控点对应同一文本行的情况下,根据所述起始触控点和所述结束触控点之间的第一区域,确定所述触控区域。这样可以实现在同一文本行内准确地获取文本信息。According to a sixth implementation manner of the first aspect, in an eighth implementation manner of the text extraction method, the determining according to the position information of the start touch point and the position information of the end touch point The touch area may include: in the case that the start touch point and the end touch point correspond to the same text line, according to the first touch point between the start touch point and the end touch point. an area, determining the touch area. In this way, text information can be accurately obtained within the same text line.
根据第一方面的第六种实现方式,在所述文本提取方法的第九种实现方式中,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域可以包括:在所述起始触控点和所述结束触控点对应相邻文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第二区域,以及所述结束触控点和所述触摸屏的左边界之间的第三区域,确定所述触控区域。这样可以实现在相邻文本行内准确地获取文本信息。According to a sixth implementation manner of the first aspect, in a ninth implementation manner of the text extraction method, the determining according to the position information of the start touch point and the position information of the end touch point The touch area may include: in the case that the start touch point and the end touch point correspond to adjacent text lines, according to the difference between the start touch point and the right border of the touch screen. The second area, and the third area between the end touch point and the left border of the touch screen, determine the touch area. In this way, text information can be accurately obtained in adjacent text lines.
根据第一方面的第六种实现方式,在所述文本提取方法的第十种实现方式中,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域包括:在所述 起始触控点和所述结束触控点对应的文本行相隔一个或多个文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第四区域、所述起始触控点对应文本行与所述结束触控点对应文本行之间的第五区域,以及所述结束触控点和所述触摸屏的左边界之间的第六区域,确定所述触控区域。这样可以实现在较大范围内准确地获取文本信息。According to a sixth implementation manner of the first aspect, in a tenth implementation manner of the text extraction method, the determining according to the position information of the start touch point and the position information of the end touch point The touch area includes: when the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, according to the start touch point and the touch screen. The fourth area between the right borders, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the end touch point and the left border of the touch screen The sixth area between them determines the touch area. In this way, text information can be accurately acquired in a large range.
根据第一方面的第八种实现方式至第十种实现方式中的任意一种,在所述文本提取方法的第十一种实现方式中,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域可以包括:将所述起始触控点向所述触摸屏的y轴正向和x轴负向移动第一距离,得到调整后的起始触控点;将所述结束触控点向所述触摸屏的x轴正向和y轴负向移动第二距离,得到调整后的结束触控点;根据调整后的起始触控点的位置信息和调整后的结束触控点的位置信息,确定所述触控区域。这样可以略微扩大触控区域,降低因用户视觉触控点和实际触控点不一致而造成的文字漏选的影响,提高位置标记的准确性。According to any one of the eighth implementation manner to the tenth implementation manner of the first aspect, in an eleventh implementation manner of the text extraction method, the position information according to the starting touch point and the position information of the end touch point, determining the touch area may include: moving the start touch point to the positive y-axis and negative x-axis of the touch screen by a first distance, and obtaining the adjusted move the end touch point to the positive x-axis and negative y-axis of the touch screen by a second distance to obtain the adjusted end touch point; The position information of the point and the adjusted position information of the end touch point are used to determine the touch area. In this way, the touch area can be slightly enlarged, the influence of missing text selection caused by the inconsistency between the user's visual touch point and the actual touch point can be reduced, and the accuracy of the position marking can be improved.
第二方面,本公开的实施例提供了一种文本提取装置,包括:第一获取模块,用于响应于触摸屏上的触控操作,获取触控区域;提取模块,用于通过光学字符识别OCR技术提取所述第一获取模块获取的触控区域内的第一文本信息;确定模块,用于从所述触摸屏上显示一个或多个文本性控件中确定出与所述触控区域匹配的目标控件;第二获取模块,用于从所述确定模块确定的目标控件中获取第二文本信息;调整模块,用于基于所述第二获取模块获取的第二文本信息对所述提取模块提取的第一文本信息进行调整,获得第三文本信息。In a second aspect, embodiments of the present disclosure provide a text extraction device, including: a first acquisition module, used for acquiring a touch area in response to a touch operation on a touch screen; and an extraction module, used for optical character recognition (OCR) The technology extracts the first text information in the touch area acquired by the first acquisition module; the determination module is used to determine the target matching the touch area from one or more textual controls displayed on the touch screen a control; a second acquisition module for acquiring second text information from the target control determined by the determination module; an adjustment module for extracting the text information extracted by the extraction module based on the second text information acquired by the second acquisition module The first text information is adjusted to obtain third text information.
根据第二方面,在所述文本提取装置的第一种实现方式中,所述确定模块包括:第一获取单元,用于获取所述触摸屏上显示的各文本性控件与所述触控区域的交并比;第一确定单元,用于基于所述交并比,确定出所述目标控件。According to the second aspect, in a first implementation manner of the text extraction apparatus, the determining module includes: a first acquiring unit, configured to acquire the relationship between each textual control displayed on the touch screen and the touch area cross-merger ratio; a first determining unit, configured to determine the target control based on the cross-merger ratio.
根据第二方面,或者第二方面的第一种实现方式,在所述文本提取装置的第二种实现方式中,所述调整模块包括:对比单元,用于对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比;第二确定单元,用于将所述第一文本信息中,与第二文本信息中的字符对应于所述触摸屏上同一位置且内容不一致的字符,确定为目标字符;第一替换单元,用于将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。According to the second aspect, or the first implementation manner of the second aspect, in a second implementation manner of the text extraction apparatus, the adjustment module includes: a comparison unit, configured to compare the first text information with the all The characters in the second text information corresponding to the same position on the touch screen are compared; the second determination unit is used to compare the characters in the first text information and the second text information corresponding to the same characters on the touch screen. A character whose position and content are inconsistent is determined as a target character; a first replacement unit is used to replace the target character in the first text information with the target character in the second text information corresponding to the same position on the touch screen. character to obtain the third text information.
根据第二方面的第二种实现方式,在所述文本提取装置的第三种实现方式中,所述第一替换单元还用于:根据所述目标字符的数量与所述第一文本信息中字符的数量,确定匹配率;在所述匹配率大于第一阈值的情况下,将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。According to a second implementation manner of the second aspect, in a third implementation manner of the text extraction apparatus, the first replacement unit is further configured to: according to the number of the target characters and the amount of the first text information The number of characters to determine the matching rate; when the matching rate is greater than the first threshold, replace the target character in the first text information with the second text information corresponding to the target character at the same position on the touch screen characters in, the third text information is obtained.
根据第二方面,或者第二方面的第一种实现方式,在所述文本提取装置的第四种实现方式中,所述调整模块还包括:检测单元,用于检测所述第二文本信息中是否存在满足预设格式的字符集;提取单元,用于在所述第二文本信息中存在满足所述预设格式的字符集的情况下,从所述第二文本信息中提取出满足所述预设格式的字符集;第二替换单元,用于采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息。According to the second aspect, or the first implementation manner of the second aspect, in a fourth implementation manner of the text extraction apparatus, the adjustment module further includes: a detection unit configured to detect the second text information in the Whether there is a character set that meets the preset format; an extraction unit, configured to extract a character set that meets the preset format from the second text information when there is a character set that meets the preset format in the second text information. A character set in a preset format; and a second replacement unit, configured to replace the first text information with the extracted character set to obtain the third text information.
根据第二方面的第四种实现方式,在所述文本提取装置的第五种实现方式中,所述装置还包括:服务模块,用于根据所述第三文本信息,提供与所述预设格式的字符集对应的服务。According to a fourth implementation manner of the second aspect, in a fifth implementation manner of the text extraction apparatus, the apparatus further includes: a service module, configured to provide and the preset according to the third text information The character set of the format corresponds to the service.
根据第二方面,或者以上第二方面的任意一种实现方式,在所述文本提取装置的第六种实现方式中,所述第一获取模块包括:第二获取单元,用于响应于所述触控操作,获取起始 触控点的位置信息和结束触控点的位置信息;第三确定单元,用于根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域。According to the second aspect, or any implementation manner of the above second aspect, in a sixth implementation manner of the text extraction apparatus, the first acquiring module includes: a second acquiring unit, configured to respond to the For touch operation, the position information of the start touch point and the position information of the end touch point are obtained; the third determination unit is used for obtaining the position information of the start touch point and the end touch point according to the position information of the start touch point and the end touch point. to determine the touch area.
根据所述第二方面,或者根据第二方面的第二种实现方式至第五种实现方式中的任意一种,在所述文本提取装置的第七种实现方式中,所述第一获取模块还包括:加载单元,用于响应于所述触控操作,加载区域选择标记层;第四确定单元,用于基于所述区域选择标记层的确认操作,确定所述触控区域。。According to the second aspect, or according to any one of the second implementation manner to the fifth implementation manner of the second aspect, in a seventh implementation manner of the text extraction apparatus, the first acquiring module It also includes: a loading unit for loading the area selection marking layer in response to the touch operation; and a fourth determining unit for determining the touch area based on the confirmation operation of the area selection marking layer. .
根据第二方面的第六种实现方式,在所述文本提取装置的第八种实现方式中,所述第三确定单元还用于:在所述起始触控点与所述结束触控点对应同一文本行的情况下,根据所述起始触控点和所述结束触控点之间的第一区域,确定所述触控区域。According to a sixth implementation manner of the second aspect, in an eighth implementation manner of the text extraction apparatus, the third determining unit is further configured to: select between the start touch point and the end touch point In the case of corresponding to the same text line, the touch area is determined according to the first area between the start touch point and the end touch point.
根据第二方面的第六种实现方式,在所述文本提取装置的第九种实现方式中,所述第三确定单元还用于:在所述起始触控点和所述结束触控点对应相邻文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第二区域,以及所述结束触控点和所述触摸屏的左边界之间的第三区域,确定所述触控区域。According to a sixth implementation manner of the second aspect, in a ninth implementation manner of the text extraction apparatus, the third determining unit is further configured to: at the start touch point and the end touch point In the case of corresponding adjacent text lines, according to the second area between the start touch point and the right border of the touch screen, and the third area between the end touch point and the left border of the touch screen area to determine the touch area.
根据第二方面的第六种实现方式,在所述文本提取装置的第十种实现方式中,所述第三确定单元还用于:在所述起始触控点和所述结束触控点对应的文本行相隔一个或多个文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第四区域、所述起始触控点对应文本行与所述结束触控点对应文本行之间的第五区域,以及所述结束触控点和所述触摸屏的左边界之间的第六区域,确定所述触控区域。According to a sixth implementation manner of the second aspect, in a tenth implementation manner of the text extraction apparatus, the third determining unit is further configured to: at the start touch point and the end touch point When the corresponding text lines are separated by one or more text lines, according to the fourth area between the starting touch point and the right border of the touch screen, the text line corresponding to the starting touch point and the The end touch point corresponds to the fifth area between the text lines, and the sixth area between the end touch point and the left border of the touch screen, to determine the touch area.
根据第二方面的第八种实现方式至第十种实现方式中的任意一种,在所述文本提取装置的第十种实现方式中,所述第三确定单元还用于:将所述起始触控点向所述触摸屏的y轴正向和x轴负向移动第一距离,得到调整后的起始触控点;将所述结束触控点向所述触摸屏的x轴正向和y轴负向移动第二距离,得到调整后的结束触控点;根据调整后的起始触控点的位置信息和调整后的结束触控点的位置信息,确定所述触控区域。According to any one of the eighth implementation manner to the tenth implementation manner of the second aspect, in the tenth implementation manner of the text extraction apparatus, the third determining unit is further configured to: Move the starting touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted starting touch point; move the ending touch point to the positive and negative x-axis of the touch screen The y-axis is moved in the negative direction by a second distance to obtain the adjusted end touch point; the touch area is determined according to the adjusted position information of the start touch point and the adjusted position information of the end touch point.
第三方面,本公开的实施例提供了一种终端设备,该终端设备可以执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的文本提取方法。In a third aspect, an embodiment of the present disclosure provides a terminal device, which can execute the first aspect or one or more of the text extraction methods in multiple possible implementations of the first aspect.
第四方面,本公开的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的文本提取方法。In a fourth aspect, embodiments of the present disclosure provide a computer program product, comprising computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in an electronic When running in the device, the processor in the electronic device executes the first aspect or one or more of the text extraction methods in the multiple possible implementation manners of the first aspect.
在本公开实施例中,通过OCR技术准确地提取到文字位置准确的第一文本信息,通过控件取词技术获取到文字内容正确的第二文本信息,基于文字内容正确的第二文本信息对文字位置准确的第一文本信息进行调整,可以方便、快捷的获得位置准确、且内容正确的第三文字信息。In the embodiment of the present disclosure, the first text information with the correct text position is accurately extracted by the OCR technology, the second text information with the correct text content is obtained by the control word extraction technology, and the text is analyzed based on the second text information with the correct text content. By adjusting the first text information with the accurate position, the third text information with the accurate position and correct content can be obtained conveniently and quickly.
本公开的这些和其他方面在以下(多个)实施例的描述中会更加简明易懂。These and other aspects of the present disclosure will be more clearly understood in the following description of the embodiment(s).
附图说明Description of drawings
包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本公开的示例性实施例、特征和方面,并且用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure, and together with the description, serve to explain the principles of the disclosure.
图1示出本公开实施例提供的文本提取方法的实施环境示意图;FIG. 1 shows a schematic diagram of an implementation environment of a text extraction method provided by an embodiment of the present disclosure;
图2a、图2b和图2c分别示出触摸屏显示的应用界面的示例性示意图;Fig. 2a, Fig. 2b and Fig. 2c respectively show exemplary schematic diagrams of the application interface displayed by the touch screen;
图3a、图3b、图3c、图3d和图3e分别示出触控区域的示例性示意图;Fig. 3a, Fig. 3b, Fig. 3c, Fig. 3d and Fig. 3e show exemplary schematic diagrams of the touch area, respectively;
图4示出了根据本公开一实施例的终端设备200的结构示意图;FIG. 4 shows a schematic structural diagram of a terminal device 200 according to an embodiment of the present disclosure;
图5示出本公开实施例的文本提取方法的流程图;5 shows a flowchart of a text extraction method according to an embodiment of the present disclosure;
图6示出本公开实施例的文本提取装置的结构示意图。FIG. 6 shows a schematic structural diagram of a text extraction apparatus according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures denote elements that have the same or similar functions. While various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
另外,为了更好的说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present disclosure may be practiced without certain specific details. In some instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the present disclosure.
图1示出本公开实施例提供的文本提取方法的实施环境示意图。参见图1,该实施环境中包括触控媒介100和终端设备200。该触控媒介可以包括触控笔101和用户手指102等。该终端设备200可以是具有触摸屏的任意终端设备,该终端设备200包括而不限于手机、平板电脑、笔记本电脑、电视机、膝上计算机、台式计算机、移动电话、多媒体播放器、电子阅读器、智能车载设备、智能家电、人工智能设备、可穿戴电子设备(如智能手表等)、物联网设备、虚拟现实/增强现实/混合现实设备等。FIG. 1 shows a schematic diagram of an implementation environment of a text extraction method provided by an embodiment of the present disclosure. Referring to FIG. 1 , the implementation environment includes a touch medium 100 and a terminal device 200 . The touch medium may include a stylus 101, a user's finger 102, and the like. The terminal device 200 can be any terminal device with a touch screen, and the terminal device 200 includes but is not limited to mobile phones, tablet computers, notebook computers, televisions, laptop computers, desktop computers, mobile phones, multimedia players, e-readers, Smart vehicle devices, smart home appliances, artificial intelligence devices, wearable electronic devices (such as smart watches, etc.), IoT devices, virtual reality/augmented reality/mixed reality devices, etc.
终端设备200可以安装多种应用,例如即时通信应用、电商应用、游戏应用、社交应用、社区应用、新闻应用、音频播放应用、视频播放应用、直播应用、浏览器应用、旅游应用、金融应用、运动应用、拍摄应用、图像处理应用、音视频处理引用、阅读应用、外卖应用、菜谱应用、导航应用、交通票务应用、信息记录应用、邮箱应用、健康医疗应用、资源管理应用等。终端设备200安装的应用可以是独立的应用,也可以是嵌入式应用,即小程序。The terminal device 200 can install various applications, such as instant messaging applications, e-commerce applications, game applications, social networking applications, community applications, news applications, audio playback applications, video playback applications, live broadcast applications, browser applications, travel applications, and financial applications. , sports application, shooting application, image processing application, audio and video processing reference, reading application, takeaway application, recipe application, navigation application, traffic ticketing application, information recording application, mailbox application, health care application, resource management application, etc. The application installed on the terminal device 200 may be an independent application or an embedded application, that is, a small program.
在一些可能的实现方式中,终端设备200的触摸屏可以显示应用的界面,应用的界面中可以包括一个或多个文本性控件。其中,文本性控件可以用于表示能够获取到文字内容的控件,例如,文字展示控件、文字输入控件等。举例来说,文本性控件可以为即时通信应用中的聊天框、信息记录应用中的输入框、阅读应用中展示电子书的区域、菜谱应用中展示菜谱文字内容的区域、新闻应用中展示文字区域的内容、浏览器应用中展示文字内容的区域等。文本性控件中提取的文字信息包括而不限于用户名、密码、链接、词语、句子、段落、文章等内容。文本性控件中提取的文字信息包括而不限于符号、数字、中文、英文、日文、韩文、西班牙文、德文、法文等形式。本公开实施例对终端设备200中显示的应用、应用中包括的文本性控件、文本性控件中提取的文字信息不做限制。In some possible implementations, the touch screen of the terminal device 200 may display an application interface, and the application interface may include one or more textual controls. The textual control may be used to represent a control that can obtain text content, for example, a text display control, a text input control, and the like. For example, the textual control can be a chat box in an instant messaging application, an input box in an information recording application, an area for displaying e-books in a reading application, an area for displaying the text content of a recipe in a recipe application, and an area for displaying text in a news application. content, the area where the text content is displayed in the browser application, etc. The text information extracted from the textual controls includes but is not limited to user names, passwords, links, words, sentences, paragraphs, articles and other contents. The text information extracted from the textual controls includes but is not limited to the forms of symbols, numbers, Chinese, English, Japanese, Korean, Spanish, German, French, and the like. The embodiments of the present disclosure do not limit the applications displayed in the terminal device 200, the textual controls included in the applications, and the textual information extracted from the textual controls.
图2a、图2b和图2c分别示出触摸屏显示的应用界面的示例性示意图。在一个示例中,终端设备200的触摸屏可以显示图2a所示的即时通信应用的界面。参见图2a,该即时通信应用的界面中的文本性控件可以包括聊天信息展示框和聊天信息输入框。举例来说,从聊天 信息展示框中获取到文字内容可以包括“我买了10号的话剧票,一起去看吧”、“好呀好呀”、“都有哪些演员啊”、“上面这个链接有详细介绍,你看一下”等;从聊天信息输入框中获取到的文字信息可以包括“好的,我看一下”等。在又一示例中,终端设备200的触摸屏可以显示图2b所示的社区应用的界面。参见图2b,该社区应用的界面中的文本性控件可以包括展示框中的文字展示区和搜索框。举例来说,从文字展示区中获取到的文字信息可以包括“帮忙推荐杭州三日游攻略”、“第一天……结束”、“景点介绍可参考……”、“景点购票可点击……”等。从搜索框中获取到的文字信息可以包括“杭州游记”(未示出)等。在又一示例中,终端设备200的触摸屏可以显示图2c所示的浏览器应用的界面。参见图2c,该浏览器应用的界面中的文本性控件可以包括文字展示区。举例来说,从文字展示区中获取到的文字信息可以包括“XL……可调”和“芯片介绍”等。Fig. 2a, Fig. 2b and Fig. 2c respectively show exemplary schematic diagrams of application interfaces displayed on the touch screen. In one example, the touch screen of the terminal device 200 may display the interface of the instant messaging application shown in FIG. 2a. Referring to Fig. 2a, the textual controls in the interface of the instant messaging application may include a chat information display box and a chat information input box. For example, the text content obtained from the chat information display box can include "I bought a ticket for the drama on the 10th, let's watch it together", "Okay, okay", "Who are the actors?", "The above The link has a detailed introduction, please take a look", etc.; the text information obtained from the chat information input box can include "OK, let me take a look" and so on. In yet another example, the touch screen of the terminal device 200 may display the interface of the community application shown in FIG. 2b. Referring to Fig. 2b, the textual controls in the interface of the community application may include a text display area and a search box in the display box. For example, the text information obtained from the text display area can include "Help recommend a three-day tour guide in Hangzhou", "The first day...end", "The introduction of attractions can be referred to...", "Tickets for attractions can be clicked" ……"Wait. The text information obtained from the search box may include "Hangzhou Travel Notes" (not shown) and the like. In yet another example, the touch screen of the terminal device 200 may display the interface of the browser application shown in FIG. 2c. Referring to Fig. 2c, the textual controls in the interface of the browser application may include a text display area. For example, the text information obtained from the text display area may include "XL... adjustable" and "chip introduction".
在一种可能的实现方式中,用户可以通过触控笔101和用户手指102等触控媒介在终端设备200的触摸屏上执行触控操作(例如:点击、双击、滑动、双指按压等操作)。终端设备200可以包括响应于上述触控操作,获取触控区域。In a possible implementation manner, the user may perform touch operations (for example, operations such as clicking, double-clicking, sliding, two-finger pressing, etc.) on the touch screen of the terminal device 200 through touch media such as the stylus 101 and the user's finger 102 . . The terminal device 200 may include acquiring the touch area in response to the above touch operation.
图3a、图3b、图3c、图3d和图3e分别示出触控区域的示例性示意图。3a, 3b, 3c, 3d, and 3e show exemplary schematic diagrams of the touch area, respectively.
在一种可能的实现方式中,用户执行的触控操作可以用于确定起始触控点和结束触控点,终端设备可以基于起始触控点和结束触控点,确定触控区域。In a possible implementation manner, the touch operation performed by the user may be used to determine the start touch point and the end touch point, and the terminal device may determine the touch area based on the start touch point and the end touch point.
参见图3a,基于图2c所示的应用界面,用户可以通过手指在终端设备200的触摸屏上执行双指按压操作。终端设备200响应于该双指按压操作,可以获取到两个触控点(记为起始触控点和结束触控点)的位置信息。终端设备200通过OCR技术将界面划分为多个文本行。终端设备200可以根据起始触控点的位置信息和结束触控点的位置信息确定起始触控点对应的文本行(记为第一文本行)和结束触控点对应的文本行(记为第二文本行)。如图3a所示,第一文本行和第二文本行为同一文本行,终端设备200可以根据起始触控点和结束触控点之间的区域(记为第一区域)确定触控区域。Referring to FIG. 3 a , based on the application interface shown in FIG. 2 c , the user can perform a two-finger pressing operation on the touch screen of the terminal device 200 with a finger. In response to the two-finger pressing operation, the terminal device 200 can acquire position information of two touch points (referred to as the start touch point and the end touch point). The terminal device 200 divides the interface into multiple text lines through the OCR technology. The terminal device 200 can determine the text line corresponding to the starting touch point (denoted as the first text line) and the text line corresponding to the ending touch point (denoted as the first text line) according to the position information of the start touch point and the position information of the end touch point. for the second line of text). As shown in FIG. 3a, the first text line and the second text line are the same text line, and the terminal device 200 may determine the touch area according to the area between the start touch point and the end touch point (referred to as the first area).
参见图3b,基于图2c所示的应用界面,用户可以通过手指在终端设备200的触摸屏上执行滑动操作。终端设备200可以根据滑动操作的起始点和结束点确定起始触控点和结束触控点,并确定出第一文本行和第二文本行。如图3b所示,第一文本行和第二文本行为同一文本行,终端设备200可以根据起始触控点和结束触控点之间的第一区域确定触控区域。Referring to Fig. 3b, based on the application interface shown in Fig. 2c, the user can perform a sliding operation on the touch screen of the terminal device 200 with a finger. The terminal device 200 may determine the start touch point and the end touch point according to the start point and end point of the sliding operation, and determine the first text line and the second text line. As shown in FIG. 3b, the first text line and the second text line are the same text line, and the terminal device 200 may determine the touch area according to the first area between the start touch point and the end touch point.
参见图3c,基于图2c所示的应用界面,用户可以通过手指在终端设备200的触摸屏上执行两次点击(单击或者双击等)操作。终端设备200可以根据检测到的两个点击点确定起始触控点和结束触控点,并确定出第一文本行和第二文本行。如图3c所示,第一文本行和第二文本行为相邻文本行,终端设备200可以根据起始触控点和触摸屏的右边界之间的区域(记为第二区域)和结束触控点和触摸屏的左边界之间的区域(记为第三区域)确定触控区域。Referring to FIG. 3c, based on the application interface shown in FIG. 2c, the user can perform two clicks (single-click or double-click, etc.) operations on the touch screen of the terminal device 200 with a finger. The terminal device 200 may determine the start touch point and the end touch point according to the detected two click points, and determine the first text line and the second text line. As shown in FIG. 3c , the first text line and the second text line are adjacent text lines, and the terminal device 200 can end the touch according to the area between the starting touch point and the right border of the touch screen (referred to as the second area) and ending the touch The area between the point and the left border of the touch screen (denoted as the third area) determines the touch area.
参见图3d,基于图2c所示的应用界面,用户可以通过手指在终端设备200的触摸屏上执行滑动操作。终端设备200可以根据滑动操作的起始点和结束点确定起始触控点和结束触控点,并确定出第一文本行和第二文本行。如图3d所示,第一文本行和第二文本行之间相隔两个文本行,终端设备200可以根据起始触控点和触摸屏的右边界之间的区域(记为第四区域,可参照第二区域)、第一文本行和第二文本行之间的区域(记为第五区域)、以及结束触控点和触摸屏的左边界之间的区域(记为第六区域,可参照第三区域)确定触控区域。Referring to FIG. 3d, based on the application interface shown in FIG. 2c, the user can perform a sliding operation on the touch screen of the terminal device 200 with a finger. The terminal device 200 may determine the start touch point and the end touch point according to the start point and end point of the sliding operation, and determine the first text line and the second text line. As shown in FIG. 3d, two text lines are separated between the first text line and the second text line. Refer to the second area), the area between the first text line and the second text line (marked as the fifth area), and the area between the end touch point and the left border of the touch screen (marked as the sixth area, refer to The third area) determines the touch area.
在一种可能的实现方式中,第一区域、第二区域、第三区域、第四区域、第五区域和第 六区域可以为矩形区域。当然,第一区域至第六区域还可以为其他形状的区域,例如椭圆区域、梯形区域、六边形区域和八边形区域等,对此本公开不做限制。In a possible implementation manner, the first area, the second area, the third area, the fourth area, the fifth area and the sixth area may be rectangular areas. Certainly, the first to sixth regions may also be regions of other shapes, such as elliptical regions, trapezoidal regions, hexagonal regions, and octagonal regions, which are not limited in the present disclosure.
需要说明的是,在本公开实施例中,起始触控点和结束触控点是基于其在触摸屏中的相对位置确定的,与文字内容的顺序一致。举例来说,在第一文本行和第二文本行为同一文本行的情况下,起始触控点位于结束触控点的左侧;在第一文本行和第二文本行为不同文本行的情况下,起始触控点位于结束触控点的上方。It should be noted that, in the embodiment of the present disclosure, the start touch point and the end touch point are determined based on their relative positions on the touch screen, which are consistent with the order of the text content. For example, when the first text line and the second text line are the same text line, the start touch point is located to the left of the end touch point; when the first text line and the second text line are different text lines , the start touch point is above the end touch point.
在一种可能的实现方式中,触控操作还可以用于触发区域选择。终端设备响应于该触控操作,可以加载区域选择标记层,基于该区域选择标记层的确认操作,确定触控区域。In a possible implementation manner, the touch operation can also be used to trigger area selection. In response to the touch operation, the terminal device may load the area selection marker layer, and determine the touch area based on the confirmation operation of the area selection marker layer.
参见图3e,基于图2c所示的应用界面,终端设备200响应于长按屏幕、触发标记控件等触控操作,显示区域选择标记层。用户可以对该区域选择标记层的位置进行调整。在调整完成后,用户可以点击“√”控件执行确认区域选择标记层的确认操作。终端设备300响应于区域选择标记层的确认操作,可以依据区域选择标记层的位置,确定触控区域。这样,可以使得触控区域的选择更加准确,从而进一步提高了文本信息位置的准确性。Referring to FIG. 3e, based on the application interface shown in FIG. 2c, the terminal device 200 displays the area selection marker layer in response to touch operations such as long-pressing the screen and triggering the marker control. The user can adjust the position of the region selection marker layer. After the adjustment is completed, the user can click the "√" control to perform the confirmation operation of selecting the mark layer in the confirmation area. In response to the confirmation operation of the area selection marker layer, the terminal device 300 may determine the touch area according to the position of the area selection marker layer. In this way, the selection of the touch area can be made more accurate, thereby further improving the accuracy of the position of the text information.
参照图2a和图2b可知,终端设备200的触摸屏中可以显示一个文本性控件,也可以同时显示了多个文本性控件。终端设备200可以在检测到触摸屏上的触控操作时,确定触摸屏上当前显示的所有文本性控件。之后,终端设备200可以从这些文本性控件中,确定出与触控区域匹配的目标控件。在一个示例中,终端设备200可以获取触摸屏上显示的各文本性控件与触控区域的交并比,基于交并比,确定出目标控件。例如,将对应交并比最大的文本性控件确定为目标控件。可以理解的是,终端设备200的触摸屏上显示的文本性控件的位置,可以从当前触摸屏上显示的应用中获取。Referring to FIG. 2a and FIG. 2b, it can be known that the touch screen of the terminal device 200 may display one textual control, or may simultaneously display multiple textual controls. The terminal device 200 may determine all textual controls currently displayed on the touch screen when detecting a touch operation on the touch screen. Afterwards, the terminal device 200 may determine a target control matching the touch area from these textual controls. In one example, the terminal device 200 may acquire the intersection ratio of each textual control displayed on the touch screen and the touch area, and determine the target control based on the intersection ratio. For example, the textual control with the largest corresponding union ratio is determined as the target control. It can be understood that, the position of the textual control displayed on the touch screen of the terminal device 200 can be obtained from the application currently displayed on the touch screen.
在终端设备200获取到触控区域后,可以通过OCR技术提取出触控区域内的第一文本信息。终端设备200在确定出目标控件后,可以直接从目标控件中直接获取第二文本信息。由于第一文本信息具有更加准确的位置信息,第二文本信息具有更加准确的文字内容,因此,终端设备200可以基于第二文本信息对第一文本信息进行调整,更新第一文本信息中不太准确的部分,从而得到位置准确且内容准确的第三文本信息。After the terminal device 200 acquires the touch area, the first text information in the touch area can be extracted by using the OCR technology. After determining the target widget, the terminal device 200 can directly acquire the second text information from the target widget. Since the first text information has more accurate location information, and the second text information has more accurate text content, the terminal device 200 can adjust the first text information based on the second text information, and update the first text information that is not very accurate. accurate part, so as to obtain the third text information with accurate position and accurate content.
举例来说,基于图3a,终端设备200提取到第一文本信息“集成了100mQ的MOSFET开关功”,获取到第二文本信息“XL 1509-3.3E1 5G基站电源芯片特点2A连续输出电流8-30V宽工作电压输入集成了100mΩ的MOSFET开关功率管输出18-28V可调”。终端设备200采用该第二文本信息对第一文本信息进行调整,得到第三文本信息“集成了100mΩ的MOSFET开关功”。For example, based on Fig. 3a, the terminal device 200 extracts the first text information "Integrated MOSFET switching power of 100mQ", and obtains the second text information "XL 1509-3.3E1 5G base station power chip features 2A continuous output current 8- The 30V wide operating voltage input integrates a 100mΩ MOSFET switching power tube and the output is adjustable from 18-28V". The terminal device 200 uses the second text information to adjust the first text information, and obtains the third text information "Integrated MOSFET switching power of 100 mΩ".
图4示出了根据本公开一实施例的终端设备200的结构示意图。FIG. 4 shows a schematic structural diagram of a terminal device 200 according to an embodiment of the present disclosure.
终端设备200可以包括处理器210,外部存储器接口220,内部存储器221,USB接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块251,无线通信模块252,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及SIM卡接口295等。其中传感器模块280可以包括触摸传感器280K,(当然,终端设备200还可以包括其它传感器,比如陀螺仪传感器,加速度传感器,接近光传感器、指纹传感器、温度传感器,压力传感器、距离传感器、磁传感器、环境光传感器、气压传感器、骨传导传感器等,图中未示出)。The terminal device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 251, and a wireless communication module 252 , audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 and so on. The sensor module 280 may include a touch sensor 280K, (of course, the terminal device 200 may also include other sensors, such as a gyroscope sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an environmental sensor light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是终端设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 210 may include one or more processing units, for example, the processor 210 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), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. The controller may be the nerve center and command center of the terminal device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
处理器210可以运行本公开实施例提供的文本提取方法,以便于方便、快捷、准确的提获得用户需要的文本信息。处理器210可以包括不同的器件,比如集成CPU和GPU时,CPU和GPU可以配合执行本公开实施例提供的文本提取方法,比如文本提取方法中部分算法由CPU执行,另一部分算法由GPU执行,以得到较快的处理效率。The processor 210 may execute the text extraction method provided by the embodiment of the present disclosure, so as to conveniently, quickly and accurately extract the text information required by the user. The processor 210 may include different devices. For example, when a CPU and a GPU are integrated, the CPU and the GPU may cooperate to execute the text extraction method provided by the embodiments of the present disclosure. for faster processing efficiency.
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端设备200可以包括1个或N个显示屏294,N为大于1的正整数。显示屏294可用于显示由用户输入的信息或提供给用户的信息以及各种图形用户界面(graphical user interface,GUI)。例如,显示器294可以显示照片、视频、网页、或者文件等。再例如,显示器294可以显示图形用户界面。其中,图形用户界面上包括状态栏、可隐藏的导航栏、时间和天气小组件(widget)、以及应用的图标,例如浏览器图标等。状态栏中包括运营商名称(例如中国移动)、移动网络(例如4G)、时间和剩余电量。导航栏中包括后退(back)键图标、主屏幕(home)键图标和前进键图标。此外,可以理解的是,在一些实施例中,状态栏中还可以包括蓝牙图标、Wi-Fi图标、外接设备图标等。还可以理解的是,在另一些实施例中,图形用户界面中还可以包括Dock栏,Dock栏中可以包括常用的应用图标等。当处理器210检测到用户的手指(或触控笔等)针对某一应用图标的触摸事件后,响应于该触摸事件,打开与该应用图标对应的应用的用户界面,并在显示器294上显示该应用的用户界面。 Display screen 294 is used to display images, videos, and the like. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light). emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the terminal device 200 may include one or N display screens 294 , where N is a positive integer greater than one. The display screen 294 may be used to display information entered by or provided to the user as well as various graphical user interfaces (GUIs). For example, display 294 may display photos, videos, web pages, or documents, and the like. As another example, display 294 may display a graphical user interface. The GUI includes a status bar, a hideable navigation bar, a time and weather widget, and an application icon, such as a browser icon. The status bar includes operator name (eg China Mobile), mobile network (eg 4G), time and remaining battery. The navigation bar includes a back button icon, a home button icon, and a forward button icon. In addition, it can be understood that, in some embodiments, the status bar may further include a Bluetooth icon, a Wi-Fi icon, an external device icon, and the like. It can also be understood that, in other embodiments, the graphical user interface may further include a Dock bar, and the Dock bar may include commonly used application icons and the like. After the processor 210 detects a touch event of the user's finger (or stylus, etc.) on an application icon, in response to the touch event, the user interface of the application corresponding to the application icon is opened and displayed on the display 294 The user interface of the application.
在本公开实施例中,显示屏294可以是一个一体的柔性显示屏,也可以采用两个刚性屏以及位于两个刚性屏之间的一个柔性屏组成的拼接显示屏等,本发明实施例不做限定。In the embodiment of the present disclosure, the display screen 294 may be an integrated flexible display screen, or a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens, etc. Do limit.
当处理器210运行本公开实施例提供的文本提取方法后,终端设备200可以控制显示屏294显示相应的图形用户界面,例如图2a、图2b和图2c所示的应用界面,图3a、图3b、图3c和图3d所示的触控区域,以及图3e所示的区域选择标记层。After the processor 210 executes the text extraction method provided by the embodiment of the present disclosure, the terminal device 200 can control the display screen 294 to display a corresponding graphical user interface, such as the application interface shown in FIG. 2a, FIG. 2b, and FIG. 3b, the touch area shown in FIG. 3c and FIG. 3d, and the area selection marking layer shown in FIG. 3e.
摄像头293(前置摄像头或者后置摄像头,或者一个摄像头既可作为前置摄像头,也可 作为后置摄像头)用于捕获静态图像或视频。通常,摄像头293可以包括感光元件比如镜头组和图像传感器,其中,镜头组包括多个透镜(凸透镜或凹透镜),用于采集待拍摄物体反射的光信号,并将采集的光信号传递给图像传感器。图像传感器根据所述光信号生成待拍摄物体的原始图像。Camera 293 (front or rear camera, or a camera that can be both front and rear camera) is used to capture still images or video. Generally, the camera 293 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex or concave) for collecting the light signal reflected by the object to be photographed, and transmitting the collected light signal to the image sensor . The image sensor generates an original image of the object to be photographed according to the light signal.
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行终端设备200的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,应用程序(比如相机应用,微信应用等)的代码等。存储数据区可存储终端设备200使用过程中所创建的数据(比如相机应用采集的图像、视频等)等。 Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the terminal device 200 by executing the instructions stored in the internal memory 221 . The internal memory 221 may include a storage program area and a storage data area. The storage program area may store operating system, code of application programs (such as camera application, WeChat application, etc.), and the like. The storage data area may store data created during the use of the terminal device 200 (such as images and videos captured by the camera application) and the like.
内部存储器221还可以存储本公开实施例提供的文本提取方法对应的一个或多个计算机程序1310。该一个或多个计算机程序1304被存储在上述存储器221中并被配置为被该一个或多个处理器210执行,该一个或多个计算机程序1310包括指令,上述指令可以用于执行如图5相应实施例中的各个步骤,该计算机程序1310可以包括第一获取模块、提取模块、确定模块、第二获取模块和调整模块,其中,第一获取模块,用于响应于触摸屏上的触控操作,获取触控区域;提取模块,用于通过光学字符识别OCR技术提取所述第一获取模块获取的触控区域内的第一文本信息;确定模块,用于从所述触摸屏上显示的文本性控件中,确定出与所述第一获取模块获取的触控区域匹配的目标控件,所述文本性控件用于表示能够获取到文字内容的控件;第二获取模块,用于从所述确定模块确定的目标控件中获取第二文本信息;调整模块,用于基于所述第二获取模块获取的第二文本信息对所述提取模块提取的第一文本信息进行调整,获得第三文本信息。当内部存储器221中存储的文本提取方法的代码被处理器210运行时,处理器210可以控制显示屏显示第三文本信息。The internal memory 221 may also store one or more computer programs 1310 corresponding to the text extraction method provided by the embodiment of the present disclosure. The one or more computer programs 1304 are stored in the aforementioned memory 221 and configured to be executed by the one or more processors 210, and the one or more computer programs 1310 include instructions that may be used to perform the execution of FIG. 5 For each step in the corresponding embodiment, the computer program 1310 may include a first acquisition module, an extraction module, a determination module, a second acquisition module and an adjustment module, wherein the first acquisition module is used to respond to touch operations on the touch screen , obtains the touch area; the extraction module is used to extract the first text information in the touch area obtained by the first acquisition module through the optical character recognition OCR technology; the determination module is used to extract the textual information displayed on the touch screen from the Among the controls, a target control that matches the touch area obtained by the first obtaining module is determined, and the textual control is used to represent a control that can obtain text content; the second obtaining module is used for obtaining from the determining module. The second text information is obtained from the determined target control; the adjustment module is configured to adjust the first text information extracted by the extraction module based on the second text information obtained by the second obtaining module to obtain third text information. When the code of the text extraction method stored in the internal memory 221 is executed by the processor 210, the processor 210 may control the display screen to display third text information.
此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
当然,本公开实施例提供的文本提取方法的代码还可以存储在外部存储器中。这种情况下,处理器210可以通过外部存储器接口220运行存储在外部存储器中的文本提取方法的代码。Certainly, the code of the text extraction method provided by the embodiment of the present disclosure may also be stored in an external memory. In this case, the processor 210 may execute the code of the text extraction method stored in the external memory through the external memory interface 220 .
下面介绍传感器模块280中的触摸传感器280K的功能。The functions of the touch sensor 280K in the sensor module 280 are described below.
触摸传感器280K,也称“触控面板”。触摸传感器280K可以设置于显示屏294,由触摸传感器280K与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280K用于检测作用于其上或附近的触控操作。触摸传感器可以将检测到的触控操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触控操作相关的视觉输出。在本公开实施例中,用户可以在触摸屏上执行图3a、图3b、图3c和图3d所示的触控操作,处理器依据这些触控操作可以获取到触控区域。 Touch sensor 280K, also called "touch panel". The touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen". The touch sensor 280K is used to detect touch operations on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided via display screen 294 . In the embodiment of the present disclosure, the user can perform the touch operations shown in FIGS. 3 a , 3 b , 3 c and 3 d on the touch screen, and the processor can obtain the touch area according to these touch operations.
示例性的,终端设备200的显示屏294显示主界面,主界面中包括多个应用(比如即时通信应用、浏览器应用等)的图标。用户通过触摸传感器280K点击主界面中即时通信应用的图标,触发处理器210启动即时通信应用。显示屏294显示即使通信应用的界面,例如登录界面或者聊天界面等。Exemplarily, the display screen 294 of the terminal device 200 displays a main interface, and the main interface includes icons of multiple applications (such as instant messaging applications, browser applications, etc.). The user clicks the icon of the instant messaging application in the main interface through the touch sensor 280K, and triggers the processor 210 to start the instant messaging application. The display screen 294 displays an interface of an instant communication application, such as a login interface or a chat interface.
终端设备200的无线通信功能可以通过天线1,天线2,移动通信模块251,无线通信模块252,调制解调处理器以及基带处理器等实现。The wireless communication function of the terminal device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 251, the wireless communication module 252, the modulation and demodulation processor, the baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。终端设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块251可以提供应用在终端设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块251可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块251可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块251还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块251的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块251的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。在本公开实施例中,移动通信模块251还可以用于与其它终端设备进行信息交互。The mobile communication module 251 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the terminal device 200 . The mobile communication module 251 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like. The mobile communication module 251 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 251 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 251 may be provided in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 251 may be provided in the same device as at least part of the modules of the processor 210 . In this embodiment of the present disclosure, the mobile communication module 251 may also be used for information interaction with other terminal devices.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块251或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 . In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modulation and demodulation processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 251 or other functional modules.
无线通信模块252可以提供应用在终端设备200上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块252可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块252经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块252还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本公开实施例中,无线通信模块252,用于在处理器210的控制下与其他终端设备之间传输数据,比如,处理器210运行本公开实施例提供的文本提取方法时,处理器可以控制无线通信模块252向其他终端设备发送服务请求,还可以接收其他终端设备基于上述服务请求提供的服务结果。例如,向其他终端设备发送网页访问请求,接收其他终端设备提供的网页内容。The wireless communication module 252 can provide applications on the terminal device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR). The wireless communication module 252 may be one or more devices integrating at least one communication processing module. The wireless communication module 252 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 252 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 . In this embodiment of the present disclosure, the wireless communication module 252 is configured to transmit data with other terminal devices under the control of the processor 210. For example, when the processor 210 executes the text extraction method provided by the embodiment of the present disclosure, the processor can control the The wireless communication module 252 sends a service request to other terminal devices, and can also receive service results provided by other terminal devices based on the above-mentioned service request. For example, sending a web page access request to other terminal devices, and receiving web page content provided by other terminal devices.
另外,终端设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。In addition, the terminal device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. Such as music playback, recording, etc.
应理解,在实际应用中,终端设备200可以包括比图4所示的更多或更少的部件,本公开实施例不作限定。图示终端设备200仅是一个范例,并且终端设备200可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that, in practical applications, the terminal device 200 may include more or less components than those shown in FIG. 4 , which is not limited by the embodiment of the present disclosure. The illustrated terminal device 200 is only an example, and the terminal device 200 may have more or fewer components than those shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
下面结合图3a所示的应用界面,示例性说明终端设备200软件以及硬件的工作流程。The workflow of the software and hardware of the terminal device 200 is exemplarily described below with reference to the application interface shown in FIG. 3a.
在终端设备200在显示屏294显示如图3a所示的应用界面的情况下,当用户触摸信息“集 成了100mΩ的MOSFET开关功”的两侧,触摸传感器280K接收到该触控操作,相应的硬件终端被发给内核层。内核层将触控操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的应用。以该触控操作为双指按压操作,该双指按压操作所对应的应用为文本提取应用为例,文本提取应用调用应用框架层的接口,启动文本提取应用。文本提取应用响应于上述双指按压操作,获取图3a所示的触控区域;通过OCR技术提取触控区域内的第一文本信息“集成了100mQ的MOSFET开关功”;从显示屏294上显示的文本性控件中,确定出与图3a所示的触控区域匹配的目标控件;从目标控件中获取第二文本信息“XL 1509-3.3E1 5G基站电源芯片特点2A连续输出电流8-30V宽工作电压输入集成了100mΩ的MOSFET开关功率管输出18-28V可调”;基于第二文本信息对第一文本信息进行调整,得到第三文本信息“集成了100mΩ的MOSFET开关功”。In the case where the terminal device 200 displays the application interface shown in FIG. 3a on the display screen 294, when the user touches both sides of the information "Integrated MOSFET switching power of 100mΩ", the touch sensor 280K receives the touch operation, and the corresponding Hardware terminals are sent to the kernel layer. The kernel layer processes touch operations into raw input events (including touch coordinates, timestamps of touch operations, etc.). Raw input events are stored at the kernel layer. The application framework layer obtains the original input event from the kernel layer, and identifies the application corresponding to the input event. Taking the touch operation as a two-finger pressing operation and the application corresponding to the two-finger pressing operation being a text extraction application as an example, the text extraction application invokes the interface of the application framework layer to start the text extraction application. The text extraction application acquires the touch area shown in FIG. 3a in response to the above-mentioned two-finger pressing operation; extracts the first text information in the touch area "integrated with 100mQ MOSFET switching power" through OCR technology; displays the display screen 294 In the textual control of the 5G base station, determine the target control that matches the touch area shown in Figure 3a; obtain the second text information from the target control "XL 1509-3.3E1 5G base station power chip features 2A continuous output current 8-30V wide The working voltage input integrates a 100mΩ MOSFET switching power tube output 18-28V adjustable"; based on the second text information, the first text information is adjusted to obtain the third text information "Integrated 100mΩ MOSFET switching power".
图5示出本公开实施例的文本提取方法的流程图。该方法可以由终端设备执行,例如图4所示的终端设备200。如图5所示,所述方法可以包括:FIG. 5 shows a flowchart of a text extraction method according to an embodiment of the present disclosure. The method may be performed by a terminal device, such as the terminal device 200 shown in FIG. 4 . As shown in Figure 5, the method may include:
步骤S601,响应于触摸屏上的触控操作,获取触控区域。Step S601, in response to a touch operation on the touch screen, obtain a touch area.
步骤S602,通过光学字符识别OCR技术提取所述触控区域内的第一文本信息。Step S602, extracting the first text information in the touch area by using an optical character recognition (OCR) technology.
步骤S603,从所述触摸屏上显示的一个或多个文本性控件中确定出与所述触控区域匹配的目标控件。Step S603, determining a target control matching the touch area from one or more textual controls displayed on the touch screen.
其中,所述文本性控件用于表示能够获取到文字内容的控件。Wherein, the textual control is used to represent a control that can obtain text content.
步骤S604,从所述目标控件中获取第二文本信息。Step S604, acquiring second text information from the target control.
步骤S605,基于所述第二文本信息对所述第一文本信息进行调整,获得第三文本信息。Step S605: Adjust the first text information based on the second text information to obtain third text information.
在本公开实施例中,通过OCR技术准确地提取到文字位置准确的第一文本信息,通过控件取词技术获取到文字内容正确的第二文本信息,基于文字内容正确的第二文本信息对文字位置准确的第一文本信息进行调整,可以方便、快捷的获得位置准确、且内容正确的第三文字信息。In the embodiment of the present disclosure, the first text information with the correct text position is accurately extracted by the OCR technology, the second text information with the correct text content is obtained by the control word extraction technology, and the text is analyzed based on the second text information with the correct text content. By adjusting the first text information with the accurate position, the third text information with the accurate position and correct content can be obtained conveniently and quickly.
在步骤S601中,触控操作可以包括点击操作、滑动操作、按压操作。其中,点击操作可以包括两次点击操作、两次双击操作、一次单击操作和一次双击操作,或者一次双击操作和一次单击操作等。滑动操作可以包括单指滑动操作、多指滑动操作等。按压操作可以包括单指按压操作、多指按压操作(例如双指按压操作)等。触控操作可以通过触控笔、用户手指、或者用户指关节等执行。终端设备响应于触摸屏上的触控操作,可以获取触控区域。该触控区域可以准确的标记出用户需要获得的文字信息的位置。在一个示例中,考虑到文字具有分行的特点,触控区域可以为包括一个或多个矩形区域。触控区域也可以为其他能够准确标记位置的区域。In step S601, the touch operation may include a click operation, a sliding operation, and a pressing operation. The click operation may include two click operations, two double click operations, one click operation and one double click operation, or one double click operation and one click operation, and the like. The sliding operation may include a single-finger sliding operation, a multi-finger sliding operation, and the like. The pressing operation may include a single-finger pressing operation, a multi-finger pressing operation (eg, a two-finger pressing operation), and the like. The touch operation may be performed by a stylus, a user's finger, or a user's knuckle, or the like. The terminal device can acquire the touch area in response to the touch operation on the touch screen. The touch area can accurately mark the position of the text information that the user needs to obtain. In one example, considering that the text has the feature of being divided into lines, the touch area may include one or more rectangular areas. The touch area can also be other areas that can accurately mark the position.
在一种可能的实现方式中,步骤S601可以包括:响应于所述触控操作,获取起始触控点的位置信息和结束触控点的位置信息;根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域。In a possible implementation manner, step S601 may include: in response to the touch operation, acquiring the position information of the start touch point and the position information of the end touch point; according to the position of the start touch point information and the position information of the end touch point to determine the touch area.
触控操作可能产生两个或者两个以上的触控点。在本公开实施例中,需要从这两个或者两个以上的触控点中确定出起始触控点和结束触控点。其中,起始触控点可以用于标记用户想要获取的文本信息的起始点,结束触控点可以用于标记用户想要获取的文本信息的结束点。起始触控点和结束触控点是根据文本信息中文字内容的顺序确定的,而不是根据触控点产生 的顺序确定。对于从左下向右上滑动的滑动操作而言,起始触控点是滑动操作产生的最后一个触控点,结束触控点是滑动操作产生的第一个触控点。举例来说,终端设备确定触控操作产生的各触控点对应文本行与触摸屏上边界之间的距离,并将距离最小的触控点确定为第一触控点。同样,终端设备确定触控操作产生的各触控点对应文本行与触摸屏下边界之间的距离,并将距离最小的触控点确定为第二触控点。在存在一个第一触控点的情况下,终端设备可以将第一触控点确定为起始触控点;在存在多个第一触控点的情况下,终端设备可以将与触摸屏左边界最小的第一触控点确定为起始触控点。在存在一个第二触控点的情况下,终端设备可以将第二触控点确定为结束触控点;在存在多个第二触控点的情况下,终端设备可以将与触摸屏右边界距离最小的第二触控点确定为结束触控点。A touch operation may generate two or more touch points. In the embodiment of the present disclosure, the start touch point and the end touch point need to be determined from the two or more touch points. The start touch point may be used to mark the start point of the text information that the user wants to obtain, and the end touch point may be used to mark the end point of the text information that the user wants to obtain. The starting touch point and the ending touch point are determined according to the order of the text content in the text information, not the order in which the touch points are generated. For a sliding operation that slides from bottom left to top right, the starting touch point is the last touch point generated by the sliding operation, and the ending touch point is the first touch point generated by the sliding operation. For example, the terminal device determines the distance between the text line corresponding to each touch point generated by the touch operation and the upper boundary of the touch screen, and determines the touch point with the smallest distance as the first touch point. Similarly, the terminal device determines the distance between the text line corresponding to each touch point generated by the touch operation and the lower boundary of the touch screen, and determines the touch point with the smallest distance as the second touch point. In the case that there is one first touch point, the terminal device may determine the first touch point as the starting touch point; in the case that there are multiple first touch points, the terminal device may determine the first touch point with the left border of the touch screen The smallest first touch point is determined as the initial touch point. In the case that there is one second touch point, the terminal device can determine the second touch point as the end touch point; in the case that there are multiple second touch points, the terminal device can determine the distance from the right border of the touch screen The smallest second touch point is determined as the end touch point.
起始触控点的位置信息和结束触控点的位置信息是基于触摸屏确定的。在一个示例中,可以将触摸屏的左下角确定为坐标原点,将坐标原点的正右方作为x轴的正向,将坐标原点的正左方作为y轴的负向,将坐标原点的正上方作为y轴的正向,将坐标原点的正下方作为y轴的负向。这样,起始触控点的位置信息和结束触控点的位置信息可以通过x和y进行表示。The position information of the start touch point and the position information of the end touch point are determined based on the touch screen. In one example, the lower left corner of the touch screen may be determined as the coordinate origin, the positive right side of the coordinate origin may be used as the positive direction of the x-axis, the positive left side of the coordinate origin may be used as the negative direction of the y-axis, and the positive side of the coordinate origin may be used as the positive direction of the y-axis. As the positive direction of the y-axis, the negative direction of the y-axis is directly below the origin of the coordinates. In this way, the position information of the starting touch point and the position information of the ending touch point can be represented by x and y.
在一个示例中,在所述起始触控点与所述结束触控点对应同一文本行的情况下,终端设备可以根据所述起始触控点和所述结束触控点之间的第一区域,确定所述触控区域。以第一区域为矩形区域为例,终端设备可以根据起始触控点确定第一区域的左边界,根据结束触控点确定第一区域的右边界,根据OCR技术划分的行确定矩形区域的上下边界,并将确定出的上下左右边界之间的矩形区域,确定为触控区域。In an example, in the case that the start touch point and the end touch point correspond to the same text line, the terminal device can an area, determining the touch area. Taking the first area as a rectangular area as an example, the terminal device can determine the left boundary of the first area according to the starting touch point, determine the right boundary of the first area according to the ending touch point, and determine the rectangle area according to the lines divided by the OCR technology. The upper and lower boundaries are determined, and the determined rectangular area between the upper, lower, left and right boundaries is determined as the touch area.
在一个示例中,在所述起始触控点和所述结束触控点对应相邻文本行的情况下,终端设备可以根据所述起始触控点和所述触摸屏的右边界之间的第二区域,以及所述结束触控点和所述触摸屏的左边界之间的第三区域,确定所述触控区域。In an example, in the case that the starting touch point and the ending touch point correspond to adjacent text lines, the terminal device can The second area, and the third area between the end touch point and the left border of the touch screen, determine the touch area.
其中,确定第二区域和第三区域的方式可以参照确定第一区域的方式,这里不再赘述。可以理解的是第二区域中的文本信息应该排在第三区域中的文本信息之前。在一个示例中,可以将第三区域拼接在第二区域之后,得到触控区域。The manner of determining the second area and the third area may refer to the manner of determining the first area, which will not be repeated here. It can be understood that the text information in the second area should be arranged before the text information in the third area. In one example, the touch area can be obtained by splicing the third area after the second area.
在一个示例中,在所述起始触控点和所述结束触控点对应的文本行相隔一个或多个文本行的情况下,终端设备可以根据所述起始触控点和所述触摸屏的右边界之间的第四区域、所述起始触控点对应文本行与所述结束触控点对应文本行之间的第五区域,以及所述结束触控点和所述触摸屏的左边界之间的第六区域,确定所述触控区域。In an example, when the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, the terminal device can The fourth area between the right border of the touch screen, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the end touch point and the left side of the touch screen The sixth area between the boundaries determines the touch area.
其中,确定第四区域、第五区域和第六区域的方式可以参照确定第一区域的方式,这里不再赘述。在一个示例中,可以先将第五区域划分成一个或多个子区域,每个子区域对应一个文本行。然后,将第五区域的各子区域按照先后顺序依次拼接在第四区域之后,并将第六区域拼接在第五区域最后一个文本行对应的子区域之后,得到触控区域。The manner of determining the fourth area, the fifth area and the sixth area may refer to the manner of determining the first area, which will not be repeated here. In an example, the fifth area may be divided into one or more sub-areas, and each sub-area corresponds to a text line. Then, the sub-regions of the fifth region are sequentially spliced after the fourth region, and the sixth region is spliced after the sub-regions corresponding to the last text line of the fifth region to obtain a touch-sensitive region.
在本公开实施例中,通过上述方式可以准确标记出用户需要获取的文本信息的位置。In the embodiment of the present disclosure, the position of the text information that the user needs to acquire can be accurately marked by the above method.
在一种可能的实现方式中,在获取起始触控点的位置信息和结束触控点的位置信息之前,终端设备可以先对起始触控点和结束触控点的位置进行调整。在一个示例中,终端设备可以将所述起始触控点向所述触摸屏的y轴正向和x轴负向移动第一距离,得到调整后的起始触控点;将所述结束触控点向所述触摸屏的x轴正向和y轴负向移动第二距离,得到调整后的结束触控点。之后,终端设备可以根据调整后的起始触控点的位置信息和调整后的结束触控 点的位置信息,确定所述触控区域。In a possible implementation manner, before acquiring the position information of the start touch point and the position information of the end touch point, the terminal device may first adjust the positions of the start touch point and the end touch point. In one example, the terminal device may move the starting touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted starting touch point; move the ending touch point by a first distance. The control point is moved a second distance in the positive direction of the x-axis and the negative direction of the y-axis of the touch screen to obtain the adjusted end touch point. After that, the terminal device may determine the touch area according to the adjusted position information of the start touch point and the adjusted position information of the end touch point.
其中,第一距离可以包括第一x轴距离和第一y轴距离。第一x轴距离和第一y轴距离可以相同也可以不同。第一x轴距离和第一y轴距离可以根据需要进行设置,例如可以根据触摸屏的尺寸、文本行的高度以及文字的大小中的一者或多者确定,对此本公开不做限制。举例来说,第一x轴距离可以为0.5cm,第一y轴距离可以为0.5cm。第二距离可以参照第一距离,这里不再赘述,The first distance may include a first x-axis distance and a first y-axis distance. The first x-axis distance and the first y-axis distance may be the same or different. The first x-axis distance and the first y-axis distance may be set as required, for example, may be determined according to one or more of the size of the touch screen, the height of the text line, and the size of the text, which is not limited in the present disclosure. For example, the first x-axis distance may be 0.5 cm, and the first y-axis distance may be 0.5 cm. The second distance can refer to the first distance, which will not be repeated here.
在本公开实施例中,通过向y轴正向和x轴负向调整起始触摸点的位置,以及向y轴负向和x轴正向调整结束触控点的位置,可以略微扩大触控区域,降低因用户视觉触控点和实际触控点不一致而造成的文字漏选的影响,提高位置标记的准确性。In the embodiment of the present disclosure, by adjusting the position of the starting touch point in the positive direction of the y-axis and the negative direction of the x-axis, and adjusting the position of the end touch point in the negative direction of the y-axis and the positive direction of the x-axis, the touch can be slightly enlarged. area, reduce the impact of missing text selection caused by the inconsistency between the user's visual touch point and the actual touch point, and improve the accuracy of the position mark.
在一种可能的实现方式中,终端设备在确定出起始触控点和结束触控点对应的文本行之后,可以向上和向下分别多取一个文本行的区域,添加至触控区域中。这样,可以有效扩展触控区域,以更好的降低因用户视觉触控点和实际触控点不一致而造成的文字漏选的影响,提高位置标记的准确性。特别是,通过手指或者指关节执行的触控操作,效果更加明显。In a possible implementation manner, after determining the text line corresponding to the start touch point and the end touch point, the terminal device may take an area of an additional text line up and down, respectively, and add it to the touch area . In this way, the touch area can be effectively expanded, so as to better reduce the influence of missing text selection caused by the inconsistency between the user's visual touch point and the actual touch point, and improve the accuracy of the position mark. In particular, the effect of touch operations performed by fingers or knuckles is more pronounced.
在步骤S602中,第一文本信息可以表示通过OCR技术提取的触控区域内的文本信息。在一个示例中,终端设备可以对触控区域进行二值化处理、噪声去除、倾斜矫正、分行处理、字符分割、字符识别和板面恢复(即使识别出的文字内容,仍然按照原触控区域中显示的文字内容那样排列,保持文字的段落不变、位置不变、顺序不变)。In step S602, the first text information may represent the text information in the touch area extracted by the OCR technology. In an example, the terminal device can perform binarization processing, noise removal, tilt correction, line branch processing, character segmentation, character recognition, and panel restoration on the touch area (even if the text content is recognized, it is still in accordance with the original touch area) The text content displayed in the text is arranged in the same way, keeping the paragraphs of the text unchanged, the position unchanged, and the order unchanged).
在步骤S603中,文本性控件可以用于表示能够获取到文字内容的空间。在一个示例中,文本性控件可以包括文本展示控件和文本输入控件。例如,文本性控件可以为短消息展示框、即时通信消息展示框、备忘录、记事本等。触摸屏中可以同时显示一个或多个文本性控件。需要说明的是,触摸屏上显示的文本性控件包括触摸屏上未完全显示的文本性控件。In step S603, the textual control may be used to indicate a space where text content can be obtained. In one example, textual controls may include text presentation controls and text entry controls. For example, the textual control can be a short message display box, an instant messaging message display box, a memo, a notepad, and the like. One or more textual controls can be displayed simultaneously on the touch screen. It should be noted that the textual controls displayed on the touch screen include textual controls that are not fully displayed on the touch screen.
在一种可能的实现方式中,终端设备可以获取所述触摸屏上显示的各文本性控件与所述触控区域的交并比;基于所述交并比,确定出所述目标控件。在一个示例中,终端设备可以将与触控区域的交并比最大的文本性控件确定为目标控件。在又一示例中,终端设备可以将与触控区域的交并比最大、且交并比大于指定阈值的文本性控件,确定为目标控件。其中,指定阈值可以根据需要进行设置,例如可以设置为85%、90%等,对此本公开不做限制。In a possible implementation manner, the terminal device may acquire the intersection ratio of each textual control displayed on the touch screen and the touch area; and determine the target control based on the intersection ratio. In one example, the terminal device may determine the textual control with the largest intersection ratio with the touch area as the target control. In yet another example, the terminal device may determine a textual control whose intersection ratio with the touch area is the largest and whose intersection ratio is greater than a specified threshold as the target control. The specified threshold can be set as required, for example, can be set to 85%, 90%, etc., which is not limited in the present disclosure.
在步骤S604中,由于目标控件是能够获取到文字内容的控件。因此,终端设备可以直接从目标控件中获取到第二文本信息。第二文本信息可以存储在目标控件的属性信息中。In step S604, since the target control is a control that can obtain text content. Therefore, the terminal device can directly acquire the second text information from the target control. The second text information may be stored in attribute information of the target control.
在步骤S605中,终端设备可以基于第二文本信息对第一文本信息进行调整,使得第一文本信息中不正确的文字内容变为正确的文字内容。由于第一文本信息本身的文字位置是准确的。因此,第一文本信息调整后得到的第三文本信息中的文字位置是准确的、文字内容是正确的。In step S605, the terminal device may adjust the first text information based on the second text information, so that the incorrect text content in the first text information becomes the correct text content. Because the text position of the first text information itself is accurate. Therefore, the position of the text in the third text information obtained after the adjustment of the first text information is accurate, and the text content is correct.
在一种可能的实现方式中,步骤S605可以包括:对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比;将所述第一文本信息中,与第二文本信息中的字符对应于所述触摸屏上同一位置且内容不一致的字符,确定为目标字符;将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。In a possible implementation manner, step S605 may include: comparing the characters in the first text information and the second text information corresponding to the same position on the touch screen; , and the characters in the second text information correspond to the characters in the same position on the touch screen and the contents are inconsistent, and are determined as target characters; replace the target characters in the first text information with the characters corresponding to the target characters on the touch screen. Characters in the second text information at the same position to obtain the third text information.
在本公开实施例中,首先对第一文本信息和第二文本信息进行对齐处理,找到第一文本信息和第二文本信息中对应于触摸屏上同一位置的字符。在一个示例中,可以先将第一文本 信息的第一个字符与第二文本信息的第一个字符对齐,然后依次比对后续字符,确定匹配率(例如,相同字符的数量占不同字符的数量的比例);将第一文本信息的第一个字符与第二文本信息的第二个字符对齐,再次确定匹配率。以此类推,直至将第一文本信息的第一个字符与第二文本信息的最后一个字符进行对齐,确定出最后一个匹配率。找出匹配率最大的对齐位置,作为最终的对齐位置。在又一示例中,可以确定出一个大于一定阈值(可根据需要进行设置,例如可以设置为95%、90%等)的匹配率之后,即将该匹配率对应的对齐位置,作为最终的对齐位置,不再进行后续操作。然后,对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比。基于对比结果,针对不一致的情况进行替换处理。举例来说,基于图3a,终端设备200提取到第一文本信息“集成了100mQ的MOSFET开关功”,获取到第二文本信息“XL 1509-3.3E1 5G基站电源芯片特点2A连续输出电流8-30V宽工作电压输入集成了100mΩ的MOSFET开关功率管输出18-28V可调”,进行对齐处理后,终端设备可以确定第一文本信息中“集成了100mQ的MOSFET开关功”的各个字符依次与第二文本信息“集成了100mΩ的MOSFET开关功”中的各个字符对应同一位置。终端设备可以对第一文本信息和第二文本信息中同一位置的字符进行对比。经对比,终端设备发现对应同一位置的第一文本信息中的字符“Q”与第二文本信息中的字符“Ω”不同。此时,终端设备可以确定字符“Q”确定为目标字符,从而将第一文本信息“集成了100mQ的MOSFET开关功”中的目标字符“Q”替换为第二文本信息中同一位置的字符“Ω”,得到最终的第三文本信息“集成了100mΩ的MOSFET开关功”。In the embodiment of the present disclosure, the first text information and the second text information are aligned first, and characters in the first text information and the second text information that correspond to the same position on the touch screen are found. In an example, the first character of the first text information may be aligned with the first character of the second text information, and then the subsequent characters are compared in sequence to determine the matching rate (for example, the number of the same characters accounts for the percentage of the different characters). Quantity ratio); align the first character of the first text information with the second character of the second text information, and determine the matching rate again. By analogy, until the first character of the first text information is aligned with the last character of the second text information, the last matching rate is determined. Find the alignment position with the largest matching rate as the final alignment position. In yet another example, after a matching rate greater than a certain threshold (which can be set as required, for example, can be set to 95%, 90%, etc.) may be determined, the alignment position corresponding to the matching rate may be used as the final alignment position , no further operations are to be performed. Then, the characters corresponding to the same position on the touch screen in the first text information and the second text information are compared. Based on the comparison results, replacement processing is performed for inconsistent situations. For example, based on Fig. 3a, the terminal device 200 extracts the first text information "Integrated MOSFET switching power of 100mQ", and obtains the second text information "XL 1509-3.3E1 5G base station power chip features 2A continuous output current 8- The 30V wide operating voltage input integrates a 100mΩ MOSFET switching power tube and the output is adjustable from 18 to 28V." After the alignment process, the terminal device can determine that the characters in the first text message "Integrated 100mQ MOSFET switching power" are in turn with the first text. 2. Each character in the text message "Integrated MOSFET switching power of 100mΩ" corresponds to the same position. The terminal device may compare the characters in the same position in the first text information and the second text information. After comparison, the terminal device finds that the character "Q" in the first text information corresponding to the same position is different from the character "Ω" in the second text information. At this time, the terminal device can determine the character "Q" as the target character, so that the target character "Q" in the first text message "Integrated MOSFET switching power of 100mQ" is replaced with the character in the same position in the second text message" Ω" to get the final third text message "Integrated MOSFET switching work of 100mΩ".
相较于OCR技术,本公开实施例提供的文本提取方法可以提高提取文本内容正确性。相较于控件取词技术,本公开实施例提供的文本提取方法可以提高提取文本位置的准确性,省去用户在提取结果中寻找需要的文字的过程。也就是说,本公开实施例提供的文本提取方法可以方便、快捷、准确地获取到用户需要的文本信息。Compared with the OCR technology, the text extraction method provided by the embodiments of the present disclosure can improve the correctness of the extracted text content. Compared with the control word extraction technology, the text extraction method provided by the embodiment of the present disclosure can improve the accuracy of the extracted text position, and saves the process of the user searching for the required text in the extraction result. That is to say, the text extraction method provided by the embodiments of the present disclosure can conveniently, quickly and accurately obtain the text information required by the user.
在一个示例中,终端设备在将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息之前,可以先根据所述目标字符的数量与所述第一文本信息中字符的数量,确定匹配率。然后在所述匹配率大于第一阈值的情况下,终端设备再将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。In an example, before the terminal device replaces the target character in the first text information with the character in the second text information corresponding to the target character at the same position on the touch screen, and obtains the third text information, The matching rate may be determined according to the number of the target characters and the number of characters in the first text information. Then, when the matching rate is greater than the first threshold, the terminal device replaces the target character in the first text information with a character in the second text information corresponding to the target character at the same position on the touch screen, The third text information is obtained.
其中,匹配率可以为第一文本信息中除目标字符以外的字符的数量与第一文本信息中字符的数量的比值。第一阈值可以根据需要进行设置,例如,第一阈值可以为92%、95%等,本公开实施例对第一阈值不做限定。在匹配率大于第一阈值的情况下,表明第一文本信息中存在少量提取错误的文字内容,第一文本信息经过调整可以提高正确性。因此,在匹配率大于第一阈值的情况下,终端设备再将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。在匹配率小于或者等于第一阈值的情况下,表明第一文本信息中可能存在大量提取错误的文字内容,这可能是因为第一文本信息和第二文本信息未对齐或者对齐不准确造成的,也可能是因为第一文本信息和第二文本信息中的一者或两者提取错误造成的。此时,终端设备可以重新进行第一文本信息和第二文本信息的对齐或者重新进行第一文本信息和第二文本信息的获取。The matching rate may be a ratio of the number of characters other than the target character in the first text information to the number of characters in the first text information. The first threshold may be set as required, for example, the first threshold may be 92%, 95%, etc., which is not limited in this embodiment of the present disclosure. When the matching rate is greater than the first threshold, it indicates that there is a small amount of wrongly extracted text content in the first text information, and the correctness of the first text information can be improved after adjustment. Therefore, when the matching rate is greater than the first threshold, the terminal device then replaces the target character in the first text information with a character in the second text information corresponding to the target character at the same position on the touch screen, to obtain the third text information. In the case that the matching rate is less than or equal to the first threshold, it indicates that there may be a large number of wrongly extracted text content in the first text information, which may be caused by the misalignment or inaccurate alignment of the first text information and the second text information, It may also be caused by an extraction error of one or both of the first text information and the second text information. At this time, the terminal device may re-align the first text information and the second text information or re-acquire the first text information and the second text information.
这样,通过在匹配率较大的情况下,进行字符替换,可以提高正确性。In this way, the correctness can be improved by performing character replacement when the matching rate is high.
在一种可能的实现方式中,步骤S605可以包括:检测所述第二文本信息中是否存在满足 预设格式的字符集;在所述第二文本信息中存在满足所述预设格式的字符集的情况下,从所述第二文本信息中提取出满足所述预设格式的字符集;采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息。In a possible implementation manner, step S605 may include: detecting whether a character set satisfying a preset format exists in the second text information; and a character set satisfying the preset format exists in the second text information In the case of , extract a character set that satisfies the preset format from the second text information; replace the first text information with the extracted character set to obtain the third text information.
其中,预设格式的字符集可以包括口令或者链接等,本公开实施例对预设格式不做限制。在一个示例中,终端设备可以通过正则表达式或者自然语言处理(Natural Language Processing,NLP)技术,对第二文本信息进行预设格式字符集的检测以及提取。The character set of the preset format may include a password or a link, etc., and the embodiment of the present disclosure does not limit the preset format. In an example, the terminal device may detect and extract a character set in a preset format for the second text information by using a regular expression or a natural language processing (Natural Language Processing, NLP) technology.
通过OCR技术获取链接或口令时,容易出错,且OCR技术在链接或口令换行时会做折断处理,从而造成通过OCR技术难以准确地提取到链接或者口令。通过控件取词技术获取链接或口令时,需要用户从获取的文本中寻找具体的位置,操作繁琐。而本公开实施例提供的文本提取方法,能够通过OCR技术确定链接或者口令所属的控件,然后自动从控件中提取出链接或者口令,既可以保证链接或者口令的完整性和位置准确性,又能够保证链接或者口令的正确性,同时操作快捷方便。When the link or password is obtained by the OCR technology, it is prone to errors, and the OCR technology will break the link or the password when it wraps, which makes it difficult to accurately extract the link or password by the OCR technology. When a link or a password is obtained through the control word extraction technology, the user needs to find a specific location from the obtained text, which is a cumbersome operation. The text extraction method provided by the embodiments of the present disclosure can determine the control to which a link or a password belongs by using OCR technology, and then automatically extract the link or password from the control, which can not only ensure the integrity and location accuracy of the link or password, but also can Ensure the correctness of the link or password, and operate quickly and easily.
在一种可能的实现方式中,采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息之后,终端设备还可以根据所述第三文本信息,提供与所述预设格式的字符集对应的服务。例如,终端设备可以跳转至链接对应的网页,还可以打开口令对应的应用并跳转至对应的详情页或者复制口令并在相应应用被打开的情况下自动跳转至对应的详情页。In a possible implementation manner, the extracted character set is used to replace the first text information, and after obtaining the third text information, the terminal device may further provide the preset text information according to the third text information The character set of the format corresponds to the service. For example, the terminal device can jump to the webpage corresponding to the link, and can also open the application corresponding to the password and jump to the corresponding details page, or copy the password and automatically jump to the corresponding details page when the corresponding application is opened.
这样,可以提高服务效率,有利于提升用户满意度。In this way, service efficiency can be improved, and user satisfaction can be improved.
图6示出本公开实施例的文本提取装置的结构示意图。如图6所示,该装置80可以包括:FIG. 6 shows a schematic structural diagram of a text extraction apparatus according to an embodiment of the present disclosure. As shown in FIG. 6, the apparatus 80 may include:
第一获取模块81,用于响应于触摸屏上的触控操作,获取触控区域;a first acquiring module 81, configured to acquire a touch area in response to a touch operation on the touch screen;
提取模块82,用于通过光学字符识别OCR技术提取所述第一获取模块81获取的触控区域内的第一文本信息;The extraction module 82 is used for extracting the first text information in the touch area obtained by the first obtaining module 81 through the optical character recognition OCR technology;
确定模块83,用于用于从所述触摸屏上显示一个或多个文本性控件中确定出与所述触控区域匹配的目标控件;a determining module 83, configured to determine a target control matching the touch area from one or more textual controls displayed on the touch screen;
第二获取模块84,用于从所述确定模块83确定的目标控件中获取第二文本信息;The second obtaining module 84 is configured to obtain second text information from the target control determined by the determining module 83;
调整模块85,用于基于所述第二获取模块84获取的第二文本信息对所述提取模块82提取的第一文本信息进行调整,获得第三文本信息。The adjustment module 85 is configured to adjust the first text information extracted by the extraction module 82 based on the second text information acquired by the second acquisition module 84 to obtain third text information.
在本公开实施例中,通过OCR技术准确地提取到文字位置准确的第一文本信息,通过控件取词技术获取到文字内容正确的第二文本信息,基于文字内容正确的第二文本信息对文字位置准确的第一文本信息进行调整,可以方便、快捷的获得位置准确、且内容正确的第三文字信息。In the embodiment of the present disclosure, the first text information with the correct text position is accurately extracted by the OCR technology, the second text information with the correct text content is obtained by the control word extraction technology, and the text is analyzed based on the second text information with the correct text content. By adjusting the first text information with the accurate position, the third text information with the accurate position and correct content can be obtained conveniently and quickly.
在一种可能的实现方式中,所述确定模块包括:第一获取单元,用于获取所述触摸屏上显示的各文本性控件与所述触控区域的交并比;第一确定单元,用于基于所述交并比,确定出所述目标控件。In a possible implementation manner, the determining module includes: a first acquiring unit, configured to acquire the intersection ratio of each textual control displayed on the touch screen and the touch area; the first determining unit, using The target control is determined based on the cross-union ratio.
在一种可能的实现方式中,所述调整模块包括:对比单元,用于对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比;第二确定单元,用于将所述第一文本信息中,与第二文本信息中的字符对应于所述触摸屏上同一位置且内容不一致的字符,确定为目标字符;第一替换单元,用于将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。In a possible implementation manner, the adjustment module includes: a comparison unit, configured to compare the characters corresponding to the same position on the touch screen in the first text information and the second text information; the second a determining unit, configured to determine the characters in the first text information and the characters in the second text information that correspond to the same position on the touch screen and have inconsistent contents as target characters; the first replacement unit is configured to replace the first A target character in a piece of text information is replaced with a character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information.
在一种可能的实现方式中,所述第一替换单元还用于:根据所述目标字符的数量与所述 第一文本信息中字符的数量,确定匹配率;在所述匹配率大于第一阈值的情况下,将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。In a possible implementation manner, the first replacement unit is further configured to: determine a matching rate according to the number of the target characters and the number of characters in the first text information; when the matching rate is greater than the first In the case of the threshold value, the target character in the first text information is replaced with a character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information.
在一种可能的实现方式中,所述调整模块还包括:检测单元,用于检测所述第二文本信息中是否存在满足预设格式的字符集;提取单元,用于在所述第二文本信息中存在满足所述预设格式的字符集的情况下,从所述第二文本信息中提取出满足所述预设格式的字符集;第二替换单元,用于采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息。In a possible implementation manner, the adjustment module further includes: a detection unit for detecting whether a character set satisfying a preset format exists in the second text information; an extraction unit for When there is a character set that satisfies the preset format in the information, extract the character set that satisfies the preset format from the second text information; the second replacement unit is used to replace the character set with the extracted character set The third text information is obtained from the first text information.
在一种可能的实现方式中,所述装置还包括:服务模块,用于根据所述第三文本信息,提供与所述预设格式的字符集对应的服务。在一种可能的实现方式中,所述第一获取模块包括:第二获取单元,用于响应于所述触控操作,获取起始触控点的位置信息和结束触控点的位置信息;第三确定单元,用于根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域。In a possible implementation manner, the apparatus further includes: a service module, configured to provide a service corresponding to the character set in the preset format according to the third text information. In a possible implementation manner, the first obtaining module includes: a second obtaining unit, configured to obtain the position information of the starting touch point and the position information of the ending touch point in response to the touch operation; A third determining unit, configured to determine the touch area according to the position information of the start touch point and the position information of the end touch point.
在一种可能的实现方式中,所述第一获取模块还包括:加载单元,用于响应于所述触控操作,加载区域选择标记层;第四确定单元,用于基于所述区域选择标记层的确认操作,确定所述触控区域。In a possible implementation manner, the first obtaining module further includes: a loading unit, configured to load a region selection marker layer in response to the touch operation; and a fourth determination unit, configured to select a marker based on the region The confirmation operation of the layer determines the touch area.
在一种可能的实现方式中,所述第三确定单元还用于:在所述起始触控点与所述结束触控点对应同一文本行的情况下,根据所述起始触控点和所述结束触控点之间的第一区域,确定所述触控区域。In a possible implementation manner, the third determining unit is further configured to: in the case that the start touch point and the end touch point correspond to the same text line, according to the start touch point and the first area between the end touch point to determine the touch area.
在一种可能的实现方式中,所述第三确定单元还用于:在所述起始触控点和所述结束触控点对应相邻文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第二区域,以及所述结束触控点和所述触摸屏的左边界之间的第三区域,确定所述触控区域。In a possible implementation manner, the third determining unit is further configured to: in the case that the start touch point and the end touch point correspond to adjacent text lines, according to the start touch point The touch area is determined by a second area between the point and the right border of the touch screen, and a third area between the end touch point and the left border of the touch screen.
在一种可能的实现方式中,所述第三确定单元还用于:在所述起始触控点和所述结束触控点对应的文本行相隔一个或多个文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第四区域、所述起始触控点对应文本行与所述结束触控点对应文本行之间的第五区域,以及所述结束触控点和所述触摸屏的左边界之间的第六区域,确定所述触控区域。In a possible implementation manner, the third determining unit is further configured to: in the case that the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, according to The fourth area between the start touch point and the right border of the touch screen, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the A sixth area between the end touch point and the left border of the touch screen is used to determine the touch area.
在一种可能的实现方式中,所述第三确定单元还用于:将所述起始触控点向所述触摸屏的y轴正向和x轴负向移动第一距离,得到调整后的起始触控点;将所述结束触控点向所述触摸屏的x轴正向和y轴负向移动第二距离,得到调整后的结束触控点;根据调整后的起始触控点的位置信息和调整后的结束触控点的位置信息,确定所述触控区域。In a possible implementation manner, the third determining unit is further configured to: move the initial touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted starting touch point; moving the ending touch point to the positive x-axis and negative y-axis of the touch screen by a second distance to obtain the adjusted ending touch point; according to the adjusted starting touch point and the adjusted position information of the end touch point to determine the touch area.
本公开的实施例提供了一种文本提取装置,包括:处理器以及用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令时实现上述方法。Embodiments of the present disclosure provide a text extraction apparatus, comprising: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions.
本公开的实施例提供了一种非易失性计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。Embodiments of the present disclosure provide a non-volatile computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the above method when executed by a processor.
本公开的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。Embodiments of the present disclosure provide a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如包括但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举 的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(Electrically Programmable Read-Only-Memory,EPROM或闪存)、静态随机存取存储器(Static Random-Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. Computer-readable storage media include, but are not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing, for example. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (Electrically Programmable Read-Only-Memory, EPROM or flash memory), static random access memory (Static Random-Access Memory, SRAM), portable compact disk read-only memory (Compact Disc Read-Only Memory, CD - ROM), Digital Video Disc (DVD), memory sticks, floppy disks, mechanically encoded devices, such as punch cards or raised structures in grooves on which instructions are stored, and any suitable combination of the foregoing .
这里所描述的计算机可读程序指令或代码可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer readable program instructions or code described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或可编程逻辑阵列(Programmable Logic Array,PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。The computer program instructions for carrying out the operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or in one or more source or object code written in any combination of programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or, may be connected to an external computer (eg, use an internet service provider to connect via the internet). In some embodiments, electronic circuits, such as programmable logic circuits, Field-Programmable Gate Arrays (FPGA), or Programmable Logic Arrays (Programmable Logic Arrays), are personalized by utilizing state information of computer-readable program instructions. Logic Array, PLA), the electronic circuitry can execute computer-readable program instructions to implement various aspects of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的装置、系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行相应的功能或动作的硬件(例如电路或ASIC(Application Specific Integrated Circuit,专用集成电路))来实现,或者可以用硬件和软件的组合,如固件等来实现。It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in hardware (eg, circuits or ASICs (Application) that perform the corresponding functions or actions. Specific Integrated Circuit, application-specific integrated circuit)), or can be implemented by a combination of hardware and software, such as firmware.
尽管在此结合各实施例对本发明进行了描述,然而,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其它变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其它单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。While the invention has been described herein in connection with various embodiments, those skilled in the art will understand and understand from a review of the drawings, the disclosure, and the appended claims in practicing the claimed invention. Other variations of the disclosed embodiments are implemented. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that these measures cannot be combined to advantage.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Various embodiments of the present disclosure have been described above, and the foregoing descriptions are exemplary, not exhaustive, and not limiting of the disclosed embodiments. Numerous modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the various embodiments, the practical application or improvement over the technology in the marketplace, or to enable others of ordinary skill in the art to understand the various embodiments disclosed herein.

Claims (26)

  1. 一种文本提取方法,其特征在于,所述方法包括:A text extraction method, characterized in that the method comprises:
    响应于触摸屏上的触控操作,获取触控区域;Acquire a touch area in response to a touch operation on the touch screen;
    通过光学字符识别OCR技术提取所述触控区域内的第一文本信息;Extract the first text information in the touch area by using optical character recognition OCR technology;
    从所述触摸屏上显示的一个或多个文本性控件中确定出与所述触控区域匹配的目标控件;determining a target control matching the touch area from one or more textual controls displayed on the touch screen;
    从所述目标控件中获取第二文本信息;Obtain second text information from the target control;
    基于所述第二文本信息对所述第一文本信息进行调整,获得第三文本信息。The first text information is adjusted based on the second text information to obtain third text information.
  2. 根据权利要求1所述的方法,其特征在于,所述从所述触摸屏上显示的一个或多个文本性控件中确定出与所述触控区域匹配的目标控件包括:The method according to claim 1, wherein the determining a target control matching the touch area from one or more textual controls displayed on the touch screen comprises:
    获取所述触摸屏上显示的各文本性控件与所述触控区域的交并比;obtaining the intersection ratio of each textual control displayed on the touch screen and the touch area;
    基于所述交并比,确定出所述目标控件。Based on the cross-union ratio, the target control is determined.
  3. 根据权利要求1或2所述的方法,其特征在于,所述基于所述第二文本信息对所述第一文本信息进行调整,获得第三文本信息包括:The method according to claim 1 or 2, wherein the adjusting the first text information based on the second text information to obtain the third text information comprises:
    对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比;comparing the characters corresponding to the same position on the touch screen in the first text information and the second text information;
    将所述第一文本信息中,与第二文本信息中的字符对应于所述触摸屏上同一位置且内容不一致的字符,确定为目标字符;In the first text information, the characters in the second text information that correspond to the same position on the touch screen and have inconsistent contents are determined as the target characters;
    将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。The third text information is obtained by replacing the target character in the first text information with the character in the second text information corresponding to the target character at the same position on the touch screen.
  4. 根据权利要求3所述的方法,其特征在于,所述将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息包括:The method according to claim 3, wherein by replacing the target character in the first text information with a character in the second text information corresponding to the target character at the same position on the touch screen, the obtained The third text information includes:
    根据所述目标字符的数量与所述第一文本信息中字符的数量,确定匹配率;Determine the matching rate according to the number of the target characters and the number of characters in the first text information;
    在所述匹配率大于第一阈值的情况下,将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。In the case where the matching rate is greater than the first threshold, replace the target character in the first text information with the character in the second text information corresponding to the target character at the same position on the touch screen, to obtain the first Three text messages.
  5. 根据权利要求1或2所述的方法,其特征在于,所述基于所述第二文本信息对所述第一文本信息进行调整,获得第三文本信息包括:The method according to claim 1 or 2, wherein the adjusting the first text information based on the second text information to obtain the third text information comprises:
    检测所述第二文本信息中是否存在满足预设格式的字符集;Detecting whether there is a character set satisfying a preset format in the second text information;
    在所述第二文本信息中存在满足所述预设格式的字符集的情况下,从所述第二文本信息中提取出满足所述预设格式的字符集;Extracting a character set that satisfies the preset format from the second text information when there is a character set that satisfies the preset format in the second text information;
    采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息。The first text information is replaced with the extracted character set to obtain the third text information.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    根据所述第三文本信息,提供与所述预设格式的字符集对应的服务。According to the third text information, a service corresponding to the character set of the preset format is provided.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述响应于触控操作,获取触控区域包括:The method according to any one of claims 1 to 6, wherein the acquiring a touch area in response to a touch operation comprises:
    响应于所述触控操作,获取起始触控点的位置信息和结束触控点的位置信息;In response to the touch operation, obtain the position information of the start touch point and the position information of the end touch point;
    根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域。The touch area is determined according to the position information of the start touch point and the position information of the end touch point.
  8. 根据权利要求1至6中任一项所述的方法,其特征在于,所述响应于触控操作,获取触控区域包括:The method according to any one of claims 1 to 6, wherein the acquiring a touch area in response to a touch operation comprises:
    响应于所述触控操作,加载区域选择标记层;In response to the touch operation, loading a region selection marker layer;
    基于所述区域选择标记层的确认操作,确定所述触控区域。The touch area is determined based on the confirmation operation of the area selection marking layer.
  9. 根据权利要求7所述的方法,其特征在于,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域包括:The method according to claim 7, wherein the determining the touch area according to the position information of the start touch point and the position information of the end touch point comprises:
    在所述起始触控点与所述结束触控点对应同一文本行的情况下,根据所述起始触控点和所述结束触控点之间的第一区域,确定所述触控区域。In the case that the start touch point and the end touch point correspond to the same text line, the touch control is determined according to the first area between the start touch point and the end touch point area.
  10. 根据权利要求7所述的方法,其特征在于,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域包括:The method according to claim 7, wherein the determining the touch area according to the position information of the start touch point and the position information of the end touch point comprises:
    在所述起始触控点和所述结束触控点对应相邻文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第二区域,以及所述结束触控点和所述触摸屏的左边界之间的第三区域,确定所述触控区域。In the case that the start touch point and the end touch point correspond to adjacent text lines, according to the second area between the start touch point and the right border of the touch screen, and the end The third area between the touch point and the left border of the touch screen determines the touch area.
  11. 根据权利要求7所述的方法,其特征在于,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域包括:The method according to claim 7, wherein the determining the touch area according to the position information of the start touch point and the position information of the end touch point comprises:
    在所述起始触控点和所述结束触控点对应的文本行相隔一个或多个文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第四区域、所述起始触控点对应文本行与所述结束触控点对应文本行之间的第五区域,以及所述结束触控点和所述触摸屏的左边界之间的第六区域,确定所述触控区域。In the case that the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, according to the fourth value between the start touch point and the right border of the touch screen area, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the sixth area between the end touch point and the left border of the touch screen, Determine the touch area.
  12. 根据权利要求9至11中任一项所述的方法,其特征在于,所述根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域包括:The method according to any one of claims 9 to 11, wherein the determining the touch area according to the position information of the start touch point and the position information of the end touch point includes: :
    将所述起始触控点向所述触摸屏的y轴正向和x轴负向移动第一距离,得到调整后的起始触控点;moving the initial touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted initial touch point;
    将所述结束触控点向所述触摸屏的x轴正向和y轴负向移动第二距离,得到调整后的结束触控点;moving the end touch point to the positive x-axis and negative y-axis of the touch screen by a second distance to obtain the adjusted end touch point;
    根据调整后的起始触控点的位置信息和调整后的结束触控点的位置信息,确定所述触控区域。The touch area is determined according to the adjusted position information of the starting touch point and the adjusted position information of the end touch point.
  13. 一种文本提取装置,其特征在于,所述装置包括:A text extraction device, characterized in that the device comprises:
    第一获取模块,用于响应于触摸屏上的触控操作,获取触控区域;a first acquisition module, configured to acquire a touch area in response to a touch operation on the touch screen;
    提取模块,用于通过光学字符识别OCR技术提取所述第一获取模块获取的触控区域内的第一文本信息;an extraction module, configured to extract the first text information in the touch area acquired by the first acquisition module through optical character recognition (OCR) technology;
    确定模块,用于从所述触摸屏上显示一个或多个文本性控件中确定出与所述触控区域匹配的目标控件;a determining module, configured to determine a target control matching the touch area from one or more textual controls displayed on the touch screen;
    第二获取模块,用于从所述确定模块确定的目标控件中获取第二文本信息;A second obtaining module, configured to obtain second text information from the target control determined by the determining module;
    调整模块,用于基于所述第二获取模块获取的第二文本信息对所述提取模块提取的第一文本信息进行调整,获得第三文本信息。An adjustment module, configured to adjust the first text information extracted by the extraction module based on the second text information acquired by the second acquisition module to obtain third text information.
  14. 根据权利要求13所述的装置,其特征在于,所述确定模块包括:The apparatus according to claim 13, wherein the determining module comprises:
    第一获取单元,用于获取所述触摸屏上显示的各文本性控件与所述触控区域的交并比;a first acquiring unit, configured to acquire the intersection ratio of each textual control displayed on the touch screen and the touch area;
    第一确定单元,用于基于所述交并比,确定出所述目标控件。a first determining unit, configured to determine the target control based on the cross-union ratio.
  15. 根据权利要求13或14所述的装置,其特征在于,所述调整模块包括:The device according to claim 13 or 14, wherein the adjustment module comprises:
    对比单元,用于对所述第一文本信息和所述第二文本信息中对应于所述触摸屏上同一位置的字符进行对比;a comparison unit, configured to compare the characters corresponding to the same position on the touch screen in the first text information and the second text information;
    第二确定单元,用于将所述第一文本信息中,与第二文本信息中的字符对应于所述触摸屏上同一位置且内容不一致的字符,确定为目标字符;a second determining unit, configured to determine a character in the first text information and a character in the second text information corresponding to the same position on the touch screen and with inconsistent content as a target character;
    第一替换单元,用于将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。The first replacement unit is configured to replace the target character in the first text information with the character in the second text information corresponding to the target character at the same position on the touch screen to obtain the third text information.
  16. 根据权利要求15所述的装置,其特征在于,所述第一替换单元还用于:The device according to claim 15, wherein the first replacement unit is further used for:
    根据所述目标字符的数量与所述第一文本信息中字符的数量,确定匹配率;Determine the matching rate according to the number of the target characters and the number of characters in the first text information;
    在所述匹配率大于第一阈值的情况下,将第一文本信息中的目标字符替换为与所述目标字符对应于所述触摸屏上同一位置的第二文本信息中的字符,得到所述第三文本信息。In the case where the matching rate is greater than the first threshold, replace the target character in the first text information with the character in the second text information corresponding to the target character at the same position on the touch screen, to obtain the first Three text messages.
  17. 根据权利要求13或14所述的装置,其特征在于,所述调整模块还包括:The device according to claim 13 or 14, wherein the adjustment module further comprises:
    检测单元,用于检测所述第二文本信息中是否存在满足预设格式的字符集;a detection unit, configured to detect whether there is a character set satisfying a preset format in the second text information;
    提取单元,用于在所述第二文本信息中存在满足所述预设格式的字符集的情况下,从所述第二文本信息中提取出满足所述预设格式的字符集;an extraction unit, configured to extract, from the second text information, a character set that satisfies the preset format when there is a character set that satisfies the preset format in the second text information;
    第二替换单元,用于采用提取出的字符集替换所述第一文本信息,得到所述第三文本信息。The second replacement unit is configured to replace the first text information with the extracted character set to obtain the third text information.
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括:The apparatus of claim 17, wherein the apparatus further comprises:
    服务模块,用于根据所述第三文本信息,提供与所述预设格式的字符集对应的服务。A service module, configured to provide a service corresponding to the character set of the preset format according to the third text information.
  19. 根据权利要求13至18中任一项所述的装置,其特征在于,所述第一获取模块包括:The device according to any one of claims 13 to 18, wherein the first obtaining module comprises:
    第二获取单元,用于响应于所述触控操作,获取起始触控点的位置信息和结束触控点的位置信息;a second obtaining unit, configured to obtain the position information of the starting touch point and the position information of the ending touch point in response to the touch operation;
    第三确定单元,用于根据所述起始触控点的位置信息和所述结束触控点的位置信息,确定所述触控区域。A third determining unit, configured to determine the touch area according to the position information of the start touch point and the position information of the end touch point.
  20. 根据权利要求13至18中任一项所述的装置,其特征在于,所述第一获取模块还包括:The device according to any one of claims 13 to 18, wherein the first obtaining module further comprises:
    加载单元,用于响应于所述触控操作,加载区域选择标记层;a loading unit, configured to load the area selection mark layer in response to the touch operation;
    第四确定单元,用于基于所述区域选择标记层的确认操作,确定所述触控区域。The fourth determination unit is configured to determine the touch area based on the confirmation operation of the area selection marking layer.
  21. 根据权利要求19所述的装置,其特征在于,所述第三确定单元还用于:The device according to claim 19, wherein the third determining unit is further configured to:
    在所述起始触控点与所述结束触控点对应同一文本行的情况下,根据所述起始触控点和所述结束触控点之间的第一区域,确定所述触控区域。In the case that the start touch point and the end touch point correspond to the same text line, the touch control is determined according to the first area between the start touch point and the end touch point area.
  22. 根据权利要求19所述的装置,其特征在于,所述第三确定单元还用于:The device according to claim 19, wherein the third determining unit is further configured to:
    在所述起始触控点和所述结束触控点对应相邻文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第二区域,以及所述结束触控点和所述触摸屏的左边界之间的第三区域,确定所述触控区域。In the case that the start touch point and the end touch point correspond to adjacent text lines, according to the second area between the start touch point and the right border of the touch screen, and the end The third area between the touch point and the left border of the touch screen determines the touch area.
  23. 根据权利要求19所述的装置,其特征在于,所述第三确定单元还用于:The device according to claim 19, wherein the third determining unit is further configured to:
    在所述起始触控点和所述结束触控点对应的文本行相隔一个或多个文本行的情况下,根据所述起始触控点和所述触摸屏的右边界之间的第四区域、所述起始触控点对应文本行与所述结束触控点对应文本行之间的第五区域,以及所述结束触控点和所述触摸屏的左边界之间的第六区域,确定所述触控区域。In the case that the text lines corresponding to the start touch point and the end touch point are separated by one or more text lines, according to the fourth value between the start touch point and the right border of the touch screen area, the fifth area between the text line corresponding to the start touch point and the text line corresponding to the end touch point, and the sixth area between the end touch point and the left border of the touch screen, Determine the touch area.
  24. 根据权利要求21至23中任一项所述的装置,其特征在于,所述第三确定单元还用于:The device according to any one of claims 21 to 23, wherein the third determining unit is further configured to:
    将所述起始触控点向所述触摸屏的y轴正向和x轴负向移动第一距离,得到调整后的起始触控点;moving the initial touch point to the positive y-axis and negative x-axis of the touch screen by a first distance to obtain the adjusted initial touch point;
    将所述结束触控点向所述触摸屏的x轴正向和y轴负向移动第二距离,得到调整后的结束触控点;moving the end touch point to the positive x-axis and negative y-axis of the touch screen by a second distance to obtain the adjusted end touch point;
    根据调整后的起始触控点的位置信息和调整后的结束触控点的位置信息,确定所述触控区域。The touch area is determined according to the adjusted position information of the starting touch point and the adjusted position information of the end touch point.
  25. 一种文本提取装置装置,其特征在于,包括处理器,用于存储处理器可执行指令的存储器,以及用于接收触控操作的触摸屏,所述处理器调用所述可执行指令时以使得终端实现如权利要求1-12中任意一项所述的方法。A text extraction device, characterized in that it includes a processor, a memory for storing executable instructions of the processor, and a touch screen for receiving touch operations, and when the processor invokes the executable instructions, the terminal A method as claimed in any of claims 1-12 is implemented.
  26. 一种非易失性计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1-12中任意一项所述的方法。A non-volatile computer-readable storage medium on which computer program instructions are stored, characterized in that, when the computer program instructions are executed by a processor, the method described in any one of claims 1-12 is implemented.
PCT/CN2021/133172 2020-11-27 2021-11-25 Text extraction method and apparatus WO2022111582A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011362776.XA CN114564141A (en) 2020-11-27 2020-11-27 Text extraction method and device
CN202011362776.X 2020-11-27

Publications (1)

Publication Number Publication Date
WO2022111582A1 true WO2022111582A1 (en) 2022-06-02

Family

ID=81711991

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133172 WO2022111582A1 (en) 2020-11-27 2021-11-25 Text extraction method and apparatus

Country Status (2)

Country Link
CN (1) CN114564141A (en)
WO (1) WO2022111582A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942212A (en) * 2013-01-21 2014-07-23 腾讯科技(深圳)有限公司 User interface character detecting method and device
CN106527945A (en) * 2016-11-09 2017-03-22 广东小天才科技有限公司 Text information extracting method and device
CN109739416A (en) * 2018-04-19 2019-05-10 北京字节跳动网络技术有限公司 A kind of Text Extraction and device
CN110287091A (en) * 2019-05-10 2019-09-27 国家计算机网络与信息安全管理中心 A kind of detection method and device in application software installation process
CN112966583A (en) * 2021-02-26 2021-06-15 深圳壹账通智能科技有限公司 Image processing method, image processing device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006259830A (en) * 2005-03-15 2006-09-28 Toshiba Corp Optical character recognition device and optical character recognition result confirmation method
JP2006260080A (en) * 2005-03-16 2006-09-28 Toshiba Corp Optical character recognition system and optical character recognition method
CN111381751A (en) * 2016-10-18 2020-07-07 北京字节跳动网络技术有限公司 Text processing method and device
CN109002759A (en) * 2018-06-07 2018-12-14 Oppo广东移动通信有限公司 text recognition method, device, mobile terminal and storage medium
CN111007980A (en) * 2019-11-29 2020-04-14 维沃移动通信有限公司 Information input method and terminal equipment
CN111930622B (en) * 2020-08-10 2023-10-13 中国工商银行股份有限公司 Interface control testing method and system based on deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942212A (en) * 2013-01-21 2014-07-23 腾讯科技(深圳)有限公司 User interface character detecting method and device
CN106527945A (en) * 2016-11-09 2017-03-22 广东小天才科技有限公司 Text information extracting method and device
CN109739416A (en) * 2018-04-19 2019-05-10 北京字节跳动网络技术有限公司 A kind of Text Extraction and device
CN110287091A (en) * 2019-05-10 2019-09-27 国家计算机网络与信息安全管理中心 A kind of detection method and device in application software installation process
CN112966583A (en) * 2021-02-26 2021-06-15 深圳壹账通智能科技有限公司 Image processing method, image processing device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114564141A (en) 2022-05-31

Similar Documents

Publication Publication Date Title
US20210208776A1 (en) Techniques for image-based search using touch controls
US20230040146A1 (en) User device and method for creating handwriting content
US11550993B2 (en) Ink experience for images
US10572779B2 (en) Electronic information board apparatus, information processing method, and computer program product
KR102199786B1 (en) Information Obtaining Method and Apparatus
US20170351917A1 (en) Method for recognizing a specific object inside an image and electronic device thereof
US9792708B1 (en) Approaches to text editing
TWI653545B (en) Method, system and non-transitory computer-readable media for real-time handwriting recognition
US9075828B2 (en) Electronic device and method of controlling the same
EP3183640B1 (en) Device and method of providing handwritten content in the same
US20190324634A1 (en) Display and Processing Methods and Related Apparatus
US20160203194A1 (en) User terminal for displaying image and image display method thereof
US20150077362A1 (en) Terminal with fingerprint reader and method for processing user input through fingerprint reader
KR20180004552A (en) Method for controlling user interface according to handwriting input and electronic device for the same
KR102521333B1 (en) Method for displaying user interface related to user authentication and electronic device for the same
US8615274B2 (en) Electronic device and controlling method thereof
US20170285932A1 (en) Ink Input for Browser Navigation
EP2747057A1 (en) Text-enlargement display method
JP2013077302A (en) User interface providing method and device of portable terminal
KR102125212B1 (en) Operating Method for Electronic Handwriting and Electronic Device supporting the same
US20150370786A1 (en) Device and method for automatic translation
CN105590298A (en) Extracting and correcting image data of an object from an image
US20220050975A1 (en) Content Translation Method and Terminal
US20180024976A1 (en) Annotation providing method and device
WO2023197648A1 (en) Screenshot processing method and apparatus, electronic device, and computer readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21897082

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21897082

Country of ref document: EP

Kind code of ref document: A1