Image processing method, device, apparatus and storage medium
By identifying the face and surrounding area in image processing, detecting target objects, and processing them based on feature information, the problem of image distortion in existing technologies is solved, and the quality of image processing is improved.
Patent Information
- Application Number
- CN202011173511.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-28
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2040-10-28
AI Technical Summary
Existing image processing algorithms typically only process the user's face, leading to image distortion and affecting the quality of image processing.
By identifying the face region and surrounding preset regions in the target image, it detects whether the target object meets the processing conditions, and searches for matching sample images in a preset image library based on feature information. The target object is then processed, and its proportion and positional relationship are adjusted to finally determine the processed target image.
This avoids distortion and deformation of the target area caused by processing the facial area, thus improving the image processing quality.
Smart Images

Figure CN114418865B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of terminals, and particularly relates to an image processing method and device, equipment and a storage medium. BACKGROUND
[0002] With the popularity of terminal devices such as smart phones, more and more users use mobile phones to take pictures. In order to meet the demand for beautiful images, many users will process the captured images. In response to this demand, many beauty applications have emerged. Nowadays, most of the cameras of terminal devices also have a beauty function to process the captured user image during the user's photographing process.
[0003] However, the image processing algorithm in the related art usually only processes the face of the user, resulting in image distortion and affecting the quality of image processing. SUMMARY
[0004] To overcome the problems in the related art, the embodiments of the present disclosure provide an image processing method, device, equipment and storage medium to solve the defects in the related art.
[0005] According to a first aspect of the embodiments of the present disclosure, an image processing method is provided, and the method comprises:
[0006] obtaining a target image to be processed;
[0007] determining a target region in the target image, the target region comprising a face region and a peripheral preset region;
[0008] in response to detecting that a target object in the target region meets a processing condition, processing the target object;
[0009] determining a processed target image based on the processed face region and the processed target object.
[0010] In an embodiment, the target object meets the processing condition, comprising at least one of:
[0011] the position of the target object in the target image meets a set position condition;
[0012] the proportion of the target object in the target image meets a set proportion condition.
[0013] In an embodiment, the target object comprises a hand;
[0014] the processing of the target object comprises:
[0015] determining feature information of the hand;
[0016] find a sample image matching the hand from a preset hand image library based on the feature information;
[0017] process the hand based on the sample image.
[0018] In an embodiment, the feature information comprises a target proportion of the palm and the fingers.
[0019] The finding of the sample image matching the hand from the preset hand image library based on the feature information comprises:
[0020] finding a sample image with a proportion of the palm and the fingers closest to the target proportion from the preset hand image library.
[0021] In an embodiment, the processing of the hand based on the sample image comprises:
[0022] adjusting the target proportion of the palm and the fingers in the hand based on the proportion of the palm and the fingers in the sample image.
[0023] In an embodiment, the processing of the hand based on the sample image comprises:
[0024] obtaining a first image parameter of the face region and a second image parameter of the sample image, the first image parameter and the second image parameter comprising at least one of color and texture;
[0025] processing an image parameter of the hand based on the first image parameter and the second image parameter.
[0026] In an embodiment, the determining of the processed target image based on the processed face region and the processed target object comprises:
[0027] determining a second positional relationship between the processed face region and the processed target object based on a first relationship between the face region and the target object in the target image;
[0028] adjusting a positional relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object based on the second positional relationship, to obtain the processed target image.
[0029] In an embodiment, the method further comprises:
[0030] in response to detecting that there is a blank area between the adjusted first layer and the second layer, filling the blank area with a preset image filling manner.
[0031] According to a second aspect of the embodiments of the present disclosure, an image processing apparatus is provided, which comprises:
[0032] a target image acquisition module configured to acquire a target image to be processed;
[0033] a target region determination module configured to determine a target region in the target image, the target region comprising a face region and a peripheral preset region;
[0034] a target object processing module configured to, in response to detecting that a target object in the target region meets a processing condition, process the target object;
[0035] a processed image determination module configured to determine a processed target image based on the processed face region and the processed target object.
[0036] In an embodiment, the target object meeting the processing condition comprises at least one of the following:
[0037] a position of the target object in the target image meeting a set position condition;
[0038] a proportion of the target object in the target image meeting a set proportion condition.
[0039] In an embodiment, the target region comprises a hand;
[0040] the target object processing module comprises:
[0041] a feature information determination unit configured to determine feature information of the hand;
[0042] a sample image searching unit configured to search, based on the feature information, a preset hand image library for a sample image matching the hand;
[0043] a target object processing unit configured to process the hand based on the sample image.
[0044] In an embodiment, the feature information comprises a target proportion of a palm and fingers;
[0045] the sample image searching unit is further configured to search, in the preset hand image library, for a sample image whose palm and finger proportion is closest to the target proportion.
[0046] In an embodiment, the target object processing unit is further configured to adjust the target proportion of the palm and fingers in the hand based on the palm and finger proportion in the sample image.
[0047] In an embodiment, the target object processing unit is further configured to:
[0048] acquire first image parameters of the face region and second image parameters of the sample image, the first image parameters and the second image parameters comprising at least one of color and texture;
[0049] process image parameters of the hand based on the first image parameters and the second image parameters.
[0050] In an embodiment, the processing image determination module comprises:
[0051] a position relationship determination unit configured to determine a second position relationship between the processed face region and the processed target object based on a first relationship between the face region and the target object in the target image;
[0052] a processing image determination unit configured to adjust a position relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object based on the second position relationship, to obtain a processed target image.
[0053] In an embodiment, the processing image determination module further comprises:
[0054] a blank area filling unit configured to, in response to detecting that there is a blank area between the adjusted first layer and the second layer, fill the blank area using a preset image filling manner.
[0055] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, and the device comprises:
[0056] a processor and a memory for storing processor-executable instructions;
[0057] wherein the processor is configured to:
[0058] acquire a target image to be processed;
[0059] determine a face region in the target image and a target region, the target region comprising the face region and a surrounding preset region;
[0060] in response to detecting that a target object in the target region satisfies a processing condition, process the target object;
[0061] determine a processed target image based on the processed face region and the processed target object.
[0062] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores a computer program, and the program is executed by a processor to implement:
[0063] acquire a target image to be processed;
[0064] determine a face region in the target image and a target region, the target region including the face region and a preset peripheral region;
[0065] perform processing on the target object in response to detecting that the target object in the target region satisfies a processing condition;
[0066] determine a processed target image based on the processed face region and the processed target object.
[0067] Embodiments of the present disclosure provide technical solutions that can include the following beneficial effects:
[0068] The present disclosure can avoid the problem of distortion of the target region caused by processing the face region, avoid image distortion, and thus improve the processing quality of the image.
[0069] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0070] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure.
[0071] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment;
[0072] Figure 2 is a flowchart of how to process the target object according to an exemplary embodiment;
[0073] Figure 3 is a flowchart of how to process the target object based on the sample image according to an exemplary embodiment;
[0074] Figure 4 is a flowchart of how to determine a processed target image based on the processed face region and the processed target object according to an exemplary embodiment;
[0075] Figure 5 is a block diagram of an image processing apparatus according to an exemplary embodiment;
[0076] Figure 6is a block diagram of an image processing apparatus according to yet another exemplary embodiment;
[0077] Figure 7 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0078] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to designate the same elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0079] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment; the method of the present embodiment can be applied to a terminal device (such as a smart phone, a tablet computer, a notebook computer, a wearable device, etc.) having an image processing function.
[0080] As shown in Figure 1 the method comprises the following steps S101-S104:
[0081] In step S101, a target image to be processed is acquired.
[0082] In the present embodiment, after the user collects the target image through the image collection device (such as a camera, etc.) of the terminal device, the terminal device can acquire the target image through its own image processing apparatus.
[0083] The above target image can be a preview image acquired by the terminal device in the process of collecting the user image, or can be a to-be-processed image selected by the user from the electronic album saved in the terminal device, which is not limited in the present embodiment.
[0084] In step S102, a face region and a target region in the target image are determined.
[0085] In the present embodiment, after the target image to be processed is acquired, the terminal device can determine a face region and a target region in the target image, wherein the target region comprises the face region and a peripheral preset region, and the face region can be a region corresponding to the face of the user in the target image.
[0086] For example, after the target image is acquired, face recognition can be performed on the target image to determine the region where the recognized face is located as the face region; and the face region can be determined as the target region as a peripheral preset region (such as a region of a preset size around the face region).
[0087] In step S103, in response to detecting that the target object in the target region satisfies the processing condition, processing is performed on the target object.
[0088] In this embodiment, after the face region in the target image and the target region are determined, it can be detected whether a target object (such as a user's hand, or a chopstick, a knife, a fork, or other tableware) exists in the target region, and then it can be further detected whether the target object satisfies the processing condition when the target object exists. On this basis, when it is determined that the target object satisfies the processing condition, processing is performed on the target object to obtain a processed target object.
[0089] In an embodiment, the target object satisfying the processing condition can include at least one of the following:
[0090] (1) The position of the target object in the target image satisfies a set position condition, such as being in a central region of the image, or being in a preset region in front of the face or on both sides of the chin.
[0091] (2) The proportion of the target object in the target image satisfies a set proportion condition, such as the proportion of the target object in the target image being greater than or equal to a set proportion threshold.
[0092] For example, after the face region in the target image is determined, the face region in the target image can be beautified based on a preset beautification method. The preset beautification method can be set based on actual needs, such as being set to perform face slimming, whitening, acne removal, big eye, and skin smoothing, and the present embodiment does not limit this. On the other hand, after the face region in the target image is determined and the target region is determined based on the face region, it can be detected whether the target object in the target region satisfies the processing condition, and then the target object in the target image is processed when it is determined that the condition is satisfied. Taking a long strip-shaped object such as a chopstick as an example, when it is detected that the target object satisfies the processing condition, for example, the chopstick is in a preset region in front of the face or on both sides of the chin in the target image, and the proportion of the chopstick in the target image is greater than a set proportion threshold (such as 10%), the bent chopstick in the current target image can be processed according to the conventional image of the object (such as a long strip shape) to restore the shape of the processed chopstick to the original shape, that is, to restore it to a long strip shape before the face is beautified.
[0093] In another embodiment, the manner in which the target object is processed can refer to the embodiment shown in the following Figure 2 which will not be described in detail here.
[0094] In step S104, a processed target image is determined based on the processed face region and the processed target object.
[0095] In this embodiment, after the target object in the target region is processed in response to detecting that the target object satisfies the processing condition, the processed target image can be determined based on the processed face region and the processed target object.
[0096] For example, after the target object in the target region is processed, the processed face region and the processed target object can be replaced on the basis of the original target image to obtain the processed target image.
[0097] In another embodiment, the manner in which the target object is processed can refer to the following Figure 2 embodiment, which will not be described in detail here.
[0098] As can be seen from the above description, the method of this embodiment can obtain a target image to be processed, determine a face region and a target region in the target image, process a target object in the target region in response to detecting that the target object satisfies a processing condition, and then determine a processed target image based on the processed face region and the processed target object. This can avoid the problem of distortion of the target region caused by processing the face region, avoid image distortion, and thus improve the processing quality of the image.
[0099] Figure 2 is a flowchart illustrating how the target object is processed according to an example embodiment. This embodiment is illustratively described below with reference to how the target object is processed on the basis of the above-described embodiments. The target object can include a hand. As shown in Figure 2 the above, the processing of the target object in step S103 can include the following steps S201-S203.
[0100] In step S201, feature information of the hand is determined.
[0101] In an embodiment, the feature information can include a target ratio of a palm and fingers.
[0102] In step S202, a sample image matching the hand is searched for in a preset hand image library based on the feature information.
[0103] For example, if the feature information includes a target proportion of the palm and the fingers, such as 25%, the proportion of the palm and the fingers in each sample image in the preset hand image library can be determined, and then a sample image with a proportion closest to the target proportion can be selected. In the preset hand image library, a plurality of sample images meeting aesthetic requirements can be preset, and the embodiment is not limited in this regard.
[0104] In step S203, the hand is processed based on the sample image.
[0105] In the embodiment, after the sample image matching the hand is found in the preset hand image library based on the feature information, the hand can be processed based on the sample image.
[0106] For example, in the case where the feature information includes a target proportion of the palm and the fingers, the target proportion of the palm and the fingers in the hand can be adjusted based on the proportion of the palm and the fingers in the sample image, such as making the target proportion of the palm and the fingers in the target image the same as the proportion of the palm and the fingers in the sample image, and orthodontic treatment, adjustment and beautification can be performed on the shape of the hand to make the hand more beautiful and meet the set aesthetic requirements.
[0107] For another example, Figure 3 is a flowchart illustrating how to process the target object based on the sample image according to an example embodiment. As shown in Figure 3 The step 303 can include steps S301-S302.
[0108] In step S301, a first image parameter of the face region and a second image parameter of the sample image are acquired.
[0109] The first image parameter and the second image parameter include at least one of color and texture. For example, the color in the image parameter can correspond to the skin color of the human body (such as white, black, yellow, or light white, dark, etc.), and the texture in the image parameter can correspond to the skin texture of the human body (such as rough or delicate, etc.).
[0110] In step S302, the image parameter of the hand is processed based on the first image parameter and the second image parameter.
[0111] In the embodiment, after the first image parameter of the face region and the second image parameter of the sample image are acquired, the hand in the current image to be processed can be processed based on the color and / or texture of the face region in the target image and the color and / or texture of the hand in the sample image, so that the hand in the current image to be processed is more beautiful.
[0112] It can be known from the above description that, by determining the feature information of the hand, and searching for a sample image matched with the hand in the preset hand image library based on the feature information, and processing the hand based on the sample image, the sample image matched in the preset hand image library can be acquired based on the feature information of the hand in the target region, and then the hand in the target region can be beautified based on the sample image, the quality of processing the target object in the target region other than the face region in the target image can be improved, and then the processing quality of the image can be improved.
[0113] Figure 4 is a flowchart illustrating how to determine the processed target image based on the processed face region and the processed target object according to an example embodiment; the embodiment is illustratively described based on how to determine the processed target image based on the processed face region and the processed target object on the basis of the above-described embodiment. As shown in Figure 4 The determination of the processed target image based on the processed face region and the processed target object in step S104 can include the following steps S401-S402.
[0114] In step S401, a second positional relationship between the processed face region and the processed target object is determined based on a first relationship between the face region and the target object in the target image.
[0115] In the embodiment, after the target object is processed in response to the detection that the target object in the target region satisfies the processing condition, the first relationship between the face region and the target object in the target image can be determined, and then the second positional relationship between the processed face region and the processed target object can be determined based on the first relationship.
[0116] In step S402, the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object is adjusted based on the second positional relationship.
[0117] In the embodiment, after the first relationship between the face region and the target object in the target image is determined, the second positional relationship between the processed face region and the processed target object can be determined based on the first relationship, and then the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object can be adjusted based on the second positional relationship, so that the positional relationship between the processed target object and the face region remains unchanged.
[0118] In step S403, in response to detecting that there is a blank area between the adjusted first layer and the second layer, the preset image filling manner is used to fill the blank area, to obtain a processed target image.
[0119] In this embodiment, when the position relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object is adjusted based on the second position relationship, it can also be detected whether there is a blank area between the adjusted first layer and the second layer. Furthermore, when it is detected that there is a blank area between the first layer and the second layer, the preset image filling manner is used to fill the blank area, to obtain a processed target image.
[0120] The preset image filling manner can be set based on actual business needs, such as being set to a filling manner based on content recognition in related technologies, which is not limited in this embodiment.
[0121] As can be seen from the above description, in this embodiment, the second position relationship between the processed face region and the processed target object is determined based on the first relationship between the face region and the target object in the target image, and the position relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object is adjusted based on the second position relationship. The position relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object can be accurately determined based on the relationship between the face region and the target region in the target image, the position relationship between the face and the target region in the image is ensured to be unchanged, and by responding to the detection that there is a blank area between the adjusted first layer and the second layer, the preset image filling manner is used to fill the blank area, it can be avoided that a blank area is generated due to image processing, and the processing quality of the image is improved.
[0122] Figure 5 is a block diagram of an image processing device according to an exemplary embodiment; the device of this embodiment can be applied to a terminal device (such as a smart phone, a tablet computer, a notebook computer, or a wearable device, etc.) having an image processing function. As shown in Figure 5 The device includes a target image acquisition module 110, a target region determination module 120, a target object processing module 130, and a processed image determination module 140, wherein:
[0123] The target image acquisition module 110 is configured to acquire a target image to be processed;
[0124] The target region determination module 120 is configured to determine a target region in the target image, where the target region includes a face region and a peripheral preset region.
[0125] The target object processing module 130 is configured to process a target object in the target region in response to detecting that the target object satisfies a processing condition.
[0126] The processed image determination module 140 is configured to determine a processed target image based on the processed face region and the processed target object.
[0127] As can be seen from the above description, the device of the embodiment can acquire a target image to be processed, determine a face region and a target region in the target image, then process a target object in the target region in response to detecting that the target object satisfies a processing condition, and further determine a processed target image based on the processed face region and the processed target object, so as to avoid the problem of distortion of the target region caused by processing the face region, avoid image distortion, and further improve the processing quality of the image.
[0128] Figure 6 is a block diagram of an image processing device according to yet another exemplary embodiment; the device of the embodiment can be applied to a terminal device (such as a smart phone, a tablet computer, a notebook computer, or a wearable device, etc.) having an image processing function. Wherein: the target image acquisition module 210, the target region determination module 220, the target object processing module 230, and the processed image determination module 240 have the same functions as the target image acquisition module 110, the target region determination module 120, the target object processing module 130, and the processed image determination module 140 in the above-mentioned embodiments, and will not be described here. Figure 5 The target image acquisition module 110, the target region determination module 120, the target object processing module 130, and the processed image determination module 140 in the above-mentioned embodiments, and will not be described here.
[0129] In the embodiment, the target object satisfying the processing condition can include at least one of the following:
[0130] The position of the target object in the target image satisfies a set position condition;
[0131] The target region is distorted after processing the face region;
[0132] The proportion of the target object in the target image satisfies a set proportion condition.
[0133] As shown in Figure 6 The target object can include a hand; on this basis, the target object processing module 230 can include:
[0134] The feature information determination unit 231 is configured to determine feature information of the hand.
[0135] The sample image searching unit 232 is configured to search, based on the feature information, a sample image matching the hand from a preset hand image library.
[0136] The target object processing unit 233 is configured to process the hand based on the sample image.
[0137] In an embodiment, the feature information can include a target proportion of the palm and the fingers.
[0138] On this basis, the sample image searching unit 232 can also be configured to search, from the preset hand image library, a sample image whose proportion of the palm and the fingers is most similar to the target proportion.
[0139] In an embodiment, the target object processing unit 233 can also be configured to adjust the target proportion of the palm and the fingers in the hand based on the proportion of the palm and the fingers in the sample image.
[0140] In an embodiment, the target object processing unit 233 can also be configured to:
[0141] obtain a first image parameter of the face region and a second image parameter of the sample image, the first image parameter and the second image parameter including at least one of color and texture;
[0142] process an image parameter of the hand based on the first image parameter and the second image parameter.
[0143] In an embodiment, the processing image determining module 240 can include:
[0144] The position relationship determining unit 241 is configured to determine, based on a first relationship between the face region and the target object in the target image, a second position relationship between the processed face region and the processed target object.
[0145] The processing image determining unit 242 is configured to adjust, based on the second position relationship, a position relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object, to obtain a processed target image.
[0146] In an embodiment, the processing image determining module 240 can also include:
[0147] The blank area filling unit 243 is configured to, in response to detecting that there is a blank area between the adjusted first layer and the second layer, fill the blank area by using a preset image filling manner.
[0148] With reference to the apparatus in the above-described embodiments, specific manner in which various modules perform operations has been described in detail in embodiments relating to the method, and thus will not be described in detail here.
[0149] Figure 7 is a block diagram of an electronic device illustrated according to an exemplary embodiment. For example, the apparatus 900 can be a mobile phone, a computer, a digital broadcasting terminal, a message transmitting / receiving device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like. In the present embodiment, the electronic device can include a normally-on image capturing apparatus for capturing image information.
[0150] Referring to Figure 7 , the apparatus 900 can include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.
[0151] The processing component 902 usually controls overall operations of the apparatus 900, such as operations associated with displaying, making phone calls, data communications, camera operations, and recording operations. The processing component 902 can include one or more processors 920 to execute instructions to complete all or part of steps of the above-described methods. In addition, the processing component 902 can include one or more modules to facilitate interaction between the processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0152] The memory 904 is configured to store various types of data to support operations of the apparatus 900. Examples of these data include instructions for any applications or methods operating on the apparatus 900, contact data, phonebook data, messages, pictures, videos, and so on. The memory 904 can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0153] The power supply component 906 supplies electric power for various components of the apparatus 900. The power supply component 906 can include a power supply management system, one or more power sources, and other components associated with generating, managing and distributing electric power for the apparatus 900.
[0154] The multimedia component 908 includes a screen providing an output interface between the device 900 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensors can not only sense a boundary of a touching or swiping action, but also detect duration and pressure related to the touching or swiping action. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.
[0155] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC) to receive an external audio signal when the device 900 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 904 or transmitted via the communication component 916. In some embodiments, the audio component 910 also includes a speaker to output audio signals.
[0156] The I / O interface 912 provides an interface between the processing component 902 and peripheral interface modules, such as a keypad, a click wheel, buttons, and so on. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0157] The sensor component 914 includes one or more sensors to provide various state assessments for the device 900. For example, the sensor component 914 can detect an open / closed position of the device 900, relative positioning of components, such as a display and a keypad of the device 900, a change in position of the device 900 or a component of the device 900, presence or absence of user contact with the device 900, a change in orientation of the device 900 or acceleration / deceleration of the device 900, and a temperature change of the device 900. The sensor component 914 can also include proximity sensor configured to detect presence of an object in proximity to the device 900, without any physical contact. The sensor component 914 can further include a light sensor (e.g., a CMOS or CCD image sensor) configured to function as an image capture device in a camera application. In some embodiments, the sensor component 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0158] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0159] In an exemplary embodiment, the device 900 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.
[0160] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 904 including instructions, is also provided, which can be executed by the processor 920 of the device 900 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0161] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following, in general, the principles of the present disclosure and including such features to the extent that they are not disclosed in the prior art. The specification and examples given are intended as illustrative only and not restrictive of the true scope and spirit of the present disclosure, which is set forth in the following claims.
[0162] It should be understood that the present disclosure is not limited to the precise structures described and shown in the drawings, and that various modifications and changes can be made to the embodiments without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the claims that follow.
Claims
1. An image processing method, characterized by, The method comprises: acquiring a target image to be processed; determining a target region in the target image, the target region comprising a face region and a surrounding preset region; in response to detecting that a target object in the target region meets a processing condition, processing the target object, the target object comprising a preset object that is distorted due to processing of the face region; determining a processed target image based on the processed face region and the processed target object; the target object comprises a hand; the processing of the target object comprises: determining feature information of the hand, the feature information comprising a target proportion of a palm and fingers; based on the feature information, searching for a sample image matching the hand in a preset hand image library; processing the hand based on the sample image; the determination of the processed target image based on the processed face region and the processed target object comprises: based on a first relationship between the face region and the target object in the target image, determining a second positional relationship between the processed face region and the processed target object; adjusting a positional relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object based on the second positional relationship, to obtain the processed target image.
2. The method of claim 1, wherein, The target object meets the processing condition, comprising at least one of: a position of the target object in the target image meets a set position condition; a proportion of the target object in the target image meets a set proportion condition.
3. The method of claim 1, wherein, The feature information comprises a target proportion of a palm and fingers; the searching for a sample image matching the hand in a preset hand image library based on the feature information comprises: searching for a sample image in the preset hand image library, the sample image having a proportion of a palm and fingers that is closest to the target proportion.
4. The method of claim 3, wherein, The processing of the hand based on the sample image comprises: adjusting a target proportion of a palm and fingers in the hand based on a proportion of a palm and fingers in the sample image.
5. The method of claim 1, wherein, The processing of the hand based on the sample image comprises: acquiring a first image parameter of the face region and a second image parameter of the sample image, the first image parameter and the second image parameter comprising at least one of color and texture; processing an image parameter of the hand based on the first image parameter and the second image parameter.
6. The method of claim 1, wherein, The method further comprises: in response to detecting that there is a blank area between the adjusted first layer and the second layer, filling the blank area using a preset image filling method.
7. An image processing apparatus characterized by comprising: The device comprises: a target image acquisition module, configured to acquire a target image to be processed; a target region determination module, configured to determine a target region in the target image, the target region comprising a face region and a surrounding preset region; a target object processing module, configured to, in response to detecting that a target object in the target region meets a processing condition, process the target object, the target object comprising a preset object that is distorted due to processing of the face region; The processing image determination module is configured to determine a processed target image based on the processed face region and the processed target object; The target object includes a hand; and the target object processing module includes: A feature information determination unit configured to determine feature information of the hand, the feature information including a target proportion of a palm and fingers; A sample image searching unit configured to search for a sample image matching the hand from a preset hand image library based on the feature information; A target object processing unit configured to process the hand based on the sample image; The processing image determination module includes: A position relationship determination unit configured to determine a second position relationship between the processed face region and the processed target object based on a first relationship between the face region and the target object in the target image; The processing image determination unit is configured to adjust a position relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object based on the second position relationship, to obtain a processed target image.
8. The apparatus of claim 7, wherein, The target object satisfies a processing condition, including at least one of: A position of the target object in the target image satisfies a set position condition; A proportion of the target object in the target image satisfies a set proportion condition.
9. The apparatus of claim 7, wherein, The feature information includes a target proportion of a palm and fingers; The sample image searching unit is further configured to search for a sample image with a palm and finger proportion most similar to the target proportion from the preset hand image library.
10. The apparatus of claim 9, wherein, The target object processing unit is further configured to adjust the target proportion of the palm and fingers in the hand based on the palm and finger proportion in the sample image.
11. The apparatus of claim 7, wherein, The target object processing unit is further configured to: Obtain a first image parameter of the face region and a second image parameter of the sample image, the first image parameter and the second image parameter including at least one of color and texture; Process an image parameter of the hand based on the first image parameter and the second image parameter.
12. The apparatus of claim 7, wherein, The processing image determination module further includes: A blank area filling unit configured to, in response to detecting that there is a blank area between the adjusted first layer and the second layer, fill the blank area by using a preset image filling manner.
13. An electronic device, comprising: The device includes: A processor and a memory for storing processor-executable instructions; The processor is configured to: Obtain a target image to be processed; Determine a face region in the target image and a target region, the target region including the face region and a surrounding preset region; In response to detecting that a target object in the target region satisfies a processing condition, process the target object, the target object including a preset object distorted due to processing of the face region; Determine a processed target image based on the processed face region and the processed target object; The target object includes a hand; and the processing of the target object includes: Determining feature information of the hand, the feature information including a target proportion of a palm and fingers; A sample image searching unit configured to search for a sample image matching the hand from a preset hand image library based on the feature information; find a sample image matching the hand from a preset hand image library based on the feature information; process the hand based on the sample image; the determining the processed target image based on the processed face region and the processed target object comprises: determining a second positional relationship between the processed face region and the processed target object based on a first relationship between the face region and the target object in the target image; adjusting a positional relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object based on the second positional relationship to obtain the processed target image.
14. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement: obtaining a target image to be processed; determining a face region and a target region in the target image, the target region including the face region and a surrounding preset region; in response to detecting that a target object in the target region meets a processing condition, processing the target object, the target object including a preset object distorted due to processing of the face region; determining a processed target image based on a processed face region and a processed target object; the target object includes a hand; the processing the target object comprises: determining feature information of the hand, the feature information including a target proportion of a palm and fingers; finding a sample image matching the hand from a preset hand image library based on the feature information; processing the hand based on the sample image; the determining the processed target image based on the processed face region and the processed target object comprises: determining a second positional relationship between the processed face region and the processed target object based on a first relationship between the face region and the target object in the target image; adjusting a positional relationship between a first layer corresponding to the processed face region and a second layer corresponding to the processed target object based on the second positional relationship to obtain the processed target image.
Citation Information
Patent Citations
Image beautifying processing method and device
CN107358573A
Image restoration method and device, electronic equipment and storage medium
CN111553864A