Image processing method, device, computer equipment and storage medium
By implementing cross-text unit editing of multiple text areas in an instant messaging client, the problem of limited user editing freedom in the prior art is solved, and the user experience is improved.
Patent Information
- Application Number
- CN201911383203.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-27
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2040-12-20
AI Technical Summary
In the image recognition function, existing instant messaging applications are difficult to realize cross-text unit editing of multiple text areas, which limits the user's freedom to edit the recognized text.
An image processing method is provided, by identifying multiple text areas in the image to be recognized in an instant messaging client, and displaying a text recognition result page when a text recognition instruction is detected, the page includes an image area and a text recognition result area. , allows identification of cross-text unit editing between text units.
It realizes simultaneous editing of all text recognized from the image to be recognized, improving the freedom of user experience and text editing.
Smart Images

Figure CN111144320B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to an image processing method, apparatus, computer equipment and storage medium. Background Art
[0002] IM (Instant Messaging) application is software that realizes online chatting and communication based on instant messaging technology. In addition, the instant messaging application also provides an image recognition function for images sent by users in the chat session page. This image recognition function can perform text recognition on the images sent by users, making it convenient for users to use the text recognition results corresponding to the images. Summary of the invention
[0003] The embodiments of the present invention provide an image processing method, apparatus, computer device and storage medium, which can perform cross-text unit editing on multiple recognized text units recognized from an image to be recognized in an instant messaging client, thereby improving the text editing freedom of the text recognized from the image to be recognized.
[0004] An embodiment of the present invention provides an image processing method, the method comprising:
[0005] Determine an image to be identified in an instant messaging client, wherein the image to be identified includes a plurality of text areas;
[0006] When a text recognition instruction for the image to be recognized is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, the first text recognition result includes recognized text units corresponding to each text area, wherein recognized text units can be edited across text units.
[0007] This embodiment also provides an image processing device, which includes:
[0008] A determination unit, used to determine an image to be identified in an instant messaging client, wherein the image to be identified includes a plurality of text areas;
[0009] A recognition result display unit is used to display a text recognition result page when a text recognition instruction for the image to be recognized is detected, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, the first text recognition result includes a recognized text unit corresponding to each text area, wherein the recognized text units can be edited across text units.
[0010] This embodiment further provides a storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the image processing method shown in the embodiment of the present invention are implemented.
[0011] This embodiment also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the image processing method shown in the embodiment of the present invention are implemented.
[0012] An embodiment of the present invention provides an image processing method, apparatus, computer equipment and storage medium, which can determine an image to be recognized in an instant messaging client, wherein the image to be recognized includes multiple text areas; when a text recognition instruction for the image to be recognized is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, wherein the image area includes the image to be recognized, and the text recognition result area includes a first text recognition result, and the first text recognition result includes recognized text units corresponding to each text area, wherein the recognized text units can be edited across text units, thereby all texts recognized from an image to be recognized can be edited at the same time, which is beneficial to improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1a is a scene schematic diagram of the image processing method provided by an embodiment of the present invention;
[0015] Figure 1b is a flow chart of an image processing method provided by an embodiment of the present invention;
[0016] Figure 2a is a display schematic diagram of a text recognition result page provided by an embodiment of the present invention;
[0017] Figure 2b is a display schematic diagram of another text recognition result page provided by an embodiment of the present invention;
[0018] Figure 2c is a display schematic diagram of another text recognition result page provided by an embodiment of the present invention;
[0019] Figure 2dis a display schematic diagram of another text recognition result page provided by an embodiment of the present invention;
[0020] Figure 2e is a display schematic diagram of another text recognition result page provided by an embodiment of the present invention;
[0021] Figure 2f is a display schematic diagram of another text recognition result page provided by an embodiment of the present invention;
[0022] Figure 3a is a schematic diagram of modifying the second text recognition result provided by an embodiment of the present invention;
[0023] Figure 3b is a schematic diagram of modifying the second text recognition result provided by an embodiment of the present invention;
[0024] Figure 3c This is an optional page composition diagram of a text recognition result page provided by an embodiment of the present invention;
[0025] Figure 4a is a flow chart of an image processing method provided by an embodiment of the present invention;
[0026] Figure 4b is another flowchart of the image processing method provided by an embodiment of the present invention;
[0027] Figure 5 is a structural schematic diagram of an image processing device provided by an embodiment of the present invention;
[0028] Figure 6 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention;
[0029] Figure 7 It is an optional structural diagram of the distributed system 700 provided in an embodiment of the present invention applied to a blockchain system;
[0030] Figure 8 It is an optional schematic diagram of a block structure provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0032] The embodiments of the present invention provide an image processing method, apparatus, computer device and storage medium. Specifically, the embodiments of the present invention provide an image processing apparatus suitable for a first computer device (for distinction, it can be referred to as a first image processing apparatus), and the first computer device can be a terminal or other device, and the terminal can be a tablet computer, a laptop computer, a mobile phone, a smart TV or other device. The embodiments of the present invention also provide an image processing apparatus suitable for a second computer device (for distinction, it can be referred to as a second image processing apparatus), and the second computer device can be a network-side device such as a server, and the server can be a single server or a server cluster composed of multiple servers, and can be a physical server or a virtual server.
[0033] For example, the first image processing device may be integrated in a terminal, and the second image processing device may be integrated in a server.
[0034] The embodiment of the present invention takes the first computer device as a terminal and the second computer device as a server as an example to introduce the image processing method.
[0035] refer to Figure 1a An embodiment of the present invention provides an image processing system including a terminal 10 and a server 20, etc.; the terminal 10 and the server 20 are connected via a network, such as a wired or wireless network connection, etc., wherein the first image processing device is integrated in the terminal, for example, integrated in the terminal in the form of a client.
[0036] Among them, terminal 10 can be used to determine the image to be recognized in the instant messaging client, and the image to be recognized includes multiple text areas; when a text recognition instruction for the image to be recognized is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, and the first text recognition result includes a recognized text unit corresponding to each text area, wherein the recognized text units can be edited across text units.
[0037] Among them, the first text recognition result can be obtained by the terminal 10 itself based on text recognition of the image to be recognized, or it can be obtained by the server 20 performing text recognition on the image to be recognized. When the terminal needs to obtain the first text recognition result, it can trigger the server to perform text recognition on the image to be recognized by sending an image recognition request to the server 20; the server 20 can be specifically used to: receive the image recognition request sent by the terminal; obtain the image to be recognized of the terminal based on the image recognition request, perform text recognition on the image to be recognized, obtain the text recognized from the image to be recognized, send the text to the terminal 10, and the terminal 10 sets the text as editable text through the same editor to obtain the first text recognition result, and the terminal 10 displays the text recognition result page.
[0038] In one embodiment, the text recognition process of the image to be recognized by the server may be executed by the terminal 10 .
[0039] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0040] The embodiment of the present invention will be described from the perspective of a first image processing device, which may be specifically integrated in a terminal.
[0041] An embodiment of the present invention provides an image processing method, which can be executed by a processor of a terminal, such as Figure 1b As shown, the process of the image processing method can be as follows:
[0042] 101. Determine an image to be identified in an instant messaging client, where the image to be identified includes multiple text areas;
[0043] To facilitate understanding of the content of this embodiment, some technical terms appearing in this embodiment are explained:
[0044] Instant messaging: A terminal service that allows two or more people to use the Internet to instantly transmit text messages, files, voice and video communications.
[0045] Image OCR: The full name is Optical Character Recognition, which refers to the process in which electronic devices use character recognition methods to translate the shapes on the image into computer text.
[0046] In this embodiment, the image to be identified can be any type of image, such as an image in JGP format, an expression image, etc.; the content carried in the image to be identified is not limited in form, and can include content in the form of tables, texts, pictures, etc. The source of the image to be identified is not limited, and can be an image obtained by screenshot, or an image obtained by shooting, etc., and this embodiment has no limitation on this.
[0047] For example, in one embodiment, the image to be identified may be an image obtained by a user of an instant messaging client taking a screenshot of the terminal's screen display content, or the image to be identified may be an image sent by a user during a chat session, or an image taken by a user using a terminal's camera.
[0048] Optionally, the text area in this embodiment can be understood as an area containing text. Optionally, there is no restriction on the division of the text area. For example, the text area where each line of text is located can be considered as a text area, and the area where each complete sentence of text (divided by periods) is located can be considered as a text area.
[0049] 102. When a text recognition instruction for an image to be recognized is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, the first text recognition result includes recognized text units corresponding to each text area, wherein recognized text units can be edited across text units.
[0050] In this embodiment, the text recognition instruction is an instruction for triggering the instant messaging client to recognize the image to be recognized. There are multiple ways to trigger the instruction. It can be triggered by a specific operation after the image to be recognized is determined, or it can be triggered by the operation of determining the image to be recognized. That is, when the image to be recognized is determined, it triggers the generation of text recognition execution to recognize the image to be recognized. This embodiment has no limitation on this.
[0051] In this embodiment, the text in the recognized text unit is the text recognized from the corresponding text area, and the recognized text units can be edited across text units. It can be understood that the text in two or more recognized text units can be edited at the same time, for example, part of the content in two adjacent text recognition units can be copied at the same time.
[0052] For example, refer to Figure 2a 201 is a display diagram of a text recognition result page. In the screen display area of the terminal shown in 200, a chat session page of an instant messaging client shown in 201 is displayed. The chat session page includes image A. Image A is an image sent by Li XX, a friend of the current user. In this embodiment, image A can be determined as an image to be recognized by an operation on image A. When image A is determined as an image to be recognized, a recognition operation on image A will be triggered. After successful recognition, the terminal will display the text recognition result page shown in 202. Figure 2a As shown, the text recognition result page 202 includes two areas, an image area 2021 and a text recognition result area 2022 . The image area is used to display the image to be recognized, and the text recognition result area is used to display the text recognition result, such as the first text recognition result shown in the text recognition result area 2022 .
[0053] In this embodiment, the text recognition result page may be displayed in the form of a sub-page or a pop-up window.
[0054] In this embodiment, the display content of the text recognition result area can be switched. In addition to the first text recognition result, the second text recognition result can also be displayed after switching. The text content in the second text recognition result is the same as the text content in the first text recognition result, but the text attributes of the two in the text recognition result area are different.
[0055] In this embodiment, the first text recognition result corresponds to the same editor, so any character in the first text recognition result can be used as the starting character and the ending character of the same text editing. Figure 2a In one editing, the text from "Mount Tai, also known as Mount Dai" to "Mount Tai was regarded by the ancients as" in the first text recognition result of 2022 can be used as the content to be edited in one editing process, and edited, such as copying, pasting, cutting, deleting, wrapping and other TXT-like operations.
[0056] Optionally, in this embodiment, a first editing mode switching control is provided corresponding to the first text recognition result. That is, when the text recognition result area includes the first text recognition result, the text recognition result area also includes a first editing mode switching control. The first editing mode switching control is used to switch the first text recognition result of the text recognition result area to the second text recognition result.
[0057] Optionally, the image processing method of this embodiment may further include:
[0058] When a trigger operation for the first editing mode switching control is detected, the second text recognition result is switched to be displayed in the text recognition result area, and the second text recognition result includes multiple texts recognized from multiple text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, and multiple texts cannot be edited across texts. The text recognition area is the area containing text detected from the image to be recognized.
[0059] In this embodiment, each text in the second text recognition result corresponds to a text recognition area of the image to be recognized. In the second text recognition result of this embodiment, each text is editable, but any two texts cannot be copied, modified, or edited at the same time. In this embodiment, each text in the second text recognition result corresponds to an editor, and each text corresponds to a different editor. All characters in a text can be edited separately.
[0060] When the text recognition result area switches to display the second text recognition result, the first editing mode switching control may be hidden.
[0061] Optionally, when the text recognition result area switches to display the second text recognition result, the second text recognition result can be displayed in multiple ways. For example, the second text recognition result can be displayed by moving from one boundary of the text result area (such as the left boundary) to another boundary corresponding to the boundary (such as the right boundary).
[0062] For example, or refer to Figure 2aThe display schematic diagram of the text recognition result page shown in the figure, in the text recognition result page 202, a first editing mode switching control such as a control named "branch editing" is displayed. When a trigger operation such as a click operation for the "branch editing" control is detected, the text recognition result area 2022 in the 202 page is switched to display as a text recognition result area 2023. In the text recognition result area 2023, the second text recognition result is displayed, and the second text recognition result includes multiple texts. Optionally, a text sequence number can also be displayed before each text, and the text sequence number is determined by the position of the corresponding text recognition area in the image to be recognized. For the second text recognition result, each text therein can be edited separately, for example, the content in the first text "Taishan, also known as Daishan, Daizong, Daiyue, Dongyue, Taiyue, is one of the famous five mountains in China", can be arbitrarily edited, such as copying, modifying, deleting, etc., but the content in the first text and the content in the second text cannot be edited at the same time, such as being copied.
[0063] Optionally, in this embodiment, when the text recognition result area includes the second text recognition result, the text recognition result area also includes a second editing mode switching control, and the second editing mode switching control is used to switch the second text recognition result of the text recognition result area to the first text recognition result.
[0064] Optionally, the method of this embodiment further includes:
[0065] When a trigger operation on the second editing mode switching control is detected, the first text recognition result is switched to be displayed in the text recognition result area.
[0066] In this embodiment, when a text recognition instruction for an image to be recognized is detected, the first text recognition result may be displayed first in the text recognition result display page. When a trigger operation for the first editing mode switching control is detected, the second text recognition result may be switched to be displayed in the text recognition result area.
[0067] For example, Figure 2a As shown, 2022 is displayed first, and when a trigger operation for the "line edit" control is detected, the second text recognition result shown in 2023 is displayed.
[0068] In another embodiment, when a text recognition instruction of an image to be recognized is detected, a first text recognition result may be displayed first in a page displaying text recognition results, and when a trigger operation for a second editing mode switching control is detected, the first text recognition result may be switched to be displayed in the text recognition result area.
[0069] For example, refer to Figure 2bWhen a text recognition instruction for image A in 201 is detected, the text recognition result page shown in 203 is displayed. In the text recognition result page, the text recognition result area includes a second text recognition result and a second editing mode switching control such as a "mixed editing" control. When a trigger operation for the "mixed editing" control is detected, the second editing mode switching control is hidden, and the first text recognition result and the first editing mode switching control are switched to be displayed in the text recognition result area (reference 204).
[0070] In this embodiment, in the second text recognition result, the corresponding relationship between each text and the text recognition area is very clear and obvious, which is conducive to the user's comparative reading of the text and the text recognition area.
[0071] Optionally, in this embodiment, the image to be recognized on the text recognition result page may also include a text recognition area mark, each of which is used to identify a text recognition area in the image to be recognized. The text recognition area mark may be an underline, a color mark, a text box, etc. Figure 2a 2024, wherein the area where each line of text is located is respectively identified as a text recognition area, each line of text corresponds to a text box including the line of text, the text recognized in the text box is a text in the second text recognition result, and the characters in the text can be edited arbitrarily, such as forwarding, copying, modifying, etc.
[0072] In this embodiment, when the text recognition result area displays the first text recognition result, the image to be recognized in the image area may also include a text recognition area identifier. Optionally, in this embodiment, the text in the first text recognition result may be arranged in the form of paragraphs, and the paragraphs in the first text recognition result correspond to the paragraphs in the image to be recognized. In this embodiment, when it is detected that the cursor corresponding to the mouse is on the text on the text recognition result page, the paragraph to which the text belongs can be determined, and the paragraph can be highlighted in the image to be recognized. The highlighting method includes but is not limited to: highlighting the text recognition area corresponding to the paragraph in the image to be recognized, or changing the display parameters of the text recognition area identifier corresponding to the text recognition area of the paragraph in the image to be recognized, such as making the text box bold or changing the color of the text box.
[0073] In one example, the text in the text recognition area on the image to be recognized may also be affected based on the modification of the text in the first text recognition result.
[0074] In one embodiment, the image processing method may further include:
[0075] Based on the text editing operation on the target paragraph in the first text recognition result, obtaining a modified text corresponding to the target paragraph;
[0076] When the end of the text editing operation for the target paragraph is detected, the image to be recognized and the first text recognition result are updated and displayed on the text recognition result page. After the update, the text in the text recognition area corresponding to the target paragraph in the image to be recognized is replaced by the modified text, and the text in the target paragraph in the first text recognition result is replaced by the modified text.
[0077] In another embodiment, the image processing method may further include:
[0078] Based on the text editing operation on the first target text in the first text recognition result, obtaining a modified text corresponding to the first target text;
[0079] When the text editing operation for the first target text is detected to be completed, the image to be recognized and the first text recognition result are updated and displayed on the text recognition result page. After the update, the text in the text recognition area corresponding to the first target text in the image to be recognized is replaced by the modified text, and the first target text in the first text recognition result is replaced by the modified text.
[0080] In one embodiment, when the cursor is detected to be located in a text recognition area in the image to be recognized, the text corresponding to the text recognition area can be highlighted in the second text recognition result. The way in which the text appears includes but is not limited to bolding the text, changing the background color of the text, etc.
[0081] For example, reference Figure 2a ,In 2024, the cursor is located in the text display area where the first line of text is located. In the second text recognition result, the background of the first text becomes gray, highlighting the correspondence between the first text and the first line of text in the image to be recognized.
[0082] Optionally, the image to be recognized in this embodiment can be determined in a variety of ways.
[0083] (1) The image to be identified may be an image sent by a user in a chat session page.
[0084] Optionally, the step of “determining an image to be identified in the instant messaging client” may include:
[0085] Displaying a chat session page of an instant messaging client, the chat session page including images sent by users of the chat session;
[0086] When a text recognition operation on an image is detected, the image corresponding to the text recognition operation is determined as an image to be recognized, triggering the generation of a text recognition instruction for the image to be recognized.
[0087] In the embodiment of the present invention, the chat session page of the instant messaging client can be a single chat session page, a group chat session page, or a chat session page with a public account, and this embodiment has no limitation on this. The chat session user who sends the image can be the current user of the terminal, that is, the user who is currently logged in to the terminal, or can be another user who is having a chat session with the current user in the chat session page, and this embodiment has no limitation on this.
[0088] In this embodiment, the chat session page may include multiple images, and the user can select an image to be recognized for text recognition. There are many ways to select the image to be recognized, which can be selected based on the terminal's shortcut keys, or can be selected through the controls in the chat session page. This embodiment has no restrictions on this.
[0089] Optionally, the step of “when a text recognition operation on an image is detected, determining the image corresponding to the text recognition operation as an image to be recognized, and triggering generation of a text recognition instruction for the image to be recognized” includes:
[0090] When a function control list display operation for an image is detected, a control list is displayed for the image, the control list including a text recognition trigger control;
[0091] When a trigger operation for a text recognition trigger control is detected, an image corresponding to the text recognition operation is determined as an image to be recognized, and a text recognition instruction for the image to be recognized is triggered to be generated.
[0092] It is understandable that the text recognition instruction that triggers the generation can be detected by the instant messaging client. When the instant messaging client detects the instruction, text recognition can be performed on the image to be recognized.
[0093] For example, refer to Figure 2c In the chat session page 201 between the current user and Li XX, an image A in a thumbnail display state is displayed. When a function control list display operation for image A is detected, a function control list is displayed (reference 205). The function control list includes a text recognition trigger control such as a control named "screen recognition". When a trigger operation for the "screen recognition" control is detected, such as a left-click operation, image A is determined to be an image to be recognized, and a text recognition instruction for the image to be recognized is triggered to generate text recognition for image A. When the recognition is successful, the text recognition result page shown in 206 is displayed. Among them, the function control list display operation can also be a right-click operation when the cursor is in the display area of image A.
[0094] Optionally, the step of “when a text recognition operation on an image is detected, determining the image corresponding to the text recognition operation as an image to be recognized, and triggering generation of a text recognition instruction for the image to be recognized” includes:
[0095] When a zoom-in display operation on an image in the chat session page is detected, an image zoom-in page for displaying the image is shown. The image zoom-in page includes the image in the zoom-in display state and a text recognition control.
[0096] When a trigger operation on the text recognition control is detected, the image shown on the image zoom-in page is determined as the image to be recognized, and a text recognition instruction for the image to be recognized is triggered and generated.
[0097] Optionally, in this embodiment, the zoom-in display operation on the image in the chat session page may be a click operation on the image in the chat session page. This click operation may be triggered by an input device, such as being triggered by the left mouse button. Or if the display screen of the terminal is a touch display screen, the zoom-in display operation on the image may be a touch click operation on the image. The touch operation in this embodiment may be a long-press operation, a double-click operation, a swipe operation, and so on.
[0098] For example, referring to Figure 2d , in the chat session page 201 between the current user and Li XX, an image A in a thumbnail display state is shown. When a zoom-in display operation on the image A, such as a left mouse button click operation, is detected, an image zoom-in page 207 for displaying the image A is shown. This image zoom-in page includes the image A in the zoom-in display state and a text recognition control, such as the control with the character "文" in 207. When a trigger operation on this "文" control, such as a left mouse button click operation, is detected, the image A is determined as the image to be recognized, and a text recognition instruction for the image to be recognized is triggered and generated to perform text recognition on the image A. When the recognition is successful, a text recognition result page shown in 208 is displayed.
[0099] (2) The image to be recognized can be obtained based on a screenshot.
[0100] Optionally, the step of "determining the image to be recognized in the instant messaging client" may include:
[0101] When a screenshot recognition instruction that needs to be responded to by the instant messaging client is detected, a page to be screenshot is shown.
[0102] When a screenshot end operation on the page to be screenshot is detected, an image to be recognized is generated based on the page to be screenshot within the screenshot range corresponding to the screenshot end operation, and a text recognition instruction for the image to be recognized is triggered and generated.
[0103] Among them, the screenshot recognition instruction may be triggered by an operation on a control in the chat session page, or may also be triggered by an operation on an external input device such as a keyboard. This embodiment has no limitation on this.
[0104] In this embodiment, the page to be screenshotted can be the display page of the terminal when the screenshot recognition instruction to be responded by the instant messaging client is detected, that is, the page included in the screen display area of the terminal. In the page to be screenshotted, a cursor can be displayed, and the user can set the screenshot range based on the cursor.
[0105] Optionally, the step of “when a screenshot recognition instruction that needs to be responded to by the instant messaging client is detected, displaying a page to be screenshotted” may include:
[0106] Displaying a chat session page of an instant messaging client, wherein the chat session page includes a screenshot recognition control;
[0107] When a trigger operation for the screenshot recognition control is detected, a screenshot recognition instruction is triggered to be generated;
[0108] The page to be captured is displayed.
[0109] For example, refer to Figure 2e , the screen display area of the terminal displays a chat session page of the instant messaging client (as shown in 209), and the chat page includes a screenshot recognition control such as "screen recognition". When a trigger operation for the screenshot recognition control is detected, such as a left-click operation of the mouse, a screenshot recognition instruction is triggered to generate a screenshot recognition instruction, and a page to be screenshotted 210 is displayed. In the page to be screenshotted 210, an operation can be performed on the cursor 2001 to determine the screenshot area. When a screenshot end operation is detected, an image to be recognized is generated based on the page to be screenshotted within the screenshot range corresponding to the screenshot end operation, and a text recognition instruction for the image to be recognized is triggered. For example, if Figure 2e In the example, the light-colored area in page 210 is the area corresponding to the screenshot range, and an image to be recognized is generated based on the content in the area, and a text recognition result page shown in 211 is displayed.
[0110] Optionally, in this embodiment, the screenshot recognition control may already exist when the image magnification page is displayed, that is, the screenshot recognition control may be a control that is always displayed on the image magnification page. In another embodiment, the image recognition control may also be a sub-control of a certain control.
[0111] Optionally, the step of “displaying a chat session page of an instant messaging client, wherein the chat session page includes a screenshot recognition control” may include:
[0112] Displaying a chat session page of an instant messaging client, the chat session page including an image operation control;
[0113] When a sub-control display operation for the image operation control is detected, a sub-control list of the image operation control is displayed, and the sub-control list includes a screenshot recognition control.
[0114] For example, or refer to Figure 2e , the screen display area of the terminal displays a chat session page of the instant messaging client (as shown in 209), the chat session page includes an image operation control such as a control named "Screenshot", when a sub-control display operation for the "Screenshot" control is detected, such as a mouse left-button click operation, a sub-control list of the image operation control is displayed, the sub-control list includes a screenshot recognition control such as a control named "Screen Recognition", when a trigger operation for the "Screen Recognition" control is detected, such as a mouse left-button click operation, a screenshot recognition instruction is triggered to display a page 210 to be screenshotted, in which the cursor 2001 can be operated to determine the screenshot area, when a screenshot end operation is detected, an image to be recognized is generated based on the page to be screenshotted within the screenshot range corresponding to the screenshot end operation, triggering the generation of a text recognition instruction for the image to be recognized, for example, in Figure 2e In the example, the light-colored area in page 210 is the area corresponding to the screenshot range, and an image to be recognized is generated based on the content in the area, and a text recognition result page shown in 211 is displayed. It can be understood that in this embodiment, the sub-control list can also include other controls, such as a "screenshot" control for triggering a screenshot instruction.
[0115] In one example, the screenshot operation can be triggered by a shortcut key command of an external device.
[0116] Optionally, the step of “when a screenshot recognition instruction that needs to be responded to by the instant messaging client is detected, displaying a page to be screenshotted” may include:
[0117] Receive shortcut key instructions;
[0118] Analyze the response object and the indicated operation of the shortcut key command;
[0119] When it is determined that the shortcut key instruction is a screenshot recognition instruction that needs to be responded to by the instant messaging client, a page to be screenshoted is displayed.
[0120] The shortcut key command may be input by the user through an external input device of the terminal, and the external device may be a device such as a mouse, a keyboard, and a numerical control board that can be connected to the terminal and input data. Optionally, the connection mode between the device and the terminal includes but is not limited to wired and wireless.
[0121] In this embodiment, the shortcut key instruction can be triggered based on the simultaneous operation of multiple shortcut keys in the keyboard. For example, the shortcut key can be Ctrl+Alt+O, that is, when the user presses the Ctrl key, the Alt key and the O key on the keyboard at the same time, the shortcut key instruction is triggered, and the terminal can analyze the response object and the indicated operation of the shortcut key instruction. When it is determined that the response object is an instant messaging client and the indicated operation is a screenshot recognition operation, it is determined that the instruction is a screenshot recognition instruction that needs to be responded to by the instant messaging client, and the display is as follows: Figure 2f The page to be screenshot 212 is a page in which a cursor 2001 is displayed. The movement track of the cursor and the mouse operation on the cursor can be detected, and the screenshot range is re-determined in the page to be screenshot. For example, based on the user's operation on the cursor, the screenshot range is changed from the light-colored area in page 212 to the light-colored area in page 213. When the screenshot end operation on the page to be screenshot is detected, an image to be recognized is generated based on the page to be screenshot within the screenshot range corresponding to the screenshot end operation, and a text recognition instruction for the image to be recognized is triggered, and a text recognition result page such as the page shown in 214 is displayed.
[0122] Among them, for the method of selecting the screenshot range by using the mouse, the screenshot ending operation for the to-be-screenshot page may be a release operation for the mouse control, such as a release operation for the left mouse button.
[0123] Optionally, in one example, the text recognition result area includes a second text recognition result, and the method further includes:
[0124] Based on the text editing operation on the target text in the second text recognition result, obtaining a modified text corresponding to the target text;
[0125] When the editing end operation for the target text is detected, the image to be recognized and the second text recognition result are updated and displayed on the text recognition result page. After the update, the text in the text recognition area corresponding to the target text in the image to be recognized is replaced by the modified text, and the target text in the second text recognition result is replaced by the modified text.
[0126] In this embodiment, the target text is the edited text selected by the user in the second text recognition result, and the text editing operation includes but is not limited to operations such as deletion and input.
[0127] In an example of this embodiment, when the text recognition result page is updated to display the image to be recognized, the text recognition area of the target text in the image to be recognized can be determined first, and then the text in the text recognition area in the image to be recognized can be removed. The removal method is not limited, and can be any method of removing text in the image in the prior art. Then, in the image to be recognized after the text is removed, the modified text is drawn in the text recognition area corresponding to the target text. It can be understood that if the modified text is empty, that is, the text editing operation for the target text is a complete deletion operation, in the image to be recognized after the text is removed, the text drawn in the text recognition area corresponding to the target text is empty, and there is no text in the text recognition area.
[0128] For example, refer to Figure 3a , 302 shows a text recognition result page, in which a plurality of texts are displayed in the text recognition result area. Assuming that a deletion operation is performed on the second text (i.e., the target text), when it is detected that the text editing operation on the target text is ended, that is, when it is detected that the deletion operation is ended, as shown in 303, the modified text in the second text is "one of, located in the central part of Shandong Province, total", and the text in the second line of text recognition area corresponding to the second text in the image to be recognized in the image area is replaced by "one of, located in the central part of Shandong Province, total".
[0129] In another embodiment, in the image to be recognized in the image area, the text in the text recognition area is replaced by the text recognized from the text area, and after the replacement, the text in the text recognition area is editable.
[0130] In one embodiment, text editing can be performed directly on the image to be recognized. Optionally, the method of this embodiment may also include: based on a text editing operation on the text in the target text recognition area in the image to be recognized, modifying the text in the target text recognition area; when the text editing operation on the text in the target text recognition area is detected to be ended, replacing the text corresponding to the target text recognition area in the second text recognition result with the modified text in the target text recognition area.
[0131] In the above embodiment, the second text recognition result is modified, and the text in the image to be recognized can also be modified. Considering the layout problem of the modified text, in this embodiment, in the scenario where the text in the image to be recognized is editable, the image to be recognized and the second text recognition result can be further updated.
[0132] Optionally, after the step of “updating and displaying the image to be recognized and the second text recognition result on the text recognition result page”, the following steps may also be included:
[0133] Rearranging the text in the text recognition area of the updated image to be recognized, so that in the rearranged image to be recognized, in the text of the same paragraph, the interval between characters in each line of text does not exceed a preset threshold;
[0134] Re-recognize the rearranged image to be recognized, and determine a new text recognition area in the image to be recognized, and the text in each text recognition area;
[0135] The second text recognition result in the text recognition result area is updated with the new text recognition area and the text in each text recognition area.
[0136] For example, refer to Figure 3b , 304 shows a text recognition result page, in which a plurality of texts are displayed in the text recognition result area. Assuming that a deletion operation is performed on the second text (i.e., the target text), when the text editing operation on the target text is detected to be finished, i.e., when the deletion operation is detected to be finished, assuming that the modified text in the second text is "one of, located in the middle of Shandong Province, total", the text in the second line of the text recognition area corresponding to the second text in the image to be recognized in the image area is replaced by "one of, located in the middle of Shandong Province, total". After the replacement, the second line of the text recognition area has no text in the second half (reference Figure 3a 303), the text layout in the image to be recognized is not beautiful and not conducive to reading. The text in the text recognition area of the image to be recognized is rearranged, and the text in the text recognition area of the third line is added to the text recognition area of the second line to form a coherent text line. After the rearrangement, the text layout of the image to be recognized changes, and text detection is performed again. Based on the detected new text recognition area and the corresponding text, the second text recognition result is updated. Referring to the page shown in 305, after the text of the image to be recognized is rearranged, the contents of the second and third texts in the second text recognition result are also changed accordingly.
[0137] In this embodiment, for an image displayed from a non-frontal perspective, it can also be corrected to an image from a frontal perspective before shooting. Optionally, in this embodiment, the image magnification page also includes an image correction trigger control, and the image processing method of this embodiment can also include:
[0138] When a trigger operation for the image correction trigger control is detected, four angle correction anchor points and correction controls are displayed on the image magnification page;
[0139] Based on the movement operation of the angle correction anchor points, a quadrilateral area formed by the angle correction anchor points is determined, wherein the image in the quadrilateral area is the image to be corrected;
[0140] When a trigger operation for the correction control is detected, the corrected image is switched to be displayed on the image magnification page. The corrected image is a rectangular image mapped from the quadrilateral image to be corrected.
[0141] Optionally, the correction controls can be hidden when toggling display of the corrected image.
[0142] In this embodiment, the movement operation of the angle correction anchor point can be controlled by an external input device such as a mouse or a numerical control board, and this embodiment has no limitation on this.
[0143] In one example, the first text recognition result and the second text recognition result can be displayed simultaneously on the text recognition result page. Optionally, in this embodiment, the text recognition result page also includes: an original text recognition result area, the original text recognition result area includes the second text recognition result, the second text recognition result includes multiple texts recognized from multiple text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, and multiple texts cannot be edited across texts. The text recognition area is an area containing text detected from the image to be recognized.
[0144] For example, refer to Figure 3c The text recognition result page 306 includes an image area 3061 , a text recognition result area 3062 (displaying the first text recognition result), and an original text recognition result area 3063 (displaying the second text recognition result).
[0145] In this embodiment, all the above-mentioned solutions with the second text recognition result in the text recognition result area can replace the second text recognition result in the text recognition result area with the second text recognition result in the original text recognition result area (except for the editing mode switching solution based on the first editing mode switching control and the second editing mode switching control). This embodiment does not repeat the operation of the original text recognition area. Figure 3c The text recognition result page does not include any controls in the first editing mode switching control and the second editing mode switching control.
[0146] In this embodiment, the step of “when a text recognition instruction for the image to be recognized is detected, displaying a text recognition result page” may include:
[0147] When a text recognition instruction for the image to be recognized is detected, text recognition is performed on multiple text regions of the image to be recognized, wherein the text recognized from each text region is respectively regarded as a text recognition unit;
[0148] Using the same editor to edit the texts of the multiple text recognition units into editable texts, to obtain a first text recognition result;
[0149] The text recognition results page is displayed.
[0150] In this embodiment, when performing text recognition on the image to be recognized, an area where text may exist may be determined from the image to be recognized, that is, the text recognition area described in the above example, and then the text in the text recognition area may be recognized.
[0151] In the above steps, the text area of the image to be recognized can be understood as the area where text may exist, which is first recognized from the image to be recognized when performing text recognition on the image to be recognized. Optionally, in this embodiment, when a text recognition instruction for the image to be recognized is detected, the API (Application Programming Interface) of the background OCR application or the SDK (Software Development Kit) of the local OCR can be called to recognize the text in the image to be recognized, wherein each recognized sentence can be independent as a sentence and correspond to the original text in the image to be recognized based on the text recognition area identifier. In the traditional recognition result, each line of text recognition area corresponds to an editor, and the recognized text cannot be edited across lines. However, this embodiment provides a new mixed type editor. When the user clicks the second editing mode switching operation, each text in the second text recognition result can be edited in an editor in a certain order, for example, in an editor in the order of the serial numbers corresponding to each text in the text recognition result page. Optionally, each sentence of text can be displayed in a line break, and the user can edit and adjust the content across lines and sentences just like editing txt.
[0152] In one example, the editing operation on the text in the first text recognition result does not affect the text in the image to be recognized. For example, in the first text recognition result, a paragraph is deleted, but the paragraph still exists in the image to be recognized.
[0153] By using the image processing method of the embodiment of the present invention, it is possible to determine the image to be recognized in the instant messaging client, perform text recognition on the image to be recognized, and display a text recognition result page after the text recognition is successful, wherein the text recognition result page includes an image area and a text recognition result area, wherein the image area includes the image to be recognized, and the text recognition result area includes a first text recognition result, and the first text recognition result includes recognized text units corresponding to each text area, wherein the recognized text units can be edited across text units, thereby all texts recognized from an image to be recognized can be edited at the same time, which is beneficial to improving the user experience.
[0154] The embodiment of the present invention also provides a detailed image processing method, which can be executed by a processor of a terminal, or by a processor of a terminal and a server together, such as Figure 4a As shown, the process of the image processing method can be as follows:
[0155] 401. Receive shortcut key command.
[0156] 402. Analyze the response object of the shortcut key command and the indicated operation.
[0157] 403. When it is determined that the shortcut key instruction is a screenshot recognition instruction that needs to be responded to by the instant messaging client, a page to be screenshoted is displayed.
[0158] 404. When a screenshot completion operation for the page to be screenshotted is detected, an image to be identified is generated based on the page to be screenshotted within the screenshot range corresponding to the screenshot completion operation, and a text recognition instruction for the image to be identified is triggered.
[0159] refer to Figure 4b , Figure 4b Another form of flowchart is shown in FIG. The above describes a solution for obtaining an image to be identified by taking a screenshot. In one example, Figure 4b As shown, an image can also be selected in the chat session page of the instant messaging client as the image to be identified. This embodiment has no limitation on this. The specific selection process can be described in the related description of the aforementioned embodiment.
[0160] 405. Calling the text recognition program through the API interface of the text recognition program to perform text recognition on the image to be recognized, and obtaining position information of multiple text recognition areas in the image to be recognized and multiple texts recognized from the multiple text recognition areas;
[0161] Among them, the text to be recognized can be first recognized in the text recognition area, that is, multiple text recognition areas where text exists in the image to be recognized are first determined, and then the text is recognized from the text recognition area, wherein the text recognized by one text recognition area is a text, and when the text recognition area where text exists in the image to be recognized is determined, the position information such as coordinates of the text recognition area in the image to be recognized can also be obtained;
[0162] The text recognition program may be an application program that implements an OCR function. In another example, the OCR recognition of the image to be recognized may be implemented by calling an SDK of the OCR function.
[0163] During OCR recognition, the position information of the text recognition area in the image to be recognized and each text from each text recognition area are obtained. The OCR application can return multiple texts according to the position of their text recognition areas in the image to be recognized. Optionally, they can be returned in order from top to bottom and from left to right, that is, the text corresponding to the upper text recognition area is arranged in front, and the text recognition areas are basically on the same horizontal line, and the text corresponding to the text recognition area located on the left in the image to be recognized is arranged in front.
[0164] In this embodiment, step 405 may be completed by the server. For example, the terminal sends the image to be recognized to the server, triggering the server to perform text recognition on the image to be recognized, and obtaining position information of multiple text recognition areas in the image to be recognized and multiple texts recognized from the multiple text recognition areas.
[0165] 406. Editing each piece of text recognized by each text recognition area based on different editors, and obtaining a second text recognition result based on each piece of text after the edit;
[0166] In this embodiment, after obtaining the text returned by the OCR application, an editor may be created for each text based on the return order of each text to edit the text, and each text may be set as editable text through the editor.
[0167] 407. Displaying a text recognition result page, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes an image to be recognized, the image to be recognized includes a text recognition area identifier, and the text recognition area identifier is used to identify the text recognition area recognized in the image to be recognized; the text recognition result area includes a second text recognition result and a second edit mode switching control;
[0168] In this embodiment, the second text recognition result includes multiple texts recognized from multiple text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, and multiple texts cannot be edited across texts. The text recognition area is the area containing text detected from the image to be recognized.
[0169] In this embodiment, the text recognition result area also includes a copy control. After the second text recognition result is displayed, user operations can be monitored. Optionally, when a user trigger operation on the copy control is detected, the text in the second text recognition result is added to a copy text collection, and the copy text collection can be stored in the memory area corresponding to the clipboard (ClipBoard).
[0170] 408. When a trigger operation for the second editing mode switching control is detected, the second editing mode switching control is hidden, and the first text recognition result is switched to be displayed in the text recognition result area. The text recognition result area after switching the display also includes the first editing mode switching control. The first text recognition result includes each text recognized from each text recognition area, wherein multiple texts can be edited across texts.
[0171] The above-mentioned multiple texts can be edited across the texts, which can be understood as that two or more texts in the first text recognition result can be edited at the same time.
[0172] Among them, in the first text recognition result, the text recognized from the image to be recognized can be freely edited, and the touch operation of the first editing mode switching control can be considered as switching to the free editing mode. In this embodiment, the first text recognition result can be generated only when the trigger operation of the second editing mode switching control is detected.
[0173] Optionally, when a trigger operation for the second editing mode switching control is detected, the generation of the first text recognition result is triggered. The generation of the first text recognition result may include: obtaining each text from each text recognition area, inputting each text into the same editor in the order returned by the OCR application, and having the editor edit all the text into editable text to obtain the first text recognition result.
[0174] 409. When a trigger operation on the first editing mode switching control is detected, the second text recognition result is switched to be displayed in the text recognition result area.
[0175] Similarly, the monitoring service can be used to detect whether the free editing mode needs to be closed. When a trigger operation on the first editing mode switching control is detected, the free editing mode is closed, the first editing mode switching control is hidden, and the second text recognition result is displayed.
[0176] By using the image processing method provided by the embodiment of the present invention, an image to be identified in an instant messaging client can be determined; when a text recognition instruction for the image to be identified is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be identified, the text recognition result area includes a first text recognition result, the first text recognition result includes an identified text unit corresponding to each text area, wherein the identified text units can be edited across text units, thereby, all texts identified from an image to be identified can be edited at the same time, which is beneficial to improving the user experience.
[0177] In order to better implement the above method, accordingly, an image processing device is also provided, wherein the image processing device can be integrated in a terminal, or integrated in a server, or integrated in a terminal and a server. Figure 5 , the image processing device comprises:
[0178] A determination unit 501 is used to determine an image to be identified in an instant messaging client, where the image to be identified includes multiple text areas;
[0179] The recognition result display unit 502 is used to display a text recognition result page when a text recognition instruction for an image to be recognized is detected, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, and the first text recognition result includes recognized text units corresponding to each text area, wherein recognized text units can be edited across text units.
[0180] Optionally, determine the unit, including:
[0181] A first display subunit is used to display a chat session page of the instant messaging client, wherein the chat session page includes images sent by the chat session users;
[0182] The first trigger subunit is used to, when a text recognition operation on an image is detected, determine the image corresponding to the text recognition operation as an image to be recognized, and trigger the generation of a text recognition instruction for the image to be recognized.
[0183] Optionally, determine the unit, including:
[0184] The second display subunit is used to display the page to be screenshotted when a screenshot identification instruction that needs to be responded to by the instant messaging client is detected;
[0185] The second trigger subunit is used to generate an image to be recognized based on the page to be screenshot within the screenshot range corresponding to the screenshot end operation when a screenshot end operation is detected for the page to be screenshot. This triggers generation of a text recognition instruction for the image to be recognized.
[0186] Optionally, the recognition result display unit includes:
[0187] The zoom display subunit is used to display an image zoom page of the image when a zoom display operation on the image in the chat session page is detected, and the image zoom page includes an image and a text recognition control in a zoom display state;
[0188] The third trigger subunit is used to determine the image displayed on the image magnification page as the image to be recognized when a trigger operation on the text recognition control is detected, and trigger the generation of a text recognition instruction for the image to be recognized.
[0189] Optionally, the second display subunit is used to: receive a shortcut key instruction; analyze the response object and the indicated operation of the shortcut key instruction; and display a page to be screenshot when it is determined that the shortcut key instruction is a screenshot recognition instruction that requires a response from the instant messaging client.
[0190] Optionally, the second display subunit is used to display a chat session page of the instant messaging client, the chat session page includes a screenshot recognition control; when a trigger operation for the screenshot recognition control is detected, triggering generation of a screenshot recognition instruction; and displaying a page to be screenshotted.
[0191] Optionally, when the text recognition result area includes the first text recognition result, the text recognition result area also includes a first editing mode switching control, and the device of this embodiment further includes:
[0192] The first switching display unit is used to switch and display a second text recognition result in the text recognition result area when a trigger operation for the first editing mode switching control is detected. The second text recognition result includes multiple texts recognized from multiple text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, and multiple texts cannot be edited across texts. The text recognition area is an area containing text detected from the image to be recognized.
[0193] When the text recognition result area includes a second text recognition result, the text recognition result area also includes a second editing mode switching control. The device of this embodiment also includes: a second switching display unit, which is used to switch the display of the first text recognition result in the text recognition result area when a trigger operation for the second editing mode switching control is detected.
[0194] Optionally, in one example, the text recognition result page also includes: an original text recognition result area, the original text recognition result area includes a second text recognition result, the second text recognition result includes multiple texts recognized from multiple text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, multiple texts cannot be edited across texts, and the text recognition area is an area containing text detected from the image to be recognized.
[0195] Optionally, when the text recognition result area includes the second text recognition result, the image processing device of this embodiment further includes:
[0196] A modification unit, configured to obtain a modified text corresponding to the target text based on a text editing operation on the target text in the second text recognition result;
[0197] An updating display unit is used to update and display the image to be recognized and the second text recognition result on the text recognition result page when the text editing operation for the target text is detected to be completed. After the update, the text in the text recognition area corresponding to the target text in the image to be recognized is replaced by the modified text, and the target text in the second text recognition result is replaced by the modified text.
[0198] Optionally, the image magnification page of this embodiment further includes an image correction trigger control, and the image processing device of this embodiment further includes:
[0199] A correction trigger unit, used to display four angle correction anchor points and correction controls on the image magnification page when a trigger operation for the image correction trigger control is detected;
[0200] An anchor point determination unit, used to determine a quadrilateral area formed by the angle correction anchor points based on a movement operation on the angle correction anchor points, wherein the image in the quadrilateral area is an image to be corrected;
[0201] The image switching display unit is used to switch and display the corrected image on the image magnification page when a trigger operation for the correction control is detected. The corrected image is a rectangular image mapped from the quadrilateral image to be corrected.
[0202] Optionally, a recognition result display unit is used to perform text recognition on multiple text areas of the image to be recognized when a text recognition instruction for the image to be recognized is detected, wherein the text recognized from each text area is respectively used as a text recognition unit; the text of the multiple text recognition units is edited into editable text using the same editor to obtain a first text recognition result; and the text recognition result page is displayed.
[0203] In this embodiment, the first text recognition result can be displayed on the text recognition result page of the image to be recognized, so that the user can perform text editing similar to TXT that can cross lines and sentences on all texts extracted from the image to be recognized, thereby improving the user experience of the image text recognition function.
[0204] In addition, an embodiment of the present invention further provides a computer device, which may be a terminal or a server. Figure 6 As shown, it shows a schematic diagram of the structure of a computer device involved in an embodiment of the present invention, specifically:
[0205] The computer device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that Figure 6The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0206] The processor 601 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, it executes various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0207] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein 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 according to the use of the computer device, etc. In addition, the memory 602 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, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0208] The computer device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0209] The computer device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0210] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 601 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602 to implement various functions, for example, to implement any method provided in the embodiments of the present application. Optionally, the following method may be implemented:
[0211] Determine an image to be identified in an instant messaging client, where the image to be identified includes multiple text areas;
[0212] When a text recognition instruction for an image to be recognized is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, the first text recognition result includes recognized text units corresponding to each text area, wherein recognized text units can be edited across text units.
[0213] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0214] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0215] To this end, an embodiment of the present invention further provides a storage medium, in which a plurality of instructions are stored. The instructions can be loaded by a processor to execute the image processing method provided by the embodiment of the present invention.
[0216] The image processing system involved in the embodiment of the present invention can be a distributed system formed by connecting a client and multiple nodes (computer devices of any form connected to the network, such as a server and a terminal) through network communication. The image processing method involved in the present invention can be executed by any computer device connected to the distributed system.
[0217] Take the distributed system as the blockchain system as an example, see Figure 7 , Figure 7It is an optional structural diagram of the distributed system 700 provided by the embodiment of the present invention applied to the blockchain system, which is formed by multiple nodes 701 (any form of computing devices in the access network, such as servers and user terminals) and clients 702, and the nodes form a peer-to-peer (P2P, Peer To Peer) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP, Transmission Control Protocol) protocol. In the distributed system, any machine such as a server or a terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer. Among them, the image to be recognized, the first text recognition result and the second text recognition result of the image to be recognized, etc. can all be stored in the shared account book of the regional chain system through the nodes of the distributed system.
[0218] See also Figure 7 The functions of each node in the blockchain system shown include:
[0219] 1) Routing: a basic function of a node, used to support communication between nodes.
[0220] In addition to the routing function, the node can also have the following functions:
[0221] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.
[0222] For example, the services implemented by the application include:
[0223] 2.1) Wallet, used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After the other nodes successfully verify the transaction, as a response to acknowledge the validity of the transaction, the transaction record data is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;
[0224] 2.2) Shared ledger, which is used to provide functions such as storage, query and modification of account data. The record data of the operation on the account data is sent to other nodes in the blockchain system. After other nodes verify the validity, as a response to acknowledging the validity of the account data, the record data is stored in a temporary block, and a confirmation can also be sent to the node that initiated the operation.
[0225] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying code on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0226] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0227] See also Figure 8 , Figure 8 This is an optional schematic diagram of the block structure provided by an embodiment of the present invention. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.
[0228] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0229] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0230] Since the instructions stored in the storage medium can execute the steps in the image processing method provided in the embodiment of the present invention, the beneficial effects that can be achieved by the image processing method provided in the embodiment of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0231] The above is a detailed introduction to an image processing method, device, computer equipment and storage medium provided by an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An image processing method, characterized in that: include: Determine an image to be identified in an instant messaging client, wherein the image to be identified includes a plurality of text areas; When a text recognition instruction for the image to be recognized is detected, a text recognition result page is displayed, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, the first text recognition result includes a recognized text unit corresponding to each text area, wherein the recognized text units can be edited across text units, the text in each of the recognized text units is the text recognized in the corresponding text area, and the texts in all the text areas included in the first text recognition result correspond to the same editor; When a trigger operation for the first editing mode switching control is detected, the second text recognition result is switched to be displayed in the text recognition result area, wherein the second text recognition result includes multiple texts recognized from multiple text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, and the multiple texts cannot be edited across texts, and the text recognition area is an area containing text detected from the image to be recognized; When a trigger operation on the second editing mode switching control is detected, the first text recognition result is switched to be displayed in the text recognition result area.
2. The image processing method according to claim 1, characterized in that: The step of determining the image to be identified in the instant messaging client includes: Displaying a chat session page of an instant messaging client, the chat session page including images sent by a user of the chat session; When a text recognition operation for an image is detected, the image corresponding to the text recognition operation is determined as an image to be recognized, triggering generation of a text recognition instruction for the image to be recognized.
3. The image processing method according to claim 1, characterized in that: The step of determining the image to be identified in the instant messaging client includes: When a screenshot recognition instruction that needs to be responded to by the instant messaging client is detected, a page to be screenshoted is displayed; When a screenshot completion operation for the page to be screenshotted is detected, an image to be identified is generated based on the page to be screenshotted within the screenshot range corresponding to the screenshot completion operation, triggering generation of a text recognition instruction for the image to be identified.
4. The image processing method according to claim 2, characterized in that: When a text recognition operation on an image is detected, the image corresponding to the text recognition operation is determined as an image to be recognized, and a text recognition instruction for the image to be recognized is triggered, including: When a zoom-in display operation for an image in the chat session page is detected, an image zoom-in page of the image is displayed, the image zoom-in page including the image in a zoom-in display state and a text recognition control; When a trigger operation for the text recognition control is detected, the image displayed on the image magnification page is determined as an image to be recognized, and a text recognition instruction for the image to be recognized is triggered to be generated.
5. The image processing method according to claim 3, characterized in that: When a screenshot recognition instruction that needs to be responded to by the instant messaging client is detected, a page to be screenshot is displayed, including: Receive shortcut key instructions; Analyzing the response object and the indicated operation of the shortcut key command; When it is determined that the shortcut key instruction is a screenshot recognition instruction that needs to be responded to by the instant messaging client, a page to be screenshoted is displayed.
6. The image processing method according to claim 3, characterized in that: When a screenshot recognition instruction that needs to be responded to by the instant messaging client is detected, a page to be screenshot is displayed, including: Displaying a chat session page of an instant messaging client, wherein the chat session page includes a screenshot recognition control; When a trigger operation for the screenshot recognition control is detected, triggering generation of a screenshot recognition instruction; The page to be captured is displayed.
7. The image processing method according to claim 1, characterized in that: The text recognition result page also includes: an original text recognition result area, the original text recognition result area includes a second text recognition result, the second text recognition result includes multiple texts recognized from multiple text recognition areas in the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, and the multiple texts cannot be edited across texts, and the text recognition area is an area containing text detected from the image to be recognized.
8. The image processing method according to claim 1, characterized in that: When the text recognition result area includes the second text recognition result, the method further includes: Based on the text editing operation on the target text in the second text recognition result, obtaining a modified text corresponding to the target text; When the text editing completion operation for the target text is detected, the image to be recognized and the second text recognition result are updated and displayed on the text recognition result page. After the update, the text in the text recognition area corresponding to the target text in the image to be recognized is replaced by the modified text, and the target text in the second text recognition result is replaced by the modified text.
9. The image processing method according to claim 4, characterized in that: The image magnification page also includes an image correction trigger control, and the method further includes: When a trigger operation for the image correction trigger control is detected, four angle correction anchor points and correction controls are displayed on the image magnification page; Based on the movement operation of the angle correction anchor point, determining a quadrilateral area formed by the angle correction anchor points, wherein the image in the quadrilateral area is the image to be corrected; When a trigger operation for the correction control is detected, the corrected image is switched to be displayed on the image magnification page, and the corrected image is a rectangular image mapped from the quadrilateral image to be corrected.
10. The image processing method according to claim 1, characterized in that: When a text recognition instruction for the image to be recognized is detected, a text recognition result page is displayed, including: When a text recognition instruction for the image to be recognized is detected, text recognition is performed on multiple text regions of the image to be recognized, wherein the text recognized from each text region is respectively used as a text recognition unit; Using the same editor to edit the texts of the multiple text recognition units into editable texts, to obtain a first text recognition result; The text recognition results page is displayed.
11. An image processing device, characterized in that: include: A determination unit, used to determine an image to be identified in an instant messaging client, wherein the image to be identified includes a plurality of text areas; A recognition result display unit, used for displaying a text recognition result page when a text recognition instruction for the image to be recognized is detected, wherein the text recognition result page includes an image area and a text recognition result area, the image area includes the image to be recognized, the text recognition result area includes a first text recognition result, the first text recognition result includes a recognized text unit corresponding to each text area, wherein the recognized text units can be edited across text units, the text in each of the recognized text units is the text recognized in the corresponding text area, and the texts in all the text areas included in the first text recognition result correspond to the same editor; The device is also used for: when a trigger operation for the first editing mode switching control is detected, switching to display a second text recognition result in the text recognition result area, the second text recognition result includes a plurality of texts recognized from a plurality of text recognition areas of the image to be recognized, wherein each text corresponds to a text recognition area in the image to be recognized, the plurality of texts cannot be edited across texts, and the text recognition area is an area containing text detected from the image to be recognized; When a trigger operation on the second editing mode switching control is detected, the first text recognition result is switched to be displayed in the text recognition result area.
12. A storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Picture processing method and terminal
CN105184838A
Picture identification, mobile terminal and computer readable storage medium
CN108874283A