Color rendering method, device, equipment and medium for target area

By segmenting the target face image and determining the texture image, and combining preset rendering feature values, color rendering of the target area is solved, which solves the problem that the target area texture information cannot be effectively reflected in the existing technology, and achieves a rendering effect that is closer to reality.

CN112419470BActive Publication Date: 2025-03-14BEIJING INKE CHEESE NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011479463.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-15
Publication Date
2025-03-14
Estimated Expiration
2040-12-15

AI Technical Summary

Technical Problem

When rendering the target area such as lips, the prior art cannot effectively reflect the texture information of the target area, resulting in poor rendering effect.

Method used

By obtaining the original image of the target area from the target face image, the image segmentation process is performed to obtain the segmented image, the texture image of the target area is determined, and the target area is rendered color based on the segmented image, texture image and preset rendering feature values.

Benefits of technology

Combining the texture characteristics of the target area, the color rendering results are closer to reality, thereby enhancing the user's visual perception.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112419470B_ABST
    Figure CN112419470B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for color rendering of a target area. The method comprises: obtaining an original image of a target area from a target face image; performing image segmentation processing on the original image of the target area to obtain a segmented image; determining a texture image of the original image of the target area; and color rendering the target area according to the segmented image, the texture image of the original image and a preset rendering feature value. The embodiment of the present invention can combine the texture features of the target area to make the color rendering result of the target area closer to reality, so as to enhance the visual perception of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to a method, device, equipment and medium for color rendering of a target area. Background Art

[0002] At present, beauty and makeup have become one of the most commonly used functions for users on major live broadcast platforms. Lipstick has a great influence on the overall effect and can provide users with a good visual experience. In the prior art, the use of lipstick to color the lips is mainly to directly overlay the coloring on the image of the lips itself to obtain the coloring effect of lipstick; for example, the brightened mixed layer is overlaid with the colored lip layer through a preset algorithm, and finally the effect image after lipstick rendering is obtained.

[0003] The drawback of the above solution is that the above solution performs overall color superposition on the image and cannot reflect the unique texture information of the target area, resulting in poor rendering effect. Summary of the invention

[0004] The embodiments of the present application provide a method, device, equipment and medium for color rendering of a target area, which can combine the texture features of the target area to make the color rendering result of the target area closer to reality, so as to enhance the user's visual perception.

[0005] In a first aspect, an embodiment of the present invention provides a color rendering method for a target area, comprising:

[0006] Acquire an original image of a target area from a target face image; and perform image segmentation processing on the original image of the target area to obtain a segmented image;

[0007] Determining a texture image of the original image of the target area;

[0008] The target area is rendered in color according to the segmented image, the texture image of the original image and a preset rendering feature value.

[0009] Optionally, an original image of the target area is obtained from the target face image, including:

[0010] Inputting the target face image into the face detection model to obtain the key points of the target face image;

[0011] The original image of the target area is determined according to the key points of the target face image.

[0012] Optionally, determining the original image of the target area according to the key points of the target face image includes:

[0013] Determining key points of a target area from key points of the target face image;

[0014] The region image where the key points of the target region in the target face image are located is used as the original image of the target region.

[0015] Optionally, determining the texture image of the original image of the target area includes:

[0016] Performing a preset filter process on the original image of the target area to obtain a filtered image, and determining the color feature value of each pixel point of the filtered image;

[0017] The texture image of the target area is obtained according to the difference between the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter.

[0018] Optionally, the process of determining the basic color feature value of each pixel of the preset filter includes:

[0019] Select at least two training sample images of the target area from the candidate face image;

[0020] Performing preset filter processing on the at least two training sample images to obtain filter images of the at least two training sample images;

[0021] The basic color feature value of each pixel point of the preset filter is determined according to the filter images of the at least two training sample images.

[0022] Optionally, determining the basic color feature value of each pixel point of the preset filter according to the filter images of the at least two training sample images includes:

[0023] Obtaining color feature values ​​of the filter images of the at least two training sample images;

[0024] The color feature mean of the filter images of the at least two training sample images is used as the basic color feature value of each pixel point of the preset filter.

[0025] Optionally, color rendering is performed on the target area according to the segmented image, the texture image of the original image and a preset rendering feature value, including:

[0026] Performing color rendering on the texture image of the original image according to a preset rendering feature value to obtain an initial rendered image;

[0027] Based on the segmented image, the initial rendered image is cropped to obtain a cropped image; and the cropped image is replaced with the original image of the target area to obtain a target rendered image of the target area.

[0028] In a second aspect, an embodiment of the present invention provides a color rendering device for a target area, comprising:

[0029] The segmented image determination module is used to obtain the original image of the target area from the target face image; and perform image segmentation processing on the original image of the target area to obtain a segmented image;

[0030] A texture image determination module, used to determine the texture image of the original image of the target area;

[0031] The color rendering module is used to perform color rendering on the target area according to the segmented image, the texture image of the original image and the preset rendering feature value.

[0032] Optionally, the segmented image determination module includes:

[0033] A key point determination unit, used for inputting a target face image into a face detection model to obtain key points of the target face image;

[0034] The image determination unit is used to determine the original image of the target area according to the key points of the target face image.

[0035] Optionally, the image determination unit is specifically configured to:

[0036] Determining key points of a target area from key points of the target face image;

[0037] The region image where the key points of the target region in the target face image are located is used as the original image of the target region.

[0038] Optionally, the texture image determination module is specifically used for:

[0039] Performing a preset filter process on the original image of the target area to obtain a filtered image, and determining the color feature value of each pixel point of the filtered image;

[0040] The texture image of the target area is obtained according to the difference between the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter.

[0041] Optionally, a color feature value determination module is also included, and the color feature value determination module includes:

[0042] A training sample image determination unit, used for selecting at least two training sample images of a target area from the candidate face image;

[0043] A filter image determination unit, configured to perform preset filter processing on the at least two training sample images to obtain filter images of the at least two training sample images;

[0044] The feature value determining unit is used to determine the basic color feature value of each pixel point of the preset filter according to the filter images of the at least two training sample images.

[0045] Optionally, the characteristic value determination unit is specifically used to:

[0046] Obtaining color feature values ​​of the filter images of the at least two training sample images;

[0047] The color feature mean of the filter images of the at least two training sample images is used as the basic color feature value of each pixel point of the preset filter.

[0048] Optional, color rendering module, specifically used for:

[0049] Performing color rendering on the texture image of the original image according to a preset rendering feature value to obtain an initial rendered image;

[0050] Based on the segmented image, the initial rendered image is cropped to obtain a cropped image; and the cropped image is replaced with the original image of the target area to obtain a target rendered image of the target area.

[0051] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0052] one or more processors;

[0053] a storage device for storing one or more programs,

[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the color rendering methods for the target area in the embodiments of the present invention.

[0055] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one of the color rendering methods for a target area in the embodiments of the present invention.

[0056] The embodiment of the present invention obtains the original image of the target area from the target face image; performs image segmentation processing on the original image of the target area to obtain a segmented image; determines the texture image of the original image of the target area; and performs color rendering on the target area according to the segmented image, the texture image of the original image and a preset rendering feature value. The embodiment of the present invention can combine the texture features of the target area to make the color rendering result of the target area closer to reality, thereby enhancing the visual perception of the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1is a flow chart of a method for color rendering of a target area in Embodiment 1 of the present invention;

[0058] Figure 2 is a flow chart of a color rendering method for a target area in Embodiment 2 of the present invention;

[0059] Figure 3 is a schematic diagram showing a target face image in the second embodiment of the present invention;

[0060] Figure 4 is a schematic diagram of key points of a target face image in Embodiment 2 of the present invention;

[0061] Figure 5 is a schematic diagram of positioning the original image of the target area in the second embodiment of the present invention;

[0062] FIG6( a ) is a schematic diagram of a texture image of a target area in Embodiment 2 of the present invention;

[0063] FIG6( b ) is a schematic diagram showing a segmented image in Embodiment 2 of the present invention;

[0064] FIG6( c ) is a schematic diagram showing an initial rendered image in Embodiment 2 of the present invention;

[0065] Figure 7 It is a schematic diagram showing a target rendered image of a target area in the second embodiment of the present invention.

[0066] Figure 8 is a schematic structural diagram of a color rendering device for a target area in a third embodiment of the present invention;

[0067] Fig. 9 It is a schematic diagram of the structure of the electronic device in the fourth embodiment. DETAILED DESCRIPTION

[0068] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0069] Embodiment 1

[0070] Figure 1 : is a flowchart of the color rendering method of the target area in the first embodiment of the present invention. This embodiment can be applied to the case where color rendering is achieved in combination with the texture characteristics of the target area. The method of this embodiment can be executed by a color rendering device for the target area, which can be implemented in hardware / software and can be configured in an electronic device. The color rendering method of the target area described in any embodiment of the present application can be implemented. Figure 1 As shown, the method specifically includes the following:

[0071] S110, acquiring an original image of a target area from the target face image; and performing image segmentation processing on the original image of the target area to obtain a segmented image.

[0072] In this embodiment, the target facial image is a facial image that requires color rendering of local areas; the target area image is the local area in the target facial image that requires color rendering, such as eyebrows, lips or cheeks; the applicable scenarios of this embodiment are color rendering of the target area of ​​the image in the video or color rendering of the target area in the photo, such as the rendering of different lipstick shades of lip color in the beauty live broadcast platform, and the rendering of different lipstick shades of lip color in the photo.

[0073] Among them, the original image of the target area is subjected to image segmentation processing to obtain a segmented image, including: inputting the original image into a preset segmentation model, and using the output result of the preset segmentation model as the segmented image; specifically, the preset segmentation model is trained by the original image samples of the pre-selected target area.

[0074] S120: Determine a texture image of the original image of the target area.

[0075] In this embodiment, the texture image can effectively reflect the color gradient characteristics in an image; the prior art mainly uses the superposition of a preset layer and the regional image where the local area is located to achieve color rendering when rendering the color of a local area. This method ignores the texture characteristics of different areas during implementation, resulting in a large deviation between the rendering result and the actual result; this embodiment can intuitively and clearly see the texture characteristics of the part to be rendered by determining the texture image of the original image of the target area.

[0076] S130 , performing color rendering on the target area according to the segmented image, the texture image of the original image and the preset rendering feature value.

[0077] In this embodiment, the preset rendering feature value is a representation value of the color to be rendered, for example, it can be the RGB value of the marking color; wherein, the preset rendering feature value can be found from the feature comparison table according to the color to be rendered (for example, lipstick color); the feature comparison table stores the association between the rendering color and RGB.

[0078] The segmented image can extract the overall outline of the target area from the original image, and the texture image of the original image can display the texture information of the original image. The texture image of the original image, the segmented image and the preset rendering feature values ​​can effectively realize the color rendering of specific parts in the target area, thereby improving the color rendering accuracy of the target area.

[0079] The embodiment of the present invention obtains the original image of the target area from the target face image; performs image segmentation processing on the original image of the target area to obtain a segmented image; determines the texture image of the original image of the target area; and performs color rendering on the target area according to the segmented image, the texture image of the original image and a preset rendering feature value. The embodiment of the present invention can combine the texture features of the target area to make the color rendering result of the target area closer to reality, so as to enhance the visual perception of the user.

[0080] Embodiment 2

[0081] Figure 2 is a flow chart of the color rendering method of the target area in the second embodiment of the present invention. This embodiment is further expanded and optimized on the basis of the above embodiment, and can be combined with any optional solution in the above technical solution. Figure 2 As shown, the method includes:

[0082] S210, acquiring an original image of a target area from a target face image; and performing image segmentation processing on the original image of the target area to obtain a segmented image.

[0083] In this embodiment, optionally, obtaining an original image of a target area from a target face image includes:

[0084] Input the target face image into the face detection model to obtain the key points of the target face image;

[0085] According to the key points of the target face image, the original image of the target area is determined.

[0086] Among them, the face detection model is trained by using face images containing key points as training samples; specifically, the training process of the face detection model may include: selecting face images containing key points as training samples, and dividing the training samples into a test set and a verification set; using the test set to train the face detection model, and using the verification set to verify the face detection model, if the verification passes, the face detection model is determined.

[0087] Since each local part in a face image has its specific boundary contour, determining the original image of the target area according to the key points of the target face image may include: forming an enclosing area according to each key point in the target face image; wherein the enclosing areas are each local part in the target face image; and matching the enclosing area with the preset target area enclosing area to obtain the original image of the target area. This embodiment can accurately and effectively determine the original image of the target area through the key points in the target face image.

[0088] In this embodiment, optionally, determining the original image of the target area according to the key points of the target face image includes:

[0089] Determine the key points of the target area from the key points of the target face image;

[0090] The area image where the key points of the target area in the target face image are located is used as the original image of the target area.

[0091] Among them, according to the different contour features of each part in the target face image, the key points of the target area are identified from the key points of the face image, and the area is cropped to obtain the original image of the target area, so as to accurately determine the original image of the target area.

[0092] For example, a face image is used as an example for explanation; Figure 3 Schematic diagram of the selected target face image experimental sample; after the target face image is input into the face detection model, the key points of the target face image are obtained. Figure 4 , Figure 4 is a schematic diagram of the key points of the target face image; after locating the region of interest, the original image of the target area can be found in Figure 5 , Figure 5 Schematic diagram of the positioning of the original image of the target area.

[0093] S220 , performing a preset filter process on the original image of the target area to obtain a filtered image, and determining a color feature value of each pixel of the filtered image.

[0094] In this embodiment, a preset filter processing of the original image of the target area is implemented through LUT (Look-up Table); specifically, the RGB value of the original image of the target area is input, the feature block in the LUT is determined through the B channel, the R channel determines the offset in the x direction, and the G channel determines the offset in the y direction, thereby determining the position on the LUT map, and the RGB value corresponding to the position is the value after the filter.

[0095] The preset filter can generally be a preset nonlinear equation as a correspondence model and a preset LUT map. Considering that finding a suitable correspondence model is highly dependent on experience and intuition, if a suitable model cannot be found, the effect map will deviate from the preset effect. Therefore, in this embodiment, a preset LUT map is selected as the filter, which can be achieved through a table lookup method.

[0096] The table lookup method can be seen as a discrete form of a nonlinear function; in terms of function form, the preset filter is a compression interval plus a larger deviation value, so that the difference in RGB values ​​with large differences becomes smaller after conversion, while retaining the texture and reducing the impact of different skin colors, different light, etc.

[0097] S230 , obtaining a texture image of the target area according to the difference between the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter.

[0098] In this embodiment, since the preset filter reduces the influence of different skin colors and different light, even if the color difference of each point in the target area increases, the difference between the colors after passing through the preset filter will be reduced and will be close to the mean.

[0099] The basic color feature value of each pixel of the preset filter refers to the average value of the lip area after a large amount of data is filtered; wherein, FIG6(a) is a schematic diagram of the texture image of the target area; at this time, the image after the preset filter minus the average value of the preset filter will make the lip lines in the target area darker than the lips have a negative value around zero, and the highlight area lighter than the lips has a positive value. This embodiment can effectively characterize the texture image of the target area based on the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter.

[0100] S240 , performing color rendering on the target area according to the segmented image, the texture image of the original image and the preset rendering feature value.

[0101] Based on the above embodiment, optionally, the process of determining the basic color feature value of each pixel point of the preset filter includes:

[0102] Select at least two training sample images of the target area from the candidate face image;

[0103] Performing preset filter processing on at least two training sample images to obtain filter images of at least two training sample images;

[0104] The basic color feature value of each pixel point of the preset filter is determined according to the filter images of at least two training sample images.

[0105] In this embodiment, the filter image of each training sample image corresponds to a group of RGB values, and the obtained groups of RGB values ​​can effectively reflect the basic color feature values ​​of each pixel point of the preset filter. For example, the group of RGB values ​​with the largest values ​​in each group of RGB values ​​can be used as the basic color feature values ​​of each pixel point of the preset filter, or the summed mean value of each group of RGB values ​​can be used as the basic color feature value of each pixel point of the preset filter.

[0106] On the basis of the above embodiment, optionally, determining the basic color feature value of each pixel of the preset filter according to the filter images of at least two training sample images includes:

[0107] Obtaining color feature values ​​of filter images of at least two training sample images;

[0108] The color feature mean of the filter images of at least two training sample images is used as the basic color feature value of each pixel point of the preset filter.

[0109] In this embodiment, by training the training samples of the target area of ​​the data volume, multiple groups of RGB values ​​can be obtained, and the summed mean of R, the summed mean of G, and the summed mean of B form a new RGB set to obtain the basic color feature value of each pixel of the preset filter. In this embodiment, the basic color feature value of the preset filter is determined by the RGB mean of the pixel, which can ensure the stability of the feature value.

[0110] On the basis of the above embodiment, optionally, color rendering is performed on the target area according to the segmented image, the texture image of the original image and the preset rendering feature value, including:

[0111] Performing color rendering on the texture image of the original image according to a preset rendering feature value to obtain an initial rendered image;

[0112] Based on the segmented image, the initial rendered image is cropped to obtain a cropped image; and the cropped image is replaced with the original image of the target area to obtain a target rendered image of the target area.

[0113] In this embodiment, the schematic diagram of the segmented image can be seen in FIG6(b), which is a segmented image obtained after the original image is segmented. The preset rendering feature value is superimposed on the texture image to obtain an initial rendering image with texture characteristics, which can be seen in FIG6(c), which is a schematic diagram showing the initial rendering image.

[0114] Based on the outline of the lips in Figure 6(b), the corresponding position of Figure 6(c) is cropped to obtain a lip color image with color rendering, and this image is replaced with the original image of the target area (i.e. Figure 5 ), the target rendering image of the target area can be obtained, see Figure 7 , Figure 7 Schematic diagram showing a target rendered image of a target area.

[0115] In this embodiment, the corresponding position of the initial rendering image is replaced according to the segmentation result of the segmented image to obtain the color rendering result of the target area, and the texture characteristics of the target area can be retained while the color rendering is performed on the target area.

[0116] Embodiment 3

[0117] Figure 8: is a schematic diagram of the structure of the color rendering device of the target area in the third embodiment of the present invention. This embodiment can be applied to the case where color rendering is achieved in combination with the texture characteristics of the target area. The device is configured in an electronic device and can implement the color rendering method of the target area described in any embodiment of the present application. The device specifically includes the following:

[0118] The segmented image determination module 810 is used to obtain the original image of the target area from the target face image; and perform image segmentation processing on the original image of the target area to obtain a segmented image;

[0119] The texture image determination module 820 is used to determine the texture image of the original image of the target area;

[0120] The color rendering module 830 is used to perform color rendering on the target area according to the segmented image, the texture image of the original image and the preset rendering feature value.

[0121] Based on the above embodiment, optionally, the segmented image determination module 810 includes:

[0122] A key point determination unit, used for inputting a target face image into a face detection model to obtain key points of the target face image;

[0123] The image determination unit is used to determine the original image of the target area according to the key points of the target face image.

[0124] Based on the above embodiment, optionally, the image determination unit is specifically used to:

[0125] Determining key points of a target area from key points of the target face image;

[0126] The region image where the key points of the target region in the target face image are located is used as the original image of the target region.

[0127] Based on the above embodiment, optionally, the texture image determination module 820 is specifically used to:

[0128] Performing a preset filter process on the original image of the target area to obtain a filtered image, and determining the color feature value of each pixel point of the filtered image;

[0129] The texture image of the target area is obtained according to the difference between the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter.

[0130] On the basis of the above embodiment, optionally, the device of this embodiment further includes a color feature value determination module, and the color feature value determination module includes:

[0131] A training sample image determination unit, used for selecting at least two training sample images of a target area from the candidate face image;

[0132] A filter image determination unit, configured to perform preset filter processing on the at least two training sample images to obtain filter images of the at least two training sample images;

[0133] The feature value determining unit is used to determine the basic color feature value of each pixel point of the preset filter according to the filter images of the at least two training sample images.

[0134] Based on the above embodiment, optionally, the characteristic value determination unit is specifically used to:

[0135] Obtaining color feature values ​​of the filter images of the at least two training sample images;

[0136] The color feature mean of the filter images of the at least two training sample images is used as the basic color feature value of each pixel point of the preset filter.

[0137] Based on the above embodiment, optionally, the color rendering module 830 is specifically used for:

[0138] Performing color rendering on the texture image of the original image according to a preset rendering feature value to obtain an initial rendered image;

[0139] Based on the segmented image, the initial rendered image is cropped to obtain a cropped image; and the cropped image is replaced with the original image of the target area to obtain a target rendered image of the target area.

[0140] Through the color rendering device of the target area of ​​the third embodiment of the present invention, the texture features of the target area can be combined to make the color rendering result of the target area closer to reality, so as to enhance the visual perception of the user.

[0141] The target area color rendering device provided in the embodiment of the present invention can execute the target area color rendering method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0142] Embodiment 4

[0143] Fig. 9 is a schematic diagram of the structure of an electronic device in Embodiment 4 of the present invention. Fig. 9 As shown, the electronic device includes a processor 910, a memory 920, an input device 930, and an output device 940; the number of the processor 910 in the electronic device can be one or more. Fig. 9A processor 910 is taken as an example; the processor 910, the memory 920, the input device 930 and the output device 940 in the electronic device can be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0144] The memory 920, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the color rendering method of the target area in the embodiment of the present invention. The processor 910 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 920, that is, implements the color rendering method of the target area provided in the embodiment of the present invention.

[0145] The memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 920 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 920 may further include a memory remotely arranged relative to the processor 910, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0146] The input device 930 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 940 may include a display device such as a display screen.

[0147] Embodiment 5

[0148] This embodiment provides a storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to implement the color rendering method of the target area provided by the embodiment of the present invention.

[0149] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the color rendering method of the target area provided by any embodiment of the present invention.

[0150] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0151] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0152] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A color rendering method for a target area, characterized in that: The method comprises: Acquire an original image of a target area from a target face image; and perform image segmentation processing on the original image of the target area to obtain a segmented image; Determining the texture image of the original image of the target area includes: performing a preset filter process on the original image of the target area to obtain a filter image, and determining the color feature value of each pixel of the filter image; obtaining the texture image of the target area according to the difference between the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter; wherein the basic color feature value of each pixel of the preset filter refers to the average value of the target area after a large amount of data is filtered; According to the segmented image, the texture image of the original image and the preset rendering feature value, the target area is color rendered, including: according to the preset rendering feature value, the texture image of the original image is color rendered to obtain an initial rendered image; based on the segmented image, the initial rendered image is cropped to obtain a cropped image; and the cropped image is replaced with the original image of the target area to obtain a target rendered image of the target area.

2. The method according to claim 1, characterized in that Obtaining the original image of the target area from the target face image, including: Inputting the target face image into the face detection model to obtain the key points of the target face image; The original image of the target area is determined according to the key points of the target face image.

3. The method according to claim 2, characterized in that Determining the original image of the target area according to the key points of the target face image includes: Determining key points of a target area from key points of the target face image; The region image where the key points of the target region in the target face image are located is used as the original image of the target region.

4. The method according to claim 1, characterized in that: The process of determining the basic color characteristic value of each pixel point of the preset filter includes: Select at least two training sample images of the target area from the candidate face image; Performing preset filter processing on the at least two training sample images to obtain filter images of the at least two training sample images; The basic color feature value of each pixel point of the preset filter is determined according to the filter images of the at least two training sample images.

5. The method according to claim 4, characterized in that Determining the basic color feature value of each pixel point of the preset filter according to the filter images of the at least two training sample images includes: Obtaining color feature values ​​of the filter images of the at least two training sample images; The color feature mean of the filter images of the at least two training sample images is used as the basic color feature value of each pixel point of the preset filter.

6. A color rendering device for a target area, characterized in that: The device comprises: The segmented image determination module is used to obtain the original image of the target area from the target face image; and perform image segmentation processing on the original image of the target area to obtain a segmented image; A texture image determination module, used to determine the texture image of the original image of the target area; The texture image determination module is specifically used to perform a preset filter process on the original image of the target area to obtain a filter image, and determine the color feature value of each pixel of the filter image; according to the difference between the color feature value of each pixel of the filter image and the predetermined basic color feature value of each pixel of the preset filter, the texture image of the target area is obtained; wherein the basic color feature value of each pixel of the preset filter refers to the average value of the target area after a large amount of data is filtered; A color rendering module, used for performing color rendering on the target area according to the segmented image, the texture image of the original image and a preset rendering feature value; The color rendering module is specifically used to perform color rendering on the texture image of the original image according to the preset rendering feature value to obtain an initial rendered image; based on the segmented image, crop the initial rendered image to obtain a cropped image; and replace the cropped image with the original image of the target area to obtain a target rendered image of the target area.

7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the color rendering method for the target area as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the color rendering method of the target area as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Image processing method, computing device and storage medium

    CN108874145A