Image processing method, device, computer readable storage medium and computer equipment

By automatically identifying and processing text content areas in images in instant messaging applications, and performing image enhancement and position correction, the problem of difficult recognition of text content caused by poor shooting environments is solved, and the clarity of text content is improved and the efficiency of image processing is improved. improvement.

CN115348362BActive Publication Date: 2025-01-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110462254.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-27
Publication Date
2025-01-21
Estimated Expiration
2041-04-27

AI Technical Summary

Technical Problem

In instant messaging applications, the pictures taken by the mobile phone are difficult to recognize due to poor shooting environment or poor light source position.

Method used

An image processing method is provided that automatically identifies the text content area in the image and performs image enhancement processing and position correction processing, thereby improving the clarity of the text content.

Benefits of technology

Through automatic recognition and processing, the clarity of text content in images is significantly improved and the efficiency of image processing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115348362B_ABST
    Figure CN115348362B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses an image processing method, device, computer-readable storage medium and computer equipment. The method displays an image display page of an instant messaging client; in response to a trigger operation for an image editing trigger control, displays an image editing page of a target image; in response to a trigger operation for an image content enhancement control, identifies the position of a text content area in a target image to display a first target text image, wherein the first target text image includes a first target text content area, and the first target text content area is an area of ​​the text content area after image enhancement processing and position correction processing. In this way, by automatically identifying the text content area in the image, and performing image enhancement processing and position correction processing on the text content area, the method can improve the clarity of the text content in the target image, thereby improving the efficiency of image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, an apparatus, a computer-readable storage medium and a computer device. Background Art

[0002] With the development of Internet technology and the popularization of smart mobile terminals, communication between people has become more and more convenient, and instant messaging is undoubtedly the most convenient and economical way of communication in the era of the Internet of Things.

[0003] People use instant messaging applications not only for chatting, but also for processing text content in many cases. For example, in a distance learning scenario, students need to use instant messaging applications to take photos of their completed homework and send them to their teachers for correction.

[0004] However, photos taken with mobile phones are often difficult to recognize text content in the images due to poor shooting environment or poor light source position. Summary of the invention

[0005] The embodiments of the present application provide an image processing method, apparatus, computer-readable storage medium and computer equipment. The method can automatically identify the text content area in the image, and perform image enhancement processing and position correction processing on the text content area, thereby improving the clarity of the text content in the image and further improving the efficiency of image processing.

[0006] The first aspect of the present application provides an image processing method, comprising:

[0007] Displaying an image display page of an instant messaging client, the image display page including an image editing trigger control and a target image, the target image including a text content area;

[0008] In response to a trigger operation on the image editing trigger control, displaying an image editing page of the target image, the image editing page including an image content enhancement control;

[0009] In response to a trigger operation for the image content enhancement control, the position of the text content area in the target image is identified to display a first target text image, wherein the first target text image includes a first target text content area, which is the area of ​​the text content area after image enhancement processing and position correction processing.

[0010] Accordingly, a second aspect of the present application provides an image processing device, including:

[0011] A first display unit, used to display an image display page of an instant messaging client, wherein the image display page includes an image editing trigger control and a target image, wherein the target image includes a text content area;

[0012] A second display unit, configured to display an image editing page of the target image in response to a trigger operation on the image editing trigger control, wherein the image editing page includes an image content enhancement control;

[0013] A third display unit is used to identify the position of the text content area in the target image in response to a trigger operation on the image content enhancement control to display a first target text image, wherein the first target text image includes a first target text content area, and the first target text content area is an area of ​​the text content area after image enhancement processing and position correction processing.

[0014] In some embodiments, the apparatus further comprises:

[0015] a fourth display unit, configured to display a calibration trigger control of the first target text image;

[0016] a fifth display unit, configured to display a calibration page in response to a trigger operation on the calibration trigger control, the calibration page including the target image, the area positioning mark of the text content area, and the calibration control;

[0017] A positioning unit, configured to reposition the text content area in response to a drag operation on the area positioning mark;

[0018] The sixth display unit is used to display a second target text image in response to a trigger operation on the calibration control, wherein the second target text image includes a second target text content area, and the second target text content area is an area after the repositioned text content area has been subjected to image enhancement processing and position correction processing.

[0019] In some embodiments, the area positioning mark includes a positioning frame of the text content area and a positioning reference point located on the positioning frame, and the positioning unit includes:

[0020] A first determining subunit, configured to redefine a positioning frame including the text content area in response to a drag operation on the positioning reference point;

[0021] The positioning subunit is used to reposition the text content area according to the re-determined positioning frame.

[0022] In some embodiments, the apparatus further comprises:

[0023] A seventh display unit, for displaying an effect control of the first target text image;

[0024] An eighth display unit is used to switch and display a third target text image in response to a trigger operation on the effect control, where the third target text image is an image of the first target text image after the enhancement effect restoration processing is performed.

[0025] In some embodiments, the apparatus further comprises:

[0026] a ninth display unit, configured to display a save control for the first target text image;

[0027] A saving unit is used to save the first target text image in response to a triggering operation on the saving control.

[0028] In some embodiments, the first display unit includes:

[0029] A first display subunit, used to display a session page of a target session in an instant messaging client;

[0030] The second display subunit is used to display an image display page of the instant messaging client in response to an image browsing operation in the conversation page.

[0031] In some embodiments, the second display subunit includes:

[0032] A first display module, used for displaying an image shooting control in the session page;

[0033] A second display module, in response to a trigger operation on the image shooting control, displays an image shooting page;

[0034] The third display module is used to display an image display page of the instant messaging client in response to a shooting operation on the image shooting page, wherein the image display page includes the shot target image.

[0035] In some embodiments, the second display subunit includes:

[0036] A fourth display module, configured to display an image selection control in the session page;

[0037] a fifth display module, configured to display a candidate image list in response to a touch operation on the image selection control, the list including at least one candidate image;

[0038] The sixth display module is used to display an image display page of the instant messaging client in response to a selection operation on a candidate image in the candidate image list, wherein the image display page includes a target image selected by the selection operation.

[0039] In some embodiments, the apparatus further comprises:

[0040] a seventh display module, configured to display a sending control for the first target text image;

[0041] The sending module is used to send the first target text image to the target client corresponding to the member in the target session in response to the trigger operation on the sending control, and display the sent first target text image in the session page.

[0042] In some embodiments, the editing page further includes an editing control list, the editing control list includes at least one image editing control, and the apparatus further includes:

[0043] A display unit, used for receiving an editing operation on the target image input through an image editing control, and displaying the edited image;

[0044] The third display unit is also used for:

[0045] In response to a triggering operation on the image content enhancement control, a position of a text content area in the edited image is identified to display a first target text image.

[0046] In some embodiments, the image processing device provided by the present application further includes a shadow removal unit, and the shadow removal unit includes:

[0047] An acquisition subunit, used to acquire a shadow value of each pixel in the target image;

[0048] A calculation subunit, used for calculating a target pixel value of each pixel point according to a pixel value and a shadow value of each pixel point in the target image;

[0049] The updating subunit is used to update the pixel value of each pixel in the target image to the corresponding target pixel value to obtain a shadow-removed image.

[0050] In some embodiments, the third display unit includes:

[0051] A second determining subunit, configured to determine a position of a text content area in the target image in response to a triggering operation on the image content enhancement control;

[0052] A correction subunit, used for performing position correction processing on the image corresponding to the position of the text content area to obtain a transition image;

[0053] An enhancement subunit, configured to perform image enhancement processing on the transition image to obtain a first target text image;

[0054] The third display subunit is used to display the first target text image.

[0055] In some embodiments, the enhancer unit comprises:

[0056] A first determination module, used to determine the color type to which the transition image belongs;

[0057] A second determination module is used to determine a target image enhancement method associated with the color type;

[0058] The enhancement module is used to perform image enhancement processing on the transition image by adopting the target image enhancement method to obtain a first target text image.

[0059] In some embodiments, the enhancement module includes:

[0060] an adjusting submodule, for adjusting the brightness of the transition image to obtain a first target text image when it is detected that the transition image is a color image;

[0061] The processing submodule is used to perform shadow removal and text content enhancement processing on the transition image to obtain a first target text image when it is detected that the transition image is a black and white image.

[0062] In some embodiments, the determining subunit comprises:

[0063] A detection module, configured to receive a trigger operation for the image content enhancement control, perform edge detection on the target image, and determine a plurality of edge line segments according to the edge detection result;

[0064] A third determination module, configured to determine a plurality of target line segments corresponding to the text content area from the plurality of edge line segments;

[0065] The fourth determination module is used to determine the position of the text content area according to the multiple target line segments.

[0066] In some embodiments, the syndrome unit comprises:

[0067] An acquisition module, used for acquiring coordinate information of each endpoint of the plurality of target line segments;

[0068] A fifth determination module, used to determine target coordinate information of each endpoint of the plurality of target line segments after position correction processing;

[0069] A calculation module, used for calculating a mapping relationship according to the coordinate information and the target coordinate information;

[0070] A mapping module is used to perform mapping processing on the image corresponding to the position of the text content area according to the mapping relationship to obtain a transition image.

[0071] The third aspect of the present application also provides a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the steps of the image processing method provided in the first aspect of the present application.

[0072] The fourth aspect of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image processing method provided in the first aspect of the present application when executing the computer program.

[0073] In a fifth aspect, the present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the image processing method provided in the first aspect.

[0074] The image processing method provided by the embodiment of the present application is to display the image display page of the instant messaging client, the image display page includes an image editing trigger control and a target image, and the target image includes a text content area; in response to the trigger operation of the image editing trigger control, the image editing page of the target image is displayed, and the image editing page includes an image content enhancement control; in response to the trigger operation of the image content enhancement control, the position of the text content area in the target image is identified to display the first target text image, the first target text image includes a first target text content area, and the first target text content area is the area of ​​the text content area after image enhancement processing and position correction processing. In this way, by automatically identifying the text content area in the image, and performing image enhancement processing and position correction processing on the text content area, the clarity of the text content in the image is improved, thereby improving the efficiency of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] 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.

[0076] Figure 1 It is a schematic diagram of the scene of image processing provided by this application;

[0077] Figure 2 It is a flowchart of the image processing method provided by this application;

[0078] Figure 3 is another schematic diagram of image processing provided by this application;

[0079] Figure 4 is another schematic diagram of an image processing scenario provided by this application;

[0080] Figure 5 is another schematic diagram of an image processing scenario provided by this application;

[0081] Figure 6 is another schematic diagram of an image processing scenario provided by this application;

[0082] Figure 7 is another schematic diagram of an image processing scenario provided by this application;

[0083] Figure 8 is another schematic diagram of an image processing scenario provided by this application;

[0084] Fig. 9 is another schematic diagram of an image processing scenario provided by this application;

[0085] Fig.10 is another schematic diagram of an image processing scenario provided by this application;

[0086] Fig.11 is another schematic diagram of an image processing scenario provided by this application;

[0087] Fig.12 is another flow chart of the image processing method provided by the present application;

[0088] Fig.13A is another schematic diagram of an image processing scenario provided by this application;

[0089] Fig. 13B is another schematic diagram of an image processing scenario provided by this application;

[0090] Fig.14 is a structural schematic diagram of an image processing device provided by the present application;

[0091] Fig.15 It is a structural schematic diagram of the computer device provided by this application. DETAILED DESCRIPTION

[0092] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings 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.

[0093] The embodiments of the present invention provide an image processing method, apparatus, computer-readable storage medium, and computer equipment. The image processing method can be used in an image processing apparatus. The image processing apparatus can be integrated in a computer equipment, and the computer equipment can be a terminal. The terminal can be a mobile phone, a tablet computer, a laptop computer, a smart TV, a wearable smart device, a personal computer (PC), and the like.

[0094] See also Figure 1 , is a schematic diagram of the image processing scenario provided by the present application; as shown in the figure, the terminal acquires a target image, which can be a captured image or an image saved in the terminal. Then, the image display page of the instant messaging client loaded in the terminal is displayed, and the acquired target image and the image editing trigger control are displayed in the image display page. In response to the trigger operation for the image editing trigger control, the image editing page of the target image is displayed, and the image editing page includes an image content enhancement control. In response to the trigger operation for the image content enhancement control, the position of the first text content area in the target image is identified to display the first target text image. Among them, the first target text image includes a first target text content area, and the first target text content area is the area after the first text content area has been processed by image enhancement and position correction.

[0095] It should be noted that Figure 1 The image processing scenario diagram shown is only an example. The image processing scenario described in the embodiment of the present application is to more clearly illustrate the technical solution of the present application and does not constitute a limitation on the technical solution provided by the present application. It is known to those skilled in the art that with the evolution of image processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.

[0096] Based on the above implementation scenarios, detailed descriptions are given below.

[0097] The embodiments of the present application will be described from the perspective of an image processing device, which can be integrated in a computer device. The computer device can be a terminal, which can be a mobile phone, a tablet computer, a laptop computer, a smart TV, a wearable smart device, a personal computer (PC), and the like. Figure 2 FIG. 1 is a flow chart of an image processing method provided by the present application, and the method comprises:

[0098] Step 101: display an image display page of an instant messaging client.

[0099] Among them, the instant messaging client is the user end of the instant messaging software. The instant messaging software is software that uses instant messaging technology to achieve online chatting and communication, such as WeChat, QQ and enterprise WeChat.

[0100] The image display page of the instant messaging client can be a display page that opens images sent by other instant messaging clients in the conversation page of the instant messaging client for display, or it can be a display page that displays images after the image acquisition function (such as scanning or taking a photo) of the instant messaging client acquires the image.

[0101] At present, when using an instant messaging client to process images with text content, the text content in the captured image may be difficult to recognize due to poor ambient light or poor light source position when the image was captured. In response to this, the present application proposes an image processing method to enhance images with text content to improve the recognizability of the text content in the image. The image processing method provided by the present application is described in detail below.

[0102] In the image display interface of the instant messaging client, the target image to be processed is displayed, and the editing trigger control is also displayed in the display page. The target image can be an image collected by the instant messaging client, an image saved in the current terminal, or an image received by the instant messaging client and sent by other instant messaging clients. Moreover, the target image contains a text content area. Specifically, Figure 3 FIG. 1 is another schematic diagram of an image processing scenario provided by the present application. As shown in the figure, in the image display interface 10 of the instant messaging client, a target image 110 and an edit trigger control 120 are displayed, wherein the target image 110 includes a text content area 111, wherein Figure 3 The dotted line in the figure indicating the text content area 111 only indicates that there is a text content area 111 in the figure. When the target image is actually displayed, there is no such line. The edit trigger control 120 can be displayed as follows Figure 3The control with the word "Edit" shown may also be an edit trigger icon such as a magic wand. The edit trigger control 120 may be located in the area where the target image 110 is displayed, or may be located outside the area where the target image 110 is displayed. Figure 3 What is shown in FIG. 1 is only an embodiment in which the edit trigger control 120 is located in the area where the target image 110 is displayed. The edit trigger control 120 may also be located outside the area where the target image 110 is displayed. When the edit trigger control 120 is located in the area where the target image 110 is displayed, the edit trigger control 120 may also be located at any position in the area where the target image 110 is displayed.

[0103] The scattered background effect in the target image 110 illustrates the effects of color cast on the text image, shadows on the text, dark text, and unclear text as a whole caused by a bad shooting environment.

[0104] Among them, when the target image is an image captured by an instant messaging client, the target image may be an image obtained by photographing a text file using a camera function in the instant messaging client, or an image generated by scanning or photographing a text file using a scan function or a scan translation function in the instant messaging client. When the target image is an image saved in the current terminal, the target image may be an image obtained by a user photographing a text file using a camera function of the terminal, or an image with text content downloaded from the Internet by a user, or an image with text content sent by other instant messaging clients and saved by the user. When the target image is an image captured by an instant messaging client, the target image may be an image obtained by photographing a text file using a camera function of the instant messaging client.

[0105] In some embodiments, displaying an image display page of an instant messaging client includes:

[0106] 1. Display the session page of the target session in the instant messaging client;

[0107] 2. In response to the image browsing operation in the conversation page, an image display page of the instant messaging client is displayed.

[0108] Among them, the response is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.

[0109] In the embodiment of the present application, the display of the target image can be triggered in the session page of the target session in the instant messaging client. The session page of the target session can be a session page of a single chat or a session page of a group chat. In the session page of the target session, the user can send images to the clients of other session members, and can also receive images sent by other session members.

[0110] When receiving an image sent by other members in the session page of the target session, you can click on the thumbnail of the target image displayed in the message bar to browse the target image. In this case, the click operation on the thumbnail of the target image is an image browsing operation. In response to the image browsing operation, the image display page of the instant messaging client can be displayed. When it is necessary to send an image to other session members in the session page of the target session, the user also needs to first select the target image in the image library, or re-shoot an image as the target image. In this case, the selection operation and re-shooting operation in the image library are image browsing operations. In response to the image browsing operation, the image display page of the instant messaging client can also be displayed.

[0111] In some embodiments, in response to an image browsing operation on a conversation page, an image display page of an instant messaging client is displayed, including:

[0112] 1.1. Display the image capture control in the session page;

[0113] 1.2. In response to a trigger operation on an image capture control, an image capture page is displayed;

[0114] 1.3. In response to a shooting operation on the image shooting page, an image display page of the instant messaging client is displayed, and the image display page includes the shot target image.

[0115] In the embodiment of the present application, the image display page of the instant messaging client can be triggered by the shooting function in the conversation page of the instant messaging client. Figure 4 As shown, it is another scene schematic diagram of the image processing method provided by the present application. As shown in the figure, in the conversation page 20 of the instant messaging client, an image shooting control 210 is displayed, wherein the image shooting control 210 can be displayed at the bottom of the conversation page 20, or at other locations such as the top of the conversation page 20. A function control area can also be displayed in the conversation page 20, and the image shooting control 210 can be displayed in the function control area. Figure 4 The session page shown is a schematic diagram of a session page for a single-person session. The session page may also be a session page for a group chat, which will not be described in detail here.

[0116] When it is necessary to send an image to other members in the conversation page, the image capture control 210 can be clicked to enter the image capture page. The image capture page may include an image capture control. In response to a capture operation on the image capture page, or in response to a trigger operation on the image capture control, the image currently captured by the terminal camera is obtained, that is, the image currently displayed on the image capture page is obtained, and then the image capture page is displayed. Figure 3 The image display page 10 of the instant messaging client is shown. At this time, the target image 110 in the image display page 10 is an image captured in response to the shooting operation on the image shooting page, and the target image is an image containing text content.

[0117] In some embodiments, in response to an image browsing operation on a conversation page, an image display page of an instant messaging client is displayed, including:

[0118] A. Display image selection controls in the session page;

[0119] B. in response to a touch operation on an image selection control, displaying a candidate image list, the list including at least one candidate image;

[0120] C. In response to a selection operation on a candidate image in the candidate image list, an image display page of the instant messaging client is displayed, where the image display page includes the target image selected by the selection operation.

[0121] In the embodiment of the present application, the image display page of the instant messaging client can be triggered by the image selection function in the conversation page of the instant messaging client. Figure 5 As shown, it is another scene schematic diagram of the image processing method provided by the present application. As shown in the figure, in the conversation page 20 of the instant messaging client, an image selection control 220 is displayed. The image selection control 220 can be displayed at the bottom of the conversation page 20 of the instant messaging client as shown in the figure, and can also be displayed at other locations such as the top of the conversation page 20.

[0122] When it is necessary to send an image to other members in the conversation page, the image selection control 220 can be clicked to enter the image selection interface. In the image selection interface, a candidate image list can be displayed, and the candidate image list includes at least one candidate image. The image displayed in the candidate image list can be an image stored in the terminal where the instant messaging client is currently located. Then, in response to the selection operation of the candidate image in the candidate image list, the display is switched to the image selection interface. Figure 3 The image display page 10 of the instant messaging client is shown. The target image 110 displayed in the image display page 10 is the target image selected by the user in the candidate image list.

[0123] In some embodiments, a voice input control may also be displayed in the conversation page 20, and in response to the triggering operation of the voice input control, a voice command input by the user is received. The voice command may be used to trigger the display of the image display page of the instant messaging client. Then, in response to the voice command to open the target image, the image display page of the instant messaging client is displayed, and the image display page includes the target image corresponding to the voice command. Specifically, for example, if the voice command "open the ID card image" is input, the image with the "ID card" label in the images stored in the terminal will be searched. Then the image display page of the instant messaging client is displayed, and the image with the "ID card" label is displayed in the image display page. Of course, when storing the image in the terminal, a label may be set for each image. For example, the "ID card" label is set for the ID card photo taken, the "homework label" is set for the homework image taken, and even the "April 20 Homework" label may be set for the photo of the homework on April 20 in a more detailed manner.

[0124] Step 102: In response to a trigger operation on an image editing trigger control, an image editing page of a target image is displayed.

[0125] When the target image displayed in the image display page of the instant messaging client displayed in step 101 needs to be processed, the image editing trigger control displayed in the image display page can be clicked to trigger the image editing page displaying the target image, and the image editing page includes the content enhancement control 310. Specifically, when the user clicks Figure 3 When the edit trigger control 120 is activated, the image editing page of the target image 110 is displayed. Figure 6 , which is another scene schematic diagram of the image processing method provided by the present application, as shown in the figure, in the image editing page 30 of the target image 110, a content enhancement control 310 is displayed.

[0126] In some embodiments, the image editing page further includes an editing control list, the editing control list includes at least one image editing control, and in response to a trigger operation on the image content enhancement control, before identifying the position of the text content area in the target image to display the first target text image, further includes:

[0127] 1. Receive the editing operation of the target image input through the image editing control and display the edited image;

[0128] In response to a trigger operation on an image content enhancement control, identifying a position of a text content area in a target image to display a first target text image, comprising:

[0129] 2. In response to a trigger operation on the image content enhancement control, identify the position of the text content area in the edited image to display a first target text image.

[0130] In the embodiment of the present application, the image editing page also includes an editing control list, which includes multiple image editing controls, such as an "annotation" control, a "text" control, a "crop" control, and a "graffiti" control. The user can click on these image editing controls to perform corresponding editing operations on the target image. Specifically, Figure 7 As shown, it is another schematic diagram of the image processing provided by the present application. As shown in the figure, the image editing page 30 of the target image 110 includes not only a content enhancement control 310, but also an editing control list 320. Among them, the editing control list 320 can also include editing controls such as a labeling control 321, a text control 322, a cropping control 323, and a graffiti control 324.

[0131] The user can select any editing control in the editing page 30 to perform corresponding editing operations as needed, and obtain the corresponding edited image according to the editing operations. The edited image is an image obtained after performing the above editing operations on the target image, and the above editing operations do not include content enhancement operations. After the user completes the above editing operations, the above edited image is displayed in the editing page. At this time, the user can click the content enhancement control 310 again to realize image content enhancement and position correction processing on the edited image to obtain the first text image.

[0132] Step 103: In response to a trigger operation on the image content enhancement control, identify the position of the text content area in the target image to display a first target text image.

[0133] Wherein, as described in step 102, the image content enhancement control 310 is displayed in the image editing page 30, and the user can trigger the enhancement processing of the target image by clicking the content enhancement control 310. Wherein, the enhancement processing of the target image includes identifying the text content area in the target image and performing position correction and image enhancement processing on the text content area. Wherein, image enhancement refers to enhancing the useful information in the image, which can be a distortion process, and its purpose is to improve the visual effect of the image for the application of a given image. That is, image enhancement is to purposefully emphasize the overall or local characteristics of the image, make the originally unclear image clear or emphasize certain features of interest, expand the differences between the features of different objects in the image, suppress features of no interest, so as to improve the image quality, enrich the amount of information, strengthen the image interpretation and recognition effect, and meet the needs of certain special analysis.

[0134] Specifically, Figure 8As shown, it is another scene schematic diagram of the image processing method provided by the present application. As shown in the figure, in the enhanced display page 40, a first target text image 410 is displayed. Among them, the first target text image 410 is based on Figure 3 The image corresponding to the text content area 111 in the first target text image 410 is obtained after the position correction processing and image enhancement processing. That is, the first target text content area is included in the first target text image 410, and the first target text content area is the area after the text content area 111 is processed by the position correction processing and image enhancement processing. As shown in the figure, after the text content area 111 is processed by the image enhancement processing, the Figure 3 The scattered background effect in the image is removed, that is, the negative effects of color cast, text shadow, dark text, and overall unclear text caused by the poor shooting environment in the image corresponding to the text content area are removed. The text content in the text content area 111 is also made clearer and more readable. Moreover, since the position of the text content area 111 is adjusted, the originally crooked text is corrected, and since the corrected first target text image 410 is larger than the image size corresponding to the original text content area 111, the text size in the text content is also increased, further improving the clarity of the text content in the target image.

[0135] In some embodiments, the image enhancement processing described in the image processing method provided by the present application includes at least one of shadow removal processing or text content enhancement processing.

[0136] Specifically, the shadow removal process in the image processing method provided by the present application includes:

[0137] Get the shadow value of each pixel in the target image;

[0138] Calculate the target pixel value of each pixel point according to the pixel value and shadow value of each pixel point in the target image;

[0139] The pixel value of each pixel in the target image is updated to the corresponding target pixel value to obtain the image after shadow removal.

[0140] That is, in an embodiment of the present application, in order to remove the shadow in the target image and make the target image display clearer, the shadow degree of each pixel in the target image can be determined first. Specifically, the shadow value of each pixel in the target image can be determined by a flood filling method. Since the pixel value of each pixel in the target image is the product of the original pixel value of the text image and the shadow value, after obtaining the shadow value of each pixel in the target image, the current pixel value of each pixel in the target image can be further obtained, and then the quotient of the current pixel value of each pixel and its corresponding shadow value is calculated to obtain the original pixel value of the text image in the target image. The original pixel value of each pixel in the text image can be called the target pixel value of each pixel in the text image. In this way, the target pixel value of each pixel in the target image can be used to replace the current pixel value to perform shadow removal processing on the target image to obtain an image after shadow removal.

[0141] In some embodiments, obtaining the shadow value of each pixel in the transition image includes:

[0142] Determine shadow areas in the target image;

[0143] Perform shadow value detection on the pixel points in each shadow area to obtain the shadow value of the pixel points in each shadow area;

[0144] Then the target pixel value of each pixel is calculated according to the pixel value and shadow value of each pixel, including:

[0145] Calculate the target pixel value of each pixel in the shadow area according to the pixel value of each pixel in the shadow area and the shadow value of the pixel in each shadow area;

[0146] The target pixel value of each pixel in the target image is determined according to the target pixel value of the pixel in each shadow area, wherein the target pixel value of the pixel in the non-shadow area is the pixel value of the pixel in the non-shadow area.

[0147] Among them, to obtain the shadow value of each pixel in the target image, the shadow area in the target can be determined first. Since not all areas in the target image have shadow effects, before performing shadow removal processing on the target image, the shadow area with shadow effects in the target image can be determined first, and then the shadow values ​​of the pixels in the shadow area can be obtained. After obtaining the shadow values ​​of the pixels in the shadow area, the target pixel values ​​of the pixels in the shadow area are calculated according to the above method. For non-shadow areas, their pixel values ​​do not need to be adjusted, and their current pixel values ​​can be determined as the target pixel values. Finally, according to the above method, the target pixel value of each pixel is used to replace its current pixel value to update the pixel value of each pixel in the target image, thereby achieving the effect of shadow removal processing on the target image.

[0148] In some embodiments, in response to a trigger operation on an image content enhancement control, identifying a location of a text content area in a target image to display a first target text image includes:

[0149] 1. In response to a trigger operation on an image content enhancement control, determining a location of a text content area in a target image;

[0150] 2. Perform position correction processing on the image corresponding to the position of the text content area to obtain a transition image;

[0151] 3. Perform image enhancement processing on the transition image to obtain the first target text image;

[0152] 4. Display the first target text image.

[0153] Among them, the specific process of identifying the text content in the target image to display the first target text image can be to first determine the position of the text content area of ​​the target text image, and after determining the position of the text content area, perform position correction processing on the image corresponding to the position of the text content area to obtain a transition image. Then, the transition image is subjected to image enhancement processing to obtain the first target text image. Finally, the first target text image is displayed in the enhanced display page 40. Among them, the transition image is only an image corresponding to an intermediate process in the image processing process and may not be displayed. In some embodiments, it is also possible not to generate this transition image, and the image corresponding to the text content area may be subjected to position correction and image enhancement processing at the same time to directly obtain the first target text image.

[0154] In some embodiments, performing image enhancement processing on the transition image to obtain the first target text image includes:

[0155] 3.1. Determine the color type of the transition image;

[0156] 3.2. Determine the target image enhancement method associated with the color type;

[0157] 3.3. Perform image enhancement processing on the transition image using the target image enhancement method to obtain the first target text image.

[0158] Among them, the image enhancement processing of the transition image is mainly used to deal with the color cast of the text screen, shadows on the text, dark text, and unclear text as a whole caused by the poor shooting environment. The transition image can be a color image or a black and white image. Since the color image itself has significant color distinction, it is easier to recognize than the black and white image. Therefore, in this application, different image enhancement methods will be used for images of different color types. Therefore, before performing image enhancement processing on the transition image, it is necessary to first determine the color type of the transition image, and then determine the target image enhancement method that matches the color type according to the color type of the transition image, and finally use the matching target image enhancement method to perform content enhancement processing on the transition image, so as to obtain the first target text image.

[0159] In some embodiments, determining the color type to which the transition image belongs includes:

[0160] Get the grayscale image of the transition image;

[0161] The color type of the transition image is determined according to the grayscale image of the transition image.

[0162] Among them, the color type to which the transition image belongs is determined, and the transition image can be converted into a Lab color space from which the color channel can be extracted. The Lab color model is a device-independent color model and also a color model based on physiological characteristics. The Lab color model consists of three elements, one of which is brightness L, and a and b are two color channels. The colors included in a range from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value); and b ranges from bright blue (low brightness value) to gray (medium brightness value) to yellow (high brightness value). For a pixel, if its a channel value and b channel value are both 128, then it can be determined that the pixel is a black and white pixel. Alternatively, the absolute value of the difference between the a channel value and the b channel value of each pixel and 128 can be calculated. If the absolute value of the difference is within the preset threshold range, the pixel can also be determined to be a black and white pixel.

[0163] In this way, the absolute value of the difference between the a channel value, the b channel value and 128 of each pixel in the transition image can be calculated respectively, and the grayscale image of the transition image can be generated accordingly, and the grayscale image expresses the color degree of the transition image. Finally, the average value of the entire grayscale image is calculated, and the obtained average value is compared with the preset threshold value to determine the color type to which the transition image belongs. Specifically, the maximum value of the absolute value of the difference between the a channel value, the b channel value and 128 of each pixel can be taken as the grayscale value of the pixel, so that the grayscale value corresponding to each pixel in the transition image can be obtained, and then the grayscale value corresponding to each pixel in the transition image is averaged to obtain the grayscale value of the transition image. When the grayscale value is less than the preset threshold, the transition image can be determined as a black and white image; when the grayscale value is not less than the preset threshold, the transition image can be determined as a color image.

[0164] In some embodiments, performing image enhancement processing on the transition image in a target image enhancement manner to obtain a first target text image includes:

[0165] 3.3.1. When it is detected that the transition image is a color image, the brightness of the transition image is adjusted to obtain a first target text image;

[0166] 3.3.2. When it is detected that the transition image is a black and white image, the handwriting of the text in the transition image is deepened to obtain the first target text image.

[0167] Among them, when the transition image is detected as a color image, the color text content recognition is relatively easy because the color image itself has a strong color distinction. Only when the ambient light is dim during shooting, the overall image color will be darker, resulting in increased recognition difficulty. Therefore, for the color transition image, its brightness is adjusted to increase its brightness, so that the text content of the color transition image is displayed more clearly.

[0168] When the transition image is a black and white image, you can first perform white balance processing on the transition image to correct the color cast caused by the ambient light problem. Then perform shadow removal on the image after white balance processing, then adjust the brightness of the image after shadow removal, and finally perform darkening processing on the text in the image after brightness adjustment.

[0169] In some embodiments, the text handwriting is deepened, including:

[0170] Obtain boundary high-frequency information in the transition image;

[0171] The high-frequency information of the boundary is amplified to obtain a first target text image.

[0172] When the transition image is a black and white text image, the font in the image is the high-frequency boundary information in the image. In this way, the high-frequency boundary information in the image can be extracted and the extracted high-frequency boundary information can be amplified to achieve the effect of deepening the font handwriting.

[0173] In some embodiments, in response to a trigger operation on an image content enhancement control, determining a location of a text content area in a target image includes:

[0174] 1.1. In response to a trigger operation on an image content enhancement control, edge detection is performed on a target image, and a plurality of edge line segments are determined according to the edge detection result;

[0175] 1.2. Determine multiple target line segments corresponding to the text content area from multiple edge line segments;

[0176] 1.3. Determine the position of the text content area in the target image based on multiple target line segments.

[0177] Among them, the position of the text content area in the target image is determined, and the edge detection technology can be used to detect the edge of the target image to obtain multiple edge segments. Specifically, edge candidate pixels can be detected from the target image, and then multiple edge segments can be fitted. Then, the multiple edge segments obtained are scored with confidence, and multiple target segments corresponding to the text content area are determined according to the confidence scores. Finally, the position of the text content area in the target image is determined according to the multiple target segments obtained.

[0178] In some embodiments, performing position correction processing on an image corresponding to the position of the text content area to obtain a transition image includes:

[0179] 1.3.1. Obtain the coordinate information of each endpoint of multiple target line segments;

[0180] 1.3.2. Determine the target coordinate information of each endpoint of the multiple target line segments after position correction processing;

[0181] 1.3.3. Calculate the mapping relationship based on the coordinate information and the target coordinate information;

[0182] 1.3.4. Map the image corresponding to the position of the text content area according to the mapping relationship to obtain a transition image.

[0183] Among them, after determining the multiple target line segments constituting the target text area, the coordinate information of the endpoints of each target line segment can be determined respectively. The endpoints of the target line segments are also the intersection points of the two target line segments, and can also be called the vertices of the polygonal box corresponding to the target text area. After obtaining the coordinates of the vertices of the polygonal box corresponding to the target text area, the target coordinate information of the vertices of the polygonal box after correction processing is further determined. Generally, the vertices of the polygonal box after correction processing are the vertices of the first target text image, and the coordinates of the vertices of the first target text image can be determined according to the display data in the display screen of the terminal.

[0184] Furthermore, the coordinate information of each vertex in the text content area and the corrected target coordinate information are used to calculate a mapping relationship, which can also be called a correction parameter. Finally, each pixel in the text content area is mapped according to the mapping relationship, thereby realizing the position correction processing of the image corresponding to the text content area, and then obtaining a transition image.

[0185] In some embodiments, the image processing method provided by the present application may further include:

[0186] A, a calibration trigger control for displaying a first target text image;

[0187] B. In response to a trigger operation on a calibration trigger control, displaying a calibration page, the calibration page including a target image, an area positioning mark of a text content area, and a calibration control;

[0188] C. in response to a drag operation on the area positioning mark, repositioning the text content area;

[0189] D. In response to a trigger operation on the calibration control, a second target text image is displayed, where the second target text image includes a second target text content area, where the second target text content area is the area after the repositioned text content area has been subjected to image enhancement processing and position correction processing.

[0190] Among them, in response to the trigger operation of the content enhancement control, when the first target text image is displayed, the display interface corresponding to the first target text image may also include other functional controls, such as a calibration trigger control. When the user determines that the automatically identified text content area is not accurate enough based on the displayed first target text image, the calibration trigger control can be touched to trigger the display of the calibration page. The calibration page can display the target image, the regional positioning mark of the text content area, and the calibration control. The user can reposition the text content area by dragging the regional positioning mark of the text content area. After the user repositions the text content area by dragging the regional positioning mark of the text content area, the second target text image can be regenerated and displayed by touching the calibration control in the calibration page. The second target text image is an image corresponding to the area after the image enhancement processing and position correction processing are performed on the repositioned text content area.

[0191] Specifically, Fig. 9 FIG. 4 is another schematic diagram of an image processing method provided by the present application. As shown in the figure, in addition to displaying the first target text image 410, a calibration trigger control 420 is also displayed in the enhanced display page 40. The calibration trigger control 420 can be displayed inside the first target text image 410 or outside the first target text image 410. In response to the trigger operation on the calibration trigger control 420, the calibration page is displayed. Fig.10 As shown, it is another scene schematic diagram of the image processing method provided by the present application. In the calibration page 50, the target image 110, the calibration control 510 and the regional positioning mark 520 of the text content area are displayed. The regional positioning mark 520 may include a positioning frame composed of positioning segments 521 and a positioning reference point 522 located on the positioning frame. The user can drag the regional positioning mark 520 to change the position of the positioning frame. Specifically, the user can drag the positioning reference point 522 or the positioning segment 521 to practice dragging the regional positioning mark 520, or can drag the regional positioning mark 520 as a whole. After the dragging is completed, the calibration control 510 in the figure can be triggered to switch to display the second target text image. The second target text image is an image obtained after the image corresponding to the position of the dragged positioning frame is enhanced with content and position correction.

[0192] In some embodiments, in response to a drag operation on a region positioning mark, repositioning the text content region includes:

[0193] C1. In response to a drag operation on the positioning reference point, redetermine a positioning frame including the text content area;

[0194] C2. Reposition the text content area according to the re-determined positioning frame.

[0195] In the embodiment of the present application, the positioning reference point can be dragged to change the positioning frame including the text content area, thereby realizing the repositioning of the text content area. Fig.10 As shown, by dragging any positioning reference point 522 in the figure, a connection line is re-established according to the dragged positioning reference point, and the positioning frame including the text content area is re-determined according to the connection line. Finally, the text content area is re-positioned according to the re-determined positioning frame including the text content area. The range defined by the re-determined positioning frame including the text content area is the new text content area.

[0196] In some embodiments, the image processing method provided by the present application may further include:

[0197] a1, an effect control for displaying a first target text image;

[0198] a2. In response to a trigger operation on the effect control, a third target text image is switched to be displayed. The third target text image is an image after the first target text image is restored by performing enhancement effect restoration processing.

[0199] Among them, in an embodiment of the present application, there may be a situation where the text content is distorted after image enhancement of the text content area, making the enhanced text content more difficult to identify. At this time, an effect control can be set in the display interface corresponding to the first target text image. In response to the triggering operation of the effect control, the display can be switched to the third target text image, which is an image after the enhancement effect restoration processing of the first target text image.

[0200] Specifically, see Fig. 9 In the enhanced display page 40 corresponding to the first target text image, an effect control 430 is also displayed. In response to the triggering operation of the effect control 430, the third target text image is displayed. Fig.11 As shown, it is another schematic diagram of the image processing method provided by the present application. As shown in the figure, in the correction display page 60, the third target text image 610 is displayed. It can be seen from the figure that the third target text image 610 is the image of the first target text image 410 after the enhancement effect restoration processing. Alternatively, the third target text image 610 can also be understood as the image obtained after the target image 110 is processed by position correction. Further, in the correction display page 60, a continue display effect control can also be displayed, and in response to the touch instruction of the effect control in the correction display page 60, the first target text image is switched to be displayed. In this way, the user can switch back and forth to display the first target text image and the third target text image for comparison, so as to select a better way to view the text.

[0201] In some embodiments, the image processing method provided by the present application may further include:

[0202] b1, displaying a save control of the first target text image;

[0203] b2. In response to a trigger operation on a save control, the first target text image is saved.

[0204] For further information, please refer to Fig. 9 , a save control 440 may also be displayed in the enhanced display page 40. In response to a touch operation on the save control 440, the first target text image is stored in the image library of the terminal, or the first target text image may be stored in the storage space corresponding to the user currently logged in to the instant messaging client. For example, the first target text image is stored in the storage location corresponding to the user currently logged in to the instant messaging client in the server. In this way, when the user logs in on the instant messaging client in other terminals, the saved first target text image can still be viewed.

[0205] Furthermore, it has been described in the above embodiments that the target image can be opened in the conversation page of the instant messaging client and image processing can be performed. Therefore, in some embodiments, the image processing method provided by the present application can also include:

[0206] A sending control for displaying a first target text image;

[0207] In response to a trigger operation on a sending control, a first target text image is sent to a target client corresponding to a member in a target session, and the sent first target text image is displayed in a session page.

[0208] Specifically, it can be Fig. 9 The enhanced display page 40 shown further displays a sending control. In response to a trigger operation on the sending control, a first target text image is sent to a target client corresponding to a member of the target session, and the sent first target text image is displayed in the session page.

[0209] When the target session is a single-person session, the first target text image is sent to the target client of the target object of the current single-person session. When the target object uses multiple terminals to log in to the instant messaging application, for example, the target object logs in to the instant messaging application on both the mobile phone and the computer, then the target client at this time is two clients. That is, the first target text image is sent not only to the mobile phone client of the target object, but also to the computer client of the target object.

[0210] When the target session is a group chat, the first target text image is sent to the client of each other member in the group chat.

[0211] In some embodiments, what is displayed in the conversation page may be a thumbnail image of the first target text image.

[0212] According to the above description, the image processing method provided by the embodiment of the present application displays the image display page of the instant messaging client, the image display page includes an image editing trigger control and a target image, and the target image includes a text content area; in response to a trigger operation on the image editing trigger control, the image editing page of the target image is displayed, and the image editing page includes an image content enhancement control; in response to a trigger operation on the image content enhancement control, the position of the text content area in the target image is identified to display a first target text image, the first target text image includes a first target text content area, and the first target text content area is the area of ​​the text content area after image enhancement processing and position correction processing. In this way, by automatically identifying the text content area in the image, and performing image enhancement processing and position correction processing on the text content area, the clarity of the text content in the image is improved, thereby improving the efficiency of image processing.

[0213] Accordingly, the embodiment of the present application will further describe the image processing method provided by the present application in detail from the perspective of a computer device, wherein the computer device may be a terminal. Fig.12 FIG. 1 is another flow chart of the image processing method provided by the present application, the method comprising:

[0214] Step 201: The computer device displays a target image in an instant messaging client.

[0215] Wherein, the computer device here can be a terminal device such as a mobile phone, a tablet computer, a laptop computer, a smart TV, a wearable smart device, a personal computer (PC, Personal Computer), etc., and an instant messaging client can be loaded in the computer device. The computer device opens the target image in the use scenario of the instant messaging application, so that the target image is displayed in the instant messaging client. Specifically, the scene can be a scene for viewing the received picture, a scene for viewing the photo just taken, a scene for viewing the photo stored in the terminal to be called, or a scene for viewing the image collected by scanning or taking a photo translation function. The target image contains a text content area, and the image processing method provided by the present application is intended to improve the readability of the content of the text content area in the target image. Or it is to solve the problem of color cast, shadows, dark text, and unclear overall text in the image corresponding to the text content area caused by poor shooting environment. The scheme of the image processing method provided by the present application is further described in detail below.

[0216] When the computer device displays the target image, an editing trigger control is also displayed in the display interface. In response to a trigger operation on the editing trigger control, an editing interface of the target image can be displayed.

[0217] Step 202: In response to a trigger operation on an edit trigger control, the computer device displays an image editing page of the target image.

[0218] The target image editing page includes an editing list, which includes multiple editing controls. In response to the editing operation input through the editing controls, the editing effect of the target image is achieved. The target image editing page also includes a file enhancement control. In response to the touch operation of the file enhancement control, the computer device performs image enhancement and position correction processing on the text content area in the target image to obtain the first target text image after enhancement processing. The process of the computer device performing image enhancement and position correction processing on the text content area in the target image will be further described in detail below.

[0219] Step 203: In response to a trigger operation on the content enhancement control, the computer device determines a position of the text content area.

[0220] The specific steps of determining the position of the text content area may include: preprocessing the target image, removing the text information in the target image and retaining the edge information; performing edge extraction on the preprocessed image to obtain the edge information in the target image; performing straight line detection on the edge information map to extract the line segments therein; merging and screening the extracted line segments to find the four line segments with the highest confidence, and the four line segments determine the position of the text content area. The above steps are described in detail below.

[0221] First, the process of preprocessing the target image can convert the RGB expression of the target image to the Lab space. The Lab space has been introduced in the previous content of this application and will not be repeated here. Since the Lab space can better express the colors seen by the human eye, the color gamut is wide and can express almost all colors; secondly, separating the brightness channel from the color channel is more in line with the human eye's perception of color, and will first explore the brightness and then the color. Therefore, this step conversion can better convey the information of the image itself. Next, a closing operation in a morphological filter is performed on the brightness L channel, and an erosion operation is performed on the a and b channels. The erosion and expansion operations in morphological filtering are to make the image have larger dark or highlighted areas. The expansion operation is to use a square kernel with a central anchor point to convolve with all the points in the image, and find the local maximum value in the kernel to obtain the effect of enhancing the highlighted part of the picture. The effect of erosion is the opposite, and the local minimum value is found in the same way. The closing operation is to expand first and then erode, which can fill some tiny holes or small gaps in the foreground very well. This step can effectively erase the fonts in the text content area that are not related to the edge, so that the text content area can become a complete texture that is distinguished from other backgrounds, thereby completing the preprocessing process of the target image.

[0222] Then, edge extraction is performed on the image obtained after preprocessing. Using the idea of ​​gradient, on the Lab image obtained by the above preprocessing, which can distinguish the boundary, the channel gradient map of each channel is calculated, where the channel gradient map = channel expansion result map - channel corrosion result map, and the boundary of each channel can be obtained, which is also the gradient measurement of color. In order to obtain a finer and clearer boundary, a morphological operation kernel as small as possible can be selected here for processing. Then, the gradient values ​​of the three channels are added to obtain the final gradient map = L channel gradient map + a channel gradient map + b channel gradient map. Finally, a closing operation is performed on the final gradient map to eliminate some possible discontinuous holes. In addition, a preset brightness threshold is used to filter the darker part of the gradient map, and the boundary with a certain brightness value is retained as the edge information detected.

[0223] Then, the edge information obtained by edge detection is subjected to straight line detection to extract the line segments therein. In the present application, a line segment detection (LSD) algorithm can be used for detection. The line segment detection method is to find pixels with large gradient changes in the image, and fit the line segments according to these pixels. Specifically, the LSD algorithm focuses on the gradient and the horizontal line direction perpendicular to the gradient direction. The horizontal line direction of each pixel can be calculated to form a horizontal line direction field. By this direction field, pixels with the same horizontal line direction within a certain tolerance can be divided into different connected domains. The pixels of each connected domain can be fitted to obtain a line segment, thereby finding all the line segments in the picture. Afterwards, for the set of pixel points corresponding to each line segment, their circumscribed rectangles can be calculated. Since the straight line is generally slender, the direction of the internal point should be as consistent as possible with the direction of the entire rectangle. Therefore, the internal points that are basically consistent with the direction of the circumscribed rectangle are calculated as alignment points. The distribution of the alignment points and their proportion in the entire rectangle are statistically analyzed, and the line segments that meet the requirements are found using the error control method. After extracting the line segments in the target image using the LSD algorithm, the repeated straight lines can be further merged. Specifically, the difference between the two endpoints of the line segment in the x-axis direction and the y-axis direction in the preset coordinate axis can be compared to determine whether the line segment is a horizontal line segment or a vertical line segment. The preset coordinate axis can be a coordinate axis constructed with the bottom edge of the display area as the x-axis and the left side as the y-axis. The horizontal line segment can be understood as a line segment parallel to the x-axis, and the vertical line segment can be understood as a line segment perpendicular to the x-axis. Then, the distance from the endpoint of a line segment to the straight line where other line segments parallel to it are located is calculated between the line segments determined to be parallel, and then the line segments whose distances are all less than the preset threshold are merged. Wherein, the merging can be to delete the shorter line segments. Wherein, in the step, the line segments whose length is less than the preset length can also be deleted, and it is assumed that these line segments are not the line segments corresponding to the text content area.

[0224] After extracting the line segment information in the target image, the four line segments with the highest confidence values ​​are determined from the line segment information as the line segments corresponding to the text content area. Specifically, the horizontal line segments can be separated from the vertical line segments, and then the horizontal line segments and the vertical line segments can be scored according to the following items: the average length of the two line segments, the distance between the two line segments, the angle between the two straight lines, and the length ratio of the intersection of the two line segments in the horizontal or vertical direction. Specifically, weights can be set for the above four indicators respectively, and the confidence values ​​between the two line segments can be calculated respectively, and multiple groups of line segments with confidence values ​​higher than the first preset threshold are used as candidate line segments. Then, a second preset threshold is determined, and the second preset threshold is higher than the first preset threshold. If there is a group of line segments in both the horizontal line segments and the vertical line segments in the candidate line segments, and the confidence values ​​are greater than the second preset threshold, the two groups of line segments are directly determined to be the line segments corresponding to the text content area. If only one group of the horizontal and vertical line segments in the candidate line segments has a confidence value greater than the second preset threshold, it is determined whether there are line segments in the candidate line segments that have intersections with the group of line segments, and if so, it is determined that the two groups of line segments are line segments corresponding to the text content area. If not, it is determined that the group of line segments with confidence values ​​greater than the second preset threshold and the screen boundary line segments perpendicular to the group of line segments constitute the text content area.

[0225] After determining the four line segments corresponding to the text content area, it is necessary to further determine whether the four line segments intersect with the boundary of the target image. If they intersect with the boundary of the target image, it means that the captured target image does not capture the entire text content. At this time, the text content area can be re-determined by the intersection with the boundary of the target image and the endpoint of another line segment that does not intersect with the edge of the target image. Specifically, Fig.13A As shown, it is another scene schematic diagram of the image processing method provided by the present application. As shown in the figure, a target image 110 is displayed in the image display page 10. The target image includes a text content area 111. The four line segments that determine the text content area 111 are line segments obtained by the above-mentioned line segment detection method. As can be seen from the figure, the two sides of the text content area 111 intersect with the edge of the target image 110. At this time, the text content area can be re-determined based on the intersection with the boundary of the target image and the endpoint of another line segment that does not intersect with the edge of the target image. Fig. 13B As shown, line segment 1111 is the discarded line segment, line segment 1112 is the regenerated line segment, and line segment 1112 and the other three line segments reconstruct the new text content area 111.

[0226] Step 204: The computer device determines the corner points of the text content area and performs position correction on the text content area according to the corner points.

[0227] In step 203, the text content area position of the target image is determined, specifically, the four line segments constituting the text content area position and the quadrilateral frame formed by the four line segments are determined. Therefore, the vertices of the quadrilateral frame can be used as the corner points of the text content area, and the coordinate information of the four corner points in the aforementioned preset coordinate axes can be determined one by one.

[0228] Furthermore, it is necessary to determine the correspondence between each corner point and the corner point in the transformed image. Specifically, the horizontal line segment can be determined first, the slope of each line segment relative to the x-axis can be calculated first, and the line segment with the smallest slope can be determined as the horizontal line segment. In some embodiments, the horizontal line can also be determined according to the direction of the text in the text content area. After determining a horizontal line segment, the relative position relationship of other line segments can be determined, so the correspondence between each corner point and the corner point in the transformed image can be further determined, and the coordinate information of each corner point before and after the transformation can be further determined. A mapping matrix is ​​calculated based on the coordinate information of each corner point before and after the transformation, and each point in the text content area is mapped and transformed through the mapping matrix to obtain the transformed image, that is, the image after the position correction processing of the target image.

[0229] Step 205: The computer device performs image enhancement processing on the image after the position correction processing.

[0230] After the position correction processing is performed on the text content area, the image after the position correction processing is further enhanced to further improve the readability of the text content in the text content area.

[0231] Specifically, before performing image enhancement processing on the image after position correction processing, the color of the image can be detected first. When it is detected that the image is a color image, the brightness of the color image is adjusted to enhance the brightness of the color image to obtain a first target text image; when the image is a black and white image, white balance processing is first performed on the image, and then shadow removal processing is performed on the image after white balance processing, and then brightness enhancement processing is performed on the image after shadow removal processing, and finally handwriting deepening processing is performed on the image after brightness enhancement processing to obtain the first target text image.

[0232] Specifically, a curve brightness enhancement method can be used to enhance the brightness of a color image. Specifically, a brightness adjustment curve can be set. For example, a brightness adjustment curve can be generated by using three points (0,0), (126,174) and (255,255). Since any x value input on the curve will result in a y value not less than the x value, the curve is a brightness enhancement curve. In this way, the curve is applied to the image obtained after the position correction process, and the brightness of the image after the position correction process can be enhanced.

[0233] The processing method for black and white images is relatively more complicated than that for color images. First, the black and white images need to be white balanced. Specifically, the average color value of the three RGB channels of the image obtained after position correction can be calculated first, and then the balance gain required for each channel can be calculated. Take the R channel as an example to calculate the balance gain of the R channel:

[0234] KR=(meanR+meanG+meanB) / 3 / R

[0235] Among them, KR is the balance gain of the R channel of a target pixel, meanR is the average color value of the R channel, meanG is the average color value of the G channel, meanB is the average color value of the B channel, and R is the value of the R channel of the target pixel. Similarly, the balance gain of other channels of the target pixel can be calculated by the above method. Finally, each pixel in the black and white image after position correction is adjusted according to the calculated balance gain of each channel to obtain the image after white balance processing.

[0236] Furthermore, after the black and white image is white balanced, the image after white balance processing needs to be further de-shadowed. In an embodiment of the present application, the flood filling method for the brightness channel can be used to remove shadows. Among them, for the de-shadowing operation, the more important step is to accurately locate the area where the shadow is located. This method considers that the brightness channel map is a topological map, in which the darker areas have lower altitudes and the brighter areas have higher altitudes. A large area with a relatively low altitude forms a depression. Here, imagine that there is a constant flow of water from a high place to pour water downward, then these depressions will be filled first, and as the water level continues to rise, these depressions will continue to spread radially around. Then the amount of water injected at each vertex here can reflect the intensity of this entire shadow area. In order to find the water level in the last stable state, there are two strategies for water injection, one is to fill it up continuously, and the other is to find the overflow point and spread it. The method used in this application is to combine these two methods to find it together.

[0237] First, define some variables. h is the pixel value, that is, the altitude of each coordinate point. w(p, t) represents the water storage at point p at time t. The coordinates of point p can be expressed as (x, y). Since our goal is to restore the information of the shadow area without affecting the existing information structure of the full text, the following restrictions will be imposed:

[0238] 1. w(p, t)>=0, for any p, any t. This restriction assumes that the water level of each point can only be stored or overflowed. That is, for any point in the image, w(p, t) cannot be a negative value at any time.

[0239] 2. w(p, t) = 0. For the pixel p at the boundary of the entire screen, water cannot be stored at any time.

[0240] 3. The amount of water flowing in and out at each point is equal. Outflow refers to the amount of water stored and diffused to other pixels, which means there will be no water loss.

[0241] Next, we introduce two water injection methods:

[0242] Method 1 is the incremental water storage method: Assume that G(p, t) represents the actual height value of point p at time t, which consists of its own altitude h(p) and water storage w(p, t):

[0243] G(p, t) = h(p) + w(p, t)

[0244] Among them, G(p, t) can also be expressed as G(x, y, t). Assuming that there is a continuous flow of water from the vertex at the highest altitude h, since the extreme point has no ability to store water, the amount of water flowing to point p depends on the flow of water brought by the altitude difference of the surrounding pixels. Then the change of water storage at point p can be expressed as formula (1):

[0245] w(x,y,t+Δ)=η*{G(x+Δ,y,t)+G(x-Δ,y,y)+G(x,y+Δ,t)+G(x,y-Δ,t)-4*G(x,y,t)}+w(x,y,t) Formula (1)

[0246] Among them, η is the parameter that controls the flow rate. When G(p, t)-G(p, t+delta_t) < threshold for all p in the figure, that is, all the horizontal planes almost no longer increase, and all pixels are filled to the same height, it is considered to be converged, and the final shadow map is obtained through the water storage value of the whole map. That is, the shadow value of each pixel in the figure can be obtained.

[0247] The second method is the diffusion and overflow water injection method. This method does not consider the supply of external water sources to drive the flow of the overall elevation map. Therefore, the height value of each point depends on two values, one is the amount of diffusion outward from this point, and the other is the amount of diffusion from the highest point.

[0248] The first outward diffusion amount is calculated by the height difference between this pixel and the surrounding pixels. This is a non-positive value, which calculates the amount of water that can diffuse outward from this point. The amount of water that diffuses outward from this point can be expressed as formula (2):

[0249] w effuse(x,y,t)=η*{min(G(x+Δ,y,t)-G(x,y,t),0)+min(G(x-Δ,y,t)-G(x,y,t),0)+min(G(x,y+Δ,t)-G(x,y,t),0)+min(G(x,y-Δ,t)-G(x,y,t),0)} Formula (2)

[0250] where w effuse (x, y, t) represents the amount of water diffused outward from point p(x, y) at time t. η is the parameter that controls the flow rate.

[0251] The second is the amount of water that overflows. From the highest point of the screen, it will spread to the entire screen within a certain period of time. Therefore, the amount of water that spreads to the current point p(x, y) is proportional to the altitude difference of the highest point and the time. The specific formula is shown in formula (3):

[0252] w flood (x,y,t)=(h peak -G(x,y,t))*e -t Formula (3)

[0253] where w flood (x, y, t) is the amount of water that spreads from the highest point to point p(x, y) at time t. peak is the pixel value of the highest point.

[0254] Therefore, the final water volume of the second iteration of method is the superposition of the stored water volume and the original water volume after the diffusion and overflow balance, as shown in formula (4):

[0255] w(x,y,t+Δ)=w effuse (x,y,t)+w flood (x,y,t)+w(x,y,t) Formula (4)

[0256] Similarly, when G(p, t)-G(p, t+delta_t) < threshold for all p in the graph, that is, all water levels are almost no longer increasing, and all pixels are filled to the same height, it is considered to be converged. Then, by comparing the final water storage value of the entire graph with the original water volume of each pixel, it is possible to determine which pixels have increased water volume, and these pixels are the pixels of the shadow area. In this way, the shadow area can be quickly determined by method 2.

[0257] Since the pixel value of the current screen is equal to the product of the background shadow value and the actual pixel value of the foreground text, the actual pixel value of the corresponding restored text can be obtained by dividing the current screen pixel value by the calculated background shadow value, and the final result image after removing the shadow can be obtained.

[0258] Specifically, the original image can be converted to Lab space first, and in the L brightness channel, the above method 2 can be used to obtain a rough shadow space area, that is, the shadow area is determined first. Then use the above method to iterate the incremental flooding method in a small step to make fine adjustments to the details and obtain the shadow value of each pixel. The shadow result obtained in this way can not only remove large-scale shadow areas, but also have a good removal effect on some small shadows of details. Finally, the original brightness channel value is divided by the brightness shadow value to obtain the final shadow removal result image. Note that the shadow removal operation only operates on the brightness L channel, and the remaining color channel a and b values ​​remain unchanged, retaining the original pixel color as much as possible.

[0259] After removing the shadows from the black and white image, the black and white image may be further subjected to brightness enhancement processing, wherein the brightness enhancement processing method for the black and white image may refer to the aforementioned brightness enhancement processing method for the color image, and will not be described in detail here.

[0260] Then, after the brightness of the black-and-white image is enhanced, the handwriting of the text in the black-and-white image after the brightness is enhanced can be further deepened. The technical details of the deepening process of the text handwriting have been described in detail in the previous embodiment of the present application, and will not be repeated here. Finally, the image enhancement process of the black-and-white image is completed to obtain the first target text image.

[0261] Step 206: The computer device displays the first target text image.

[0262] The computer device performs position correction and image enhancement processing on the target image to obtain the first target text image, which not only increases the display range of the text content area in the target image, removes the negative effects caused by the poor shooting environment in the image corresponding to the text content area, but also deepens the depth of the text in the text content area. That is, the text content in the target image is displayed more clearly, and the readability of the text content in the target image is improved.

[0263] According to the above description, the image processing method provided by the embodiment of the present application displays the image display page of the instant messaging client, the image display page includes an image editing trigger control and a target image, and the target image includes a text content area; in response to a trigger operation on the image editing trigger control, the image editing page of the target image is displayed, and the image editing page includes an image content enhancement control; in response to a trigger operation on the image content enhancement control, the position of the text content area in the target image is identified to display a first target text image, the first target text image includes a first target text content area, and the first target text content area is the area of ​​the text content area after image enhancement processing and position correction processing. In this way, by automatically identifying the text content area in the image, and performing image enhancement processing and position correction processing on the text content area, the clarity of the text content in the image is improved, thereby improving the efficiency of image processing.

[0264] In order to better implement the above method, an embodiment of the present invention further provides an image processing device, which can be integrated in a terminal. Fig.14 As shown, it is a schematic diagram of the structure of the image processing device provided in an embodiment of the present application. The image processing device may include a first display unit 301, a second display unit 302 and a third display unit 303, as follows:

[0265] The first display unit 301 is used to display an image display page of the instant messaging client, the image display page includes an image editing trigger control and a target image, and the target image includes a text content area;

[0266] The second display unit 302 is used to display an image editing page of a target image in response to a trigger operation on the image editing trigger control, where the image editing page includes an image content enhancement control;

[0267] The third display unit 303 is used to identify the position of the text content area in the target image in response to the trigger operation of the image content enhancement control to display the first target text image, where the first target text image includes a first target text content area, which is the area of ​​the text content area after image enhancement processing and position correction processing.

[0268] In some embodiments, the image processing device provided by the present application further includes:

[0269] a fourth display unit, configured to display a calibration trigger control of the first target text image;

[0270] A fifth display unit, configured to display a calibration page in response to a trigger operation on the calibration trigger control, the calibration page including a target image, an area positioning mark of a text content area, and a calibration control;

[0271] A positioning unit, configured to reposition the text content area in response to a drag operation on the area positioning mark;

[0272] The sixth display unit is used to display a second target text image in response to a trigger operation on the calibration control, wherein the second target text image includes a second target text content area, and the second target text content area is an area after the repositioned text content area has been subjected to image enhancement processing and position correction processing.

[0273] In some embodiments, the area positioning mark includes a positioning frame of the text content area and a positioning reference point located on the positioning frame, and the positioning unit includes:

[0274] A first determining subunit, configured to redefine a positioning frame including a text content area in response to a drag operation on a positioning reference point;

[0275] The positioning subunit is used to reposition the text content area according to the re-determined positioning frame.

[0276] In some embodiments, the image processing device provided by the present application further includes:

[0277] A seventh display unit, for displaying an effect control of the first target text image;

[0278] The eighth display unit is used to switch and display a third target text image in response to a trigger operation on the effect control, where the third target text image is an image after the first target text image is restored with enhanced effects.

[0279] In some embodiments, the image processing device provided by the present application further includes:

[0280] a ninth display unit, configured to display a save control for the first target text image;

[0281] The saving unit is used to save the first target text image in response to a trigger operation on the saving control.

[0282] In some embodiments, the first display unit includes:

[0283] A first display subunit, used to display a session page of a target session in an instant messaging client;

[0284] The second display subunit is used to display an image display page of the instant messaging client in response to an image browsing operation in the conversation page.

[0285] In some embodiments, the second display subunit includes:

[0286] A first display module, used to display an image capture control in a session page;

[0287] A second display module, in response to a trigger operation on the image shooting control, displays an image shooting page;

[0288] The third display module is used to display an image display page of the instant messaging client in response to a shooting operation on the image shooting page, wherein the image display page includes a shot target image.

[0289] In some embodiments, the second display subunit includes:

[0290] A fourth display module, used to display an image selection control in the session page;

[0291] a fifth display module, configured to display a candidate image list in response to a touch operation on the image selection control, the list including at least one candidate image;

[0292] The sixth display module is used to display an image display page of the instant messaging client in response to a selection operation on a candidate image in the candidate image list, wherein the image display page includes a target image selected by the selection operation.

[0293] In some embodiments, the image processing device provided by the present application further includes:

[0294] a seventh display module, configured to display a sending control of the first target text image;

[0295] The sending module is used to send the first target text image to the target client corresponding to the member in the target session in response to the trigger operation on the sending control, and display the sent first target text image in the session page.

[0296] In some embodiments, the editing page further includes an editing control list, the editing control list includes at least one image editing control, and the apparatus further includes:

[0297] A display unit, used to receive an editing operation on a target image input through an image editing control, and display the edited image;

[0298] The third display unit is also used for:

[0299] In response to a triggering operation on the image content enhancement control, a position of a text content area in the edited image is identified to display a first target text image.

[0300] In some embodiments, the third display unit includes:

[0301] A second determination subunit, configured to determine a position of a text content area in a target image in response to a trigger operation on the image content enhancement control;

[0302] A correction subunit, used for performing position correction processing on the image corresponding to the position of the text content area to obtain a transition image;

[0303] An enhancement subunit, used for performing image enhancement processing on the transition image to obtain a first target text image;

[0304] The third display subunit is used to display the first target text image.

[0305] In some embodiments, the enhancer unit comprises:

[0306] A first determination module is used to determine the color type to which the transition image belongs;

[0307] A second determination module is used to determine a target image enhancement method associated with a color type;

[0308] The enhancement module is used to perform image enhancement processing on the transition image by adopting a target image enhancement method to obtain a first target text image.

[0309] In some embodiments, the enhancement module includes:

[0310] An adjustment submodule, for adjusting the brightness of the transition image to obtain a first target text image when it is detected that the transition image is a color image;

[0311] The processing submodule is used to deepen the handwriting of the text in the transition image when it is detected that the transition image is a black and white image, so as to obtain a first target text image.

[0312] In some embodiments, determining a subunit includes:

[0313] A detection module, used to receive a trigger operation for an image content enhancement control, perform edge detection on a target image, and determine a plurality of edge line segments according to the edge detection result;

[0314] A third determination module is used to determine a plurality of target line segments corresponding to the text content area from the plurality of edge line segments;

[0315] The fourth determination module is used to determine the position of the text content area according to multiple target line segments.

[0316] In some embodiments, the syndrome unit comprises:

[0317] An acquisition module, used to acquire coordinate information of each endpoint of multiple target line segments;

[0318] A fifth determination module, used to determine target coordinate information of each endpoint of the plurality of target line segments after position correction processing;

[0319] A calculation module, used to calculate a mapping relationship according to the coordinate information and the target coordinate information;

[0320] The mapping module is used to perform mapping processing on the image corresponding to the position of the text content area according to the mapping relationship to obtain a transition image.

[0321] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0322] As can be seen from the above, the image processing device provided in this embodiment displays the image display page of the instant messaging client through the first display unit 301, and the image display page includes an image editing trigger control and a target image, and the target image includes a text content area; the second display unit 302 responds to the trigger operation for the image editing trigger control, and displays the image editing page of the target image, and the image editing page includes an image content enhancement control; the third display unit 303 responds to the trigger operation for the image content enhancement control, identifies the position of the text content area in the target image, and displays the first target text image, and the first target text image includes a first target text content area, and the first target text content area is the area after the text content area is processed by image enhancement and position correction. In this way, by automatically identifying the text content area in the image, and performing image enhancement and position correction on the text content area, the clarity of the text content in the image is improved, thereby improving the efficiency of image processing.

[0323] The present application also provides a computer device, which may be a terminal. Fig.15 The figure is a schematic diagram of the structure of the computer device provided by this application. Specifically:

[0324] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Fig.15 The 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:

[0325] The processor 401 is the control center of the computer device. It uses various interfaces and lines to link various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it executes various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 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 401.

[0326] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and image processing by running the software programs and modules stored in the memory 402. The memory 402 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, and web page access, etc.); the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 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 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0327] The computer device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 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.

[0328] The computer device may further include an input unit 404, 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.

[0329] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0330] An image display page of an instant messaging client is displayed, the image display page includes an image editing trigger control and a target image, the target image includes a text content area; in response to a trigger operation on the image editing trigger control, an image editing page of the target image is displayed, the image editing page includes an image content enhancement control; in response to a trigger operation on the image content enhancement control, a position of the text content area in the target image is identified to display a first target text image, the first target text image includes a first target text content area, and the first target text content area is an area of ​​the text content area after image enhancement processing and position correction processing.

[0331] It should be noted that the computer device provided in the embodiment of the present application and the image processing method in the above embodiment belong to the same concept, and the specific implementation of the above operations can be referred to the previous method embodiment, which will not be repeated here.

[0332] 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.

[0333] To this end, an embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the image processing methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:

[0334] An image display page of an instant messaging client is displayed, the image display page includes an image editing trigger control and a target image, the target image includes a text content area; in response to a trigger operation on the image editing trigger control, an image editing page of the target image is displayed, the image editing page includes an image content enhancement control; in response to a trigger operation on the image content enhancement control, a position of the text content area in the target image is identified to display a first target text image, the first target text image includes a first target text content area, and the first target text content area is an area of ​​the text content area after image enhancement processing and position correction processing.

[0335] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0336] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0337] Since the instructions stored in the computer-readable storage medium can execute the steps in any image processing method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any image processing method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0338] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device executes the image processing method provided in various optional implementations in the above embodiments.

[0339] The above is a detailed introduction to an image processing method, apparatus, computer-readable storage medium and computer equipment provided by an embodiment of the present invention. Specific examples are used herein 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 those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. 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: The method comprises: Displaying an image display page of an instant messaging client, the image display page including an image editing trigger control and a target image, the target image including a text content area; In response to a trigger operation on the image editing trigger control, displaying an image editing page of the target image, the image editing page including an image content enhancement control; In response to a trigger operation for the image content enhancement control, the position of the text content area in the target image is identified to display a first target text image, wherein the first target text image includes a first target text content area, wherein the first target text content area is an area of ​​the text content area after image enhancement processing and position correction processing, and the enhancement method of the image enhancement processing is related to the color type of the image in the text content area, including: when it is detected that the color type of the image in the text content area is a color image, the brightness of the image in the text content area is adjusted to obtain the first target text image; when it is detected that the color type of the image in the text content area is a black and white image, the image in the text content area is de-shadowed and text content enhanced to obtain the first target text image.

2. The method according to claim 1, characterized in that The method further comprises: Displaying a calibration trigger control for the first target text image; In response to a trigger operation on the calibration trigger control, displaying a calibration page, the calibration page including the target image, the area positioning mark of the text content area, and a calibration control; In response to a drag operation on the area positioning mark, repositioning the text content area; In response to a trigger operation on the calibration control, a second target text image is displayed, the second target text image includes a second target text content area, and the second target text content area is an area after the repositioned text content area has been subjected to image enhancement processing and position correction processing.

3. The method according to claim 2, characterized in that The area positioning mark includes a positioning frame of the text content area and a positioning reference point located on the positioning frame, and in response to the dragging operation on the area positioning mark, repositioning the text content area includes: In response to a drag operation on the positioning reference point, redetermine a positioning frame including the text content area; The text content area is repositioned according to the re-determined positioning frame.

4. The method according to claim 1, characterized in that The method further comprises: Displaying an effect control of the first target text image; In response to a trigger operation on the effect control, a third target text image is switched to be displayed, and the third target text image is an image after the first target text image is restored with enhanced effects.

5. The method according to claim 1, characterized in that: The method further comprises: Display a save control for the first target text image; In response to a trigger operation on the save control, the first target text image is saved.

6. The method according to claim 1, characterized in that The image display page for displaying the instant messaging client includes: Display the session page of the target session in the instant messaging client; In response to the image browsing operation in the conversation page, an image display page of the instant messaging client is displayed.

7. The method according to claim 6, characterized in that The method of displaying an image display page of an instant messaging client in response to an image browsing operation in the conversation page includes: Displaying an image capture control in the session page; In response to a trigger operation on the image capture control, displaying an image capture page; In response to a shooting operation on the image shooting page, an image display page of the instant messaging client is displayed, the image display page including the shot target image.

8. The method according to claim 6, characterized in that The method of displaying an image display page of an instant messaging client in response to an image browsing operation in the conversation page includes: displaying an image selection control in the session page; In response to a touch operation on the image selection control, displaying a candidate image list, the list including at least one candidate image; In response to a selection operation on a candidate image in the candidate image list, an image display page of an instant messaging client is displayed, wherein the image display page includes a target image selected by the selection operation.

9. The method according to claim 6, characterized in that The method further comprises: Display a sending control for the first target text image; In response to a trigger operation on the sending control, the first target text image is sent to a target client corresponding to a member in the target session, and the sent first target text image is displayed in the session page.

10. The method according to claim 1, characterized in that The image editing page further includes an editing control list, the editing control list includes at least one image editing control, and the identifying the position of the text content area in the target image in response to the triggering operation on the image content enhancement control to display the first target text image also includes: Receiving an editing operation on the target image input through an image editing control, and displaying the edited image; The step of identifying the position of the text content area in the target image in response to the triggering operation on the image content enhancement control to display a first target text image includes: In response to a triggering operation on the image content enhancement control, a position of a text content area in the edited image is identified to display a first target text image.

11. The method according to claim 1, characterized in that: The shadow removal process comprises: Obtaining the shadow value of each pixel in the target image; Calculate the target pixel value of each pixel point according to the pixel value and the shadow value of each pixel point in the target image; The pixel value of each pixel in the target image is updated to the corresponding target pixel value to obtain a shadow-removed image.

12. The method according to claim 1, characterized in that The step of identifying the position of the text content area in the target image in response to the triggering operation on the image content enhancement control to display a first target text image includes: In response to a triggering operation on the image content enhancement control, determining a position of a text content area in the target image; Performing position correction processing on the image corresponding to the position of the text content area to obtain a transition image; Performing image enhancement processing on the transition image to obtain a first target text image; The first target text image is displayed.

13. The method according to claim 12, characterized in that The step of determining the position of the text content area in the target image in response to the triggering operation on the image content enhancement control comprises: In response to a triggering operation on the image content enhancement control, edge detection is performed on the target image, and a plurality of edge line segments are determined according to a result of the edge detection; Determine a plurality of target line segments corresponding to the text content area from the plurality of edge line segments; The position of the text content area in the target image is determined according to the multiple target line segments.

14. The method according to claim 13, characterized in that The step of performing position correction processing on the image corresponding to the position of the text content area to obtain a transition image includes: Obtaining coordinate information of each endpoint of the plurality of target line segments; Determine target coordinate information of each endpoint of the plurality of target line segments after position correction processing; Calculate a mapping relationship according to the coordinate information and the target coordinate information; According to the mapping relationship, mapping processing is performed on the image corresponding to the position of the text content area to obtain a transition image.

15. An image processing device, characterized in that: The device comprises: A first display unit, used to display an image display page of an instant messaging client, wherein the image display page includes an image editing trigger control and a target image, wherein the target image includes a text content area; A second display unit, configured to display an image editing page of the target image in response to a trigger operation on the image editing trigger control, wherein the image editing page includes an image content enhancement control; A third display unit is used to identify the position of the text content area in the target image in response to a trigger operation on the image content enhancement control to display a first target text image, wherein the first target text image includes a first target text content area, and the first target text content area is an area of ​​the text content area after image enhancement processing and position correction processing. The enhancement method of the image enhancement processing is related to the color type of the image in the text content area, including: when it is detected that the color type of the image in the text content area is a color image, the brightness of the image in the text content area is adjusted to obtain the first target text image; when it is detected that the color type of the image in the text content area is a black and white image, the image in the text content area is de-shadowed and text content enhanced to obtain the first target text image.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the image processing method according to any one of claims 1 to 14.

17. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image processing method according to any one of claims 1 to 14 when executing the computer program.

Citation Information

Patent Citations

  • Image processing apparatus, image processing method, and storage medium

    CN108965646A

  • Document image processing method, storage medium and computing device

    CN110298282A

  • Image processing method and device, computer equipment and storage medium

    CN111144320A