Image processing method and electronic device

CN121326209BActive Publication Date: 2026-10-09HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411396023.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2024-06-27
Filing Date
2024-09-30
Publication Date
2026-10-09
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

[0005]本申请提供了一种图像处理方法,能够解决对原始图像进行图像处理之后生成的图像,图像处理效果不佳的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121326209B_ABST
    Figure CN121326209B_ABST
Patent Text Reader

Abstract

Embodiments of the present application are applicable to the field of data processing, and provide an image processing method and an electronic device. In response to a first operation of a user, an image erasing function is started, and in response to a second operation of the user on a first image, a selected region is highlighted in the first image, and then a to-be-erased object in the selected region is identified. Then, in response to the first operation of the user when the first image meets a preset condition, an erased image is obtained. Thus, the erasing of the first image is performed when the first image meets the preset condition, thereby avoiding the problem that the first image is still forcibly erased when the first image does not meet the preset condition, resulting in a poor display effect of the erased first image and affecting the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese Patent Application No. 202410858009.X, filed on June 27, 2024, entitled "Image Processing Method and Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of data processing, and more specifically, to an image processing method and an electronic device. Background Technology

[0003] With the continuous development of image processing technology, electronic devices are able to perform increasingly diverse image processing functions. For example, electronic devices can erase the target area corresponding to the indicated information in the original image based on the user's instructions, thus achieving the function of image erasure.

[0004] However, in some cases, the resulting image after image processing of the original image may not have a good image processing effect. Summary of the Invention

[0005] This application provides an image processing method that can solve the problem of poor image processing effect in the generated image after image processing of the original image.

[0006] Firstly, an image processing method is provided, the method comprising:

[0007] The image removal function is enabled in response to the user's first action;

[0008] In response to a second user action on the first image, the selected area is highlighted in the first image;

[0009] Identify the objects to be eliminated in the selected area;

[0010] If the first image meets the preset conditions, the object to be eliminated is removed, resulting in the erased image.

[0011] The first operation can refer to the operation of the check-in image removal function. For example, the first operation can refer to clicking on the image removal function. Figure 2 The operation of the manual smearing control shown in (e) is as follows. The second operation may refer to the operation of selecting the area to be eliminated in the first image, for example, the second operation may refer to... Figure 6 The circle drawing operation shown in (a) above is used to select the selected area; the second operation can also refer to, for example... Figure 6 The click operation shown in (b) above has selected the aforementioned selected area; the second operation can also refer to, for example... Figure 6The operation of drawing a wavy line shown in (c) indicates that the selected area has been selected; however, this embodiment does not limit this. The selected area can indicate... Figure 5 The region to be eliminated is shown in (b) in the figure.

[0012] The image processing method provided in this application embodiment, in response to a user's first operation, activates an image elimination function, and in response to a user's second operation on a first image, highlights a selected area in the first image, thereby identifying the object to be eliminated in the selected area. Then, in response to the user's first operation, the erased image is obtained when the first image meets preset conditions. Thus, the erasure of the first image is performed when the first image meets preset conditions, avoiding the problem of forcibly erasing the first image when the first image does not meet preset conditions, resulting in poor display effect of the erased first image and affecting the user experience.

[0013] In conjunction with the first aspect, in some embodiments of the first aspect, the preset conditions include: the first image is not a first type of image but a second type of image, and the selected area does not include the body part area; the sensitivity of the first type of image is greater than a first threshold; and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold.

[0014] Understandably, electronic devices can categorize images into three types based on their sensitivity: Type I, Type II, and Type III. Type I images have a sensitivity greater than a first threshold; Type II images have a sensitivity greater than a second threshold but less than the first threshold; and Type III images can have a sensitivity less than the second threshold. In other words, Type I images have higher sensitivity than Type II images, and Type II images have higher sensitivity than Type III images. Displaying Type I images typically leads to negative social consequences; displaying Type II images carries the risk of negative social consequences; and displaying Type III images generally does not lead to negative social consequences.

[0015] The image processing method provided in this application embodiment, in response to a user's first operation, activates an image removal function, and in response to a user's second operation on a first image, highlights a selected area in the first image, thereby identifying the object to be removed in the selected area. Then, if the first image is not a first type of image but a second type of image, and the selected area does not include body parts, in response to the user's first operation, an erased image is obtained. Since the first type of image has high image sensitivity, displaying a first type of image usually causes a negative social impact. The second type of image has lower sensitivity than the first type of image, and displaying a second type of image poses a risk of causing a negative social impact. It is understood that in images that pose a risk of causing a negative social impact, body parts are usually more sensitive areas. Therefore, if the first image poses a risk of causing a negative social impact, and it is further determined that the selected area is not a body part, the first image is erased only, which can reduce the risk of the erased image causing a negative social impact.

[0016] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: if the erased image is a first type of image, then the erased image is not displayed; if the erased image is not a first type of image, then the erased image is displayed.

[0017] The image processing method provided in this application, in response to a user's first operation, erases a first image that is not a first type of image but is a second type of image when the area to be erased is not a body area, and obtains an erased image. It is necessary to further determine whether the erased image is a first type of image, and if the erased image is a first type of image, it is not displayed. Only if the erased image is not a first type of image is it displayed. This can further reduce the risk of causing bad social impact due to the high sensitivity of the erased image.

[0018] In conjunction with the first aspect, in some embodiments of the first aspect, the preset conditions include: the first image is neither a first type of image nor a second type of image, wherein the sensitivity of the first type of image is greater than a first threshold, and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold.

[0019] The image processing method provided in this application only performs image erasure processing when the first image is not a highly sensitive first-class image or second-class image. When the first image is a highly sensitive first-class image or second-class image, there is no need to perform image erasure processing. This can avoid the situation where the erased image cannot be displayed due to its high sensitivity after image erasure processing has been performed, which also avoids unnecessary resource consumption of electronic devices.

[0020] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: if the erased image is a first type of image, or if the erased image is a second type of image, then the erased image is not displayed; if the erased image is neither a first type of image nor a second type of image, then the erased image is displayed.

[0021] The image processing method provided in this application, after responding to the user's first operation and erasing the first image that is not a first-type image or a second-type image to obtain the erased image, needs to further determine whether the erased image is a first-type image. If the erased image is a first-type image, the erased image is not displayed. Only if the erased image is not a first-type image is the erased image displayed. This can further reduce the risk of causing bad social impact due to the high sensitivity of the erased image.

[0022] In conjunction with the first aspect, in some embodiments of the first aspect, the preset conditions include: the first image is not a first type of image, and the selected area does not include body parts, wherein the sensitivity of the first type of image is greater than a first threshold.

[0023] The image processing method provided in this application embodiment, in response to a user's first operation, activates an image removal function, and in response to a user's second operation on a first image, highlights a selected area in the first image, thereby identifying the object to be removed in the selected area. Then, only when the first image is not a first type of image and the selected area does not include body parts, does the first operation occur, resulting in an erased image. It is understood that, since first type images have high image sensitivity, displaying first type images usually causes negative social impact. Body parts are usually more sensitive areas. Therefore, when the first image poses a risk of causing negative social impact, further determining that the selected area is not a body part before erasing the first image can reduce the risk of negative social impact caused by the erased image.

[0024] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: if the erased image is neither a first type image nor a second type image, then displaying the erased image, wherein the sensitivity of the second type image is greater than a second threshold and less than or equal to a first threshold; if the erased image is either a first type image or a second type image, then not displaying the erased image.

[0025] The image processing method provided in this application, in response to a user's first operation, performs image erasure on a first image that is not a first type of image, and when the area to be eliminated is not a body area, to obtain an erased image. It is then necessary to further determine whether the erased image is a first type of image or a second type of image. Only when the erased image is neither a first type of image nor a second type of image is the erased image displayed. This can further reduce the risk of causing adverse social impact due to the high sensitivity of the erased image.

[0026] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: determining whether a first image satisfies a preset condition; wherein determining whether a first image satisfies the preset condition includes: determining whether the first image is a first type of image, or whether the first image is a second type of image, wherein the sensitivity of the first type of image is greater than a first threshold, and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold; if the first image is not a first type of image and the first image is a second type of image, then determining whether a selected region includes a body part region; if the selected region includes a body part region, then determining whether the selected region is a region that causes an increase in the sensitivity value of the first image; if the selected region is not a region that causes an increase in the sensitivity value of the first image, then the first image satisfies the preset condition.

[0027] It is understandable that body parts include areas that can increase image sensitivity values ​​and areas that cannot. For example, when the body part is displayed as a human hand, foot, or head, that body part usually will not cause an increase in image sensitivity values.

[0028] Electronic devices can input images into a preset sensitivity model, and then determine the sensitivity value of the image based on the data output by the sensitivity model.

[0029] The image processing method provided in this application embodiment, in response to a user's first operation, activates an image removal function, and in response to a user's second operation on a first image, highlights a selected area in the first image, thereby identifying the object to be removed in the selected area. Then, if the first image is not a first-type image and is a second-type image, it further determines whether the selected area is a body part. If the selected area is a body part, it determines that the selected area is not a region that causes an increase in the sensitivity value of the first image before responding to the user's first operation to obtain the erased image. It can be understood that since the image sensitivity of the first-type image is high, displaying the first-type image usually causes a bad social impact. Therefore, if the first image has the risk of causing a bad social impact, it further determines that the selected area is not a body part that causes an increase in the image sensitivity value before erasing the first image, which can reduce the risk of the erased image causing a bad social impact.

[0030] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: if the erased image is a first type of image, or if the erased image is a second type of image, then the erased image is not displayed; if the erased image is neither a first type of image nor a second type of image, then the erased image is displayed.

[0031] The image processing method provided in this application, in response to a user's first operation, performs image erasure on a first image that is not a first type of image but is a second type of image, and the area to be eliminated is a body area, but not a body area that causes increased sensitivity of the first image. After obtaining the erased image, it is necessary to further determine whether the erased image is a first type of image or a second type of image. Only if the erased image is neither a first type of image nor a second type of image is the erased image displayed. This can further reduce the risk of causing adverse social impact due to the high sensitivity of the erased image.

[0032] In conjunction with the first aspect, in some embodiments of the first aspect, determining whether the first image meets the preset conditions includes: if the first image is neither a first type of image nor a second type of image, then the first image meets the preset conditions.

[0033] The image processing method provided in this application embodiment activates the image removal function in response to a user's first operation, and highlights the selected area in the first image in response to a user's second operation on the first image, thereby identifying the object to be removed in the selected area. Then, if the first image is neither a first type of image nor a second type of image, the first operation is responded to to obtain the erased image. Image erasure of images with low sensitivity risk can reduce the risk of the erased image causing bad social impact.

[0034] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: if the erased image is a first type of image, then the erased image is not displayed; if the erased image is not a first type of image, then the erased image is displayed.

[0035] The image processing method provided in this application, in response to a user's first operation, erases the first image that is neither a first type image nor a second type image, and obtains the erased image. It is then necessary to further determine whether the erased image is a first type image. Only if the erased image is not a first type image will the erased image be displayed. This can further reduce the risk of causing adverse social impact due to the high sensitivity of the erased image.

[0036] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: determining whether the first image satisfies a preset condition; wherein, determining whether the first image satisfies the preset condition includes: if the first image is not a first type of image but a second type of image, determining whether the region to be eliminated includes a body part region, wherein the sensitivity of the first type of image is greater than a first threshold, and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold; if the region to be eliminated does not include a body part region, then the first image satisfies the preset condition.

[0037] In conjunction with the first aspect, in some embodiments of the first aspect, determining whether the first image meets the preset conditions includes: if the first image is neither a first type of image nor a second type of image, then the first image meets the preset conditions.

[0038] Secondly, an image processing method is provided, the method comprising:

[0039] The image removal function is enabled in response to the user's first action;

[0040] In response to a second user action on the first image, the selected area is highlighted in the first image;

[0041] Identify the objects to be eliminated in the selected area;

[0042] If the first image is a first-type image, cancel the erasure operation on the object to be eliminated in the selected area. The first-type image is an image with a sensitivity greater than the first threshold.

[0043] If the first image is a second type of image, and the selected area does not include the body part, the object to be eliminated in the first image is removed to obtain the erased image, and the erased image is displayed. The second type of image is an image with a sensitivity greater than the second threshold and less than the first threshold.

[0044] The image processing method provided in this application embodiment, in response to a user's first operation, enables an image removal function, and in response to a user's second operation on a first image, highlights a selected area in the first image, identifies the object to be removed in the selected area, cancels the erasure operation on the object to be removed in the selected area if the first image is a first type of image (images with a sensitivity greater than a first threshold), and removes the object to be removed from the first image if the first image is a second type of image and the selected area does not include a body part, obtains the erased image, and displays the erased image. The second type of image is an image with a sensitivity greater than a second threshold. Images smaller than a first threshold are considered. Since the first type of images has higher sensitivity, displaying them usually causes negative social impact. The second type of images has lower sensitivity, and displaying them also poses a risk of causing negative social impact. It is understood that body parts are usually more sensitive areas in images that pose a risk of causing negative social impact. Therefore, if the first image poses a risk of causing negative social impact, it is only after further determining that the selected area is not a body part that the first image is erased. This can reduce the risk of negative social impact caused by the erased image.

[0045] In conjunction with the second aspect, in some embodiments of the second aspect, if the first image is a first type of image, after canceling the erasure operation on the object to be eliminated in the selected area, the method further includes: displaying a first prompt message, wherein the first prompt signal indicates that the erasure operation on the object to be eliminated in the selected area is canceled.

[0046] The image processing method provided in this application embodiment, after canceling the erasure operation on the object to be eliminated in the selected area when the first image is a first type of image, displays a first prompt message indicating that the erasure operation on the object to be eliminated in the selected area should be canceled. This can prompt the user that the first image has not been erased, so that the user can determine the next operation based on the state that the first image has not been erased, thus improving the user experience.

[0047] In conjunction with the second aspect, in some embodiments of the second aspect, the aforementioned first prompt information is a text signal, and displaying the first prompt information includes: displaying the first prompt information through a pop-up window.

[0048] In conjunction with the second aspect, in some embodiments of the second aspect, the above-mentioned display of the first prompt information includes: displaying the first prompt information by means of vibration.

[0049] In some cases, electronic devices can simultaneously display the initial prompt message via a pop-up window and alert the user via vibration.

[0050] In conjunction with the second aspect, in some embodiments of the second aspect, the second operation includes performing a sliding operation on the first image, and in response to the user's second operation on the first image, highlighting a selected area in the first image, including: determining a selected area in the first image in response to the trajectory formed by the user's sliding operation on the first image; and highlighting the selected area in the first image.

[0051] The image processing method provided in this application embodiment enables the image elimination function in response to a first user operation, and highlights a selected area in the first image in response to a second user operation on the first image, and identifies the object to be eliminated in the selected area. The second operation may refer to a sliding operation performed on the first image. In response to the trajectory formed by the user's sliding operation in the first image, the selected area in the first image is determined and highlighted in the first image. This enables the electronic device to determine the selected area based on a simple sliding operation, and the user interaction method is relatively simple.

[0052] In conjunction with the second aspect, in some embodiments of the second aspect, the second operation includes a click operation on the first image.

[0053] Thirdly, an image processing apparatus is provided, including a unit for performing the method of either the first or second aspect. The apparatus may be a server, a terminal device, or a chip within a terminal device. The apparatus may include an input unit and a processing unit.

[0054] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory for storing computer program code, which, when the processor executes the computer program code stored in the memory, causes the terminal device to perform either the first aspect or the second aspect.

[0055] When the device is a chip within a terminal device, the processing unit can be an internal processing unit of the chip, and the input unit can be an output interface, pin, or circuit, etc.; the chip may also include a memory, which can be an internal memory of the chip (e.g., registers, cache, etc.) or an external memory (e.g., read-only memory, random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, it causes the chip to execute either the first aspect or the second aspect.

[0056] In one possible implementation, the memory is used to store computer program code; the processor executes the computer program code stored in the memory, and when the computer program code stored in the memory is executed, the processor is used to perform: in response to a first operation by the user, enabling the image removal function; in response to a second operation by the user on the first image, highlighting a selected area in the first image; identifying the object to be removed in the selected area; and if the first image meets preset conditions, removing the object to be removed to obtain the erased image.

[0057] In one possible implementation, the memory is used to store computer program code; the processor executes the computer program code stored in the memory, and when the computer program code stored in the memory is executed, the processor is used to perform: in response to a first operation by the user, enabling an image removal function; in response to a second operation by the user on a first image, highlighting a selected area in the first image; identifying objects to be removed in the selected area; if the first image is a first type of image, canceling the erasure operation on the objects to be removed in the selected area, wherein the first type of image is an image with a sensitivity greater than a first threshold; if the first image is a second type of image, and the selected area does not include body parts, removing the objects to be removed from the first image to obtain an erased image, and displaying the erased image, wherein the second type of image is an image with a sensitivity greater than a second threshold and less than a first threshold.

[0058] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer program code, which, when executed by an image processing apparatus, causes the image processing apparatus to perform any one of the image processing methods of the first aspect or the second aspect.

[0059] Fifthly, a computer program product is provided, the computer program product comprising: computer program code, which, when executed by an image processing apparatus, causes the image processing apparatus to perform any one of the apparatus methods of the first aspect or the second aspect. Attached Figure Description

[0060] Figure 1 This is a schematic diagram of a hardware system for an electronic device applicable to this application;

[0061] Figure 2 This is a schematic diagram illustrating an application scenario of an image processing method applicable to an embodiment of this application.

[0062] Figure 3 This is a schematic diagram illustrating an application scenario of an image processing method applicable to an embodiment of this application.

[0063] Figure 4 This is a schematic diagram illustrating an application scenario of an image processing method applicable to an embodiment of this application.

[0064] Figure 5 This is a schematic diagram of the flow of an image processing method provided in an embodiment of this application;

[0065] Figure 6 This is a schematic diagram of the selected area provided in the embodiments of this application;

[0066] Figure 7 This is a schematic diagram of the flow of an image processing method provided in an embodiment of this application;

[0067] Figure 8 This is a schematic diagram of the flow of an image processing method provided in an embodiment of this application;

[0068] Figure 9 This is a schematic diagram of the flow of an image processing method provided in an embodiment of this application;

[0069] Figure 10 This is a schematic diagram of the flow of an image processing method provided in an embodiment of this application;

[0070] Figure 11 This is a schematic diagram of an object to be eliminated in a selected area provided in an embodiment of this application;

[0071] Figure 12 This is a schematic diagram of an object to be eliminated in a selected area provided in an embodiment of this application;

[0072] Figure 13 This is a schematic diagram of an object to be eliminated in a selected area provided in an embodiment of this application;

[0073] Figure 14 This is a schematic diagram illustrating how a selected region is determined from a first image, as provided in an embodiment of this application.

[0074] Figure 15 This is a schematic diagram of an image processing apparatus provided in this application;

[0075] Figure 16This is a schematic diagram of an electronic device for image processing provided in this application. Detailed Implementation

[0076] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0077] Hereinafter, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature.

[0078] For ease of understanding, the examples provided are for reference only and relate to the concepts in the embodiments of this application.

[0079] 1. Mask.

[0080] In image processing and computer vision, masks are typically used to specify a region of an image so that operations on that region do not affect other parts of the image. Typically, a mask is a binary or Boolean image of the same size as the original image. For example, pixels in the selected region of the mask are set to 1, while pixels in other regions are set to 0.

[0081] 2. Image segmentation.

[0082] Image segmentation is a crucial preprocessing step in image recognition and computer vision. It involves dividing an original image into several regions based on the brightness and color of its pixels, enabling subsequent image recognition or other computer vision processing based on these segmented regions. Image segmentation can be achieved by inputting the original image into an image segmentation model, which then performs machine learning to obtain the segmented regions. These segmented regions can consist of multiple segmented images.

[0083] 3. Image erasure.

[0084] Image erasure, as a common image processing technique, is widely used in various scenarios. For example, electronic devices can erase unwanted human figures from images, or they can erase items worn by a target object in an image.

[0085] The image processing method provided in this application can be applied to electronic devices. Optionally, the electronic device includes a terminal device, which can also be called a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device can be a mobile phone, smart TV, wearable device, tablet computer, computer with wireless transceiver function, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc. The embodiments of this application do not limit the specific technology or device form used in the terminal device.

[0086] For example, Figure 1 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0087] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0088] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0089] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0090] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0091] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0092] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0093] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0094] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding. In some cases, NPUs can also perform image segmentation.

[0095] It should be noted that any electronic device mentioned in the embodiments of this application may include more or fewer modules in electronic device 100.

[0096] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.

[0097] The application scenarios provided by the embodiments of this application are described below with reference to the accompanying drawings.

[0098] Image erasure, as a common image processing technique, is widely used in various scenarios. For example, electronic devices can erase unwanted human figures from images, or they can erase items worn by a target object in an image. The following section combines... Figure 2 and Figure 3 Explain how electronic devices erase images.

[0099] In response to the user's click on the gallery application 101 in interface 10, such as Figure 2 As shown in (a), the electronic device switches from display interface 10 to display interface 11, as follows: Figure 2 As shown in (b) above. The display interface 11 can display thumbnails of various images already stored in the gallery. At this time, if the user clicks on one of the thumbnails, for example... Figure 2 The thumbnail 111 in the first row and first column shown in (b) indicates that the electronic device switches from display interface 11 to display interface 12, as shown in the image. Figure 2 As shown in (c) in the diagram. The display interface 12 shows the image 121 corresponding to the thumbnail 111 in the first row and first column, as well as a share control 122, a favorite control 123, an edit control 124, a delete control 125, and more controls 126. If the user clicks the edit control 124, as shown in (c) in the diagram. Figure 2 As shown in (d), in response to the user clicking the edit control 124, the display interface 12 switches to the display interface 13, as follows. Figure 2 As shown in (e) in the diagram. The display interface 13 includes an image 131 corresponding to the thumbnail 111 in the first row and first column, a graffiti control 132, a text control 133, a smart eraser 134, a mosaic control 135, and a watermark control 136. When navigating to the display interface 13, the electronic device can also display the sub-controls corresponding to the smart eraser 134 by default, such as... Figure 2 The smart selection sub-control 1341 and the manual smearing sub-control 1342 are shown in (e) in the diagram. It should be noted that when navigating to display interface 13, the electronic device may also default to displaying the sub-controls corresponding to the graffiti control 132, text control 133, mosaic control 135, or watermark control 136; this embodiment does not impose such limitations. If the electronic device defaults to displaying the sub-control corresponding to the mosaic control 135 when navigating to display interface 13, the user can also click the smart removal control 134 to display the sub-control corresponding to the smart removal control 134.

[0100] The image 131 displayed in display interface 13 and the image 121 displayed in display interface 12 are both images corresponding to the thumbnail 111 in display interface 11. That is to say, the display content of images 131 and 121 is the display content of thumbnail 111. The size of image 131 and the size of image 121 can be the same or different, and this embodiment does not limit this. The size of image 131 can be a preset size, or it can be a size obtained by adaptively adjusting the preset size based on other information displayed on display interface 13.

[0101] In the display interface 13, if the user clicks the manual smear sub-control 1342, such as Figure 3As shown in (a) of the image. In response to the user's click on the manual erasure sub-control 1342, the user can erase the target object selected by the user in the image 131. The target object can be any extra person in the image 131, or accessories worn by a person in the image 131, etc., and this embodiment does not impose any limitations on this. As the user's finger moves in the image 131, the user's finger movement trajectory 137 is displayed on the image 131, such as... Figure 3 As shown in (b) above. When the user stops moving their finger, the displayed movement trajectory 138 is as follows. Figure 3 As shown in (c) above. It is understood that the movement trajectory 138 can be a closed curve or an open curve, and this embodiment of the application does not limit this.

[0102] If the movement trajectory 138 is a closed curve (not shown in the figure), the electronic device can directly generate the region to be eliminated 139 based on the movement trajectory 138, such as... Figure 3 As shown in (d) in the figure.

[0103] If the movement trajectory 138 is an open region (not shown in the figure), the start and end points of the movement trajectory 138 can be connected to form a new closed curve. Then, the region to be eliminated 139 can be generated based on the new closed region, such as... Figure 3 As shown in (d) in the figure.

[0104] Then, the electronic device can erase the target person selected in the area to be eliminated 139, and display the image 1312 after the target person has been erased, such as... Figure 3 As shown in (e) in the diagram.

[0105] In one possible scenario, the target object selected by movement trajectory 138 is an item worn by the person in image 131. For example, as... Figure 4 In (a), the target object selected by the user is the brooch worn by the person in image 131. The movement trajectory 138 formed by the user's finger movement can be as follows: Figure 4 As shown in (a) above. The electronic device generates the region to be eliminated 1310 based on the movement trajectory 138, as shown in (a). Figure 4 As shown in (b) above. The electronic device can then erase the target object (brooch) in the area to be erased 1310, obtaining image 1313 after the brooch has been erased, as shown below. Figure 4 As shown in (c) in the figure.

[0106] It should be understood that the above are illustrative examples of application scenarios and do not limit the application scenarios of this application in any way.

[0107] However, in some cases, image erasure may remove clothing or accessories from sensitive areas of a person in an image, leaving those areas exposed and causing negative social consequences.

[0108] In view of this, embodiments of this application provide an image processing method that can activate an image removal function in response to a user's first operation, and highlight a selected area in the first image in response to a user's second operation on the first image, thereby identifying the object to be removed in the selected area. Then, in response to the user's first operation, the erased image is obtained when the first image meets preset conditions. Thus, the erasure of the first image is performed when the first image meets preset conditions, avoiding the problem of forcibly erasing the first image when the first image does not meet preset conditions, resulting in poor display effect of the erased first image and affecting the user experience.

[0109] The following is combined Figures 5 to 14 The image processing method provided in the embodiments of this application will be described in detail.

[0110] Understandably, electronic devices can categorize images into three types based on their sensitivity: Type I, Type II, and Type III. Type I images have a sensitivity greater than a first threshold; Type II images have a sensitivity greater than a second threshold but less than the first threshold; and Type III images can have a sensitivity less than the second threshold. In other words, Type I images have higher sensitivity than Type II images, and Type II images have higher sensitivity than Type III images. Displaying Type I images typically leads to negative social consequences; displaying Type II images carries the risk of negative social consequences; and displaying Type III images generally does not lead to negative social consequences.

[0111] In one possible scenario, the electronic device can first determine that the image to be erased is neither a first-type image nor a second-type image, then erase the image according to the user's instructions. Finally, after generating the erased image, it can further determine the sensitivity of the erased image, and then determine whether to display the erased image based on the sensitivity. The following is a demonstration... Figure 5 The embodiments shown will be described in detail.

[0112] Figure 5 This is a schematic diagram illustrating an image processing method provided in an embodiment of this application, such as... Figure 5 As shown, the method includes:

[0113] S101. Determine whether the image to be erased is a first-type image. If not, proceed to S102. If yes, proceed to S103.

[0114] The image to be erased can refer to the above. Figure 2Image 131 shown in (e) is the image 121 selected in response to the user selecting thumbnail 111 in the gallery, and further in response to the user clicking the smart elimination control 134.

[0115] It is understood that the image to be erased can also be an image selected in other ways. For example, the first application is an application for image erasure. When the user opens the first application, they can access a gallery through the first application, and the user can select an image from the gallery in the first application as the image to be erased; or, the user can access an image stored on another electronic device (e.g., an Internet server) through the first application and download the image to the current electronic device as the image to be erased; this application embodiment does not limit this.

[0116] The electronic device can input the image to be erased into a first model for image recognition, and use the first model to perform machine learning to determine whether the image to be erased belongs to a first type of image. The first model can be a neural network model. The first model can reside in the current electronic device or be stored on a cloud server; this application embodiment does not impose any limitations on this.

[0117] If the first model is stored in the current electronic device, the electronic device can directly input the image to be erased into the first model to determine whether the image to be erased is a first type of image.

[0118] If the first model is stored on a cloud server, the electronic device can send the image to be erased to the cloud server, and the cloud server can input the image to be erased into the first model to determine whether the image to be erased is a first type of image.

[0119] Understandably, before inputting the image to be erased into the first model, the size of the image to be erased can be modified to match the size of the image processed by the first model. For example, the size of the long side of the image to be erased can be modified to 512, and the size of the short side can be modified accordingly.

[0120] If the image to be erased is a first-type image, then the image erasure process is terminated, that is, S103 is executed.

[0121] If the image to be erased is not a first type of image, then it is further determined whether the image to be erased is a second type of image, that is, S102 is executed.

[0122] S102. Determine whether the image to be erased is a second type of image. If yes, proceed to S104; otherwise, proceed to S109.

[0123] Determining whether the image to be erased is a second type of image can be achieved by inputting the image to be erased into the first model, where the first model simultaneously determines whether the image to be erased is a first type of image and a second type of image; alternatively, the image to be erased can be input into the first model, and after determining that the image to be erased is not a first type of image, the image to be erased can be input into the second model, where the second model determines whether the image to be erased is a second type of image; this application does not limit this.

[0124] For example, the image to be erased is input into a first model, and the first model outputs a sensitivity value for the image to be erased. If the sensitivity value of the image to be erased is greater than a first threshold, the image to be erased is determined to be a first-type image. If the sensitivity value of the image to be erased is less than the first threshold but greater than a second threshold, the image to be erased is determined to be a second-type image. If the sensitivity value of the image to be erased is less than the second threshold, the image to be erased is determined to be neither a first-type nor a second-type image.

[0125] If the image to be erased is a second type of image, then determine whether the user is erasing a body part of the human figure in the image, that is, execute S104.

[0126] If the image to be erased is not a second type of image, the image erasure can be started directly, that is, S109 is executed.

[0127] S103, terminate image erasure processing.

[0128] If the image to be erased is a type I image, the electronic device can directly terminate the image erasure process. Optionally, the electronic device can also return an error code when terminating the image erasure process. Based on the returned error code, the electronic device can also output a prompt message to the user, indicating that image operation cannot be performed normally.

[0129] For example, electronic devices can display the text message "Image cannot be erased" in a pop-up window based on the error code.

[0130] For example, electronic devices can use an error code to indicate to the user that the image cannot be erased by vibrating the image to be erased.

[0131] For example, electronic devices can display the text message "Image cannot be erased" in a pop-up window based on an error code, and also display a dynamic effect of vibrating the image to be erased to inform the user that the image cannot be erased.

[0132] For example, an electronic device may continue to display the image to be erased without responding to the user's erase instruction based on an error code.

[0133] S104. Determine whether the erasure area indicated by the instruction information is the body part of the human image in the image to be erased. If not, proceed to S105; if yes, proceed to S103.

[0134] The instruction information may refer to the information of the area to be erased selected by the user. The user can select the area to be erased by drawing a circle, by clicking on the target object, or by drawing other shapes. This application embodiment does not limit this.

[0135] For example, a user can draw a circle to define the erasure area 131A in the image to be erased, such as... Figure 6 As shown in (a) in the figure.

[0136] For example, a user can click on an object, and the area formed by the touch trajectory is the erased area, such as... Figure 6 As shown in (b) of the diagram.

[0137] For example, a user can draw a wavy line on a target object; the area covered by the drawn wavy line is the area to be erased. Figure 6 As shown in (c) in the figure.

[0138] For details on determining whether the area to be erased indicated by the instruction is the body portion of the human figure in the image to be erased, please refer to [link to relevant documentation]. Figure 10 The steps shown are not repeated here.

[0139] S105. Based on the mask determined by the instruction information, the image to be erased is erased to obtain the first erased image.

[0140] When the instruction information is a region to be erased selected by the user by drawing a circle, a corresponding mask can be generated based on the area inside the trajectory drawn by the user.

[0141] When the instruction information indicates that the user determines the target object for image erasure by clicking on the object, a mask image can be directly generated based on the target object.

[0142] When the instruction information is that the user selects the target object by drawing other images as the erasure area, a mask image can be directly generated based on the target object.

[0143] The electronic device can input a mask and the image to be erased into a third model, which then performs image erasure to generate a first erased image. The third model is a neural network model used for image erasure; by inputting the mask and the image to be erased into the third model, machine learning is performed to generate the first erased image.

[0144] The third model can be a GAN-based inpainting model or a stableDiffusion-based inpainting model; this application does not limit this.

[0145] S106. Determine whether the first erased image is a first type of image. If not, proceed to S107. If yes, proceed to S108.

[0146] The specific process of determining whether the first erased image is a first type of image is similar to the specific process of determining whether the image to be erased is a first type of image in S101 above, and will not be repeated here.

[0147] Understandably, if the image to be erased is not a second type of image and is not an image of a part of the body, and the obtained first erased image is not a first type of image, it means that the risk of sensitivity of the first erased image is not increased compared to the image to be erased, so the first erased image can be directly displayed, that is, S107 is executed; if the obtained first erased image is a first type of image, it means that the risk of sensitivity of the first erased image is increased compared to the image to be erased, so the first erased image is not displayed, that is, S108 is executed.

[0148] S107. Display the first erased image.

[0149] S108, Do not display the first erased image.

[0150] S109. Based on the mask determined by the instruction information, the image to be erased is erased to obtain the second erased image.

[0151] It is understandable that if the image to be erased is not a second type of image, it means that the sensitivity value of the image to be erased is low. In this case, the image can be erased directly according to the mask determined by the instruction information and the image to be erased to obtain the second erased image.

[0152] The specific process of erasing the image using the mask determined by the instruction information and the image to be erased to obtain the second erased image is similar to the process described in S105 above, which states that "the image is erased using the mask determined by the instruction information and the image to be erased to obtain the first erased image," and will not be repeated here.

[0153] S110. Determine whether the second erased image is a first type of image. If yes, execute S113; otherwise, execute S111.

[0154] The specific process of determining whether the second erased image is a first-type image is similar to the specific process of determining whether the image to be erased is a first-type image, and will not be repeated here.

[0155] If the second erased image is not a first type of image, it can be further determined whether the second erased image is a second type of image, that is, S111 is executed.

[0156] If the second erased image is a first type of image, then it can be determined that the second erased image will not be displayed, that is, S113 is executed.

[0157] S111. Determine whether the second erased image is a second type of image. If not, proceed to S112. If yes, proceed to S113.

[0158] The specific process of determining whether the second erased image is a second type of image is similar to the specific process of determining whether the image to be erased is a second type of image, and will not be repeated here.

[0159] If the second erased image is a second type of image, then the second erased image is not displayed, that is, S113 is executed.

[0160] If the second erased image is not a second type of image, then the second erased image is displayed, that is, S112 is executed.

[0161] S112, Display the second erased image.

[0162] S113, Do not display the second erased image.

[0163] In this way, when performing image operations, electronic devices can avoid displaying highly sensitive erased images, thereby avoiding negative social impacts caused by displaying highly sensitive erased images.

[0164] In one possible scenario, the electronic device can erase the image to be erased according to the user's instructions after determining that the image to be erased is not a first-type image. Finally, after generating the erased image, it can further determine the sensitivity of the erased image, and only display the erased image if it is neither a first-type image nor a second-type image. The following is a description of... Figure 7 The embodiments shown will be described in detail.

[0165] Figure 7 A flowchart illustrating another image processing method provided in this application embodiment is shown below. Figure 7 As shown, the method includes:

[0166] S201. Determine whether the image to be erased is a first-type image. If not, proceed to S202. If yes, proceed to S203.

[0167] The specific process for determining whether the image to be erased is a first-type image can be found in the steps shown in S101 above, and will not be repeated here.

[0168] If the image to be erased is a first-type image, then the image erasure process is terminated, that is, S203 is executed.

[0169] If the image to be erased is not a first type of image, then it is further determined whether the image to be erased is a second type of image, that is, S202 is executed.

[0170] S202. Determine whether the erasure area indicated by the instruction information is the body part of the human image in the image to be erased. If not, proceed to S204; if yes, proceed to S203.

[0171] The specific process for determining whether the erasure area indicated by the instruction information is the body part of the human figure in the image to be erased can be found in the steps shown in S104 above, and will not be repeated here.

[0172] If the erasure area indicated by the instruction message is the body part of the human figure in the image to be erased, then the image erasure process is terminated, that is, S203 is executed.

[0173] If the erasure area indicated by the instruction information is not the body part of the human image in the image to be erased, then the image is erased according to the mask determined by the instruction information and the image to be erased, and the erased image is obtained, which is to execute S204.

[0174] S203, terminate image erasure processing.

[0175] The specific process for terminating the image erasure process can be found in the description of S103 above, and will not be repeated here.

[0176] S204. Erase the image by matching the mask determined by the instruction information with the image to be erased, and obtain the erased image.

[0177] The specific process of erasing the image by using the mask determined by the instruction information and the image to be erased to obtain the erased image can be found in the description of S105 above, and will not be repeated here.

[0178] S205. Determine whether the erased image is a first-class image. If not, proceed to S206; if yes, proceed to S208.

[0179] The specific process for determining whether an erased image is a first-class image is similar to the specific process for determining whether an image to be erased is a first-class image in S101 above, and will not be repeated here.

[0180] If the erased image is a first-class image, then the erased image is not displayed, that is, S208 is executed.

[0181] If the erased image is not a first-type image, then it is further determined whether the erased image is a second-type image, that is, S206 is executed.

[0182] S206. Determine whether the erased image is a second-type image. If not, proceed to S207; if yes, proceed to S208. The specific process for determining whether the erased image is a second-type image is similar to the specific process for determining whether the image to be erased is a second-type image, and will not be repeated here.

[0183] If the erased image is a second type of image, then the erased image is not displayed, that is, S208 is executed.

[0184] If the erased image is not a second type of image, then the erased image is displayed, which means S207 is executed.

[0185] S207. Display the erased image.

[0186] S208, Do not display erased images.

[0187] In one possible scenario, during the process of erasing an image based on the mask determined by the instruction information and the image to be erased, to obtain an erased image, the erased area image can be obtained first based on the mask determined by the instruction information and the image to be erased. Then, the erased area image is used to overlay the corresponding area in the image to be erased, resulting in the erased image. That is, the mask determined by the instruction information and the image to be erased are input into the third model, and the output is the erased area image. In this way, the electronic device can determine whether an erased image can be generated based on the sensitivity value of the erased area image. This allows the step of generating an erased image based on the erased area image to be avoided if the sensitivity data of the erased area image is greater than a first threshold or a second threshold, thus preventing unnecessary resource consumption by the electronic device. The following is a detailed explanation... Figure 8 Let me explain in detail.

[0188] Figure 8 This is a schematic diagram illustrating an image processing method provided in an embodiment of this application, such as... Figure 8 As shown, the method includes:

[0189] S301. Determine whether the image to be erased is a first-type image. If not, proceed to S302. If yes, proceed to S303.

[0190] The specific process for determining whether the image to be erased is a first-type image can be found in the steps shown in S101 above, and will not be repeated here.

[0191] If the image to be erased is a first-class image, then the image erasure process is terminated, that is, S303 is executed.

[0192] If the image to be erased is not a first type of image, then it is further determined whether the image to be erased is a second type of image, that is, S302 is executed.

[0193] S302. Determine whether the image to be erased is a second type of image. If yes, proceed to S304; otherwise, proceed to S305.

[0194] The specific process for determining whether the image to be erased is a second type of image can be found in the steps shown in S102 above, and will not be repeated here.

[0195] If the image to be erased is a second type of image, then determine whether the user is erasing a body part of the image, that is, execute S304.

[0196] If the image to be erased is not a second type of image, the image erasure can be started directly, that is, S305 is executed.

[0197] S303, terminate image erasure processing.

[0198] The specific process for terminating the image erasure process can be found in the description of S103 above, and will not be repeated here.

[0199] S304. Determine whether the erasure area indicated by the instruction information is the body part of the human image in the image to be erased. If not, proceed to S305; if yes, proceed to S303.

[0200] The specific process for determining whether the erasure area indicated by the instruction information is the body part of the human figure in the image to be erased can be found in the description of S104 above, and will not be repeated here.

[0201] If the erasure area indicated by the instruction message is the body part of the human image in the image to be erased, then the image erasure process is terminated, that is, S303 is executed.

[0202] If the erasure area indicated by the instruction information is not the body part of the human image in the image to be erased, the image is erased according to the mask determined by the instruction information and the image to be erased, and the erased area image is obtained, which is to execute S305.

[0203] S305. Based on the mask determined by the instruction information, perform image erasure with the image to be erased to obtain the erased area image.

[0204] The erased area image can be obtained by cropping a first region image from the image to be erased, and then erasing the first region image. The first region can refer to the area in the image to be erased corresponding to the mask determined by the indicator information. That is, the erased area image is an image of the same size as the first region image, which is a portion cropped from the image to be erased; therefore, the size of the erased area image is usually smaller than the size of the image to be erased.

[0205] The electronic device can input the mask determined by the indication information and the image to be erased into the fourth model to obtain the erased area image. The fourth model is a neural network model used for image erasure. The mask and the image to be erased are input into the fourth model, and machine learning is performed to generate the erased area image.

[0206] S306. Determine whether the erased area image is a first-type image. If not, proceed to S307; if yes, proceed to S303.

[0207] The specific process for determining whether an erased image is a first-class image is similar to the specific process for determining whether an image to be erased is a first-class image in S101 above, and will not be repeated here.

[0208] If the erased area is a first-class image, then the image erasure process is terminated, that is, S303 is executed.

[0209] If the erased area image is not a first-type image, then it is further determined whether the erased image is a second-type image, that is, S307 is executed.

[0210] S307. Determine whether the erased area image is a second type of image. If not, proceed to S308; if yes, proceed to S303.

[0211] The specific process for determining whether an erased area image is a type II image is similar to the specific process for determining whether an image to be erased is a type II image, and will not be repeated here.

[0212] If the erased area is a second type of image, then the image erasure process is terminated, that is, S303 is executed.

[0213] If the erased image is not a second type of image, then an erased image is generated based on the erased area image, which is to execute S308.

[0214] S308. Generate an erased image based on the erased area image.

[0215] The specific process of generating an erased image based on an erased area image can overlay the erased area image onto the corresponding position in the image to be erased, as detailed in the following description.

[0216] S309. Display the erased image.

[0217] In one possible scenario, if the image to be erased is not a first-type image but a second-type image, and the area to be erased is determined to be a body part based on the indication information, it can be further determined whether this body part is the type of body part that causes the sensitivity value of the image to be erased to increase. If the body part is not the type of body part that causes the sensitivity value of the image to be erased to increase, then image erasure processing can be performed on that body part. The following is a breakdown... Figure 9 The embodiments shown will be described in detail below.

[0218] Figure 9 This is a schematic diagram illustrating an image processing method provided in an embodiment of this application, such as... Figure 9 As shown, the method includes:

[0219] S401. Determine whether the image to be erased is a first-type image. If not, proceed to S402. If yes, proceed to S403.

[0220] The specific process for determining whether the image to be erased is a first-type image can be found in the steps shown in S101 above, and will not be repeated here.

[0221] If the image to be erased is a first-class image, then the image erasure process is terminated, that is, S403 is executed.

[0222] If the image to be erased is not a first type of image, then it is further determined whether the image to be erased is a second type of image, that is, S402 is executed.

[0223] S402. Determine whether the image to be erased is a second type of image. If yes, execute S404; otherwise, execute S410.

[0224] The specific process for determining whether the image to be erased is a second type of image can be found in the steps shown in S102 above, and will not be repeated here.

[0225] If the image to be erased is a second type of image, then determine whether the user is erasing a body part of the image, that is, execute S404.

[0226] If the image to be erased is not a second type of image, the image erasure can be started directly, that is, S410 is executed.

[0227] S403, terminate image erasure processing.

[0228] The specific process for terminating the image erasure process can be found in the description of S103 above, and will not be repeated here.

[0229] S404. Determine whether the erasure area indicated by the instruction information is a body part area in the image to be erased. If yes, execute S405; if yes, execute S406.

[0230] The specific process for determining whether the erasure area indicated by the instruction information is a body part of the image to be erased can be found in the description of S104 above, and will not be repeated here.

[0231] If the erasure area indicated by the instruction information is the body part of the human image in the image to be erased, then determine whether the body part indicated by the instruction information is the body part that causes the sensitivity value of the image to be erased to be greater than the second threshold, that is, execute S405.

[0232] If the erasure area indicated by the instruction information is not the body part of the human image in the image to be erased, the image is erased according to the mask determined by the instruction information and the image to be erased, and the erased area image is obtained, which is to execute S406.

[0233] S405. Determine whether the first body region indicated by the instruction information is the second body region that causes the sensitivity value of the image to be erased to be greater than the second threshold. If yes, execute S403; otherwise, execute S406.

[0234] Understandably, after the image to be erased is input into the first model, the first model can output the sensitivity value of the image to be erased.

[0235] In one possible scenario, the sensitivity value of the image to be erased is obtained by averaging the sensitivity values ​​of each person in the image. Therefore, the electronic device can obtain the sensitivity value of each person. In this case, the electronic device can acquire the sensitivity value of the body region indicated by the instruction information to determine whether the sensitivity value of the first body region indicated by the instruction information is higher than the sensitivity value of the image to be erased. If the sensitivity value of the first body region indicated by the instruction information is higher than the sensitivity value of the image to be erased, then the first body region indicated by the instruction information is a second body region that causes the sensitivity value of the image to be erased to exceed a second threshold; if the sensitivity value of the first body region indicated by the instruction information is lower than the sensitivity value of the image to be erased, then the first body region indicated by the instruction information is not a second body region that causes the sensitivity value of the image to be erased to exceed the second threshold.

[0236] In one possible scenario, the electronic device can also crop out the first body region indicated by the instruction information from the image to be erased, generating an erasure region image. The erasure region image is then input into a first model, causing the first model to output sensitivity data for the erasure region image. If the sensitivity value of the erasure region image is greater than a second threshold, then the first body region indicated by the instruction information is a second body region that causes the sensitivity of the image to be erased to exceed the second threshold.

[0237] S406. Based on the mask determined by the instruction information, the image to be erased is erased to obtain the first erased image.

[0238] The specific process of erasing the image based on the mask determined by the instruction information and the image to be erased to obtain the first erased image can be described in the above-mentioned S105, and will not be repeated here.

[0239] S407. Determine whether the first erased image is a first type of image. If not, proceed to S408. If yes, proceed to S409.

[0240] The specific process of determining whether the first erased image is a first type of image is similar to the specific process of determining whether the image to be erased is a first type of image in S101 above, and will not be repeated here.

[0241] Understandably, the first erased image is obtained when the image to be erased is a second-type image and no body area has been erased. In this case, if the first erased image is not a first-type image, it means that the sensitivity of the first erased image has not increased relative to the image to be erased, and the first erased image can be displayed directly, that is, S408 is executed; if the first erased image is a first-type image, the sensitivity of the first erased image has increased relative to the image to be erased. In this case, in order to avoid the problems caused by displaying the first erased image with increased sensitivity, the first erased image can be not displayed, that is, S409 is executed.

[0242] S408, Display the first erased image.

[0243] S409, Do not display the first erased image.

[0244] S410. Based on the mask determined by the instruction information, the image to be erased is erased to obtain a second erased image.

[0245] It is understandable that if the image to be erased is not a second type of image, it means that the sensitivity value of the image to be erased is low. In this case, the image can be erased directly according to the mask determined by the instruction information and the image to be erased to obtain the second erased image.

[0246] The specific process of erasing the image using the mask determined by the instruction information and the image to be erased to obtain the second erased image is similar to the process described in S105 above, which states that "the image is erased using the mask determined by the instruction information and the image to be erased to obtain the first erased image," and will not be repeated here.

[0247] S411. Determine whether the second erased image is a first type of image. If yes, execute S414; otherwise, execute S412.

[0248] If the second erased image is not a first type image, then it is further determined whether the second erased image is a second type image, that is, S412 is executed.

[0249] If the second erased image is a first type of image, then it can be determined that the second erased image will not be displayed, that is, S414 is executed.

[0250] S412. Determine whether the second erased image is a second type of image. If not, proceed to S413. If yes, proceed to S414.

[0251] The specific process of determining whether the second erased image is a second type of image is similar to the specific process of determining whether the image to be erased is a second type of image, and will not be repeated here.

[0252] If the second erased image is not a second type of image, then the second erased image is displayed, that is, S413 is executed.

[0253] If the second erased image is a second type of image, then the second erased image is not displayed, that is, S414 is executed.

[0254] S413, Display the second erased image.

[0255] S414, Do not display the second erased image.

[0256] The following is combined Figure 10 This section explains the specific process of determining whether the area to be erased indicated by the instruction information is a body region in the image to be erased. For example... Figure 10 As shown, it includes:

[0257] S501. Based on the image to be erased and the segmentation model, obtain the segmentation result.

[0258] Here, the segmentation model can refer to a neural network model. A segmentation model can be used to segment human figures in an image and generate a human figure mask.

[0259] The generated human face mask can be referred to as the segmentation result, and each human face mask includes a HumanInstanceMask. It is understandable that the number of human face masks generated by the segmentation model varies depending on the number of human faces in the image. For example, if there are 5 human faces in the image to be erased, the segmentation model will generate 5 human face masks.

[0260] The segmentation model can be a human image instance segmentation model or a panoramic segmentation model; this application does not limit this.

[0261] If the splitting result is not empty, then execute S502.

[0262] Alternatively, if the segmentation result is not empty, further determine whether the proportion of the human image mask in the segmentation result to the human image mask map is greater than the fourth threshold. If the proportion of the human image mask HumanInstanceMask in the segmentation result to the human image mask map is greater than the fourth threshold, then execute S502. The fourth threshold can be 1%.

[0263] S502. Determine the intersection area between the mask of the erased area indicated by the instruction information and the mask of each portrait mask in the portrait mask image.

[0264] The process of obtaining the erasure area indicated by the instruction information can be as described in S104 above, and will not be repeated here. After obtaining the erasure area indicated by the instruction information, the mask of the erasure area can be determined based on the erasure area indicated by the instruction information. For example, by setting the pixel value of the erasure area in the image to be erased to 1, and setting the pixel value of the image to be erased excluding the erasure area to 0, the mask of the erasure area indicated by the instruction information can be obtained.

[0265] The electronic device can obtain the intersection area of ​​the mask indicating the erasure area and the HumanInstanceMask in each portrait mask by traversing and calculating.

[0266] S503. Determine whether the intersection area (intersectionArea) meets the preset conditions. If it does not meet the preset conditions, proceed to S504. If it meets the preset conditions, proceed to S505.

[0267] In one possible scenario, the preset condition could refer to whether the proportion of the intersection area in the human instance mask in the human image meets a preset threshold, or whether the proportion of the intersection area in the mask of the erased area indicated by the instruction information meets a preset threshold. This application embodiment does not limit this.

[0268] For example, the preset conditions are that the proportion of the intersection area in the human instance mask in the human image is greater than the fifth threshold and less than the sixth threshold, and that the proportion of the intersection area in the mask of the erased area indicated by the indication information is greater than the seventh threshold.

[0269] Among them, the fifth threshold can be 2%, the sixth threshold can be 48%, and the seventh threshold can be 82%.

[0270] In other words, the preset conditions are that intersectionArea / HumanInstanceMask ∈ (2%, 48%), and intersectionArea / Mask > 82%. Here, intersectionArea refers to the area of ​​the intersection region, HumanInstanceMask refers to the area of ​​the human image in the human image mask, and Mask refers to the area of ​​the erased region indicated by the indicator information.

[0271] For example, the erasure area indicated by the instruction message can be as follows: Figure 11 As shown in (a) above, the HumanInstanceMask in the human image can be as follows: Figure 11 As shown in (b) above, since the erase area indicated by the indicator area is entirely within the mask 902, the intersection area is the same as the erase area indicated by the indicator information, i.e., as shown in (b). Figure 11 Mask 901 is shown in (a) above. Mask 901 accounts for 5% of mask 902, meaning that the intersection area satisfies the preset condition that intersectionArea / HumanInstanceMask ∈ (2%, 48%). In this case, the erasure area indicated by the indication information is determined to be the body part of the image to be erased, and the image corresponding to mask 902 is not erased.

[0272] For example, the instruction information can be obtained by clicking on the target object, so the erasure area indicated by the instruction area can be as follows: Figure 12The human face mask shown in (a) can be a human instance mask, where the human face mask (HumanInstanceMask) can be as follows: Figure 12 As shown in (b) above, the mask 904, since the erasure area indicated by the indicator area is the human image mask, which basically overlaps with the human image mask HumanInstanceMask in the human image mask, the intersection area can be as follows: Figure 12 Mask 903 is shown in (a) above mask 904, where mask 903 accounts for 99% of mask 904, and that is, the intersection area does not satisfy the preset condition that intersectionArea / HumanInstanceMask∈(2%, 48%). In this case, it is determined that the erasure area indicated by the indication information is not a body part area in the image to be erased, and image erasure can be performed on the human image corresponding to mask 902.

[0273] In one possible scenario, the preset condition could refer to whether the proportion of the intersection area in the human instance mask in the human image meets a preset threshold, and whether the ratio of the width of the intersection area to the width of the human instance mask in the human image meets a preset threshold.

[0274] For example, the preset conditions are that the proportion of the intersection area in the human instance mask in the human image is greater than the fifth threshold and less than the sixth threshold, and the ratio of the width of the intersection area to the width of the human instance mask in the human image is greater than the eighth threshold.

[0275] Among them, the fifth threshold can be 2%, the sixth threshold can be 48%, and the eighth threshold can be 30%.

[0276] In other words, the preset conditions are that intersectionArea / HumanInstanceMask ∈ (2%, 48%), and BBOX(intersectionArea).width / BBOX(HumanInstanceMask).width > 30%. Here, intersectionArea refers to the area of ​​the intersection region, HumanInstanceMask refers to the area of ​​the human image in the human image mask, BBOX(intersectionArea).width refers to the width of the intersection region, and BBOX(HumanInstanceMask).width refers to the width of the human image mask in the human image mask.

[0277] For example, the erasure area indicated by the instruction message can be as follows: Figure 13 The mask 905 shown in (a) of the image can be a human instance mask, such as... Figure 13 Mask 906 is shown in (b) above, where mask 905 is a slightly wider area than mask 906. Therefore, the intersection area can be as follows: Figure 13 Mask 907, shown in (c), is slightly smaller than mask 905. Mask 907 occupies an area of ​​mask 906 of ∈ (2%, 48%), and the width of mask 907 is greater than 30% of the width of mask 906, meaning it satisfies the preset condition BBOX(intersectionArea).width / BBOX(HumanInstanceMask).width > 30%. In this case, the erasure area indicated by the instruction information is determined to be the body portion of the image to be erased, and the image corresponding to mask 902 is not erased.

[0278] S504. Determine that the area to be erased indicated by the instruction information is the body part area in the image to be erased.

[0279] S505. Determine that the area to be erased indicated by the instruction information is not a body part area in the image to be erased.

[0280] In some possible scenarios, when performing image erasure processing on the erasure area in the image to be erased, if the area proportion P of the erasure area in the image to be erased meets certain conditions, the portrait mask and the image to be erased can be cropped separately first, and then the image erasure processing can be performed based on the cropped portrait mask and the cropped image to be erased. This can optimize the effect of image erasure processing.

[0281] The specific process of image cropping may include:

[0282] For example, when the area percentage P is less than X2 (e.g., 10%), the portrait mask and the image to be erased can be cropped separately. The cropped portrait mask contains the first mask region, and the cropped image to be erased contains the erasure region. Then, based on the cropped portrait mask and the cropped image to be erased, image erasure processing can be performed on the erasure region in the image to be erased. The following describes the possible implementation methods for determining the cropping region and specific cropping provided by the embodiments of this application.

[0283] 1) Calculate the number of pixels in the first mask region (denoted as S).

[0284] 2) Multiply S by the coefficient corresponding to P to calculate the number of pixels in the erased area (denoted as T).

[0285] In some embodiments, when P < 2%, the coefficient corresponding to P is N6, and the number of pixels in the cropped region T = S * N6 is calculated. Optionally, N6 can be 17. Multiplying S by 17 can be understood as cropping the image by 6%.

[0286] In some embodiments, when 2% ≤ P < 10%, the coefficient corresponding to P is N7, and the number of pixels in the cropped region is calculated as T = S * N7. Optionally, N7 can be 10. Multiplying S by 10 can be understood as cropping the image by 10%.

[0287] 3) Calculate the width and height (H1) of the erased region (denoted as W1) based on the number of pixels T in the erased region. For example, you can take the square root of T and determine the width W1 and height H1 of the erased region. For instance, if T is 360000, then the width W1 and height L1 of the cropped region are both 600.

[0288] 4) such as Figure 14 As shown in (a), the width (denoted as W2) and height (denoted as H2) of the minimum bounding rectangle 17 of the first mask region are calculated.

[0289] 5) Adjust the width W1 and height H1 of the clipping region based on the width L2 and height H2 of the minimum bounding rectangle 17.

[0290] For example, if the width W1 of the clipping region is less than the width W2 of the minimum bounding rectangle 17, then W1 = W2 + N8.

[0291] For example, if the height H1 of the clipping region is less than the height H2 of the minimum bounding rectangle 17, then H1 = H2 + N8.

[0292] For example, if the width W1 or height H1 of the cropping region is less than N9, then the width W1 or height H1 of the cropping region is set to N9. Here, N9*N9 is the input image size defined by the inpainting model.

[0293] Optionally, N8 can be 6, and N9 can be 768.

[0294] 6) such as Figure 14 As shown in (a), the clipping region 42 is determined with the midpoint of the minimum bounding rectangle 41 of the first mask region as the center, according to the adjusted width L1 and height H1.

[0295] In this context, it is assumed that both the image to be erased and the portrait mask have a first size. For example, the first size is 1600*1200.

[0296] like Figure 14 As shown in (a) and (d) above, following steps 1) to 6), a first mask image of a second size is cropped from the portrait mask image, and a second-sized region image to be erased is cropped from the image to be erased. For example, the second size is 1200*800.

[0297] In this way, a cropped image of the region to be erased, matching the third model, can be obtained. This image can then be used as input to the third model, which performs machine learning on the image to be erased to generate an image of the erased region. The erased image is then overlaid on the corresponding position in the image to be erased, resulting in the erased image.

[0298] The specific process of overlaying the erased area image onto the corresponding position in the image to be erased to obtain the erased image may include:

[0299] It is understandable that by scaling the erased area image to the same size as the area to be erased image (second size), the scaled erased area image can be seamlessly filled into the area to be erased of the image to be erased.

[0300] In the embodiments of this application, the erased image is obtained by the following image matrix calculation formula.

[0301] Pi = Po × (1 – Pm) + Pe × Pm.

[0302] Where Po represents the image to be erased, Pe represents the erased area image, Pm represents the mask determined according to the instruction information, and Pi represents the erased image.

[0303] Where (1–Pm) represents inverting the pixel values ​​of the portrait mask.

[0304] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0305] It is understood that, in order to achieve the above functions, the electronic device includes hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0306] This application embodiment can divide an electronic device into functional modules based on the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one module. It should be noted that the module division in this application embodiment is illustrative and represents only one logical functional division; other division methods may be used in actual implementation. It should also be noted that the module names in this application embodiment are illustrative, and the names of the modules are not limited in actual implementation.

[0307] Figure 15 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application.

[0308] It should be understood that the image processing device 600 can perform... Figures 7 to 16 The image processing method shown; the image processing apparatus 600 includes: an acquisition unit 610 and a processing unit 620.

[0309] The processing unit 620 is configured to enable the image removal function in response to a first operation by the user; highlight the selected area in the first image in response to a second operation by the user on the first image; identify the object to be removed in the selected area; and remove the object to be removed if the first image meets the preset conditions, thereby obtaining the erased image.

[0310] The image processing apparatus provided in this embodiment is used to execute the image processing method of the above embodiment. The technical principle and technical effect are similar, and will not be described again here.

[0311] It should be noted that the image processing device 600 described above is embodied in the form of a functional unit. The term "unit" here can be implemented in software and / or hardware, and there is no specific limitation on this.

[0312] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.

[0313] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0314] Figure 16 A schematic diagram of the structure of an electronic device provided in this application is shown. Figure 16 The dashed lines indicate that the unit or module is optional. The electronic device 700 can be used to implement the image processing method described in the above method embodiments.

[0315] The electronic device 700 includes one or more processors 701, which can support the implementation of the image processing method in the method embodiments of the electronic device 700. The processor 701 can be a general-purpose processor or a special-purpose processor. For example, the processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, such as discrete gate, transistor logic devices, or discrete hardware components.

[0316] The processor 701 can be used to control the electronic device 700, execute software programs, and process data from the software programs. The electronic device 700 may also include a communication unit 705 for inputting (receiving) and outputting (transmitting) signals.

[0317] For example, electronic device 700 may be a chip, communication unit 705 may be the input and / or output circuit of the chip, or communication unit 705 may be the communication interface of the chip, and the chip may be a component of terminal device or other electronic device.

[0318] For example, electronic device 700 can be a terminal device, communication unit 705 can be the transceiver of the terminal device, or communication unit 705 can be the transceiver circuit of the terminal device.

[0319] The electronic device 700 may include one or more memories 702, which store a program 704. The program 704 can be executed by the processor 701 to generate instructions 703, causing the processor 701 to execute the impedance matching method described in the above method embodiments according to the instructions 703.

[0320] Optionally, the memory 702 may also store data. Optionally, the processor 701 may also read the data stored in the memory 702, which may be stored at the same memory address as the program 704, or the data may be stored at a different memory address than the program 704.

[0321] The processor 701 and memory 702 can be configured separately or integrated together; for example, integrated on the system on chip (SOC) of the terminal device.

[0322] For example, the memory 702 can be used to store the relevant program 704 of the image processing method provided in the embodiments of this application, and the processor 701 can be used to call the relevant program 704 of the image processing method stored in the memory 702 when performing image restoration, and execute the image processing method of the embodiments of this application; including: in response to a first operation of the user, enabling the image removal function; in response to a second operation of the user on the first image, highlighting the selected area in the first image; identifying the object to be removed in the selected area; if the first image meets the preset conditions, removing the object to be removed to obtain the erased image.

[0323] Alternatively, the processor 701 can be used to call the relevant program 704 of the image processing method stored in the memory 702 during image restoration, and execute the image processing method of the present application embodiment; including: enabling the image removal function in response to a first operation of the user; highlighting the selected area in the first image in response to a second operation of the user on the first image; identifying the object to be removed in the selected area; if the first image is a first type of image, canceling the erasure operation on the object to be removed in the selected area, the first type of image being an image with a sensitivity greater than a first threshold; if the first image is a second type of image, and the selected area does not include the body part area, removing the object to be removed in the first image to obtain the erased image, and displaying the erased image, the second type of image being an image with a sensitivity greater than a second threshold and less than a first threshold.

[0324] This application also provides a computer program product that, when executed by processor 701, implements the image processing method described in any of the method embodiments of this application.

[0325] The computer program product can be stored in memory 702, for example, program 704. Program 704 is finally converted into an executable object file that can be executed by processor 701 after processing such as preprocessing, compilation, assembly and linking.

[0326] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the image processing method described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0327] The computer-readable storage medium is, for example, memory 702. Memory 702 can be volatile memory or non-volatile memory, or memory 702 can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0328] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0329] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0330] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0331] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0332] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0333] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0334] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0335] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image processing method, characterized in that, The method includes: The image removal function is enabled in response to the user's first action; In response to a second user action on the first image, the selected area is highlighted in the first image; Identify the objects to be eliminated in the selected area; Determine whether the first image meets the preset conditions; The step of determining whether the first image meets the preset conditions includes: Determine whether the first image is a first type of image or a second type of image, wherein the sensitivity of the first type of image is greater than a first threshold, and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold; If the first image is not a first type of image and the first image is a second type of image, then determine whether the selected area includes a body part area; If the selected region includes the body part region, then determine whether the selected region is the region that causes the sensitivity value of the first image to increase; If the selected region is not a region that causes the sensitivity value of the first image to increase, then the first image satisfies the preset condition. If the first image meets the preset conditions, the object to be eliminated is removed, resulting in an erased image.

2. The method according to claim 1, characterized in that, The preset conditions include: the first image is not a first type of image but a second type of image, and the selected area does not include the body part area; the sensitivity of the first type of image is greater than a first threshold; and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold.

3. The method according to claim 2, characterized in that, The method further includes: If the erased image is the first type of image, then the erased image will not be displayed; If the erased image is not of the first type, then the erased image is displayed.

4. The method according to any one of claims 1 to 3, characterized in that, The preset conditions include: the first image is neither a first type of image nor a second type of image, wherein the sensitivity of the first type of image is greater than a first threshold, and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold.

5. The method according to claim 4, characterized in that, The method further includes: If the erased image is a first type of image, or if the erased image is a second type of image, then the erased image will not be displayed. If the erased image is neither the first type of image nor the second type of image, then the erased image is displayed.

6. The method according to claim 1, characterized in that, The preset conditions include: the first image is not a first type of image, and the selected area does not include body parts, wherein the sensitivity of the first type of image is greater than a first threshold.

7. The method according to claim 6, characterized in that, The method further includes: If the erased image is neither the first type of image nor the second type of image, then the erased image is displayed, wherein the sensitivity of the second type of image is greater than the second threshold and less than or equal to the first threshold; If the erased image is either the first type of image or the second type of image, then the erased image will not be displayed.

8. The method according to claim 1, characterized in that, The method further includes: If the erased image is a first type of image, or if the erased image is a second type of image, then the erased image will not be displayed. If the erased image is neither the first type of image nor the second type of image, then the erased image is displayed.

9. The method according to claim 1 or 8, characterized in that, Determining whether the first image meets the preset conditions includes: If the first image is neither the first type of image nor the second type of image, then the first image satisfies the preset condition.

10. The method according to claim 9, characterized in that, The method further includes: If the erased image is the first type of image, then the erased image will not be displayed; If the erased image is not of the first type, then the erased image is displayed.

11. The method according to claim 1, characterized in that, The method further includes; Determine whether the first image meets the preset conditions; The step of determining whether the first image meets the preset condition includes: If the first image is not a first type of image but a second type of image, determine whether the region to be eliminated includes a body part region. The sensitivity of the first type of image is greater than a first threshold, and the sensitivity of the second type of image is greater than a second threshold and less than or equal to the first threshold. If the area to be eliminated does not include the body portion, then the first image satisfies the preset condition.

12. The method according to claim 11, characterized in that, Determining whether the first image meets the preset condition includes: If the first image is neither the first type of image nor the second type of image, then the first image satisfies the preset condition.

13. An image processing method, characterized in that, The method includes: The image removal function is enabled in response to the user's first action; In response to a second user action on the first image, the selected area is highlighted in the first image; Identify the objects to be eliminated in the selected area; If the first image is a first type of image, cancel the erasure operation on the object to be eliminated in the selected area. The first type of image is an image with a sensitivity greater than the first threshold. If the first image is a second type of image, and the selected area does not include the body part area, the object to be eliminated in the first image is removed to obtain the erased image, and the erased image is displayed. The second type of image is an image with a sensitivity greater than a second threshold and less than a first threshold. If the first image is a second type of image, and the selected area includes a body part area, then determine whether the selected area is the area that causes the sensitivity value of the first image to increase; If the selected area is not the area that causes the sensitivity value of the first image to increase, the object to be removed from the first image is eliminated to obtain the erased image.

14. The method according to claim 13, characterized in that, If the first image is a first type of image, after canceling the erasure operation on the object to be eliminated in the selected area, the method further includes: The system displays a first prompt message, indicating that the erasure operation on the object to be eliminated in the selected area should be cancelled.

15. The method according to claim 14, characterized in that, The first prompt message is a text signal, and displaying the first prompt message includes: The first prompt message will be displayed in a pop-up window.

16. The method according to claim 14 or 15, characterized in that, The display of the first prompt information includes: The first prompt message is displayed via vibration.

17. The method according to any one of claims 13 to 15, characterized in that, The second operation includes performing a sliding operation on the first image. The step of highlighting a selected area in the first image in response to a second user action on the first image includes: In response to the trajectory formed by the user's swiping operation in the first image, a selected area in the first image is determined; The selected area is highlighted in the first image.

18. The method according to any one of claims 13 to 15, characterized in that, The second operation includes a click operation on the first image.

19. An electronic device, characterized in that, The electronic device includes a module for performing the method as described in any one of claims 1 to 12, or the electronic device includes a module for performing the method as described in any one of claims 13 to 18.

20. An electronic device, characterized in that, include: One or more processors; Memory; And one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer programs are executed by the one or more processors, cause the electronic device to perform the method as claimed in any one of claims 1 to 12, or cause the electronic device to perform the method as claimed in any one of claims 13 to 18.

21. A chip system, characterized in that, The chip system includes a processor for calling and running a computer program from memory, causing an electronic device on which the chip system is installed to perform the method as claimed in any one of claims 1 to 12, or causing an electronic device on which the chip system is installed to perform the method as claimed in any one of claims 13 to 18.

22. A computer-readable storage medium comprising a computer program, characterized in that, When the computer program is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 12, or causes the electronic device to perform the method as described in any one of claims 13 to 18.

Citation Information

Patent Citations

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

    CN114285961A