Image erasing method and device, electronic equipment and storage medium

By determining the selection and erasing layers in image editing, and using mask layers to indicate the erasing area, the problem of unnatural image integration in image editing is solved, and accurate image erasing and natural integration effects are achieved.

CN118967885APending Publication Date: 2024-11-15BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411038002.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

When adding special effects to images, it is difficult to naturally incorporate material images into the image to be added, and the lack of precise erasing methods leads to inadequate image editing.

Method used

Provide an image erasing method, by displaying the image erasing page, responding to the erase function startup command, determine the selection layer and erase layer in the candidate layer, and display the mask layer in the selection layer to indicate the target. Area of ​​the object, the image in the erase layer is erased based on the area indicated by the mask layer.

Benefits of technology

It realizes the effect of users accurately selecting erasing areas based on specific needs, and the selection layer and erasing layer are naturally integrated after image erasing, reducing the risk of misoperation and improving the efficiency and effect of image editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967885A_ABST
    Figure CN118967885A_ABST
Patent Text Reader

Abstract

The invention relates to an image erasing method and device, electronic equipment and a storage medium, and the method comprises the steps: displaying an image erasing page which comprises at least two candidate layers; in response to an erasure function starting instruction, determining a selected area layer and an erasure layer in the at least two candidate layers; the selected area layer comprises at least one object; a target object is determined in at least one object included in the selected area layer, a mask layer corresponding to the target object is displayed in the image erasing page, and the mask layer is used for indicating the area occupied by the target object in the selected area layer; and in response to an erasure confirmation instruction, erasing the image in the erasure layer based on the area indicated by the mask layer. The invention essentially provides a new method, so that a user can accurately select and erase the area needing to be erased by taking the object in the selected area layer as a reference according to specific requirements, and the effect that the image in the erased selected area layer is naturally fused with the image in the erased area layer is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image erasing method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of digital image technology, people have put forward higher requirements for the visual effects of images. In order to increase the appreciation and artistry of images, adding special effects to images has become an important technical means. Special effects can bring richer visual effects to images, making them more attractive and valuable to watch.

[0003] When adding special effects to an image, it is often desired to naturally blend the source image into the image to which the special effects are to be added. Summary of the invention

[0004] In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides an image erasing method, device, electronic device and storage medium.

[0005] In a first aspect, the present disclosure provides an image erasing method, comprising:

[0006] Displaying an image erasure page, wherein the image erasure page includes at least two candidate layers;

[0007] In response to an erase function start instruction, determining a selection layer and an erase layer in the at least two candidate layers; the selection layer includes at least one object;

[0008] Determine a target object from at least one object included in the selection layer, and display a mask layer corresponding to the target object in the image erasing page, wherein the mask layer is used to indicate an area occupied by the target object in the selection layer;

[0009] In response to the erase confirmation instruction, the image in the erase layer is erased based on the area indicated by the mask layer.

[0010] In a second aspect, the present disclosure further provides an image erasing device, comprising:

[0011] A candidate layer display module, used to display an image erasure page, wherein the image erasure page includes at least two candidate layers;

[0012] A layer determination module, configured to determine, in response to an erase function start instruction, a selection layer and an erase layer from among the at least two candidate layers; the selection layer includes at least one object;

[0013] a mask layer display module, used to determine a target object from at least one object included in the selection layer, and to display a mask layer corresponding to the target object in the image erasing page, wherein the mask layer is used to indicate an area occupied by the target object in the selection layer;

[0014] The erasing module is used to erase the image in the erasing layer based on the area indicated by the mask layer in response to the erasing confirmation instruction.

[0015] In a third aspect, the present disclosure further provides an electronic device, the electronic device comprising:

[0016] one or more processors;

[0017] A storage device for storing one or more programs;

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the image erasing method as described above.

[0019] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the image erasing method as described above when executed by a processor.

[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0021] The technical solution provided by the disclosed embodiment is to determine a selection layer and an erasing layer in at least two candidate layers by setting a response to an erase function start instruction; the selection layer includes at least one object; the target object is determined in the at least one object included in the selection layer, and a mask layer corresponding to the target object is displayed in the image erasing page, and the mask layer is used to indicate the area occupied by the target object in the selection layer; in response to the erase confirmation instruction, the image in the erasing layer is erased based on the area indicated by the mask layer. In essence, it provides a new method, which enables users to accurately select and erase the area to be erased based on specific needs and with reference to the objects in the selection layer, so as to achieve the effect of natural integration of the image in the selection layer and the image in the erasing layer after erasing. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 A flowchart of an image erasing method provided by an embodiment of the present disclosure;

[0025] Figure 2 A schematic diagram of a base map provided in an embodiment of the present disclosure;

[0026] Figure 3 A schematic diagram of a material image provided in an embodiment of the present disclosure;

[0027] Figure 4-Figure 5 Schematic diagrams of several image erasing pages provided in the embodiments of the present disclosure;

[0028] Figure 6 A schematic diagram of an auxiliary line corresponding to a base map provided in an embodiment of the present disclosure;

[0029] Figure 7-12 Schematic diagrams of several other image erasing pages provided by the embodiments of the present disclosure;

[0030] Fig.13 is a schematic structural diagram of an image erasing device in an embodiment of the present disclosure;

[0031] Fig.14 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0033] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0034] Figure 1This is a flowchart of an image erasing method provided by an embodiment of the present disclosure. This embodiment is applicable to the case where an image is edited in a client. The method can be executed by an image erasing device, which can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a terminal, specifically including but not limited to a smart phone, a PDA, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one machine, a smart home device, etc. Alternatively, this embodiment is applicable to the case where an image is edited in a server. The method can be executed by an image erasing device, which can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a server.

[0035] like Figure 1 As shown, the method may specifically include:

[0036] S110: Display an image erasing page, where the image erasing page includes at least two candidate layers.

[0037] The image erasing page, for example, can be a page for editing an image. Further, in the image erasing page, the user can interact with the controls or options in the image erasing page to erase the image in the local area of ​​the layer located in the upper layer. After the erasing operation, the erased area in the layer located in the upper layer presents a state of no pattern, no color, and transparency, which can show the image in the layer located in the lower layer.

[0038] The candidate layer is a pre-given layer, and the candidate layer includes images. In practice, the images in the candidate layer can be images taken by the user or images downloaded from the network.

[0039] S120. In response to an erase function start instruction, determine a selection layer and an erase layer in at least two candidate layers; the selection layer includes at least one object.

[0040] The erase function activation instruction may be, for example, an instruction for conveying to the electronic device that the user wishes to erase a local area in the layer.

[0041] There are many times when the erase function start instruction is generated. For example, in practice, it can be set that when it is detected that the image erase page includes at least two candidate layers, the erase function start instruction is directly generated. Alternatively, it is set that when it is detected that the image erase page includes at least two candidate layers and it is detected that the option for generating the erase function start instruction is triggered, the erase function start instruction is generated.

[0042] The option for generating the erase function start instruction may be, for example, a control or other triggerable element. Optionally, the option for generating the erase function start instruction is displayed in the image erase page. The option for generating the erase function start instruction is triggered, for example, when the user interacts with the option for generating the erase function start instruction by clicking, sliding, or dragging.

[0043] Determining the selection layer and the erasure layer from at least two candidate layers may include, for example, selecting one of the at least two candidate layers as the selection layer and selecting the other as the erasure layer. In other words, the selection layer and the erasure layer are both candidate layers. However, the selection layer and the erasure layer are different candidate layers. For another example, determining the selection layer and the erasure layer from at least two candidate layers may include, for example, selecting one of the at least two candidate layers as both the selection layer and the erasure layer. That is, the selection layer and the erasure layer are the same candidate layer.

[0044] The erasing layer may be, for example, a layer that is an erasing object. In other words, the image to be erased is located in the erasing layer. The selection layer may, for example, refer to a layer used to assist in determining the location of the image to be erased. In some scenarios, when the selection layer and the erasing layer are different candidate layers, the selection layer is located below the erasing layer. When the image to be erased in the erasing layer is erased, the area originally occupied by the image to be erased will become a transparent area. If there are images in the selection layer below, these images that were originally covered and blocked by the image to be erased and are located in the selection layer will be revealed due to the formation of the transparent area.

[0045] Objects are things that make up the image in the selection layer. They have clear semantic information, are identifiable, and are countable or uncountable individuals or units. They constitute the visual content of the image through their own attribute characteristics. They are the basic objects of image processing and analysis, especially the targets that need to be accurately extracted and separated. For example, objects can be people, parts of people (such as face, clothes, arms, hair, eyes), animals, parts of animals, plants, buildings, trees, vehicles, sky or grass, etc. In some scenes, objects are also called entities.

[0046] There are multiple methods for implementing this step. For example, in the case where the selection layer and the erasing layer are different candidate layers, in one embodiment, the method for implementing this step may include: in response to an erase function start instruction, using the candidate layer that is currently in a selected state as the erasing layer, or using the candidate layer that is currently at the top layer as the erasing layer; using the candidate layers other than the erasing layer as reference layers; and determining the selection layer in the reference layers.

[0047] The candidate layer currently in the selected state is used as the erasing layer. For example, the user performs a selection operation on one or more candidate layers in the image erasing page. In response to the selection operation on the one or more candidate layers, the selected layers are placed in a selected state, and then the candidate layer currently in the selected state is used as the erasing layer. The setting of using the candidate layer currently in the selected state as the erasing layer is because in some scenarios, the user's operation of selecting the candidate layer itself reflects that the user wants to use the selected candidate layer as the erasing layer.

[0048] The reason why the candidate layer currently at the top is set as the erasing layer is that during the image editing process, the candidate layer at the top is usually the first to be seen and operated by the user. This setting is in line with the user's intuitive cognition, making it easier for the user to understand the logic of erasing and quickly learn to use the image erasing function.

[0049] Optionally, a selection layer is determined in the reference layer, for example, all or part of the reference layer may be used as the selection layer.

[0050] For example, if the user successively Figure 2 The base map and Figure 3 Upload the material map given in to the image erasure page so that the base map and material map are displayed in the image erasure page as candidate layers. Figure 4 After the upload is completed, the candidate layer corresponding to the material image is located above the candidate layer corresponding to the base map. The candidate layer corresponding to the material image is determined to be the erase layer, and the candidate layer corresponding to the base map is the selection layer.

[0051] Furthermore, in the reference layer, determining the selection layer may also include: displaying the layer identifier of each reference layer in the image erasing page; and in response to a selection instruction of the target layer identifier in the layer identifier of the reference layer, using the reference layer corresponding to the target layer identifier as the selection layer.

[0052] The layer identification may be information for distinguishing one reference layer from other reference layers. For example, the layer identification may include one or more of the region range, name, number, and thumbnail of the reference layer.

[0053] The area range of the reference layer may be, for example, the area range occupied by the reference layer in the image erasing page.

[0054] The selection instruction for the target layer identifier in the layer identifier of the reference layer may be, for example, an instruction generated based on a user's selection operation on the layer identifier of the reference layer. The selection operation may be, for example, a click operation, a slide operation, or a drag operation. The layer identifier selected by the user through the selection operation is the target layer identifier.

[0055] If the layer identifier can include the area range of the reference layer, the selection operation on the target layer identifier can be, for example, a click operation or a sliding operation on a specific position in the area range of the target image, or it can be a circle selection operation on the area range of the target image using an area selection tool.

[0056] In some scenarios, taking into comprehensive consideration the situations that the selected layer and the erased layer are different candidate layers, and the selected layer and the erased layer are the same candidate layer, it can be set that, in the image erase page, the layer identifier of each candidate layer (including the reference layer and the erased layer) is displayed; in response to a selection instruction for the first target layer identifier in the layer identifier of the candidate layer, the candidate layer corresponding to the first target layer identifier is used as the selected layer.

[0057] The selection instruction for the first target layer identifier in the layer identifier of the candidate layer may be, for example, an instruction generated based on a user's selection operation on the layer identifier of the candidate layer. The selection operation may be, for example, a click operation, a slide operation, or a drag operation. The layer identifier selected by the user through the selection operation is the first target layer identifier.

[0058] For example, see Figure 5 , if the image displayed in the current image erasing page is the result of superimposing three candidate layers. The first candidate layer includes people, sky and grass. The second candidate layer includes a puppy. The third candidate layer includes the sun. In the image erasing page, three layer identifiers are displayed. These three layer identifiers correspond to the candidate layers one by one. If the user clicks the first layer identifier, the first candidate layer is used as the reference layer.

[0059] Optionally, in practice, when determining the erasing layer, a similar method may be selected, such as in response to an erase function start instruction, displaying the layer identifier of each candidate layer in the image erasing page; in response to a selection instruction for the second target layer identifier in the layer identifier of each candidate layer, using the candidate layer corresponding to the second target layer identifier as the erasing layer.

[0060] It should be noted that, in practice, the number of selected layers determined may be one or more. Similarly, the number of erased layers determined may be one or more. This application does not impose any limitation on this.

[0061] S130. Determine a target object from at least one object included in the selection layer, and display a mask layer corresponding to the target object in the image erasing page, where the mask layer is used to indicate an area occupied by the target object in the selection layer.

[0062] There are many methods for implementing this step, and this application does not limit this. For example, in some scenarios, the objects in the selection layer can be further divided into main objects and non-main objects. The main object can be, for example, an object in the selection layer that needs to be focused on or is expected to be highlighted. The non-main object can be, for example, an object other than the main object in the selection layer. In view of this, in some embodiments, S130 may include: determining the main object in the selection layer as the target object, and displaying a mask layer corresponding to the target object in the image erasing page. Among them, the mask layer corresponding to the target object can be obtained by identifying the selection layer using a subject recognition model. The execution time of the step of obtaining the mask layer corresponding to the target object can be located before S130, or it can be executed after the main object in the selection layer is determined as the target object.

[0063] In practice, optionally, the main object and the non-main object may not be distinguished, and S130 may include: in response to a selection instruction for a target object in at least one object included in the selection layer, displaying a mask layer corresponding to the target object in the image erasing page. The essence of such a setting is to allow the user to independently select which object occupies the area to determine the erasing area in the erasing layer. The object selected by the user may be a main object or a non-main object.

[0064] Further, S130 may include: displaying an object identifier in the image erasing page, the object identifier corresponding to the object in the selection layer; and displaying a mask layer corresponding to the target object in the image erasing page in response to a selection instruction for a target object identifier in the object identifier.

[0065] The object identification may be information that distinguishes one object from other objects, for example, and may include the name, number, and category name of the object.

[0066] The selection instruction for the target object identifier in the object identifier may be, for example, an instruction generated based on the user's selection operation on the target object identifier. The selection operation may be, for example, a click operation, a slide operation, or a drag operation. The object identifier selected by the user through the selection operation is the target object identifier.

[0067] For example, see Figure 4 , using the base map as the selection layer, using a certain entity segmentation model to identify the selection layer, we can get three objects: people, clothes, and sky. Using a certain subject recognition model to identify the selection layer, we get the subject object. The subject recognition model "thinks" that the subject object is a person. Figure 4In the image erasing page, four object identifiers are displayed: "intelligent subject", "person", "clothes", and "sky". "Intelligent subject" is the identifier of the subject object identified by the subject recognition model, and "person", "clothes", and "sky" are the identifiers of the objects identified by the entity segmentation model. If the user does not select the object identifier, the object corresponding to the default "intelligent subject" identifier (i.e., the subject object) can be set as the target object. The mask layer corresponding to the "intelligent subject" is displayed in the image erasing page. If the user selects the object identifier, such as selecting the "clothes" identifier, the mask layer corresponding to the "clothes" is displayed in the image erasing page.

[0068] In another embodiment, the implementation method of S130 may include: displaying auxiliary lines corresponding to the selection layer in the image erasing page; the auxiliary lines are used to indicate the edges of objects included in the selection layer, and the auxiliary lines divide the selection layer into multiple areas; in response to a selection operation on a target area among the multiple areas, determining a target object corresponding to the target area; and displaying a mask layer corresponding to the target object in the image erasing page.

[0069] The user selects one or more areas among the multiple areas divided by the auxiliary lines, and the area selected by the user is the target area. The selection operation of the target area among the multiple areas can be, for example, a click operation or a sliding operation by the user in the target area.

[0070] For example, if the base map ( Figure 2 The image in the figure is the selection layer. The auxiliary lines corresponding to the selection layer are as follows: Figure 6 . Assume that the entity recognition model is Figure 2 The image in the image is recognized, and there are three objects recognized, namely the sky, the grass, and the person. The auxiliary lines corresponding to the selection layer outline the edges of the sky, the grass, and the person. The auxiliary lines divide the selection layer into three areas. Each area corresponds to an object. Figure 6 In the example, area 1 corresponds to the sky, area 2 corresponds to the grass, and area 3 corresponds to the person. If it is detected that the user has performed a selection operation on one of the areas, such as performing a selection operation on area 2, since area 2 corresponds to the grass, the grass is taken as the target object.

[0071] When actually displaying the auxiliary lines, for example, Figure 6 The image in the Figure 4 or Figure 5 In the image, the auxiliary lines are displayed prominently by setting the color and / or thickness of the auxiliary lines.

[0072] By setting up the auxiliary lines corresponding to the selected area layer to be displayed in the image erasing page; in response to the selection operation of the target area in multiple areas, the target object corresponding to the target area is determined; its essence is to use the auxiliary lines to clearly indicate the scope of each area, so that the user can select the area to be referenced more accurately and quickly according to their needs.

[0073] In some other embodiments, before S130, the method further includes performing object recognition on the image in the selected area layer to obtain a mask layer corresponding to each object, and then obtaining a correspondence set between the object and the mask layer. "Displaying the mask layer corresponding to the target object in the image erasing page" may include querying the correspondence set between the object and the mask layer to obtain the mask layer corresponding to the target object, and displaying the mask layer corresponding to the target object in the image erasing page.

[0074] Optionally, the entity segmentation model and / or the entity parsing model may be used to perform object recognition on the image in the selection layer to obtain a mask layer corresponding to each object.

[0075] It should be noted that the subject segmentation model, entity segmentation model and entity parsing model are all image segmentation models, which are used to segment images (selection layers in this application), but the segmentation dimensions are different.

[0076] Typically, the subject segmentation model is used to segment the main object of the image, but not the non-subject objects.

[0077] The entity segmentation model is used to segment an image into entities. The segmented objects include main objects and non-main objects.

[0078] In some scenes, the object is a complex body that can be decomposed into multiple parts. The entity parsing module is used to further segment the object in the image into parts. In some embodiments, the object can be parsed as a whole. For example, if the object is a human body, the parsed parts may include a hat, gloves, glasses, a top, pants, socks, hair, trunk skin, left leg, right leg, left hand, right hand, sleeves, etc. In other embodiments, the object can be parsed locally. For example, if the object is a person, the parsed parts may include skin, left eyebrow, right eyebrow, left eye, right eye, nose, lips, hair, etc., which are located on the face of the person.

[0079] Base map ( Figure 2 The image in the image is the selection layer, and the person in the base image is the target object. Figure 7 The mask layer corresponding to the target object is displayed after the image is erased. Figure 7The area indicated by the mask layer shown in the figure is the area occupied by the person in the selection layer (i.e., the base map). Due to the existence of the mask layer, the person in the selection layer becomes blurred. In this way, the user can use the mask layer to identify which area will be used as the basis for determining the erasing area later.

[0080] In practice, in order to make the mask layer corresponding to the target object easier to observe in the image erasing page, the color of the area indicated by the mask layer can be set to a preset color, such as green, yellow, etc.

[0081] S140. In response to the erase confirmation instruction, erase the image in the erase layer based on the area indicated by the mask layer.

[0082] The erase confirmation instruction may be, for example, information that conveys to the electronic device that the user is satisfied with the currently selected selection layer, erase layer, and target object. It may be generated based on the user's selection operation of the erase information confirmation option. The selection operation may be, for example, a click operation, a slide operation, or a drag operation. For example, see Figure 7 , the "OK" in the lower right corner of the image erasing page is the erasing information confirmation option. If the user clicks the erasing information confirmation option, the image in the erasing layer will be erased based on the currently selected selection layer, erasing layer, and target object.

[0083] There are many methods for implementing this step, and this application does not limit this. Exemplarily, the method for implementing this step includes: based on the area indicated by the mask layer, determining a first area and a second area in the erasing layer; the first area corresponds to the area indicated by the mask layer, and the second area is the area in the erasing layer other than the first area; erasing the image in the first area in the erasing layer, or erasing the image in the second area in the erasing layer.

[0084] “The first area corresponds to the area indicated by the mask layer” may, for example, mean that the first area is completely consistent with the area indicated by the mask layer. In other words, the first area is defined based on the area occupied by the target object clearly indicated in the mask layer.

[0085] For example, see Figure 7 If the area indicated by the mask layer is the area occupied by the person in the selection layer, and the first area is in the erase layer, overlap the selection layer with the erase layer, and the first area coincides with the area occupied by the person in the selection layer. Figure 8 If you erase the image in the first area of ​​the erase layer, the first area will become a transparent area, which will make the person in the selected layer fully visible. Fig. 9If the image in the second area of ​​the erasing layer is erased, the second area will form a transparent area, which means that the part of the puppy image that does not overlap with the person (such as the head, tail, etc.) will disappear, and the sky and grass originally blocked by the puppy's head in the selection layer will be revealed, and the grass originally blocked by the puppy's tail in the selection layer will also be revealed. For example, the user can select the "Invert" option in the image erasing page to determine to erase the image in the first area of ​​the erasing layer, or to erase the image in the second area of ​​the erasing layer.

[0086] In the above technical solution, by setting a response to the erase function start instruction, a selection layer and an erase layer are determined in at least two candidate layers; the selection layer includes at least one object; the target object is determined in the at least one object included in the selection layer, and a mask layer corresponding to the target object is displayed in the image erase page, and the mask layer is used to indicate the area occupied by the target object in the selection layer; in response to the erase confirmation instruction, the image in the erase layer is erased based on the area indicated by the mask layer. It essentially provides a new method, which enables users to accurately select and erase the area to be erased based on specific needs, with the object in the selection layer as a reference, so as to achieve the effect of natural integration of the image in the selection layer and the image in the erase layer after erasure. Compared with the traditional method, this solution does not rely on precise pixel-by-pixel erasure or is limited to the local area defined by the thickness of the erase tool. It provides a more accurate, practical and fast way to select the erasure range, significantly reduces the risk of misoperation, and speeds up the erasure process. This image erasing method has great advantages for efficiently adding special effects and performing fine image editing.

[0087] On the basis of the above technical solution, optionally, after S130, the method further includes: reducing the transparency of the erased layer; after S140, further includes: restoring the transparency of the erased layer.

[0088] Reducing the transparency of the erased layer will make the image in the layer below it appear. Reducing the transparency of the erased layer may, for example, refer to adjusting the transparency of the erased layer to a pre-specified transparency value lower than 100%, such as 50% or 75%.

[0089] Restoring the transparency of the erased layer, for example, may refer to adjusting the transparency of the erased layer to 100%, so that the image in the layer below it is blocked and cannot be displayed.

[0090] See also Figure 7, after displaying the mask layer corresponding to the target object, adjust the transparency of the erased layer to 50%. In this way, the user can observe the area indicated by the mask layer and the base image through the erased layer, and then determine whether the area indicated by the mask layer is consistent with the area the user wants to erase, and estimate the overall visual effect of the image after erasure. Figure 8 After erasing the image in the erasing layer, the transparency of the erasing layer is restored to 100%. The user cannot see the grass in the bottom image through the puppy.

[0091] Based on the above technical solution, optionally, if the erasable layer includes text, before S140, it also includes: displaying a prompt message for prompting that after the erasable layer is erased, editing of the text in the erasable layer will be restricted. Restricting editing of the text in the erasable layer may include, for example, restricting editing of one or more of the content, font, color, and position of the text.

[0092] For example, see Fig.10 The image displayed on the image erasing page consists of three layers. Layer 1 includes text information, the content of which is "Lucky day", and layer 2 includes a puppy (i.e. Figure 3 ), layer 3 includes people, sky and grass (i.e. Figure 2 ).exist Fig.10 In the figure, layer 1 is selected, and the upper right corner of the text "Lucky day" has an "Edit" control corresponding to it. If the user clicks the "Edit" control, the content, font, color, position, etc. of the text information can be further edited. If layer 1 is used as the erasing layer, before erasing the image in the erasing layer, refer to Fig.11 , a prompt message is displayed, which reads "After using the word 'Erase', editing of text content, fonts, styles, etc. is no longer supported. Do you want to continue?" If the user clicks "Continue" and takes the person in layer 3 as the target object, the parts in layer 1 that overlap with the target object are erased. The erased result is as follows: Fig.12 .exist Fig.12 In the image, layer 1 is selected. Fig.10 and Fig.12 , there is no corresponding "Edit" control in the upper right corner of the text "Lucky day", which means that the content, font, color, position, etc. of the text in the erased layer are restricted from being edited.

[0093] The purpose of this setting is to prevent the editing operation from affecting the previously obtained text erasure results.

[0094] On the basis of the above technical solution, optionally, after S120, it also includes: detecting a smearing operation on the erasing layer, and erasing the image in the erasing layer based on the area covered by the smearing operation.

[0095] The smearing operation on the erasable layer may be, for example, smearing the erasable layer using an erasing tool, such as an eraser pen, a rubber, etc. Subsequently, the area covered by the smearing operation may be determined according to the thickness of the erasing tool and the smearing track, and then the image in the area covered by the smearing operation in the erasable layer may be erased.

[0096] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0097] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0098] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0099] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0100] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0101] Fig.13 Schematic diagram of the structure of an image erasing device in an embodiment of the present disclosure. The image erasing device provided in the embodiment of the present disclosure can be configured in a client, or can be configured in a server. Fig.13, the image erasing device specifically comprises:

[0102] A candidate layer display module 310 is used to display an image erasure page, wherein the image erasure page includes at least two candidate layers;

[0103] The layer determination module 320 is used to determine, in response to the erase function start instruction, a selection layer and an erase layer from the at least two candidate layers; the selection layer includes at least one object;

[0104] A mask layer display module 330, used to determine a target object from at least one object included in the selection layer, and to display a mask layer corresponding to the target object in the image erasing page, wherein the mask layer is used to indicate an area occupied by the target object in the selection layer;

[0105] The erasing module 340 is used to erase the image in the erasing layer based on the area indicated by the mask layer in response to the erasing confirmation instruction.

[0106] Furthermore, the layer determination module 320 is used to:

[0107] In response to the erase function start instruction, the candidate layer currently in the selected state is used as the erase layer, or the candidate layer currently located at the top layer is used as the erase layer; and the candidate layers other than the erase layer are used as reference layers;

[0108] In the reference layer, a selection layer is determined.

[0109] Furthermore, the layer determination module 320 is used to:

[0110] In the image erasing page, the layer identification of each reference layer is displayed;

[0111] In response to a selection instruction for a target layer identifier in the layer identifier of the reference layer, the reference layer corresponding to the target layer identifier is used as a selection layer.

[0112] Further, the mask layer display module 330 is used to:

[0113] Displaying object identifiers in the image erasing page, the object identifiers corresponding to the objects in the selection layer;

[0114] In response to a selection instruction for a target object identifier in the object identifiers, a mask layer corresponding to the target object is displayed in the image erasing page.

[0115] Further, the mask layer display module 330 is used to:

[0116] Displaying auxiliary lines corresponding to the selected area layer in the image erasing page; the auxiliary lines are used to indicate the edges of the objects included in the selected area layer, and the auxiliary lines divide the selected area layer into multiple areas;

[0117] In response to a selection operation on a target area among the multiple areas, determining a target object corresponding to the target area;

[0118] A mask layer corresponding to the target object is displayed in the image erasing page.

[0119] Furthermore, the device also includes a transparency adjustment module, which is used to reduce the transparency of the erasing layer after displaying the mask layer corresponding to the target object in the image erasing page;

[0120] In response to the erase confirmation instruction, the image in the erase layer is erased based on the area indicated by the mask layer, and then the transparency of the erase layer is restored.

[0121] Furthermore, if the erased layer includes text, the device further includes a prompt module for:

[0122] In response to the erase confirmation instruction, based on the area indicated by the mask layer, before erasing the image in the erase layer, a prompt message is displayed to indicate that after the erase operation is performed on the erase layer, editing of the text in the erase layer will be restricted.

[0123] Furthermore, the erasing module 340 is used to:

[0124] Based on the area indicated by the mask layer, determining a first area and a second area in the erasing layer; the first area corresponds to the area indicated by the mask layer, and the second area is an area in the erasing layer other than the first area;

[0125] The image in the first area of ​​the erasing layer is erased, or the image in the second area of ​​the erasing layer is erased.

[0126] The image erasing device provided in the embodiment of the present disclosure can execute the steps executed by the client or server in the image erasing method provided in the embodiment of the method of the present disclosure, and has the execution steps and beneficial effects, which will not be repeated here.

[0127] Fig.14 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Fig.14, which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing the embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Fig.14 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0128] like Fig.14 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003 to implement the image erasing method of the embodiment described in the present disclosure. In the RAM 1003, various programs and information required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0129] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange information. Although Fig.14 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0130] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the image erasing method as described above. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0131] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include an information signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0132] In some embodiments, the client and the server may communicate using any known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital information communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any known or future developed network.

[0133] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0134] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0135] Displaying an image erasure page, wherein the image erasure page includes at least two candidate layers;

[0136] In response to an erase function start instruction, determining a selection layer and an erase layer in the at least two candidate layers; the selection layer includes at least one object;

[0137] Determine a target object from at least one object included in the selection layer, and display a mask layer corresponding to the target object in the image erasing page, wherein the mask layer is used to indicate an area occupied by the target object in the selection layer;

[0138] In response to the erase confirmation instruction, the image in the erase layer is erased based on the area indicated by the mask layer.

[0139] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0140] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0142] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0143] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0144] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0145] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0146] one or more processors;

[0147] A memory for storing one or more programs;

[0148] When the one or more programs are executed by the one or more processors, the one or more processors implement any image erasing method provided by the present disclosure.

[0149] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the image erasing method as described in any one of the present disclosure is implemented.

[0150] The embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the image erasing method as described above is implemented.

[0151] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also 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 a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0152] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image erasing method, characterized in that: include: Displaying an image erasure page, wherein the image erasure page includes at least two candidate layers; In response to an erase function start instruction, determining a selection layer and an erase layer in the at least two candidate layers; the selection layer includes at least one object; Determine a target object from at least one object included in the selection layer, and display a mask layer corresponding to the target object in the image erasing page, wherein the mask layer is used to indicate an area occupied by the target object in the selection layer; In response to the erase confirmation instruction, the image in the erase layer is erased based on the area indicated by the mask layer.

2. The method according to claim 1, characterized in that In response to the erase function start instruction, determining a selection layer and an erase layer in the at least two layers includes: In response to the erase function start instruction, the candidate layer currently in the selected state is used as the erase layer, or the candidate layer currently located at the top layer is used as the erase layer; and the candidate layers other than the erase layer are used as reference layers; In the reference layer, a selection layer is determined.

3. The method according to claim 2, characterized in that Determining the selected area layer in the reference layer includes: In the image erasing page, the layer identification of each reference layer is displayed; In response to a selection instruction for a target layer identifier in the layer identifier of the reference layer, the reference layer corresponding to the target layer identifier is used as a selection layer.

4. The method according to claim 1, characterized in that: The step of determining a target object from at least one object included in the selected area layer, and displaying a mask layer corresponding to the target object in the image erasing page, comprises: Displaying object identifiers in the image erasing page, the object identifiers corresponding to the objects in the selection layer; In response to a selection instruction for a target object identifier in the object identifiers, a mask layer corresponding to the target object is displayed in the image erasing page.

5. The method according to claim 1, characterized in that The step of determining a target object from at least one object included in the selected area layer, and displaying a mask layer corresponding to the target object in the image erasing page, comprises: Displaying auxiliary lines corresponding to the selected area layer in the image erasing page; The auxiliary lines are used to indicate the edges of the objects included in the selection layer, and the auxiliary lines divide the selection layer into multiple areas; In response to a selection operation on a target area among the multiple areas, determining a target object corresponding to the target area; A mask layer corresponding to the target object is displayed in the image erasing page.

6. The method according to claim 1, characterized in that After displaying the mask layer corresponding to the target object in the image erasing page, the method further includes: reducing the transparency of the erase layer; After erasing the image in the erasing layer based on the area indicated by the mask layer in response to the erasing confirmation instruction, the method further includes: Restores the transparency of the erased layer.

7. The method according to claim 1, characterized in that If the erasable layer includes text; before erasing the image in the erasable layer based on the area indicated by the mask layer in response to the erasing confirmation instruction, the method further includes: A prompt message is displayed to indicate that after the erasing operation is performed on the erasing layer, editing of the text in the erasing layer will be restricted.

8. The method according to claim 1, characterized in that In response to the erase confirmation instruction, erasing the image in the erase layer based on the area indicated by the mask layer includes: Based on the area indicated by the mask layer, determining a first area and a second area in the erasing layer; the first area corresponds to the area indicated by the mask layer, and the second area is an area in the erasing layer other than the first area; The image in the first area of ​​the erasing layer is erased, or the image in the second area of ​​the erasing layer is erased.

9. An image erasing device, characterized in that: include: A candidate layer display module, used to display an image erasure page, wherein the image erasure page includes at least two candidate layers; A layer determination module, configured to determine, in response to an erase function start instruction, a selection layer and an erase layer from among the at least two candidate layers; the selection layer includes at least one object; a mask layer display module, used to determine a target object from at least one object included in the selection layer, and to display a mask layer corresponding to the target object in the image erasing page, wherein the mask layer is used to indicate an area occupied by the target object in the selection layer; The erasing module is used to erase the image in the erasing layer based on the area indicated by the mask layer in response to the erasing confirmation instruction.

10. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Image erasing method and apparatus, and electronic device and storage medium

    WO2026026646A1