Image processing method and device, equipment and readable storage medium
By using the target portrait and scene characteristics to determine the lighting special effects parameters in image processing, and generating rich and diverse spotlight special effects, the problems of singleness of spotlight special effects and insufficient user attractiveness in the existing technology are solved, and the user experience and platform retention rate are improved.
Patent Information
- Application Number
- CN202311684972.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-08
- Publication Date
- 2024-12-20
AI Technical Summary
The existing spotlight special effects implementation method is single, and the user's attractiveness is insufficient, which affects the platform's retention rate.
By obtaining the target portrait features and scene features in the image, determine appropriate lighting special effects parameters, such as light source distance, light direction and light source color, and perform image processing to generate a rich and diverse spotlight special effects.
It improves the user's viewing experience, enhances the retention rate of platform users, and dynamically adjusts the lighting special effects parameters to adapt to different image scenes, providing a more personalized spotlight effect.
Smart Images

Figure CN119168843A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image processing method, apparatus, device and readable storage medium. Background Art
[0002] With the development of the Internet, more and more users like to publish and share digital media content such as images and videos on public platforms. In order to highlight the key content in digital media content and improve the viewing experience of other users, more and more platforms also support users to add some custom special effects to these digital media content. Take the more common spotlight effect as an example. The spotlight effect can make users focus on digital media content more quickly.
[0003] However, existing spotlight effects usually only add a spotlight effect layer on the surface of the image posted by the user. The implementation method of the special effects is relatively simple and has limited appeal to users, thus affecting the retention rate of users on the platform. Summary of the invention
[0004] Based on this, it is necessary to provide an image processing method, device, equipment and readable storage medium to address the above technical problems, so as to solve the technical problems in the prior art that the spotlight special effects are single in performance and insufficient in appeal to users.
[0005] In a first aspect, the present application provides an image processing method, comprising:
[0006] Acquire an initial image to be processed, and determine at least one target human portrait in the initial image;
[0007] Determine a target lighting special effect parameter according to the scene features in the initial image and the portrait features of the target portrait, wherein the target lighting special effect parameter includes at least one of a light source distance, a light direction, and a light source color;
[0008] The target portrait in the initial image is processed according to the target light effect parameters to obtain a target image.
[0009] As a feasible embodiment of the present application, the light source distance in the target lighting special effect parameter is determined according to the scene type of the initial image and the portrait size of the target portrait;
[0010] Determining the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait; and / or
[0011] The light source color in the target lighting special effect parameters is determined according to the scene color of the initial image and the portrait color of the target portrait.
[0012] As a feasible embodiment of the present application, determining the target lighting special effect parameters according to the scene features in the initial image and the portrait features of the target portrait includes:
[0013] Determining the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait;
[0014] Determining the light source distance in the target lighting special effect parameters according to the scene type of the initial image and the size of the target portrait; and / or
[0015] The light source color in the target lighting special effect parameters is determined according to the scene color of the initial image and the portrait color of the target portrait.
[0016] As a feasible embodiment of the present application, determining the light source color in the target lighting special effect parameter according to the scene color of the initial image and the portrait color of the target portrait includes:
[0017] Querying a preset color chart to obtain a first similarity between each initial light source color and the scene color of the initial image, and a second similarity between each initial light source color and the portrait color of the target portrait;
[0018] A target light source color is determined from the initial light source color according to the first similarity and the second similarity as the light source color in the target light effect parameter.
[0019] As a feasible embodiment of the present application, the determining of at least one target portrait in the initial image includes:
[0020] Performing image segmentation on the initial image to obtain a portrait region corresponding to an initial portrait in the initial image;
[0021] If the initial image includes a plurality of initial human portraits, at least one target human portrait is determined from the initial human portraits according to the regional brightness and / or regional area of the human portrait regions corresponding to the initial human portraits.
[0022] As a feasible embodiment of the present application, the determining at least one target portrait in the initial image includes:
[0023] If the initial image is an image frame in an initial video, determining a motion feature corresponding to an initial portrait in the initial image according to the initial image and a reference image before the initial image in the initial video;
[0024] At least one target person portrait in the initial image is determined according to the action feature.
[0025] As a feasible embodiment of the present application, determining the target lighting special effect parameters according to the scene features in the initial image and the portrait features of the target portrait includes:
[0026] Determine the target lighting special effect parameters corresponding to the initial image according to the scene features in the initial image, the portrait features of the target portrait, and the scene features in the reference image;
[0027] The step of processing the target portrait in the initial image according to the target light special effect parameters to obtain the target image includes:
[0028] The target portraits in the initial images of the initial video are processed respectively according to the target lighting special effect parameters corresponding to the initial images to obtain the target video.
[0029] As a feasible embodiment of the present application, after the step of processing the target portrait in the initial image according to the target light effect parameters to obtain the target image, the method further includes:
[0030] Providing a portrait switching control and / or a lighting effect parameter switching control on the display page of the target image;
[0031] In response to an operation instruction on the portrait switching control and / or the lighting special effect parameter switching control, determining a target portrait after switching and a target lighting special effect parameter after switching;
[0032] The switched target portrait in the target image is processed according to the switched target light special effect parameters to obtain a modified target image.
[0033] In a second aspect, the present application provides an image processing device, comprising:
[0034] An acquisition module, used for acquiring an initial image to be processed and determining at least one target portrait in the initial image;
[0035] A determination module, configured to determine target lighting special effect parameters according to scene features in the initial image and portrait features of the target portrait, wherein the target lighting special effect parameters include at least one of a light source position, a light direction, and a light source color;
[0036] The processing module is used to process the target portrait in the initial image according to the target light effect parameters to obtain a target image.
[0037] In a third aspect, the present application further provides a computer device, the computer device comprising:
[0038] one or more processors;
[0039] Memory; and
[0040] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the image processing method provided above.
[0041] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the image processing method provided above.
[0042] The image processing method provided in the embodiment of the present application, after determining the target portrait that needs special effects display in the image to be processed, determines suitable target lighting special effects parameters, such as light source distance, light direction, light source color, etc., by further utilizing the scene features in the image and the portrait features of the portrait. Therefore, after processing the target portrait in the initial image according to the target lighting special effects parameters, an image with spotlight special effects that conforms to the scene in the current image can be obtained, thereby better helping users focus on the detailed features in the image and providing users with a better viewing experience. In addition, the rich and diverse spotlight special effects generated for different images can also better improve the retention rate of users on the platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A schematic diagram of adding a spotlight effect to an image provided by the related technology;
[0045] Figure 2 A schematic diagram of a process flow of an image processing method provided in an embodiment of the present application;
[0046] FIG. 3( a ) is a schematic diagram of a process of analyzing a portrait in an image to determine a target portrait in the image according to an embodiment of the present application;
[0047] FIG3( b ) is a schematic diagram of an original image provided by an embodiment of the present application and the effect of a portrait mask area obtained by processing the original image;
[0048] FIG3( c ) is a schematic diagram of the effect of the bounding box of the portrait area provided in an embodiment of the present application;
[0049] Figure 4A schematic diagram of a process flow for determining a target person portrait in an initial image based on related images in a video provided in an embodiment of the present application;
[0050] FIG5( a ) is a schematic diagram of a process flow for determining target lighting effect parameters based on scene features and portrait features provided by an embodiment of the present application;
[0051] FIG5( b ) is a schematic diagram of a spotlight special effect presented after image processing provided by an embodiment of the present application;
[0052] FIG6( a ) is a schematic diagram of a flow chart of steps for determining the light source color in the target lighting effect parameters provided by an embodiment of the present application;
[0053] FIG6( b ) is a schematic diagram of a color chart provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of a process flow of determining lighting effect parameters of an image in a video to add lighting effects provided by an embodiment of the present application;
[0055] Figure 8 A schematic diagram of a process flow for modifying a target image provided in an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0057] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0059] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0060] In the description of the present application, the word "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0061] To facilitate understanding of the image processing method provided in the embodiment of the present application, the application scenario of the image processing method is first described. The image processing method provided in the embodiment of the present application is mainly run on a software platform provided by some Internet manufacturers that supports users to upload some images and videos of daily life and share them with other users. Usually, the software platform will provide some conventional special effects functions to support users to add some image effects to videos and images in the process of uploading images and videos, so as to provide other users with a better viewing experience when publishing. For example, the more common ones are spotlight effects. For ease of understanding, such as Figure 1 As shown, Figure 1 A schematic diagram of an effect of adding a spotlight special effect to an image is provided for related technology. Under the spotlight special effect, the user can be easily attracted by the portrait under the spotlight.
[0062] However, under normal circumstances, the spotlight effects provided by the software platform often only add a spotlight effects layer on the surface of the image posted by the user. This method can quickly process the images uploaded by the user, but the implementation scheme of the spotlight effects is relatively simple, and the special effects presented are also relatively popular, which has limited appeal to users, thus affecting the user retention rate on the platform to a certain extent.
[0063] It is precisely to solve the above-mentioned technical problems that the embodiments of the present application provide an image processing method, device, equipment and readable storage medium, which can add specialized spotlight effects to the target portrait in the image based on some features of the image, can better help users focus on the detailed features in the image, and provide users with a better viewing experience. At the same time, the rich and diverse spotlight effects generated for different images can also better improve the retention rate of users on the platform. Specifically, the image processing method is usually set in the image processing device in the form of a computer program, and the image processing device is usually set in the form of a processor in a computer device, such as the server end of a software platform provided by an Internet manufacturer that supports users to upload and share images and videos. The image processing device in the computer device executes the image processing method provided by the embodiments of the present application by running the computer program corresponding to the image processing method.
[0064] like Figure 2 As shown, Figure 2 A schematic flow chart of the steps of an image processing method provided in an embodiment of the present application, specifically, comprising steps S210 to S230:
[0065] S210, acquiring an initial image to be processed, and determining at least one target portrait in the initial image.
[0066] In the embodiments of the present application, combined with the application scenario diagram provided above, it can be seen that the initial image to be processed here usually refers to a single image uploaded by the user, or a part of the image frames in the video uploaded by the user. Of course, considering that the special effects processing of the video is usually also processed separately for the image frames in the video, therefore, for the sake of ease of description, the current embodiment is only explained by taking a single image as an example, and when the image is an image in a video, some special processing that may exist for the image at this time will be explained through additional other embodiments.
[0067] Furthermore, considering that in most cases, the focus that the user expects other users to pay attention to is usually the portrait in the image uploaded by the user, therefore, the image processing method provided in the embodiment of the present application is mainly for processing the portrait in the initial image, that is, under normal circumstances, it is necessary to first determine at least one target portrait in the initial image for subsequent spotlight special effects processing. Of course, it should be noted that the above-mentioned embodiment is implemented by giving priority to the target portrait in the image, and should not be regarded as a limitation on the embodiment of the present application. In fact, in some special cases, when the user hopes to highlight certain special items in the image uploaded by the user, an additional control can be used to select the target object in the image as the object that needs to be processed with spotlight special effects. For specific implementation schemes, please refer to the subsequent Figure 8and its explanatory contents.
[0068] Specifically, the target portrait in the initial image determined by the image processing device may be a single portrait, or of course may be multiple portraits. However, considering that in the subsequent special effects processing process, adding spotlight effects to multiple target portraits usually also involves adding appropriate lighting effects to each target portrait respectively, for ease of description, the embodiment of the present application mainly takes the spotlight effect adding process of a single target portrait as an example to illustrate, and for the spotlight effect adding process of multiple target portraits, those skilled in the art can achieve it by executing the spotlight effect adding process for a single target portrait one by one for each target portrait, and the embodiment of the present application will not be repeated here.
[0069] In addition, when the initial image contains only a single portrait, usually, the portrait is the target portrait in the initial image. Of course, when the initial image contains multiple portraits at the same time, it is necessary to determine the target portrait that needs to be processed with subsequent spotlight special effects from the multiple portraits contained in the initial image, such as one of the portraits. Specifically, as a common feasible implementation scheme, the target portrait can be determined by the user through a preset interface control when uploading the initial image, for example, by checking or boxing. Of course, it can also be determined based on the portrait features of multiple portraits obtained by analyzing the image after the user uploads the initial image. Specifically, as shown in Figure 3(a), Figure 3(a) is a schematic diagram of a step flow based on analyzing the portrait in the image to determine the target portrait in the image provided by an embodiment of the present application, specifically, including steps S310 to S320:
[0070] S310, performing image segmentation on the initial image to obtain a portrait region corresponding to an initial portrait in the initial image.
[0071] In an embodiment of the present application, the portrait area obtained by processing the initial image generally refers to a portrait mask area, that is, a portrait mask. Specifically, the portrait mask area can be obtained by processing the initial image based on an AI (Artificial Intelligence) model trained by deep learning. Specifically, for ease of understanding, as shown in Figure 3(b), an original image and a schematic diagram of the effect of the portrait mask area obtained by processing the original image are shown, wherein the original image has been blurred in advance.
[0072] S320: If there are multiple initial human portraits in the initial image, determine at least one target human portrait from the initial human portraits according to the regional brightness and / or regional area of the human portrait regions corresponding to the initial human portraits.
[0073] In the embodiment of the present application, after the portrait area in the initial image is determined by the portrait mask, since each portrait area corresponds to an initial portrait, the number of initial portraits can be determined based on the number of portrait areas processed. Specifically, when there is only one portrait area processed, the number of portraits contained in the image is 1. Therefore, under normal circumstances, the portrait can be used as the target portrait in the initial image that needs to be processed with spotlight special effects. When there are multiple portrait areas, that is, the initial image includes multiple initial portraits, in order to determine one or more target portraits to which the user desires to add a spotlight effect, considering that usually the user will give priority to highlighting the target portrait during the shooting process, therefore, as an embodiment of the present application, it is possible to select the regional brightness and / or regional area of the portrait area corresponding to each initial portrait to determine at least one target portrait from the initial portraits. Specifically, the regional brightness and / or regional area of the portrait area can describe the user's exposure to the portrait to a certain extent. Usually, the higher the regional brightness or the larger the regional area of the portrait area, the higher the user's exposure to the portrait, and the more the user desires to add a spotlight effect to the portrait.
[0074] Of course, considering that under normal circumstances, the portrait area segmented from the image is usually irregular in shape, therefore, in order to facilitate the calculation of the regional brightness and regional area of the portrait area corresponding to the initial portrait, thereby improving the image processing efficiency, as a feasible implementation scheme of the present application, it can be considered to calculate the bounding box of the portrait mask area, so as to obtain the bounding box information with a relatively regular shape for subsequent regional brightness or regional area calculation, as follows:
[0075] (1) The AABB bounding box of the portrait mask is calculated by calling the boundingRect in OpenCV (Open Source Computer Vision Library, a cross-platform open source software library for computer vision processing). Specifically, as shown in FIG3(c), a schematic diagram of the effect of the bounding box of the portrait mask calculated by calling the interface is shown. It can be seen that each face (edge) of the AABB (Axially Aligned Bounding Box) bounding box is parallel to the coordinate plane (coordinate axis), so the coordinates of each vertex of the AABB bounding box and the size of the bounding box can be easily determined;
[0076] (2) Converting the area within the bounding box into a grayscale image, for example, by calculating the average value of the RGB (red, green, and blue) values of each pixel in the area, the grayscale value of each pixel is obtained. The grayscale value can reflect the brightness of the pixel. Specifically, the higher the grayscale value, the higher the brightness of the pixel. Conversely, the lower the grayscale value, the lower the brightness of the pixel. Therefore, several portrait areas with the highest average grayscale values of the pixels in the area can be used as the target portraits finally determined, or the portrait areas with the average grayscale values of the pixels in the area exceeding a certain threshold can be used as the target portraits finally determined;
[0077] (3) The area of each portrait region is calculated based on the size of the bounding box. By sorting the areas of these portrait regions, several portrait regions with the largest area can be used as the target portraits finally determined, or portrait regions with an area greater than a certain threshold can be used as the target portraits finally determined.
[0078] It should be noted that the above implementation method is explained by taking the AABB bounding box as an example. In fact, although the AABB bounding box can conveniently calculate the regional brightness and regional area of the portrait area, it will lose the posture characteristics of the portrait area to a certain extent, that is, it cannot reflect the posture of the portrait in the image. Therefore, as another optional embodiment of the present application, it is also possible to calculate the OBB (Oriented Bounding Box) of the portrait area to realize the calculation of the regional brightness and regional area of the portrait area. Specifically, the OBB bounding box can be obtained by processing the contour approximation method. For example, the minimum area rectangle of the convex hull can be calculated by the minAreaRect function of opencv, and then the boxpoints function of opencv is used to obtain the four corner points of the rectangle, so as to further obtain the vertices on the contour of the portrait area, thereby obtaining the final OBB bounding box. Compared with the AABB bounding box, the OBB bounding box can determine the posture characteristics of the portrait to a certain extent, so as to facilitate the subsequent calculation of the target lighting special effect parameters.
[0079] Of course, as another feasible embodiment of the present application, when the initial image is an image frame in a video uploaded by the user, at this time, it is also possible to consider using the portrait in the initial image and the portraits in other related image frames in the video to determine the portrait action features in the image, so as to facilitate determining a more active portrait from the initial image as the target portrait that needs to be processed with spotlight special effects. The specific implementation scheme can be referred to as follows: Figure 4 . Specifically, Figure 4 As shown, Figure 4A schematic flow chart of a step of determining a target person portrait in an initial image based on related images in a video provided in an embodiment of the present application, specifically, comprising steps S410 to S420:
[0080] S410: If the initial image is an image frame in an initial video, determine action features corresponding to an initial portrait in the initial image according to the initial image and a reference image before the initial image in the initial video.
[0081] In an embodiment of the present application, when the initial image is an image frame in a video uploaded by a user, considering that under normal circumstances, the portraits in the video will keep changing, at this time, if the portrait features of each image frame in the video are analyzed separately, it is easy to cause errors in the target portraits determined in some image frames in the video. For example, in certain image frames of the video, the target portrait that the user wants to focus on may temporarily "move out" of the image. At this time, other portraits in the image frame will be determined as target portraits, affecting the user's viewing experience. Therefore, in an embodiment of the present application, if the initial image is an image frame in the initial video, at this time, the image processing device will determine the action features corresponding to each portrait in the complete video based on the initial image and the reference image before the initial image in the initial video, that is, considering the video as a whole. Specifically, considering that in a video, the target portraits that the user wants to focus on are usually those whose movements change more frequently. For example, in a dance video, dancing portraits whose movements change more frequently are usually the target portraits that the user wants to add spotlight effects to. Therefore, as a feasible embodiment of the present application, the motion features determined here can be determined by calculating the change in the portrait center of each portrait in the video in different image frames.
[0082] S420: Determine at least one target person portrait in the initial image according to the action feature.
[0083] In the embodiment of the present application, taking the aforementioned change amount of the portrait center in different image frames as an example of action features, at this time, based on optical flow tracking, the displacement change information of the portrait center of a certain portrait in different image frames in the video can be tracked and determined, and by comparing the displacement change information corresponding to different initial portraits, the portrait with the most frequent displacement change information can be screened out as the target portrait for adding spotlight special effects later. Of course, in the above process, considering that the number of image frames contained in the video is usually large, in order to avoid excessive calculations that affect the image processing efficiency, as a feasible embodiment of the present application, after the user uploads the video, the image processing device can consider sampling the video at a certain sampling frequency to obtain a number of initial images to be processed. For example, as a feasible embodiment of the present application, it can be based on a sampling frequency of 50 frames, that is, one frame of image is sampled for every 50 frames of image as the initial image to be processed to complete the preprocessing of the video.
[0084] So far, through the above description, the image processing device can complete the determination of the target portrait in the initial image in different specific application scenarios based on different actual needs, so as to be further used to execute subsequent image processing processes.
[0085] S220, determining target lighting special effect parameters according to scene features in the initial image and portrait features of the target portrait.
[0086] In the embodiment of the present application, after the target portrait in the image that needs to be processed with spotlight special effects is determined, the image processing device will further extract the scene features in the initial image and the portrait features of the target portrait to comprehensively determine the set target lighting special effects parameters. Specifically, the target lighting special effects parameters usually include at least one of the light source distance, light direction and light source color, wherein the light source distance usually affects the intensity of the spotlight special effects ultimately formed in the image, while the light direction can highlight the different details in the portrait, and the light source color can provide the user with different spotlight performance effects. At this time, the implementation scheme for determining different parameters in the target lighting special effects parameters based on scene features and portrait features can refer to the subsequent Figure 5 and its explanatory description. Specifically, as shown in Figure 5(a), Figure 5(a) is a schematic flow chart of the steps for determining target lighting special effects parameters based on scene features and portrait features provided in the embodiment of the present application, specifically including steps S510 to S530:
[0087] S510: Determine the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait.
[0088] In the embodiment of the present application, in the conventional lighting special effect scheme, for example, Figure 1Taking the lighting effects implemented in the related technologies shown as an example, it can be seen that in conventional lighting effects, the light source is usually located directly above the portrait area and presents the lighting effects in a vertical manner to the ground. However, when the portrait is in a tilted posture at a certain angle, this conventional vertical light usually cannot reflect a good focusing effect. Therefore, as a feasible embodiment of the present application, the light direction in the target lighting effect parameters can be determined based on the portrait posture of the target portrait, wherein the portrait posture here can be determined based on the OBB bounding box obtained by the aforementioned processing of the portrait area. For ease of description, the portrait posture can be described based on the angle between the OBB bounding box and the ground. For example, under normal circumstances, the portrait posture can be described by an angle value between 70° and 90°. On this basis, as the most common implementation scheme, the angle corresponding to the light direction in the target lighting effect parameters can usually be the same as or complementary to the angle value corresponding to the portrait posture. Among them, the angle corresponding to the light direction in the target lighting special effect parameters is the same as the angle corresponding to the portrait posture, which usually means that the light direction is roughly parallel to the portrait posture in the image, and the angle corresponding to the light direction in the target lighting special effect parameters is complementary to the angle corresponding to the portrait posture, which usually means that the light is irradiated on the portrait at an angle symmetrical to the vertical axis of the portrait posture.
[0089] On the basis of the above, the light direction in the target lighting special effect parameters finally determined can be related to the portrait posture of the target portrait, and can also be further related to the scene layout of the initial image. Specifically, considering that in a normal image, in addition to the target portrait that the user wants to highlight, there may usually be other background objects in the background area of the image, such as roadside trees, street lights, or indoor tables and chairs, etc. Therefore, in order to reduce the impact of the spotlight special effect on these background objects, in the process of specifically determining the light direction in the target lighting special effect parameters, the position information of other background objects in the initial image, that is, the scene layout, can be further considered, and the irradiation angle with less impact on the background objects, that is, the fewer background objects passed through, is preferably selected as the light direction in the target lighting special effect parameters. At this time, the light direction determined according to the scene layout of the initial image and the portrait posture of the target portrait can minimize the impact on other background objects in the initial image on the basis of ensuring the spotlight special effect effect on the target portrait in the initial image.
[0090] S520: Determine a light source distance in a target lighting effect parameter according to a scene type of the initial image and a size of the target portrait.
[0091] In the embodiment of the present application, as a common feasible implementation scheme, after the light direction in the target lighting special effect parameters is determined as mentioned above, usually, it can be selected based on the light direction, that is, by using the intersection of the extension lines of the corresponding side lengths of the bounding box to determine the light source position in the target lighting special effect parameters, thereby ensuring that the spotlight can completely cover the target portrait in the initial image. However, as a feasible embodiment of the present application, in order to better reflect the spotlight special effect, after the light direction is determined, the light source position in the target lighting special effect parameters can be reflected by the light source distance, and the light source distance can be further determined based on the size of the target portrait and the scene type of the initial image.
[0092] Specifically, as a feasible embodiment of the present application, the scene types of the initial image can mainly include indoor scenes and outdoor scenes, wherein, in outdoor scenes, the light source distance in the target lighting special effect parameters can be set farther to simulate a focusing effect similar to a moonlight point light source, whereas, in indoor scenes, the light source distance in the target lighting special effect parameters can be set relatively closer to simulate a focusing effect of an indoor point light source. Of course, on this basis, the light source distance in the target lighting special effect parameters can be further adjusted based on the size of the target portrait, for example, when the target portrait is larger, the light source distance can be further shortened, whereas, when the target portrait is smaller, the light source distance can be further expanded.
[0093] Of course, the implementation scheme provided above is only a feasible implementation scheme. In fact, the scene type of the initial image can also include more scene types. In order to better determine the light source distance, the correlation between the scene type and the light source distance and the correlation between the portrait size and the light source distance can be pre-stored in a database, wherein the correlation between the scene type and the light source distance is used as a benchmark to determine the optimal light source distance under the current scene type, and on this basis, the correlation between the portrait size and the light source distance is used to make certain corrections to the light source distance. When the obtained light source distance is used as the target lighting special effect parameter, a spotlight special effect with better performance can be obtained.
[0094] Specifically, for ease of understanding, as shown in FIG5( b ), there is shown a schematic diagram of a spotlight special effect presented by the image processing method provided by an embodiment of the present application.
[0095] S530: Determine a light source color in the target lighting effect parameters according to a scene color of the initial image and a portrait color of the target portrait.
[0096] In an embodiment of the present application, in order to improve the performance of the spotlight, the light source color in the target lighting special effect parameters is usually related to the background color. For example, for images or videos obtained by common night shooting, when the background color brightness is relatively low, the spotlight special effect can use a relatively bright light source color. For example, an RGB value of (0.8, 0.8, 0.8) can be selected by default, that is, a relatively bright gray as the light source color in the target lighting special effect parameters, so as to better reflect the portrait in the image.
[0097] Of course, in addition to the aforementioned default light source color, the light source color can also be selected based on other actual needs. For example, as a feasible embodiment of the present application, in order to present a better color comparison effect to the user, the light source color is selected based on the scene color and the portrait color. Specifically, it can be selected by using a preset color chart to select a suitable color as the light source color in the target lighting special effect parameter. For a specific implementation scheme, please refer to the subsequent Figure 6 (a) and its explanation. Specifically, as shown in Figure 6 (a), Figure 6 (a) is a schematic flow chart of the steps for determining the light source color in the target lighting special effect parameter provided in an embodiment of the present application, specifically, including steps S610 to S620:
[0098] S610, querying a preset color chart to obtain a first similarity between each initial light source color and the scene color of the initial image, and a second similarity between each initial light source color and the portrait color of the target portrait.
[0099] Taking into account the general color theory, the light source color can be selected to be a similar color or a complementary color to the scene color or the portrait color (usually refers to the color of the clothes worn by the portrait) to achieve a more harmonious color matching effect. Therefore, in an embodiment of the present application, it can be considered to determine the first similarity between each initial light source color and the scene color of the initial image, and the second similarity between each initial light source color and the portrait color of the target portrait by querying a preset color chart. Specifically, as a feasible embodiment of the present application, as shown in Figure 6(b), Figure 6(b) shows a color chart. Specifically, in the color chart, each color area is described in the form of an angle. For example, the red area usually refers to the area with an angle of 330° to 360°, the yellow area refers to the area with an angle of 30° to 90°, and the green area refers to the area with an angle of 90° to 150°. The closer the angles, such as the red and yellow areas, the closer the colors in the color areas are, and the higher the color similarity. Conversely, the more complementary the angles are, the more corresponding the light and dark, cold and warm colors in the color areas are, and the lower the color similarity. Therefore, based on the preset color chart, the first similarity between each initial light source color and the scene color of the initial image, and the second similarity between each initial light source color and the portrait color of the target portrait can be quickly calculated.
[0100] S620: Determine a target light source color from the initial light source color according to the first similarity and the second similarity as the light source color in the target light effect parameter.
[0101] In an embodiment of the present application, on the basis of the foregoing, when considering using similar colors to improve the color matching effect between the spotlight special effect and the color of the image itself, the target light source color with relatively higher first similarity and second similarity can be given priority as the light source color in the target lighting special effect parameters. For example, when the scene color is green and the portrait color is red, yellow can be selected as the light source color in the target lighting special effect parameters. Conversely, when considering using complementary colors to improve the color matching effect between the spotlight special effect and the color of the image itself, the target light source color with relatively lower first similarity and second similarity can be given priority as the light source color in the target lighting special effect parameters. For example, when the scene color is green and the portrait color is red, blue can be selected as the light source color in the target lighting special effect parameters.
[0102] Of course, the above implementation scheme only provides a feasible implementation scheme. In fact, considering the visual senses of different users, the selection of the light source color can be set based on actual needs, or as another feasible implementation scheme, when the image is an image frame in a video, the light source color selected for each image frame in the video can be changed over time through a time function, so as to achieve the effect of continuously switching the light source color as the video is played. The specific implementation scheme of this application embodiment will not be repeated here.
[0103] Of course, the implementation scheme provided above is illustrated using a single target portrait as an example. When there are multiple target portraits determined in the initial image, the image processing device will consider the portrait features of each target portrait separately to set more reasonable target lighting special effect parameters for it, thereby providing users with a better visual experience overall.
[0104] S230: Process the target portrait in the initial image according to the target light effect parameters to obtain a target image.
[0105] In the present embodiment, after the target lighting special effect parameters are determined as mentioned above, a target image containing a specific spotlight special effect can be formed by generating a light source at a specified position and adding a specific ray effect to the target portrait with a given light direction and a given light source color.
[0106] In addition, as another embodiment of the present application, when the initial image is an image frame in the uploaded video, at this time, the image processing device usually needs to add a spotlight effect to the uploaded complete video, that is, usually a corresponding spotlight effect will be added to each image frame in the video. At this time, in order to avoid the large differences in target lighting effect parameters of adjacent images due to the consideration of the image features of each image frame alone, thereby causing the spotlight effect to have a sudden change abnormality, as another feasible implementation scheme of the present application, when the initial image is an image frame in the initial video, the target lighting effect parameters will also be determined by considering the image features of the relevant reference images in the video. The specific implementation scheme can be found in the subsequent Figure 7 and its explanations, such as Figure 7 As shown, Figure 7 A schematic flow chart of a step of determining lighting effect parameters of an image in a video to add lighting effects is provided in an embodiment of the present application, specifically, comprising steps S710 to S720:
[0107] S710, determining target lighting special effect parameters corresponding to the initial image according to scene features in the initial image, portrait features of the target portrait, and scene features in the reference image.
[0108] Different from the aforementioned method of determining the light direction, light source distance and other parameters in the target lighting special effects parameters based on the scene features in the initial image and the portrait features of the target portrait, in the embodiment of the present application, the target lighting special effects parameters will also additionally consider the scene features of a portion of the reference image in the video that is located before the initial image, thereby avoiding sudden changes in the light direction or light source distance in the target lighting special effects parameters. The specific determination of the target lighting special effects parameters can refer to the relevant instructions of the aforementioned step S220, which will not be repeated here in the embodiment of the present application.
[0109] S720, processing the target portraits in the initial images of the initial video respectively according to the target lighting effect parameters corresponding to the initial images to obtain the target video.
[0110] In the embodiment of the present application, after determining the target lighting special effect parameters corresponding to each initial image frame in the video and processing each initial image frame respectively, a target video with a better spotlight performance effect can be obtained while ensuring the smoothness of the lighting special effect. In the target video, the spotlight special effect can change continuously with the movement of the target portrait, thereby enriching the user's viewing experience.
[0111] In addition, through the above scheme, after the user automatically uploads the image or video, the target portrait that needs to be added with special effects in the image or video can be automatically determined, and the lighting special effects parameters of each image frame in the image or video can be determined, so as to generate a more reasonable spotlight special effect on the image according to the lighting special effects parameters. The entire process does not require user operation, which improves the convenience of users using the software platform. Of course, considering that there may be errors in the target portrait and lighting special effects parameters determined by the platform, resulting in the generated target image failing to meet the user's expected results, therefore, in order to meet the user's expectations, additional switching controls can be displayed during the process of the image processing device displaying the target image, so that the user can modify the target portrait and target lighting special effects parameters determined by the image processing device. For specific implementation schemes, please refer to the subsequent Figure 8 and its explanation. Figure 8 As shown, Figure 8 A schematic flow chart of a step of modifying a target image provided in an embodiment of the present application, specifically, comprising steps S810 to S830:
[0112] S810: providing a portrait switching control and / or a lighting effect parameter switching control on the display page of the target image.
[0113] In the embodiment of the present application, after the image processing device completes the spotlight special effect processing in the initial image to obtain the target image, it will usually be displayed through a preset interface, for example, it can be displayed through the client of the aforementioned software platform, that is, the relevant interface of the application installed on the user terminal device, such as a mobile phone or a computer. At this time, in addition to displaying the target image, the image processing device can also control to provide a portrait switching control and / or a light special effect parameter switching control on the display page of the target image, wherein the portrait switching control can be used to switch the target portrait with the spotlight special effect added, and the light special effect parameter switching control can switch the parameters of the spotlight special effect added to the target portrait, such as the light source distance, light direction, and light source color, etc.
[0114] S820, in response to an operation instruction on the portrait switching control and / or the lighting effect parameter switching control, determining a target portrait after switching and a target lighting effect parameter after switching.
[0115] Based on the foregoing, the user can process the portrait switching control and the lighting effect parameter switching control through preset operation instructions, such as by clicking and checking, to determine the target portrait after switching and the target lighting effect parameters after switching.
[0116] S830, processing the switched target portrait in the target image according to the switched target light special effect parameters to obtain a modified target image.
[0117] In an embodiment of the present application, after the target lighting effect parameters are switched in response to an operation instruction of the lighting effect parameter switching control, the target portrait in the target image can be processed according to the switched target lighting effect parameters to obtain a modified target image. After the target portrait is switched in response to an operation instruction of the portrait switching control, the target portrait in the target image can be processed according to the switched target lighting effect parameters to obtain a modified target image. After the target lighting effect parameters are switched in response to an operation instruction of the lighting effect parameter switching control, and the target portrait is switched in response to an operation instruction of the portrait switching control, the target portrait in the target image can be processed according to the switched target lighting effect parameters to obtain a modified target image.
[0118] The image processing method provided in the embodiment of the present application, after determining the target portrait that needs special effects display in the image to be processed, determines suitable target lighting special effects parameters, such as light source distance, light direction, light source color, etc., by further utilizing the scene features in the image and the portrait features of the portrait. Therefore, after processing the target portrait in the initial image according to the target lighting special effects parameters, an image with spotlight special effects that conforms to the scene in the current image can be obtained, thereby better helping users focus on the detailed features in the image and providing users with a better viewing experience. In addition, the rich and diverse spotlight special effects generated for different images can also better improve the retention rate of users on the platform.
[0119] In order to better implement the image processing method provided in the embodiment of the present application, on the basis of the image processing method provided in the embodiment of the present application, an image processing device is also provided in the embodiment of the present application, such as Fig. 9 As shown, the image processing device 900 includes:
[0120] An acquisition module 910 is used to acquire an initial image to be processed and determine at least one target portrait in the initial image;
[0121] A determination module 920, configured to determine target lighting effect parameters according to the scene features in the initial image and the portrait features of the target portrait, wherein the target lighting effect parameters include at least one of a light source position, a light direction, and a light source color;
[0122] The processing module 930 is used to process the target portrait in the initial image according to the target light effect parameters to obtain a target image.
[0123] In some embodiments of the present application, the determination module 920 is also used to determine the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait; determine the light source distance in the target lighting special effect parameters according to the scene type of the initial image and the portrait size of the target portrait; and / or determine the light source color in the target lighting special effect parameters according to the scene color of the initial image and the portrait color of the target portrait.
[0124] In some embodiments of the present application, the determination module 920 is also used to query a preset color chart, obtain a first similarity between each initial light source color and the scene color of the initial image, and a second similarity between each initial light source color and the portrait color of the target portrait; and determine the target light source color from the initial light source color as the light source color in the target lighting special effect parameters based on the first similarity and the second similarity.
[0125] In some embodiments of the present application, the acquisition module 910 is also used to perform image segmentation on the initial image to obtain a portrait area corresponding to the initial portrait in the initial image; if the initial image includes multiple initial portraits, at least one target portrait is determined from the initial portraits based on the regional brightness and / or regional area of the portrait areas corresponding to each of the initial portraits.
[0126] In some embodiments of the present application, the acquisition module 910 is also used to determine the action features corresponding to the initial portrait in the initial image based on the initial image and a reference image before the initial image in the initial video if the initial image is an image frame in the initial video; and determine at least one target portrait in the initial image based on the action features.
[0127] In some embodiments of the present application, the determination module 920 is also used to determine the target lighting special effect parameters corresponding to the initial image based on the scene features in the initial image, the portrait features of the target portrait and the scene features in the reference image; the processing module 930 is also used to process the target portraits in each initial image of the initial video according to the target lighting special effect parameters corresponding to each initial image to obtain the target video.
[0128] In some embodiments of the present application, the processing module 930 is also used to provide a portrait switching control and / or a lighting effect parameter switching control on the display page of the target image; in response to an operation instruction on the portrait switching control and / or the lighting effect parameter switching control, determine the switched target portrait and the switched target lighting effect parameters; process the switched target portrait in the target image according to the switched target lighting effect parameters to obtain a modified target image.
[0129] For the specific definition of the road generation device, please refer to the definition of the road generation method above, which will not be repeated here. Each module in the above road generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0130] In some embodiments of the present application, the road generation device 900 can be implemented in the form of a computer program. The computer program can be used in Fig.10 The computer device shown in the figure is run on the computer device. The memory of the computer device can store various program modules constituting the road generation device 900, for example, Fig. 9The acquisition module 910, the determination module 920 and the processing module 930 are shown. The computer program composed of various program modules enables the processor to execute the steps of the road generation method of each embodiment of the present application described in this specification.
[0131] For example, Fig.10 The computer device shown can be Fig. 9 The acquisition module 910 in the road generation device 900 shown executes step S210. The computer device can execute step S220 through the determination module 920. The computer device can execute step S230 through the processing module 930. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external computer device through a network connection. When the computer program is executed by the processor, a road generation method is implemented.
[0132] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0133] In some embodiments of the present application, a computer device is provided, comprising one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the following steps:
[0134] Acquire an initial image to be processed, and determine at least one target human portrait in the initial image;
[0135] Determine a target lighting special effect parameter according to the scene features in the initial image and the portrait features of the target portrait, wherein the target lighting special effect parameter includes at least one of a light source distance, a light direction, and a light source color;
[0136] The target portrait in the initial image is processed according to the target light effect parameters to obtain a target image.
[0137] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: determining the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait; determining the light source distance in the target lighting special effect parameters according to the scene type of the initial image and the portrait size of the target portrait; and / or determining the light source color in the target lighting special effect parameters according to the scene color of the initial image and the portrait color of the target portrait.
[0138] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: querying a preset color chart to obtain a first similarity between each initial light source color and the scene color of the initial image, and a second similarity between each initial light source color and the portrait color of the target portrait; determining a target light source color from the initial light source colors as the light source color in the target lighting effect parameters based on the first similarity and the second similarity.
[0139] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: performing image segmentation on the initial image to obtain a portrait area corresponding to an initial portrait in the initial image; if there are multiple initial portraits in the initial image, determining at least one target portrait from the initial portraits based on the regional brightness and / or regional area of the portrait areas corresponding to each of the initial portraits.
[0140] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: if the initial image is an image frame in an initial video, determining the action features corresponding to the initial portrait in the initial image based on the initial image and a reference image before the initial image in the initial video; and determining at least one target portrait in the initial image based on the action features.
[0141] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: determining the target lighting special effect parameters corresponding to the initial image based on the scene features in the initial image, the portrait features of the target portrait, and the scene features in the reference image; and processing the target portraits in each initial image of the initial video according to the target lighting special effect parameters corresponding to each initial image to obtain a target video.
[0142] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: providing a portrait switching control and / or a lighting effect parameter switching control on the display page of the target image; determining the switched target portrait and the switched target lighting effect parameters in response to an operation instruction on the portrait switching control and / or the lighting effect parameter switching control; and processing the switched target portrait in the target image according to the switched target lighting effect parameters to obtain a modified target image.
[0143] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Any reference to memory, storage, information library or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0144] In some embodiments of the present application, a computer-readable storage medium is provided, which stores a computer program. The computer program is loaded by a processor, so that the processor performs the following steps:
[0145] Acquire an initial image to be processed, and determine at least one target human portrait in the initial image;
[0146] Determine a target lighting special effect parameter according to the scene features in the initial image and the portrait features of the target portrait, wherein the target lighting special effect parameter includes at least one of a light source distance, a light direction, and a light source color;
[0147] The target portrait in the initial image is processed according to the target light effect parameters to obtain a target image.
[0148] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: determining the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait; determining the light source distance in the target lighting special effect parameters according to the scene type of the initial image and the portrait size of the target portrait; and / or determining the light source color in the target lighting special effect parameters according to the scene color of the initial image and the portrait color of the target portrait.
[0149] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: querying a preset color chart to obtain a first similarity between each initial light source color and the scene color of the initial image, and a second similarity between each initial light source color and the portrait color of the target portrait; determining a target light source color from the initial light source colors as the light source color in the target lighting effect parameters based on the first similarity and the second similarity.
[0150] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: performing image segmentation on the initial image to obtain a portrait area corresponding to an initial portrait in the initial image; if there are multiple initial portraits in the initial image, determining at least one target portrait from the initial portraits based on the regional brightness and / or regional area of the portrait areas corresponding to each of the initial portraits.
[0151] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: if the initial image is an image frame in an initial video, determining the action features corresponding to the initial portrait in the initial image based on the initial image and a reference image before the initial image in the initial video; and determining at least one target portrait in the initial image based on the action features.
[0152] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: determining the target lighting special effect parameters corresponding to the initial image based on the scene features in the initial image, the portrait features of the target portrait, and the scene features in the reference image; and processing the target portraits in each initial image of the initial video according to the target lighting special effect parameters corresponding to each initial image to obtain a target video.
[0153] In some embodiments of the present application, the processor further implements the following steps when executing the computer program: providing a portrait switching control and / or a lighting effect parameter switching control on the display page of the target image; determining the switched target portrait and the switched target lighting effect parameters in response to an operation instruction on the portrait switching control and / or the lighting effect parameter switching control; and processing the switched target portrait in the target image according to the switched target lighting effect parameters to obtain a modified target image.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above is a detailed introduction to an image processing method, device, computer equipment and storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An image processing method, characterized in that: include: Acquire an initial image to be processed, and determine at least one target human portrait in the initial image; Determine a target lighting special effect parameter according to the scene features in the initial image and the portrait features of the target portrait, wherein the target lighting special effect parameter includes at least one of a light source distance, a light direction, and a light source color; The target portrait in the initial image is processed according to the target light effect parameters to obtain a target image.
2. The image processing method according to claim 1, characterized in that: The step of determining target lighting special effect parameters according to the scene features in the initial image and the portrait features of the target portrait includes: Determining the light direction in the target lighting special effect parameters according to the scene layout of the initial image and the portrait posture of the target portrait; Determining the light source distance in the target lighting special effect parameters according to the scene type of the initial image and the size of the target portrait; and / or The light source color in the target lighting special effect parameters is determined according to the scene color of the initial image and the portrait color of the target portrait.
3. The image processing method according to claim 2, characterized in that: The step of determining the light source color in the target lighting special effect parameters according to the scene color of the initial image and the portrait color of the target portrait includes: Querying a preset color chart to obtain a first similarity between each initial light source color and the scene color of the initial image, and a second similarity between each initial light source color and the portrait color of the target portrait; A target light source color is determined from the initial light source color according to the first similarity and the second similarity as the light source color in the target light effect parameter.
4. The image processing method according to claim 1, characterized in that: The determining of at least one target portrait in the initial image includes: Performing image segmentation on the initial image to obtain a portrait region corresponding to an initial portrait in the initial image; If the initial image includes a plurality of initial human portraits, at least one target human portrait is determined from the initial human portraits according to the regional brightness and / or regional area of the human portrait regions corresponding to the initial human portraits.
5. The image processing method according to claim 1, characterized in that: The determining of at least one target portrait in the initial image includes: If the initial image is an image frame in an initial video, determining a motion feature corresponding to an initial portrait in the initial image according to the initial image and a reference image before the initial image in the initial video; At least one target person portrait in the initial image is determined according to the action feature.
6. The image processing method according to claim 5, characterized in that: The step of determining target lighting special effect parameters according to the scene features in the initial image and the portrait features of the target portrait includes: Determine the target lighting special effect parameters corresponding to the initial image according to the scene features in the initial image, the portrait features of the target portrait, and the scene features in the reference image; The step of processing the target portrait in the initial image according to the target light special effect parameters to obtain the target image includes: The target portraits in the initial images of the initial video are processed respectively according to the target lighting special effect parameters corresponding to the initial images to obtain the target video.
7. The image processing method according to any one of claims 1 to 6, characterized in that: After the step of processing the target portrait in the initial image according to the target light effect parameters to obtain the target image, the method further includes: Providing a portrait switching control and / or a lighting effect parameter switching control on the display page of the target image; In response to an operation instruction on the portrait switching control and / or the lighting special effect parameter switching control, determining a target portrait after switching and a target lighting special effect parameter after switching; The switched target portrait in the target image is processed according to the switched target light special effect parameters to obtain a modified target image.
8. An image processing device, characterized in that: include: An acquisition module, used for acquiring an initial image to be processed and determining at least one target portrait in the initial image; A determination module, configured to determine target lighting special effect parameters according to scene features in the initial image and portrait features of the target portrait, wherein the target lighting special effect parameters include at least one of a light source position, a light direction, and a light source color; The processing module is used to process the target portrait in the initial image according to the target light effect parameters to obtain a target image.
9. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the processor to implement the image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the image processing method according to any one of claims 1 to 7.
