Background adaptive shooting method, device, system and storage medium

By analyzing the user's initial deletion image and selected scene labels, automatically matching the appropriate background image and adjusting the light, the dissatisfaction problem caused by the user's inability to fully understand the shooting background is solved, and the adaptability and user experience of the finished shooting is improved.

CN119211745BActive Publication Date: 2025-03-21SUZHOU UNIV OF SCI & TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411296465.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-03-21
Estimated Expiration
2044-09-18

AI Technical Summary

Technical Problem

During shooting, the existing intelligent shooting system is unable to fully understand the shooting background of its own adaptation, resulting in high image restoration but not adapting to the user, resulting in user dissatisfaction.

Method used

A background adaptive shooting method is provided, by analyzing the user's initial image, judging the user's skin color tag, and determining the target background image that is suitable for the user based on the skin color tag and the scene tag selected by the user. Then, the fill light data is determined based on the target background image and the user's initial image. By switching the background image and adjusting the lighting parameters, the user's image under the target background image and the adapted light are obtained.

Benefits of technology

It improves users' satisfaction with shooting finished products, reduces users' time and energy when selecting background images, and improves user experience and shooting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211745B_ABST
    Figure CN119211745B_ABST
Patent Text Reader

Abstract

The present invention discloses a background adaptive shooting method, device, system and storage medium, the method comprising: in response to a shooting request, the shooting request includes a scene tag, controlling a camera to shoot an initial image of a target object under an original background image; graying the initial image to obtain a gray image; constructing a series of skin color area images based on the gray image and preset progressive data, and determining a target background image adapted to the target object according to the series of skin color area images and the scene tag; controlling a background switching device to switch the original background image to a target background image; determining fill light data of the target object based on the gray image and the target background image; controlling a light adjustment device to adjust light parameters according to the fill light data; and controlling a camera to shoot a result image of the target object under the target background image and the adapted light. The present invention can adapt the background image and light intensity to the user as much as possible under the condition of meeting the needs of the user, thereby improving the user's satisfaction with the finished product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of photography technology, and in particular to a background adaptive shooting method, device, system and storage medium. Background Art

[0002] Shooting refers to the process of using equipment such as video cameras, camcorders or cameras to record the light reflected or emitted by objects and save the image of people or things on film, tapes, memory cards or other storage media.

[0003] Chinese patent application No. 201810011476.3 discloses an intelligent shooting system and method with lighting recognition and reproduction functions, and specifically discloses the following contents: the terminal generates a shooting order according to the user's selection, and the shooting order includes a background image selected by the user. The intelligent shooting controller analyzes the background image selected by the user, determines the lighting parameters of the shooting control system, so that the lighting distribution of the shooting control system matches the lighting distribution of the scene where the background image is located, controls the corresponding lights of the shooting control system according to the lighting parameters, and the intelligent shooting controller controls the shooting equipment to shoot the subject.

[0004] The shooting of the above-mentioned intelligent shooting system is based on the user's selection on the terminal. Although the system can restore the image authenticity as much as possible, since the user is not a professional photographer and cannot fully understand the shooting background that is suitable for him, there may be a situation where the image restoration authenticity is high but it is not suitable for the user, resulting in user dissatisfaction with the finished product. Summary of the invention

[0005] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a background adaptive shooting method, device, system and storage medium, which can adapt the background image and light intensity to the user as much as possible while meeting the user's needs, thereby improving the user's satisfaction with the finished shot.

[0006] A first aspect of the present disclosure provides a background adaptive shooting method, the method is performed by a background adaptive shooting device, the background adaptive shooting device is respectively connected to a camera, a background switching device and a light adjustment device by signal, the method comprises:

[0007] In response to a shooting request, the shooting request includes a scene tag, controlling the camera to shoot an initial image of the target object under the original background image;

[0008] Performing grayscale processing on the initial image to obtain a grayscale image;

[0009] constructing a series of skin color area images based on the grayscale image and the preset gradual change data, and determining a target background image adapted to the target object according to the series of skin color area images and the scene label;

[0010] Controlling the background switching device to switch the original background image to the target background image;

[0011] Determine fill light data of a target object based on the grayscale image and the target background image;

[0012] Controlling the light adjustment device to adjust light parameters according to the fill light data;

[0013] The camera is controlled to capture the resulting image of the target object against the target background image and the adapted lighting.

[0014] Optionally, constructing a series of skin color area images based on the grayscale image and preset gradient data includes:

[0015] Inputting the grayscale image into a pre-trained skin color model to identify the skin color probability of each pixel in the grayscale image belonging to skin color and the non-skin color probability of each pixel belonging to non-skin color;

[0016] Acquire gradual change data, wherein the gradual change data includes a gradual change threshold initial value, a gradual change rule, and a gradual change coefficient;

[0017] Determine at least two gradual change thresholds according to the gradual change data;

[0018] Based on the skin color probability and non-skin color probability of each pixel in the grayscale image and each progressive threshold, a skin color area image corresponding to the progressive threshold is generated, and the skin color area images corresponding to at least two progressive thresholds constitute a series of skin color area images.

[0019] Optionally, generating a skin color region image corresponding to each progressive threshold value based on the skin color probability and non-skin color probability of each pixel point in the grayscale image and each progressive threshold value comprises:

[0020] The progressive value Y corresponding to each pixel is calculated according to the skin color probability and non-skin color probability of each pixel, where the progressive value Y is expressed as follows: Where P(S / F) is the probability of skin color, and P(-S / F) is the probability of non-skin color;

[0021] For each gradual change threshold, pixels whose gradual change values ​​are less than the gradual change threshold are extracted as skin color pixels, and a skin color area image corresponding to the gradual change threshold is generated according to the extracted skin color pixels.

[0022] Optionally, the series of skin color areas includes at least two skin color area images, and determining the target background image adapted to the target object according to the series of skin color area images and the scene label includes:

[0023] Determining a target skin color label of a target object according to a series of skin color area images and preset skin color label data;

[0024] The background images in the background image library are traversed, and the background image carrying the target skin color label and the scene label is used as the target background image.

[0025] Optionally, determining a target skin color label of the target object according to the series of skin color area images and preset skin color label data includes:

[0026] Selecting a skin color region image from the series of skin color region images as a target skin color region image;

[0027] Extracting overlapping pixel points between the grayscale image and the target skin color area image to generate an overlapping image;

[0028] Starting from the upper left corner of the overlapped image, traverse each pixel point in a forward direction, compare the gray value of each pixel point with the preset gray threshold, and calculate a first ratio of the number of pixel points in the overlapped image whose gray value exceeds the preset gray threshold to the total number of pixel points in the overlapped image;

[0029] Starting from the middle of the overlapped image, traverse each pixel point in a forward reverse direction and a backward forward direction, compare the gray value of each pixel point with a preset gray threshold, and calculate a second ratio of the number of pixels in the overlapped image whose gray value exceeds the preset gray threshold to the total number of pixels in the overlapped image;

[0030] Starting from the lower right corner of the overlapped image, traverse each pixel point, compare the gray value of each pixel point with the preset gray threshold, and calculate a third ratio of the number of pixels in the overlapped image whose gray value exceeds the preset gray threshold to the total number of pixels in the overlapped image;

[0031] The first ratio, the second ratio and the third ratio are matched with the preset skin color label data to determine the skin color labels corresponding to the first ratio, the second ratio and the third ratio respectively; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are the same, the skin color label is used as the target skin color label of the target object; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are not exactly the same, return to the step of selecting a skin color area image from the series of skin color area images as the target skin color area image until the target skin color label of the target object is determined.

[0032] Optionally, determining fill light data of the target object based on the grayscale image and the target background image includes:

[0033] Identify the illumination distribution of the scene where the target background image is located, and obtain the illumination parameters of the target background image;

[0034] According to the illumination parameters, a lighting effect matching the illumination distribution of the scene where the target background image is located is superimposed on the grayscale image to form a corrected grayscale image;

[0035] Traversing each pixel in the grayscale image and the corrected grayscale image, comparing the grayscale value of each pixel in the grayscale image with the grayscale value of the corresponding pixel in the corrected grayscale image, if the grayscale values ​​of any pixel in the grayscale image and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel are all lower than the grayscale value of the corresponding pixel in the corrected grayscale image, then the area consisting of the pixel and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel is determined as the fill light area;

[0036] Calculate the grayscale value difference between the grayscale value of each pixel in the fill light area in the grayscale image and the grayscale value of the corresponding pixel in the corrected grayscale image;

[0037] The intensity of the light to be filled in the area of ​​the target object that needs to be filled in is calculated according to the gray value difference, wherein the calculation expression is E=f*ΔG, where E represents the intensity of the light to be filled in, ΔG represents the gray value difference, and f represents the correlation coefficient between the intensity of the light to be filled in and the gray value difference, which is obtained through historical data;

[0038] Input the intensity of the light to be filled into the preset multi-objective optimization model, and output the adjustment parameters of each light. Optionally, the expression of the multi-objective optimization model is:

[0039] min[f1(x),f1(x),...,f1(x)]

[0040] Where: f1(x) represents the lighting adjustment measure;

[0041]

[0042] In the formula: x represents the light adjustment variable, lb and up represent the upper and lower limits of constraint x, Aeq*x=beq represents the linear constraint of variable x, and A*x≤b represents the linear inequality constraint of variable x.

[0043] A second aspect of the present disclosure provides a background adaptive shooting device, the device comprising:

[0044] A first shooting module is configured to respond to a shooting request, wherein the shooting request includes a scene tag, and control a camera to shoot an initial image of a target object under an original background image;

[0045] A grayscale processing module, configured to perform grayscale processing on the initial image to obtain a grayscale image;

[0046] A target background determination module is configured to construct a series of skin color area images based on the grayscale image and preset gradient data, and determine a target background image adapted to the target object according to the series of skin color area images and the scene label;

[0047] A background switching module, configured to control the background switching device to switch the original background image to the target background image;

[0048] A fill light data determination module, configured to determine fill light data of a target object based on the grayscale image and the target background image;

[0049] A light adjustment module, configured to control the light adjustment device to adjust light parameters according to the fill light data;

[0050] The second shooting module is configured to control the camera to shoot the resulting image of the target object under the target background image and the adapted lighting.

[0051] A third aspect of the present disclosure provides a background adaptive shooting system, the system comprising a camera, a background switching device, a light adjustment device and a background adaptive shooting device, the background adaptive shooting device being signal-connected to the camera, the background switching device and the light adjustment device respectively;

[0052] The background adaptive shooting device is configured as follows: in response to a shooting request, the shooting request includes a scene tag, controlling the camera to shoot an initial image of the target object under the original background image; graying the initial image to obtain a gray image; constructing a series of skin color area images based on the gray image and preset gradual change data, and determining a target background image adapted to the target object according to the series of skin color area images and the scene tag; controlling the background switching device to switch the original background image to the target background image; determining the fill light data of the target object based on the gray image and the target background image; controlling the light adjustment device to adjust the light parameters according to the fill light data; and controlling the camera to shoot the result image of the target object under the target background image and the adapted light.

[0053] The camera is configured to: in response to the control of the background adaptive shooting device, shoot an initial image of the target object under the original background image, and shoot a result image of the target object under the target background image and the adapted light;

[0054] The background switching device is configured to: in response to the control of the background adaptive shooting device, switch the original background image to the target background image;

[0055] The light adjustment device is configured to adjust the light parameters according to the fill light data in response to the control of the background adaptive shooting device.

[0056] A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium, in which computer instructions are stored. The computer instructions are suitable for loading by a processor to implement the background adaptive shooting method described in the first aspect above.

[0057] The implementation of the above scheme has the following beneficial effects:

[0058] The present invention first captures the user's initial image, analyzes the initial image to determine the user's skin color label, and then determines the target background image adapted to the user based on the skin color label and the scene label selected by the user, and then determines the fill light data based on the target background image and the user's initial image, and captures the user's image under the target background image and the adapted light by switching the background image and adjusting the lighting parameters of the shooting area. After the user selects the background label, the target background image determined based on the user's skin color and the background label is more compatible with the user's own situation, thereby improving the user's satisfaction with the finished product, and without the user having to select a suitable background image from hundreds of background images, the user experience and shooting efficiency can be improved.

[0059] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0061] Figure 1 is a schematic diagram of an application scenario of a background adaptive shooting system provided in an embodiment of the present application;

[0062] Figure 2 is a flow chart of a background adaptive shooting method provided by an embodiment of the present application;

[0063] Figure 3 is a structural block diagram of a background adaptive shooting device provided in an embodiment of the present application;

[0064] Figure 4 A schematic diagram of the structure of an electronic device provided for implementing an embodiment of the present application;

[0065] Figure 5A schematic diagram of the hardware structure of an electronic device provided for implementing an embodiment of the present application;

[0066] Figure 6 A hardware schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] 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 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 ordinary technicians in this field without creative work are within the scope of protection of this application.

[0068] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein.

[0069] It should be understood that "one embodiment" or "an embodiment" mentioned in the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.

[0070] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0071] The present application embodiment provides a background adaptive shooting system. Figure 1 1 is a schematic diagram of an application scenario of a background adaptive shooting system provided by an embodiment of the present invention. The background adaptive shooting system provided by an embodiment of the present invention includes a server 120, a terminal 130, and a shooting control system 110. The server 120 is a background management control server of the shooting control system. A background adaptive shooting device is provided in the server 120. The background adaptive shooting device interacts with the shooting control system 110 to implement control operations on the shooting control system 110. The shooting control system 110 includes a camera, a background switching device, a plurality of lights, and a light adjustment device.

[0072] Figure 1In the example, the user interacts with the background adaptive shooting device through the terminal 130. For example, the user makes an online reservation for shooting images through a mobile terminal, a tablet computer, etc. A typical application scenario is that the user accesses the background resources of the background adaptive shooting device through a terminal in a digital studio, selects scene tags, shooting time and other information, and generates a shooting order. Among them, the background image in the background resource can be a static image, a dynamic image, or a 3D image.

[0073] The background adaptive shooting device is used to manage the shooting control system 110, including the maintenance of the shooting control system 110, definition and configuration of product information for scheduled shooting, statistics and data analysis, etc.

[0074] The background adaptive shooting device responds to the shooting request sent by the terminal 130, controls the camera to shoot the initial image of the target object under the original background image; then grayscales the initial image to obtain a grayscale image; constructs a series of skin color area images based on the grayscale image and preset gradient data, and determines the target background image adapted to the target object according to the series of skin color area images and the scene label contained in the shooting request; then controls the background switching device to switch the original background image to the target background image; determines the fill light data of the target object based on the grayscale image and the target background image; then controls the light adjustment device to adjust the light parameters according to the fill light data; then controls the camera to shoot the result image of the target object under the target background image and the adapted light.

[0075] It should be noted that when shooting images of different scenes in the real world, in order to obtain good shooting effects, the subject often needs to spend a lot of energy and time on a series of activities such as making appointments for shooting, putting on makeup, traveling to shooting locations, and screening images, but the shooting effects are not necessarily ideal. In the shooting system provided by the embodiment of the present invention, the user can select a background tag before or during shooting, and the system automatically matches the background based on the user's skin color and outputs the image quickly. On the one hand, the degree of integration between the shooting object and the background image is high, which can improve the user's satisfaction with the finished product while ensuring that the user's needs are met. On the other hand, it is convenient for users to try different styles and find the background style, shooting posture, shooting angle, etc. that suits them with less time, energy and money, which can be used as preparation before real-scene shooting.

[0076] Figure 2 is a flowchart of a background adaptive shooting method provided in an embodiment of the present application. The method is executed by a background adaptive shooting device. Figure 2 , methods include:

[0077] S201 . In response to a shooting request including a scene tag, a camera is controlled to shoot an initial image of a target object under an original background image.

[0078] Among them, the shooting request can be issued by the user who is being photographed or the user who performs the shooting operation through the terminal. The shooting request should include a scene tag so as to frame the image that can be used as the background for shooting here in the existing background image. The scene tag is determined according to the image presented by the background image. Each background image is pre-labeled with a scene tag. The scene tag can be a hierarchical tag, including a parent node tag and multiple child node tags. The parent node tag represents the scene presented by the background image, such as an amusement park, outdoor rafting, tourist scenery, virtual fairy scene, etc. The child node tag represents at least the specific content in a background image, such as a carousel in an amusement park, a rapids in outdoor rafting, a dragon in a virtual fairy, etc. Before the user issues a shooting request, by selecting scene tags step by step, or by entering keywords and the system automatically matching scene tags, one or more background images that can be used for actual shooting can be quickly locked, without having to search in a large number of pictures, saving time and energy.

[0079] Furthermore, each background image is also labeled with a skin color label, which refers to the color and / or brightness of the skin color that best matches the background image. In a possible implementation, the scene label and skin color label of the background image can be identified and labeled by a trained label recognition model, or can be labeled manually, or the above two can be combined to achieve faster and more accurate identification.

[0080] After receiving the shooting request, the background adaptive shooting device will control the camera to shoot the initial image of the target object against the original background. The original background here can be a solid color background. In actual application, it can be a background curtain. The color of the curtain is preferably white, light gray, green, etc., so as to reduce the influence of the original background on the light and color of the target object.

[0081] S202: grayscale the initial image to obtain a grayscale image.

[0082] Grayscale processing is to convert each pixel in a color image from the original red, green and blue color channels into a single-channel image with only one grayscale value. That is, according to the sensitivity of the human eye to different colors, the values ​​of the three components R, G and B are weighted averaged according to different weights, and the result is used as the grayscale value of the pixel. The commonly used weight combinations are R: 0.3, G: 0.59, B: 0.11, which can simplify image data, reduce the amount of calculation, and facilitate image analysis and processing.

[0083] S203: construct a series of skin color region images based on the grayscale image and the preset gradual change data, and determine a target background image adapted to the target object according to the series of skin color region images and the scene label.

[0084] Constructing a series of skin color area images based on the grayscale image and the preset gradient data includes steps S2031 to S2034.

[0085] S2031: Inputting the grayscale image into a pre-trained skin color model to identify the skin color probability of each pixel in the grayscale image belonging to the skin color and the non-skin color probability of each pixel belonging to the non-skin color;

[0086] S2032: Acquire gradual change data, where the gradual change data includes a gradual change threshold initial value, a gradual change rule, and a gradual change coefficient;

[0087] S2033: Determine at least two gradual change thresholds according to the gradual change data;

[0088] S2034: Based on the skin color probability and non-skin color probability of each pixel in the grayscale image and each progressive threshold, generate skin color area images corresponding to the progressive threshold one by one, and the skin color area images corresponding to at least two progressive thresholds constitute a series of skin color area images.

[0089] Step S2034 specifically includes: calculating the progressive value Y corresponding to each pixel point according to the skin color probability and non-skin color probability of each pixel point, wherein the progressive value Y is expressed as follows: Wherein, P(S / F) is the skin color probability, and P(-S / F) is the non-skin color probability; for each progressive threshold, the pixels whose progressive values ​​are less than the progressive threshold are extracted as skin color pixels, and the skin color area image corresponding to the progressive threshold is generated according to the extracted skin color pixels; then, the skin color area images corresponding to all progressive thresholds are combined into a series of skin color area images.

[0090] As can be seen from the above, the series of skin color areas includes at least two skin color area images, and determining the target background image adapted to the target object according to the series of skin color area images and the scene label includes steps S2035 to S2036.

[0091] S2035: determining a target skin color label of the target object according to the series of skin color area images and preset skin color label data;

[0092] S2036: Traverse the background images in the background image library, and use the background image carrying the target skin color label and scene label as the target background image.

[0093] Among them, step S2035 specifically includes: extracting the overlapping pixels of the grayscale image and the target skin color area image to generate an overlapping image; starting from the upper left corner of the overlapping image, traversing each pixel point forward, comparing the grayscale value of each pixel point with the size of the preset grayscale threshold, and calculating the first ratio of the number of pixels in the overlapping image whose grayscale values ​​exceed the preset grayscale threshold to the total number of pixels in the overlapping image; starting from the middle of the overlapping image, traversing each pixel point forward, reversely and backward, comparing the grayscale value of each pixel point with the size of the preset grayscale threshold, and calculating the second ratio of the number of pixels in the overlapping image whose grayscale values ​​exceed the preset grayscale threshold to the total number of pixels in the overlapping image; starting from the lower right corner of the overlapping image, traversing each pixel point, and comparing the grayscale value of each pixel point and a preset grayscale threshold, and calculate a third ratio of the number of pixels in the overlapping image whose grayscale values ​​exceed the preset grayscale threshold to the total number of pixels in the overlapping image; match the first ratio, the second ratio and the third ratio with the preset skin color label data, and determine the skin color labels corresponding to the first ratio, the second ratio and the third ratio respectively; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are the same, then use the skin color label as the target skin color label of the target object; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are not exactly the same, then return to execute the step of selecting a skin color area image from the series of skin color area images as the target skin color area image until the target skin color label of the target object is determined.

[0094] S204: Control the background switching device to switch the original background image to the target background image.

[0095] After selecting the background image that matches the scene label and the skin color label, if there is only one background image, this background image will be used as the target background image, and the background adaptive shooting device will control the background switching device to switch the original background image to the target background image. If there are multiple background images, any one of them can be selected as the target background image. If the user is not satisfied with the final output result image, the terminal can issue a background switching instruction, and the background adaptive shooting device will give a background switching instruction to determine another background image from other background images that match the scene label and the skin color label as the target background image, and repeat steps S205 to S207 to output a new result image.

[0096] In one possible implementation, the original background image may be switched to the target background image by projecting the target background image onto a screen or a wall. In another possible implementation, there is a large display screen behind the target object, i.e., the person being photographed, and the background image is changed by switching the display content on the display screen.

[0097] S205 , determining fill light data of the target object based on the grayscale image and the target background image.

[0098] In a possible implementation, step S205 includes:

[0099] S2051: Identify the illumination distribution of the scene where the target background image is located, and obtain illumination parameters of the target background image;

[0100] S2052: superimposing a lighting effect matching the lighting distribution of the scene where the target background image is located on the grayscale image according to the lighting parameters to form a corrected grayscale image;

[0101] S2053: traverse each pixel in the grayscale image and the corrected grayscale image, compare the grayscale value of each pixel in the grayscale image with the grayscale value of the corresponding pixel in the corrected grayscale image, if the grayscale values ​​of any pixel in the grayscale image and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel are all lower than the grayscale value of the corresponding pixel in the corrected grayscale image, then the area consisting of the pixel and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel is determined as the fill light area;

[0102] S2054: Calculate the grayscale value difference between the grayscale value of each pixel in the fill light area in the grayscale image and the grayscale value of the corresponding pixel in the corrected grayscale image;

[0103] S2055: Calculating the light intensity of the target object in the area to be filled with light according to the gray value difference, wherein the calculation expression is E=f*ΔG, where E represents the light intensity of the target object, ΔG represents the gray value difference, and f represents the correlation coefficient between the light intensity of the target object and the gray value difference, which is obtained through historical data;

[0104] Input the intensity of the light to be filled into the preset multi-objective optimization model, and output the adjustment parameters of each light. The expression of the multi-objective optimization model is:

[0105] min[f1(x),f1(x),...,f1(x)];

[0106] Where: f1(x) represents the lighting adjustment measure;

[0107]

[0108] In the formula: x represents the light adjustment variable, lb and up represent the upper and lower limits of constraint x, Aeq*x=beq represents the linear constraint of variable x, and A*x≤b represents the linear inequality constraint of variable x.

[0109] When constructing the initial multi-objective optimization model, data of various lighting adjustment measures under the same lighting intensity are collected as a data set, and the data of various lighting adjustment measures in the data set are input into the initial multi-objective optimization model for training until convergence to obtain a multi-objective optimization model.

[0110] S206: Control the light adjustment device to adjust light parameters according to the fill light data.

[0111] The fill light data may include any one or more of the lighting angle, color and light intensity of the light. By adjusting the lighting parameters, the light and color fusion degree of the target object's skin color and the background image can be improved.

[0112] S207, controlling the camera to shoot a result image of the target object under the target background image and the adapted light.

[0113] The present invention first captures the user's initial image, analyzes the initial image to determine the user's skin color label, and then determines the target background image adapted to the user based on the skin color label and the scene label selected by the user, and then determines the fill light data based on the target background image and the user's initial image, and captures the user's image under the target background image and the adapted light by switching the background image and adjusting the lighting parameters of the shooting area. After the user selects the background label, the target background image determined based on the user's skin color and the background label is more compatible with the user's own situation, thereby improving the user's satisfaction with the finished product, and without the user having to select a suitable background image from hundreds of background images, the user experience and shooting efficiency can be improved.

[0114] This embodiment also provides a background adaptive shooting device, see Figure 3 The device includes a first shooting module 111, a grayscale processing module 112, a target background determination module 113, a background switching module 114, a fill light data determination module 115, a light adjustment module 116 and a second shooting module 117.

[0115] The first shooting module 111 is configured to respond to a shooting request including a scene tag and control a camera to shoot an initial image of a target object under an original background image.

[0116] The grayscale processing module 112 is configured to perform grayscale processing on the initial image to obtain a grayscale image.

[0117] The target background determination module 113 is configured to construct a series of skin color area images based on the grayscale image and the preset gradual change data, and determine the target background image adapted to the target object according to the series of skin color area images and the scene label.

[0118] The background switching module 114 is configured to control the background switching device to switch the original background image to the target background image.

[0119] The fill light data determination module 115 is configured to determine the fill light data of the target object based on the grayscale image and the target background image.

[0120] The light adjustment module 116 is configured to control the light adjustment device to adjust the light parameters according to the fill light data.

[0121] The second shooting module 117 is configured to control the camera to shoot the result image of the target object under the target background image and the adapted light.

[0122] In a possible implementation, the target background determination module 113 further includes a probability determination unit, a gradual change data acquisition unit, a gradual change threshold determination unit, and a skin color area image determination unit.

[0123] The probability determination unit is configured to: input the grayscale image into a pre-trained skin color model, and identify the skin color probability of each pixel point in the grayscale image belonging to the skin color and the non-skin color probability of each pixel point belonging to the non-skin color.

[0124] The gradual change data acquisition unit is configured to: acquire gradual change data, where the gradual change data includes a gradual change threshold initial value, a gradual change rule, and a gradual change coefficient.

[0125] The gradual change threshold determination unit is configured to determine at least two gradual change thresholds according to the gradual change data.

[0126] The skin color area image determination unit is configured to generate a skin color area image corresponding to the progressive threshold one by one based on the skin color probability and non-skin color probability of each pixel point in the grayscale image and each progressive threshold, and the skin color area images corresponding to at least two progressive thresholds constitute a series of skin color area images.

[0127] In a possible implementation, the skin color area image determination unit is configured to calculate the progressive value Y corresponding to each pixel point according to the skin color probability and non-skin color probability of each pixel point, wherein the progressive value Y is expressed as: Wherein, P(S / F) is the skin color probability, and P(-S / F) is the non-skin color probability. For each gradual change threshold, the pixels whose gradual change values ​​are less than the gradual change threshold are extracted as skin color pixels, and the skin color area image corresponding to the gradual change threshold is generated according to the extracted skin color pixels.

[0128] The series of skin color regions includes at least two skin color region images, and the target background determination module 113 includes a target skin color label determination unit and a target background image determination unit.

[0129] The target skin color label determination unit is configured to determine the target skin color label of the target object according to the series of skin color area images and preset skin color label data.

[0130] The target background image determination unit is configured to: traverse the background images in the background image library, and use the background image carrying the target skin color label and the scene label as the target background image.

[0131] Among them, the target skin color label determination unit is configured as follows: select a skin color area image from a series of skin color area images as the target skin color area image; extract the overlapping pixels of the grayscale image and the target skin color area image to generate an overlapping image; start from the upper left corner of the overlapping image to traverse each pixel point forward, compare the grayscale value of each pixel point with the preset grayscale threshold, and calculate the first ratio of the number of pixels in the overlapping image whose grayscale value exceeds the preset grayscale threshold to the total number of pixels in the overlapping image; start from the middle of the overlapping image to traverse each pixel point forward, backward and forward, compare the grayscale value of each pixel point with the preset grayscale threshold, and calculate the second ratio of the number of pixels in the overlapping image whose grayscale value exceeds the preset grayscale threshold to the total number of pixels in the overlapping image; start from the lower right corner of the overlapping image to traverse each pixel point a pixel point, compare the gray value of each pixel point with the preset gray value threshold, and calculate the third ratio of the number of pixels in the overlapping image whose gray value exceeds the preset gray value threshold to the total number of pixels in the overlapping image; match the first ratio, the second ratio and the third ratio with the preset skin color label data, and determine the skin color labels corresponding to the first ratio, the second ratio and the third ratio respectively; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are the same, then use the skin color label as the target skin color label of the target object; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are not exactly the same, then return to execute the step of selecting a skin color area image from the series of skin color area images as the target skin color area image until the target skin color label of the target object is determined.

[0132] In a possible implementation, the fill light data determination module 115 includes a lighting parameter determination unit, a corrected grayscale image acquisition unit, a fill light area determination unit, a difference determination unit, a light intensity determination unit, and an adjustment parameter determination unit.

[0133] The illumination parameter determination unit is configured to: identify the illumination distribution of the scene where the target background image is located, and obtain the illumination parameters of the target background image.

[0134] The corrected grayscale image acquisition unit is configured to: superimpose a lighting effect matching the lighting distribution of the scene where the target background image is located on the grayscale image according to the lighting parameters to form a corrected grayscale image.

[0135] The fill light area determination unit is configured to: traverse each pixel in the grayscale image and the corrected grayscale image, compare the grayscale value of each pixel in the grayscale image with the grayscale value of the corresponding pixel in the corrected grayscale image, if the grayscale values ​​of any pixel in the grayscale image and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel are all lower than the grayscale value of the corresponding pixel in the corrected grayscale image, then the area composed of the pixel and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel is determined as the fill light area.

[0136] The difference determination unit is configured to calculate the grayscale value difference between the grayscale value of each pixel point in the fill light area in the grayscale image and the grayscale value of the corresponding pixel point in the corrected grayscale image.

[0137] The light intensity determination unit is configured as follows: the light intensity to be filled in the area of ​​the target object to be filled in is calculated according to the gray value difference, wherein the calculation expression is E=f*ΔG, wherein E represents the light intensity to be filled in, ΔG represents the gray value difference, and f represents the correlation coefficient between the light intensity to be filled in and the gray value difference, which is obtained through historical data.

[0138] The expression of the multi-objective optimization model is:

[0139] min[f1(x),f1(x),...,f1(x)];

[0140] Where: f1(x) represents the lighting adjustment measure;

[0141]

[0142] In the formula: x represents the light adjustment variable, lb and up represent the upper and lower limits of constraint x, Aeq*x=beq represents the linear constraint of variable x, and A*x≤b represents the linear inequality constraint of variable x.

[0143] The adjustment parameter determination unit is configured to: input the intensity of the light to be filled into a preset multi-objective optimization model, and output the adjustment parameters of each light.

[0144] The present disclosure also provides a background adaptive shooting system. Figure 4 The system includes a camera 420, a background switching device 430, a light adjustment device 440 and a background adaptive shooting device 410, and the background adaptive shooting device 410 is respectively connected to the camera 420, the background switching device 430 and the light adjustment device signal 440.

[0145] The background adaptive shooting device 410 is configured as follows: in response to a shooting request, the shooting request includes a scene label, controlling the camera to shoot an initial image of the target object under the original background image; graying the initial image to obtain a grayscale image; constructing a series of skin color area images based on the grayscale image and preset gradient data, and determining a target background image adapted to the target object according to the series of skin color area images and the scene label; controlling the background switching device to switch the original background image to the target background image; determining the fill light data of the target object based on the grayscale image and the target background image; controlling the light adjustment device to adjust the light parameters according to the fill light data; and controlling the camera to shoot the target object under the target background image and the resulting image under the adapted light.

[0146] The camera 420 is configured to: in response to the control of the background adaptive shooting device, shoot an initial image of the target object under the original background image, and shoot a result image of the target object under the target background image and the adapted lighting.

[0147] The background switching device 430 is configured to switch the original background image to the target background image in response to the control of the background adaptive shooting device.

[0148] The light adjustment device 440 is configured to adjust the light parameters according to the fill light data in response to the control of the background adaptive shooting device.

[0149] The specific structure of the background adaptive shooting device 410 can be found in the aforementioned embodiment and will not be described in detail here.

[0150] The photographing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0151] The shooting device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0152] The shooting device provided in the embodiment of the present application can implement each process implemented by the shooting device in each method embodiment, and will not be described again here to avoid repetition.

[0153] Optional, such as Figure 5 As shown, an embodiment of the present application also provides an electronic device, including a memory 501, a processor 502, and a program or instruction stored in the memory 501 and executable on the processor 502. When the program or instruction is executed by the processor 502, each process of the above-mentioned background adaptive shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0154] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0155] Figure 6 A hardware schematic diagram of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610 and other components.

[0156] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0157] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (Graphics Processing Unit, GPU) 6041 and a microphone 6042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0158] In the embodiment of the present application, the radio frequency unit 601 obtains information and then sends it to the processor 610 for processing. Generally, the radio frequency unit 601 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.

[0159] The memory 609 can be used to store software programs or instructions and various data. The memory 609 can mainly include a program or instruction storage area and a data storage area, wherein the program or instruction storage area can store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 can include a high-speed random access memory, and can also include a non-volatile memory, wherein the non-volatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. For example, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0160] The processor 610 may include one or more processing units; optionally, the processor 610 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs or instructions, etc., and the modem processor mainly processes wireless communications, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.

[0161] The processor 610 is used to: in response to a shooting request including a scene tag, control the camera to shoot an initial image of the target object under the original background image.

[0162] Optionally, the processor 610 is used to: perform grayscale processing on the initial image to obtain a grayscale image.

[0163] Optionally, the processor 610 is used to: construct a series of skin color area images based on the grayscale image and preset gradient data, and determine a target background image adapted to the target object according to the series of skin color area images and the scene label.

[0164] Optionally, the processor 610 is used to: control the background switching device to switch the original background image to the target background image.

[0165] Optionally, the processor 610 is configured to determine fill light data of the target object based on the grayscale image and the target background image.

[0166] Optionally, the processor 610 is used to: control the light adjustment device to adjust the light parameters according to the fill light data; and control the camera to capture the result image of the target object under the target background image and the adapted light.

[0167] The electronic device provided in the embodiment of the present application first captures the initial image of the user, analyzes the initial image to determine the user's skin color label, and then determines the target background image adapted to the user based on the skin color label and the scene label selected by the user, and then determines the fill light data based on the target background image and the initial image of the user, and captures the image of the user under the target background image and the adapted light by switching the background image and adjusting the lighting parameters of the shooting area. After the user selects the background label, the target background image determined based on the user's skin color and the background label is more compatible with the user's own situation, which improves the user's satisfaction with the finished product, and does not require the user to select a suitable background image from hundreds of background images, which can improve the user experience and shooting efficiency.

[0168] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0169] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0170] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned shooting method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0171] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0172] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0174] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A background adaptive shooting method, characterized in that: The method is performed by a background adaptive shooting device, which is respectively connected to the camera, the background switching device and the light adjustment device by signals, and the method includes: In response to a shooting request, the shooting request includes a scene tag, controlling the camera to shoot an initial image of the target object under the original background image; Performing grayscale processing on the initial image to obtain a grayscale image; constructing a series of skin color area images based on the grayscale image and the preset gradual change data, and determining a target background image adapted to the target object according to the series of skin color area images and the scene label; Controlling the background switching device to switch the original background image to the target background image; Determine fill light data of a target object based on the grayscale image and the target background image; Controlling the light adjustment device to adjust light parameters according to the fill light data; Control the camera to capture the target object against the target background image and the resulting image under the adapted lighting; Wherein, constructing a series of skin color area images based on the grayscale image and preset gradual change data includes: Inputting the grayscale image into a pre-trained skin color model to identify the skin color probability of each pixel in the grayscale image belonging to skin color and the non-skin color probability of each pixel belonging to non-skin color; Acquire gradual change data, wherein the gradual change data includes a gradual change threshold initial value, a gradual change rule, and a gradual change coefficient; Determine at least two gradual change thresholds according to the gradual change data; Based on the skin color probability and non-skin color probability of each pixel in the grayscale image and each gradual change threshold, a skin color region image corresponding to the gradual change threshold is generated, and the skin color region images corresponding to at least two gradual change thresholds constitute a series of skin color region images, including: The progressive value Y corresponding to each pixel is calculated according to the skin color probability and non-skin color probability of each pixel, where the progressive value Y is expressed as follows: Where P(S / F) is the probability of skin color, and P(-S / F) is the probability of non-skin color; For each gradual change threshold, pixels whose gradual change values ​​are less than the gradual change threshold are extracted as skin color pixels, and a skin color area image corresponding to the gradual change threshold is generated according to the extracted skin color pixels.

2. The method according to claim 1, characterized in that The series of skin color areas includes at least two skin color area images, and determining a target background image adapted to the target object according to the series of skin color area images and the scene label includes: Determining a target skin color label of a target object according to a series of skin color area images and preset skin color label data; The background images in the background image library are traversed, and the background image carrying the target skin color label and the scene label is used as the target background image.

3. The method according to claim 2, characterized in that Determining the target skin color label of the target object according to the series of skin color area images and the preset skin color label data includes: Selecting a skin color region image from the series of skin color region images as a target skin color region image; Extracting overlapping pixel points between the grayscale image and the target skin color area image to generate an overlapping image; Starting from the upper left corner of the overlapped image, traverse each pixel point in a forward direction, compare the gray value of each pixel point with the preset gray threshold, and calculate a first ratio of the number of pixel points in the overlapped image whose gray value exceeds the preset gray threshold to the total number of pixel points in the overlapped image; Starting from the middle of the overlapped image, traverse each pixel point in a forward reverse direction and a backward forward direction, compare the gray value of each pixel point with a preset gray threshold, and calculate a second ratio of the number of pixels in the overlapped image whose gray value exceeds the preset gray threshold to the total number of pixels in the overlapped image; Starting from the lower right corner of the overlapped image, traverse each pixel point, compare the gray value of each pixel point with the preset gray threshold, and calculate a third ratio of the number of pixels in the overlapped image whose gray value exceeds the preset gray threshold to the total number of pixels in the overlapped image; The first ratio, the second ratio and the third ratio are matched with the preset skin color label data to determine the skin color labels corresponding to the first ratio, the second ratio and the third ratio respectively; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are the same, the skin color label is used as the target skin color label of the target object; if the skin color label of the first ratio, the skin color label of the second ratio and the skin color label of the third ratio are not exactly the same, return to the step of selecting a skin color area image from the series of skin color area images as the target skin color area image until the target skin color label of the target object is determined.

4. The method according to claim 1, characterized in that: The step of determining fill light data of the target object based on the grayscale image and the target background image comprises: Identify the illumination distribution of the scene where the target background image is located, and obtain the illumination parameters of the target background image; According to the illumination parameters, a lighting effect matching the illumination distribution of the scene where the target background image is located is superimposed on the grayscale image to form a corrected grayscale image; Traversing each pixel in the grayscale image and the corrected grayscale image, comparing the grayscale value of each pixel in the grayscale image with the grayscale value of the corresponding pixel in the corrected grayscale image, if the grayscale values ​​of any pixel in the grayscale image and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel are all lower than the grayscale value of the corresponding pixel in the corrected grayscale image, then the area consisting of the pixel and its adjacent upper left adjacent pixel, upper adjacent pixel, upper right adjacent pixel, lower left adjacent pixel, lower adjacent pixel and lower right adjacent pixel is determined as the fill light area; Calculate the grayscale value difference between the grayscale value of each pixel in the fill light area in the grayscale image and the grayscale value of the corresponding pixel in the corrected grayscale image; The intensity of the light to be filled in the area of ​​the target object that needs to be filled in is calculated according to the gray value difference, wherein the calculation expression is E=f*ΔG, where E represents the intensity of the light to be filled in, ΔG represents the gray value difference, and f represents the correlation coefficient between the intensity of the light to be filled in and the gray value difference, which is obtained through historical data; The intensity of the light to be filled is input into the preset multi-objective optimization model, and the adjustment parameters of each light are output.

5. The method according to claim 4, characterized in that The expression of the multi-objective optimization model is: min[f1(x),f1(x),...,f1(x)]; Where: f1(x) represents the lighting adjustment measure; In the formula: x represents the light adjustment variable, lb and up represent the upper and lower limits of constraint x, Aeq*x=beq represents the linear constraint of variable x, and A*x≤b represents the linear inequality constraint of variable x.

6. A background adaptive shooting device, characterized in that: The background adaptive shooting device is respectively connected to the camera, the background switching device and the light adjustment device by signals, and includes: A first shooting module is configured to respond to a shooting request, wherein the shooting request includes a scene tag, and control a camera to shoot an initial image of a target object under an original background image; A grayscale processing module, configured to perform grayscale processing on the initial image to obtain a grayscale image; A target background determination module is configured to construct a series of skin color area images based on the grayscale image and preset gradient data, and determine a target background image adapted to the target object according to the series of skin color area images and the scene label; A background switching module, configured to control the background switching device to switch the original background image to the target background image; A fill light data determination module, configured to determine fill light data of a target object based on the grayscale image and the target background image; A light adjustment module, configured to control the light adjustment device to adjust light parameters according to the fill light data; A second shooting module is configured to control the camera to shoot a result image of the target object under the target background image and the adapted light; Wherein, the target background determination module also includes: a probability determination unit configured to input the grayscale image into a pre-trained skin color model, and identify the skin color probability of each pixel in the grayscale image belonging to the skin color and the non-skin color probability of each pixel belonging to the non-skin color; A gradual change data acquisition unit, configured to acquire gradual change data, the gradual change data including a gradual change threshold initial value, a gradual change rule and a gradual change coefficient; a gradual change threshold determination unit, configured to determine at least two gradual change thresholds according to the gradual change data; The skin color area image determination unit is configured to generate a skin color area image corresponding to a gradual change threshold value based on the skin color probability and non-skin color probability of each pixel point in the grayscale image and each gradual change threshold value, and the skin color area images corresponding to at least two gradual change threshold values ​​constitute a series of skin color area images; wherein, the skin color area images corresponding to the gradual change threshold value and the skin color probability and non-skin color probability of each pixel point in the grayscale image are generated one by one. The skin color area images corresponding to the gradual change threshold value and the skin color probability and non-skin color probability of each pixel point in the grayscale image constitute a series of skin color area images, including: calculating a gradual change value Y corresponding to each pixel point according to the skin color probability and non-skin color probability of each pixel point, wherein the expression of the gradual change value Y is: Wherein, P(S / F) is the skin color probability, and P(-S / F) is the non-skin color probability. For each gradual change threshold, the pixels whose gradual change values ​​are less than the gradual change threshold are extracted as skin color pixels, and the skin color area image corresponding to the gradual change threshold is generated according to the extracted skin color pixels.

7. A background adaptive shooting system, characterized in that: The system includes a camera, a background switching device, a light adjustment device and a background adaptive shooting device, wherein the background adaptive shooting device is respectively connected to the camera, the background switching device and the light adjustment device by signals; The background adaptive shooting device is configured to: in response to a shooting request, the shooting request including a scene tag, control a camera to shoot an initial image of a target object under an original background image; The initial image is grayed to obtain a grayscale image; a series of skin color area images are constructed based on the grayscale image and preset gradient data, and a target background image adapted to the target object is determined based on the series of skin color area images and the scene label; the background switching device is controlled to switch the original background image to the target background image; the fill light data of the target object is determined based on the grayscale image and the target background image; the light adjustment device is controlled to adjust the light parameters according to the fill light data; the camera is controlled to capture the result image of the target object under the target background image and the adapted light; wherein, the construction of the series of skin color area images based on the grayscale image and the preset gradient data includes: inputting the grayscale image into a pre-trained skin color model, identifying the skin color probability of each pixel in the grayscale image belonging to skin color and the probability of belonging to non-skin color. The non-skin color probability of skin color; obtaining gradual change data, the gradual change data including the gradual change threshold initial value, the gradual change rule and the gradual change coefficient; determining at least two gradual change thresholds according to the gradual change data; based on the skin color probability and the non-skin color probability of each pixel point in the grayscale image and each gradual change threshold, generating a skin color area image corresponding to the gradual change threshold one by one, and the skin color area images corresponding to at least two gradual change thresholds constitute a series of skin color area images; wherein, based on the skin color probability and the non-skin color probability of each pixel point in the grayscale image and each gradual change threshold, generating a skin color area image corresponding to the gradual change threshold one by one, and the skin color area images corresponding to at least two gradual change thresholds constitute a series of skin color area images, comprises: calculating the gradual change value Y corresponding to each pixel point according to the skin color probability and the non-skin color probability of each pixel point, wherein the expression of the gradual change value Y is Wherein, P(S / F) is the skin color probability, and P(-S / F) is the non-skin color probability; for each gradual change threshold, the pixels whose gradual change value is less than the gradual change threshold are extracted as skin color pixels, and the skin color area image corresponding to the gradual change threshold is generated according to the extracted skin color pixels; The camera is configured to: in response to the control of the background adaptive shooting device, shoot an initial image of the target object under the original background image, and shoot a result image of the target object under the target background image and the adapted light; The background switching device is configured to: in response to the control of the background adaptive shooting device, switch the original background image to the target background image; The light adjustment device is configured to adjust the light parameters according to the fill light data in response to the control of the background adaptive shooting device.

8. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are suitable for being loaded by a processor to implement the background adaptive shooting method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Intelligent photographing system and method with illumination recognition and reproduction function

    CN109618088A

  • Image shooting method and apparatus, storage medium, and electronic device

    CN108200334A

  • Light distribution method and system for portrait in image, medium and electronic equipment

    CN111583155A