Image processing method and device, equipment and medium

By obtaining the object type of the target object in the image and determining the target area to be processed, and using the image processing model to generate differential target images, the problem of lack of targetedness in the existing photo editing function is solved and the photo editing effect is improved.

CN120013745APending Publication Date: 2025-05-16BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311532535.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing photo editing function lacks targeting when processing the specific body parts of the target object in the image, resulting in poor photo editing.

Method used

By obtaining the object type of the target object in the original image, determining the target area to be processed in the target object, and generating the target image using the corresponding image processing model, so that there is a difference between the target area of ​​the target image and the target area of ​​the original image.

Benefits of technology

Targeted photo editing processing for different target object types is realized, improving the photo editing effect and ensuring the targeted and effective image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013745A_ABST
    Figure CN120013745A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to an image processing method and device, equipment and a medium. The method comprises the steps that a to-be-processed original image is acquired; obtaining an object type to which a target object contained in the original image belongs; determining a to-be-processed target area in the target object based on the object type to which the target object belongs; generating a target image according to the original image and a target area in the original image; wherein a target area in the target image is different from a target area in the original image. According to the embodiment of the invention, the picture retouching effect can be further guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The photo editing function has been widely used in various application scenarios such as image editing software, photo taking software, video live broadcasting platforms, etc. Users can adjust the image according to their needs, such as beautifying the specified body parts of the characters in the image. However, the existing photo editing function still needs to be optimized. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, apparatus, device and medium.

[0004] An embodiment of the present disclosure provides an image processing method, the method comprising: acquiring an original image to be processed; acquiring an object type to which a target object contained in the original image belongs; determining a target area to be processed in the target object based on the object type to which the target object belongs; generating a target image based on the original image and the target area in the original image; wherein the target area in the target image is different from the target area in the original image.

[0005] Optionally, obtaining the object type to which the target object contained in the original image belongs includes: obtaining attribute characteristics of the target object contained in the original image; determining the object type to which the target object belongs based on the attribute characteristics of the target object and a preset first correspondence relationship; wherein the first correspondence relationship is used to indicate the object type to which each of the multiple attribute characteristics corresponds.

[0006] Optionally, obtaining the attribute characteristics of the target object contained in the original image includes: when a target part of the target object contained in the original image is detected, obtaining the target part characteristics of the target object, so as to obtain the attribute characteristics of the target object based on the target part characteristics; when the target part of the target object contained in the original image is not detected, obtaining the body characteristics of the target object, so as to obtain the attribute characteristics of the target object based on the body characteristics.

[0007] Optionally, determining the target area to be processed in the target object based on the object type to which the target object belongs includes: determining the target area to be processed in the target object based on the object type to which the target object belongs and a preset second correspondence relationship; wherein the second correspondence relationship is used to indicate the areas to be processed corresponding to each of multiple object types.

[0008] Optionally, generating a target image based on the original image and the target area in the original image includes: obtaining an image processing model corresponding to an object type to which the target object belongs; obtaining an original mask image corresponding to the target area in the original image; and generating the target image using the image processing model based on the original image and the original mask image corresponding to the target area.

[0009] Optionally, the target image is generated using the image processing model based on the original image and the original mask image corresponding to the target area, including: determining the object area to be cropped in the original image according to the target object in the original image; wherein the object area includes at least a partial area of ​​the target object, and the partial area includes the target area; cropping the original image according to the object area to obtain an object image; cropping the original mask image corresponding to the target area according to the object image to obtain a target mask image corresponding to the target area; wherein the size of the target mask image is consistent with the size of the object image; and generating the target image based on the object image and the target mask image corresponding to the target area using the image processing model.

[0010] Optionally, different object types correspond to different image processing models.

[0011] Optionally, obtaining the original mask image corresponding to the target area in the original image includes: generating a regional mask image based on the target area in the original image; wherein the regional mask image is consistent with the size of the original image, and the target area to be processed identified by the regional mask image is consistent with the target area in the original image; and dilating the target area identified by the regional mask image to obtain the original mask image corresponding to the target area in the original image.

[0012] Optionally, generating the target image using the image processing model based on the original image and the original mask image corresponding to the target area includes: acquiring image processing parameters; wherein the image processing parameters include parameters for indicating the degree of difference between the target area in the target image and the target area in the original image; generating the target image using the image processing model based on the original image, the original mask image corresponding to the target area and the image processing parameters.

[0013] Optionally, the method further includes: performing color migration processing on the target image based on color information of the original image to obtain a target image after color migration processing.

[0014] Optionally, the difference between the target area in the target image and the target area in the original image includes: the difference in edge contours between the target area in the target image and the target area in the original image, and / or the difference in texture lines within the target area in the target image and the target area in the original image.

[0015] The disclosed embodiment also provides an image processing device, comprising: an original image acquisition module, used to acquire an original image to be processed; an object type acquisition module, used to acquire an object type to which a target object contained in the original image belongs; a target area determination module, used to determine a target area to be processed in the target object based on the object type to which the target object belongs; and a target image generation module, used to generate a target image based on the original image and the target area in the original image; wherein the target area in the target image is different from the target area in the original image.

[0016] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the image processing method provided by the embodiment of the present disclosure.

[0017] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the image processing method provided by the embodiment of the present disclosure.

[0018] The above technical solution provided by the embodiment of the present disclosure can determine the target area to be processed according to the object type of the target object in the original image to be processed, and generate a target image based on this, and the target area of ​​the target image is different from the target area of ​​the original image. Compared with the existing photo editing function that does not consider the object type and adopts a unified photo editing method, the above method can specifically determine the target area to be processed that matches the target object, which helps to further ensure the photo editing effect.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0023] Figure 2 A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0024] Figure 3 A comparative schematic diagram provided for an embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;

[0026] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

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

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

[0029] Figure 1 The following is a flow chart of an image processing method provided by an embodiment of the present disclosure. The method can be executed by an image processing device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S108:

[0030] Step S102, obtaining the original image to be processed. Exemplarily, the original image is an image containing a target object, such as a person, an animal, a vehicle, a building, or a specific object, etc. The embodiment of the present disclosure does not limit the target object, and it can be flexibly set according to the needs. In addition, the embodiment of the present disclosure does not limit the method of obtaining the original image, such as an image uploaded by a user, an image selected by a user locally, an image downloaded by a user through the network, or an image transmitted through other devices.

[0031] Step S104: obtaining the object type to which the target object contained in the original image belongs.

[0032] In practical applications, the position of the target object contained in the original image can be determined by using methods such as object detection algorithms, and then the object type to which the target object belongs can be analyzed. In addition, the user can be provided with an object type option, and the object type selected by the user for the target object in the original image can be obtained, which is not limited here.

[0033] Specifically, the object type of the target object can be flexibly divided according to the actual situation. Taking the target object as a person, the object type can be divided based on gender or based on external body shape. Taking the target object as an animal, the object type can be divided based on breed. Taking the target object as a vehicle, the object type can be divided based on vehicle structure (such as cars, motorcycles, etc.) and taking the target object as a building, the object type can be divided based on architectural style (Chinese classical style, European style, etc.).

[0034] Step S106: determining a target area to be processed in the target object based on the object type to which the target object belongs.

[0035] The target area may be, for example, a local area of ​​the target object. For example, if the target object is a person, the target area may be one or more of the person's abdomen, upper body (the area between the neck and the waist, which may also include the neck and / or waist), arms, legs, face, etc. The specific area may be flexibly set according to the needs and is not limited here. In the disclosed embodiment, considering the different types of objects, the different features presented to the outside, and the different focus points, the image retouching requirements for the target area to be processed are different. For example, most of the objects with a burly body have the need to retouch the upper body as a whole, so as to present the effect of well-developed upper body muscles, while most of the objects with a petite body have the need to retouch the abdomen, so as to present a toned abdominal line. In practical applications, the areas to be processed corresponding to different object types can be pre-set according to the actual situation, so that when the object type to which the target object belongs in the image to be processed is obtained, the target area to be processed in the target object can be efficiently determined.

[0036] Step S108, generating a target image according to the original image and the target area in the original image; wherein the target area in the target image is different from the target area in the original image. For example, the target area can be processed on the basis of the original image using an image processing model, and the target area in the target image finally generated is different from the target area in the original image, for example, the target area in the target image has a better or more impactful visual perception than the target area in the original image.

[0037] Exemplarily, the difference between the target area in the target image and the target area in the original image includes: the difference in edge contours between the target area in the target image and the target area in the original image, and / or the difference in texture lines within the target area in the target image and the target area in the original image. Taking the target area as the abdomen as an example, there are differences in the abdomen lines of the characters in the target image and the original image, and / or there are differences in the muscle lines on the abdomen, such as, the abdomen edge contour of the character in the original image has no obvious sense of curve and no obvious muscle lines, while the abdomen edge contour of the character in the target image has a more obvious sense of curve and has more obvious muscle lines.

[0038] In some implementations, the above step S104, that is, obtaining the object type to which the target object contained in the original image belongs, can be performed with reference to the following steps a to b:

[0039] Step a, obtaining the attribute features of the target object contained in the original image. The attribute features of the target object are the features of the specific attributes of the target object. The specific attributes can be used to distinguish the object type to which the target object belongs, such as external gender features, body shape features, animal breed features, building style features, etc. The specific attributes can be flexibly set according to the needs to obtain the corresponding attribute features of the target object. The embodiment of the present disclosure provides a method for obtaining attribute features when the target object is a person or an animal, etc., which can be implemented by referring to the following method:

[0040] When the target part of the target object included in the original image is detected, the target part feature of the target object is obtained to obtain the attribute feature of the target object based on the target part feature. The target part may be a part that can better present the attribute feature of the target object, such as the face of the target object. In practical applications, the target part may be flexibly set according to needs, and is not limited here.

[0041] In the case where the target part of the target object included in the original image is not detected, the body features of the target object are obtained to obtain the attribute features of the target object based on the body features. In the case where the target part is not detected, the body features of the target object as a whole can be obtained, and the attribute features of the target object can also be obtained relatively accurately through the body features presented by the target object as a whole.

[0042] It is understandable that the disclosed embodiments can preferentially obtain the attribute characteristics of the target object based on the target part characteristics. For example, when the target object is a person or an animal, the target part can be the face, and the target part characteristics are facial characteristics. Facial characteristics are typical representatives of the external characteristics of the target object, and can usually present the external conditions of the target object to a large extent. Therefore, the disclosed embodiments can preferentially detect the face of the target object, and can use the facial characteristics as the attribute characteristics of the target object. Considering that the face of the target object may not be detected in many cases, such as the target image only showing the abdomen of a person and other body parts, the body characteristics of the target object are then obtained, and the body characteristics are used as the attribute characteristics of the target object. In the above manner, the attribute characteristics of the target object can be obtained more efficiently and reliably.

[0043] Step b, based on the attribute characteristics of the target object and a preset first correspondence, determine the object type to which the target object belongs; wherein the first correspondence is used to indicate the object type to which each of the multiple attribute characteristics corresponds. In practical applications, a statistical method can be used to determine the attribute characteristics corresponding to each object type, and a first correspondence can be established. For example, a large number of pictures containing target objects of different object types can be collected, and the first correspondence between the attribute characteristics and the object type can be established by counting the attribute characteristics corresponding to each of the different object types. In the embodiment of the present disclosure, the first correspondence is preset, so when acquiring the attribute characteristics of the target object, the object type to which the target object belongs can be efficiently and reliably determined based on the first correspondence, further shortening the image processing time.

[0044] In some embodiments, the above step S106, that is, determining the target area to be processed in the target object based on the object type to which the target object belongs, can be specifically implemented based on the object type to which the target object belongs and the preset second correspondence relationship to determine the target area to be processed in the target object; wherein the second correspondence relationship is used to indicate the areas to be processed corresponding to the various object types. In practical applications, the corresponding areas to be processed can be pre-set according to the object type, thereby constructing the second correspondence relationship. Specifically, the areas to be processed corresponding to the different object types can also be determined by statistical means, such as by conducting online or offline surveys, or by obtaining historical image processing records, etc. to count the areas to be processed corresponding to various object types with a higher proportion of image retouching requirements, thereby establishing a second correspondence relationship between the object type and the area to be processed, such as most users with a burly figure or most men have the need to retouch the entire upper body, and most users with a petite figure or most women have the need to retouch the abdomen. By establishing the second corresponding relationship as described above, the target area to be processed in the target object can be quickly and accurately determined based on the object type to which the target object belongs, so that subsequent image processing can be carried out in a targeted manner based on the target area and the image retouching needs can be met with a higher probability.

[0045] In some implementations, the above step S108, that is, generating the target image according to the original image and the target area in the original image, can be performed with reference to the following steps A to C:

[0046] Step A: Obtain an image processing model corresponding to the object type to which the target object belongs. The image processing model is a neural network model. The embodiment of the present disclosure does not limit the structure of the image processing model. Specifically, the image processing model may be a generative model.

[0047] In order to facilitate model processing and better guarantee the image processing effect, in some specific implementation examples, the image processing models corresponding to different object types are different. Specifically, at least one of the model structure, model parameters and training samples of the image processing models corresponding to different object types is different. Exemplarily, the training samples of the image processing models corresponding to different object types are different, such as, the training samples of the image processing models are original images of target objects containing corresponding object types and / or images that meet the requirements, and corresponding prompt information can be set for the training samples, such as using prompts marked with special symbols to guide the model to learn the required sample features. In this way, it is distinguished that the image processing model can better learn the characteristics of the target objects of the corresponding object types and the corresponding processing methods, so that it is able to output image processing results that meet the requirements.

[0048] Step B, obtaining an original mask image corresponding to the target area in the original image. In some specific implementation examples, step B can be performed with reference to the following steps B1 to B2:

[0049] Step B1, generating a regional mask map according to the target region in the original image; specifically, the target region of the original image can be segmented to obtain the regional mask map based on the segmentation result. The regional mask map has the same size as the original image, and the target region to be processed identified by the regional mask map is consistent with the target region in the original image. In the regional mask map, the pixel values ​​of the target region are all the first value (such as 255), and the pixel values ​​of the non-target region are all the second value (such as 0), so that the target region can be clearly and unambiguously identified.

[0050] Step B2, dilate the target area marked by the regional mask image to obtain the original mask image corresponding to the target area in the original image. In practical applications, the dilation algorithm can be used to process the target area. By appropriately expanding the target area to be processed, it is helpful to improve the subsequent image processing effect and make the final image more natural and realistic.

[0051] Step C, based on the original image and the original mask image corresponding to the target area, the target image is generated using the image processing model. The original mask image corresponding to the target area can be used to enable the image processing model to clearly know the target area to be processed in the original image, so that on the basis of the original image, the target area is beautified and repaired, and finally the target image is obtained.

[0052] In order to further enable the image processing model to better generate the desired target image, in some specific implementation examples, step C can be performed with reference to the following steps C1 to C4:

[0053] Step C1, according to the target object in the original image, determine the object area to be cropped in the original image; wherein the object area includes at least a partial area of ​​the target object, and the partial area includes the target area. For example, taking the target object as a person as an example, the object area can be the whole body of the person, or only the upper body of the person, but at least needs to include the target area to be processed.

[0054] Step C2, cropping the original image according to the object area to obtain the object image. It is understandable that the embodiment of the present disclosure fully considers that the original image may still contain a large number of background areas, and the proportion of the target object in the original image may not be high. In order to make it easier for the image processing model to process the target area, the embodiment of the present disclosure can perform a cropping operation on the original image in advance. The proportion of the target area in the object image is usually large, and irrelevant background is also reduced in the object image, which is more convenient for model processing. In practical applications, the cropping size can be flexibly set according to needs.

[0055] Step C3, cropping the original mask image corresponding to the target area according to the object image to obtain a target mask image corresponding to the target area; wherein the size of the target mask image is consistent with the size of the object image. It is understandable that after the original image is cropped, the original mask image also needs to be cropped accordingly, so that the cropped target mask image matches the object image. Specifically, the position of the target area in the target mask image corresponds to the target area to be processed in the object image.

[0056] Step C4, based on the target mask map corresponding to the object image and the target area, the target image is generated using the image processing model. Exemplarily, the pixel value of the target area to be processed in the target mask map is 255 (white), and the pixel value of the non-target area is 0 (black). The image processing model can perform fusion processing based on the target mask map and the object image, and can accurately obtain the target area to be processed in the object image, that is, the target mask map can be used to assist the image processing model in locating the target area to be processed. The image processing model can beautify the target area in the object image (such as modifying the outline, adding line texture, etc.), and output the beautified image. Since the object image is part of the original image, the image beautified by the image processing model can also be pasted back to the corresponding area in the original image, so as to obtain the final target image, and the final target image is consistent with the size of the original image.

[0057] In practical applications, the object image and the target mask map can be directly input into the image processing model, or the edge pixels of the object image and the target mask map can be filled, so that the object image and the target mask map are completed to a square size, which is more convenient for the image processing model to process. It should be noted that if the above-mentioned filling process is performed in advance, the edge of the output image of the image processing model should also be cropped to crop the original filled edge area, so as to ensure that the beautified image output by the image processing model is consistent with the size of the object image.

[0058] Through the above method, the image processing model can better process based on the object image and the target mask map corresponding to the target area, and can also avoid the interference of irrelevant background as much as possible, so as to obtain a target image with better effect.

[0059] In some specific implementation examples, step C may also be performed with reference to the following steps 1 and 2:

[0060] Step 1, obtaining image processing parameters; wherein the image processing parameters include parameters for indicating the degree of difference between the target area in the target image and the target area in the original image, which may also be referred to as intensity parameters, and may characterize different image processing intensities. Taking the processing of the abdomen of a person as an example, the intensity parameter is used to indicate the strength of the muscle lines added to the abdomen of the person, or the degree of curve of the outline of the abdomen of the person. In addition, the image processing parameters may also include parameters such as CFG (Classifier Free Guidance) to adjust the degree of guidance of the diffusion process of the model by the text prompt. In actual applications, the image processing parameters may be default values, or the user may be provided with setting options for the image processing parameters, and the image processing parameters set by the user may be obtained.

[0061] Step 2: Generate a target image using an image processing model based on the original image, the original mask image corresponding to the target area, and the image processing parameters. In this way, a target image with a desired effect of image editing can be output.

[0062] In practical applications, steps 1 to 2 and steps C1 to C4 may also be combined for application.

[0063] In order to further ensure the image processing effect, the disclosed embodiment can also perform color migration processing on the target image based on the color information of the original image to obtain the target image after color migration processing. Specifically, color migration can be mainly performed on the processed target area in the target image. It is understandable that the color of the target image generated by the image processing model may be different from the color of the original image, so the target image can be post-processed and color migration can be used to further improve the realism of the processed target image.

[0064] For ease of understanding, the present disclosure further provides Figure 2 The flowchart of an image processing method shown mainly includes the following steps S202 to S210:

[0065] Step S202, obtaining the original image to be processed.

[0066] Step S204, obtaining the object type to which the target object contained in the original image belongs. When the object type is the first type, step S206a is executed, and when the object type is the second type, step S206b is executed.

[0067] Step S206a, determining that the target area to be processed in the target object is the abdomen area, and determining that the image processing model corresponding to the original image is the first image processing model;

[0068] Step S206b, determining that the target area to be processed in the target object is the upper body area, and determining that the image processing model corresponding to the original image is the second image processing model;

[0069] Step S208, obtaining an original mask image corresponding to the target area in the original image, and obtaining image processing parameters.

[0070] Step S210, based on the original image and the original mask image corresponding to the target area, and the image processing parameters, the target image is generated using the image processing model corresponding to the original image. Figure 3 A comparative schematic diagram is shown, which illustrates the original image, target image 1 and target image 2. The image processing parameters corresponding to target image 1 and target image 2 are different. Specifically, the parameters used to indicate the strength of the effect are different. The effect of target image 2 is stronger than that of target image 1. For example, target image 1 and target image 2 generated by the image processing model both highlight the muscle lines of the upper body, and the muscle lines in target image 2 are more obvious than those in target image 1. It should be noted that Figure 3 It is just for simple illustration and mosaic processing is performed in some local areas, such as Figure 3 As shown, in actual applications, the original image and the target image usually also include a background, and also include other body parts of the target object, which are not limited here.

[0071] In related technologies, a unified image retouching method is usually adopted without considering the object type, and for areas such as the abdomen and upper body, deformation and other methods are usually relied on, resulting in distorted and unrealistic images, and non-target areas (such as the background) will also be deformed accordingly, resulting in poor image processing effects. In contrast, the disclosed embodiment can specifically determine the target area to be processed that matches the target object, obtain the corresponding mask map, and use the corresponding image processing model for processing. The final image can better meet user needs and effectively ensure the image retouching effect.

[0072] Figure 4 The structure diagram of an image processing device provided by an embodiment of the present disclosure is shown in FIG. 1 , which can be implemented by software and / or hardware, and can generally be integrated in an electronic device, and can execute an image processing method. Figure 4 As shown, the image processing device includes:

[0073] The original image acquisition module 402 is used to acquire the original image to be processed;

[0074] The object type acquisition module 404 is used to acquire the object type to which the target object contained in the original image belongs;

[0075] A target region determination module 406 is used to determine a target region to be processed in the target object based on the object type to which the target object belongs;

[0076] The target image generation module 408 is used to generate a target image according to the original image and the target area in the original image; wherein the target area in the target image is different from the target area in the original image.

[0077] Compared with the existing photo editing function that does not consider the object type and adopts a unified photo editing method, the above-mentioned device can specifically determine the target area to be processed that matches the target object, which helps to further ensure the photo editing effect.

[0078] In some embodiments, the object type acquisition module 404 is specifically used to: obtain the attribute characteristics of the target object contained in the original image; determine the object type to which the target object belongs based on the attribute characteristics of the target object and a preset first correspondence relationship; wherein the first correspondence relationship is used to indicate the object type corresponding to each of the multiple attribute characteristics.

[0079] In some embodiments, the object type acquisition module 404 is specifically used to: when the target part of the target object contained in the original image is detected, acquire the target part features of the target object to obtain the attribute features of the target object based on the target part features; when the target part of the target object contained in the original image is not detected, acquire the body features of the target object to obtain the attribute features of the target object based on the body features.

[0080] In some embodiments, the target area determination module 406 is specifically used to: determine the target area to be processed in the target object based on the object type to which the target object belongs and a preset second correspondence relationship; wherein the second correspondence relationship is used to indicate the areas to be processed corresponding to each of multiple object types.

[0081] In some embodiments, the target image generation module 408 is specifically used to: obtain an image processing model corresponding to the object type to which the target object belongs; obtain an original mask image corresponding to the target area in the original image; and generate a target image using the image processing model based on the original image and the original mask image corresponding to the target area.

[0082] In some embodiments, the target image generation module 408 is specifically used to: determine the object area to be cropped in the original image according to the target object in the original image; wherein the object area includes at least a partial area of ​​the target object, and the partial area includes the target area; crop the original image according to the object area to obtain an object image; crop the original mask image corresponding to the target area according to the object image to obtain a target mask image corresponding to the target area; wherein the size of the target mask image is consistent with the size of the object image; based on the object image and the target mask image corresponding to the target area, generate the target image using the image processing model.

[0083] In some implementations, different object types correspond to different image processing models.

[0084] In some embodiments, the target image generation module 408 is specifically used to: generate a regional mask map based on the target area in the original image; wherein the regional mask map is consistent with the size of the original image, and the target area to be processed identified by the regional mask map is consistent with the target area in the original image; and perform expansion processing on the target area identified by the regional mask map to obtain the original mask map corresponding to the target area in the original image.

[0085] In some embodiments, the target image generation module 408 is specifically used to: obtain image processing parameters; wherein the image processing parameters include parameters for indicating the degree of difference between the target area in the target image and the target area in the original image; based on the original image, the original mask image corresponding to the target area and the image processing parameters, generate the target image using the image processing model.

[0086] In some embodiments, the device further includes a color migration module, which is used to perform color migration processing on the target image based on the color information of the original image to obtain the target image after the color migration processing.

[0087] In some embodiments, the difference between the target area in the target image and the target area in the original image includes: the difference in edge contours between the target area in the target image and the target area in the original image, and / or the difference in texture lines within the target area in the target image and the target area in the original image.

[0088] The image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.

[0090] An embodiment of the present disclosure provides an electronic device, which includes: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any method in the present disclosure.

[0091] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0092] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

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

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

[0095] In addition to the above-mentioned methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the image processing method provided by the embodiments of the present disclosure. The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present disclosure, the programming languages ​​including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0096] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the image processing method provided by the embodiment of the present disclosure.

[0097] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0098] The embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the image processing method in the embodiment of the present disclosure when the computer program / instruction is executed by a processor.

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

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

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

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

[0103] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

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

Claims

1. An image processing method, characterized in that: include: Obtain the original image to be processed; Acquire the object type to which the target object contained in the original image belongs; Based on the object type to which the target object belongs, determining a target area to be processed in the target object; A target image is generated according to the original image and the target area in the original image; wherein the target area in the target image is different from the target area in the original image.

2. The method according to claim 1, characterized in that The obtaining the object type to which the target object contained in the original image belongs includes: Acquire attribute features of the target object contained in the original image; Based on the attribute characteristics of the target object and a preset first corresponding relationship, the object type to which the target object belongs is determined; wherein the first corresponding relationship is used to indicate the object type corresponding to each of the multiple attribute characteristics.

3. The method according to claim 2, characterized in that The acquiring the attribute features of the target object contained in the original image includes: In the case where a target part of the target object contained in the original image is detected, a target part feature of the target object is acquired to obtain an attribute feature of the target object based on the target part feature; In a case where the target part of the target object included in the original image is not detected, a body feature of the target object is acquired to obtain an attribute feature of the target object based on the body feature.

4. The method according to claim 1, characterized in that: The determining, based on the object type to which the target object belongs, a target area to be processed in the target object includes: Based on the object type to which the target object belongs and a preset second corresponding relationship, a target area to be processed in the target object is determined; wherein the second corresponding relationship is used to indicate the areas to be processed corresponding to each of multiple object types.

5. The method according to claim 1, characterized in that The step of generating a target image according to the original image and the target area in the original image comprises: Obtain an image processing model corresponding to the object type to which the target object belongs; Obtaining an original mask image corresponding to the target area in the original image; Based on the original image and the original mask image corresponding to the target area, the target image is generated using the image processing model.

6. The method according to claim 5, characterized in that The step of generating a target image by using the image processing model based on the original image and the original mask image corresponding to the target area includes: Determine an object region to be cropped in the original image according to the target object in the original image; wherein the object region includes at least a partial region of the target object, and the partial region includes the target region; Cropping the original image according to the object area to obtain an object image; According to the object image, the original mask image corresponding to the target area is cropped to obtain a target mask image corresponding to the target area; wherein the size of the target mask image is consistent with the size of the object image; Based on the object image and the target mask image corresponding to the target area, the target image is generated using the image processing model.

7. The method according to claim 5, characterized in that Different object types correspond to different image processing models.

8. The method according to claim 5, characterized in that The obtaining of an original mask image corresponding to the target area in the original image includes: Generate a regional mask image according to the target area in the original image; wherein the regional mask image has the same size as the original image, and the target area to be processed identified by the regional mask image is consistent with the target area in the original image; The target region identified by the regional mask image is expanded to obtain an original mask image corresponding to the target region in the original image.

9. The method according to claim 5, characterized in that The step of generating a target image by using the image processing model based on the original image and the original mask image corresponding to the target area includes: Acquiring image processing parameters; wherein the image processing parameters include parameters for indicating the degree of difference between the target area in the target image and the target area in the original image; Based on the original image, the original mask image corresponding to the target area and the image processing parameters, the target image is generated using the image processing model.

10. The method according to claim 1, characterized in that The method further comprises: Based on the color information of the original image, the target image is subjected to color migration processing to obtain a target image after color migration processing.

11. The method according to any one of claims 1 to 10, characterized in that: The difference between the target area in the target image and the target area in the original image includes: the difference in edge contours between the target area in the target image and the target area in the original image, and / or the difference in texture lines within the target area in the target image and the target area in the original image.

12. An image processing device, characterized in that: include: An original image acquisition module, used to acquire the original image to be processed; An object type acquisition module, used to acquire the object type to which the target object contained in the original image belongs; A target region determination module, configured to determine a target region to be processed in the target object based on the object type to which the target object belongs; The target image generation module is used to generate a target image according to the original image and the target area in the original image; wherein the target area in the target image is different from the target area in the original image.

13. An electronic device, characterized in that: The electronic device comprises: a storage device having a computer program stored thereon; A processing device, used to execute the computer program in the storage device to implement the steps of the image processing method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the image processing method described in any one of claims 1 to 11.

15. A computer program product, characterized in that The invention comprises a computer program, which implements the image processing method according to any one of claims 1 to 11 when being executed by a processor.