Text recognition method and device based on terminal device and storage medium
By designing the function of automatically identifying and extracting text in images on the terminal device, the problem of insufficient speed and accuracy in text information extraction in the existing technology is solved, fast and accurate text recognition and extraction is achieved, and user operation costs are reduced.
Patent Information
- Application Number
- CN202310252334.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-06
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 the design of a series of interfaces and buttons on the terminal device, text objects in images are automatically recognized and automatic extraction functions are provided, reducing user manual operations and improving the speed and accuracy of text recognition.
It achieves rapid and accurate recognition and extraction of text information in images in real-time scenes, reduces user operation costs, avoids conflicts when interacting with the camera, and improves text recognition efficiency.
Smart Images

Figure CN118609129A
Abstract
Description
Technical Field
[0001] 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
[0002] Terminal devices have become an important tool in people's lives. They can be used to capture images, extract text information from images, and then users can obtain text information.
[0003] 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. Summary of the invention
[0004] 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.
[0005] In a first aspect, an embodiment of the present application proposes a text recognition method based on a terminal device, the method is applied to the terminal device, and the method includes:
[0006] 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;
[0007] When the object category of the first image in the preview stream is a document object, displaying a second button on the first interface;
[0008] 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;
[0009] 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;
[0010] 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.
[0011] In this way, the document scanning function and the image processing function are provided. The text extraction function is provided.
[0012] In a possible implementation manner, after displaying the third interface, the method further includes:
[0013] In response to the third button in the third interface being triggered, the second interface is displayed.
[0014] In this way, click the "text extraction button" to return to the preview stream interface.
[0015] In a possible implementation manner, after displaying the fourth interface, the method further includes:
[0016] 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.
[0017] In this way, the function of image processing under document scanning is provided.
[0018] In a possible implementation, the method further includes:
[0019] When the object category of the first image is a text object, displaying the third button on the first interface;
[0020] 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;
[0021] In response to a third button in the third interface being triggered, the first interface is displayed.
[0022] In this way, a text extraction function is provided. Users no longer need to manually select the text to be recognized, which can prevent the text from being fleeting and the user from selecting the target text in time, thus causing the text to be missed. For example, in a conference PPT presentation, the speaker turns pages too quickly and the mobile phone viewfinder may not have time to select the target text. The text in the image can be recognized in a timely manner. In addition, users do not need to manually select the target text on the screen, which avoids conflicts with the interaction with the camera itself, affecting text recognition or affecting the captured image; and reduces the user's learning cost.
[0023] In a possible implementation, the method further includes
[0024] 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.
[0025] 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 acquired, the user can be prompted from the abnormal situation.
[0026] 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;
[0027] 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.
[0028] 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 is no longer displayed and the third button is displayed to avoid position conflict between the first icon and the third button.
[0029] 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;
[0030] When the object category of the first image is a text object, displaying the third button on the first interface includes:
[0031] When the object category of the first image is a text object, at a first moment, displaying the third button on the first interface;
[0032] 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;
[0033] 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.
[0034] In this way, when the super macro mode is triggered, if it is determined that the object category of the first image is a text object, the third button is displayed first; then the first icon is displayed and the third button is displayed to avoid position conflict between the first icon and the third button, and the user is reminded 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.
[0035] In a possible implementation, the third interface also includes a seventh button.
[0036] 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 also displays a tenth button.
[0037] In a 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.
[0038] In a 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.
[0039] In this way, when the first button is triggered, the function with the highest priority corresponding to the sixth button can be directly called, thereby reducing user operations.
[0040] In a possible implementation, 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 the user portrait or 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;
[0041] 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.
[0042] 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.
[0043] In a possible implementation, it is characterized in that the method further includes:
[0044] 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.
[0045] 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 and displaying the first icon on the first interface;
[0046] 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.
[0047] 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 is no longer displayed and the second button is displayed to avoid position conflict between the first icon and the second button.
[0048] 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,
[0049] 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:
[0050] 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;
[0051] 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;
[0052] 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.
[0053] 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 is displayed and the second button is displayed to avoid position conflict between the first icon and the second button, and the user is reminded 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.
[0054] 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;
[0055] 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.
[0056] In this way, the area of non-target text can be removed, making it easier for users to view the target text.
[0057] 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;
[0058] 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.
[0059] In this way, the area of non-target text can be removed, which is convenient for users to view the target text. The direction of the text block is adapted to the screen direction of the terminal device, which is convenient for users to view the target text.
[0060] In a possible implementation, 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 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;
[0061] 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.
[0062] In this way, the area of non-target text can be removed, making it easier for users to view the target text.
[0063] In a possible implementation, 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;
[0064] 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.
[0065] In this way, the non-target text area can be removed and the background image can be retained, so that the user can see the target text and the background of the text block more easily.
[0066] 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; the directions of the text blocks of the target text in the second image in the preview stream include at least two different directions;
[0067] 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.
[0068] In this way, the area of non-target text can be removed, making it easier for users to view the target text.
[0069] In a possible implementation, 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;
[0070] 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.
[0071] In this way, the area of non-target text can be removed, which is convenient for users to view the target text. The direction of the text block is adapted to the screen direction of the terminal device, which is convenient for users to view the target text.
[0072] In a possible implementation, 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;
[0073] 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.
[0074] In this way, the non-target text area can be removed and the background image can be retained, so that the user can see the target text and the background of the text block more easily.
[0075] In a possible implementation, 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;
[0076] 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;
[0077] 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.
[0078] 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.
[0079] In a possible implementation, 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;
[0080] 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.
[0081] In this way, by enlarging the image and then restoring the image, it is convenient for users to view the details of the image and text.
[0082] 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; the longest text block in the enlarged image after the ninth moment reaches the edge of the screen of the terminal device;
[0083] 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.
[0084] In this way, by triggering the text block, the image is enlarged in a way 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 the original image size.
[0085] 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; the second text block in the enlarged image after the eleventh moment reaches the edge of the screen of the terminal device;
[0086] 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;
[0087] 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;
[0088] 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.
[0089] In this way, by enlarging the text block, it is convenient for users to view the details of the image and text block.
[0090] In a possible implementation manner, after displaying the fourth interface, the method further includes:
[0091] In response to the seventh button on the fourth interface being triggered, the terminal device displays the second interface.
[0092] In a possible implementation manner, after displaying the fourth interface, the method further includes:
[0093] In response to the eighth button on the fourth interface being triggered, the terminal device reacquires a frame of image in the preview stream.
[0094] In a second aspect, an embodiment of the present application provides 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 function, 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 smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0095] The terminal device comprises: 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.
[0096] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.
[0097] 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 executed, the computer executes the method of the first aspect.
[0098] 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.
[0099] 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
[0100] Figure 1 A schematic diagram of the structure of the terminal device 100 is shown;
[0101] Figure 2 is a software structure block diagram of the terminal device 100 according to an embodiment of the present application;
[0102] Figure 3 A flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application Figure 1 ;
[0103] Figure 4 Schematic diagram of the process of detecting the content object of an image in the method provided in the embodiment of the present application Figure 1 ;
[0104] Figure 5 Schematic diagram of the process of detecting the content object of an image in the method provided in the embodiment of the present application Figure 2 ;
[0105] Figure 6 Interface diagram provided for the embodiment of the present application Figure 1 ;
[0106] Figure 7 Interface diagram provided for the embodiment of the present application Figure 2 ;
[0107] Figure 8 Interface diagram provided for the embodiment of the present application Figure 3 ;
[0108] Fig. 9 Interface diagram provided for the embodiment of the present application Figure 4 ;
[0109] Fig.10 Interface diagram provided for the embodiment of the present application Figure 5 ;
[0110] Fig.11 Interface diagram provided for the embodiment of the present application Figure 6 ;
[0111] Fig.12Interface diagram provided for the embodiment of the present application Figure 7 ;
[0112] Fig.13 Interface diagram provided for the embodiment of the present application Figure 8 ;
[0113] Fig.14 Interface diagram provided for the embodiment of the present application Figure 9 ;
[0114] Fig.15 Interface diagram provided for the embodiment of the present application Figure 10 ;
[0115] Fig.16 Interface diagram provided for the embodiment of the present application Figure 10 one;
[0116] Fig.17 Interface diagram provided for the embodiment of the present application Figure 10 two;
[0117] Fig.18 Interface diagram provided for the embodiment of the present application Figure 10 three;
[0118] Fig.19 Interface diagram provided for the embodiment of the present application Figure 10 Four;
[0119] Fig. 20 Interface diagram provided for the embodiment of the present application Figure 10 five;
[0120] Fig.21 Interface diagram provided for the embodiment of the present application Figure 10 six;
[0121] Fig. 22 Interface diagram provided for the embodiment of the present application Figure 10 seven;
[0122] Fig.23 Interface diagram provided for the embodiment of the present application Figure 10 eight;
[0123] Fig.24 Interface diagram provided for the embodiment of the present application Figure 10 Nine;
[0124] Fig.25 Interface diagram provided for the embodiment of the present application Figure 2 ten;
[0125] Fig.26 Interface diagram provided for the embodiment of the present application Figure 2 eleven;
[0126] Fig. 27 Interface diagram provided for the embodiment of the present application Figure 2 twelve;
[0127] Fig.28 Interface diagram provided for the embodiment of the present application Figure 2 Thirteen;
[0128] Fig.29 Interface diagram provided for the embodiment of the present application Figure 2 fourteen;
[0129] Fig.30 Interface diagram provided for the embodiment of the present application Figure 2 fifteen;
[0130] Fig.31 Interface diagram provided for the embodiment of the present application Figure 2 sixteen;
[0131] Fig.32 Interface diagram provided for the embodiment of the present application Figure 2 XVII;
[0132] Fig.33 Interface diagram provided for the embodiment of the present application Figure 2 eighteen;
[0133] Fig.34 Interface diagram provided for the embodiment of the present application Figure 2 nineteen;
[0134] Fig.35 Interface diagram provided for the embodiment of the present application Figure 3 ten;
[0135] Fig.36 Interface diagram provided for the embodiment of the present application Figure 3 eleven;
[0136] Fig.37 Interface diagram provided for the embodiment of the present application Figure 3 twelve;
[0137] Fig.38 Interface diagram provided for the embodiment of the present application Figure 3 Thirteen;
[0138] Fig.39 Interface diagram provided for the embodiment of the present application Figure 3 fourteen;
[0139] Fig.40 Interface diagram provided for the embodiment of the present application Figure 3 fifteen;
[0140] Fig.41Interface diagram provided for the embodiment of the present application Figure 3 sixteen;
[0141] Fig.42 Interface diagram provided for the embodiment of the present application Figure 3 XVII;
[0142] Fig.43 Interface diagram provided for the embodiment of the present application Figure 3 eighteen;
[0143] Fig.44 Interface diagram provided for the embodiment of the present application Figure 3 nineteen;
[0144] Fig.45 Interface diagram provided for the embodiment of the present application Figure 4 ten;
[0145] Fig.46 Interface diagram provided for the embodiment of the present application Figure 4 eleven;
[0146] Fig.47 Interface diagram provided for the embodiment of the present application Figure 4 twelve;
[0147] Fig.48 Interface diagram provided for the embodiment of the present application Figure 4 Thirteen;
[0148] Fig.49 Interface diagram provided for the embodiment of the present application Figure 4 fourteen;
[0149] Fig.50 Interface diagram provided for the embodiment of the present application Figure 4 fifteen;
[0150] Fig.51 A schematic diagram of the software layer of a terminal device provided in an embodiment of the present application;
[0151] Fig.52 A flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application Figure 2 ;
[0152] Fig.53 Interface diagram provided for the embodiment of the present application Figure 4 sixteen;
[0153] Fig.54 A flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application Figure 3 ;
[0154] Fig.55 Interface diagram provided for the embodiment of the present application Figure 4 XVII;
[0155] Fig.56 Interface diagram provided for the embodiment of the present application Figure 4 eighteen;
[0156] Fig.57 The figure shows a schematic diagram of the structure of a chip provided in an embodiment of the present application;
[0157] Fig.58 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0158] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0159] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" 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: A exists alone, A and B exist at the same time, and B exists 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" or similar expressions refers to any combination of these items, including any combination of single 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.
[0160] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.
[0161] Terminal devices have become an important tool in people's lives. They can be used to capture images, extract text information from images, and then users can obtain text information.
[0162] Therefore, there is an urgent need for a solution that can obtain the text in the image in a timely and rapid manner, so as to avoid missing the text in the real-time image.
[0163] Electronic devices include terminal devices, which may also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Terminal devices may be mobile phones, smart TVs, wearable devices, tablet computers (Pad), 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 used by the terminal devices.
[0164] In order to better understand the embodiment of the present application, the structure of the terminal device in the embodiment of the present application is introduced below:
[0165] Figure 1 The structure diagram of the terminal device 100 is shown. 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 screen 194, and a subscriber identification module (SIM) card interface 195, etc. 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.
[0166] It is understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0167] 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 processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.
[0168] 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.
[0169] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0170] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuits 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, etc.
[0171] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the terminal device 100.
[0172] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is a schematic illustration 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 in the above embodiments, or a combination of multiple interface connection methods.
[0173] 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.
[0174] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which 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, which execute program instructions to generate or change display information.
[0175] Display screen 194 is used to display images, videos, etc.
[0176] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0177] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0178] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or 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.
[0179] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0180] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0181] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0182] 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 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0183] 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.
[0184] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0185] The software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device 100.
[0186] Figure 2 It is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.
[0187] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0188] The application layer can include a series of application packages.
[0189] like Figure 2 As shown, the application package may include applications such as camera, calendar, phone, map, call, music, settings, mailbox, video, social, etc.
[0190] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0191] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a resource manager, a view system, a notification manager, and the like.
[0192] 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, capture the screen, etc.
[0193] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0194] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0195] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0196] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.
[0197] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0198] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0199] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0200] The system library may 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.
[0201] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0202] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0203] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0204] A 2D graphics engine is a drawing engine for 2D drawings.
[0205] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0206] The following is an illustrative description of the software and hardware workflow of the terminal device 100 in conjunction with a scenario where an application is started or an interface switch occurs in an application.
[0207] 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 strength, timestamp of the touch operation, 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 single-click operation and the control corresponding to the single-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.
[0208] The solution provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0209] Figure 3 A flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application Figure 1 ,like Figure 3 As shown, the method includes:
[0210] S301, the terminal device opens a camera application and displays 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. 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 frame.
[0211] 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.
[0212] Wherein, if the object category of the image is a text object, it means that the captured image includes the target text and the captured image is not a document.
[0213] The object category of the image is a document object, which indicates that the captured image is a document and includes the target text.
[0214] If the object category of the image is a non-text object, it means that the acquired image does not include the target text.
[0215] Exemplarily, the execution subject of this embodiment is a terminal device, which has a camera application.
[0216] The user triggers the terminal device to open the camera application. The terminal device captures the 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 the 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.
[0217] In the process of obtaining the preview stream based on the camera application, the terminal device continuously detects image frames and generates the preview stream at a preset speed, for example, generating the preview stream at a speed of 20 frames / second, or generating the preview stream at a speed of 60 frames / second.
[0218] In the process of generating a preview stream in real time, 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 identifies the object category of the first image to determine whether the object category of the first image is a text object, a document object, or a non-text object. For example, in the process of generating a preview stream in real time, the terminal device samples a frame of image at a detection frequency of 5 frames to obtain the first image, and the terminal device detects the first image to determine the object category of the first image. Among them, detection is performed once every 5 frames, i.e., detection is performed once every 250 milliseconds.
[0219] “Identifying the object category of the acquired first image” may be implemented in any of the following ways:
[0220] The first implementation method. Figure 4 Schematic diagram of the process of detecting the content object of an image in the method provided in the embodiment of the present application Figure 1 ,like Figure 4 As shown, the detection process includes:
[0221] 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.
[0222] Step S42: The terminal device extracts the image in the preview stream at a preset detection frequency to obtain the 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.
[0223] Step S43: The terminal device performs text detection on the current image frame by using text detection technology to determine whether the current frame image includes the target text.
[0224] The "target text" refers to a text of a preset category. The preset category includes one or more of the following: preset language, preset font information, no language restriction and no font restriction, etc. The "preset font information" includes one or more of the following: preset font type, preset font size, preset font type (e.g., print, handwriting), preset font color, etc.
[0225] "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", includes: 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.
[0226] Among them, 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 information of the preset category 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 currently used by the terminal device, the font used, the glyph used, and the font glyph of the text entered by the user in history. Another way is that the terminal device automatically determines the preset category based on the historical selection of the user when selecting the text on the image in the "text recognition method based on the terminal device" provided by this scheme; 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.
[0227] If the preset category is "no language restriction and no font 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.
[0228] 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.
[0229] The terminal device performs document detection on the current frame image, and the terminal device determines whether the document is detected based on one or more of the edge detection information, the ratio value information of the frame to be analyzed to the frame, and the positional relationship between the center point of the frame and the frame to be analyzed. If the terminal device determines that the edge detection information meets the first condition, the ratio value information of the frame to be analyzed to the frame meets the second condition, and the positional relationship between the center point of the frame and the frame to be analyzed meets the third condition, and one or more of the three meet their respective conditions, then it is determined that the document is detected; otherwise, the terminal device determines that the document is not detected.
[0230] The “edge detection information” represents the number of detected edges and / or the number of detected corners.
[0231] 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.
[0232] The terminal device may perform edge detection on the current frame image to obtain the number of edges. For example, edge detection may be performed on the current frame image using an edge detection algorithm to obtain the number of edges.
[0233] The terminal device performs edge detection on the current frame image, and based on the result of edge detection, determines whether the edge forms an angle, and obtains the number of angles. For example, the edge detection algorithm is used to perform edge detection on the current frame image to determine whether an edge is detected; then, whether the edges intersect is calculated to determine whether an angle is detected.
[0234] After the "edge detection information" is obtained, one or more frames to be analyzed are obtained based on the edges in the "edge detection information". For example, four edges are obtained, and the four edges constitute a frame to be analyzed 1; and the other four edges are obtained, and the other four edges constitute a frame to be analyzed 2.
[0235] "The proportion value information of the frame to be analyzed in the viewfinder" represents the proportion of the frame to be analyzed in the viewfinder. When the first image is obtained by capturing an image through a camera application, the viewfinder is the viewfinder when the terminal device captures the image 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 obtained through a screenshot application, the viewfinder is the size of the first image.
[0236] The "second condition" corresponding to the "ratio value information of the frame to be analyzed to the frame" is a value represented by the ratio value information, which is greater than or equal to the preset ratio threshold. The preset ratio threshold is a preset value, for example, the preset ratio threshold is 80%, or the preset ratio threshold is 70%.
[0237] The "positional relationship between the center point of the framing frame and the frame to be analyzed" characterizes 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 into 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 into 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 into the preset area in the frame to be analyzed. The "preset area" here may be a preset shape area centered on the center point of the frame to be analyzed; for example, the "preset area" may be a preset circular area centered on the center point of the frame to be analyzed; or, the "preset area" here may be a preset rectangular area centered on the center point of the frame to be analyzed.
[0238] 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.
[0239] 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.
[0240] 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.
[0241] 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.
[0242] The detection process of steps S41-S47 is a preview stream scene recognition model.
[0243] The second implementation method. Figure 5 Schematic diagram of the process of detecting the content object of an image in the method provided in the embodiment of the present application Figure 2 ,like Figure 5 As shown, the detection process includes:
[0244] Step S51: 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.
[0245] Step S52: The terminal device extracts the image in the preview stream at a preset detection frequency to obtain the 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.
[0246] Step S53: The terminal device determines whether a document is detected.
[0247] Among them, step S53 can refer to the above-mentioned step S44 and will not be repeated here.
[0248] 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.
[0249] 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.
[0250] Among them, step S55 can refer to the above step S43 and will not be repeated here.
[0251] 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.
[0252] 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.
[0253] S302: When the object category of the first image is a document object, the terminal device displays a second button on the first interface.
[0254] Exemplarily, when the terminal device starts the camera application, the terminal device displays a first interface in real time, the first interface includes a first window, and the first window displays each current frame image in the preview stream collected 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.
[0255] Among them, 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.
[0256] 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.
[0257] The preview button is a button for being triggered to preview an image in a camera application.
[0258] The switch button is a button used to be triggered to switch between the front camera and the rear camera.
[0259] The first interface also includes at least one multiple button, which is a button for adjusting the display size of the image in the preview stream. For example, the multiple buttons include: "0.5" button, "1" button, "5" button, and "10" button.
[0260] After step S301, when the terminal device determines that the first image in the captured preview stream is a document object, a second button is displayed on the first interface. The second button is a document scanning animation button; the second button is a button for being triggered to scan the document in the image. "Document Scan" is displayed on the second button to facilitate the user to determine the function of the second button.
[0261] The second button is an animated button; the second button can have an expanded state and a collapsed state. Moreover, when the second button is displayed for the first time, 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 then the terminal device moves the second button on the first interface in response to the user's dragging operation.
[0262] 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.
[0263] Figure 6 Interface diagram provided for the embodiment of the present application Figure 1 ,like Figure 6 As shown in (a) of FIG. 1 , 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. Figure 6 As shown in (b) of FIG. 1 , 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. Figure 6 In (b), the second button 606 is in the expanded state.
[0264] Figure 7 Interface diagram provided for the embodiment of the present application Figure 2 ,like Figure 7 As shown in (a), Figure 7 (a) is the above Figure 6 (b) in FIG. 6 ; the second button 606 is an animated button. Figure 7 In (a), the second button 606 is in the expanded state. Figure 7 As shown in (b), if the second button 606 is not triggered within the preset time, the second button 606 is in the retracted state.
[0265] 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 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, 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.
[0266] Exemplarily, in response to the second button on the first interface being triggered, the terminal device displays the second interface. The second interface includes a second window and a third window. The second window displays a preview stream collected 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.
[0267] The third window displays a first button, a preview button, and a fourth button. The fourth button is a button for being triggered to exit document scanning. "Document Scanning ×" is displayed on the fourth button to facilitate the user to determine the function of the fourth button.
[0268] At least one shooting-related setting button may also be displayed on the second interface. The at least one shooting-related setting button on the second interface includes: an AI shooting button, a flash button, an image mode button, and the like.
[0269] 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.
[0270] The terminal device needs to detect in real time whether the current frame image of the preview stream in the second window has the target text.
[0271] The "target text" refers to a text of a preset category. The preset category includes one or more of the following: preset language, preset font information, no language restriction and no font restriction, etc. The "preset font information" includes one or more of the following: preset font type, preset font size, preset font type (e.g., print, handwriting), preset font color, etc.
[0272] Among them, 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 information of the preset category 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 currently used by the terminal device, the font used, the glyph used, and the font glyph of the text entered by the user in history. Another way is that the terminal device automatically determines the preset category based on the historical selection of the user when selecting the text on the image in the "text recognition method based on the terminal device" provided by this scheme; 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.
[0273] If the preset category is "no language restriction and no font 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.
[0274] 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 in the detection process, the terminal device requires that the text is a preset category of text to detect whether the current frame image of the preview stream in the second window includes the target text.
[0275] 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 the third button is a button for being triggered to extract text from the image. "Text extraction" is displayed on the third button to facilitate the user to determine the function of the third button.
[0276] The third button is an animated button; the third button can have an expanded state and a collapsed state. Moreover, when the third button is displayed for the first time, 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 then the terminal device moves the third button on the second interface in response to the user's dragging operation.
[0277] 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 the terminal device displays the third button on the second interface regardless of whether the target text is detected.
[0278] Figure 8 Interface diagram provided for the embodiment of the present application Figure 3 ,like Figure 8 As shown in (a), Figure 8 (a) is the above Figure 6 (a) Figure 8 (b) is the above Figure 6 (b) in .
[0279] User in Figure 8 The second button 606 is triggered on the first interface in (b), such as Figure 8 As shown in (c) of FIG. 1 , the terminal device displays a second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream collected 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. When the terminal device determines that the current frame image of the preview stream displayed in the second window 502 includes the target text, Figure 8 As shown in (c) in FIG. 5 , the terminal device displays a third button 607 on the second interface. The third window 503 displays a first button 601, a preview button 604, and a fourth button 608, and “Document Scan×” is displayed on the fourth button 608. There may also be at least one shooting-related setting button 602 on the first interface.
[0280] Alternatively, the user Figure 8 The second button 606 is triggered on the first interface in (b), such as Figure 8 As shown in (d) in FIG. 1 , the terminal device displays a second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream collected 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. When 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, Figure 8 As shown in (d) in FIG. 5 , 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, and the fourth button 608 displays "Document Scan ×". There may also be at least one shooting-related setting button 602 in the first interface.
[0281] 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.
[0282] In one example, the third interface also includes a seventh button.
[0283] 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.
[0284] 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.
[0285] 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 also displays a tenth button.
[0286] In one example, 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.
[0287] 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". Then the user can trigger the third button on the second interface.
[0288] Then, in response to the third button in the second interface being triggered, the terminal device displays the third interface. The third interface includes the fourth window and the fifth window. And the third button is displayed on the third interface; the third button is in the retracted state or the expanded state.
[0289] Since the user triggers the third button on the second interface, the terminal device can collect the current frame image in the preview stream at the time when the third button is triggered in real time, and then obtain a second image. Therefore, the terminal device displays the second image in the preview stream in the fourth window. At this time, the terminal device displays a frame of the second image in the fourth window of the third interface. Among them, the second image here, the first image mentioned above, and the image in step S303 are images at different times in the preview stream.
[0290] Furthermore, the terminal device detects the target text in the second image in real time, and the “target text” is as described above. If the terminal device detects that the second image has the target text, the target text in the second image is highlighted in the fourth window of the third interface.
[0291] It can be seen that the fourth window is the "text display area".
[0292] In one example, the terminal device displays the second image of the preview stream in the second window of the second interface in real time. The terminal device does not process the second image on 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 an area formed by the text blocks of the target text, and the second area is a 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.
[0293] In response to the third button in the second interface being triggered, the terminal device determines the minimum external matrix formed by each text block in the second image; the terminal device crops the second image according to the size of the minimum external matrix, and crops the peripheral area of the second image that is located before the minimum external matrix. The terminal device can retain part of the area around the periphery of the minimum external 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 each text block and the edge of the image; the distance can be set to a fixed number of pixels, and the number of pixels is an empirical value; or, the distance is a proportion of the length of the text block corresponding to the distance.
[0294] Thus, the second image displayed by the terminal device in the third interface includes the first area but does not include the second area. Furthermore, the terminal device highlights each text block of the target text in the first area. Furthermore, the terminal device sets the background color of the text block of the target text in the first area to a preset color (e.g., 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.
[0295] 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. For example, based on the width of the cropped second image, the cropped second image fills 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 fills the fourth window so that the cropped second image reaches the edge of the fourth window in the height direction.
[0296] Furthermore, during the process of the terminal device detecting the target text in the second image in real time, the terminal device identifies entities in the target text. It can be seen that the target text includes entities and / or non-entities. Among them, entities include the following entities: email address, ID number, courier number, flight number, website, telephone number, address, etc.
[0297] When the terminal device detects that the target text in the second image in the fourth window does not include any entity, the terminal device displays a fifth button in the fifth window, which 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. In addition, the terminal device displays a seventh button on the third interface, which 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.
[0298] 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 corresponding one-to-one to the entity in the target text in the second image. Among them, 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 the sixth button displays the information of the entity corresponding to the sixth button. In addition, the terminal device displays the seventh button on the third interface, and the seventh button is a button for displaying the prompt information "Long press to select text", and the seventh button displays "Long press to select text". Among them, 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.
[0299] 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.
[0300] 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.
[0301] 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.
[0302] If the number of entities in the second image is greater than the preset number, the terminal device may display M-1 sixth buttons in the fifth window. At the same time, the terminal device displays a tenth button in the fifth window, which is a button for being 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); "...more" is displayed on the tenth button. The terminal device displays the tenth button at the end of the M-1 sixth buttons.
[0303] 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.
[0304] 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, displays a sixth button on the fifth window, and the sixth button displays AA City BB District CC Road DD. The email entity www.***@**.com displays a sixth button on the fifth window, and the sixth button displays www.***@**.com.
[0305] Alternatively, for each sixth button, since it is necessary to display the information of the entity corresponding to the sixth button on the sixth button. For the sake of aesthetics or for the effective use of the position of the interface, the key information of the entity can be displayed on the sixth button. Among them, the terminal device can determine the key information of the entity according to the preset display method; or, the terminal device determines the key information of the entity according to the user's intention or user portrait, etc. For example, the telephone entity 86 158********, a sixth button is displayed on the fifth window, and 158******** is displayed on the sixth button. The website entity www.****@**.com, a sixth button is displayed on the fifth window, and ****@**.com is displayed on the sixth button. The address entity AA City BB District CC Road DD, a sixth button is displayed on the fifth window, and BB District CC Road DD is displayed on the sixth button. The email entity www.***@**.com, a sixth button is displayed on the fifth window, and ***@**.com is displayed on the sixth button.
[0306] 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 may 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.
[0307] Alternatively, the terminal device may dynamically sort the order of the sixth buttons in the fifth window according to the user's user portrait, user intention, user preference, and other information. The terminal device may determine the user's user portrait, user intention, and user preference according to the user's personal information and the number of times the user uses the entity. The user's personal information includes the user's gender, user age, and the like. The number of times the user uses the entity, for example, is the number of times the user opens a website, the number of times the user makes a phone call, the number of times the user sends an email, and the like.
[0308] Fig. 9 Interface diagram provided for the embodiment of the present application Figure 4 ,like Fig. 9 As shown in (a), 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.
[0309] like Fig. 9 As shown in (b) of FIG. 1 , 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 is a "document scanning animation button". The second button 606 has an expanded state and a collapsed state. Fig. 9 In (b), the second button 606 is in the expanded state.
[0310] User in Fig. 9 The second button 606 is triggered on the first interface in (b), such as Fig. 9 As shown in (c) in the figure, the terminal device displays a second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream collected by the terminal device. The terminal device detects in real time whether the current frame image of the preview stream displayed by the second window 502 includes the target text. When the terminal device determines that the current frame image of the preview stream displayed by the second window 502 includes the target text, the terminal device displays a third button 607 on the second interface, and the third button is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig. 9 In (c), the third button 607 is in an expanded state. The third window 503 displays the first button 601, the preview button 604, and the fourth button 608, and the fourth button 608 displays "Document Scan ×". The first interface may also include at least one shooting-related setting button 602. Fig. 9The image shown in (c) is the second image.
[0311] User in Fig. 9 The third button 607 is triggered on the second interface in (c), such as Fig. 9 As shown in (d) in FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig. 9 In (d), the third button 607 is in the collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted, and 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. "Copy All" is displayed on the fifth button 609; 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 "Long Press to Select Text" is displayed on the seventh button 611, which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0312] The sixth button displays complete information of the entity corresponding to the sixth button. Fig. 9 As shown in (d) in the figure, the telephone 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.
[0313] Fig.10 Interface diagram provided for the embodiment of the present application Figure 5 ,like Fig.10 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.10 (a) in , see Fig. 9(a) in .
[0314] like Fig.10 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.10 (b) in , see Fig. 9 (b) in .
[0315] User in Fig.10 The second button 606 is triggered on the first interface in (b), such as Fig.10 As shown in (c), the terminal device displays the second interface. Fig.10 (c) in , see Fig. 9 (c) in .
[0316] User in Fig.10 The third button 607 is triggered on the second interface in (c), such as Fig.10 As shown in (d) in FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig.10 In (d), the third button 607 is in the collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted, and 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. "Copy All" is displayed on the fifth button 609; 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 "Long Press to Select Text" is displayed on the seventh button 611, which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0317] The sixth button displays key information of the entity corresponding to the sixth button. Fig.10As shown in (d) in the figure, the telephone entity 86 158******** displays a sixth button 610 on the fifth window 505, and 158******** is displayed on the sixth button 610. The website entity www.****@**.com displays a sixth button 610 on the fifth window 505, and ****@**.com is displayed on the sixth button 610. The address entity AA City BB District CC Road DD Number displays a sixth button 610 on the fifth window 505, and BB District CC Road DD Number displays on the sixth button 610. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and ***@**.com is displayed on the sixth button 610.
[0318] Fig.11 Interface diagram provided for the embodiment of the present application Figure 6 ,like Fig.11 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.11 (a) in , see Fig. 9 (a) in .
[0319] like Fig.11 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.11 (b) in , see Fig. 9 (b) in .
[0320] User in Fig.11 The second button 606 is triggered on the first interface in (b), such as Fig.11 As shown in (c), the terminal device displays the second interface. Fig.11 (c) in , see Fig. 9 (c) in .
[0321] User in Fig.11 The third button 607 is triggered on the second interface in (c), such as Fig.11 As shown in (d) in FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig.11In (d), the third button 607 is in the retracted 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 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. "Copy All" is displayed on the fifth button 609; 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 "Long Press to Select Text" is displayed on the seventh button 611, which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0322] 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. Fig.11 As shown in (d) in the figure, the telephone 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 610 on the fifth window 505, and the sixth button 610 displays ****@**.com. The address entity AA City BB District CC Road DD Number displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays BB District CC Road DD Number. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays ***@**.com. The tenth button 612 is displayed on the fifth window.
[0323] User in Fig.11 The tenth button 612 is triggered on the fifth window 505 of the third interface in (d), such as Fig.11 As shown in (e) of FIG. 1 , the terminal device displays the remaining sixth buttons 610 that are 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.
[0324] Fig.12 Interface diagram provided for the embodiment of the present application Figure 7 ,like Fig.12As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.12 (a) in , see Fig. 9 (a) in .
[0325] like Fig.12 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.12 (b) in , see Fig. 9 (b) in .
[0326] User in Fig.12 The second button 606 is triggered on the first interface in (b), such as Fig.12 The terminal device shown in (c) displays the second interface. Fig.12 (c) in , see Fig. 9 (c) in .
[0327] User in Fig.12 The third button 607 is triggered on the second interface in (c), such as Fig.12 As shown in (d) in FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig.12 In (d), the third button 607 is in the retracted 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 the 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.
[0328] S305: In response to the third button in the third interface being triggered, the terminal device displays the second interface.
[0329] Exemplarily, after step S304, the user triggers the third button "text extraction animation button" on the third interface, then the terminal device exits the third interface, and the terminal device displays the second interface. The second interface includes a second window and a third window. The second window displays a preview stream collected 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.
[0330] 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 the third button is a button for being triggered to extract text from the image. "Text extraction" is displayed on the third button to facilitate the user to determine the function of the third button.
[0331] The third button is an animated button; the third button can have an expanded state and a collapsed state. Moreover, when the third button is displayed for the first time, 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 then the terminal device moves the third button on the second interface in response to the user's dragging operation.
[0332] 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.
[0333] 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.
[0334] 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.
[0335] Fig.13 Interface diagram provided for the embodiment of the present application Figure 8 ,like Fig.13 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.13 (a) in , see Fig. 9 (a) in .
[0336] like Fig.13As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.13 (b) in , see Fig. 9 (b) in .
[0337] User in Fig.13 The second button 606 is triggered on the first interface in (b), such as Fig.13 As shown in (c), the terminal device displays the second interface. Fig.13 (c) in , see Fig. 9 (c) in .
[0338] User in Fig.13 The third button 607 is triggered on the second interface in (c), such as Fig.13 As shown in (d), the terminal device displays the third interface. Fig.13 (d) in, see Fig. 9 (d) or see Fig.10 (d) or see Fig.11 (d) or see Fig.12 (d) in.
[0339] User in Fig.13 In (d), the third button 607 is triggered on the third interface, such as Fig.13 As shown in (e), the terminal device displays the second interface. Fig.13 (d) in, see Fig. 9 At this time, the terminal device displays the preview stream collected in real time by the terminal device on the second window 504 of the second interface.
[0340] 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.
[0341] 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 the current frame image of the preview stream is determined in real time to be a document object, the fourth button ("document scan ×" button) is displayed on the second interface.
[0342] 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 the 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.
[0343] Then, in step S306, for "method 1 of step S303", there is always the first button (shooting button) on the second interface. For "method 2 of step S303", there is also always the first button (shooting button) on the second interface.
[0344] Therefore, no matter which of the above methods is used, the user can see the first button (shooting button) displayed on the second interface.
[0345] If the user triggers the first button (shooting button) on the second interface, the terminal device displays the fourth interface. The fourth interface displays the third image in the preview stream captured by the terminal device in real time, and the third image is the image captured when the user triggers the first button on the second interface; it can be seen that the fourth interface is used to display a frame of an image. In addition, 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.
[0346] In addition, the terminal device displays a seventh button, an eighth button, and a ninth button on the fourth interface. The seventh button is a button for returning to the second interface, and “Preview” is displayed on the seventh button. The eighth button is a button for reshooting an image, and “Reshoot” is displayed on the eighth button, that is, the eighth button is a Reshoot button. The ninth button is a button for confirming image processing of the third image, and “Confirm and Continue” is displayed on the ninth button, that is, the ninth button is a Confirm and Continue button.
[0347] In response to the seventh button on the fourth interface being triggered, the terminal device displays the second interface.
[0348] 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.
[0349] 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.
[0350] Exemplarily, 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, and optionally, the terminal device enlarges and displays the third image on the fifth interface.
[0351] The fifth interface includes at least one image processing button, an eleventh button, a delete button, and an export button.
[0352] 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.
[0353] The eleventh button is a button for returning to the fourth interface, and “Preview” is displayed on the eleventh button. If the user triggers the eleventh button, the terminal device returns to the fourth interface.
[0354] 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.
[0355] 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.
[0356] Fig.14 Interface diagram provided for the embodiment of the present application Figure 9 ,like Fig.14 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.14 (a) in , see Fig. 9 (a) in .
[0357] like Fig.14 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.14 (b) in , see Fig. 9 (b) in .
[0358] User in Fig.14 The second button 606 is triggered on the first interface in (b), such as Fig.14 As shown in (c), the terminal device displays the second interface. Fig.14 (c) in , see Fig. 9 (c) in .
[0359] User in Fig.14 The third button 607 is triggered on the second interface in (c), such as Fig.14 As shown in (d), the terminal device displays the third interface. Fig.14 (d) in, see Fig. 9 (d) or see Fig.10 (d) or see Fig.11 (d) or see Fig.12 (d) in.
[0360] User in Fig.14 The third button 607 is triggered on the third interface in (d), such as Fig.14 As shown in (e), the terminal device displays the second interface. Fig.14 (d) in, see Fig. 9 At this time, the terminal device displays the preview stream collected in real time by the terminal device on the second window 504 of the second interface.
[0361] User in Fig.14 The first button 601 is triggered on the second interface in (c), such as Fig.14 As shown in (f) in the figure, the terminal device displays a fourth interface, and the fourth interface displays a third image 801, which is a frame of image captured in real time when the first button 601 of 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".
[0362] User in Fig.14 The ninth button 615 is triggered on the fourth interface in (f) as shown in FIG. Fig.14 As shown in (g), the terminal device displays a fifth interface, and the fifth interface displays a 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.
[0363] Fig.15 Interface diagram provided for the embodiment of the present application Figure 10 ,like Fig.15 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.15 (a) in , see Fig. 9 (a) in .
[0364] like Fig.15 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.15 (b) in , see Fig. 9 (b) in .
[0365] User in Fig.15 The second button 606 is triggered on the first interface in (b), such as Fig.15As shown in (c) in the figure, the terminal device displays a second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream collected 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. When 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, the terminal device does not display the third button on the second interface. The terminal device displays a first button 601, a preview button 604, and a fourth button 608 in the third window 503 of the second interface, and "Document Scan ×" is displayed on the fourth button 608. There can also be at least one shooting-related setting button 602 in the first interface.
[0366] User in Fig.15 The first button 601 is triggered on the second interface in (c), such as Fig.15 As shown in (d) in the figure, the terminal device displays a fourth interface, and the fourth interface displays a third image 801, which is a frame of image captured in real time when the first button 601 of 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".
[0367] User in Fig.15 The ninth button 615 is triggered on the fourth interface in (d), such as Fig.15 As shown in (e) of FIG. 1 , the terminal device displays a fifth interface, and the fifth interface displays a 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.
[0368] S308: In response to the fourth button in the second interface being triggered, the terminal device displays the first interface.
[0369] Exemplarily, when the user triggers the fourth button (“Document Scan×” button) in the second interface, the terminal device exits the second interface, and then the terminal device displays the first interface.
[0370] 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.
[0371] Fig.16 Interface diagram provided for the embodiment of the present application Figure 10 One, such as Fig.16 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.16 (a) in , see Fig. 9 (a) in .
[0372] like Fig.16 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.16 (b) in , see Fig. 9 (b) in .
[0373] User in Fig.16 The second button 606 is triggered on the first interface in (b), such as Fig.16 As shown in (c), the terminal device displays the second interface. Fig.16 (c) in , see Fig. 9 (c) in .
[0374] User in Fig.16 Click the fourth button 608 ("Document Scan ×" button) on the second interface in (c) of FIG. Fig.16 As shown in (d) in FIG. 1 , the terminal device displays 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. Fig.16 As shown in (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, a second button 606 (document scanning animation button) is displayed on the first interface.
[0375] Fig.17 Interface diagram provided for the embodiment of the present application Figure 10 Second, such as Fig.17 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.17 (a) in , see Fig. 9 (a) in .
[0376] like Fig.17 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.17 (b) in , see Fig. 9 (b) in .
[0377] User in Fig.17 The second button 606 is triggered on the first interface in (b), such as Fig.17 As shown in (c), the terminal device displays the second interface. Fig.17 (c) in , see Fig. 9 (c) in .
[0378] User in Fig.17 Click the fourth button 608 ("Document Scan ×" button) on the second interface in (c) of FIG. Fig.17 As shown in (d) in FIG. 1 , the terminal device displays 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. Fig.17 As shown in (d) in FIG. 1 , 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, a third button 607 (text extraction animation button) is displayed on the first interface.
[0379] Fig.18 Interface diagram provided for the embodiment of the present application Figure 10 Three, such as Fig.18 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.18 (a) in , see Fig. 9 (a) in .
[0380] like Fig.18 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.18 (b) in , see Fig. 9 (b) in .
[0381] User in Fig.18 The second button 606 is triggered on the first interface in (b), such as Fig.18As shown in (c) in the figure, the terminal device displays a second interface. The second interface includes a second window 502 and a third window 503; the second window 502 displays a preview stream collected 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. When 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, the terminal device does not display the third button on the second interface. The terminal device displays a first button 601, a preview button 604, and a fourth button 608 in the third window 503 of the second interface, and "Document Scan ×" is displayed on the fourth button 608. There can also be at least one shooting-related setting button 602 in the first interface.
[0382] User in Fig.18 Click the fourth button 608 ("Document Scan ×" button) on the second interface in (c) of FIG. Fig.18 As shown in (d) in FIG. 1 , the terminal device displays the first interface. 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. Fig.18 As shown in (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, a second button 606 (document scanning animation button) is displayed on the first interface.
[0383] 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; and the third window displays the first button and the fourth button.
[0384] Exemplarily, in the above 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 is executed.
[0385] 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 a first prompt message is displayed in the sixth interface, and the first prompt message is used to prompt the user that the text is not recognized, and the first prompt message is "text is 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.
[0386] Fig.19 Interface diagram provided for the embodiment of the present application Figure 10 Four, such as Fig.19 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.19 (a) in , see Fig. 9 (a) in .
[0387] like Fig.19 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a document object, the terminal device displays a second button 606 on the first interface. Fig.19 (b) in , see Fig. 9 (b) in .
[0388] User in Fig.19 The second button 606 is triggered on the first interface in (b), such as Fig.19 As shown in (c), the terminal device displays the second interface. Fig.19 (c) in , see Fig. 9 (c) in .
[0389] User in Fig.19 If the third button 607 is triggered on the second interface in (c), but the terminal device is shaken, the terminal device displays the sixth interface. Fig.19 As shown in (d), the sixth interface includes a sixth window 506 and a third window 503; the sixth window 506 displays a preview stream, and the first prompt message "No text recognized" is displayed on the sixth window 506; the third button is not displayed on the sixth interface; the third window 503 displays a first button 601 and a fourth button 604.
[0390] S309: When the object category of the first image is a text object, the terminal device displays a third button on the first interface.
[0391] Exemplarily, when the terminal device starts the camera application, the terminal device displays a first interface in real time, the first interface includes a first window, and the first window displays each current frame image in the preview stream collected 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.
[0392] Among them, 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.
[0393] 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.
[0394] The preview button is a button for being triggered to preview an image in a camera application.
[0395] The switch button is a button used to be triggered to switch between the front camera and the rear camera.
[0396] The first interface also includes at least one multiple button, which is a button for adjusting the display size of the image in the preview stream. For example, the multiple buttons include: "0.5" button, "1" button, "5" button, and "10" button.
[0397] After step S301, when the terminal device determines that the first image in the captured preview stream is a text object, a third button is displayed on the first interface. The third button is a "text extraction animation button", and the third button is a button for being triggered to extract text from an image. "Text extraction" is displayed on the third button to facilitate the user to determine the function of the third button.
[0398] The third button is an animated button; the third button can have an expanded state and a collapsed state. Moreover, when the third button is displayed for the first time, 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 then the terminal device moves the third button on the first interface in response to the user's dragging operation.
[0399] Fig. 20 Interface diagram provided for the embodiment of the present application Figure 10 Five, such as Fig. 20 As shown in (a) of FIG. 1 , 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. Fig. 20 As shown in (b) of FIG. 1 , 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. Fig. 20 In (b), the third button 607 is in the expanded state.
[0400] Fig.21 Interface diagram provided for the embodiment of the present application Figure 10Six, such as Fig.21 As shown in (a), Fig.21 (a) is the above Fig. 20 (b) in FIG. 6 ; the third button 607 is an animated button. Fig.21 (a) The third button 607 is in the expanded state. Fig.21 As shown in (b), within the preset time, the third button 607 is not triggered, and the third button 607 is in the retracted state.
[0401] S310. 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 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.
[0402] In one example, the third interface also includes a seventh button.
[0403] 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.
[0404] 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.
[0405] 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 also displays a tenth button.
[0406] In one example, 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.
[0407] Exemplarily, after step S309, the terminal device triggers the third button (text extraction animation button) on the third interface, and the terminal device displays the third interface. The third interface includes the fourth window and the fifth window. And the third button is displayed on the third interface; the third button is in the collapsed state or the expanded state.
[0408] Since the user triggers the third button on the first interface, the terminal device can collect the current frame image in the preview stream at the time when the third button is triggered in real time, and then obtain a second image. Therefore, the terminal device displays the second image in the preview stream in the fourth window. At this time, the terminal device displays a frame of the second image in the fourth window of the third interface. The second image here and the first image mentioned above are images at different times in the preview stream.
[0409] Furthermore, the terminal device detects the target text in the second image in real time, and the “target text” is as described above. If the terminal device detects that the second image has the target text, the target text in the second image is highlighted in the fourth window of the third interface.
[0410] It can be seen that the fourth window is the "text display area".
[0411] In one example, during the process of real-time display of the preview stream in the first window of the first interface, the terminal device displays the second image of the preview stream. The terminal device does not process the second image on 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 an area formed by the text blocks of the target text, and the second area is a 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 an area in the second image excluding the minimum bounding rectangle.
[0412] In response to the triggering of the third button in the first interface, the terminal device determines the minimum external matrix formed by each text block in the second image; the terminal device crops the second image according to the size of the minimum external matrix, and crops the peripheral area of the second image before the minimum external matrix. The terminal device can retain part of the area around the periphery of the minimum external 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 each text block and the edge of the image; the distance can be set to a fixed number of pixels, the number of pixels is an empirical value; or, the distance is a proportion of the length of the text block corresponding to the distance.
[0413] Thus, the second image displayed by the terminal device in the third interface includes the first area but does not include the second area. Furthermore, the terminal device highlights each text block of the target text in the first area. Furthermore, the terminal device sets the background color of the text block of the target text in the first area to a preset color (e.g., 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.
[0414] 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. For example, based on the width of the cropped second image, the cropped second image fills 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 fills the fourth window so that the cropped second image reaches the edge of the fourth window in the height direction.
[0415] Furthermore, during the process of the terminal device detecting the target text in the second image in real time, the terminal device identifies entities in the target text. It can be seen that the target text includes entities and / or non-entities. Among them, entities include the following entities: email address, ID number, courier number, flight number, website, telephone number, address, etc.
[0416] When the terminal device detects that the target text in the second image in the fourth window does not include any entity, the terminal device displays a fifth button in the fifth window, which 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. In addition, the terminal device displays a seventh button on the third interface, which 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.
[0417] 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 corresponding one-to-one to the entity in the target text in the second image. Among them, 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 the sixth button displays the information of the entity corresponding to the sixth button. In addition, the terminal device displays the seventh button on the third interface, and the seventh button is a button for displaying the prompt information "Long press to select text", and the seventh button displays "Long press to select text". Among them, 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.
[0418] 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.
[0419] 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.
[0420] 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.
[0421] If the number of entities in the second image is greater than the preset number, the terminal device may display M-1 sixth buttons in the fifth window. At the same time, the terminal device displays a tenth button in the fifth window, which is a button for being 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); "...more" is displayed on the tenth button. The terminal device displays the tenth button at the end of the M-1 sixth buttons.
[0422] 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.
[0423] 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, displays a sixth button on the fifth window, and the sixth button displays AA City BB District CC Road DD. The email entity www.***@**.com displays a sixth button on the fifth window, and the sixth button displays www.***@**.com.
[0424] Alternatively, for each sixth button, since it is necessary to display the information of the entity corresponding to the sixth button on the sixth button. For the sake of aesthetics or for the effective use of the position of the interface, the key information of the entity can be displayed on the sixth button. Among them, the terminal device can determine the key information of the entity according to the preset display method; or, the terminal device determines the key information of the entity according to the user's intention or user portrait, etc. For example, the telephone entity 86 158********, a sixth button is displayed on the fifth window, and 158******** is displayed on the sixth button. The website entity www.****@**.com, a sixth button is displayed on the fifth window, and ****@**.com is displayed on the sixth button. The address entity AA City BB District CC Road DD, a sixth button is displayed on the fifth window, and BB District CC Road DD is displayed on the sixth button. The email entity www.***@**.com, a sixth button is displayed on the fifth window, and ***@**.com is displayed on the sixth button.
[0425] 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 may 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.
[0426] Alternatively, the terminal device may dynamically sort the order of the sixth buttons in the fifth window according to the user's user portrait, user intention, user preference, and other information. The terminal device may determine the user's user portrait, user intention, and user preference according to the user's personal information and the number of times the user uses the entity. The user's personal information includes the user's gender, user age, and the like. The number of times the user uses the entity, for example, is the number of times the user opens a website, the number of times the user makes a phone call, the number of times the user sends an email, and the like.
[0427] Fig. 22 Interface diagram provided for the embodiment of the present application Figure 10 Seven, such as Fig. 22 As shown in (a), 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.
[0428] like Fig. 22 As shown in (b) of FIG. 1 , 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 is a "text extraction animation button". The third button 607 has an expanded state and a collapsed state. Fig. 22 In (b), the third button 607 is in the expanded state.
[0429] User in Fig. 22 The third button 607 is triggered on the first interface in (b), such as Fig. 22 As shown in (c) of FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig. 22In (c), the third button 607 is in the collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted, and 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. "Copy All" is displayed on the fifth button 609; 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 "Long Press to Select Text" is displayed on the seventh button 611, which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0430] The sixth button displays complete information of the entity corresponding to the sixth button. Fig. 22 As shown in (c) in FIG. 5 , the telephone 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 Number displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays AA City BB District CC Road DD Number. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays www.***@**.com.
[0431] Fig.23 Interface diagram provided for the embodiment of the present application Figure 10 Eight, such as Fig.23 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.23 (a) in , see Fig. 22 (a) in .
[0432] like Fig.23 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. Fig.23 (b) in , see Fig. 22 (b) in .
[0433] User in Fig.23The third button 607 is triggered on the first interface in (b), such as Fig.23 As shown in (c) of FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig.10 In (d), the third button 607 is in the collapsed state. Each text block 701 of the target text in the second image displayed in the fourth window 504 is highlighted, and 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. "Copy All" is displayed on the fifth button 609; 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 "Long Press to Select Text" is displayed on the seventh button 611, which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0434] The sixth button displays key information of the entity corresponding to the sixth button. Fig.23 As shown in (c) in the figure, the telephone entity 86 158******** displays a sixth button 610 on the fifth window 505, and 158******** is displayed on the sixth button 610. The website entity www.****@**.com displays a sixth button 610 on the fifth window 505, and ****@**.com is displayed on the sixth button 610. The address entity AA City BB District CC Road DD Number displays a sixth button 610 on the fifth window 505, and BB District CC Road DD Number displays on the sixth button 610. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and ***@**.com is displayed on the sixth button 610.
[0435] Fig.24 Interface diagram provided for the embodiment of the present application Figure 10 Nine, such as Fig.24 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.24 (a) in , see Fig. 22 (a) in .
[0436] like Fig.24As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. Fig.24 (b) in , see Fig. 22 (b) in .
[0437] User in Fig.24 The third button 607 is triggered on the first interface in (b), such as Fig.24 As shown in (c) of FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig.24 In (c), the third button 607 is in the retracted 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 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. "Copy All" is displayed on the fifth button 609; 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 "Long Press to Select Text" is displayed on the seventh button 611, which can prompt the user to long press the target text in the fourth window 504 to select the target text.
[0438] 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. Fig.24 As shown in (c) in the figure, the telephone 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 610 on the fifth window 505, and the sixth button 610 displays ****@**.com. The address entity AA City BB District CC Road DD Number displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays BB District CC Road DD Number. The email entity www.***@**.com displays a sixth button 610 on the fifth window 505, and the sixth button 610 displays ***@**.com. The tenth button 612 is displayed on the fifth window.
[0439] User in Fig.24 The tenth button 612 is triggered on the fifth window 505 of the third interface in (c), such as Fig.24 As shown in (d) in FIG. 1 , the terminal device displays the remaining sixth buttons 610 that are 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.
[0440] Fig.25 Interface diagram provided for the embodiment of the present application Figure 2 Ten, such as Fig.25 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.25 (a) in , see Fig. 22 (a) in .
[0441] like Fig.25 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. Fig.25 (b) in , see Fig. 22 (b) in .
[0442] User in Fig.25 The third button 607 is triggered on the first interface in (b), such as Fig.25 As shown in (c) of FIG. 1 , 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. The third button 607 is a "text extraction animation button"; the third button 607 can be in an expanded state or a collapsed state. Fig.25 In (c), the third button 607 is in the retracted 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 the 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.
[0443] S311. In response to a third button in a third interface being triggered, the terminal device displays the first interface.
[0444] Exemplarily, after step S310, if the user triggers the third button "text extraction animation button" on the third interface, the terminal device exits the third interface and displays the first interface. The first interface includes a first window, which displays a preview stream collected 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.
[0445] Step S301 is executed again.
[0446] Thus, in this step, the terminal device responds to the third button "text extraction animation button" in the third interface being triggered and returns to the display of the first interface of step S301.
[0447] 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.
[0448] Fig.26 Interface diagram provided for the embodiment of the present application Figure 2 XI. Fig.26 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig.26 (a) in , see Fig. 22 (a) in .
[0449] like Fig.26 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. Fig.26 (b) in , see Fig. 22 (b) in .
[0450] User in Fig.26 The third button 607 is triggered on the first interface in (b), such as Fig.26 As shown in (c) , the terminal device displays the third interface. Fig.26 (c) in Fig. 22 (c) or see Fig.23 (c) or see Fig.24 (c) or see Fig.25 (c) in .
[0451] User in Fig.26 In (c), the third button 507 is triggered on the third interface, such as Fig.26 As shown in (d) in the figure, the first interface is displayed. At this time, the terminal device displays the preview stream collected in real time by the terminal device on the first window 501 of the first interface.
[0452] In one example, the method provided by 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.
[0453] Exemplarily, in the above 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.
[0454] 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 a second prompt message is displayed in the seventh interface, and the second prompt message is used to prompt the user that the text is not recognized, and the second prompt message is "text is not recognized". It can be seen that the seventh interface includes the seventh window; the seventh window displays a preview stream, and the second prompt message is displayed on the seventh window; the third button is not displayed on the seventh interface.
[0455] 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.
[0456] Fig. 27 Interface diagram provided for the embodiment of the present application Figure 2 Twelve, such as Fig. 27 As shown in (a), the terminal device opens the camera application and the terminal device displays the first interface; Fig. 27 (a) in , see Fig. 22 (a) in .
[0457] like Fig. 27 As shown in (b) in FIG. 6 , when the terminal device determines that the current frame image (ie, the first image) in the preview stream is a text object, the terminal device displays a third button 607 on the first interface. Fig. 27 (b) in , see Fig. 22 (b) in .
[0458] User in Fig. 27 The third button 607 is triggered on the first interface in (b), such as Fig. 27 As shown in (c) in FIG. 1 , the terminal device displays the seventh interface. Fig. 27 As shown in (c) of FIG. 1 , the seventh interface includes a seventh window 507, the seventh window 507 displays a preview stream, and the seventh window 507 displays a second prompt message "No text recognized"; the third button is not displayed on the seventh interface. The seventh interface also includes 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.
[0459] 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.
[0460] 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.
[0461] 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.
[0462] Therefore, the steps of this example can be executed 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.
[0463] An entity has multiple functions, and the functions of an entity have priorities. The priority of the functions of an entity can be determined in real time based on a user profile or user intent. For example, a user profile and user intent can be generated based on user personal information and / or the user's use of the entity.
[0464] The sixth button corresponds one-to-one to 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 portrait or the user intention.
[0465] After step S304 or step S310, the user may touch the sixth button on the fifth window in the third interface, and then the device directly responds to the function with the highest priority corresponding to the sixth button.
[0466] For example, the entity is a phone entity, and the second image in the fourth window includes the phone number of the phone entity. The functions corresponding to the phone entity include: copy function, selection function, dial function, storage function, etc. The functions corresponding to the phone entity have priorities. According to the priority, they are sorted into dial function, storage function, copy function, and selection function.
[0467] The user touches the sixth button corresponding to the phone entity on the fifth window in 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.
[0468] For example, the entity is an address entity, and the second image in the fourth window includes the address information code of the address entity. The functions corresponding to the address entity include: copy function, select function, go function, store function, etc. The functions corresponding to the address entity have priorities. According to the priority, they are sorted into go function, copy function, store function, and select function.
[0469] The user touches the sixth button corresponding to the address entity on 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 function", and then the terminal device directly calls the map application to display how to go to the location represented by the address information.
[0470] In one example, the entity displayed in the fourth window of 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 the user portrait or the 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;
[0471] The method also includes: the terminal device responds to the entity in the fourth window being triggered, and displays the 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.
[0472] 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.
[0473] An entity has multiple functions, and the functions of an entity have priorities. The priority of the functions of an entity can be determined in real time based on a user profile or user intent. For example, a user profile and user intent can be generated based on user personal information and / or the user's use of the entity.
[0474] The sixth button corresponds one-to-one to 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 portrait or the user intention.
[0475] After step S304 or step S310, the user touches the text of the entity on the fourth window in the third interface, and the terminal device displays the 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.
[0476] Therefore, the first option of the first service menu has a priority, which is the priority of the function corresponding to the first option.
[0477] The order of the first options in the first service menu is based on the priority of the first option.
[0478] For example, the entity is a phone entity, and the second image in the fourth window includes the phone number of the phone entity. The functions corresponding to the phone entity include: copy function, selection function, dial function, storage function, sharing function, etc. The functions corresponding to the phone entity have priorities. According to the priority, they are sorted into dial function, storage function, copy function, selection function, and sharing function.
[0479] Therefore, the order of the first options corresponding to the telephone entity is: dialing function, storage function, copy function, and selection function.
[0480] Fig.28 Interface diagram provided for the embodiment of the present application Figure 2 Thirteen, such as Fig.28 As shown, the user touches the text of the phone entity on the fourth window 504 in the third interface, and the terminal device displays the 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 "dial" option, "save" option, "copy" option, "select" option, and "share" option.
[0481] For example, the entity is an address entity, and the second image in the fourth window includes the address information code of the address entity. The functions corresponding to the address entity include: copy function, select function, go function, store function, share function, etc. The functions corresponding to the address entity have priorities. According to the priority, they are sorted into go function, copy function, store function, select function, share function.
[0482] Therefore, the order of the first options corresponding to the address entity is: go to function, copy function, store function, select function, and share function.
[0483] Fig.29 Interface diagram provided for the embodiment of the present application Figure 2 Fourteen, such as Fig.29 As shown, the user touches the text of the address entity on the fourth window 504 in the third interface, and the terminal device displays the 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 "Go" option, "Copy" option, "Save" option, "Select" option, and "Share" option.
[0484] 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.
[0485] 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.
[0486] If the second image in the fourth window includes non-entity text, the image displayed in the fourth window includes non-entity text.
[0487] After step S304 or step S310, the user touches the non-entity text on the fourth window in the third interface, and the terminal device displays a second service menu, wherein the content in the second service menu is the same for different non-entity texts.
[0488] The second service menu includes at least one second option, such as select all, copy, translate, search, share, etc.
[0489] The order of the second options in the second service menu may 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 option may be determined in real time based on the user profile or the user intent. For example, the user profile and the user intent are generated based on the user personal information and / or the user's use of the second option.
[0490] Fig.30 Interface diagram provided for the embodiment of the present application Figure 2 Fifteen, such as Fig.30 As shown, the user touches the non-physical text on the fourth window 504 in the third interface, and the terminal device displays the second service menu 902. The second service menu 902 includes multiple second options, which are "Select All", "Copy", "Translate", "Search", and "Share". Fig. 20 As shown, when the second image in the fourth aspect 504 has an entity, the fifth window 505 displays a fifth button 509 and a sixth button 610 corresponding to the entity.
[0491] Fig.31 Interface diagram provided for the embodiment of the present application Figure 2 Sixteen, such as Fig.31 As shown, the user touches the non-physical text on the fourth window 504 in the third interface, and the terminal device displays the second service menu 902. The second service menu 902 includes multiple second options, which are "Select All", "Copy", "Translate", "Search", and "Share". Fig. 20 As shown, when the second image in the fourth aspect 504 does not have any entity, a fifth button 509 is displayed in the fifth window 505 .
[0492] In one example, the method further includes: in response to a fifth button in the fifth window being triggered, the terminal device copies the target text in the fourth window.
[0493] 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.
[0494] The user triggers the fifth button (a copy all button) in the fifth window, and the terminal device copies all target texts in the fourth window.
[0495] In this embodiment, during step S301, when the terminal device displays the first interface, the terminal device collects 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 collect the physical object and the physical object is less than a preset threshold (for example, 17 cm), the terminal device needs to turn on the super macro mode. When the terminal device uses the super macro mode, the terminal device can display a first icon, which is an icon of the super macro mode, and the first icon can prompt the user that the terminal device is currently in the super macro mode.
[0496] The first icon may be displayed in any of the following two ways.
[0497] 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 a first icon on the first interface.
[0498] 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.
[0499] 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.
[0500] Among them, the preset threshold is the first threshold.
[0501] For example, in step S301, when the terminal device displays the first interface, the terminal device collects the physical object through the camera to obtain a preview stream; in this process, if the terminal device determines that the distance between the camera used to collect 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 collects the preview stream through the super macro mode. The terminal device first displays the first icon on the first interface, thereby prompting the user that the terminal device is currently in the super macro mode.
[0502] At the same time, the terminal device detects the object category of the first image in the preview stream of the first interface.
[0503] 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).
[0504] Fig.32Interface diagram provided for the embodiment of the present application Figure 2 Seventeen, such as Fig.32 As shown in (a), 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.
[0505] Fig.32 As shown in (b), 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; the terminal device displays the 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 FIG. Fig.32 As shown in (b) , the first icon 620 is in an expanded state.
[0506] Fig.32 As shown in (c), 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 at the lower right corner of the first window 501 of the first interface.
[0507] Fig.32 As shown in (d) in Fig.32 After (b) in FIG. 1 , if the terminal device starts the super macro mode again, the terminal device may display the first icon 620 on the first interface. The first icon 620 is located at the lower right corner of the first window 501 of the first interface. Fig.32 As shown in (d) in FIG. 8 , the first icon 620 is in a retracted state.
[0508] Fig.33 Interface diagram provided for the embodiment of the present application Figure 2 Eighteen, such as Fig.33 As shown in (a), 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.
[0509] Fig.33 As shown in (b), 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; the terminal device displays the 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 FIG. Fig.33 As shown in (b) , the first icon 620 is in an expanded state.
[0510] Fig.33 As shown in (c), 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 at the lower right corner of the first window 501 of the first interface.
[0511] Fig.33 As shown in (d) in Fig.33 After (b) in FIG. 1 , if the terminal device starts the super macro mode again, the terminal device may display the first icon 620 on the first interface. The first icon 620 is located at the lower right corner of the first window 501 of the first interface. Fig.33 As shown in (d) in FIG. 8 , the first icon 620 is in a retracted state.
[0512] 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.
[0513] Step S302 includes: when the object category of the first image is a document object, at a first moment, the terminal device displays a 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.
[0514] Step S309 includes: when the object category of the first image is a text object, at a first moment, the terminal device displays a 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.
[0515] Among them, the preset threshold is the first threshold.
[0516] 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.
[0517] At the same time, the terminal device detects the object category of the first image in the preview stream of the first interface.
[0518] 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.
[0519] 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.
[0520] Fig.34 Interface diagram provided for the embodiment of the present application Figure 2 Nineteen, such as Fig.34 As shown in (a), 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.
[0521] 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.
[0522] Fig.34 As shown in (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, at the first moment, the terminal device displays a second button 606 on the first interface. The second button 606 is located at the lower right corner of the first window 501 of the first interface.
[0523] Then at a second moment later than the first moment, Fig.34 As shown in (c) in FIG. 5 , the terminal device displays the first icon 620 on the first interface, but does not display the second button 606. The first icon 620 is located at the lower right corner of the first window 501 of the first interface.
[0524] The first icon 620 has a collapsed state and an expanded state; Fig.34 As shown in (c) in FIG. 8 , the first icon 620 is in an expanded state.
[0525] Then at a third moment later than the second moment, Fig.34 As shown in (d) in FIG. 5 , the terminal device displays the second button 606 on the first interface, but does not display the first icon 620. The second button 606 is located at the lower right corner of the first window 501 of the first interface.
[0526] in, Fig.34 In the interface diagram shown, 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.
[0527] Fig.35 Interface diagram provided for the embodiment of the present application Figure 3 Ten, such as Fig.35 As shown in (a), 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.
[0528] 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.
[0529] Fig.35As shown in (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, at the first moment, the terminal device displays a third button 607 on the first interface. The third button 607 is located at the lower right corner of the first window 501 of the first interface.
[0530] Then at a second moment later than the first moment, Fig.35 As shown in (c) in FIG. 5 , 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 at the lower right corner of the first window 501 of the first interface.
[0531] The first icon 620 has a collapsed state and an expanded state; Fig.35 As shown in (c) in FIG. 8 , the first icon 620 is in an expanded state.
[0532] Then at a third moment later than the second moment, Fig.35 As shown in (d) in FIG. 5 , the terminal device displays the third button 607 on the first interface, but does not display the first icon 620. The third button 607 is located at the lower right corner of the first window 501 of the first interface.
[0533] in, Fig.35 In the interface diagram shown, 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 on the fourth window of the third interface, the second image in the preview stream can be cropped (that is, the second image in the preview stream in the second interface can be cropped). In step S310, when the terminal device displays the second image on the fourth window of the third interface, the second image in the preview stream can be cropped (that is, the second image in the preview stream in the first interface can 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] Fig.36 Interface diagram provided for the embodiment of the present application Figure 3 XI. Fig.36 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.36 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.36 (a) in the figure is the first window 501 mentioned above. Fig.36 (a) in FIG. 1 has a third button 607 .
[0540] like Fig.36 As shown in (a) of FIG. 8 , 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 a text block of the target text). The second region is the peripheral region of the first region 1001.
[0541] User Trigger Fig.36 The third button 607 in (a) is as follows: Fig.36 As shown in (b), 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, but 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. Fig.36 (b) in FIG. 1 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 may 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] Exemplarily, based on the first cropping method, if the directions of the text blocks in the second image in the preview stream are the same, but the directions of the text blocks in the second image in the preview stream do not match the screen direction of the terminal device, then the directions of the text blocks in the second image displayed by the terminal device in the fourth window of the third interface match the screen direction 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] Fig.37 Interface diagram provided for the embodiment of the present application Figure 3 Twelve, such as Fig.37 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.37 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.37 (a) in the figure is the first window 501 mentioned above. Fig.37 (a) in FIG. 1 has a third button 607 .
[0548] like Fig.37 As shown in (a) in FIG. 8 , the second image 802 includes a first area 1001 (as shown in a dotted box) and a second area. The first area 1001 is the minimum circumscribed matrix formed by each text block in the second image (wherein the text block is a text block of the target text). The second area is the peripheral area of the first area 1001. The first area 1001 is the direction of each text block in the second image, which is not compatible with the screen direction of the terminal device.
[0549] User Trigger Fig.37The third button 607 in (a) is as follows: Fig.37 As shown in (b), 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, but 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; the terminal device adapts the direction of the text block to the screen direction of the terminal device on the fourth window 504 of the third interface. Fig.37 (b) in FIG. 1 has a 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 may fill the fourth window 504 .
[0551] Fig.38 Interface diagram provided for the embodiment of the present application Figure 3 Thirteen, such as Fig.38 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.38 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.38 (a) in the figure is the first window 501 mentioned above. Fig.38 (a) in FIG. 1 has a third button 607 .
[0552] like Fig.38 As shown in (a) in FIG. 8 , the second image 802 includes a first area 1001 (as shown in a dotted box) and a second area. The first area 1001 is the minimum circumscribed matrix formed by each text block in the second image (wherein the text block is a text block of the target text). The second area is the peripheral area of the first area 1001. The first area 1001 is the direction of each text block in the second image, which is not compatible with the screen direction of the terminal device.
[0553] User Trigger Fig.38 The third button 607 in (a) is as follows: Fig.38As shown in (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 to a preset color (for example, gray) in the fourth window 504 of the third interface; the terminal device adapts the direction of the text block to the screen direction of the terminal device in the fourth window 504 of the third interface. Fig.38 (b) in FIG. 1 has a third button 607 .
[0554] The third cropping method: 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 a text block 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 an area formed by at least one third area.
[0555] The second image displayed in the third interface includes at least one third area but does not include a 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.
[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, there is a distance between two third areas in adjacent third areas that is greater than a preset distance. The area formed by at least one third area is the minimum bounding rectangle formed by each text block in the second image. The fourth area is a peripheral area of the area formed by at least one third area, that is, the fourth area is a peripheral area of the minimum bounding rectangle formed by each text block in the second image.
[0558] When the terminal device displays the third interface in response to the third button being triggered, the terminal device determines the minimum external matrix formed by the text blocks in the second image; the terminal device crops the second image according to the size of the minimum external matrix, and crops the peripheral area of the second image before the minimum external matrix. The terminal device may retain a partial area around the periphery of the minimum external matrix.
[0559] Furthermore, 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 fill the fourth window. For example, based on the width of the cropped second image, the cropped second image fills 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 fills the fourth window so that the cropped second image reaches the edge of the fourth window in the height direction.
[0562] Wherein, if the directions of the text blocks in the second image in the preview stream are the same, but the directions of the text blocks in the second image in the preview stream do not match the screen direction of the terminal device; then the directions of the text blocks in the second image displayed by the terminal device in the fourth window of the third interface are adapted to the screen direction of the terminal device. Alternatively, if the directions of the text blocks in the second image in the preview stream are the same, but the directions of the text blocks in the second image in the preview stream do not match the screen direction of the terminal device; then the terminal device does not adjust the directions of the text blocks in the second image in the fourth window of the third interface.
[0563] Fig.39 Interface diagram provided for the embodiment of the present application Figure 3 Fourteen, such as Fig.39 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.39(a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.39 (a) in the figure is the first window 501 mentioned above. Fig.39 (a) in FIG. 1 has a third button 607 .
[0564] like Fig.39 As shown in (a) of FIG. 8 , 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 circumscribed rectangle, such as Fig.39 As shown in the dotted box in (a), the minimum circumscribed rectangle is region 1003. The distance between two third regions 1002 in adjacent third regions 1002 is greater than a preset distance. The fourth region is a peripheral region of region 1003. The directions of the text blocks in the second image in the preview stream are the same.
[0565] User Trigger Fig.39 The third button 607 in (a) is as follows: Fig.39 As shown in (b), the terminal device cuts off the fourth area, but the terminal device can retain part of the area around area 1003. The second image displayed by the terminal device on the fourth window 504 of the third interface does not include the fourth area, but at this time, there is a certain distance between the frame formed by the text blocks in the second image and the edge of the second image; the distance can be set to a fixed number of pixels, and the number of pixels 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 cuts off the area between adjacent third areas 1003 with a larger 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. Fig.39 (b) in FIG. 1 has a 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 may fill the fourth window 504 .
[0567] Fig.40 Interface diagram provided for the embodiment of the present application Figure 3 Fifteen, such as Fig.40 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.40(a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.40 (a) in the figure is the first window 501 mentioned above. Fig.40 (a) in FIG. 1 has a third button 607 .
[0568] like Fig.40 As shown in (a) of FIG. 8 , 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 circumscribed rectangle, such as Fig.40 As shown in the dotted box in (a), 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 block in the second image in the preview stream is the same, but the direction of the text block in the second image in the preview stream does not match the screen direction of the terminal device.
[0569] User Trigger Fig.40 The third button 607 in (a) is as follows: Fig.40 As shown in (b), the terminal device cuts off the fourth area, but the terminal device can retain part of the area around area 1003. The second image displayed by the terminal device on the fourth window 504 of the third interface does not include the fourth area, but 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, the number of pixels is an empirical value; or, the distance is a proportion of the length of the text block corresponding to the distance. In addition, the terminal device cuts off the area between adjacent third areas 1003 with a larger 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; the terminal device adapts the direction of the text block to the screen direction of the terminal device on the fourth window 504 of the third interface. Fig.40 (b) in FIG. 1 has a 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 may 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] Exemplarily, the second image in the preview stream includes a fifth area and a sixth area. Each text block in the second image in the preview stream has a background image; wherein the background image is a character background, or a landscape background, etc.; the fifth area is an area formed by each text block of the second image in the preview stream, and the fifth area has a background image. The sixth area is a peripheral area of the fifth area.
[0575] When the terminal device displays the third interface in response to the third button being triggered, the terminal device retains each text block in the second image and the background image of each text block, so that the terminal device retains the fifth area and cuts off the sixth area. The terminal device highlights each text block of the target text in the fourth window of the third interface.
[0576] Fig.41 Interface diagram provided for the embodiment of the present application Figure 3 Sixteen, such as Fig.41 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.41 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.41 (a) in the figure is the first window 501 mentioned above. Fig.41 (a) in FIG. 1 has a third button 607 .
[0577] like Fig.41 As shown in (a) of FIG. 8 , the second image 802 includes a fifth region 1004 and a sixth region. The fifth region 1004 is a region formed by the text blocks of the second image in the preview stream, and the fifth region 1004 has a background image. The sixth region is a peripheral region of the fifth region. The directions of the text blocks in the second image in the preview stream are the same.
[0578] User Trigger Fig.41 The third button 607 in (a) is as follows: Fig.41 As shown in (b) in FIG. 1 , the terminal device cuts off the sixth area. The second image displayed by the terminal device on the fourth window 504 of the third interface includes but does not include the sixth area, but includes the fifth area 1004 . Fig.41 (b) in FIG. 1 has a 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 may fill the fourth window 504 .
[0580] The fifth 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 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.
[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 area and a second area, the first area is an area formed by the text blocks of the target text, and the second area is a 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 an area in the second image excluding the minimum bounding rectangle. The directions of the text blocks of the target text in the second image in the preview stream are different.
[0583] When the terminal device displays the third interface in response to the third button being triggered, the terminal device determines the minimum external matrix formed by each text block in the second image; the terminal device crops the second image according to the size of the minimum external matrix, and crops the peripheral area of the second image that is located before the minimum external matrix. The terminal device can retain part of the area around the periphery of the minimum external 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 each text block and the edge of the image; the distance can be set to a fixed number of pixels, and the number of pixels is an empirical value; or, the distance is a proportion 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 first area but does not include the second area. Furthermore, the terminal device highlights each text block of the target text in the first area. Furthermore, the terminal device sets the background color of the text block of the target text in the first area to a preset color (e.g., 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 may fill the fourth window.
[0587] Fig.42 Interface diagram provided for the embodiment of the present application Figure 3 Seventeen, such as Fig.42 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.42 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.42 (a) in the figure is the first window 501 mentioned above. Fig.42 (a) in FIG. 1 has a third button 607 .
[0588] like Fig.42 As shown in (a) of FIG. 8 , 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 a text block of the target text). The second region is the peripheral region of the first region 1001. The directions of the text blocks in the first region 1001 are different.
[0589] User Trigger Fig.42 The third button 607 in (a) is as follows: Fig.42 As shown in (b) in FIG. 1 , the terminal device cuts off the second area, but the terminal device may retain a portion of the area around 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 may fill the fourth window 504 .
[0591] The sixth 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 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.
[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: taking the correction angle of the first text block as a reference, other text blocks follow the first text block; or, taking the text block with the largest area as a reference for the correction angle, other text blocks follow this text block; or, taking the text block with the largest number of words as a reference for the correction angle, other text blocks follow this text block.
[0596] Fig.43 Interface diagram provided for the embodiment of the present application Figure 3 Eighteen, such as Fig.43 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.43 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.43 (a) in the figure is the first window 501 mentioned above. Fig.43 (a) in FIG. 1 has a third button 607 .
[0597] like Fig.43As shown in (a) of FIG. 8 , 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 a text block of the target text). The second region is the peripheral region of the first region 1001. The directions of the text blocks in the first region 1001 are different.
[0598] User Trigger Fig.43 The third button 607 in (a) is as follows: Fig.43 As shown in (b) in FIG. 1 , 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 may fill the fourth window 504 .
[0600] The seventh cropping method. 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 an area formed by at least one third 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.
[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 smaller 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 of the third cropping method mentioned above. Different from the third cropping method, the directions of the text blocks of the target text in the second image in the preview stream are different; when the terminal device displays the third interface in response to the third button being triggered, the terminal device corrects the directions of the text blocks of the target text in the second image displayed in the third interface to the same direction, and the directions of the text blocks are adapted to the screen direction of the terminal device.
[0604] Fig.44 Interface diagram provided for the embodiment of the present application Figure 3 Nineteen, such as Fig.44 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.44 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.44 (a) in the figure is the first window 501 mentioned above. Fig.44 (a) in FIG. 1 has a third button 607 .
[0605] like Fig.44 As shown in (a) of FIG. 8 , 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 circumscribed rectangle, such as Fig.44 As shown in the dotted box in (a), the minimum circumscribed rectangle is region 1003. The distance between two third regions 1002 in adjacent third regions 1002 is greater than a preset distance. The fourth region is a peripheral region of region 1003. The directions of the text blocks in the second image in the preview stream are different.
[0606] User Trigger Fig.44 The third button 607 in (a) is as follows: Fig.44 As shown in (b), the terminal device cuts off the fourth area, but the terminal device can retain part of the area around area 1003. The second image displayed by the terminal device on the fourth window 504 of the third interface does not include the fourth area, but at this time, there is a certain distance between the frame formed by the text blocks in the second image and the edge of the second image. In addition, the terminal device cuts off the area between adjacent third areas 1003 with a larger 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. In the fourth window 504 of the third interface of the terminal device, the direction of the text block is corrected to the same direction. Fig.44(b) in the figure has a 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 may fill the fourth window 504.
[0607] Alternatively, the user triggers Fig.44 The third button 607 in (a) is as follows: Fig.44 As shown in (c), Fig.44 (c) includes Fig.44 The processing process of (b) in FIG. 5 is the same as that of FIG. 5 , but the direction of the text block is not corrected in the fourth window 504 of the third interface of the terminal device.
[0608] The eighth 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 the 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.
[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, 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. Different from the third cropping method, the directions of the text blocks of the target text in the second image in the preview stream are different; when the terminal device displays the third interface in response to the third button being triggered, the terminal device corrects the directions of the text blocks of the target text in the second image displayed in the third interface to the same direction, or does not correct the directions.
[0612] Fig.45 Interface diagram provided for the embodiment of the present application Figure 4 Ten, such as Fig.45 As shown in (a) in FIG. 1 , when the image in the first interface is a document object, the terminal device displays a preview stream on the second window, and the preview stream has a second image 802. Fig.45 (a) is the second window 502; when the image in the first interface is a text object, the terminal device displays a preview stream on the first window, and the preview stream has a second image 802, Fig.45 (a) in the figure is the first window 501 mentioned above. Fig.45 (a) in FIG. 1 has a third button 607 .
[0613] like Fig.45 As shown in (a) of FIG. 8 , the second image 802 includes a fifth region 1004 and a sixth region. The fifth region 1004 is a region formed by the text blocks of the second image in the preview stream, and the fifth region 1004 has a background image. The sixth region is a peripheral region of the fifth region. The directions of the text blocks in the second image in the preview stream are different.
[0614] User Trigger Fig.45 The third button 607 in (a) is as follows: Fig.45 As shown in (b), the terminal device cuts off the sixth area. The second image displayed by the terminal device on the fourth window 504 of the third interface includes but does not include the sixth area and includes the fifth area 1004. The terminal device does not correct the direction of the text block on the fourth window 504 of the third interface. Fig.45 (b) in FIG. 1 has a 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 may 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 on the fourth window of the third interface, the terminal device can enlarge the second image on the fourth window based on the user's trigger. In step S310, after the terminal device displays the second image on the fourth window of the third interface, the terminal device can enlarge the second image on the fourth window based on the user's trigger.
[0618] The zooming method may be any of the following methods: In the following zooming methods (excluding gesture operation), when the user triggers the position, text block, or area on the fourth window, it may be triggered by double-clicking or single-clicking.
[0619] The first way to zoom in.
[0620] At a fourth moment, the terminal device is triggered in response to a first position on a fourth window, wherein 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, wherein 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 responds 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, and shrinks 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 the fourth moment, the user triggers the first position on the fourth window, and the first position is any position on the second image in the fourth window; the terminal device magnifies and displays the image on the fourth window at a first ratio and with the first position as the center point, wherein the first ratio is a preset multiple (for example, 1.75 times to 3 times) of the original image size, and 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 the second position on the fourth window, the second position being any position on the second image in the fourth window; the terminal device magnifies and displays the image on the fourth window at a second ratio and with the second position as the center point, wherein the second ratio is a preset multiple (e.g., 1.75 times to 3 times) of the original image size, wherein 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, and 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] Fig.46 Interface diagram provided for the embodiment of the present application Figure 4 XI. Fig.46 As shown in (a) , the terminal device displays the third interface, and displays the second image 802 on the fourth window 504 of the third interface.
[0630] like Fig.46 As shown in (a) of FIG. 5 , at the fourth moment, the user triggers the first position 1101 on the fourth window 504, and the first position 1001 is any position on the second image in the fourth window 504. Fig.46 As shown in (b) in FIG. 1 , the terminal device enlarges the image on 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] like Fig.46 As shown in (b) of FIG. 5 , at a fifth moment later than the fourth moment, the user triggers the second position 1102 on the fourth window 504, and the second position 1102 is any position on the second image in the fourth window 504. Fig.46 As shown in (c) in FIG. 1 , the terminal device enlarges the image on 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] like Fig.46 As shown in (c) in FIG. 5 , at a sixth moment later than the fifth moment, the user triggers the third position 1103 on the fourth window 504, and the third position 1003 is any position on the second image in the fourth window 504. Fig.46 As shown in (d) in FIG. 1 , the terminal device reduces the image on the fourth window to the size before the fourth moment, and restores the image on the fourth window to the original image size.
[0634] The second way to zoom in.
[0635] At the seventh moment, the terminal device is triggered in response to a fourth position on the fourth window, wherein the fourth position is any position on the second image in the fourth window, and enlarges the image on the fourth window at a third ratio with the fourth position as the center point.
[0636] At the eighth moment, the terminal device responds 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, and restores the size of the image on the fourth window; the eighth moment is later than the seventh moment.
[0637] For example, Fig.47 Interface diagram provided for the embodiment of the present application Figure 4 Twelve, such as Fig.47 As shown in (a), the terminal device displays the third interface, and the second image 802 is displayed on the fourth window 504 of the third interface.
[0638] like Fig.47 As shown in (a) of FIG. 5 , at the seventh moment, the user triggers the fourth position 1104 on the fourth window 504, and the fourth position 1104 is any position on the second image in the fourth window 504. Fig.47 As shown in (b) in FIG. 1 , the terminal device enlarges the image on 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] like Fig.47 As shown in (b) of FIG. 5 , at an eighth moment later than the seventh moment, the user triggers the fifth position 1105 on the fourth window 504, and the fifth position 1105 is any position on the second image in the fourth window 504. Fig.47 As shown in (c) in FIG. 5 , the terminal device reduces the image on the fourth window 504 to the size before the fourth moment, that is, restores the image on the fourth window 504 to the original image size.
[0640] The third way to zoom in.
[0641] At the ninth moment, the terminal device responds to the first text block on the fourth window being triggered and enlarges the image on the fourth window. The longest text block in the enlarged image after the ninth moment reaches the edge of the screen of the terminal device.
[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] For example, Fig.48 Interface diagram provided for the embodiment of the present application Figure 4 Thirteen, such as Fig.48 As shown in (a), the terminal device displays the third interface, and the second image 802 is displayed on the fourth window 504 of the third interface.
[0644] like Fig.48 As shown in (a) of FIG. 5 , 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] Then, the terminal device calculates the enlarged length of the longest text block. The enlarged length of the longest text block is z'=z / (y / (yx)). Where 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] like Fig.48As shown in (b) in FIG. 1 , 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] like Fig.48 As shown in (b) of FIG. 5 , at a tenth time later than the ninth time, the user triggers the sixth position 1106 on the fourth window 504, and the sixth position 1106 is any position on the second image in the fourth window 504. Fig.48 As shown in (c) in FIG. 5 , the terminal device reduces the image on the fourth window 504 to the size before the fourth moment, that is, restores the image on 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 screen edge of the terminal device.
[0650] At the twelfth moment, the terminal device responds 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, and enlarges the image on the fourth window; the third text block in the enlarged image after the twelfth moment reaches the screen edge 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 arrives at the screen edge of the terminal device; the thirteenth moment is later than the twelfth moment.
[0652] At the fourteenth moment, the terminal device responds to the seventh position on the fourth window being triggered, wherein the seventh position does not have the target text, and restores the image on the fourth window to the original image size of the image; the fourteenth moment is later than the eleventh moment.
[0653] For example, Fig.49 Interface diagram provided for the embodiment of the present application Figure 4 Fourteen, such as Fig.49 As shown in (a), the terminal device displays the third interface, and the second image 802 is displayed on the fourth window 504 of the third interface.
[0654] like Fig.49 As shown in (a) in FIG. 11 , 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)). 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] like Fig.49 As shown in (b) in FIG. 1 , 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] like Fig.49 As shown in (b), at the twelfth moment later than the eleventh moment, 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)). z3 is the length of the third text block 1203 before the twelfth moment, x3 is the distance from the third text block 1203 to the edge of the screen before the twelfth moment, and y is the total length of the screen (i.e., the total width of the screen).
[0658] like Fig.49 As shown in (c) in FIG. 1 , 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] like Fig.49 As shown in (c) in FIG. 1 , at a thirteenth moment later than the twelfth moment, the user triggers the third text block 1203 on the fourth window 504. Fig.49 As shown in (d) in FIG. 1 , the terminal device restores the image on the fourth window 504 to the image size before the twelfth moment; wherein the third text block 1202 is Fig.49 The state of (b) in Fig.49 (d) in Fig.49 (b) in .
[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 the original image size of the image.
[0661] For example, Fig.49As shown in (c) in FIG. 5 , at a time point 14 later than the 11th time point, the user triggers the seventh position 1107 on the fourth window 504. The seventh position 1107 does not have a target text. Fig.49 As shown in (e) in FIG. 5 , the terminal device restores the image on the fourth window 504 to the original image size of the image, that is, Fig.49 (e) in Fig.49 (a) in .
[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, to enlarge 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 displayed image in the fourth window.
[0665] Exemplarily, the terminal device may infinitely magnify the image in the fourth window, or infinitely reduce 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, and 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 displayed image in the fourth window based on the size indicated by the second gesture operation.
[0668] Fig.50 Interface diagram provided for the embodiment of the present application Figure 4 Fifteen, such as Fig.50 As shown in (a) of FIG. 5 , the user touches the fourth window 504 to input a two-finger zoom-in operation. Fig.50 As shown in (b) in FIG. 5 , the terminal device enlarges the image displayed in the fourth window 504 based on the size indicated by the two-finger zoom-in operation.
[0669] like Fig.50 As shown in (b) of FIG. 5 , the user touches the fourth window 504 to input a two-finger zoom-out operation. Fig.50 As shown in (c) in FIG. 5 , the terminal device reduces the displayed image in the fourth window 504 based on the size indicated by the two-finger reduction operation.
[0670] In the interface diagram in this application, "***" is text.
[0671] Fig.51A schematic diagram of the software layer of a terminal device provided in an embodiment of the present application, such as Fig.51 As shown, 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 deploys camera applications, gallery applications, screenshot applications, etc. 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 the 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 the third interface in response to the third button in the second interface being triggered; the third interface displays the 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 the 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 third button in the first interface being triggered, the terminal device displays a third interface; the third interface displays the third button; the fourth window displays the second image in the preview stream, and the second image includes the highlighted target text. Thus, the function of text extraction is provided.
[0677] It further provides the function of recognizing documents and texts, and can provide document scanning and text extraction functions.
[0678] In this embodiment, the user is no longer required to manually select the text to be recognized, so as to prevent the text from being fleeting and the user from having time to select the target text, thereby missing the text. For example, in a conference PPT presentation, the speaker turns pages too quickly and the mobile phone viewfinder may not have time to select the target text. The text in the image can be recognized in a timely manner. In addition, the user does not need to manually select the target text on the screen, avoiding conflicts with the interaction with the camera itself, affecting text recognition or affecting the captured image; and reducing the user's learning cost.
[0679] The solution provided in 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] Fig.52 A flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application Figure 2 ,like Fig.52 As shown, the method includes:
[0681] S5201. In response to opening a second image through a gallery application, the terminal device displays a first interface.
[0682] Exemplarily, 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 the like.
[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 as 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] Fig.53 Interface diagram provided for the embodiment of the present application Figure 4 Sixteen, such as Fig.53 As shown in (a) in the figure, 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: sharing icon, collection icon, edit icon, delete icon, "more" icon, etc. Fig.53 As shown in (b), 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, such as Fig.53 As shown in (c) in the figure, the terminal device displays a third interface, wherein the third interface includes a fourth window and a fifth window. The third interface may include icons of the gallery application: a share icon, a favorite icon, an edit icon, a delete icon, a "more" icon, and the like.
[0692] The user triggers the third button 507 on the third interface, such as Fig.53 As shown in (d) in the figure, the terminal device returns to the first interface, wherein: Fig.53 (d) in Fig.53 (b) in .
[0693] In the interface diagram in this application, "***" is text.
[0694] Fig.54 A flowchart of a text recognition method based on a terminal device provided in an embodiment of the present application Figure 3 ,like Fig.54 As shown, the method includes:
[0695] S5401. In response to obtaining a second image through a screenshot application, the terminal device displays a first interface.
[0696] Exemplarily, the user triggers the terminal device to take a screenshot. The terminal device obtains the second image through a screenshot application. Thus, the terminal device displays a first interface, and the first interface displays the second image; the first interface includes an icon of 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 as 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] Fig.55 Interface diagram provided for the embodiment of the present application Figure 4 Seventeen, such as Fig.55 As shown in (a) in the figure, the user triggers the terminal device to take a screenshot, and then the terminal device obtains the second image. 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 screenshot application: sharing icon, editing icon, mosaic icon, eraser icon, delete icon, save icon, icons for drawing graphics (for example, free graphics, rectangle, circle, heart shape), etc. Fig.55As shown in (b), 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.
[0705] The user triggers the third button 507 on the first interface, such as Fig.55 As shown in (c), the terminal device displays a third interface, wherein the third interface includes a fourth window and a fifth window. The third interface may include an icon of a screenshot application.
[0706] The user triggers the third button 507 on the third interface, such as Fig.55 As shown in (d) in the figure, the terminal device returns to the first interface, wherein: Fig.55 (d) in Fig.55 (b) in .
[0707] Fig.56 Interface diagram provided for the embodiment of the present application Figure 4 Eighteen, such as Fig.56 As shown in (a) in the figure, the user triggers the terminal device to take a screenshot, and the user draws a graphic on the screenshot image, and then the terminal device obtains the second image. 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 screenshot application: a sharing icon, an icon for drawing graphics (for example, a free graphic, a rectangle, a circle, a heart shape), etc. Fig.56 As shown in (b), when the terminal device determines that the second image includes the target text (identifying the target text in the area in 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, such as Fig.56 As shown in (c) in the figure, the terminal device displays a third interface; wherein the third interface includes a fourth window and a fifth window. The third interface may include an icon of a 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, such as Fig.56 As shown in (d) in the figure, the terminal device returns to the first interface, wherein: Fig.56 (d) in Fig.56 (b) in .
[0710] In the interface diagram in this application, "***" is text.
[0711] The method for sorting the device list in the embodiment of the present application has been described above, and the device for performing the method for sorting the list in the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided in the embodiment of the present application can perform the steps in the method for sorting the list in the embodiment of the present application.
[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] like Fig.57 FIG. 5 is a schematic diagram of a chip structure provided by 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. In the implementation process, the steps of the above terminal device execution method can be completed by the hardware integrated logic circuit or software instructions in the processor 5701. The above processor 5701 can be a general 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 disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0716] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field 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 completes the steps of the above method in combination with its hardware.
[0717] The processor 5701 , the memory 5704 , and the communication interface 5703 may communicate with each other via the communication line 5702 .
[0718] Fig.58 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application is shown in FIG. Fig.58 As shown, the terminal device 5800 includes the above 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 removes the integrated circuit unit used to calculate the coordinate information corresponding to the touch operation.
[0719] The terminal device-based text recognition method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic device includes a terminal device, and the specific device form of the terminal device can refer to the above related description, which 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 embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0722] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function 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, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed 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 technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in 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 embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0726] The above specific implementation methods further illustrate the purpose, 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 substitutions, 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 a terminal device, 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, 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, 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, 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, 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, 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, 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, characterized in that The third interface also includes a seventh button.
9. The method according to any one of claims 1 to 8, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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
Cited By
Text recognition method based on terminal device, and device and storage medium
EP4625366A1
Text recognition method based on terminal device, and device and storage medium
WO2024183372A1
