A lighting control method and device for AR photography
By calculating the brightness difference between the background image and the reference image of the character and adjusting the voltage of the adjustable lamp according to these differences, the problem that existing AR photography devices cannot intelligently modify real characters is solved, and a more realistic AR fusion image is achieved.
Patent Information
- Application Number
- CN202111518105.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-13
AI Technical Summary
When taking photos, existing AR photography devices cannot intelligently modify real characters based on the lighting and color environment of the virtual scene, resulting in the fusion image of the target portrait and the background being visually unreal or inconsistent.
By obtaining the brightness average of each partition in the background picture and the brightness average of the character reference image, calculating the brightness difference, and determining the required voltage to turn on the adjustable lights, in response to the photo area displayed in the background picture, an AR fusion image is obtained.
It realizes the modification of real characters based on the lighting and color environment of the background image in the virtual scene, thereby obtaining a more realistic fusion image, improving the control accuracy and authenticity of the fusion image.
Smart Images

Figure CN114567729B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photography, and in particular to a lighting control method and device for AR photography. Background Art
[0002] With the development of VR (Virtual Reality) technology and AR (Augmented Reality) technology, virtual photography systems can meet people's various experiences and integrate the captured portraits with the desired background. The problem that some scenes, objects, and people that people want to capture cannot be reproduced due to limitations of time, space, and other factors can be solved with the help of virtual photography technology systems.
[0003] This technology can utilize various sensors and combine digital image processing technology to achieve the replacement and fusion of the target portrait with any background, thus realizing the virtual photo-taking function.
[0004] However, since AR camera equipment is usually placed in different application locations, the lighting environment in different locations will also be different; when taking pictures, existing AR devices do not intelligently modify real people according to the lighting and color environment of the virtual scene, resulting in the generated fusion image of the target portrait and the background being visually unreal or inconsistent. Summary of the invention
[0005] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art and propose a lighting control method for AR photography, which can modify real people according to the lighting and color environment of the background picture in the virtual scene, so as to obtain a more realistic fusion image.
[0006] The present invention adopts the following technical solution:
[0007] A lighting control method for AR photography, comprising:
[0008] Get the average brightness of each partition in the photo area of the background image;
[0009] In response to a photographing area where a person is displayed in a background image, photographing a person reference reference to obtain a person reference image, and obtaining a brightness average of each subarea of the person reference image corresponding to the photographing area in the background image;
[0010] Calculate the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the character reference image corresponding to the brightness of each partition of the photographing area in the background image;
[0011] According to the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the voltage of the adjustable lamp in each partition required for the brightness difference of each partition is determined;
[0012] The adjustable lights of each partition are turned on according to the voltage of the adjustable lights of each partition, in response to the photo-taking area where the person is displayed in the background picture; and an AR fusion image is obtained.
[0013] Specifically, it also includes:
[0014] Get all the colors of the background image, use K-means to find N cluster centers as N colors, and determine the category of the N colors based on the distance between the pixel and the cluster center, where N is a positive integer;
[0015] According to the determined N colors, a color histogram of the background image is obtained to obtain the color with the highest frequency of occurrence;
[0016] The color temperature of the adjustable lamp is determined based on the color that occurs most frequently.
[0017] Specifically, the color temperature of the adjustable lamp is determined according to the color with the highest occurrence frequency, and the color temperature of the adjustable lamp is specifically: 3000K, 4500K and 6500K.
[0018] Specifically, the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, wherein the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained as follows:
[0019] Obtaining the corresponding relationship between the voltage of the adjustable lamp in each partition and the light intensity data obtained in each partition;
[0020] Obtaining the corresponding relationship between the light intensity data of each partition and the brightness of each partition in the image;
[0021] The corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained.
[0022] Another aspect of the present invention provides a lighting control device for AR photography, including:
[0023] Background image brightness acquisition unit: acquires the average brightness of each partition of the photographing area in the background image;
[0024] A reference image brightness acquisition unit: in response to a photographing area where a person is displayed in a background image, photographing a person reference, obtaining a person reference image, and acquiring a brightness average of each partition of the person reference image corresponding to the photographing area in the background image;
[0025] A brightness difference calculation unit: calculating brightness differences of each partition of the photographing area in the background image and brightness differences of each partition of the character reference image corresponding to the brightness mean of each partition of the photographing area in the background image;
[0026] Adjustable equal voltage acquisition unit: determines the voltage of each partition's adjustable lamp required for the brightness difference of each partition according to the corresponding relationship between the voltage of each partition's adjustable lamp and the brightness value of each partition of the picture;
[0027] The AR fusion image acquisition unit turns on the adjustable lights of each partition according to the voltage of the adjustable lights of each partition, and responds to the photo-taking area where the person is displayed in the background image; and obtains the AR fusion image.
[0028] Specifically, it also includes: a color temperature adjustment unit, specifically:
[0029] Get all the colors of the background image, use K-means to find N cluster centers as N colors, and determine the category of the N colors based on the distance between the pixel and the cluster center, where N is a positive integer;
[0030] According to the determined N colors, a color histogram of the background image is obtained to obtain the color with the highest frequency of occurrence;
[0031] The color temperature of the adjustable lamp is determined based on the color that occurs most frequently.
[0032] Specifically, in the color temperature adjustment unit, the color temperature of the adjustable lamp is determined according to the color with the highest occurrence frequency, wherein the color temperature of the adjustable lamp is specifically: 3000K, 4500K and 6500K.
[0033] Specifically, in the adjustable voltage acquisition unit, according to the correspondence between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the correspondence between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained as follows:
[0034] Obtaining the corresponding relationship between the voltage of the adjustable lamp in each partition and the light intensity data obtained in each partition;
[0035] Obtaining the corresponding relationship between the light intensity data of each partition and the brightness of each partition in the image;
[0036] The corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained.
[0037] On the other hand, an embodiment of the present invention provides an electronic device for controlling lighting for AR photography, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method steps for controlling lighting for AR photography when executing the computer program.
[0038] Another aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of the light control for AR photography described above are implemented.
[0039] It can be seen from the above description of the present invention that, compared with the prior art, the present invention has the following beneficial effects:
[0040] (1) The present invention provides a lighting control method for AR photography, which obtains the average brightness of each partition of a photography area in a background image; in response to a person being displayed in the photography area in the background image, shoots a person reference reference to obtain a person reference image, and obtains the average brightness of each partition of the photography area in the background image corresponding to the person reference image; calculates the brightness difference of each partition between the average brightness of each partition of the photography area in the background image and the average brightness of each partition of the photography area in the background image corresponding to the person reference image; determines the voltage of each partition of the adjustable lamp required for the brightness difference of each partition according to the corresponding relationship between the voltage of each partition of the adjustable lamp and the brightness value of each partition of the image; turns on each partition of the adjustable lamp according to the voltage of each partition, in response to a person being displayed in the photography area in the background image; obtains an AR fusion image; The method provided by the present invention can modify real people according to the lighting and color environment of the background image in the virtual scene, thereby obtaining a more realistic fusion image.
[0041] (2) In the method provided by the present invention, the photo taking area in the virtual scene background image is divided into zones, and zone dimming and the like are set to control the color and lighting of the zones, thereby improving the control accuracy.
[0042] (3) In the method provided by the present invention, the photo-taking area and partitions in the virtual scene background image are exactly the same as the actual photo-taking area and partitions of the person, which simplifies the control of the adjustable light. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flow chart of a lighting control method for AR photography provided by an embodiment of the present invention;
[0044] Figure 2 A background image of a virtual scene provided by an embodiment of the present invention;
[0045] Figure 3 A character map including partitions provided by an embodiment of the present invention;
[0046] FIG4 is a figure diagram before and after light control according to an embodiment of the present invention, wherein (a) is a figure diagram before light control, and (b) is a figure diagram after light control;
[0047] Figure 5 The AR fusion diagram provided by the embodiment of the present invention;
[0048] Figure 6 A structural diagram of a lighting control device for AR photography provided by an embodiment of the present invention;
[0049] Figure 7A schematic diagram of an electronic device according to an embodiment of the present invention;
[0050] Figure 8 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0052] The present invention provides a lighting control method for AR photography, which can modify a real person according to the lighting and color environment of a background picture in a virtual scene, thereby obtaining a more realistic fusion picture.
[0053] like Figure 1 A flow chart of a lighting control method for AR photography provided by the present invention specifically includes:
[0054] A lighting control method for AR photography, comprising:
[0055] S101: Obtaining the average brightness of each partition of the photographing area in the background image;
[0056] like Figure 2 The background picture in the virtual scene of the present invention is a landscape picture of Gulangyu Island. Area A shown in the figure is a photo area. The embodiment of the present invention divides the photo area A into 6 areas. In fact, the number of areas can also be set according to the required accuracy.
[0057] First, obtain the YUV brightness values in the 1st to 6th partitions of the photographing area in the background image, and calculate the average brightness corresponding to each partition. YUV is a color encoding method.
[0058] S102: In response to a photographing area where a person is displayed in a background image, photograph a person reference image to obtain a person reference image, and obtain brightness averages of the person reference image corresponding to each subarea of the photographing area in the background image;
[0059] The distance between the character and the AR interactive camera device, when the character is displayed in the camera area of the background image, the camera starts to shoot the character according to the camera trigger mechanism; Figure 3 shown.
[0060] It is worth noting that the photo-taking area and partitions in the virtual scene background image are exactly the same as the actual photo-taking area and partitions of the character at a 1:1 ratio, and a character reference image is obtained; the YUV brightness value of the character reference image is also obtained, and the brightness mean corresponding to each partition is calculated.
[0061] S103: Calculating the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the character reference image corresponding to the brightness of each partition of the photographing area in the background image;
[0062] Calculate the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the person reference image corresponding to the photographing area in the background image, and determine the control of the adjustable light of each partition according to the brightness difference;
[0063] S104: Determine the voltage of the adjustable lamp in each partition required for the brightness difference of each partition according to the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture;
[0064] Specifically, the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, wherein the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained as follows:
[0065] Obtaining the corresponding relationship between the voltage of the adjustable lamp in each partition and the light intensity data obtained in each partition;
[0066] Obtaining the corresponding relationship between the light intensity data of each partition and the brightness of each partition in the image;
[0067] The corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained.
[0068] Each partition corresponds to an adjustable lamp to control the lighting and color of the partition. The adjustable lamp has different voltage levels and produces different light intensities. The photo area in the virtual scene background picture is partitioned, and the partition dimming is set to control the color and lighting of the partition to improve control accuracy.
[0069] The light intensity and brightness are in a corresponding relationship. The greater the light intensity, the greater the brightness. Brightness is proportional to intensity; specifically, L = R × E, where L is brightness, R is reflection coefficient, and E is light intensity.
[0070] S105: Turn on the adjustable lights of each partition according to the voltage of the adjustable lights of each partition, in response to the photo-taking area where the person is displayed in the background picture; and obtain an AR fusion image.
[0071] FIG4 is a diagram of a person before and after the adjustable light control, wherein FIG4 (a) is a diagram of a person before the adjustable light control, and FIG4 (b) is a diagram of a person after the adjustable light control.
[0072] like Figure 5 This is the final AR fusion image.
[0073] In addition, the embodiment of the present invention further includes: obtaining all colors of the background image, using K-means to find N cluster centers as N colors, and determining the category belonging to the N colors according to the distance between the pixel point and the cluster center, where N is a positive integer;
[0074] According to the determined N colors, a color histogram of the background image is obtained to obtain the color with the highest frequency of occurrence;
[0075] The color temperature of the adjustable lamp is determined based on the color that occurs most frequently.
[0076] Specifically, the color temperature of the adjustable lamp is determined according to the color with the highest occurrence frequency, and the color temperature of the adjustable lamp is specifically: 3000K, 4500K and 6500K.
[0077] Color images have three channels, RGB, and the value of each channel is usually 0-255. In this way, a pixel has 2^24 color values. Even if two pixels only have a difference in brightness value in a single channel, two color values need to be saved. In fact, there is basically no difference between these two colors in terms of actual effect, but it takes up extra storage space. Color quantization is to find some representative colors (16, 32, 64 kinds) to represent the entire image. Before quantization, each pixel requires 3 bits to store, and after quantization, only its color label (1 bit) needs to be stored, thus greatly reducing the required storage space. Therefore, color quantization is performed in the embodiment of the present invention. The first step is to use K-means to find N cluster centers as N colors. The second step is to determine the category of the N colors based on the distance between the pixel and the cluster center.
[0078] Regarding the value of N, based on a large amount of experimental data, it is found that when N=64, there is not much difference from the original image, except that the color vividness is slightly worse and a small amount of blockiness appears. When N=32,16, the image quality will be worse. Because the storage space corresponding to the image is the same when N=64,32,16, it is better to have a larger N, but it will be slower when training the model. Therefore, the embodiment of the present invention adopts N=64;
[0079] The color temperature of the adjustable lamp is determined according to the color with the highest frequency; the color determines the color temperature of the adjustable lamp, and the specific corresponding relationship can be customized according to the actual effect required by the user.
[0080] The color temperature levels provided by the embodiment of the present invention are 3000K, 4500K and 6500K, wherein 3000K warm light is equivalent to the color of an incandescent lamp, 4500K is the color of natural daylight, and 6500K is cool white.
[0081] like Figure 6 A structural diagram of a lighting control device for AR photography provided by an embodiment of the present invention; comprising:
[0082] Background image brightness acquisition unit 601: acquires the average brightness of each partition of the photographing area in the background image;
[0083] like Figure 2 The background picture in the virtual scene of the present invention is a landscape picture of Gulangyu Island. Area A shown in the figure is a photo area. The embodiment of the present invention divides the photo area A into 6 areas. In fact, the number of areas can also be set according to the required accuracy.
[0084] First, obtain the YUV brightness values in the 1st to 6th partitions of the photographing area in the background image, and calculate the average brightness corresponding to each partition. YUV is a color encoding method.
[0085] The reference image brightness acquisition unit 602: in response to the photographing area where the person is displayed in the background image, photograph the person reference to obtain the person reference image, and obtain the brightness mean of each partition of the photographing area in the background image corresponding to the person reference image;
[0086] The distance between the character and the AR interactive camera device, when the character is displayed in the camera area of the background image, the camera starts to shoot the character according to the camera trigger mechanism; Figure 3 shown.
[0087] It is worth noting that the photo-taking area and partitions in the virtual scene background image are exactly the same as the actual photo-taking area and partitions of the character at a 1:1 ratio, and a character reference image is obtained; the YUV brightness value of the character reference image is also obtained, and the brightness mean corresponding to each partition is calculated.
[0088] Brightness difference calculation unit 603: calculates brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the character reference image corresponding to the brightness of each partition of the photographing area in the background image;
[0089] Calculate the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the person reference image corresponding to the photographing area in the background image, and determine the control of the adjustable light of each partition according to the brightness difference;
[0090] Adjustable equal voltage acquisition unit 604: determines the voltage of each partition's adjustable lamp required for the brightness difference of each partition according to the corresponding relationship between the voltage of each partition's adjustable lamp and the brightness value of each partition of the picture;
[0091] Specifically, in the adjustable voltage acquisition unit, according to the correspondence between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the correspondence between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained as follows:
[0092] Obtaining the corresponding relationship between the voltage of the adjustable lamp in each partition and the light intensity data obtained in each partition;
[0093] Obtaining the corresponding relationship between the light intensity data of each partition and the brightness of each partition in the image;
[0094] The corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained.
[0095] Each partition corresponds to an adjustable lamp to control the lighting and color of the partition. The adjustable lamp has different voltage levels and produces different light intensities. The photo area in the virtual scene background picture is partitioned, and the partition dimming is set to control the color and lighting of the partition to improve control accuracy.
[0096] The light intensity and brightness are in a corresponding relationship. The greater the light intensity, the greater the brightness. Brightness is proportional to intensity; specifically, L = R × E, where L is brightness, R is reflection coefficient, and E is light intensity.
[0097] AR fusion image acquisition unit 605: turns on the adjustable lights of each partition according to the voltage of the adjustable lights of each partition, and responds to the photo-taking area where the person is displayed in the background image; and obtains the AR fusion image.
[0098] FIG4 is a diagram of a person before and after the adjustable light control, wherein FIG4 (a) is a diagram of a person before the adjustable light control, and FIG4 (b) is a diagram of a person after the adjustable light control.
[0099] like Figure 5 This is the final AR fusion image.
[0100] In addition, the embodiment of the present invention further includes: also includes: a color temperature adjustment unit, specifically:
[0101] Get all the colors of the background image, use K-means to find N cluster centers as N colors, and determine the category of the N colors based on the distance between the pixel and the cluster center, where N is a positive integer;
[0102] According to the determined N colors, a color histogram of the background image is obtained to obtain the color with the highest frequency of occurrence;
[0103] The color temperature of the adjustable lamp is determined based on the color that occurs most frequently.
[0104] Specifically, in the color temperature adjustment unit, the color temperature of the adjustable lamp is determined according to the color with the highest occurrence frequency, wherein the color temperature of the adjustable lamp is specifically: 3000K, 4500K and 6500K.
[0105] Color images have three channels, RGB, and the value of each channel is usually 0-255. In this way, a pixel has 2^24 color values. Even if two pixels only have a difference in brightness value in a single channel, two color values need to be saved. In fact, there is basically no difference between these two colors in terms of actual effect, but it takes up extra storage space. Color quantization is to find some representative colors (16, 32, 64 kinds) to represent the entire image. Before quantization, each pixel requires 3 bits to store, and after quantization, only its color label (1 bit) needs to be stored, thus greatly reducing the required storage space. Therefore, color quantization is performed in the embodiment of the present invention. The first step is to use K-means to find N cluster centers as N colors. The second step is to determine the category of the N colors based on the distance between the pixel and the cluster center.
[0106] Regarding the value of N, based on a large amount of experimental data, it is found that when N=64, there is not much difference from the original image, except that the color vividness is slightly worse and a small amount of blockiness appears. When N=32,16, the image quality will be worse. Because the storage space corresponding to the image is the same when N=64,32,16, it is better to have a larger N, but it will be slower when training the model. Therefore, the embodiment of the present invention adopts N=64;
[0107] The color temperature of the adjustable lamp is determined according to the color with the highest frequency; the color determines the color temperature of the adjustable lamp, and the specific corresponding relationship can be customized according to the actual effect required by the user.
[0108] The color temperature levels provided by the embodiment of the present invention are 3000K, 4500K and 6500K, wherein 3000K warm light is equivalent to the color of an incandescent lamp, 4500K is the color of natural daylight, and 6500K is cool white.
[0109] like Figure 7 As shown, an embodiment of the present invention provides an electronic device 700, including a memory 710, a processor 720, and a computer program 711 stored in the memory 710 and executable on the processor 720. When the processor 720 executes the computer program 711, a method for controlling light in AR photography provided by an embodiment of the present invention is implemented.
[0110] In a specific implementation process, when the processor 720 executes the computer program 711, the following is achieved:
[0111] A lighting control method for AR photography, comprising:
[0112] Get the average brightness of each partition in the photo area of the background image;
[0113] In response to a photographing area where a person is displayed in a background image, photographing a person reference reference to obtain a person reference image, and obtaining a brightness average of each subarea of the person reference image corresponding to the photographing area in the background image;
[0114] Calculate the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the character reference image corresponding to the brightness of each partition of the photographing area in the background image;
[0115] According to the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the voltage of the adjustable lamp in each partition required for the brightness difference of each partition is determined;
[0116] The adjustable lights of each partition are turned on according to the voltage of the adjustable lights of each partition, in response to the photo-taking area where the person is displayed in the background picture; and an AR fusion image is obtained.
[0117] Since the electronic device introduced in this embodiment is the device used to implement the embodiment of the present invention, based on the method introduced in the embodiment of the present invention, the technical personnel in this field can understand the specific implementation mode of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present invention is not introduced in detail here. As long as the equipment used by the technical personnel in this field to implement the method in the embodiment of the present invention falls within the scope of protection of the present invention.
[0118] See also Figure 8 , Figure 8 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention.
[0119] like Figure 8 As shown, this embodiment provides a computer-readable storage medium 800, on which a computer program 811 is stored. When the computer program 811 is executed by a processor, a light control method for AR photography provided by an embodiment of the present invention is implemented;
[0120] In a specific implementation process, when the computer program 811 is executed by a processor, the following is achieved:
[0121] A lighting control method for AR photography, comprising:
[0122] Get the average brightness of each partition in the photo area of the background image;
[0123] In response to a photographing area where a person is displayed in a background image, photographing a person reference reference to obtain a person reference image, and obtaining a brightness average of each subarea of the person reference image corresponding to the photographing area in the background image;
[0124] Calculate the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the character reference image corresponding to the brightness of each partition of the photographing area in the background image;
[0125] According to the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the voltage of the adjustable lamp in each partition required for the brightness difference of each partition is determined;
[0126] The adjustable lights of each partition are turned on according to the voltage of the adjustable lights of each partition, in response to the photo-taking area where the person is displayed in the background picture; and an AR fusion image is obtained.
[0127] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The present invention provides a lighting control method for AR photography, which comprises the following steps: obtaining the brightness mean of each partition of a photographing area in a background picture; photographing a reference image of a person in response to the photographing area in the background picture, obtaining a reference image of the person, and obtaining the brightness mean of each partition of the photographing area in the background picture corresponding to the reference image of the person; calculating the brightness difference of each partition between the brightness mean of each partition of the photographing area in the background picture and the brightness mean of each partition of the photographing area in the background picture corresponding to the reference image of the person; determining the voltage of each partition adjustable lamp required for the brightness difference of each partition according to the corresponding relationship between the voltage of each partition adjustable lamp and the brightness value of each partition of the picture; turning on each partition adjustable lamp according to the voltage of each partition adjustable lamp, in response to the photographing area in which the person is displayed in the background picture; obtaining an AR fusion image; the method provided by the present invention can modify a real person according to the lighting and color environment of the background picture in a virtual scene, thereby obtaining a more realistic fusion image.
[0130] In the method provided by the present invention, the photographing area in the virtual scene background picture is divided into zones, and zone dimming and the like are set to control the color and lighting of the zones, thereby improving the control accuracy.
[0131] In the method provided by the present invention, the photographing area and the partition in the virtual scene background picture are exactly the same as the actual photographing area and the partition of the character in a 1:1 ratio, thereby simplifying the control of the adjustable light.
[0132] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. The various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
[0133] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.
Claims
1. A lighting control method for AR photography, characterized in that: include: Get the average brightness of each partition in the photo area of the background image; In response to a photographing area where a person is displayed in a background image, photographing a person reference reference to obtain a person reference image, and obtaining a brightness average of each subarea of the person reference image corresponding to the photographing area in the background image; Calculate the brightness difference between the average brightness of each partition of the photographing area in the background image and the average brightness of each partition of the character reference image corresponding to the brightness of each partition of the photographing area in the background image; According to the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the voltage of the adjustable lamp in each partition required for the brightness difference of each partition is determined; The adjustable lights of each partition are turned on according to the voltage of the adjustable lights of each partition, in response to the photo-taking area where the person is displayed in the background picture; and an AR fusion image is obtained.
2. The method for controlling light of AR photography according to claim 1, characterized in that: Also includes: Get all the colors of the background image, use K-means to find N cluster centers as N colors, and determine the category of the N colors based on the distance between the pixel and the cluster center, where N is a positive integer; According to the determined N colors, a color histogram of the background image is obtained to obtain the color with the highest frequency of occurrence; The color temperature of the adjustable lamp is determined based on the color that occurs most frequently.
3. The lighting control method for AR photography according to claim 2, characterized in that: The color temperature of the adjustable lamp is determined according to the color with the highest frequency of occurrence, and the color temperatures of the adjustable lamp are specifically: 3000K, 4500K and 6500K.
4. The method for controlling light of AR photography according to claim 1, characterized in that: According to the correspondence between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the correspondence between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained as follows: Obtaining the corresponding relationship between the voltage of the adjustable lamp in each partition and the light intensity data obtained in each partition; Obtaining the corresponding relationship between the light intensity data of each partition and the brightness of each partition in the image; The corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained.
5. A lighting control device for AR photography, characterized in that: include: Background image brightness acquisition unit: acquires the average brightness of each partition of the photographing area in the background image; A reference image brightness acquisition unit: in response to a photographing area where a person is displayed in a background image, photographing a person reference, obtaining a person reference image, and acquiring a brightness average of each partition of the person reference image corresponding to the photographing area in the background image; A brightness difference calculation unit: calculating brightness differences of each partition of the photographing area in the background image and brightness differences of each partition of the character reference image corresponding to the brightness mean of each partition of the photographing area in the background image; Adjustable equal voltage acquisition unit: determines the voltage of each partition's adjustable lamp required for the brightness difference of each partition according to the corresponding relationship between the voltage of each partition's adjustable lamp and the brightness value of each partition of the picture; The AR fusion image acquisition unit turns on the adjustable lights of each partition according to the voltage of the adjustable lights of each partition, and responds to the photo-taking area where the person is displayed in the background image; and obtains the AR fusion image.
6. The AR photography light control device according to claim 5, characterized in that: It also includes: a color temperature adjustment unit, specifically: Get all the colors of the background image, use K-means to find N cluster centers as N colors, and determine the category of the N colors based on the distance between the pixel and the cluster center, where N is a positive integer; According to the determined N colors, a color histogram of the background image is obtained to obtain the color with the highest frequency of occurrence; The color temperature of the adjustable lamp is determined based on the color that occurs most frequently.
7. The AR photography light control device according to claim 6, characterized in that: In the color temperature adjustment unit, the color temperature of the adjustable lamp is determined according to the color with the highest occurrence frequency, wherein the color temperature of the adjustable lamp is specifically: 3000K, 4500K and 6500K.
8. The AR photography lighting control device according to claim 5, characterized in that: In the adjustable voltage acquisition unit, according to the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture, the corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained specifically as follows: Obtaining the corresponding relationship between the voltage of the adjustable lamp in each partition and the light intensity data obtained in each partition; Obtaining the corresponding relationship between the light intensity data of each partition and the brightness of each partition in the image; The corresponding relationship between the voltage of the adjustable lamp in each partition and the brightness value of each partition of the picture is obtained.
9. An electronic device for controlling light for AR photography, characterized in that: include: A memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method steps described in any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Brightness adjusting method and device for synthetic image, television and storage medium
CN107241555A
Augmented reality shooting and displaying method and system
CN111193858A