Text recognition method based on terminal device, and device and storage medium
By implementing automatic text recognition and dynamic button design on terminal devices, the problem of text information extraction in images is solved, and the efficiency and accuracy of text information acquisition in real-time scenarios are improved.
Patent Information
- Application Number
- PCT/CN2023/136858
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-06
- Filing Date
- 2023-12-06
- Publication Date
- 2024-09-12
AI Technical Summary
Existing technology is difficult to extract text information from images quickly and accurately, especially in real-time scenarios, and it is easy to miss important text information.
By implementing a method and system based on text recognition on the terminal device, using interface design and image processing technology, it can automatically identify text objects in images and provide dynamic buttons for text extraction, reducing user interaction and errors.
It achieves rapid and accurate recognition and extraction of text information in images on terminal devices, reduces user operation errors, and improves the efficiency of text information acquisition in real-time scenarios.
Smart Images

Figure CN2023136858_12092024_PF_FP_ABST
Abstract
Description
Terminal-based text recognition method, device, and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 6, 2023, with application number 202310252334.7 and application name “Text recognition method, device and storage medium based on terminal device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a text recognition method, device, and storage medium based on a terminal device. Background Art
[0003] Terminal devices have become an important tool in people's lives. They can be used to capture images and extract text information from images; users can then obtain the text information.
[0004] Therefore, there is an urgent need for a solution that can obtain the text in the image in a timely and rapid manner to avoid missing the text in the real-time image.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a text recognition method, device, and storage medium based on a terminal device, which are applied in the field of terminal technology.
[0007] In a first aspect, an embodiment of the present application provides a text recognition method based on a terminal device, the method being applied to the terminal device, the method comprising:
[0008] Displaying a first interface; wherein the first interface includes a first window, the first window displays a preview stream collected by the terminal device; the first interface includes a first button;
[0009] When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface;
[0010] In response to a second button in the first interface being triggered, a second interface is displayed; wherein the second interface includes a second window and a third window; the second window displays a preview stream captured by the terminal device, with the document frame in the current frame image in the preview stream being highlighted; when the current frame image of the preview stream includes target text, a third button is displayed on the second interface; when the current frame image of the preview stream does not include target text, the third button is not displayed on the second interface; the third window displays the first button and the fourth button;
[0011] In response to a third button in the second interface being triggered, a third interface is displayed; wherein the third interface includes a fourth window and a fifth window; the third button is displayed on the third interface; the fourth window displays a second image in the preview stream, wherein the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays the fifth button and at least one sixth button, wherein the sixth button corresponds one-to-one to the entity in the target text in the fourth window;
[0012] In response to the first button in the second interface being triggered, the fourth interface is displayed; wherein, the fourth interface displays the third image in the preview stream, and the document frame in the third image in the fourth interface is highlighted; the fourth interface includes a seventh button, an eighth button and a ninth button.
[0013] In this way, the document scanning function and the image processing function are provided, and the text extraction function is provided.
[0014] In a possible implementation, after displaying the third interface, the method further includes:
[0015] In response to the third button in the third interface being triggered, the second interface is displayed.
[0016] In this way, click the "Text Extraction Button" to return to the preview stream interface.
[0017] In a possible implementation, after displaying the fourth interface, the method further includes:
[0018] In response to the ninth button in the fourth interface being triggered, a fifth interface is displayed; wherein the fifth interface displays the third image in the preview stream; and the fifth interface includes at least one image processing button.
[0019] In this way, the image processing function under document scanning is provided.
[0020] In a possible implementation, the method further includes:
[0021] When the object category of the first image is a text object, displaying the third button on the first interface;
[0022] In response to a third button in the first interface being triggered, a third interface is displayed; wherein the third interface includes a fourth window and a fifth window; the third button is displayed on the third interface; the fourth window displays a second image in the preview stream, wherein the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays the fifth button and at least one sixth button, wherein the sixth button corresponds one-to-one to the entity in the target text in the fourth window;
[0023] In response to a third button in the third interface being triggered, the first interface is displayed.
[0024] This provides a text extraction function. Users no longer need to manually select the text to be recognized, preventing the possibility of missing text due to fleeting text and the user not having enough time to select the target text. For example, in a conference PowerPoint presentation, if the speaker flips through pages too quickly, the phone's viewfinder may not have enough time to select the target text. This allows for timely recognition of text in the image. Furthermore, users do not need to manually select the target text on the screen, avoiding conflicts with the camera itself, which could affect text recognition or the captured image. This also reduces the user's learning curve.
[0025] In a possible implementation, the method further includes
[0026] In response to the third button in the first interface being triggered, the seventh interface is displayed; wherein, the seventh interface includes a seventh window; the seventh window displays the preview stream, and the second prompt information is displayed on the seventh window; the third button is not displayed on the seventh interface, and the seventh interface includes the first button.
[0027] In this way, when the target text in the image is recognized based on the third button, if the terminal device shakes and a normal image cannot be obtained, the user can be prompted based on the abnormal situation.
[0028] In a possible implementation, when the object category of the first image is a text object, before displaying the third button on the first interface, the method further includes: when it is determined that the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode and displaying a first icon on the first interface;
[0029] When the object category of the first image is a text object, displaying the third button on the first interface includes: when the object category of the first image is a text object, displaying the third button on the first interface and not displaying the first icon.
[0030] In this way, when the super macro mode is triggered, the first icon can be displayed first to remind the user that the super macro mode has been entered; then, if it is determined that the object category of the first image is a text object, the first icon will no longer be displayed and the third button will be displayed to avoid position conflict between the first icon and the third button.
[0031] In a possible implementation, when the object category of the first image is a text object, before displaying the third button on the first interface, the method further includes: when it is determined that the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode;
[0032] When the object category of the first image is a text object, displaying the third button on the first interface includes:
[0033] When the object category of the first image is a text object, at a first moment, displaying the third button on the first interface;
[0034] At a second moment, the first icon is displayed on the first interface, and the third button is not displayed; wherein the second moment is later than the first moment;
[0035] At a third moment, the third button is displayed on the first interface, and the first icon is not displayed; wherein the third moment is later than the second moment.
[0036] In this way, when the super macro mode is triggered, if the object category of the first image is determined to be a text object, the third button is displayed first; then the first icon and the third button are displayed to avoid position conflict between the first icon and the third button, and to remind the user that the super macro mode has been entered; then the third button is displayed and the first icon is not displayed to prompt the user that a text object has been detected.
[0037] In a possible implementation, the third interface also includes a seventh button.
[0038] In a possible implementation, when the number of entities in the second image is greater than a preset number, the number in the sixth button is the preset number minus 1, and the fifth window further displays a tenth button.
[0039] In one possible implementation, the arrangement order of the sixth button in the fifth window and the arrangement order of the entities in the second image correspond to each other; or, the arrangement order of the sixth button in the fifth window is determined in real time based on the user portrait or user intention.
[0040] In one possible implementation, the sixth button corresponds to at least one function, and the function has a priority, and the priority of the function is determined in real time based on the user portrait or user intention; the method also includes: in response to the sixth button being triggered, calling the function with the highest priority corresponding to the sixth button.
[0041] In this way, when the first button is triggered, the function with the highest priority corresponding to the sixth button can be directly called, reducing user operations.
[0042] In one possible implementation, the entity displayed in the fourth window of the third interface corresponds to at least one first option, the first option having a priority, and the priority of the first option is determined in real time based on a user profile or user intent; the priority of the first option of the entity and the priority of the function of the sixth button corresponding to the entity have a one-to-one correspondence;
[0043] The method further includes: in response to the entity in the fourth window being triggered, displaying a first service menu corresponding to the entity in the fourth window; wherein the first service menu includes at least one first option, and the first options in the first service menu are sorted according to the priority of the first options.
[0044] In this way, when the user triggers the text of the entity in the fourth window, the user can be provided with various first options sorted by priority.
[0045] In a possible implementation, the method further includes:
[0046] In response to the non-entity in the fourth window being triggered, a second service menu corresponding to the non-entity is displayed on the fourth window; wherein the second service menu includes at least one second option.
[0047] In one possible implementation, when the object category of the first image in the preview stream is a document object, before displaying the second button on the first interface, the method further includes: when the distance between the camera of the terminal device and the physical object is less than a first threshold, enabling super macro mode and displaying a first icon on the first interface;
[0048] When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface includes: when the object category of the first image in the preview stream is a document object, displaying the second button on the first interface and not displaying the first icon.
[0049] In this way, when the super macro mode is triggered, the first icon can be displayed first to remind the user that the super macro mode has been entered; then, if the object category of the first image is determined to be a document object, the first icon will no longer be displayed and the second button will be displayed to avoid position conflict between the first icon and the second button.
[0050] In a possible implementation, when the object category of the first image in the preview stream is a document object, before displaying the second button on the first interface, the method further includes: when the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode,
[0051] When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface includes:
[0052] When the object category of the first image in the preview stream is a document object, displaying the second button on the first interface at a first moment;
[0053] At a second moment, the first icon is displayed on the first interface, and the second button is not displayed; wherein the second moment is later than the first moment;
[0054] At a third moment, the second button is displayed on the first interface and the first icon is not displayed; wherein the third moment is later than the second moment.
[0055] In this way, when the super macro mode is triggered, if the object category of the first image is determined to be a document object, the second button is displayed first; then the first icon and the second button are displayed to avoid position conflict between the first icon and the second button, and to remind the user that the super macro mode has been entered; then the second button is displayed and the first icon is not displayed to prompt the user that the target document object has been detected.
[0056] In a possible implementation, the second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area;
[0057] The second image displayed in the third interface includes the first area but does not include the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0058] In this way, the non-target text area can be removed, making it easier for users to view the target text.
[0059] In a possible implementation, the second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area;
[0060] The second image displayed in the third interface includes the first area but does not include the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the direction of the text block of the target text in the second image displayed in the third interface is adapted to the screen direction of the terminal device.
[0061] In this way, the area of non-target text can be removed, making it easier for users to view the target text. The direction of the text block is adapted to the screen direction of the terminal device, making it easier for users to view the target text.
[0062] In a possible implementation, the second image in the preview stream includes at least one third region and a fourth region, wherein the third region is a region formed by a text block of the target text; a distance between two third regions in at least one pair of adjacent third regions is greater than a preset distance; and the fourth region is a peripheral region of the region formed by the at least one third region;
[0063] The second image displayed in the third interface includes the at least one third area but does not include the fourth area, and the text block of the target text in the second image displayed in the third interface is highlighted; the distance between adjacent third areas in the second image displayed in the third interface is less than the preset distance; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0064] In this way, the non-target text area can be removed, making it easier for users to view the target text.
[0065] In a possible implementation, the second image in the preview stream includes a fifth area and a sixth area, the fifth area being an area formed by text blocks of the target text and having a background image, and the sixth area being a peripheral area of the fifth area;
[0066] The second image displayed in the third interface includes the fifth area but does not include the sixth area, and a text block of a target text in the second image displayed in the third interface is highlighted.
[0067] In this way, the non-target text area can be removed and the background image can be retained, making it easier for users to view the target text and the background of the text block.
[0068] In a possible implementation, the second image in the preview stream includes a first area and a second area, the first area being an area formed by text blocks of the target text, and the second area being a peripheral area of the first area; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions;
[0069] The second image displayed in the third interface includes the first area but does not include the second area; the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the directions of each text block of the target text in the second image displayed in the third interface include at least two different directions, or the directions of each text block of the target text in the second image displayed in the third interface are consistent.
[0070] In this way, the non-target text area can be removed, making it easier for users to view the target text.
[0071] In one possible implementation, the second image in the preview stream includes at least one third region and a fourth region, the third region being a region formed by text blocks of the target text; a distance between two third regions in at least one pair of adjacent third regions is greater than a preset distance; the fourth region is a peripheral region of the region formed by the at least one third region; and the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions;
[0072] The second image displayed in the third interface includes the at least one third area but does not include the fourth area, and the text blocks of the target text in the second image displayed in the third interface are highlighted; the distances between adjacent third areas in the second image displayed in the third interface are less than the preset distance; the background color of the text blocks of the target text in the second image in the preview stream and the background color of the text blocks of the target text in the second image displayed in the third interface are different; the directions of the text blocks of the target text in the second image displayed in the third interface are consistent.
[0073] In this way, the area of non-target text can be removed, making it easier for users to view the target text. The direction of the text block is adapted to the screen direction of the terminal device, making it easier for users to view the target text.
[0074] In one possible implementation, the second image in the preview stream includes a fifth area and a sixth area, the fifth area being an area formed by text blocks of the target text and having a background image, and the sixth area being a peripheral area of the fifth area; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions;
[0075] The second image displayed in the third interface includes the fifth area but does not include the sixth area, and the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0076] In this way, the non-target text area can be removed and the background image can be retained, making it easier for users to view the target text and the background of the text block.
[0077] In a possible implementation, at a fourth moment, in response to a first position on the fourth window being triggered, where the first position is any position on the second image in the fourth window, the image on the fourth window is enlarged at a first ratio with the first position as a center point;
[0078] At a fifth moment, in response to a second position on the fourth window being triggered, wherein the second position is an arbitrary position on the second image in the fourth window, the image on the fourth window is enlarged at a second ratio with the second position as a center point; the fifth moment is later than the fourth moment;
[0079] At a sixth moment, in response to the third position on the fourth window being triggered, wherein the third position is any position on the second image in the fourth window, the image on the fourth window is reduced to the size before the fourth moment; the sixth moment is later than the fifth moment.
[0080] In this way, by zooming in on the image, enlarging the image, and then restoring the image, it is convenient for users to view the details of the image and text.
[0081] In a possible implementation, at a seventh moment, in response to a fourth position on the fourth window being triggered, where the fourth position is any position on the second image in the fourth window, the image on the fourth window is enlarged at a third ratio with the fourth position as a center point;
[0082] At an eighth moment, in response to the fifth position on the fourth window being triggered, wherein the fifth position is any position on the second image in the fourth window, the size of the image on the fourth window is restored; the eighth moment is later than the seventh moment.
[0083] In this way, by magnifying the image and then restoring it, it is convenient for users to see the details of the image and text.
[0084] In a possible implementation, at a ninth moment, in response to the first text block on the fourth window being triggered, the image on the fourth window is enlarged; after the ninth moment, the longest text block in the enlarged image reaches an edge of the screen of the terminal device;
[0085] At the tenth moment, in response to the sixth position on the fourth window being triggered, wherein the sixth position is any position on the second image in the fourth window, the image on the fourth window is restored to the original image size of the image; the tenth moment is later than the ninth moment.
[0086] In this way, by triggering the text block, the image is enlarged in a manner that the longest text block reaches the edge of the screen of the terminal device; then, by triggering any position on the image, the image is restored to its original image size.
[0087] In a possible implementation, at the eleventh moment, in response to the second text block on the fourth window being triggered, the image on the fourth window is enlarged; after the eleventh moment, the second text block in the enlarged image reaches the edge of the screen of the terminal device;
[0088] At a twelfth moment, in response to a third text block on the fourth window being triggered, wherein the length of the third text block is less than the length of the second text block, the image on the fourth window is enlarged; the third text block in the enlarged image after the twelfth moment reaches an edge of the screen of the terminal device; the twelfth moment is later than the eleventh moment;
[0089] At a thirteenth moment, in response to the third text block on the fourth window being triggered, the image on the fourth window is restored to the image size before the twelfth moment; the second text block in the reduced image after the thirteenth moment reaches the edge of the screen of the terminal device; the thirteenth moment is later than the twelfth moment;
[0090] At the fourteenth moment, in response to the seventh position on the fourth window being triggered, wherein there is no target text at the seventh position, the image on the fourth window is restored to its original image size; the fourteenth moment is later than the eleventh moment.
[0091] In this way, by enlarging the text block, it is convenient for users to view the details of the image and text block.
[0092] In a possible implementation, after displaying the fourth interface, the method further includes:
[0093] In response to the seventh button on the fourth interface being triggered, the terminal device displays the second interface.
[0094] In a possible implementation, after displaying the fourth interface, the method further includes:
[0095] In response to the eighth button on the fourth interface being triggered, the terminal device reacquires a frame of image in the preview stream.
[0096] In a second aspect, embodiments of the present application provide a terminal device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver functions, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc.
[0097] The terminal device includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method of the first aspect.
[0098] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of the first aspect.
[0099] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, it enables the computer to execute the method of the first aspect.
[0100] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method described in the first aspect.
[0101] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] FIG1 shows a schematic structural diagram of a terminal device 100;
[0103] FIG2 is a software structure block diagram of the terminal device 100 according to an embodiment of the present application;
[0104] FIG3 is a flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application;
[0105] FIG4 is a first flow chart of a method for detecting content objects in an image according to an embodiment of the present application;
[0106] FIG5 is a second schematic diagram of a process for detecting content objects in an image in a method according to an embodiment of the present application;
[0107] FIG6 is a first schematic diagram of an interface provided in an embodiment of the present application;
[0108] FIG7 is a second schematic diagram of an interface provided in an embodiment of the present application;
[0109] FIG8 is a third schematic diagram of an interface provided in an embodiment of the present application;
[0110] FIG9 is a fourth schematic diagram of an interface provided in an embodiment of the present application;
[0111] FIG10 is a fifth schematic diagram of an interface provided in an embodiment of the present application;
[0112] FIG11 is a sixth schematic diagram of an interface provided in an embodiment of the present application;
[0113] FIG12 is a seventh schematic diagram of an interface provided in an embodiment of the present application;
[0114] FIG13 is a schematic diagram of an interface provided in an embodiment of the present application;
[0115] FIG14 is a ninth diagram of an interface provided in an embodiment of the present application;
[0116] FIG15 is a schematic diagram of the interface provided in an embodiment of the present application;
[0117] FIG16 is a schematic diagram of an interface eleven provided in an embodiment of the present application;
[0118] FIG17 is a schematic diagram of the interface 12 provided in an embodiment of the present application;
[0119] FIG18 is a schematic diagram 13 of an interface provided in an embodiment of the present application;
[0120] FIG19 is a schematic diagram of the fourteenth interface provided in an embodiment of the present application;
[0121] FIG20 is a schematic diagram of the fifteenth interface provided in an embodiment of the present application;
[0122] FIG21 is a schematic diagram of the sixteenth interface provided in an embodiment of the present application;
[0123] FIG22 is a schematic diagram of the seventeenth interface provided in an embodiment of the present application;
[0124] FIG23 is a schematic diagram of the eighteenth interface provided in an embodiment of the present application;
[0125] FIG24 is a nineteenth interface diagram provided in an embodiment of the present application;
[0126] FIG25 is a schematic diagram of the interface 20 provided in an embodiment of the present application;
[0127] FIG26 is a schematic diagram 21 of an interface provided in an embodiment of the present application;
[0128] FIG27 is a schematic diagram 22 of an interface provided in an embodiment of the present application;
[0129] FIG28 is a schematic diagram 23 of an interface provided in an embodiment of the present application;
[0130] FIG29 is a schematic diagram of the interface provided in an embodiment of the present application twenty-four;
[0131] FIG30 is a schematic diagram of the interface provided in the embodiment of the present application twenty-fifth;
[0132] FIG31 is a schematic diagram of the interface provided in an embodiment of the present application twenty-six;
[0133] FIG32 is a schematic diagram 27 of an interface provided in an embodiment of the present application;
[0134] FIG33 is a schematic diagram 28 of an interface provided in an embodiment of the present application;
[0135] FIG34 is a schematic diagram 29 of an interface provided in an embodiment of the present application;
[0136] FIG35 is a schematic diagram of the interface provided in the embodiment of the present application;
[0137] FIG36 is a schematic diagram 31 of an interface provided in an embodiment of the present application;
[0138] FIG37 is a schematic diagram of the interface provided in the embodiment of the present application 32;
[0139] FIG38 is a schematic diagram of the interface provided in the embodiment of the present application 33;
[0140] FIG39 is a diagram 34 of an interface provided in an embodiment of the present application;
[0141] FIG40 is a schematic diagram of the interface provided in an embodiment of the present application;
[0142] FIG41 is a diagram 36 of an interface provided in an embodiment of the present application;
[0143] FIG42 is a schematic diagram of the interface provided in the embodiment of the present application thirty-seven;
[0144] FIG43 is a schematic diagram of the interface provided in the embodiment of the present application 38;
[0145] FIG44 is a schematic diagram of the interface provided in the embodiment of the present application thirty-ninth;
[0146] FIG45 is a schematic diagram of the interface provided in an embodiment of the present application;
[0147] FIG46 is a schematic diagram 41 of an interface provided in an embodiment of the present application;
[0148] FIG47 is a schematic diagram 42 of an interface provided in an embodiment of the present application;
[0149] FIG48 is a schematic diagram 43 of an interface provided in an embodiment of the present application;
[0150] FIG49 is a schematic diagram 44 of an interface provided in an embodiment of the present application;
[0151] FIG50 is a schematic diagram of the interface provided in the embodiment of the present application;
[0152] FIG51 is a schematic diagram of the software layer of a terminal device provided in an embodiment of the present application;
[0153] FIG52 is a second flow chart of a text recognition method based on a terminal device provided in an embodiment of the present application;
[0154] FIG53 is a schematic diagram 46 of an interface provided in an embodiment of the present application;
[0155] FIG54 is a third flow chart of a text recognition method based on a terminal device provided in an embodiment of the present application;
[0156] FIG55 is a schematic diagram 47 of an interface provided in an embodiment of the present application;
[0157] FIG56 is a schematic diagram 48 of an interface provided in an embodiment of the present application;
[0158] FIG57 is a schematic diagram showing the structure of a chip provided in an embodiment of the present application;
[0159] Figure 58 is a structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0160] To facilitate a clear description of the technical solutions of the embodiments of this application, the words "exemplary" or "for example" are used in the embodiments of this application to indicate examples, illustrations, or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0161] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0162] It should be noted that the "at..." in the embodiments of the present application can be the instant when a certain situation occurs, or it can be a period of time after the situation occurs, and the embodiments of the present application do not specifically limit this. In addition, the display interface provided in the embodiments of the present application is only an example, and the display interface can also include more or less content.
[0163] Terminal devices have become an important tool in people's lives. They can be used to capture images and extract text information from images; users can then obtain the text information.
[0164] Therefore, there is an urgent need for a solution that can obtain the text in the image in a timely and rapid manner to avoid missing the text in the real-time image.
[0165] Electronic devices include terminal devices, which can also be called terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Terminal devices can be mobile phones, smart TVs, wearable devices, tablet computers (Pads), computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal devices.
[0166] In order to better understand the embodiments of the present application, the structure of the terminal device in the embodiments of the present application is introduced below:
[0167] 1 shows a schematic structural diagram of a terminal device 100. The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0168] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0169] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0170] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0171] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the instruction or data again, it can retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0172] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0173] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the terminal device 100.
[0174] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes only and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods from those in the above embodiments, or a combination of multiple interface connection methods.
[0175] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0176] The terminal device 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0177] The display screen 194 is used to display images, videos, etc.
[0178] The terminal device 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0179] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0180] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0181] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0182] Video codecs are used to compress or decompress digital video. Terminal device 100 may support one or more video codecs. This allows terminal device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0183] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in the terminal device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0184] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0185] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0186] The terminal device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0187] The software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture, etc. In the embodiment of the present application, the Android system with a layered architecture is used as an example to exemplify the software structure of the terminal device 100.
[0188] FIG2 is a block diagram of the software structure of the terminal device 100 according to an embodiment of the present application.
[0189] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0190] The application layer can include a series of application packages.
[0191] As shown in FIG2 , the application package may include applications such as camera, calendar, phone, map, telephone, music, settings, mailbox, video, social, etc.
[0192] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0193] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a resource manager, a view system, a notification manager, and the like.
[0194] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, take screenshots, etc.
[0195] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0196] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0197] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0198] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager can be used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating the device, or flashing indicator lights.
[0199] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0200] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0201] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0202] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0203] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0204] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0205] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0206] A 2D graphics engine is a drawing engine for 2D drawings.
[0207] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0208] The following describes the workflow of the software and hardware of the terminal device 100 by way of example, in conjunction with the scenario of application startup or interface switching in the application.
[0209] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into raw input events (including touch coordinates, touch force, touch operation timestamp and other information). The raw input events are stored in the kernel layer. The application framework layer obtains the raw input events from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch-click operation and the control corresponding to the click operation is the control of the mailbox application icon, the mailbox application calls the interface of the application framework layer to start the mailbox application, and then starts the display driver by calling the kernel layer to display the functional interface of the mailbox application.
[0210] The solution provided in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0211] FIG3 is a flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application. As shown in FIG3 , the method includes:
[0212] S301: A terminal device opens a camera application and displays a first interface; wherein the first interface includes a first window displaying a preview stream captured by the terminal device; and the first interface includes a first button. The terminal device identifies an object category of a first image in the preview stream; wherein the first image is a current frame image in the preview stream.
[0213] The object category includes the following categories: text object, document object, and non-text object. The object category of the image recognized by the terminal device is one of the above three categories.
[0214] Wherein, the object category of the image is a text object, which indicates that the captured image includes the target text and the captured image is not a document.
[0215] The object category of the image is a document object, which indicates that the captured image is a document and includes the target text.
[0216] The object category of the image is a non-text object, which indicates that the captured image does not include the target text.
[0217] Exemplarily, the execution subject of this embodiment is a terminal device, which has a camera application.
[0218] The user triggers the terminal device to open the camera application. The terminal device captures an image stream based on the camera application, and then the terminal device displays the acquired preview stream (i.e., image stream) based on the camera application. The preview stream includes an image captured in real time. At this time, the terminal device can display a first interface based on the camera application, and the first interface includes a first window, and the first window displays the currently captured preview stream (i.e., image stream). A first button is displayed on the first interface; the first button is a button for being triggered to capture an image.
[0219] In the process of obtaining the preview stream based on the camera application, the terminal device continuously detects image frames and generates a preview stream at a preset speed, for example, generating a preview stream at a speed of 20 frames / second or generating a preview stream at a speed of 60 frames / second.
[0220] During the real-time generation of the preview stream, the terminal device samples and detects a frame of image in the preview stream at a preset detection frequency to obtain the current frame image, i.e., the first image. The terminal device then identifies the object category of the first image and determines whether the object category of the first image is a text object, a document object, or a non-text object. For example, during the real-time generation of the preview stream, the terminal device samples a frame of image at a detection frequency every five frames to obtain the first image. The terminal device then detects the first image to determine the object category of the first image. The detection is performed once every five frames, i.e., once every 250 milliseconds.
[0221] “Identifying the object category of the first acquired image” may be implemented in any of the following ways:
[0222] First implementation method: FIG4 is a flow chart of detecting the content object of an image in the method provided in an embodiment of the present application. As shown in FIG4 , the detection process includes:
[0223] Step S41: The terminal device collects a preview stream based on a camera application, and the terminal device displays the obtained preview stream (ie, image stream) based on the camera application. The preview stream includes image frames collected in real time.
[0224] Step S42: The terminal device extracts images from the preview stream at a preset detection frequency to obtain a current frame image to be detected. The current frame image is the first image. For example, the terminal device detects the preview stream once every 250 milliseconds to extract a frame image.
[0225] Step S43: The terminal device performs text detection on the current image frame using a text detection technology to determine whether the current frame image includes the target text.
[0226] The "target text" refers to text that falls into a preset category. Preset categories include one or more of the following: a preset language, preset font information, no language restrictions and no font restrictions, etc. "Preset font information" includes one or more of the following: a preset font type, a preset font size, a preset font style (e.g., print, handwriting), a preset font color, etc.
[0227] "The terminal device performs text detection on the current image frame through text detection technology to determine whether the current frame image includes the target text", including: the terminal device performs text detection on the current image frame through text detection technology; and during the detection process, the terminal device requires the text to be a preset category of text to detect whether the current image frame includes the target text.
[0228] The setting of the preset category of the "target text" can be achieved in the following ways. One way is that the user sets the preset category information in the "settings" page of the terminal device; for example, the "settings" page of the terminal device provides a language option, and the user can select "Chinese" as the category of the text to be extracted in the page; for another example, the "settings" page of the terminal device provides a font option, and the user can select "Songti" as the category of the text to be extracted in the page. Another way is that the terminal device automatically determines the preset category based on the language, font, and glyph used by the terminal device, as well as the font and glyph of the text entered by the user in the past. Another way is that the terminal device automatically determines the preset category based on the user's historical selection when selecting text on an image using the "text recognition method based on a terminal device" provided by this solution; for example, when the user selects text in the "second window" introduced later, the terminal device records the user's historical selection, and then the terminal device automatically determines the preset category based on the user's multiple historical selections.
[0229] If the preset category is "no language restriction and no font information restriction", the terminal device performs text detection on the current image frame through text detection technology to detect whether the current frame image includes text; wherein, in the process of detecting whether the current frame image includes text, there is no restriction on whether the text conforms to the preset language, whether the text conforms to the preset font information, etc.
[0230] Step S44: After step S43, if the terminal device determines that the current frame image includes the target text, the terminal device determines whether a document is detected.
[0231] The terminal device performs document detection on the current frame image, and determines whether a document has been detected based on one or more of edge detection information, information about the percentage of the frame to be analyzed that is occupied by the viewfinder, and a positional relationship between the center point of the viewfinder and the frame to be analyzed. If the terminal device determines that the edge detection information meets a first condition, the information about the percentage of the frame to be analyzed that is occupied by the viewfinder meets a second condition, and the positional relationship between the center point of the viewfinder and the frame to be analyzed meets a third condition, then the terminal device determines that a document has been detected. Otherwise, the terminal device determines that a document has not been detected.
[0232] The “edge detection information” represents the number of detected edges and / or the number of detected corners.
[0233] The “first condition” corresponding to the “edge detection information” is that four edges are detected; or, the “first condition” corresponding to the “edge detection information” is that three edges are detected; or, the “first condition” corresponding to the “edge detection information” is that four corners are detected; or, the “first condition” corresponding to the “edge detection information” is that three corners are detected; or, the “first condition” corresponding to the “edge detection information” is that four edges and five corners are detected.
[0234] The terminal device may perform edge detection on the current frame image to obtain the number of edges. For example, the terminal device may perform edge detection on the current frame image using an edge detection algorithm to obtain the number of edges.
[0235] The terminal device performs edge detection on the current frame image and, based on the edge detection results, determines whether the edges form corners and obtains the number of corners. For example, the terminal device performs edge detection on the current frame image using an edge detection algorithm to determine whether edges are detected; then, the terminal device calculates whether the edges intersect to determine whether corners are detected.
[0236] After obtaining the "edge detection information," one or more frames to be analyzed are obtained based on the edges in the "edge detection information." For example, if four edges are obtained, these four edges constitute a frame to be analyzed 1; if another four edges are obtained, these other four edges constitute a frame to be analyzed 2.
[0237] "Proportion of the frame to be analyzed in the viewfinder" indicates the percentage of the frame to be analyzed that occupies the viewfinder. When the first image is acquired through a camera application, the viewfinder is the size of the frame captured by the terminal device through the camera application. When the first image is opened through a gallery application, the viewfinder is the size of the first image. When the first image is acquired through a screenshot application, the viewfinder is the size of the first image.
[0238] The "second condition" corresponding to the "proportion information of the frame to be analyzed in the viewfinder" is a value represented by the proportion information, which is greater than or equal to the preset proportion threshold. The preset proportion threshold is a preset value, for example, the preset proportion threshold is 80%, or the preset proportion threshold is 70%.
[0239] The "positional relationship between the center point of the framing frame and the frame to be analyzed" represents where the center point of the framing frame is located in the frame to be analyzed. For example, the center point of the framing frame is located in the frame to be analyzed, that is, the center point of the framing frame falls within the frame to be analyzed. For another example, the center point of the framing frame is located outside the frame to be analyzed, that is, the center point of the framing frame does not fall within the frame to be analyzed. For another example, the center point of the framing frame is located in a preset area in the frame to be analyzed, that is, the center point of the framing frame falls within the preset area in the frame to be analyzed. The "preset area" here can be a preset shape area centered on the center point of the frame to be analyzed; for example, the "preset area" can be a preset circular area centered on the center point of the frame to be analyzed; or, the "preset area" here can be a preset rectangular area centered on the center point of the frame to be analyzed.
[0240] The “third condition” corresponding to the “positional relationship between the center point of the framing frame and the frame to be analyzed” is that the center point of the framing frame is located in the frame to be analyzed, or that the center point of the framing frame is located in a preset area of the frame to be analyzed.
[0241] Step S45: After step S44, if the terminal device detects a document, the terminal device determines that the object category of the first image is a document object.
[0242] Step S46: After step S44, if the terminal device does not detect the document, the object category of the first image of the terminal device is a text object.
[0243] Step S47: After step S43, if the terminal device determines that the current frame image does not include the target text, the terminal device determines that the object category of the first image is a non-text object and executes step S42 again.
[0244] The detection process of steps S41-S47 is a preview stream scene recognition model.
[0245] Second implementation method: FIG5 is a second flow chart of detecting the content object of an image in the method provided in an embodiment of the present application. As shown in FIG5 , the detection process includes:
[0246] Step S51: The terminal device collects a preview stream based on a camera application, and displays the obtained preview stream (ie, image stream) based on the camera application. The preview stream includes image frames collected in real time.
[0247] Step S52: The terminal device extracts images from the preview stream at a preset detection frequency to obtain a current frame image to be detected. The current frame image is the first image. For example, the terminal device detects the preview stream once every 250 milliseconds to extract a frame image.
[0248] Step S53: The terminal device determines whether a document is detected.
[0249] Among them, step S53 can refer to the above step S44 and will not be repeated here.
[0250] Step S54: After step S53, if the terminal device determines that a document is detected, the terminal device determines that the object category of the first image is a document object.
[0251] Step S55: After step S53, if the terminal device determines that no document is detected, the terminal device performs text detection on the current image frame through text detection technology to determine whether the current frame image includes the target text.
[0252] Among them, step S55 can refer to the above step S43 and will not be repeated here.
[0253] Step S56: After step S55, if the terminal device determines that the current frame image includes the target text, the terminal device determines that the object category of the first image is a text object.
[0254] Step S57: After step S55, if the terminal device determines that the current frame image does not include the target text, the terminal device determines that the object category of the first image is a non-text object and executes step S52 again.
[0255] S302: When the object category of the first image is a document object, the terminal device displays a second button on the first interface.
[0256] For example, when a terminal device launches a camera application, the terminal device displays a first interface in real time. The first interface includes a first window that displays each current frame image in a preview stream captured in real time by the terminal device. The first interface includes a first button, at least one shooting-related setting button, at least one shooting mode button, a preview button, and a switch button.
[0257] Among them, the at least one shooting-related setting button on the first interface includes: a scan button, an AI shooting button, a flash button, an image mode button, a camera setting button, and the like.
[0258] At least one shooting mode button, including: "Aperture" shooting mode button, "Night Scene" shooting mode button, "Portrait" shooting mode button, "Photo" shooting mode button, "Video" shooting mode button, "Movie" shooting mode button, "Professional" shooting mode button, etc.
[0259] The preview button is a button for being triggered to preview an image in a camera application.
[0260] The switch button is a button used to be triggered to switch between the front camera and the rear camera.
[0261] The first interface also includes at least one magnification button, which is used to adjust the display size of the image in the preview stream. For example, the magnification buttons include: a "0.5" button, a "1" button, a "5" button, and a "10" button.
[0262] After step S301, when the terminal device determines that the first image in the captured preview stream is a document object, it displays a second button on the first interface. The second button is a document scanning animated button; the second button is triggered to scan the document in the image. The second button is displayed with "Document Scan" to facilitate user identification of the second button's function.
[0263] The second button is an animated button; the second button can have an expanded state and a collapsed state. Furthermore, when the second button is initially displayed, the terminal device can display the second button in the lower right corner of the first window. The user can drag the second button; and the terminal device then moves the second button on the first interface in response to the user's dragging operation.
[0264] Among them, at least one shooting-related setting button is arranged at the top of the first interface; the first window is located in the middle of the first interface; at least one shooting mode button, preview button, and switch button are located at the bottom of the first window.
[0265] Figure 6 is a schematic diagram of an interface provided by an embodiment of the present application. As shown in (a) of Figure 6 , the terminal device opens the camera application and displays the first interface. The first interface includes a first window 501, in which a preview stream captured by the terminal device is displayed. The first interface may also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605. As shown in (b) of Figure 6 , when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. The second button 606 has an expanded state and a collapsed state. In (b) of Figure 6 , the second button 606 is in the expanded state.
[0266] FIG7 is a second schematic diagram of an interface provided by an embodiment of the present application, as shown in FIG7(a), which is FIG6(b) above. Second button 606 is an animated button. In FIG7(a), second button 606 is in an expanded state. As shown in FIG7(b), if second button 606 is not triggered within a preset time, second button 606 is in a collapsed state.
[0267] S303. In response to the second button in the first interface being triggered, the terminal device displays the second interface; wherein the second interface includes a second window and a third window; the second window displays the preview stream collected by the terminal device, and the document frame in the current frame image in the preview stream is highlighted; when the current frame image of the preview stream includes the target text, the third button is displayed on the second interface; when the current frame image of the preview stream does not include the target text, the third button is not displayed on the second interface; the third window displays the first button and the fourth button.
[0268] Exemplarily, in response to a second button on the first interface being triggered, the terminal device displays a second interface. The second interface includes a second window and a third window. The second window displays a preview stream captured in real time by the terminal device. Furthermore, the terminal device highlights the outer frame of the document detected in the current frame image in the preview stream; for example, the outer frame of the document detected in the current frame image is highlighted in yellow.
[0269] The third window displays a first button, a preview button, and a fourth button. The fourth button is a button for exiting document scanning when triggered. A "Document Scan X" is displayed on the fourth button to facilitate the user to determine the function of the fourth button.
[0270] The second interface may also display at least one shooting-related setting button, wherein the at least one shooting-related setting button on the second interface includes: an AI shooting button, a flash button, an image mode button, etc.
[0271] Among them, at least one shooting-related setting button is arranged at the top of the second interface; the second window is located in the middle of the second interface; and the third window is located at the bottom of the second interface.
[0272] The terminal device needs to detect in real time whether the current frame image of the preview stream in the second window contains the target text.
[0273] The "target text" refers to text that falls into a preset category. Preset categories include one or more of the following: a preset language, preset font information, no language restrictions and no font restrictions, etc. "Preset font information" includes one or more of the following: a preset font type, a preset font size, a preset font style (e.g., print, handwriting), a preset font color, etc.
[0274] The setting of the preset category of the "target text" can be achieved in the following ways. One way is that the user sets the preset category information in the "settings" page of the terminal device; for example, the "settings" page of the terminal device provides a language option, and the user can select "Chinese" as the category of the text to be extracted in the page; for another example, the "settings" page of the terminal device provides a font option, and the user can select "Songti" as the category of the text to be extracted in the page. Another way is that the terminal device automatically determines the preset category based on the language, font, and glyph used by the terminal device, as well as the font and glyph of the text entered by the user in the past. Another way is that the terminal device automatically determines the preset category based on the user's historical selection when selecting text on an image using the "text recognition method based on a terminal device" provided by this solution; for example, when the user selects text in the "second window" introduced later, the terminal device records the user's historical selection, and then the terminal device automatically determines the preset category based on the user's multiple historical selections.
[0275] If the preset category is "no language restriction and no font information restriction", the terminal device performs text detection on the current image frame through text detection technology to detect whether the current frame image includes text; wherein, in the process of detecting whether the current frame image includes text, there is no restriction on whether the text conforms to the preset language, whether the text conforms to the preset font information, etc.
[0276] Thus, the terminal device performs text detection on the current frame image of the preview stream in the second window through text detection technology; and during the detection process, the terminal device requires the text to be a preset category of text to detect whether the current frame image of the preview stream in the second window includes the target text.
[0277] If the terminal device determines that the current frame image of the preview stream in the second window includes the target text, the terminal device displays a third button on the second interface. The third button is a "text extraction animation button" and is used to be triggered to extract text from the image. The third button is displayed with "Text Extraction" to facilitate the user to determine the function of the third button.
[0278] The third button is an animated button; the third button can have an expanded state and a collapsed state. Furthermore, when the third button is initially displayed, the terminal device can display the third button in the lower right corner of the second window. The user can drag the third button; and the terminal device then moves the third button on the second interface in response to the user's dragging operation.
[0279] If the terminal device determines that the current frame image of the preview stream in the second window does not include the target text, the terminal device does not display the third button on the second interface. Alternatively, the terminal device detects the target text in the current frame image of the preview stream in the second window in real time, and displays the third button on the second interface regardless of whether the target text is detected.
[0280] Figure 8 is a third interface diagram provided in an embodiment of the present application, as shown in (a) in Figure 8 , (a) in Figure 8 is (a) in the above-mentioned Figure 6 ; (b) in Figure 8 is (b) in the above-mentioned Figure 6 .
[0281] The user triggers the second button 606 on the first interface in FIG8(b), and the terminal device displays the second interface, as shown in FIG8(c). The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream captured by the terminal device. The terminal device detects in real time whether the current frame image of the preview stream displayed in the second window 502 contains the target text. When the terminal device determines that the current frame image of the preview stream displayed in the second window 502 contains the target text, the terminal device displays a third button 607 on the second interface, as shown in FIG8(c). The third window 503 displays the first button 601, a preview button 604, and a fourth button 608, with "Document Scan x" displayed on the fourth button 608. The first interface may also include at least one shooting-related setting button 602.
[0282] Alternatively, the user triggers the second button 606 on the first interface in FIG8(b), and as shown in FIG8(d), the terminal device displays the second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream captured by the terminal device. The terminal device detects in real time whether the current frame image of the preview stream displayed in the second window 502 includes the target text. If the terminal device determines that the current frame image of the preview stream displayed in the second window 502 does not include the target text, as shown in FIG8(d), the terminal device does not display the third button 607 on the second interface. The third window 503 displays the first button 601, the preview button 604, and the fourth button 608, with "Document Scan x" displayed on the fourth button 608. The first interface may also include at least one shooting-related setting button 602.
[0283] S304. In response to the third button in the second interface being triggered, the terminal device displays the third interface; wherein the third interface includes a fourth window and a fifth window; a third button is displayed on the third interface; the fourth window displays the second image in the preview stream, and the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays a fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window.
[0284] In one example, the third interface also includes a seventh button.
[0285] In one example, the second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area.
[0286] The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0287] In one example, when the number of entities in the second image is greater than a preset number, the number in the sixth button is the preset number minus 1, and the fifth window further displays a tenth button.
[0288] In one example, the arrangement order of the sixth button in the fifth window corresponds to the arrangement order of the entities in the second image; or, the arrangement order of the sixth button in the fifth window is determined in real time based on the user portrait or user intention.
[0289] For example, in step S303, if the terminal device detects that the current frame image of the preview stream displayed in the second window of the second interface includes the target text, the terminal device displays a third button on the second interface. The third button is a "text extraction animation button." The user can then trigger the third button on the second interface.
[0290] Then, in response to the third button in the second interface being triggered, the terminal device displays a third interface. The third interface includes a fourth window and a fifth window. A third button is displayed on the third interface; the third button is in a collapsed state or an expanded state.
[0291] Because the user triggers the third button on the second interface, the terminal device can capture the current frame image in the preview stream at the moment the third button is triggered in real time, thereby obtaining a second image. Consequently, the terminal device displays the second image in the preview stream in the fourth window. At this point, the terminal device displays a single frame of the second image in the fourth window of the third interface. The second image, the first image, and the image in step S303 are images at different moments in the preview stream.
[0292] Furthermore, the terminal device detects the target text in the second image in real time. The “target text” is described above. If the terminal device detects that the second image contains the target text, the target text in the second image is highlighted in the fourth window of the third interface.
[0293] It can be seen that the fourth window is the "text display area".
[0294] In one example, a terminal device displays a second image of the preview stream in real time in a second window of a second interface. The terminal device does not process the second image in the second window on the second interface. The second image in the preview stream includes a first area and a second area. The first area is the area formed by the text blocks of the target text, and the second area is the peripheral area of the first area. The first area is the minimum bounding rectangle formed by the text blocks in the second image, and the second area is the area of the second image excluding the minimum bounding rectangle.
[0295] In response to the third button in the second interface being triggered, the terminal device determines the minimum circumscribed matrix formed by the text blocks in the second image; the terminal device crops the second image according to the size of the minimum circumscribed matrix, and crops off the peripheral area of the second image located before the minimum circumscribed matrix. The terminal device can retain part of the area around the periphery of the minimum circumscribed matrix; and the terminal device crops off the peripheral area of the first area, that is, crops to the second area. A second image for display on the third interface is obtained. Among them, in the second image for display on the third interface, there is a certain distance between the frame formed by the text blocks and the edge of the image; the distance can be set to a fixed number of pixels, which is an empirical value; or, the distance is a percentage of the length of the text block corresponding to the distance.
[0296] Thus, the second image displayed by the terminal device in the third interface includes the above-mentioned first area, but does not include the second area. In addition, the terminal device highlights each text block of the target text in the first area. In addition, the terminal device sets the background color of the text block of the target text in the first area to a preset color (for example, gray or black); thus, the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0297] Optionally, since the second image displayed on the third interface of the terminal device is a cropped image, when the terminal device displays the second image in the fourth window of the third interface, the cropped second image can be extended to fill the fourth window. For example, based on the width of the cropped second image, the cropped second image is extended to fill the fourth window so that the cropped second image reaches the edge of the fourth window in the width direction. For another example, based on the height of the cropped second image, the cropped second image is extended to fill the fourth window so that the cropped second image reaches the edge of the fourth window in the height direction.
[0298] Furthermore, during the real-time detection of the target text in the second image by the terminal device, the terminal device identifies entities in the target text. It can be seen that the target text includes entities and / or non-entities. Entities include the following: email address, ID number, courier number, flight number, website, phone number, address, etc.
[0299] When the terminal device detects that the target text in the second image in the fourth window does not include any entities, the terminal device displays a fifth button in the fifth window. The fifth button is a button that is triggered to copy the target text in the second image in the fourth window; the fifth button is displayed with "Copy All". In addition, the terminal device displays a seventh button on the third interface. The seventh button is a button that displays the prompt message "Press and hold to select text" and the seventh button is displayed with "Press and hold to select text". The seventh button is located at the top of the third interface, the fourth window is located in the middle of the third interface, and the fifth window is located at the bottom of the third interface.
[0300] When the terminal device detects that the target text in the second image in the fourth window includes an entity, the terminal device displays a fifth button in the fifth window, and a sixth button that corresponds one-to-one to the entity in the target text in the second image. The fifth button is a button for being triggered to copy the target text in the second image in the fourth window; "Copy All" is displayed on the fifth button. The sixth button is a button for being triggered to call the function of the entity corresponding to the sixth button, and information about the entity corresponding to the sixth button is displayed on the sixth button. In addition, the terminal device displays a seventh button on the third interface. The seventh button is a button for displaying the prompt message "Long press to select text", and "Long press to select text" is displayed on the seventh button. The seventh button is located at the top of the third interface, the fourth window is located in the middle of the third interface, and the fifth window is located at the bottom of the third interface.
[0301] It can be seen that if there is an entity in the second image, the fifth window is the "entity information display area"; if there is no entity in the second image, the fifth window displays a "Copy All" capsule.
[0302] In one example, when there is an entity in the second image, when the terminal device displays the sixth button corresponding to the entity in the fifth window, since there are a large number of entities, the terminal device can display a preset number of sixth buttons in the fifth window.
[0303] If the number of entities in the second image is less than or equal to a preset number M, the terminal device may display M sixth buttons in the fifth window. M is a positive integer greater than or equal to 1. For example, M=5.
[0304] If the number of entities in the second image exceeds a preset number, the terminal device may display M-1 sixth buttons in the fifth window. Simultaneously, the terminal device displays a tenth button in the fifth window. The tenth button is a button that is triggered to display the remaining sixth buttons not displayed in the fifth window (i.e., the remaining sixth buttons not displayed in the fifth window); the tenth button is displayed with "...More." The terminal device displays the tenth button at the end of the M-1 sixth buttons.
[0305] For example, the terminal device displays a fixed number of rows of sixth buttons in the fifth window, for example, the terminal device displays three rows of sixth buttons in the fifth window; the number of sixth buttons in each row is determined according to the length of the sixth button, for example, the first row displays two sixth buttons, the second row displays two sixth buttons, and the third row displays one sixth button.
[0306] Among them, for each sixth button, since it is necessary to display the information of the entity corresponding to the sixth button on the sixth button, the complete information of the entity can be displayed on the sixth button. For example, the telephone entity 86 158******** displays a sixth button on the fifth window, and the sixth button displays 86 158********. The website entity www.****@**.com displays a sixth button on the fifth window, and the sixth button displays www.****@**.com. The address entity AA City BB District CC Road DD No. displays a sixth button on the fifth window, and the sixth button displays AA City BB District CC Road DD No. displays. The email entity www.***@**.com displays a sixth button on the fifth window, and the sixth button displays www.***@**.com.
[0307] Alternatively, for each sixth button, since it is necessary to display information about the entity corresponding to the sixth button on the sixth button, for aesthetic reasons or to effectively utilize the position of the interface, key information about the entity can be displayed on the sixth button. The terminal device can determine the key information of the entity based on a preset display method; or the terminal device can determine the key information of the entity based on user intent or user profile. For example, the telephone entity 86 158******** displays a sixth button on the fifth window, and 158******** is displayed on the sixth button. The website entity www.****@**.com displays a sixth button on the fifth window, and ****@**.com is displayed on the sixth button. The address entity AA City BB District CC Road DD No. displays a sixth button on the fifth window, and BB District CC Road DD No. displays on the sixth button. The email entity www.***@**.com displays a sixth button on the fifth window, and ***@**.com is displayed on the sixth button.
[0308] In one example, the sixth buttons displayed by the terminal device in the fifth window have an order (i.e., an order of appearance). Since there is a one-to-one correspondence between the entities in the second image and the sixth buttons, the sixth button is used to display the entities corresponding thereto. The order of the sixth buttons displayed by the terminal device in the fifth window can be adapted to the order of the entities corresponding to the sixth buttons in the second image; that is, the sixth buttons are displayed in sequence in the fifth window according to the order of appearance of the entities in the second image.
[0309] Alternatively, the terminal device can dynamically sort the order of the sixth buttons in the fifth window based on the user's profile, user intent, user preferences, and other information. The terminal device can determine the user's profile, user intent, and user preferences based on the user's personal information and the number of times the user uses the entity. User personal information includes user gender, user age, and other information. The number of times a user uses an entity includes, for example, the number of times the user opens a website, makes a phone call, or sends an email.
[0310] Figure 9 is a fourth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 9, the terminal device opens the camera application and displays the first interface; the first interface includes a first window 501, and the first window 501 displays a preview stream collected by the terminal device; the first interface may also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605; the first button 601 is a shooting button.
[0311] As shown in Figure 9(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Second button 606 is a "document scanning animation button." Second button 606 has an expanded state and a collapsed state. In Figure 9(b), second button 606 is in the expanded state.
[0312] The user triggers the second button 606 on the first interface in Figure 9 (b), and the terminal device displays the second interface, as shown in Figure 9 (c). The second interface includes a second window 502 and a third window 503. The second window 502 displays a preview stream captured by the terminal device. The terminal device detects in real time whether the current frame of the preview stream displayed in the second window 502 contains the target text. When the terminal device determines that the current frame of the preview stream displayed in the second window 502 contains the target text, the terminal device displays a third button 607 on the second interface. The third button is the "text extraction animation button." The third button 607 can be in either an expanded or collapsed state. In Figure 9 (c), the third button 607 is in the expanded state. The third window 503 displays the first button 601, the preview button 604, and the fourth button 608. The fourth button 608 displays "Document Scan ×." The first interface may also include at least one shooting-related setting button 602. The image displayed in Figure 9 (c) is the second image.
[0313] The user triggers the third button 607 on the second interface in (c) of Figure 9 , and as shown in (d) of Figure 9 , the terminal device displays the third interface. The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, and the third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. In (d) of Figure 9 , the third button 607 is in a collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted. Optionally, the background color of the text block of the target text in the second image displayed in the fourth window 504 is set to gray. The terminal device detects that the target text in the second image displayed in the fourth window 504 includes an entity, and the terminal device displays a fifth button 609 and a sixth button 610 corresponding to the entity in the fifth window 505. The fifth button 609 displays "Copy All"; when the user triggers the fifth button 609, the terminal device copies the target text (i.e., all the target text) in the second image in the fourth window 504. The terminal device also displays a seventh button 611 on the third interface, which displays "Press and hold to select text", prompting the user to press and hold the target text in the fourth window 504 to select the target text.
[0314] The sixth button displays the complete information of the entity corresponding to the sixth button. As shown in (d) of Figure 9, the phone entity 86 158******** displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays 86 158********. The website entity www.****@**.com displays a sixth button on the fifth window 505, and the sixth button 610 displays www.****@**.com. The address entity AA City BB District CC Road DD No. displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays AA City BB District CC Road DD No. displays. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays www.***@**.com.
[0315] Figure 10 is a fifth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 10 , the terminal device opens the camera application and displays the first interface; (a) in Figure 10 , see (a) in Figure 9 .
[0316] As shown in FIG10(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG10(b) is similar to FIG9(b).
[0317] The user triggers the second button 606 on the first interface in (b) of Figure 10 , and as shown in (c) of Figure 10 , the terminal device displays the second interface. (c) of Figure 10 , see (c) of Figure 9 .
[0318] The user triggers the third button 607 on the second interface in (c) of Figure 10, and as shown in (d) of Figure 10, the terminal device displays the third interface. The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, and the third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. In (d) of Figure 10, the third button 607 is in a collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted. Optionally, the background color of the text block of the target text in the second image displayed in the fourth window 504 is set to gray. The terminal device detects that the target text in the second image displayed in the fourth window 504 includes an entity, and the terminal device displays a fifth button 609 and a sixth button 610 corresponding to the entity in the fifth window 505. The fifth button 609 displays "Copy All"; when the user triggers the fifth button 609, the terminal device copies the target text (i.e., all the target text) in the second image in the fourth window 504. The terminal device also displays a seventh button 611 on the third interface, which displays "Press and hold to select text", prompting the user to press and hold the target text in the fourth window 504 to select the target text.
[0319] Among them, the sixth button displays key information of the entity corresponding to the sixth button. As shown in (d) of Figure 10, the telephone entity 86 158******** displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays 158********. The website entity www.****@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays ****@**.com. The address entity AA City BB District CC Road DD No. displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays BB District CC Road DD No. displays. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays ***@**.com.
[0320] Figure 11 is a sixth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 11 , the terminal device opens the camera application and displays the first interface; (a) in Figure 11 , see (a) in Figure 9 .
[0321] As shown in FIG11(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG11(b) is similar to FIG9(b).
[0322] The user triggers the second button 606 on the first interface in (b) of Figure 11 , and as shown in (c) of Figure 11 , the terminal device displays the second interface. (c) of Figure 11 , see (c) of Figure 9 .
[0323] The user triggers third button 607 on the second interface in Figure 11 (c), and the terminal device displays the third interface, as shown in Figure 11 (d). The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, which is the "Text Extraction Animation Button." Third button 607 can be in either an expanded or collapsed state; in Figure 11 (d), third button 607 is collapsed. Each text block 701 of the target text in the second image displayed in fourth window 504 is highlighted. The terminal device detects that the target text in the second image displayed in fourth window 504 includes an entity. In fifth window 505, the terminal device displays a fifth button 609 and a sixth button 610 corresponding to each entity. Fifth button 609 displays "Copy All." When the user triggers fifth button 609, the terminal device copies the target text (i.e., all target text) in the second image in fourth window 504. The terminal device also displays a seventh button 611 on the third interface, and the seventh button 611 displays "Long press to select text", which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0324] If the number of entities in the second image is greater than the preset number M, the terminal device displays M-1 sixth buttons 610 in the fifth window 505 and displays a tenth button 612 in the fifth window 505, with "...More" displayed on the tenth button 612. For example, as shown in (d) of FIG11 , the telephone entity 86 158******** displays a sixth button 610 in the fifth window 505, with 86 158******** displayed on the sixth button 610. The website entity www.****@**.com displays a sixth button 610 in the fifth window 505, with ****@**.com displayed on the sixth button 610. The address entity AA City BB District CC Road DD No. displays a sixth button 610 in the fifth window 505, with BB District CC Road DD No. displayed on the sixth button 610. The email entity www.***@**.com displays a sixth button 610 in the fifth window 505, with ***@**.com displayed on the sixth button 610. A tenth button 612 is displayed on the fifth window.
[0325] The user triggers the tenth button 612 on the fifth window 505 of the third interface in (d) of Figure 11 . As shown in (e) of Figure 11 , the terminal device displays the remaining sixth buttons 610 that were not displayed on the fifth window 505 of the third interface. For example, the sixth button 610 corresponding to the "Express Number" entity has "111******" displayed on it, and the sixth button 610 corresponding to the "Flight Number" entity has "H12*" displayed on it.
[0326] Figure 12 is a seventh interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 12 , the terminal device opens the camera application and displays the first interface; (a) in Figure 12 , see (a) in Figure 9 .
[0327] As shown in FIG12(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG12(b) is similar to FIG9(b).
[0328] The user triggers the second button 606 on the first interface in (b) of Figure 12 , and the terminal device displays the second interface as shown in (c) of Figure 12 . (c) of Figure 12 , see (c) of Figure 9 .
[0329] The user triggers the third button 607 on the second interface in (c) of Figure 12, and as shown in (d) of Figure 12, the terminal device displays the third interface. The third interface includes the fourth window 504 and the fifth window 505. A third button 607 is displayed on the third interface, and the third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. In (d) of Figure 12, the third button 607 is in a collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted. The terminal device detects that the target text in the second image displayed in the fourth window 504 does not include any entity, and the terminal device displays the fifth button 609 in the fifth window 505. The fifth button 609 displays "Copy All"; when the user triggers the fifth button 609, the terminal device will copy the target text in the second image in the fourth window 504 (that is, all the target text). The terminal device also displays a seventh button 611 on the third interface, and the seventh button 611 displays "Long press to select text", which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0330] S305: In response to the third button in the third interface being triggered, the terminal device displays the second interface.
[0331] For example, after step S304, if the user triggers the third button "Text Extraction Animation Effect Button" on the third interface, the terminal device exits the third interface and displays the second interface. The second interface includes a second window and a third window. The second window displays a preview stream captured in real time by the terminal device. In addition, the terminal device highlights the outer frame of the document detected in the current frame image in the preview stream; for example, the outer frame of the document detected in the current frame image is highlighted in yellow.
[0332] If the terminal device determines that the current frame image of the preview stream in the second window includes the target text, the terminal device displays a third button on the second interface. The third button is a "text extraction animation button" and is used to be triggered to extract text from the image. The third button is displayed with "Text Extraction" to facilitate the user to determine the function of the third button.
[0333] The third button is an animated button; the third button can have an expanded state and a collapsed state. Furthermore, when the third button is initially displayed, the terminal device can display the third button in the lower right corner of the second window. The user can drag the third button; and the terminal device then moves the third button on the second interface in response to the user's dragging operation.
[0334] If the terminal device determines that the current frame image of the preview stream in the second window does not include the target text, the terminal device does not display the third button on the second interface.
[0335] Thus, in response to the third button "text extraction animation button" in the third interface being triggered, the terminal device returns to the display of the second interface of step S303.
[0336] It should be noted that, since the second window of the second interface displays the preview stream captured in real time by the terminal device, in step S305, when the terminal device displays the second interface, the current frame image in the preview stream captured in real time and the current frame image displayed in step S303 are not the same frame image, and the image contents of the two are the same or different.
[0337] Figure 13 is an interface diagram eight provided in an embodiment of the present application. As shown in (a) in Figure 13 , the terminal device opens the camera application and displays the first interface; (a) in Figure 13 , see (a) in Figure 9 .
[0338] As shown in FIG13(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG13(b) is similar to FIG9(b).
[0339] The user triggers the second button 606 on the first interface in (b) of Figure 13 , and as shown in (c) of Figure 13 , the terminal device displays the second interface. (c) of Figure 13 , see (c) of Figure 9 .
[0340] The user triggers the third button 607 on the second interface in (c) of Figure 13 , and as shown in (d) of Figure 13 , the terminal device displays the third interface. (d) of Figure 13 , see (d) of Figure 9 , or (d) of Figure 10 , or (d) of Figure 11 , or (d) of Figure 12 .
[0341] The user triggers the third button 607 on the third interface in FIG13(d), and as shown in FIG13(e), the terminal device displays the second interface. FIG13(d) is similar to FIG9(c). At this point, the terminal device displays the preview stream captured in real time by the terminal device in the second window 504 of the second interface.
[0342] S306. In response to the first button in the second interface being triggered, the terminal device displays the fourth interface; wherein the fourth interface displays the third image in the preview stream, and the document frame in the third image in the fourth interface is highlighted; the fourth interface includes the seventh button, the eighth button and the ninth button.
[0343] Exemplarily, since step S303 provides two methods, method 1 of step S303 is: the terminal device detects in real time whether the current frame image of the preview stream displayed in the second window of the second interface includes the target text; if the terminal device detects that the current frame image of the preview stream displayed in the second window of the second interface includes the target text, the terminal device displays a third button on the second interface. The third button is a "text extraction animation button"; if the terminal device detects that the current frame image of the preview stream displayed in the second window of the second interface does not include the target text, the terminal device does not display the third button on the second interface. The second interface also includes a first button (shooting button). The second interface also includes a fourth button ("document scan ×" button); or, if it is determined in real time that the current frame image of the preview stream is a document object, the fourth button ("document scan ×" button) is displayed on the second interface.
[0344] Method 2 of step S303 is: the terminal device detects in real time whether the current frame image of the preview stream displayed in the second window of the second interface includes the target text. Regardless of whether the target text is detected, the terminal device displays the third button on the second interface. The third button is the "text extraction animation button". The second interface also includes the first button (shooting button). The second interface also includes a fourth button ("Document Scan ×" button); or, if it is determined in real time that the current frame image of the preview stream is a document object, the fourth button ("Document Scan ×" button) is displayed on the second interface.
[0345] Then, in step S306, for "method 1 of step S303", the first button (shooting button) is always on the second interface. For "method 2 of step S303", the first button (shooting button) is also always on the second interface.
[0346] Therefore, no matter which of the above methods is used, the user can see the first button (shooting button) displayed on the second interface.
[0347] If the user triggers the first button (shoot button) on the second interface, the terminal device displays the fourth interface. The fourth interface displays a third image from the preview stream captured in real time by the terminal device. The third image is the image captured when the user triggers the first button on the second interface. Therefore, the fourth interface is used to display a single frame of an image. Furthermore, the terminal device highlights the outer frame of the document detected in the third image; for example, the outer frame of the document detected in the third image is highlighted in yellow.
[0348] Furthermore, the terminal device displays a seventh button, an eighth button, and a ninth button on the fourth interface. The seventh button is used to return to the second interface and has "Preview" displayed on it. The eighth button is used to retake the image and has "Retake" displayed on it, i.e., the eighth button is a retake button. The ninth button is used to confirm image processing of the third image and has "Confirm and Continue" displayed on it, i.e., the ninth button is a confirm and continue button.
[0349] In response to the seventh button on the fourth interface being triggered, the terminal device displays the second interface.
[0350] In response to the eighth button on the fourth interface being triggered, the terminal device reacquires a frame of image in the preview stream, wherein the image is the current frame of image in the preview stream when the eighth button is triggered.
[0351] S307. In response to the ninth button in the fourth interface being triggered, the terminal device displays a fifth interface; wherein the fifth interface displays the third image in the preview stream; and the fifth interface includes at least one image processing button.
[0352] For example, after step S306, if the user triggers the ninth button "Confirm and Continue Button" on the fourth interface, the terminal device displays the fifth interface. The fifth interface displays the third image. Optionally, the terminal device magnifies and displays the third image on the fifth interface.
[0353] The fifth interface includes at least one image processing button, an eleventh button, a delete button, and an export button.
[0354] Among them, at least one image processing button includes one or more of the following: a retake button, a copy button, a document correction button, an image processing button, and a text extraction button. If the user triggers the retake button, the terminal device reacquires the latest frame of the image in the preview stream. If the user triggers the copy button, the terminal device copies the image displayed on the fifth interface. If the user triggers the document correction button, the terminal device performs document correction processing on the image displayed on the fifth interface. If the user triggers the image processing button, the terminal device performs enhancement, shadow removal, and other processing on the image displayed on the fifth interface. If the user triggers the text extraction button, the terminal device extracts the target text from the image displayed on the fifth interface.
[0355] The eleventh button is a button for returning to the fourth interface, and the eleventh button is displayed with "Preview". If the user triggers the eleventh button, the terminal device returns to the fourth interface.
[0356] The delete button is a button for deleting the image displayed on the fifth interface. If the user triggers the delete button, the terminal device deletes the image displayed on the fifth interface, that is, does not save the image displayed on the fifth interface.
[0357] The export button is a button for exporting the image displayed on the fifth interface. If the user triggers the export button, the terminal device exports the image displayed on the fifth interface, that is, saves the image displayed on the fifth interface.
[0358] Figure 14 is a ninth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 14 , the terminal device opens the camera application and displays the first interface; (a) in Figure 14 , see (a) in Figure 9 .
[0359] As shown in FIG14(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG14(b) is similar to FIG9(b).
[0360] The user triggers the second button 606 on the first interface in (b) of Figure 14 , and as shown in (c) of Figure 14 , the terminal device displays the second interface. (c) of Figure 14 , see (c) of Figure 9 .
[0361] The user triggers the third button 607 on the second interface in FIG14(c), and as shown in FIG14(d), the terminal device displays the third interface. FIG14(d) refers to FIG9(d), or FIG10(d), or FIG11(d), or FIG12(d).
[0362] The user triggers third button 607 on the third interface in FIG14(d), and as shown in FIG14(e), the terminal device displays the second interface. FIG14(d) is similar to FIG9(c). At this point, the terminal device displays the preview stream captured in real time by the terminal device in the second window 504 of the second interface.
[0363] The user triggers the first button 601 on the second interface in Figure 14 (c). As shown in Figure 14 (f), the terminal device displays the fourth interface, which displays a third image 801. The third image 801 is a frame of image captured in real time when the first button 601 on the second interface is triggered. The fourth interface includes a seventh button 613, an eighth button 614, and a ninth button 615. The seventh button 613 displays "Preview", the eighth button 614 displays "Retake", and the ninth button 615 displays "Confirm and Continue".
[0364] The user triggers the ninth button 615 on the fourth interface in FIG14(f), and as shown in FIG14(g), the terminal device displays the fifth interface, which displays the third image 801. Optionally, the third image 801 displayed in the fifth interface is an enlarged image. The fifth interface includes at least one image processing button 616. The fifth interface also includes an eleventh button 617, a delete button 618, and an export button 619.
[0365] Figure 15 is a tenth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 15 , the terminal device opens the camera application and displays the first interface; (a) in Figure 15 , see (a) in Figure 9 .
[0366] As shown in FIG15(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG15(b) is similar to FIG9(b).
[0367] The user triggers the second button 606 on the first interface in FIG15(b), and as shown in FIG15(c), the terminal device displays the second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream captured by the terminal device. The terminal device detects in real time whether the current frame image of the preview stream displayed in the second window 502 contains the target text. If the terminal device determines that the current frame image of the preview stream displayed in the second window 502 does not contain the target text, the terminal device does not display the third button on the second interface. The third window 503 of the second interface displays the first button 601, the preview button 604, and the fourth button 608, with "Document Scan x" displayed on the fourth button 608. The first interface may also include at least one shooting-related setting button 602.
[0368] The user triggers the first button 601 on the second interface in (c) of Figure 15 . As shown in (d) of Figure 15 , the terminal device displays the fourth interface, which displays a third image 801. The third image 801 is a frame of image captured in real time when the first button 601 on the second interface is triggered. The fourth interface includes a seventh button 613, an eighth button 614, and a ninth button 615. The seventh button 613 displays "Preview," the eighth button 614 displays "Retake," and the ninth button 615 displays "Confirm and Continue."
[0369] The user triggers the ninth button 615 on the fourth interface in FIG. 15( d ). As shown in FIG. 15( e ), the terminal device displays the fifth interface, which displays the third image 801. Optionally, the third image 801 displayed in the fifth interface is an enlarged image. The fifth interface includes at least one image processing button 616. The fifth interface also includes an eleventh button 617, a delete button 618, and an export button 619.
[0370] S308. In response to the fourth button in the second interface being triggered, the terminal device displays the first interface.
[0371] For example, when the user triggers the fourth button (“Document Scan×” button) in the second interface, the terminal device exits the second interface and displays the first interface.
[0372] In the process of exiting the second interface and displaying the first interface, the terminal device detects the object category of the current frame image in the preview stream on the first interface in real time. Please refer to the introduction of step S301. Furthermore, if the terminal device determines that the object category of the current frame image in the preview stream on the first interface is a document object, the second button (document scanning animation button) is displayed on the first interface; if the terminal device determines that the object category of the current frame image in the preview stream on the first interface is a text object, the third button (text extraction animation button) is displayed on the first interface.
[0373] Figure 16 is an interface schematic diagram eleven provided in an embodiment of the present application. As shown in (a) in Figure 16 , the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 16 , see (a) in Figure 9 .
[0374] As shown in FIG16(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG16(b) is similar to FIG9(b).
[0375] The user triggers the second button 606 on the first interface in (b) of Figure 16 , and as shown in (c) of Figure 16 , the terminal device displays the second interface. (c) of Figure 16 , see (c) of Figure 9 .
[0376] The user clicks the fourth button 608 ("Document Scan ×" button) on the second interface in FIG16(c), and the terminal device displays the first interface, as shown in FIG16(d). The terminal device detects the object category of the current frame image in the preview stream on the first interface in real time. As shown in FIG16(d), if the terminal device determines that the object category of the current frame image in the preview stream on the first interface is a document object, the second button 606 (document scan animation button) is displayed on the first interface.
[0377] Figure 17 is a twelfth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 17 , the terminal device opens the camera application and displays the first interface; (a) in Figure 17 , see (a) in Figure 9 .
[0378] As shown in FIG17(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG17(b) is similar to FIG9(b).
[0379] The user triggers the second button 606 on the first interface in (b) of Figure 17 , and as shown in (c) of Figure 17 , the terminal device displays the second interface. (c) of Figure 17 , see (c) of Figure 9 .
[0380] The user clicks the fourth button 608 ("Document Scan ×" button) on the second interface in FIG17(c), and the terminal device displays the first interface, as shown in FIG17(d). The terminal device detects the object category of the current frame image in the preview stream on the first interface in real time. As shown in FIG17(d), if the terminal device determines that the object category of the current frame image in the preview stream on the first interface is a text object, the third button 607 (text extraction animation button) is displayed on the first interface.
[0381] Figure 18 is a thirteenth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 18 , the terminal device opens the camera application and displays the first interface; (a) in Figure 18 , see (a) in Figure 9 .
[0382] As shown in FIG18(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG18(b) is similar to FIG9(b).
[0383] The user triggers the second button 606 on the first interface in FIG18(b), and as shown in FIG18(c), the terminal device displays the second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream captured by the terminal device. The terminal device detects in real time whether the current frame image of the preview stream displayed in the second window 502 contains the target text. If the terminal device determines that the current frame image of the preview stream displayed in the second window 502 does not contain the target text, the terminal device does not display the third button on the second interface. The third window 503 of the second interface displays the first button 601, the preview button 604, and the fourth button 608, with "Document Scan x" displayed on the fourth button 608. The first interface may also include at least one shooting-related setting button 602.
[0384] The user clicks the fourth button 608 ("Document Scan ×" button) on the second interface in FIG18(c), and the terminal device displays the first interface, as shown in FIG18(d). The terminal device detects in real time that the object category of the current frame image in the preview stream on the first interface is a document object. As shown in FIG18(d), if the terminal device determines that the object category of the current frame image in the preview stream on the first interface is a document object, the second button 606 (document scan animation button) is displayed on the first interface.
[0385] In one example, the method also includes: the terminal device displays a sixth interface in response to the third button in the second interface being triggered; wherein the sixth interface includes a sixth window and a third window; the sixth window displays a preview stream, and the first prompt information is displayed on the sixth window; the third button is not displayed on the sixth interface; the third window displays the first button and the fourth button.
[0386] Exemplarily, in the above-mentioned step S304, the terminal device displays the third interface in response to the third button in the second interface being triggered; in step S304, the terminal device recognizes that the second image in the preview stream is a normally captured image, and the second image contains the target text, then the process of step S304 will be executed.
[0387] However, if the terminal device shakes when the user triggers the third button in the second interface, the terminal device fails to capture the normal image in time, and thus the terminal device can display the sixth interface. The difference between the sixth interface and the second interface is that the sixth interface displays a first prompt message, which is used to prompt the user that the text was not recognized. The first prompt message is "Text not recognized". It can be seen that the sixth interface includes the sixth window and the third window; the sixth window displays a preview stream, and the first prompt message is displayed on the sixth window; the third button is not displayed on the sixth interface; the third window displays the first button and the fourth button.
[0388] Figure 19 is a fourteenth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 19 , the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 19 , see (a) in Figure 9 .
[0389] As shown in FIG19(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. FIG19(b) is similar to FIG9(b).
[0390] The user triggers the second button 606 on the first interface in (b) of Figure 19 , and as shown in (c) of Figure 19 , the terminal device displays the second interface. (c) of Figure 19 , see (c) of Figure 9 .
[0391] If the user triggers third button 607 on the second interface in FIG19(c), but the terminal device is shaken, the terminal device displays the sixth interface. As shown in FIG19(d), the sixth interface includes sixth window 506 and third window 503; sixth window 506 displays a preview stream and a first prompt message "No text recognized"; the third button is not displayed on the sixth interface; and third window 503 displays first button 601 and fourth button 604.
[0392] S309: When the object category of the first image is a text object, the terminal device displays a third button on the first interface.
[0393] For example, when a terminal device launches a camera application, the terminal device displays a first interface in real time. The first interface includes a first window that displays each current frame image in a preview stream captured in real time by the terminal device. The first interface includes a first button, at least one shooting-related setting button, at least one shooting mode button, a preview button, and a switch button.
[0394] Among them, the at least one shooting-related setting button on the first interface includes: a scan button, an AI shooting button, a flash button, an image mode button, a camera setting button, and the like.
[0395] At least one shooting mode button, including: "Aperture" shooting mode button, "Night Scene" shooting mode button, "Portrait" shooting mode button, "Photo" shooting mode button, "Video" shooting mode button, "Movie" shooting mode button, "Professional" shooting mode button, etc.
[0396] The preview button is a button for being triggered to preview an image in a camera application.
[0397] The switch button is a button used to be triggered to switch between the front camera and the rear camera.
[0398] The first interface also includes at least one magnification button, which is used to adjust the display size of the image in the preview stream. For example, the magnification buttons include: a "0.5" button, a "1" button, a "5" button, and a "10" button.
[0399] After step S301, when the terminal device determines that the first image in the captured preview stream is a text object, it displays a third button on the first interface. The third button is a "text extraction animation button" that is triggered to extract text from the image. The third button is displayed with "Text Extraction" to facilitate the user's determination of its function.
[0400] The third button is an animated button; the third button can have an expanded state and a collapsed state. Furthermore, when the third button is initially displayed, the terminal device can display the third button in the lower right corner of the first window. The user can drag the third button; and the terminal device then moves the third button on the first interface in response to the user's dragging operation.
[0401] Figure 20 is a schematic diagram of the fifteenth interface provided by an embodiment of the present application. As shown in (a) of Figure 20, the terminal device opens the camera application and displays the first interface of the terminal device; the first interface includes a first window 501, and the first window 501 displays the preview stream collected by the terminal device; the first interface may also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605. As shown in (b) of Figure 20, when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. The third button 607 has an expanded state and a collapsed state. In (b) of Figure 20, the third button 607 is in the expanded state.
[0402] FIG21 is a sixteenth schematic diagram of an interface provided in an embodiment of the present application, as shown in FIG21(a), which is FIG20(b) above. The third button 607 is an animated button. In FIG21(a), the third button 607 is in an expanded state. As shown in FIG21(b), if the third button 607 is not triggered within a preset time, the third button 607 is in a collapsed state.
[0403] S310. The terminal device displays a third interface in response to the third button in the first interface being triggered; wherein the third interface includes a fourth window and a fifth window; a third button is displayed on the third interface; the fourth window displays a second image in the preview stream, and the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays a fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window.
[0404] In one example, the third interface also includes a seventh button.
[0405] In one example, the second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area.
[0406] The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0407] In one example, when the number of entities in the second image is greater than a preset number, the number in the sixth button is the preset number minus 1, and the fifth window further displays a tenth button.
[0408] In one example, the arrangement order of the sixth button in the fifth window corresponds to the arrangement order of the entities in the second image; or, the arrangement order of the sixth button in the fifth window is determined in real time based on the user portrait or user intention.
[0409] For example, after step S309, the terminal device triggers a third button (a text extraction animation button) on the third interface, and the terminal device displays the third interface. The third interface includes a fourth window and a fifth window. A third button is displayed on the third interface; the third button is in a collapsed state or an expanded state.
[0410] Because the user triggers the third button on the first interface, the terminal device can capture the current frame image in the preview stream at the moment the third button is triggered in real time, thereby obtaining a second image. As a result, the terminal device displays the second image in the preview stream in the fourth window. At this time, the terminal device displays a single frame of the second image in the fourth window of the third interface. The second image and the aforementioned first image are images at different moments in the preview stream.
[0411] Furthermore, the terminal device detects the target text in the second image in real time. The “target text” is described above. If the terminal device detects that the second image contains the target text, the target text in the second image is highlighted in the fourth window of the third interface.
[0412] It can be seen that the fourth window is the "text display area".
[0413] In one example, a terminal device displays a second image of the preview stream in real time in a first window of a first interface. The terminal device does not process the second image in the first window on the first interface. The second image in the preview stream includes a first area and a second area. The first area is the area formed by the text blocks of the target text, and the second area is the area surrounding the first area. The first area is the minimum bounding rectangle formed by the text blocks in the second image, and the second area is the area of the second image excluding the minimum bounding rectangle.
[0414] In response to the third button in the first interface being triggered, the terminal device determines the minimum circumscribed matrix formed by each text block in the second image; the terminal device crops the second image according to the size of the minimum circumscribed matrix, and crops off the peripheral area of the second image located before the minimum circumscribed matrix. The terminal device can retain part of the area around the periphery of the minimum circumscribed matrix; and the terminal device crops off the peripheral area of the first area, that is, crops to the second area. A second image for display on the third interface is obtained. Among them, in the second image for display on the third interface, there is a certain distance between the frame formed by each text block and the edge of the image; the distance can be set to a fixed number of pixels, which is an empirical value; or, the distance is a percentage of the length of the text block corresponding to the distance.
[0415] Thus, the second image displayed by the terminal device in the third interface includes the above-mentioned first area, but does not include the second area. In addition, the terminal device highlights each text block of the target text in the first area. In addition, the terminal device sets the background color of the text block of the target text in the first area to a preset color (for example, gray or black); thus, the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0416] Optionally, since the second image displayed on the third interface of the terminal device is a cropped image, when the terminal device displays the second image in the fourth window of the third interface, the cropped second image can be extended to fill the fourth window. For example, based on the width of the cropped second image, the cropped second image is extended to fill the fourth window so that the cropped second image reaches the edge of the fourth window in the width direction. For another example, based on the height of the cropped second image, the cropped second image is extended to fill the fourth window so that the cropped second image reaches the edge of the fourth window in the height direction.
[0417] Furthermore, during the real-time detection of the target text in the second image by the terminal device, the terminal device identifies entities in the target text. It can be seen that the target text includes entities and / or non-entities. Entities include the following: email address, ID number, courier number, flight number, website, phone number, address, etc.
[0418] When the terminal device detects that the target text in the second image in the fourth window does not include any entities, the terminal device displays a fifth button in the fifth window. The fifth button is a button that is triggered to copy the target text in the second image in the fourth window; the fifth button is displayed with "Copy All". In addition, the terminal device displays a seventh button on the third interface. The seventh button is a button that displays the prompt message "Press and hold to select text" and the seventh button is displayed with "Press and hold to select text". The seventh button is located at the top of the third interface, the fourth window is located in the middle of the third interface, and the fifth window is located at the bottom of the third interface.
[0419] When the terminal device detects that the target text in the second image in the fourth window includes an entity, the terminal device displays a fifth button in the fifth window, and a sixth button that corresponds one-to-one to the entity in the target text in the second image. The fifth button is a button for being triggered to copy the target text in the second image in the fourth window; "Copy All" is displayed on the fifth button. The sixth button is a button for being triggered to call the function of the entity corresponding to the sixth button, and information about the entity corresponding to the sixth button is displayed on the sixth button. In addition, the terminal device displays a seventh button on the third interface. The seventh button is a button for displaying the prompt message "Long press to select text", and "Long press to select text" is displayed on the seventh button. The seventh button is located at the top of the third interface, the fourth window is located in the middle of the third interface, and the fifth window is located at the bottom of the third interface.
[0420] It can be seen that if there is an entity in the second image, the fifth window is the "entity information display area"; if there is no entity in the second image, the fifth window displays a "Copy All" capsule.
[0421] In one example, when there is an entity in the second image, when the terminal device displays the sixth button corresponding to the entity in the fifth window, since there are a large number of entities, the terminal device can display a preset number of sixth buttons in the fifth window.
[0422] If the number of entities in the second image is less than or equal to a preset number M, the terminal device may display M sixth buttons in the fifth window. M is a positive integer greater than or equal to 1. For example, M=5.
[0423] If the number of entities in the second image exceeds a preset number, the terminal device may display M-1 sixth buttons in the fifth window. Simultaneously, the terminal device displays a tenth button in the fifth window. The tenth button is a button that is triggered to display the remaining sixth buttons not displayed in the fifth window (i.e., the remaining sixth buttons not displayed in the fifth window); the tenth button is displayed with "...More." The terminal device displays the tenth button at the end of the M-1 sixth buttons.
[0424] For example, the terminal device displays a fixed number of rows of sixth buttons in the fifth window, for example, the terminal device displays three rows of sixth buttons in the fifth window; the number of sixth buttons in each row is determined according to the length of the sixth button, for example, the first row displays two sixth buttons, the second row displays two sixth buttons, and the third row displays one sixth button.
[0425] Among them, for each sixth button, since it is necessary to display the information of the entity corresponding to the sixth button on the sixth button, the complete information of the entity can be displayed on the sixth button. For example, the telephone entity 86 158******** displays a sixth button on the fifth window, and the sixth button displays 86 158********. The website entity www.****@**.com displays a sixth button on the fifth window, and the sixth button displays www.****@**.com. The address entity AA City BB District CC Road DD No. displays a sixth button on the fifth window, and the sixth button displays AA City BB District CC Road DD No. displays. The email entity www.***@**.com displays a sixth button on the fifth window, and the sixth button displays www.***@**.com.
[0426] Alternatively, for each sixth button, since it is necessary to display information about the entity corresponding to the sixth button on the sixth button, for aesthetic reasons or to effectively utilize the position of the interface, key information about the entity can be displayed on the sixth button. The terminal device can determine the key information of the entity based on a preset display method; or the terminal device can determine the key information of the entity based on user intent or user profile. For example, the telephone entity 86 158******** displays a sixth button on the fifth window, and 158******** is displayed on the sixth button. The website entity www.****@**.com displays a sixth button on the fifth window, and ****@**.com is displayed on the sixth button. The address entity AA City BB District CC Road DD No. displays a sixth button on the fifth window, and BB District CC Road DD No. displays on the sixth button. The email entity www.***@**.com displays a sixth button on the fifth window, and ***@**.com is displayed on the sixth button.
[0427] In one example, the sixth buttons displayed by the terminal device in the fifth window have an order (i.e., an order of appearance). Since there is a one-to-one correspondence between the entities in the second image and the sixth buttons, the sixth button is used to display the entities corresponding thereto. The order of the sixth buttons displayed by the terminal device in the fifth window can be adapted to the order of the entities corresponding to the sixth buttons in the second image; that is, the sixth buttons are displayed in sequence in the fifth window according to the order of appearance of the entities in the second image.
[0428] Alternatively, the terminal device can dynamically sort the order of the sixth buttons in the fifth window based on the user's profile, user intent, user preferences, and other information. The terminal device can determine the user's profile, user intent, and user preferences based on the user's personal information and the number of times the user uses the entity. User personal information includes user gender, user age, and other information. The number of times a user uses an entity includes, for example, the number of times the user opens a website, makes a phone call, or sends an email.
[0429] Figure 22 is the seventeenth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 22, the terminal device opens the camera application and the terminal device displays the first interface; the first interface includes a first window 501, and the first window 501 displays a preview stream collected by the terminal device; the first interface can also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605; the first button 601 is a shooting button.
[0430] As shown in Figure 22(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. Third button 607 is the "Text Extraction Animation Effect Button." Third button 607 has an expanded state and a collapsed state. In Figure 22(b), third button 607 is in the expanded state.
[0431] The user triggers the third button 607 on the first interface in (b) of Figure 22, and as shown in (c) of Figure 22, the terminal device displays the third interface. The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, and the third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. In (c) of Figure 22, the third button 607 is in a collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted. Optionally, the background color of the text block of the target text in the second image displayed in the fourth window 504 is set to gray. The terminal device detects that the target text in the second image displayed in the fourth window 504 includes an entity, and the terminal device displays a fifth button 609 and a sixth button 610 corresponding to the entity in the fifth window 505. The fifth button 609 displays "Copy All"; when the user triggers the fifth button 609, the terminal device copies the target text (i.e., all the target text) in the second image in the fourth window 504. The terminal device also displays a seventh button 611 on the third interface, which displays "Press and hold to select text", prompting the user to press and hold the target text in the fourth window 504 to select the target text.
[0432] The sixth button displays the complete information of the entity corresponding to the sixth button. As shown in (c) of Figure 22, the phone entity 86 158******** displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays 86 158********. The website entity www.****@**.com displays a sixth button on the fifth window 505, and the sixth button 610 displays www.****@**.com. The address entity AA City BB District CC Road DD No. displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays AA City BB District CC Road DD No. displays. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays www.***@**.com.
[0433] Figure 23 is an eighteenth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 23 , the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 23 , see (a) in Figure 22 .
[0434] As shown in FIG23(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. FIG23(b) is similar to FIG22(b).
[0435] The user triggers the third button 607 on the first interface in (b) of Figure 23, and as shown in (c) of Figure 23, the terminal device displays the third interface. The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, and the third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. In (d) of Figure 10, the third button 607 is in a collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted. Optionally, the background color of the text block of the target text in the second image displayed in the fourth window 504 is set to gray. The terminal device detects that the target text in the second image displayed in the fourth window 504 includes an entity. The terminal device displays a fifth button 609 and a sixth button 610 corresponding to the entity in the fifth window 505. The fifth button 609 displays "Copy All"; when the user triggers the fifth button 609, the terminal device copies the target text (i.e., all the target text) in the second image in the fourth window 504. The terminal device also displays a seventh button 611 on the third interface, which displays "Press and hold to select text", prompting the user to press and hold the target text in the fourth window 504 to select the target text.
[0436] Among them, the sixth button displays key information of the entity corresponding to the sixth button. As shown in (c) of Figure 23, the telephone entity 86 158******** displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays 158********. The website entity www.****@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays ****@**.com. The address entity AA City BB District CC Road DD No. displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays BB District CC Road DD No. displays. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays ***@**.com.
[0437] Figure 24 is the nineteenth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 24 , the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 24 , see (a) in Figure 22 .
[0438] As shown in FIG24(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. FIG24(b) is similar to FIG22(b).
[0439] The user triggers third button 607 on the first interface in Figure 24 (b), and the terminal device displays the third interface, as shown in Figure 24 (c). The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, which is the "Text Extraction Animation Button." Third button 607 can be in either an expanded or collapsed state. In Figure 24 (c), third button 607 is collapsed. Each text block 701 of the target text in the second image displayed in fourth window 504 is highlighted. The terminal device detects that the target text in the second image displayed in fourth window 504 includes an entity. In fifth window 505, the terminal device displays a fifth button 609 and a sixth button 610 corresponding to each entity. Fifth button 609 displays "Copy All." When the user triggers fifth button 609, the terminal device copies the target text (i.e., all target text) in the second image in fourth window 504. The terminal device also displays a seventh button 611 on the third interface, and the seventh button 611 displays "Long press to select text", which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0440] If the number of entities in the second image is greater than the preset number M, the terminal device displays M-1 sixth buttons 610 in the fifth window 505 and displays a tenth button 612 in the fifth window 505, with "...More" displayed on the tenth button 612. For example, as shown in (c) of FIG24 , the telephone entity 86 158******** displays a sixth button 610 in the fifth window 505, with 86 158******** displayed on the sixth button 610. The website entity www.****@**.com displays a sixth button 610 in the fifth window 505, with ****@**.com displayed on the sixth button 610. The address entity AA City BB District CC Road DD No. displays a sixth button 610 in the fifth window 505, with BB District CC Road DD No. displayed on the sixth button 610. The email entity www.***@**.com displays a sixth button 610 in the fifth window 505, with ***@**.com displayed on the sixth button 610. A tenth button 612 is displayed on the fifth window.
[0441] The user triggers the tenth button 612 on the fifth window 505 of the third interface in (c) of FIG24 . As shown in (d) of FIG24 , the terminal device displays the remaining sixth buttons 610 that were not displayed on the fifth window 505 of the third interface. For example, the sixth button 610 corresponding to the "Express Number" entity has "111******" displayed on it, and the sixth button 610 corresponding to the "Flight Number" entity has "H12*" displayed on it.
[0442] Figure 25 is an interface schematic diagram 20 provided in an embodiment of the present application. As shown in (a) in Figure 25, the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 25, see (a) in Figure 22.
[0443] As shown in FIG25(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. FIG25(b) is similar to FIG22(b).
[0444] The user triggers the third button 607 on the first interface in (b) of Figure 25 , and as shown in (c) of Figure 25 , the terminal device displays the third interface. The third interface includes a fourth window 504 and a fifth window 505. A third button 607 is displayed on the third interface, and the third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. In (c) of Figure 25 , the third button 607 is in a collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted. The terminal device detects that the target text in the second image displayed in the fourth window 504 does not include any entity, and the terminal device displays a fifth button 609 in the fifth window 505. The fifth button 609 displays "Copy All"; when the user triggers the fifth button 609, the terminal device will copy the target text in the second image in the fourth window 504 (i.e., all target text). The terminal device also displays a seventh button 611 on the third interface, and the seventh button 611 displays "Long press to select text", which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0445] S311: In response to the third button in the third interface being triggered, the terminal device displays the first interface.
[0446] For example, after step S310, if the user triggers the third button "Text Extraction Animation Effect Button" on the third interface, the terminal device exits the third interface and displays the first interface. The first interface includes a first window that displays a preview stream captured in real time by the terminal device. The first interface includes a first button, at least one shooting-related setting button, at least one shooting mode button, a preview button, and a switch button.
[0447] Step S301 is executed again.
[0448] Therefore, in this step, the terminal device returns to the display of the first interface of step S301 in response to the third button "text extraction animation button" in the third interface being triggered.
[0449] It should be noted that, since the second window of the first interface displays the preview stream captured in real time by the terminal device, in step S311, when the terminal device displays the first interface, the current frame image in the preview stream captured in real time and the current frame image in the preview stream displayed in step S301 are not the same frame image, and the image contents of the two are the same or different.
[0450] Figure 26 is an interface schematic diagram twenty-one provided in an embodiment of the present application. As shown in (a) in Figure 26, the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 26, see (a) in Figure 22.
[0451] As shown in FIG26(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. FIG26(b) is similar to FIG22(b).
[0452] The user triggers the third button 607 on the first interface in FIG26(b), and as shown in FIG26(c), the terminal device displays the third interface. FIG26(c) refers to FIG22(c), or FIG23(c), or FIG24(c), or FIG25(c).
[0453] The user triggers the third button 507 on the third interface in Figure 26 (c), and the first interface is displayed as shown in Figure 26 (d). At this time, the terminal device displays the preview stream collected in real time by the terminal device in the first window 501 of the first interface.
[0454] In one example, the method provided in this embodiment also includes: the terminal device displays a seventh interface in response to the third button in the first interface being triggered; wherein the seventh interface includes a seventh window; the seventh window displays a preview stream, and the second prompt information is displayed on the seventh window; the third button is not displayed on the seventh interface, and the seventh interface includes the first button.
[0455] Exemplarily, in the above-mentioned step S310, the terminal device displays the third interface in response to the third button in the first interface being triggered; in step S310, the terminal device recognizes that the second image in the preview stream is a normally captured image, and the second image contains the target text, then the process of step S310 will be executed.
[0456] However, if the terminal device shakes when the user triggers the third button in the first interface, the terminal device fails to capture the normal image in time, and thus the terminal device can display the seventh interface. The difference between the seventh interface and the first interface is that the seventh interface displays a second prompt message, which is used to prompt the user that the text was not recognized. The second prompt message is "Text not recognized". It can be seen that the seventh interface includes a seventh window; the seventh window displays a preview stream, and the seventh window displays the second prompt message; the seventh interface does not display the third button.
[0457] In addition, the first interface includes a first button, at least one shooting-related setting button, at least one shooting mode button, a preview button, and a switch button.
[0458] Figure 27 is an interface schematic diagram twenty-two provided in an embodiment of the present application. As shown in (a) in Figure 27, the terminal device opens the camera application and the terminal device displays the first interface; (a) in Figure 27, see (a) in Figure 22.
[0459] As shown in FIG27(b), when the terminal device determines that the current frame image (i.e., the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. FIG27(b) is similar to FIG22(b).
[0460] The user triggers the third button 607 on the first interface in FIG27(b), and as shown in FIG27(c), the terminal device displays the seventh interface. As shown in FIG27(c), the seventh interface includes a seventh window 507, which displays a preview stream and a second prompt message "No text recognized"; the third button is not displayed on the seventh interface. The seventh interface also includes the first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605.
[0461] In one example, the sixth button corresponds to at least one function, and the function has a priority, and the priority of the function is determined in real time based on the user portrait or user intention; the method also includes: the terminal device responds to the sixth button being triggered, calling the function with the highest priority corresponding to the sixth button.
[0462] Exemplarily, the third interface displayed in step S304 includes a fourth window and a fifth window; a third button is displayed on the third interface; the fourth window displays the second image in the preview stream; when the target text in the fourth window includes an entity, the fifth window displays a fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window.
[0463] The third interface displayed in step S310 includes a fourth window and a fifth window; a third button is displayed on the third interface; the fourth window displays the second image in the preview stream, and when the target text in the fourth window includes an entity, the fifth window displays a fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window.
[0464] Therefore, the steps of this example can be performed for the fifth window of the third interface displayed in step S304, or for the fifth window of the third interface displayed in step S310.
[0465] Entities have multiple functions, and these functions have priorities. The priority of an entity's functions can be determined in real time based on user profiles or user intent. For example, user profiles and user intent can be generated based on user personal information and / or user usage of the entity.
[0466] The sixth button corresponds one-to-one with the entity in the second image in the fourth window. Thus, the sixth button has multiple functions, and the functions of the sixth button have priorities. The priorities of the functions of the sixth button can be determined in real time based on the user profile or user intent.
[0467] After step S304 or step S310, the user may touch the sixth button on the fifth window in the third interface. Then, the device in the third interface directly responds to the function with the highest priority corresponding to the sixth button.
[0468] For example, the entity is a phone entity, and the second image in the fourth window includes the phone number of the phone entity. Functions associated with the phone entity include: copy, select, dial, store, etc. The functions associated with the phone entity have a priority level, and are ranked in descending order: dial, store, copy, and select.
[0469] The user touches the sixth button corresponding to the phone entity on the fifth window of the third interface, wherein the phone number of the corresponding phone entity is displayed on the sixth button. Then, the terminal device directly calls the "dial function" and then the terminal device directly dials the phone number on the sixth button.
[0470] For example, the entity is an address entity. The second image in the fourth window includes the address information code of the address entity. Functions corresponding to the address entity include: copy, select, go to, save, etc. Functions corresponding to the address entity have a priority. They are ranked according to priority: go to, copy, save, and select.
[0471] The user touches the sixth button corresponding to the address entity in the fifth window of the third interface, wherein the sixth button displays the address information of the corresponding address entity. Then, the terminal device directly calls the "go to function", and then the terminal device directly calls the map application to display the method to go to the location represented by the address information.
[0472] In one example, an entity displayed in a fourth window of a third interface corresponds to at least one first option, and the first option has a priority, and the priority of the first option is determined in real time based on a user profile or user intent; the priority of the first option of the entity and the priority of the function of the sixth button corresponding to the entity have a one-to-one correspondence;
[0473] The method also includes: the terminal device displays a first service menu corresponding to the entity in the fourth window in response to the entity in the fourth window being triggered; wherein the first service menu includes at least one first option, and the first options in the first service menu are sorted according to the priority of the first option.
[0474] Exemplarily, the steps of this example may be performed for the fourth window of the third interface displayed in step S304 or for the fourth window of the third interface displayed in step S310.
[0475] Entities have multiple functions, and these functions have priorities. The priority of an entity's functions can be determined in real time based on user profiles or user intent. For example, user profiles and user intent can be generated based on user personal information and / or user usage of the entity.
[0476] The sixth button corresponds one-to-one with the entity in the second image in the fourth window. Thus, the sixth button has multiple functions, and the functions of the sixth button have priorities. The priorities of the functions of the sixth button can be determined in real time based on the user profile or user intent.
[0477] After step S304 or step S310, the user touches the text of the entity in the fourth window of the third interface, and the terminal device displays a first service menu corresponding to the entity. The first service menu includes at least one first option, each first option of the entity corresponds to each function of the entity, and each first option of the entity corresponds to each sixth button of the entity; that is, the first option, function, and sixth button correspond to each other.
[0478] Therefore, the first option of the first service menu has a priority, which is the priority of the function corresponding to the first option.
[0479] The order of the first options in the first service menu is based on the priority of the first option.
[0480] For example, the entity is a phone entity, and the second image in the fourth window includes the phone number of the phone entity. Functions associated with the phone entity include: copy, select, dial, save, share, and so on. The functions associated with the phone entity have a priority level, ranked by priority: dial, save, copy, select, and share.
[0481] Therefore, the order of the first options corresponding to the telephone entity is: dial function, store function, copy function, and select function.
[0482] FIG28 is a diagram 23 of an interface provided in an embodiment of the present application. As shown in FIG28 , when a user touches the text of a phone entity in the fourth window 504 of the third interface, the terminal device displays a first service menu 901 corresponding to the phone entity. The first service menu 901 corresponding to the phone entity includes multiple first options, which are, in order, a "Dial" option, a "Save" option, a "Copy" option, a "Select" option, and a "Share" option.
[0483] For example, if the entity is an address entity, the second image in the fourth window includes the address information code of the address entity. Functions corresponding to the address entity include: copy, select, go to, save, share, etc. Functions corresponding to the address entity have a priority level and are ranked in descending order: go to, copy, save, select, and share.
[0484] Therefore, the order of the first options corresponding to the address entity is: go to function, copy function, save function, select function, and share function.
[0485] FIG29 is a schematic diagram 24 of an interface provided in an embodiment of the present application. As shown in FIG29 , when a user touches the text of an address entity in the fourth window 504 of the third interface, the terminal device displays a first service menu 901 corresponding to the address entity. The first service menu 901 corresponding to the address entity includes multiple first options, which are, in order, a "Go" option, a "Copy" option, a "Save" option, a "Select" option, and a "Share" option.
[0486] In one example, the method further includes: in response to the non-entity in the fourth window being triggered, the terminal device displays a second service menu corresponding to the non-entity on the fourth window; wherein the second service menu includes at least one second option.
[0487] Exemplarily, the steps of this example may be performed for the fourth window of the third interface displayed in step S304 or for the fourth window of the third interface displayed in step S310.
[0488] If the second image in the fourth window includes non-entity text, the image displayed in the fourth window includes non-entity text.
[0489] After step S304 or step S310, the user touches the non-physical text on the fourth window in the third interface, and the terminal device displays a second service menu. Wherein, for different non-physical texts, the content in the second service menu is the same.
[0490] The second service menu includes at least one second option, such as select all, copy, translate, search, share, etc.
[0491] The order of the second options in the second service menu can be fixed. Alternatively, the order of the second options in the second service menu is based on the priority of the second options. The priority of the second options can be determined in real time based on the user profile or user intent. For example, the user profile and user intent can be generated based on user personal information and / or the user's use of the second options.
[0492] FIG30 is a schematic diagram of the interface provided in accordance with an embodiment of the present application. As shown in FIG30 , when a user touches the non-entity text in the fourth window 504 of the third interface, the terminal device displays the second service menu 902. The second service menu 902 includes multiple second options, which are, in order, "Select All," "Copy," "Translate," "Search," and "Share." As shown in FIG20 , when the second image in the fourth aspect 504 contains an entity, the fifth window 505 displays a fifth button 509 and a sixth button 610 corresponding to the entity.
[0493] FIG31 is a schematic diagram of an interface provided in an embodiment of the present application. As shown in FIG31 , when a user touches non-entity text in the fourth window 504 of the third interface, the terminal device displays the second service menu 902. The second service menu 902 includes multiple second options, which are, in order, "Select All," "Copy," "Translate," "Search," and "Share." As shown in FIG20 , when the second image in the fourth aspect 504 does not contain any entity, a fifth button 509 is displayed in the fifth window 505.
[0494] In one example, the method further includes: the terminal device copies the target text in the fourth window in response to the fifth button in the fifth window being triggered.
[0495] Exemplarily, the steps of this example may be performed for the fifth window of the third interface displayed in step S304 or for the fifth window of the third interface displayed in step S310.
[0496] The user triggers the fifth button (the copy all button) in the fifth window, and the terminal device copies all target texts in the fourth window.
[0497] In this embodiment, during step S301, while the terminal device displays the first interface, the terminal device captures the physical object through the camera to obtain a preview stream. During this process, if the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (e.g., 17 cm), the terminal device needs to enable super macro mode. While the terminal device is in super macro mode, the terminal device may display a first icon, which is an icon for super macro mode. The first icon may prompt the user that the terminal device is currently in super macro mode.
[0498] The first icon may be displayed in any of the following two ways.
[0499] In one example, before step S302, when the terminal device determines that the distance between the camera of the terminal device and the physical object is less than a preset threshold, the terminal device turns on the super macro mode, and the terminal device displays the first icon on the first interface.
[0500] Step S302 includes: when the object category of the first image is a document object, the terminal device displays the second button on the first interface and does not display the first icon.
[0501] Step S309 includes: when the object category of the first image is a text object, the terminal device displays the third button on the first interface and does not display the first icon.
[0502] Among them, the preset threshold is the first threshold.
[0503] For example, during step S301, while the terminal device displays the first interface, the terminal device captures the physical object through the camera to obtain a preview stream. During this process, if the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (for example, 17 cm), the terminal device activates super macro mode and captures the preview stream in super macro mode. The terminal device first displays a first icon on the first interface, thereby prompting the user that the terminal device is currently in super macro mode.
[0504] At the same time, the terminal device detects the object category of the first image in the preview stream of the first interface.
[0505] When the terminal device determines that the object category of the first image in the preview stream of the first interface is a document object, the terminal device does not display the first icon, but displays the second button (document scanning animation button). When the terminal device determines that the object category of the first image in the preview stream of the first interface is a text object, the terminal device does not display the first icon, but displays the third button (text extraction animation button).
[0506] Figure 32 is the twenty-seventh interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 32, the terminal device opens the camera application and the terminal device displays the first interface; the first interface includes a first window 501, and the first window 501 displays a preview stream collected by the terminal device; the first interface can also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605; the first button 601 is a shooting button.
[0507] As shown in (b) of Figure 32 , if the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (e.g., 17 cm), the terminal device activates super macro mode and captures the preview stream in super macro mode; the terminal device displays a first icon 620 on the first interface. The first icon 620 is located in the lower right corner of the first window 501 of the first interface. At the same time, the terminal device detects the object category of the first image in the preview stream of the first interface. The first icon 620 has a collapsed state and an expanded state; as shown in (b) of Figure 32 , the first icon 620 is in the expanded state.
[0508] As shown in (c) of FIG32 , when the terminal device determines that the object category of the first image in the preview stream of the first interface is a document object, the terminal device does not display the first icon 620 but displays the second button 606. The second button 606 is located in the lower right corner of the first window 501 of the first interface.
[0509] As shown in FIG32(d), after FIG32(b), if the terminal device triggers the super macro mode again, the terminal device may display a first icon 620 on the first interface. The first icon 620 is located in the lower right corner of the first window 501 of the first interface. As shown in FIG32(d), the first icon 620 is in a retracted state.
[0510] Figure 33 is the twenty-eighth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 33, the terminal device opens the camera application and the terminal device displays the first interface; the first interface includes a first window 501, and the first window 501 displays a preview stream collected by the terminal device; the first interface can also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605; the first button 601 is a shooting button.
[0511] As shown in (b) of Figure 33 , if the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (e.g., 17 cm), the terminal device activates super macro mode and captures the preview stream in super macro mode; the terminal device displays a first icon 620 on the first interface. The first icon 620 is located in the lower right corner of the first window 501 of the first interface. At the same time, the terminal device detects the object category of the first image in the preview stream of the first interface. The first icon 620 has a collapsed state and an expanded state; as shown in (b) of Figure 33 , the first icon 620 is in the expanded state.
[0512] As shown in (c) of FIG33 , when the terminal device determines that the object category of the first image in the preview stream of the first interface is a text object, the terminal device does not display the first icon 620 but displays the third button 607. The third button 607 is located in the lower right corner of the first window 501 of the first interface.
[0513] As shown in FIG33(d), after FIG33(b), if the terminal device triggers the super macro mode again, the terminal device may display a first icon 620 on the first interface. The first icon 620 is located in the lower right corner of the first window 501 of the first interface. As shown in FIG33(d), the first icon 620 is in a retracted state.
[0514] In another example, before step S302, when the terminal device determines that the distance between the camera of the terminal device and the physical object is less than a preset threshold, the terminal device turns on the super macro mode.
[0515] Step S302 includes: when the object category of the first image is a document object, at a first moment, the terminal device displays the second button on the first interface; at a second moment, the terminal device displays the first icon on the first interface and does not display the second button, and the second moment is later than the first moment; at a third moment, the terminal device displays the second button on the first interface and does not display the first icon, and the third moment is later than the second moment.
[0516] Step S309 includes: when the object category of the first image is a text object, at a first moment, the terminal device displays the third button on the first interface, and the second moment is later than the first moment; at a second moment, the terminal device displays the first icon on the first interface but does not display the third button; at a third moment, the terminal device displays the third button on the first interface but does not display the first icon, and the third moment is later than the second moment.
[0517] Among them, the preset threshold is the first threshold.
[0518] Exemplarily, during step S301, when the terminal device displays the first interface, the terminal device captures the physical object through the camera to obtain a preview stream; during this process, if the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (for example, 17 cm), the terminal device turns on the super macro mode, and the terminal device captures the preview stream through the super macro mode.
[0519] At the same time, the terminal device detects the object category of the first image in the preview stream of the first interface.
[0520] When the terminal device determines that the object category of the first image in the preview stream of the first interface is a document object, at a first moment, the terminal device first displays the second button (document scanning animation button) on the first interface; then, at a second moment later than the first moment, the terminal device displays the first icon on the first interface and does not display the second button on the first interface, thereby prompting the user that the terminal device is currently in super macro mode; then, at a third moment later than the second moment, the terminal device displays the second button on the first interface and does not display the first icon on the first interface.
[0521] When the terminal device determines that the object category of the first image in the preview stream of the first interface is a text object, at a first moment, the terminal device first displays the third button (text extraction animation button) on the first interface; then, at a second moment later than the first moment, the terminal device displays the first icon on the first interface and does not display the third button on the first interface, thereby prompting the user that the terminal device is currently in super macro mode; then, at a third moment later than the second moment, the terminal device displays the third button on the first interface and does not display the first icon on the first interface.
[0522] Figure 34 is the twenty-ninth interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 34, the terminal device opens the camera application and the terminal device displays the first interface; the first interface includes a first window 501, and the first window 501 displays a preview stream collected by the terminal device; the first interface can also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605; the first button 601 is a shooting button.
[0523] If the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (for example, 17 cm), the terminal device turns on the super macro mode, and the terminal device captures the preview stream through the super macro mode; at the same time, the terminal device detects the object category of the first image in the preview stream of the first interface.
[0524] As shown in FIG34( b ), when the terminal device determines that the object category of the first image in the preview stream of the first interface is a document object, the terminal device displays a second button 606 on the first interface at the first moment. The second button 606 is located in the lower right corner of the first window 501 of the first interface.
[0525] Then, at a second time later than the first time, as shown in FIG34(c), the terminal device displays the first icon 620 on the first interface and does not display the second button 606. The first icon 620 is located in the lower right corner of the first window 501 of the first interface. The first icon 620 has a collapsed state and an expanded state; as shown in FIG34(c), the first icon 620 is in the expanded state.
[0526] Then, at a third moment later than the second moment, as shown in (d) in Figure 34 , the terminal device displays the second button 606 on the first interface and does not display the first icon 620. The second button 606 is located in the lower right corner of the first window 501 of the first interface.
[0527] 34 , the first icon 620 is located at the lower right corner of the first window 501 of the first interface. The first icon 620 can be in an expanded state or a collapsed state.
[0528] Figure 35 is an interface diagram 30 provided in an embodiment of the present application. As shown in (a) in Figure 35, the terminal device opens the camera application and the terminal device displays the first interface; the first interface includes a first window 501, and the first window 501 displays a preview stream collected by the terminal device; the first interface can also include a first button 601, at least one shooting-related setting button 602, at least one shooting mode button 603, a preview button 604, and a switch button 605; the first button 601 is a shooting button.
[0529] If the terminal device determines that the distance between the camera used to capture the physical object and the physical object is less than a preset threshold (for example, 17 cm), the terminal device turns on the super macro mode, and the terminal device captures the preview stream through the super macro mode; at the same time, the terminal device detects the object category of the first image in the preview stream of the first interface.
[0530] As shown in FIG35( b ), when the terminal device determines that the object category of the first image in the preview stream of the first interface is a text object, the terminal device displays a third button 607 on the first interface at the first moment. The third button 607 is located in the lower right corner of the first window 501 of the first interface.
[0531] Then, at a second time later than the first time, as shown in FIG35(c), the terminal device displays the first icon 620 on the first interface and does not display the third button 607. The first icon 620 is located in the lower right corner of the first window 501 of the first interface. The first icon 620 has a collapsed state and an expanded state; as shown in FIG35(c), the first icon 620 is in the expanded state.
[0532] Then, at a third moment later than the second moment, as shown in (d) in Figure 35 , the terminal device displays a third button 607 on the first interface and does not display the first icon 620. The third button 607 is located in the lower right corner of the first window 501 of the first interface.
[0533] 35 , the first icon 620 is located at the lower right corner of the first window 501 of the first interface. The first icon 620 can be in an expanded state or a collapsed state.
[0534] In one example, in step S304, when the terminal device displays the second image in the fourth window of the third interface, the second image in the preview stream may be cropped (i.e., the second image in the preview stream in the second interface may be cropped). In step S310, when the terminal device displays the second image in the fourth window of the third interface, the second image in the preview stream may be cropped (i.e., the second image in the preview stream in the first interface may be cropped).
[0535] The cutting method may be any of the following methods.
[0536] The first cropping method: The second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area.
[0537] The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0538] For example, see the introduction of step S304 and step S310.
[0539] FIG36 is a thirty-first schematic diagram of an interface provided by an embodiment of the present application. As shown in FIG36(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, and the preview stream includes a second image 802. FIG36(a) is the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, and the preview stream includes the second image 802. FIG36(a) is the first window 501. FIG36(a) also includes a third button 607.
[0540] As shown in FIG36( a ), the second image 802 includes a first region 1001 (indicated by a dotted box) and a second region. The first region 1001 is the minimum circumscribed matrix formed by the text blocks in the second image (wherein the text blocks are the target text blocks). The second region is the peripheral area of the first region 1001.
[0541] The user triggers the third button 607 in (a) of Figure 36 , as shown in (b) of Figure 36 . The terminal device cuts off the second area, but the terminal device can retain part of the area around the first area 1001. The second image displayed by the terminal device on the fourth window 504 of the third interface includes the first area 1001. However, at this time, there is a certain distance between the frame formed by each text block in the second image and the edge of the second image; the distance can be set to a fixed number of pixels, which is an empirical value; or, the distance is a percentage of the length of the text block corresponding to the distance. In addition, the terminal device highlights each text block on the fourth window 504 of the third interface; the terminal device sets the background color of the text block to a preset color (for example, gray) on the fourth window 504 of the third interface. Figure 36 (b) has a third button 607.
[0542] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0543] In the second cropping method, the second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area.
[0544] The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the direction of the text block of the target text in the second image displayed in the third interface is adapted to the screen direction of the terminal device.
[0545] For example, based on the first cropping method described above, if the orientation of the text block in the second image in the preview stream is the same, but the orientation of the text block in the second image in the preview stream does not match the screen orientation of the terminal device, then the orientation of the text block in the second image displayed in the fourth window of the third interface on the terminal device is adapted to the screen orientation of the terminal device.
[0546] Among them, "the direction of the text block in the second image displayed on the fourth window of the third interface of the terminal device is adapted to the screen direction of the terminal device" means that if the screen of the terminal device is displayed in portrait mode, the display direction of the text block in the image displayed in the fourth window is along the short side of the screen of the terminal device; if the screen of the terminal device is displayed in landscape mode, the display direction of the text block in the image displayed in the fourth window is along the long side of the screen of the terminal device.
[0547] FIG37 is a schematic diagram of an interface provided in accordance with an embodiment of the present application. As shown in FIG37(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG37(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG37(a) shows the first window 501. FIG37(a) shows a third button 607.
[0548] As shown in FIG37( a ), the second image 802 includes a first region 1001 (shown in a dotted box) and a second region. The first region 1001 is the minimum circumscribed matrix formed by each text block in the second image (wherein the text block is the text block of the target text). The second region is the peripheral area of the first region 1001. The first region 1001 indicates the orientation of each text block in the second image, which does not match the screen orientation of the terminal device.
[0549] When the user triggers the third button 607 in (a) of FIG. 37 , as shown in (b) of FIG. 37 , the terminal device crops the second area, but may retain a portion of the area surrounding the first area 1001. The second image displayed by the terminal device in the fourth window 504 of the third interface includes the first area 1001. However, at this time, the frame formed by each text block in the second image is at a certain distance from the edge of the second image. This distance can be set to a fixed number of pixels, which is an empirical value, or the distance is a percentage of the length of the text block corresponding to the distance. Furthermore, the terminal device highlights each text block in the fourth window 504 of the third interface; sets the background color of the text block in the fourth window 504 of the third interface to a preset color (e.g., gray); and adapts the orientation of the text block in the fourth window 504 of the third interface to the terminal device's screen orientation. FIG. 37 (b) includes the third button 607.
[0550] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0551] FIG38 is the thirty-third interface diagram provided by an embodiment of the present application. As shown in FIG38(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, and the preview stream includes a second image 802. FIG38(a) is the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, and the preview stream includes the second image 802. FIG38(a) is the first window 501. FIG38(a) shows a third button 607.
[0552] As shown in FIG38( a ), the second image 802 includes a first region 1001 (shown in a dotted box) and a second region. The first region 1001 is the minimum circumscribed matrix formed by each text block in the second image (wherein the text block is the text block of the target text). The second region is the peripheral area of the first region 1001. The first region 1001 indicates the orientation of each text block in the second image, which does not match the screen orientation of the terminal device.
[0553] When the user triggers the third button 607 in FIG. 38 (a), as shown in FIG. 38 (b), the terminal device does not crop the second image; the terminal device highlights each text block in the fourth window 504 of the third interface; the terminal device sets the background color of the text block in the fourth window 504 of the third interface to a preset color (e.g., gray); and the terminal device adapts the orientation of the text block in the fourth window 504 of the third interface to the screen orientation of the terminal device. FIG. 38 (b) includes the third button 607.
[0554] The third cropping method: The second image in the preview stream includes at least one third region and a fourth region. The third region is an area formed by a text block of the target text. The distance between two third regions in at least one pair of adjacent third regions is greater than a preset distance. The fourth region is a peripheral area of the area formed by the at least one third region.
[0555] The second image displayed in the third interface includes at least one third area but does not include a fourth area. The text block of the target text in the second image displayed in the third interface is highlighted. The distance between adjacent third areas in the second image displayed in the third interface is less than the preset distance. The background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0556] Optionally, the direction of the text block of the target text in the second image displayed in the third interface is adapted to the screen direction of the terminal device.
[0557] Exemplarily, the second image in the preview stream includes at least one third area and a fourth area. For each third area, each third area is an area formed by each text block (wherein the text block is a text block of the target text). In the second image in the preview stream, the distance between two adjacent third areas is greater than a preset distance. The area formed by at least one third area is the minimum circumscribed rectangle formed by each text block in the second image. The fourth area is the peripheral area of the area formed by at least one third area, that is, the fourth area is the peripheral area of the minimum circumscribed rectangle formed by each text block in the second image.
[0558] In response to the third button being triggered, when the terminal device displays the third interface, the terminal device determines a minimum bounding matrix formed by the text blocks in the second image; the terminal device crops the second image based on the size of the minimum bounding matrix, and crops the peripheral area of the second image that is located before the minimum bounding matrix. The terminal device may retain a portion of the peripheral area surrounding the minimum bounding matrix.
[0559] In addition, the terminal device determines whether the distance between adjacent third areas (i.e., adjacent text blocks) in the second image is greater than a preset distance. The "distance between adjacent third areas (i.e., adjacent text blocks) in the second image" includes the following distances: the upper and lower distances and the left and right distances of the text blocks. The "preset distance" is an empirical value, and the preset distance can be the height of the text block or the width of the text block. If the terminal device determines that the distance between adjacent third areas in the second image is greater than the preset distance, the terminal device cuts to the area between the adjacent third areas so that the distance between the adjacent third areas is less than or equal to the preset distance.
[0560] Furthermore, the terminal device highlights each text block of the target text in the fourth window of the third interface. Furthermore, the terminal device sets the background color of the text block of the target text to a preset color (e.g., gray or black) in the fourth window of the third interface; thus, the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0561] Optionally, since the second image displayed on the third interface of the terminal device is a cropped image, when the terminal device displays the second image in the fourth window of the third interface, the cropped second image can be extended to fill the fourth window. For example, based on the width of the cropped second image, the cropped second image is extended to fill the fourth window so that the cropped second image reaches the edge of the fourth window in the width direction. For another example, based on the height of the cropped second image, the cropped second image is extended to fill the fourth window so that the cropped second image reaches the edge of the fourth window in the height direction.
[0562] Wherein, if the orientation of the text block in the second image in the preview stream is the same, but the orientation of the text block in the second image in the preview stream does not match the screen orientation of the terminal device; then the orientation of the text block in the second image displayed by the terminal device in the fourth window of the third interface is adapted to the screen orientation of the terminal device. Alternatively, if the orientation of the text block in the second image in the preview stream is the same, but the orientation of the text block in the second image in the preview stream does not match the screen orientation of the terminal device; then the terminal device does not adjust the orientation of the text block in the second image in the fourth window of the third interface.
[0563] FIG39 is a diagram 34 of an interface provided by an embodiment of the present application. As shown in FIG39(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG39(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG39(a) shows the first window 501. FIG39(a) shows a third button 607.
[0564] As shown in FIG39(a), the second image 802 includes at least one third region 1002 and a fourth region. Each third region 1002 is a region formed by each text block. The region formed by each third region 1002 has a minimum bounding rectangle, as shown in the dotted box in FIG39(a), and the minimum bounding rectangle is region 1003. The distance between two adjacent third regions 1002 is greater than a preset distance. The fourth region is the peripheral area of region 1003. The text blocks in the second image in the preview stream have the same orientation.
[0565] When the user triggers the third button 607 in (a) of FIG. 39 , as shown in (b) of FIG. 39 , the terminal device crops the fourth region, but may retain a portion of the area surrounding region 1003. The second image displayed by the terminal device in the fourth window 504 of the third interface does not include the fourth region. However, at this time, the frame formed by each text block in the second image is at a certain distance from the edge of the second image; this distance can be set to a fixed number of pixels, which is an empirical value; or, the distance is a percentage of the length of the text block corresponding to the distance. Furthermore, the terminal device crops the area between adjacent third regions 1003 that are farther apart. Furthermore, the terminal device highlights each text block in the fourth window 504 of the third interface; and the terminal device sets the background color of the text block in the fourth window 504 of the third interface to a preset color (e.g., gray). FIG. 39 (b) includes the third button 607.
[0566] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0567] FIG40 is a thirty-fifth schematic diagram of an interface provided in an embodiment of the present application. As shown in FIG40(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, and the preview stream includes a second image 802. FIG40(a) is the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, and the preview stream includes the second image 802. FIG40(a) is the first window 501. FIG40(a) includes a third button 607.
[0568] As shown in (a) in Figure 40, the second image 802 includes at least one third area 1002 and a fourth area. Each third area 1002 is an area formed by each text block. The area formed by each third area 1002 has a minimum circumscribed rectangle, as shown in the dotted box in (a) in Figure 40, and the minimum circumscribed rectangle is area 1003. The distance between two third areas 1002 in adjacent third areas 1002 is greater than the preset distance. The fourth area is the peripheral area of area 1003. The direction of the text blocks in the second image in the preview stream is the same, but the direction of the text blocks in the second image in the preview stream does not match the screen direction of the terminal device.
[0569] When the user triggers the third button 607 in FIG. 40 (a), as shown in FIG. 40 (b), the terminal device crops the fourth region, but may retain a portion of the area surrounding region 1003. The second image displayed by the terminal device in the fourth window 504 of the third interface does not include the fourth region. However, at this time, the frame formed by each text block in the second image is at a certain distance from the edge of the second image. This distance can be set to a fixed number of pixels, which is an empirical value, or a percentage of the length of the text block corresponding to the distance. Furthermore, the terminal device crops the area between adjacent third regions 1003 that are farther apart. Furthermore, the terminal device highlights each text block in the fourth window 504 of the third interface; sets the background color of the text block in the fourth window 504 of the third interface to a preset color (e.g., gray); and adapts the orientation of the text block in the fourth window 504 of the third interface to the terminal device's screen orientation. FIG. 40 (b) includes the third button 607.
[0570] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0571] Fourth cropping method: The second image in the preview stream includes a fifth area and a sixth area, the fifth area is an area formed by text blocks of the target text and has a background image, and the sixth area is a peripheral area of the fifth area.
[0572] The second image displayed in the third interface includes the fifth area but does not include the sixth area, and the text block of the target text in the second image displayed in the third interface is highlighted.
[0573] Optionally, the direction of the text block of the target text in the second image displayed in the third interface is adapted to the screen direction of the terminal device.
[0574] For example, the second image in the preview stream includes a fifth region and a sixth region. Each text block in the second image in the preview stream has a background image; the background image can be a character background, a landscape background, or the like. The fifth region is the area formed by each text block in the second image in the preview stream, and the fifth region has a background image. The sixth region is the peripheral area of the fifth region.
[0575] In response to the third button being triggered, when the terminal device displays the third interface, the terminal device retains each text block and the background image of each text block in the second image, thereby retaining the fifth area and cutting out the sixth area. The terminal device highlights each text block of the target text in the fourth window of the third interface.
[0576] FIG41 is a thirty-sixth interface diagram provided in an embodiment of the present application. As shown in FIG41(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG41(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG41(a) shows the first window 501. FIG41(a) shows a third button 607.
[0577] As shown in FIG41( a ), the second image 802 includes a fifth region 1004 and a sixth region. Fifth region 1004 is the area formed by the text blocks of the second image in the preview stream, and contains a background image. The sixth region is the outer area of the fifth region. The text blocks in the second image in the preview stream all have the same orientation.
[0578] The user triggers the third button 607 in FIG41(a), and as shown in FIG41(b), the terminal device crops the sixth region. The terminal device displays the second image in the fourth window 504 of the third interface, including but not including the sixth region, and including the fifth region 1004. FIG41(b) shows the third button 607.
[0579] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0580] A fifth cropping method: The second image in the preview stream includes a first area and a second area, wherein the first area is an area formed by the text blocks of the target text, and the second area is an area surrounding the first area; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions.
[0581] The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the direction of each text block of the target text in the second image displayed in the third interface includes at least two different directions.
[0582] Exemplarily, the second image in the preview stream includes a first region and a second region. The first region is the region formed by the text blocks of the target text, and the second region is the area surrounding the first region. The first region is the minimum bounding rectangle formed by the text blocks in the second image, and the second region is the region of the second image excluding the minimum bounding rectangle. The text blocks of the target text in the second image in the preview stream have different orientations.
[0583] When the terminal device displays the third interface in response to the third button being triggered, the terminal device determines the minimum circumscribed matrix formed by the text blocks in the second image; the terminal device crops the second image according to the size of the minimum circumscribed matrix, and crops the peripheral area of the second image located before the minimum circumscribed matrix. The terminal device can retain part of the area around the periphery of the minimum circumscribed matrix; and the terminal device crops the peripheral area of the first area, that is, crops to the second area. A second image for display on the third interface is obtained. Among them, in the second image for display on the third interface, there is a certain distance between the frame formed by the text blocks and the edge of the image; the distance can be set to a fixed number of pixels, which is an empirical value; or, the distance is a percentage of the length of the text block corresponding to the distance.
[0584] Thus, the second image displayed by the terminal device in the third interface includes the above-mentioned first area, but does not include the second area. In addition, the terminal device highlights each text block of the target text in the first area. In addition, the terminal device sets the background color of the text block of the target text in the first area to a preset color (for example, gray or black); thus, the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0585] The terminal device does not perform orientation correction on text blocks.
[0586] Optionally, since the second image displayed on the third interface of the terminal device is a cropped image, when the terminal device displays the second image in the fourth window of the third interface, the cropped second image can fill the fourth window.
[0587] FIG42 is a schematic diagram of the interface provided in accordance with an embodiment of the present application. As shown in FIG42(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG42(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG42(a) shows the first window 501. FIG42(a) shows a third button 607.
[0588] As shown in FIG42(a), the second image 802 includes a first region 1001 (indicated by the dotted box) and a second region. The first region 1001 is the minimum circumscribed matrix formed by the text blocks in the second image (wherein the text blocks are the target text blocks). The second region is the peripheral area of the first region 1001. The text blocks in the first region 1001 have different orientations.
[0589] The user triggers the third button 607 in FIG42(a), and as shown in FIG42(b), the terminal device cuts off the second area, but the terminal device may retain a portion of the area surrounding the first area 1001. The directions of the text blocks in the first area 1001 are different.
[0590] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0591] Sixth cropping method: The second image in the preview stream includes a first area and a second area, the first area being an area formed by the text blocks of the target text, and the second area being an area surrounding the first area; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions.
[0592] The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the directions of the text blocks of the target text in the second image displayed in the third interface are consistent.
[0593] Optionally, the direction of each text block of the target text in the second image displayed in the third interface is based on the direction of the first text block in the second image in the preview stream; or, the direction of each text block of the target text in the second image displayed in the third interface is based on the direction of the text block with the largest area in the second image in the preview stream; or, the direction of each text block of the target text in the second image displayed in the third interface is based on the direction of the text block with the largest number of words in the second image in the preview stream.
[0594] Exemplarily, based on the sixth cropping method described above, the terminal device corrects the directions of the text blocks to be in the same direction on the fourth window of the third interface.
[0595] For example, when correcting the direction of a text block: the correction angle of the first text block is used as a basis, and other text blocks follow the first text block; or, the correction angle of the text block with the largest area is used as a basis, and other text blocks follow this text block; or, the correction angle of the text block with the largest number of words is used as a basis, and other text blocks follow this text block.
[0596] FIG43 is an interface diagram thirty-eight provided in an embodiment of the present application. As shown in FIG43(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG43(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG43(a) shows the first window 501. FIG43(a) shows a third button 607.
[0597] As shown in FIG43( a ), the second image 802 includes a first region 1001 (indicated by the dotted box) and a second region. The first region 1001 is the minimum circumscribed matrix formed by the text blocks in the second image (wherein the text blocks are the target text blocks). The second region is the peripheral area of the first region 1001. The text blocks in the first region 1001 have different orientations.
[0598] The user triggers the third button 607 in FIG43(a), and as shown in FIG43(b), the terminal device cuts off the second area, but the terminal device may retain a portion of the area surrounding the first area 1001. The directions of the text blocks in the first area 1001 are the same.
[0599] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0600] Seventh cropping method: The second image in the preview stream includes at least one third region and a fourth region, wherein the third region is an area formed by text blocks of the target text; the distance between the two third regions in at least one pair of adjacent third regions is greater than a preset distance; the fourth region is a peripheral area of the area formed by the at least one third region; and the orientation of each text block of the target text in the second image in the preview stream includes at least two different orientations.
[0601] The second image displayed in the third interface includes at least one third area but does not include a fourth area. The text blocks of the target text in the second image displayed in the third interface are highlighted. The distances between adjacent third areas in the second image displayed in the third interface are less than a preset distance. The background color of the text blocks of the target text in the second image in the preview stream and the background color of the text blocks of the target text in the second image displayed in the third interface are different. The directions of the text blocks of the target text in the second image displayed in the third interface are consistent.
[0602] Optionally, the direction of each text block of the target text in the second image displayed in the third interface is based on the direction of the first text block in the second image in the preview stream; or, the direction of each text block of the target text in the second image displayed in the third interface is based on the direction of the text block with the largest area in the second image in the preview stream; or, the direction of each text block of the target text in the second image displayed in the third interface is based on the direction of the text block with the largest number of words in the second image in the preview stream.
[0603] For example, see the introduction to the third cropping method above. Unlike the third cropping method, the text blocks of the target text in the second image in the preview stream have different orientations; when the terminal device displays the third interface in response to the third button being triggered, the terminal device corrects the orientations of the text blocks of the target text in the second image displayed in the third interface to the same orientation, and the orientations of the text blocks are adapted to the screen orientation of the terminal device.
[0604] FIG44 is a thirty-ninth interface diagram provided in an embodiment of the present application. As shown in FIG44(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG44(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG44(a) shows the first window 501. FIG44(a) shows a third button 607.
[0605] As shown in FIG44(a), the second image 802 includes at least one third region 1002 and a fourth region. Each third region 1002 is a region formed by each text block. The region formed by each third region 1002 has a minimum bounding rectangle, as shown in the dotted box in FIG44(a), and the minimum bounding rectangle is region 1003. The distance between two adjacent third regions 1002 is greater than a preset distance. The fourth region is the peripheral area of region 1003. The text blocks in the second image in the preview stream have different orientations.
[0606] When the user triggers the third button 607 in (a) of FIG. 44 , as shown in (b) of FIG. 44 , the terminal device crops the fourth area, but may retain a portion of the area surrounding area 1003. The second image displayed by the terminal device in the fourth window 504 of the third interface does not include the fourth area, but at this time, the frame formed by each text block in the second image is a certain distance from the edge of the second image. Furthermore, the terminal device crops the area between adjacent third areas 1003 that are farther apart. Furthermore, the terminal device highlights each text block in the fourth window 504 of the third interface; the terminal device sets the background color of the text blocks in the fourth window 504 of the third interface to a preset color (e.g., gray). The terminal device corrects the orientation of the text blocks in the fourth window 504 of the third interface to the same direction. FIG. 44 (b) includes the third button 607. Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0607] Alternatively, the user triggers the third button 607 in (a) of Figure 44, as shown in (c) of Figure 44, and (c) of Figure 44 includes the processing process of (b) of Figure 44, but the direction of the text block is not corrected on the fourth window 504 of the third interface of the terminal device.
[0608] An eighth cropping method: The second image in the preview stream includes a fifth region and a sixth region. The fifth region is an area formed by the text blocks of the target text and includes a background image. The sixth region is an area surrounding the fifth region. The orientation of the text blocks of the target text in the second image in the preview stream includes at least two different orientations.
[0609] The second image displayed in the third interface includes the fifth area but does not include the sixth area, and the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
[0610] Optionally, the directions of the text blocks of the target text in the second image displayed in the third interface are consistent.
[0611] For example, see the fourth cropping method described above. Unlike the third cropping method, the text blocks of the target text in the second image in the preview stream have different orientations; when the terminal device displays the third interface in response to the third button being triggered, the terminal device corrects the orientation of the text blocks of the target text in the second image displayed in the third interface to the same orientation, or does not correct the orientation.
[0612] FIG45 is a schematic diagram of an interface provided in an embodiment of the present application. As shown in FIG45(a), when the image in the first interface is a document object, the terminal device displays a preview stream in the second window, which includes a second image 802. FIG45(a) shows the second window 502. When the image in the first interface is a text object, the terminal device displays a preview stream in the first window, which includes the second image 802. FIG45(a) shows the first window 501. FIG45(a) shows a third button 607.
[0613] As shown in FIG45( a ), the second image 802 includes a fifth region 1004 and a sixth region. Fifth region 1004 is the area formed by the text blocks of the second image in the preview stream, and includes a background image. The sixth region is the outer area of the fifth region. The text blocks in the second image in the preview stream have different orientations.
[0614] The user triggers the third button 607 in FIG. 45( a ), and as shown in FIG. 45( b ), the terminal device crops the sixth region. The second image displayed by the terminal device in the fourth window 504 of the third interface includes and excludes the sixth region, and includes and excludes the fifth region 1004. The terminal device does not correct the orientation of the text block in the fourth window 504 of the third interface. FIG. 45( b ) shows the third button 607.
[0615] Optionally, the terminal device magnifies and displays the second image in the fourth window 504 of the third interface; for example, the second image in the fourth window 504 of the third interface can fill the fourth window 504 .
[0616] In the above example, the "direction of the text block" can be determined based on the language, font, font size, font shape, etc.
[0617] In one example, in step S304, after the terminal device displays the second image in the fourth window of the third interface, the terminal device may amplify the second image in the fourth window based on a user trigger. In step S310, after the terminal device displays the second image in the fourth window of the third interface, the terminal device may amplify the second image in the fourth window based on a user trigger.
[0618] The zooming method may be any of the following methods: In the following zooming methods (excluding gesture operations), when the user triggers a position, text block, or area on the fourth window, the user may trigger the zooming by double-clicking or single-clicking.
[0619] The first way to zoom in.
[0620] At the fourth moment, the terminal device is triggered in response to the first position on the fourth window, where the first position is any position on the second image in the fourth window, and the image on the fourth window is enlarged at a first ratio with the first position as the center point.
[0621] At the fifth moment, the terminal device is triggered in response to the second position on the fourth window, where the second position is any position on the second image in the fourth window, and the image on the fourth window is enlarged at a second ratio with the second position as the center point; the fifth moment is later than the fourth moment.
[0622] At the sixth moment, the terminal device is triggered in response to the third position on the fourth window, where the third position is any position on the second image in the fourth window, and reduces the image on the fourth window to the size before the fourth moment; the sixth moment is later than the fifth moment.
[0623] The image on the fourth window after the fifth moment is 1.75 times to 3 times the image on the fourth window before the fourth moment.
[0624] Exemplarily, after the terminal device displays an image on the fourth window of the third interface, the user can trigger in the fourth window to zoom in or out the image on the fourth window.
[0625] At a fourth moment, the user triggers a first position on the fourth window, where the first position is an arbitrary position on the second image in the fourth window; the terminal device magnifies and displays the image in the fourth window at a first ratio, with the first position as the center point. The first ratio is a preset multiple (e.g., 1.75 times to 3 times) of the original image size, where the original image size is the original image size of the second image displayed in the fourth window.
[0626] At a fifth moment later than the fourth moment, the user triggers a second position on the fourth window, where the second position is an arbitrary position on the second image in the fourth window; the terminal device magnifies and displays the image in the fourth window at a second ratio, with the second position as the center point. The second ratio is a preset multiple (e.g., 1.75 times to 3 times) of the original image size, where the original image size is the original image size of the second image displayed in the fourth window.
[0627] At a sixth moment later than the fifth moment, the user triggers the third position on the fourth window, where the third position is any position on the second image in the fourth window; the terminal device shrinks the image on the fourth window and restores the image to the size before the fourth moment, that is, restores it to the original image size.
[0628] The maximum value of the image after being enlarged is three times the original image size of the image.
[0629] Figure 46 is the forty-first interface diagram provided in an embodiment of the present application. As shown in (a) in Figure 46 , the terminal device displays the third interface, and the second image 802 is displayed on the fourth window 504 of the third interface.
[0630] As shown in FIG46(a), at the fourth moment, the user triggers the first position 1101 on the fourth window 504, where the first position 1101 is an arbitrary position on the second image in the fourth window 504. As shown in FIG46(b), the terminal device enlarges the image in the fourth window 504 at a first ratio (1.75 to 3 times the original image size) with the first position 1101 as the center point.
[0631] As shown in FIG46( b ), at a fifth time later than the fourth time, the user triggers the second position 1102 on the fourth window 504. The second position 1102 is an arbitrary position on the second image in the fourth window 504. As shown in FIG46( c ), the terminal device enlarges the image in the fourth window 504 at a second ratio (1.75 to 3 times the original image size) with the second position 1102 as the center point.
[0632] The maximum value of the image after being enlarged is three times the original image size of the image.
[0633] As shown in FIG46(c), at a sixth moment later than the fifth moment, the user triggers the third position 1103 on the fourth window 504. The third position 1003 is an arbitrary position on the second image in the fourth window 504. As shown in FIG46(d), the terminal device shrinks the image in the fourth window to the size before the fourth moment and restores the image in the fourth window to the original size.
[0634] The second way to zoom in.
[0635] At the seventh moment, the terminal device is triggered in response to the fourth position on the fourth window, where the fourth position is any position on the second image in the fourth window, and the image on the fourth window is enlarged at a third ratio with the fourth position as the center point.
[0636] At the eighth moment, the terminal device is triggered in response to the fifth position on the fourth window, where the fifth position is any position on the second image in the fourth window, and restores the size of the image on the fourth window; the eighth moment is later than the seventh moment.
[0637] Exemplarily, FIG47 is an interface diagram 42 provided in an embodiment of the present application. As shown in (a) in FIG47 , the terminal device displays a third interface, and displays a second image 802 on a fourth window 504 of the third interface.
[0638] As shown in FIG47(a), at the seventh moment, the user triggers the fourth position 1104 on the fourth window 504. The fourth position 1104 is an arbitrary position on the second image in the fourth window 504. As shown in FIG47(b), the terminal device enlarges the image in the fourth window 504 at a first ratio (1.75 to 3 times the original image size) with the fourth position 1104 as the center point.
[0639] As shown in FIG47(b), at an eighth moment later than the seventh moment, the user triggers the fifth position 1105 on the fourth window 504. The fifth position 1105 is an arbitrary position on the second image in the fourth window 504. As shown in FIG47(c), the terminal device shrinks the image in the fourth window 504 to the size before the fourth moment, that is, restores the image in the fourth window 504 to the original image size.
[0640] The third way to zoom in.
[0641] At the ninth moment, the terminal device is triggered to enlarge the image on the fourth window in response to the first text block on the fourth window. The longest text block in the enlarged image after the ninth moment reaches the edge of the terminal device screen.
[0642] At the tenth moment, the terminal device responds to the sixth position on the fourth window being triggered, the sixth position being any position on the second image in the fourth window, and restores the image on the fourth window to the original image size of the image; the tenth moment is later than the ninth moment.
[0643] Exemplarily, FIG48 is the forty-third interface diagram provided in an embodiment of the present application. As shown in (a) in FIG48 , the terminal device displays the third interface, and displays the second image 802 on the fourth window 504 of the third interface.
[0644] As shown in (a) of FIG48 , at the ninth moment, the user triggers the first text block 1201 on the fourth window 504. The terminal device first determines the longest text block on the fourth window 504.
[0645] The terminal device then calculates the magnified length of the longest text block. The magnified length of the longest text block is z' = z / (y / (yx)). Here, z is the length of the longest text block, x is the distance from the longest text block to the edge of the screen, and y is the total length of the screen (i.e., the total width of the screen).
[0646] As shown in (b) of FIG48 , the terminal device enlarges the image on the fourth window 504 according to the enlarged length of the largest text block; thereby, the longest text block can reach the edge of the screen of the terminal device.
[0647] As shown in FIG48(b), at a tenth time later than the ninth time, the user triggers the sixth position 1106 on the fourth window 504. The sixth position 1106 is an arbitrary position on the second image in the fourth window 504. As shown in FIG48(c), the terminal device shrinks the image in the fourth window 504 to the size before the fourth time, that is, restores the image in the fourth window 504 to the original image size.
[0648] The fourth way to zoom in.
[0649] At the eleventh moment, the terminal device enlarges the image on the fourth window in response to the second text block on the fourth window being triggered; the second text block in the enlarged image after the eleventh moment reaches the edge of the screen of the terminal device.
[0650] At the twelfth moment, the terminal device enlarges the image on the fourth window in response to the third text block on the fourth window being triggered, wherein the length of the third text block is less than the length of the second text block; the third text block in the enlarged image after the twelfth moment reaches the edge of the screen of the terminal device; the twelfth moment is later than the eleventh moment.
[0651] At the thirteenth moment, the terminal device responds to the third text block on the fourth window being triggered and restores the image on the fourth window to the image size before the twelfth moment; the second text block in the reduced image after the thirteenth moment reaches the screen edge of the terminal device; the thirteenth moment is later than the twelfth moment.
[0652] At the fourteenth moment, the terminal device is triggered in response to the seventh position on the fourth window, wherein there is no target text at the seventh position, and restores the image on the fourth window to its original image size; the fourteenth moment is later than the eleventh moment.
[0653] For example, FIG49 is an interface diagram 44 provided in an embodiment of the present application. As shown in (a) in FIG49 , the terminal device displays the third interface, and the second image 802 is displayed on the fourth window 504 of the third interface.
[0654] As shown in (a) of FIG. 49 , at time 11, the user triggers the second text block 1202 on the fourth window 504 .
[0655] The terminal device first calculates the enlarged length of the second text line 1102. The enlarged length of the second text line 102 is z2' = z2 / (y / (y-x2)). Here, z2 is the length of the second text line 1102 before the eleventh moment, x2 is the distance from the second text line 1102 to the edge of the screen before the eleventh moment, and y is the total length of the screen (i.e., the total width of the screen).
[0656] As shown in (b) of FIG. 49 , the terminal device enlarges the image on the fourth window 504 according to the enlarged length of the second text line 1102 ; thereby, the second text line 1102 can reach the edge of the screen of the terminal device.
[0657] As shown in (b) of FIG49 , at time 12, which is later than time 11, the user triggers the third text block 1203 on the fourth window 504. The length of the third text block 1203 is less than the length of the second text block 1202. The terminal device first calculates the enlarged length of the third text block 1203. The enlarged length of the third text block 1203 is z3′=z3 / (y / (y-x3)). Wherein, z3 is the length of the third text block 1203 before time 12, x3 is the distance from the third text block 1203 to the edge of the screen before time 12, and y is the total length of the screen (i.e., the total width of the screen).
[0658] As shown in (c) of FIG. 49 , the terminal device enlarges the image on the fourth window 504 according to the enlarged length of the third text block 1203 ; thereby, the third text block 1203 can reach the edge of the screen of the terminal device.
[0659] As shown in (c) of Figure 49 , at time 13, which is later than time 12, the user triggers the third text block 1203 on the fourth window 504. As shown in (d) of Figure 49 , the terminal device restores the image on the fourth window 504 to the image size before time 12; wherein, the third text block 1202 is in the state of (b) of Figure 49 , and (d) of Figure 49 is the same as (b) of Figure 49 .
[0660] In addition, the user triggers the seventh position on the fourth window at the fourteenth moment later than the eleventh moment, and there is no target text at the seventh position; then the terminal device restores the image on the fourth window to its original image size.
[0661] For example, as shown in FIG49(c), at time 14 later than time 11, the user triggers seventh position 1107 on fourth window 504. There is no target text at seventh position 1107. As shown in FIG49(e), the terminal device restores the image on fourth window 504 to its original size. That is, FIG49(e) is the same as FIG49(a).
[0662] The fifth way to zoom in.
[0663] The terminal device responds to the first gesture operation, which is a two-finger zoom-in operation, and enlarges the image displayed in the fourth window.
[0664] The terminal device responds to the second gesture operation, which is a two-finger zoom-out operation, to zoom out the image displayed in the fourth window.
[0665] For example, the terminal device may infinitely zoom in on the image in the fourth window or infinitely zoom out on the image in the fourth window based on the user's gesture operation.
[0666] For example, the user touches the fourth window to input a first gesture operation, where the first gesture operation is a two-finger zoom-in operation. The terminal device zooms in on the image displayed in the fourth window based on the size indicated by the first gesture operation.
[0667] The user touches the fourth window to input a second gesture operation, where the second gesture operation is a two-finger zoom-out operation. The terminal device zooms out the image displayed in the fourth window based on the size indicated by the second gesture operation.
[0668] FIG50 is a schematic diagram of an interface provided in an embodiment of the present application. As shown in FIG50( a ), a user touches fourth window 504 to input a two-finger zoom operation. As shown in FIG50( b ), the terminal device enlarges the image displayed in fourth window 504 based on the size indicated by the two-finger zoom operation.
[0669] As shown in (b) of Figure 50 , the user touches the fourth window 504 to input a two-finger zoom-out operation. As shown in (c) of Figure 50 , the terminal device reduces the image displayed in the fourth window 504 based on the size indicated by the two-finger zoom-out operation.
[0670] In the interface diagrams in this application, “***” is text.
[0671] Figure 51 is a schematic diagram of the software layer of the terminal device provided in an embodiment of the present application. As shown in Figure 51, the terminal device is deployed with an application layer (app), an application framework layer (Framwork, FW), a system runtime layer (Native), a hardware abstraction layer (Hardware Abstraction Layer, HAL), and a Linux kernel layer (Kenrel).
[0672] The application layer includes camera applications, gallery applications, screenshot applications, and so on. The preview stream is obtained in the application layer. Document scanning and text extraction are performed on the preview stream in the application layer.
[0673] The system runtime layer deploys the image and text understanding algorithm engine and the document scanning algorithm engine. The system runtime layer can also be called the algorithm engine layer.
[0674] Thus, the application layer can call the document scanning algorithm engine in the system runtime layer to perform document scanning. The application layer can call the image and text understanding algorithm engine in the system runtime layer to perform text recognition and text extraction.
[0675] In this embodiment, when the object category of the first image in the preview stream is a document object, the terminal device displays a second button ("document scanning animation button") on the first interface; the terminal device displays a second interface in response to the second button in the first interface being triggered; wherein the second interface includes a second window and a third window; the second window displays the preview stream collected by the terminal device, and the document frame in the current frame image in the preview stream is highlighted; when the current frame image of the preview stream includes the target text, a third button ("text extraction animation button") is displayed on the second interface. The terminal device displays a third interface in response to the third button in the second interface being triggered; the third interface displays a third button; the fourth window displays the second image in the preview stream, and the second image includes the highlighted target text. Thus, a text extraction function is provided. The terminal device displays a fourth interface in response to the first button in the second interface being triggered; thereby, a document scanning function and an image processing function are provided.
[0676] When the object category of the first image in the preview stream is a text object, the terminal device displays a third button ("text extraction button") on the first interface. In response to the triggering of the third button in the first interface, the terminal device displays a third interface; the third interface displays the third button; and the fourth window displays the second image in the preview stream, which includes the highlighted target text. This provides a text extraction function.
[0677] It further provides the function of recognizing documents and texts, and can provide document scanning and text extraction functions.
[0678] In this embodiment, users no longer need to manually select the text to be recognized, preventing the possibility of missing text due to the text appearing too quickly and the user not having enough time to select the target text. For example, in a conference PowerPoint presentation, if the speaker flips through the pages too quickly, the phone's viewfinder may not have enough time to select the target text. The text in the image can be recognized promptly. Furthermore, users do not need to manually select the target text on the screen, avoiding conflicts with the camera's interaction, which could affect text recognition or the captured image; and reducing the user's learning curve.
[0679] The solution provided by this embodiment can enable the terminal device to recognize the text in the image in a timely manner and facilitate the user to trigger the functions of each entity.
[0680] FIG52 is a second flow chart of a text recognition method based on a terminal device provided in an embodiment of the present application. As shown in FIG52 , the method includes:
[0681] S5201. In response to opening the second image through the gallery application, the terminal device displays the first interface.
[0682] For example, a user triggers a terminal device to open a second image in a gallery application. The terminal device then opens the second image based on the gallery application. Consequently, the terminal device displays a first interface, which displays the second image. The first interface includes gallery application icons such as a share icon, a favorite icon, an edit icon, a delete icon, and a "More" icon.
[0683] S5202: When the second image includes target text, the terminal device displays a third button on the first interface.
[0684] Exemplarily, the terminal device detects whether the second image contains the target text, and the “target text” is described above. When the terminal device determines that the second image contains the target text, the terminal device displays a third button (text extraction animation button) on the first interface.
[0685] S5203. In response to the third button in the first interface being triggered, the terminal device displays the third interface; wherein the third interface includes a fourth window and a fifth window; a third button is displayed on the third interface; the fourth window displays a second image, and the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays a fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window.
[0686] For example, see the above step S310. The processing in this step is based on the second image opened by the gallery application.
[0687] S5204. In response to the third button in the third interface being triggered, the terminal device displays the first interface.
[0688] Exemplarily, the user triggers the third button (text extraction animation button) on the third interface; the terminal device returns to the first interface of step S5202.
[0689] This embodiment is a process of enabling the "first image is a text object" in the above embodiment in a gallery application.
[0690] Figure 53 is the forty-sixth interface diagram provided by an embodiment of the present application. As shown in (a) in Figure 53, the user triggers the terminal device to open the second image in the gallery application. The terminal device opens the second image based on the gallery application. As a result, the terminal device displays the first interface, and the first interface displays the second image; the first interface includes icons of the gallery application: a share icon, a favorite icon, an edit icon, a delete icon, a "more" icon, and so on. As shown in (b) in Figure 53, when the terminal device determines that the second image includes the target text, the terminal device displays a third button 507 (text extraction animation button) on the first interface.
[0691] The user triggers the third button 507 on the first interface, and as shown in FIG53(c), the terminal device displays the third interface, which includes the fourth window and the fifth window. The third interface may include icons for the gallery application: a share icon, a favorite icon, an edit icon, a delete icon, a "more" icon, and so on.
[0692] The user triggers the third button 507 on the third interface, as shown in (d) in Figure 53, and the terminal device returns to the first interface, where (d) in Figure 53 is (b) in Figure 53.
[0693] In the interface diagrams in this application, “***” is text.
[0694] FIG54 is a third flow chart of a text recognition method based on a terminal device provided in an embodiment of the present application. As shown in FIG54 , the method includes:
[0695] S5401. In response to obtaining a second image through a screenshot application, the terminal device displays a first interface.
[0696] For example, a user triggers a terminal device to take a screenshot. The terminal device obtains the second image through a screenshot application. As a result, the terminal device displays a first interface, which displays the second image; and the first interface includes an icon for the screenshot application.
[0697] S5402: When the second image includes target text, the terminal device displays a third button on the first interface.
[0698] Exemplarily, the terminal device detects whether the second image contains the target text, and the “target text” is described above. When the terminal device determines that the second image contains the target text, the terminal device displays a third button (text extraction animation button) on the first interface.
[0699] S5403. In response to the third button in the first interface being triggered, the terminal device displays the third interface; wherein the third interface includes a fourth window and a fifth window; a third button is displayed on the third interface; the fourth window displays a second image, and the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays a fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window.
[0700] For example, see the above step S310. In this step, the second image obtained based on the screenshot application is processed.
[0701] S5404: In response to the third button in the third interface being triggered, the terminal device displays the first interface.
[0702] Exemplarily, the user triggers the third button (text extraction animation button) on the third interface; the terminal device returns to the first interface of step S5402.
[0703] This embodiment is a process of enabling the "first image is a text object" in the above embodiment in a screenshot application.
[0704] Figure 55 is the forty-seventh interface diagram provided by an embodiment of the present application. As shown in (a) of Figure 55 , the user triggers the terminal device to take a screenshot, and then the terminal device obtains the second image. Thus, the terminal device displays the first interface, and the first interface displays the second image; the first interface includes icons of the screenshot application: a share icon, an edit icon, a mosaic icon, an eraser icon, a delete icon, a save icon, an icon for drawing graphics (for example, a free graphic, a rectangle, a circle, a heart shape), and so on. As shown in (b) of Figure 55 , when the terminal device determines that the second image includes the target text, the terminal device displays a third button 507 (a text extraction animation button) on the first interface.
[0705] The user triggers the third button 507 on the first interface, and as shown in FIG55(c), the terminal device displays the third interface, which includes the fourth window and the fifth window. The third interface may also include an icon for a screenshot application.
[0706] The user triggers the third button 507 on the third interface, as shown in (d) in Figure 55, and the terminal device returns to the first interface, where (d) in Figure 55 is (b) in Figure 55.
[0707] Figure 56 is the forty-eighth interface diagram provided by an embodiment of the present application. As shown in (a) in Figure 56 , the user triggers the terminal device to take a screenshot, and the user draws a graphic on the obtained screenshot image, and then the terminal device obtains the second image. Thus, the terminal device displays the first interface, and the first interface displays the second image; the first interface includes icons of the screenshot application: a sharing icon, an icon for drawing graphics (for example, a free graphic, a rectangle, a circle, a heart shape), and so on. As shown in (b) in Figure 56 , when the terminal device determines that the second image includes the target text (identifying the target text in the area of the graphic drawn by the user on the screenshot image), the terminal device displays a third button 507 (text extraction animation button) on the first interface.
[0708] The user triggers the third button 507 on the first interface, and as shown in FIG56(c), the terminal device displays the third interface, which includes the fourth window and the fifth window. The third interface may include an icon for the screenshot application. At this time, the terminal device only recognizes the target text in the area of the graphic drawn by the user on the screenshot image.
[0709] The user triggers the third button 507 on the third interface, as shown in (d) in Figure 56, and the terminal device returns to the first interface, where (d) in Figure 56 is (b) in Figure 56.
[0710] In the interface diagrams in this application, “***” is text.
[0711] The method for sorting a device list in an embodiment of the present application has been described above. The following describes an apparatus for performing the aforementioned method for sorting a device list provided in an embodiment of the present application. Those skilled in the art will appreciate that the method and apparatus may be combined and referenced with one another, and that the relevant apparatus provided in an embodiment of the present application may perform the steps in the aforementioned method for sorting a device list.
[0712] The embodiment of the present application can divide the functional modules of the device of the above method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0713] 57 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip 5700 includes one or more (including two) processors 5701, a communication line 5702, a communication interface 5703, and a memory 5704.
[0714] In some embodiments, the memory 5704 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0715] The method described in the above embodiment of the present application can be applied to the processor 5701, or implemented by the processor 5701. The processor 5701 may be an integrated circuit chip with signal processing capabilities. During the implementation process, the various steps of the above-mentioned terminal device execution method can be completed by the hardware integrated logic circuit or software instructions in the processor 5701. The above-mentioned processor 5701 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 5701 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0716] The steps of the method disclosed in the embodiments of the present application can be directly implemented as being executed by a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read-only memory (EEPROM). The storage medium is located in the memory 5704, and the processor 5701 reads the information in the memory 5704 and performs the steps of the above method in combination with its hardware.
[0717] The processor 5701 , the memory 5704 , and the communication interface 5703 can communicate with each other through the communication line 5702 .
[0718] FIG58 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. As shown in FIG58 , terminal device 5800 includes the aforementioned chip and a display unit. The display unit is provided with an integrated circuit panel, which is used to issue periodic interrupt events. The integrated circuit panel excludes the integrated circuit unit used to calculate coordinate information corresponding to touch operations.
[0719] The terminal device-based text recognition method provided in the embodiments of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices. The specific device form of the terminal device can refer to the above-mentioned relevant description and will not be repeated here.
[0720] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
[0721] The present embodiment provides a chip. The chip includes a processor configured to invoke a computer program stored in a memory to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar to those of the above-mentioned related embodiments and will not be further described here.
[0722] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0723] In one possible implementation, computer-readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium designed to carry or store the desired program code in the form of instructions or data structures and accessible by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave are used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and optical disk as used herein include optical disk, laser disk, optical disk, digital versatile disk (DVD), floppy disk and Blu-ray disk, where disks generally reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0724] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0725] The present application embodiment is described with reference to the flow chart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application.It should be understood that each process and / or box in the flow chart and / or block diagram and the combination of the process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable device to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing device produces the device for realizing the function specified in one process or multiple processes and / or one box or multiple boxes of flow chart.
[0726] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A text recognition method based on terminal equipment, It is characterized in that The method is applied to a terminal device, and the method comprises: Displaying a first interface; wherein the first interface includes a first window, and the first window displays a preview stream collected by the terminal device; the first interface includes a first button; When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface; In response to the second button in the first interface being triggered, a second interface is displayed; wherein the second interface includes a second window and a third window; the second window displays a preview stream collected by the terminal device, and the document frame in the current frame image in the preview stream is highlighted; when the current frame image of the preview stream includes the target text, a third button is displayed on the second interface; when the current frame image of the preview stream does not include the target text, the third button is not displayed on the second interface; the third window displays the first button and the fourth button; In response to the third button in the second interface being triggered, the third interface is displayed; wherein the third interface includes a fourth window and a fifth window; the third button is displayed on the third interface; the fourth window displays the second image in the preview stream, and the second image includes the highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays the fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window; In response to the first button in the second interface being triggered, the fourth interface is displayed; wherein the fourth interface displays the third image in the preview stream, and the document frame in the third image in the fourth interface is highlighted; the fourth interface includes a seventh button, an eighth button and a ninth button.
2. The method according to claim 1, It is characterized in that After displaying the third interface, the method further includes: In response to the third button in the third interface being triggered, the second interface is displayed.
3. The method according to claim 1 or 2, It is characterized in that After displaying the fourth interface, the method further includes: In response to the ninth button in the fourth interface being triggered, a fifth interface is displayed; wherein the fifth interface displays the third image in the preview stream; and the fifth interface includes at least one image processing button.
4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: When the object category of the first image is a text object, displaying the third button on the first interface; In response to the third button in the first interface being triggered, a third interface is displayed; wherein the third interface includes a fourth window and a fifth window; the third button is displayed on the third interface; the fourth window displays a second image in the preview stream, and the second image includes a highlighted target text; when the target text in the fourth window does not include an entity, the fifth window displays a fifth button; when the target text in the fourth window includes an entity, the fifth window displays the fifth button and at least one sixth button, and the sixth button corresponds one-to-one to the entity in the target text in the fourth window; In response to a third button in the third interface being triggered, the first interface is displayed.
5. The method according to claim 4, It is characterized in that The method further comprises: In response to the third button in the first interface being triggered, the seventh interface is displayed; wherein the seventh interface includes a seventh window; the seventh window displays the preview stream, and the second prompt information is displayed on the seventh window; the third button is not displayed on the seventh interface, and the seventh interface includes the first button.
6. The method according to claim 4 or 5, It is characterized in that When the object category of the first image is a text object, before displaying the third button on the first interface, the method further includes: when it is determined that the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode and displaying a first icon on the first interface; When the object category of the first image is a text object, displaying the third button on the first interface includes: when the object category of the first image is a text object, displaying the third button on the first interface and not displaying the first icon.
7. The method according to claim 4 or 5, It is characterized in that When the object category of the first image is a text object, before displaying the third button on the first interface, the method further includes: when it is determined that the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode; When the object category of the first image is a text object, displaying the third button on the first interface includes: When the object category of the first image is a text object, at a first moment, displaying the third button on the first interface; At a second moment, the first icon is displayed on the first interface, and the third button is not displayed; wherein the second moment is later than the first moment; At a third moment, the third button is displayed on the first interface, and the first icon is not displayed; wherein the third moment is later than the second moment.
8. The method according to any one of claims 1 to 7, It is characterized in that The third interface also includes a seventh button.
9. The method according to any one of claims 1 to 8, It is characterized in that When the number of entities in the second image is greater than a preset number, the number in the sixth button is the preset number minus 1, and the fifth window further displays a tenth button.
10. The method according to any one of claims 1 to 9, It is characterized in that The arrangement order of the sixth button in the fifth window and the arrangement order of the entities in the second image correspond to each other; or, the arrangement order of the sixth button in the fifth window is determined in real time based on the user portrait or the user intention.
11. The method according to any one of claims 1 to 10, It is characterized in that The sixth button corresponds to at least one function, the function has a priority, and the priority of the function is determined in real time based on the user portrait or the user intention; The method further includes: in response to the sixth button being triggered, calling a function with the highest priority corresponding to the sixth button.
12. The method according to any one of claims 1 to 11, It is characterized in that The entity displayed in the fourth window in the third interface corresponds to at least one first option, the first option has a priority, and the priority of the first option is determined in real time based on a user portrait or a user intention; The priority of the first option of the entity and the priority of the function of the sixth button corresponding to the entity correspond one to one; The method further includes: in response to the entity in the fourth window being triggered, displaying a first service menu corresponding to the entity in the fourth window; wherein the first service menu includes at least one first option, and the first options in the first service menu are sorted according to the priority of the first options.
13. The method according to any one of claims 1 to 12, It is characterized in that The method further comprises: In response to the non-entity in the fourth window being triggered, a second service menu corresponding to the non-entity is displayed on the fourth window; wherein the second service menu includes at least one second option.
14. The method according to any one of claims 1 to 13, It is characterized in that When the object category of the first image in the preview stream is a document object, before displaying the second button on the first interface, the method further includes: when the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode and displaying the first icon on the first interface; When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface includes: when the object category of the first image in the preview stream is a document object, displaying the second button on the first interface and not displaying the first icon.
15. The method according to any one of claims 1 to 13, It is characterized in that When the object category of the first image in the preview stream is a document object, before displaying the second button on the first interface, the method further includes: when the distance between the camera of the terminal device and the physical object is less than a first threshold, turning on the super macro mode, When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface includes: When the object category of the first image in the preview stream is a document object, at a first moment, displaying the second button on the first interface; At a second moment, the first icon is displayed on the first interface, and the second button is not displayed; wherein the second moment is later than the first moment; At a third moment, the second button is displayed on the first interface, and the first icon is not displayed; wherein the third moment is later than the second moment.
16. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area; The second image displayed in the third interface includes the first area but not the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
17. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes a first area and a second area, the first area is an area formed by text blocks of the target text, and the second area is a peripheral area of the first area; The second image displayed in the third interface includes the first area but does not include the second area; the text block of the target text in the first area of the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the direction of the text block of the target text in the second image displayed in the third interface is adapted to the screen direction of the terminal device.
18. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes at least one third area and a fourth area, wherein the third area is an area formed by a text block of the target text; a distance between two third areas in at least one pair of adjacent third areas is greater than a preset distance; and the fourth area is a peripheral area of an area formed by the at least one third area; The second image displayed in the third interface includes the at least one third area but does not include the fourth area, and the text block of the target text in the second image displayed in the third interface is highlighted; the distance between adjacent third areas in the second image displayed in the third interface is less than the preset distance; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
19. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes a fifth area and a sixth area, the fifth area is an area formed by text blocks of the target text and has a background image, and the sixth area is a peripheral area of the fifth area; The second image displayed in the third interface includes the fifth area but does not include the sixth area, and a text block of a target text in the second image displayed in the third interface is highlighted.
20. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes a first area and a second area, the first area is an area formed by each text block of the target text, and the second area is a peripheral area of the first area; the directions of each text block of the target text in the second image in the preview stream include at least two different directions; The second image displayed in the third interface includes the first area but does not include the second area; the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the directions of each text block of the target text in the second image displayed in the third interface include at least two different directions, or the directions of each text block of the target text in the second image displayed in the third interface are consistent.
21. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes at least one third area and a fourth area, the third area is an area formed by text blocks of the target text; the distance between two third areas in at least one pair of adjacent third areas is greater than a preset distance; the fourth area is a peripheral area of the area formed by the at least one third area; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions; The second image displayed in the third interface includes the at least one third area but does not include the fourth area, and the text blocks of the target text in the second image displayed in the third interface are highlighted; the distances between adjacent third areas in the second image displayed in the third interface are smaller than the preset distance; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different; the directions of the text blocks of the target text in the second image displayed in the third interface are consistent.
22. The method according to any one of claims 1 to 15, It is characterized in that The second image in the preview stream includes a fifth area and a sixth area, the fifth area is an area formed by text blocks of the target text, and the fifth area has a background image, and the sixth area is a peripheral area of the fifth area; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions; The second image displayed in the third interface includes the fifth area but does not include the sixth area, and the text block of the target text in the second image displayed in the third interface is highlighted; the background color of the text block of the target text in the second image in the preview stream and the background color of the text block of the target text in the second image displayed in the third interface are different.
23. The method according to any one of claims 1 to 22, It is characterized in that At a fourth moment, in response to a first position on the fourth window being triggered, wherein the first position is an arbitrary position on the second image in the fourth window, the image on the fourth window is enlarged at a first ratio with the first position as a center point; At a fifth moment, in response to a second position on the fourth window being triggered, wherein the second position is an arbitrary position on the second image in the fourth window, the image on the fourth window is enlarged at a second ratio and with the second position as the center point; the fifth moment is later than the fourth moment; At a sixth moment, in response to a third position on the fourth window being triggered, wherein the third position is any position on the second image in the fourth window, the image on the fourth window is reduced to a size before the fourth moment; the sixth moment is later than the fifth moment.
24. The method according to any one of claims 1 to 22, It is characterized in that At a seventh moment, in response to a fourth position on the fourth window being triggered, wherein the fourth position is any position on the second image in the fourth window, the image on the fourth window is enlarged at a third ratio with the fourth position as a center point; At an eighth moment, in response to the fifth position on the fourth window being triggered, wherein the fifth position is any position on the second image in the fourth window, the size of the image on the fourth window is restored; the eighth moment is later than the seventh moment.
25. The method according to any one of claims 1 to 22, It is characterized in that At a ninth moment, in response to the first text block on the fourth window being triggered, the image on the fourth window is enlarged; the longest text block in the enlarged image after the ninth moment reaches the edge of the screen of the terminal device; At the tenth moment, in response to the sixth position on the fourth window being triggered, wherein the sixth position is any position on the second image in the fourth window, the image on the fourth window is restored to the original image size of the image; the tenth moment is later than the ninth moment.
26. The method according to any one of claims 1 to 22, It is characterized in that At the eleventh moment, in response to the second text block on the fourth window being triggered, the image on the fourth window is enlarged; the second text block in the enlarged image after the eleventh moment reaches the edge of the screen of the terminal device; At a twelfth moment, in response to the third text block on the fourth window being triggered, wherein the length of the third text block is less than the length of the second text block, the image on the fourth window is enlarged; the third text block in the enlarged image after the twelfth moment reaches the edge of the screen of the terminal device; the twelfth moment is later than the eleventh moment; At the thirteenth moment, in response to the third text block on the fourth window being triggered, the image on the fourth window is restored to the image size before the twelfth moment; the second text block in the reduced image after the thirteenth moment reaches the edge of the screen of the terminal device; the thirteenth moment is later than the twelfth moment; At the fourteenth moment, in response to the seventh position on the fourth window being triggered, wherein the seventh position does not have a target text, the image on the fourth window is restored to its original image size; the fourteenth moment is later than the eleventh moment.
27. The method according to any one of claims 1 to 26, It is characterized in that After the fourth interface is displayed, the method further includes: the terminal device displays the second interface in response to a seventh button on the fourth interface being triggered; After the fourth interface is displayed, the method further includes: in response to an eighth button on the fourth interface being triggered, the terminal device reacquires a frame of image in the preview stream.
28. A terminal device, It is characterized in that include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal device performs the method according to any one of claims 1 to 27.
29. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 27 is implemented.
30. A computer program product, It is characterized in that The method comprises a computer program which, when being executed, causes a computer to execute the method according to any one of claims 1 to 27.
Citation Information
Patent Citations
Text recognition method and device based on terminal device and storage medium
CN118609129A
Questioning method and device via shooting and intelligent equipment
CN105825721A
Text information extracting method and device
CN106527945A
Information extraction method, information extraction device and intelligent terminal
CN110489746A
Image processing method and device, computer equipment and storage medium
CN111126301A
