Image processing method, device, electronic device and storage medium

By displaying grid lines on text images for editing, the problem of low text image editing efficiency in the prior art is solved, simpler and more accurate text image processing is achieved, and user experience is improved.

CN113313027BActive Publication Date: 2024-10-29VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110592092.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2024-10-29
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

The existing technology is inefficient and prone to errors when editing text images. Especially when removing sensitive text, the operation is complex and easily affects other text.

Method used

By displaying grid lines on the text image, the text area is divided into grids for each character. The user can edit in the grid, update the display information of the target grid, and merge it into the original text image to generate New text image.

Benefits of technology

Compared with pixel-level processing, this method is simpler and more accurate, reduces operational errors, and improves the efficiency and user experience of text and image editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113313027B_ABST
    Figure CN113313027B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method, device, electronic device and storage medium, belonging to the field of image processing technology. The image processing method includes: receiving a first input from a user to a first text image displayed on a first layer; in response to the first input, displaying grid lines on a second layer, the second layer is superimposed on the first layer, the grid lines divide the text display area of ​​the first text image into N grids, each grid includes 1 character, and the text display area is a display area of ​​at least one character; receiving a second input from a user on the second layer; in response to the second input, updating the display information of a target grid among the N grids; fusing the content displayed in the target grid to the first text image to generate a second text image; wherein N is a positive integer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to an image processing method, device, electronic device and storage medium. Background Art

[0002] A text image is an image containing text content. Users can edit the text content in the text image, such as graffiti, frame, add text, or crop.

[0003] When it is necessary to modify, highlight, or perform other editing operations on the text in a text image, the existing method is to operate on each pixel, which is relatively complicated and prone to errors during the operation, resulting in the need for re-operation, and the editing efficiency is low. For example, for a text image obtained by intercepting a chat record or a text image with some sensitive information in text form, the existing method can use graffiti operations to remove sensitive text in the text image. Generally, it is based on a brush control, and according to the default or user-selected attributes (including line color and thickness), the brush control is moved back and forth to repeatedly smear lines in the area where the sensitive text is located to remove the sensitive text; the above process steps are complicated, and it is easy to smear the lines on other text, resulting in the need for re-operation. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide an image processing method, device, electronic device and storage medium, which can solve the problem of low efficiency in processing text in an image.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:

[0006] Receiving a first input from a user on a first text image displayed on a first layer;

[0007] In response to the first input, grid lines are displayed on a second layer, the second layer is superimposed on the first layer, the grid lines divide the text display area of ​​the first text image into N grids, each grid includes one character, and the text display area is a display area of ​​at least one character;

[0008] receiving a second input from a user on the second layer;

[0009] In response to the second input, updating display information of a target grid among the N grids;

[0010] Merging the content displayed in the target grid into the first text image to generate a second text image;

[0011] Wherein, N is a positive integer.

[0012] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:

[0013] A first input module, used for receiving a first input from a user on a first text image displayed on a first layer;

[0014] a grid generation module, configured to display grid lines on a second layer in response to the first input, the second layer being superimposed on the first layer, the grid lines dividing a text display area of ​​the first text image into N grids, each grid including one character, the text display area being a display area of ​​at least one character;

[0015] A second input module, used for receiving a second input from a user on the second layer;

[0016] A grid updating module, configured to update display information of a target grid among the N grids in response to the second input;

[0017] An image fusion module, used for fusing the content displayed in the target grid into the first text image to generate a second text image;

[0018] Wherein, N is a positive integer.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0020] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0021] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0022] In an embodiment of the present application, the position of the text is accurately located based on the grid, and the target grid corresponding to the text to be edited in the first text image is edited, the display information of the target grid is updated, and the first text image and the content displayed by the target grid are merged to generate a second text image. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, is less likely to make errors such as operating on other characters, and can more conveniently and accurately implement the editing of text images, which can enhance the user experience of editing text images. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flowchart of an image processing method provided in an embodiment of the present application;

[0024] Figure 2 is a schematic diagram of continuous text and its corresponding grid provided by an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of scattered texts and their corresponding grids provided in an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a process of processing a first text image using a morphology-based image processing method provided in an embodiment of the present application;

[0027] Figure 5 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0028] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0029] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The image processing method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0033] Figure 1 Schematic diagram of the image processing method provided by the embodiment of the present application. Figure 1 The image processing method provided by the embodiment of the present application is described. Figure 1 As shown, the method includes:

[0034] Step 101: Receive a first input from a user on a first text image displayed on a first layer.

[0035] Optionally, an embodiment of the present application provides an image processing method suitable for an image processing device.

[0036] The image processing device may be an electronic device such as a mobile phone, a tablet computer, or a PDA (Personal Digital Assistant).

[0037] It should be noted that the image processing device provided in the embodiment of the present application may include at least one screen, wherein each screen may be a foldable screen that can be bent, or a non-foldable screen that cannot be bent.

[0038] The first text image may be a pre-stored picture, and may be obtained by screenshot, scanning or taking a photo.

[0039] Optionally, the first text image is displayed in a certain area on the screen of the image processing device. The area may have one or more layers, and the layer displaying the first text image is the first layer.

[0040] Optionally, when there are multiple layers in the area, the first layer may be the topmost layer at this time.

[0041] The first input is used to trigger editing of the first text image. The first input may be touch input, voice input, gesture input, or key input, or may be a first operation.

[0042] For example, the first input may be clicking a control displayed on the screen and used to represent an edit text image.

[0043] It is understood that the above-listed inputs are exemplary, that is, the present application embodiment includes but is not limited to the above-listed inputs. In actual implementation, the input may also include any other possible inputs, which may be determined according to actual use requirements, and the present application embodiment does not limit this.

[0044] Step 102, in response to the first input, grid lines are displayed on the second layer, the second layer is superimposed on the first layer, the grid lines divide the text display area of ​​the first text image into N grids, each grid includes 1 character, and the text display area is a display area for at least one character.

[0045] Wherein, N is a positive integer.

[0046] Optionally, the first text image is an image containing text content, and the area containing text content in the first text image is the text display area.

[0047] After receiving the first input, responding to the first input, the outline of each character can be quickly determined through an image processing method; based on the outline of each character, each character in the first text image is accurately segmented to obtain grid lines and display the grid lines on the second layer.

[0048] The grid lines are used to divide the text display area of ​​the first text image into N grids. Each grid includes one character, there is no overlap between any two grids, and each character is included in a unique grid.

[0049] The characters included in each grid may be Chinese characters, Latin letters, Arabic numerals, mathematical symbols, or punctuation marks.

[0050] The grid may be a grid of a target shape. The target shape may be a rectangle, a circle, or optionally, the target shape is a rectangle.

[0051] For different meshes, the target shapes can be the same or different; when the target shapes are the same, the sizes of the meshes can also be the same or different.

[0052] Optionally, the above-mentioned image processing method may include at least one of the following: an image processing method based on artificial intelligence (AI, Artificial Intelligence) (such as an artificial neural network, etc.), an image processing method based on morphology, and a contour extraction method.

[0053] For the area displaying the first text image on the screen of the image processing device, a layer can be added above the first layer, and the layer is the second layer. After the second layer is added, the second layer is called the topmost layer of the area.

[0054] Optionally, for continuous text (such as articles, etc.), the entire first text image may be processed, and grid lines may be displayed on the entire second layer.

[0055] For example, the first text image before processing is Figure 2 As shown in the left half of Figure 2 The right half of the figure shows the grid lines 201 displayed on the second layer and the grids 202 obtained by dividing the grid lines 201 .

[0056] Optionally, for scattered texts (such as instant messaging records of instant messaging programs, etc.), the text display areas in the first text image can be extracted first, and then image processing can be performed on each text display area separately, and grid lines are displayed only in the area in the second layer corresponding to each text display area, and grid lines are not displayed in the area in the second layer corresponding to the area in the first text image that does not contain text.

[0057] For example, the first text image and each text display area 301 before processing are as follows: Figure 3 As shown in the left half of Figure 3 The right half of the figure shows the grid lines 302 displayed in the area of ​​the second layer corresponding to the text display area 301 and the grid 303 obtained by dividing the grid lines 302.

[0058] Optionally, the first text image may be processed by a morphologically based image processing method to obtain each grid. The steps and operations of the morphologically based image processing method are relatively simple, and the efficiency and speed of determining the grid can be improved.

[0059] like Figure 4 As shown, the process of processing the first text image using the morphological image processing method may include:

[0060] Performing an erosion and dilation operation to process each target word in the first text image into a separated color block 401;

[0061] Based on the edge of each color block 401 , the grid lines 402 are determined.

[0062] Optionally, the color block 401 is a black color block.

[0063] Optionally, for regularly arranged texts, the edges of each color block may be connected by straight lines to determine each grid.

[0064] Grid lines and grid can be displayed on a second layer with a targeted transparency.

[0065] Transparency, used to indicate the degree of transparency.

[0066] Transparency can be expressed as a numerical value, ranging from completely transparent to completely opaque.

[0067] Optionally, the transparency value ranges from 0 to 255, where 0 represents complete transparency and 255 represents complete opacity.

[0068] Optionally, the transparency value ranges from 0 to 100%, where 0 represents complete opacity and 100% represents complete transparency.

[0069] Optionally, the target transparency may be the same or different for different grids.

[0070] Optionally, the target transparency of the grid and grid lines can be the same or different.

[0071] When the target transparency is completely opaque, the user cannot see the grid but can see the first text image; when the target transparency is not completely opaque, the user can see the grid and the first text image.

[0072] Step 103: Receive a second input from the user on the second layer.

[0073] Optionally, the second input is used to determine a target operation to be performed on a target grid among the N grids.

[0074] The second input may be a touch input, voice input, gesture input or key input for the second layer, or may be a second operation.

[0075] For example, the second input may include an instruction to select a number of grids as target grids, and an instruction to indicate a target operation to be performed on the target grids. The target operation is used to edit the target grid.

[0076] It is understood that the above-listed inputs are exemplary, that is, the present application embodiment includes but is not limited to the above-listed inputs. In actual implementation, the input may also include any other possible inputs, which may be determined according to actual use requirements, and the present application embodiment does not limit this.

[0077] Optionally, the target operation can be used to highlight the target text corresponding to the target grid, delete the target text corresponding to the target grid, modify the text size of the target text corresponding to the target grid, modify the color of the target text corresponding to the target grid, and add an underline or a comment box to the target text corresponding to the target grid.

[0078] Step 104: In response to the second input, update the display information of the target grid among the N grids.

[0079] Optionally, after receiving the second input, in response to the second input, a target operation may be performed on the target grid to update display information of the target grid.

[0080] Display information, which may include the content displayed by the target grid.

[0081] Step 105: Merge the content displayed in the target grid into the first text image to generate a second text image.

[0082] Optionally, the first text image may be used as the background of the second text image, the content displayed in the target grid may be used as the foreground of the second text image, and the first text image and the content displayed in the target grid may be merged into the same picture to obtain the second text image.

[0083] After the second text image is obtained, the second text image may be output.

[0084] Optionally, outputting the second text image may be displaying the second text image on a screen.

[0085] It should be noted that, in the process of fusing the first text image with the content displayed in the target grid, the transparency of each grid needs to be adjusted to be completely transparent so that the content displayed in the second text image does not include the grid.

[0086] It can be understood that the characters included in the target grid are the text that the user wishes to edit. The embodiment of the present application converts the editing of the text into the editing of the grid including the characters, so that the editing of the corresponding text can be indirectly achieved by selecting the target grid and performing the target operation. The content displayed by the output second text image can reflect the effect of editing the text in the first text image.

[0087] The embodiment of the present application accurately locates the position of the text based on the grid, edits the target grid corresponding to the text to be edited in the first text image, updates the display information of the target grid, and fuses the first text image and the content displayed by the target grid to generate a second text image. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, and improve the user experience of editing text images.

[0088] Optionally, before receiving the second input from the user, the method includes: receiving a third input from the user.

[0089] Optionally, a third input is used to determine a target grid.

[0090] The third input may be touch input, voice input, gesture input or key input, or may be a third operation.

[0091] The third input can be any of the following:

[0092] Touch input for a certain grid. For example, the touch input may be a touch input in a direction parallel to a diagonal line of a certain grid, or a touch input in a direction perpendicular to a first side of a certain grid.

[0093] Voice input for a certain grid. For example, the grids may be assigned numbers in advance, with the first grid corresponding to "1", the second grid corresponding to "2", and the third grid corresponding to "3". If the user voice inputs "1", the image processing device may receive the voice information "1" and determine it as input to the first grid; if the user voice inputs "2", the image processing device may receive the voice information "2" and determine it as input to the second grid; if the user voice inputs "3", the image processing device may receive the voice information "3" and determine it as input to the third grid.

[0094] Gesture input for a certain grid. For example, if the user performs a gesture input along a first direction parallel to the plane where the screen is located, the image processing device may determine that the gesture input is an input to the first grid; if the user performs a gesture input along a second direction parallel to the plane where the screen is located, the image processing device may determine that the gesture input is an input to the second grid.

[0095] It is understood that the above-listed inputs are exemplary, that is, the present application embodiment includes but is not limited to the above-listed inputs. In actual implementation, the input may also include any other possible inputs, which may be determined according to actual use requirements, and the present application embodiment does not limit this.

[0096] In response to the third input, a cursor is displayed on the target grid.

[0097] The cursor is used to prompt the user the location of the selected grid.

[0098] Optionally, after receiving the third input, a response is made to the third input, a target grid may be determined based on the third input, and a cursor may be displayed on the target grid.

[0099] When the target grid is one grid, the cursor may be displayed in the grid; when the target grid is multiple grids, the cursor may be displayed in all of the multiple grids or in one of the multiple grids.

[0100] The cursor can prompt the user the location of the selected grid so that the user can confirm whether the characters included in the target grid are the text to be edited.

[0101] The embodiment of the present application can accurately locate the position of the text based on the grid by receiving a third input for determining the target grid, prompt the user of the location of the selected grid, avoid errors such as operating on other characters, and process text images more conveniently and accurately, improve the efficiency of editing text in the image, and enhance the user experience of editing text images.

[0102] Optionally, updating the display information of the target grid among the N grids includes: displaying a target image in the target grid when the second input is used to delete the target text corresponding to the target grid; or filling the target grid with the first color.

[0103] The target character is a target character in an area corresponding to a target grid in the text display area.

[0104] Optionally, in the case where the second input is used to delete the target characters in the area corresponding to the target grid in the text display area, a target operation of filling the target grid with a target image may be performed to update the display information of the target grid.

[0105] Optionally, the target image may be a preset picture (eg, a picture of a smiling face, etc.).

[0106] Optionally, the target image may be a picture of the background color of the area in the first picture corresponding to the target grid.

[0107] It is understandable that, during the process of filling the target image, the size of the target image may be adjusted (eg, cropped or scaled) to fit the size of each target grid, so that the target image fills the target grid but does not exceed the range of the target grid.

[0108] Since the target grid is filled with the target image, the target characters in the second text image are covered by the target image, and the user sees the target image but not the target characters, which reflects the effect of deleting the target characters in the first text image.

[0109] Optionally, in the case where the second input is used to delete the target character in the area corresponding to the target grid in the text display area, a target operation of filling the target grid with the first color may be performed to update the display information of the target grid.

[0110] The first color may be determined according to the second input.

[0111] Optionally, the brightness of the first color is greater than the brightness of the target character in the first text image.

[0112] The embodiment of the present application can achieve the effect of deleting text in the first text image more quickly and accurately by displaying the target image or filling the first color in the target grid. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, and enhance the user experience of editing text images.

[0113] Optionally, receiving a second input from the user on the second layer includes: receiving a second input from the user on a target image and a target grid in at least one image.

[0114] Optionally, the second input is used to determine a target grid and a target image.

[0115] The target image may be one of the preset multiple images. Based on the second input, one of the preset multiple images may be determined as the target image.

[0116] Optionally, the second input may include a touch input, a voice input, a gesture input, a key input or an operation for one of the preset multiple images.

[0117] Displaying a target image in the target grid includes: displaying a target image selected by the second input in the target grid.

[0118] Optionally, after receiving the second input, a target image may be selected from the plurality of preset images based on the second input.

[0119] After selecting the target image, you can display the target image in the target grid.

[0120] The embodiment of the present application can better meet user needs by displaying the target image selected by the user's input in the target grid to achieve the effect of deleting the text in the first text image, and can enhance the user's experience in editing text images.

[0121] Optionally, updating display information of a target grid among the N grids includes: filling the target grid with a second color when the second input is used to mark a target character in the target grid.

[0122] Optionally, in the case where the second input is used to mark the target character, an operation of filling the target grid with the second color may be performed to update the display information of the target grid.

[0123] The target character is a target character in an area corresponding to the target grid in the text display area.

[0124] The second color may be determined according to the second input.

[0125] Optionally, the brightness of the second color is smaller than the brightness of the target character in the first text image.

[0126] When a user needs to express his or her opinion on a chat record or a speech, the user can input a second input to the image processing device by swiping his or her finger across the corresponding text part on the screen. In response to the second input, the image processing device adds a highlight to the corresponding position and marks the characters at the corresponding position, making the transmission of ideas clear at a glance. Ideas can be conveyed quickly through pictures, reducing communication costs.

[0127] The embodiment of the present application can achieve the effect of marking the text in the first text image more quickly and accurately by filling the target grid with the second color. Compared with the pixel-based processing method, the grid-based processing method can better meet the user's needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, and enhance the user's experience in editing text images.

[0128] Optionally, in the case where the second input is used to modify the target character, the process of modifying the target character may include: deleting the target character and adding the first character in the target grid.

[0129] Optionally, deleting the target character may be performed by filling the target grid with the background color of the area where the target character is located in the first text image.

[0130] To add the first character in the target grid, you can enter the first character and adaptively fill the first character in the target grid.

[0131] Optionally, at least one of the size and color of the first character may be a default value. The default value may be determined according to the target grid. The default value of the size of the first character may be determined according to the size of the target grid or the size of the target character; the default value of the color of the first character may be determined according to the color of the target character.

[0132] Optionally, the screen may display a color picker control, which is used for the user to select a color in the first text image, so as to ensure that the color of the first character is consistent with the color of the target character.

[0133] Through the above process, the text in the first text image can be modified more quickly and accurately. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is less likely to make errors such as operating on other characters. It can more conveniently and accurately process text images, improve the efficiency of editing text in images, and enhance the user experience of editing text images.

[0134] Optionally, when the second input is used to modify the size of the target character, the user can long press the screen to control a control for indicating the modification of the size of the target character to be displayed on the screen, and the user inputs the second input by clicking the control.

[0135] Optionally, when the second input is used to modify the color of the target character, the user can long press the screen to control a control for indicating the modification of the color of the target character to be displayed on the screen, and the user inputs the second input by clicking the control.

[0136] Optionally, when the second input is used to underline the target character, the user can long press the screen to control a control for indicating that the target character is to be underlined to be displayed on the screen, and the user inputs the second input by clicking the control.

[0137] Optionally, when the second input is used to add a comment box to the target character, the user can long press the screen to control a control for indicating adding a comment box to the target character to be displayed on the screen, and the user inputs the second input by clicking the control.

[0138] Through the above process, the text in the first text image can be edited more quickly and accurately. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, and enhance the user experience of editing text images.

[0139] Optionally, before receiving a first input from a user on a first text image displayed on the first layer, the method further includes: receiving a fourth input from a user on a third text image displayed on the first layer.

[0140] Optionally, the third text image may be a picture obtained by taking photos or other methods, and the third text image may have certain image quality problems such as distortion and blur, resulting in distortion or blur of part or all of the text in the third text image.

[0141] The fourth input is used to trigger image correction of the third text image.

[0142] The fourth input may be touch input, voice input, gesture input or key input, or may be a fourth operation.

[0143] For example, the fourth input may be clicking a control displayed on the screen for indicating image correction.

[0144] It is understood that the above-listed inputs are exemplary, that is, the present application embodiment includes but is not limited to the above-listed inputs. In actual implementation, the input may also include any other possible inputs, which may be determined according to actual use requirements, and the present application embodiment does not limit this.

[0145] In response to the fourth input, image correction is performed on the third text image, and the first text image is displayed on the first layer.

[0146] Optionally, after receiving the fourth input, responding to the fifth input, the third text image is image corrected.

[0147] Image correction refers to the restoration processing of distorted images. The causes of image distortion include: image distortion caused by aberration, distortion, limited bandwidth, etc. of the imaging system; image geometric distortion caused by the shooting posture and scanning nonlinearity of the imaging device; image distortion caused by motion blur, radiation distortion, introduced noise, etc. The basic idea of ​​image correction is to establish a corresponding mathematical model according to the cause of image distortion, extract the required information from the contaminated or distorted image signal, and restore the original appearance of the image along the inverse process of the image distortion.

[0148] By image correction, various irregular phenomena of the text in the third text image, such as being larger at the top and smaller at the bottom or being curved, can be effectively improved to obtain the first text image.

[0149] The embodiment of the present application obtains the first text image by performing image correction on the third text image. The grid can be segmented more accurately based on the corrected text image, so that the position of the text can be accurately located based on the grid. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, improve the user experience of editing text images, and improve the universality of the image processing method.

[0150] Optionally, the second text image further includes an editing mark.

[0151] The editing mark is used to indicate that the second text image is obtained by editing the first text image.

[0152] Optionally, after acquiring the second text image, an editing mark may be added to the second text image, so that the second text image carries the editing mark.

[0153] Optionally, the editing mark can be hidden in the second text image as a hidden label by methods such as data encryption.

[0154] The second text image outputted in step 105 is a second text image carrying an editing mark.

[0155] The first text image does not carry an editing mark, and therefore the second text image can be distinguished from the first text image based on whether it carries an editing mark, thereby determining whether the text image is a picture that has not been edited by the image processing method provided by any of the above embodiments of the present application or a picture that has been edited by the image processing method provided by any of the above embodiments of the present application, thereby achieving security verification of the image.

[0156] The embodiment of the present application can improve security by outputting a second text image carrying an editing mark and marking the second text image as a picture edited by an image processing method.

[0157] It should be noted that the image processing method provided in the embodiment of the present application can be executed by an image processing device, or by a control module in the image processing device for executing the image processing method. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.

[0158] Figure 5 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. Based on the content of any of the above embodiments, Figure 5 As shown, the device includes a first input module 501, a grid generation module 502, a second input module 503, a grid update module 504 and an image fusion module 505, wherein:

[0159] The first input module 501 is used to receive a first input from a user on a first text image displayed on a first layer;

[0160] A grid generation module 502 is used to display grid lines on a second layer in response to a first input, the second layer is superimposed on the first layer, the grid lines divide the text display area of ​​the first text image into N grids, each grid includes one character, and the text display area is a display area of ​​at least one character;

[0161] The second input module 503 is used to receive a second input from the user on the second layer;

[0162] A grid updating module 504, configured to update display information of a target grid among the N grids in response to a second input;

[0163] An image fusion module 505 is used to fuse the content displayed in the target grid into the first text image to generate a second text image;

[0164] Wherein, N is a positive integer.

[0165] Optionally, the first input module 501, the grid generation module 502, the second input module 503, the grid editing module 504 and the image fusion module 505 are electrically connected in sequence.

[0166] The first input module 501 may receive a first input for triggering editing of a first text image.

[0167] The grid generation module 502 responds to the first input. In response to the first input, the outline of each character can be quickly determined through an image processing method; based on the outline of each character, each character in the first text image is accurately segmented to obtain grid lines and display the grid lines on the second layer.

[0168] The second input module 503 may receive a second input for determining a target operation to be performed on a target grid among the N grids.

[0169] The grid updating module 504 responds to the second input and may perform a target operation on the target grid to update the display information of the target grid.

[0170] The image fusion module 505 can use the first text image as the background of the second text image, use the content displayed in the target grid as the foreground of the second text image, and fuse the first text image and the content displayed in the target grid into the same picture to obtain the second text image.

[0171] Optionally, the image processing device further includes:

[0172] A third input module, used to receive a third input from a user;

[0173] A cursor display module, for displaying a cursor on the target grid in response to a third input;

[0174] The cursor is used to prompt the user the location of the selected grid.

[0175] Optionally, the grid updating module 504 is configured to display a target image in the target grid when the second input is for deleting the target character;

[0176] Alternatively, fill the target grid with the first color;

[0177] The target character is a target character in an area corresponding to a target grid in the text display area.

[0178] Optionally, the second input module 503 is used to receive a second input from a user on a target image and a target grid in at least one image;

[0179] The grid updating module 504 is used to display the target image selected by the second input in the target grid.

[0180] Optionally, the grid updating module 504 is configured to fill the target grid with a second color when the second input is used to mark the target character in the target grid.

[0181] Optionally, the second text image further includes an editing mark;

[0182] The editing mark is used to indicate that the second text image is obtained by editing the first text image.

[0183] The embodiment of the present application accurately locates the position of the text based on the grid, edits the target grid corresponding to the text to be edited in the first text image, updates the display information of the target grid, and fuses the first text image and the content displayed by the target grid to generate a second text image. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, and improve the user experience of editing text images.

[0184] The image processing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0185] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0186] The image processing device provided in the embodiment of the present application can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0187] Alternatively, if Figure 6As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a program or instruction stored in the memory 602 and executable on the processor 601. When the program or instruction is executed by the processor 601, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0188] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0189] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application.

[0190] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.

[0191] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0192] The user input unit 707 is used to receive a first input from a user on a first text image displayed on a first layer;

[0193] Processor 710, for displaying grid lines on a second layer in response to a first input, the second layer being superimposed on the first layer, the grid lines dividing a text display area of ​​the first text image into N grids, each grid including one character, and the text display area being a display area of ​​at least one character;

[0194] The user input unit 707 is further used to receive a second input from the user on the second layer;

[0195] The processor 710 is further configured to update display information of a target grid among the N grids in response to a second input;

[0196] The processor 710 is further configured to merge the content displayed in the target grid into the first text image to generate a second text image;

[0197] Wherein, N is a positive integer.

[0198] The embodiment of the present application accurately locates the position of the text based on the grid, edits the target grid corresponding to the text to be edited in the first text image, updates the display information of the target grid, and fuses the first text image and the content displayed by the target grid to generate a second text image. Compared with the pixel-based processing method, the grid-based processing method can better meet user needs, is simpler to operate, and is not prone to errors such as operating on other characters. It can more conveniently and accurately realize the processing of text images, improve the efficiency of editing text in the image, and improve the user experience of editing text images.

[0199] Optionally, the user input unit 707 is further configured to receive a third input from the user;

[0200] The display unit 706 is used to display a cursor in the target grid in response to the third input;

[0201] The cursor is used to prompt the user the location of the selected grid.

[0202] Optionally, the processor 710 is further configured to display a target image in the target grid when the second input is used to delete the target character;

[0203] Alternatively, fill the target grid with the first color;

[0204] The target character is a target character in an area corresponding to a target grid in the text display area.

[0205] Optionally, the user input unit 707 is further used to receive a second input from a user on a target image and a target grid in at least one image;

[0206] The processor 710 is further configured to display the target image selected by the second input in the target grid.

[0207] Optionally, the processor 710 is further configured to fill the target grid with a second color when the second input is used to mark a target character in the target grid.

[0208] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 709 can be used to store software programs and various data, including but not limited to target applications and operating systems. The processor 710 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and target applications, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 710.

[0209] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0210] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0211] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0212] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0213] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0214] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0215] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An image processing method, characterized in that: include: Receiving a first input from a user on a first text image displayed on a first layer; In response to the first input, grid lines are displayed on a second layer, the second layer is superimposed on the first layer, the grid lines divide the text display area of ​​the first text image into N grids, each grid includes one character, and the text display area is a display area of ​​at least one character; receiving a second input from a user on the second layer, wherein the second input includes an instruction to select a plurality of grids as target grids and an instruction to indicate a target operation to be performed on the target grids; In response to the second input, updating display information of a target grid among the N grids; Merging the content displayed in the target grid into the first text image to generate a second text image; Wherein, N is a positive integer.

2. The image processing method according to claim 1, characterized in that: Before receiving the second input from the user, the method includes: receiving a third input from the user; In response to the third input, displaying a cursor on the target grid; The cursor is used to prompt the user the location of the selected grid.

3. The image processing method according to claim 1, characterized in that: The updating of display information of a target grid among the N grids includes: In the case where the second input is used to delete a target character, displaying a target image in the target grid; Alternatively, filling the target grid with a first color; The target character is a target character in an area of ​​the text display area corresponding to the target grid.

4. The image processing method according to claim 3, characterized in that: The receiving a second input from the user on the second layer includes: receiving a second input from a user regarding a target image and the target grid in at least one image; The target image is displayed in the target grid, including: In the target grid, a target image selected by the second input is displayed.

5. The image processing method according to claim 1, characterized in that: The updating of display information of a target grid among the N grids includes: In case the second input is used to mark a target character in the target grid, the target grid is filled with a second color.

6. The image processing method according to claim 1, characterized in that: The second text image also includes an editing mark; The editing mark is used to indicate that the second text image is obtained by editing the first text image.

7. An image processing device, characterized in that: include: A first input module, used for receiving a first input from a user on a first text image displayed on a first layer; a grid generation module, configured to display grid lines on a second layer in response to the first input, the second layer being superimposed on the first layer, the grid lines dividing a text display area of ​​the first text image into N grids, each grid including one character, the text display area being a display area of ​​at least one character; A second input module, used to receive a second input from a user on the second layer, wherein the second input includes an instruction to select a plurality of grids as target grids and an instruction to indicate a target operation to be performed on the target grids; A grid updating module, configured to update display information of a target grid among the N grids in response to the second input; An image fusion module, used for fusing the content displayed in the target grid into the first text image to generate a second text image; Wherein, N is a positive integer.

8. The image processing device according to claim 7, characterized in that: The device also includes: A third input module, used to receive a third input from a user; A cursor display module, configured to display a cursor in the target grid in response to the third input; The cursor is used to prompt the user the location of the selected grid.

9. The image processing device according to claim 7, characterized in that: The grid updating module is used to display a target image in the target grid when the second input is used to delete a target character; Alternatively, filling the target grid with a first color; The target character is a target character in an area of ​​the text display area corresponding to the target grid.

10. The image processing device according to claim 9, characterized in that: The second input module is used to receive a second input from a user regarding a target image and the target grid in at least one image; The grid updating module is used to display the target image selected by the second input in the target grid.

11. The image processing device according to claim 7, characterized in that: The grid updating module is used to fill the target grid with a second color when the second input is used to mark the target character in the target grid.

12. The image processing device according to claim 7, characterized in that: The second text image also includes an editing mark; The editing mark is used to indicate that the second text image is obtained by editing the first text image.

13. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method as described in any one of claims 1 to 6.

14. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image processing method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Picture fusion processing method and device, equipment and storage medium

    CN110348527A

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

    CN111008947A