Image processing method and device, storage medium and electronic equipment

By acquiring the light transmission information of an image under a preset lighting environment and processing the image using preset shadow attenuation parameters, the problem of time-consuming and labor-intensive manual shooting of shadow images is solved, and realistic shadow images are generated efficiently.

CN116263941BActive Publication Date: 2026-01-06XIAOMI TECH (WUHAN) CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111521335.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2026-01-06
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

In the existing technology, manually taking pictures to obtain shadow images is time-consuming, labor-intensive, and inefficient, and existing methods cannot provide accurate shadow image processing.

Method used

By acquiring the light transmission information of the image to be processed under a preset lighting environment, and using preset shadow attenuation parameters to perform shadow processing on the image, a target shadow image is generated.

Benefits of technology

It improves the efficiency of shadow image acquisition, generates realistic shadow images that match the actual lighting environment, and avoids the inefficiency of manual shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263941B_ABST
    Figure CN116263941B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, device, storage medium and electronic device. The method comprises: obtaining light transmission information of a to-be-processed image under a preset lighting environment; performing shadow processing on the to-be-processed image according to a preset shadow attenuation parameter and the light transmission information to obtain a target shadow image corresponding to the to-be-processed image; wherein the preset shadow attenuation parameter is used to represent a reflection coefficient of a target object in the to-be-processed image under the preset lighting environment. Since the above-mentioned preset shadow attenuation parameter can represent the reflection coefficient of the target object in the to-be-processed image under the preset lighting environment, a target shadow image that matches the actual preset lighting environment can be obtained, and since manual shooting is not required, the efficiency of obtaining the shadow image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to an image processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] With the continuous development of computer and internet technologies, image shadow removal has received increasing attention. Shadow removal can be achieved using pre-set models, which require a large number of corresponding shadow and non-shadow images as training data for training. In related technologies, shadow and non-shadow images can be obtained manually as training data; however, this method is time-consuming, labor-intensive, and inefficient. Summary of the Invention

[0003] To overcome the aforementioned problems in related technologies, this disclosure provides an image processing method, apparatus, storage medium, and electronic device.

[0004] According to a first aspect of the present disclosure, an image processing method is provided, the method comprising:

[0005] Obtain the light transmittance information of the image to be processed under a preset lighting environment;

[0006] The image to be processed is subjected to shadow processing based on the preset shadow attenuation parameter and the light transmission information to obtain the target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment.

[0007] Optionally, the light transmission information includes the target opacity at each pixel position of the image to be processed; the step of performing shadow processing on the image to be processed according to the preset shadow attenuation parameter and the light transmission information to obtain the target shadow image corresponding to the image to be processed includes:

[0008] The target reflectance brightness at each pixel location is determined according to a preset shadow attenuation parameter. The target reflectance brightness is used to characterize the reflectance brightness of the target object in the image to be processed under the preset lighting environment.

[0009] Based on the target opacity and the target reflectivity, the image to be processed is subjected to shadow processing to obtain the target shadow image.

[0010] Optionally, the step of performing shadow processing on the image to be processed based on the target opacity and the target reflectivity to obtain the target shadow image includes:

[0011] The target brightness at each pixel location is obtained based on the first brightness at each pixel location of the image to be processed, the target opacity, and the target reflectance brightness;

[0012] The target shadow image is generated based on the target brightness at multiple pixel locations.

[0013] Optionally, the image to be processed includes multiple channels, the first brightness includes the first channel brightness of the multiple channels, and the target reflection brightness includes the target channel reflection brightness of the multiple channels; obtaining the target brightness at each pixel position based on the first brightness at each pixel position of the image to be processed, the target opacity, and the target reflection brightness includes:

[0014] For each channel at each pixel location in the image to be processed, the target single-channel brightness of that channel at that pixel location is calculated using the following formula, based on the brightness of the first channel, the target opacity, and the target channel reflectance:

[0015] XS k = (1-m)*XN k +m*XD k ;

[0016] Among them, XS k The value represents the target single-channel brightness of the k-th channel, and m represents the target opacity. XN k XD represents the brightness of the first channel of the k-th channel. k This represents the target channel reflectance of the k-th channel;

[0017] The target brightness at a pixel location is obtained by merging the target single-channel brightness of multiple channels.

[0018] Optionally, the preset shadow attenuation parameters include a preset direct reflection brightness and a preset ambient light attenuation factor. The preset direct reflection brightness characterizes the reflected light brightness of the target object to a direct illumination source under the preset lighting environment, and the preset ambient light attenuation factor characterizes the attenuation factor of the ambient illumination source under the preset lighting environment. Determining the target reflection brightness at each pixel position based on the preset shadow attenuation parameters includes:

[0019] The target reflection brightness at each pixel location is obtained based on the preset direct reflection brightness, the preset ambient light attenuation factor, and the first brightness.

[0020] Optionally, the preset direct reflection brightness includes the preset direct reflection channel brightness for each channel; obtaining the target reflection brightness at each pixel location based on the preset direct reflection brightness, the preset ambient light attenuation factor, and the first brightness includes:

[0021] For each pixel location, the target channel reflectance of each channel at that pixel location is calculated using the following formula, based on the preset direct reflection channel luminance, the preset ambient light attenuation factor, and the first channel luminance:

[0022]

[0023] Among them, XD k XN represents the target channel reflectance of the k-th channel. k α represents the brightness of the first channel of the k-th channel. k γ represents the preset direct reflection channel brightness of the k-th channel, and γ represents the preset ambient light attenuation factor;

[0024] The target channel reflectance of multiple channels is used as the target reflectance of the pixel location.

[0025] Optionally, obtaining the light transmittance information of the image to be processed under a preset lighting environment includes:

[0026] A preset lighting environment is determined, which includes a preset light source, a preset obstruction, a preset camera, and a preset virtual plane;

[0027] In the preset lighting environment, the model brightness at each pixel position within the preset virtual plane is captured by the preset camera;

[0028] Based on the preset virtual plane and the model brightness, the light transmittance information of the image to be processed under the preset lighting environment is determined.

[0029] According to a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:

[0030] The information acquisition module is configured to acquire the light transmission information of the image to be processed under a preset lighting environment;

[0031] The image processing module is configured to perform shadow processing on the image to be processed according to a preset shadow attenuation parameter and the light transmission information to obtain a target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment.

[0032] Optionally, the light transmission information includes the target opacity at each pixel location of the image to be processed; the image processing module is configured to determine the target reflectance brightness at each pixel location according to a preset shadow attenuation parameter, the target reflectance brightness being used to characterize the reflectance brightness of the target object in the image to be processed under the preset lighting environment; and to perform shadow processing on the image to be processed according to the target opacity and the target reflectance brightness to obtain the target shadow image.

[0033] Optionally, the image processing module is configured to obtain the target brightness at each pixel location based on the first brightness at each pixel location of the image to be processed, the target opacity, and the target reflectance brightness; and to generate the target shadow image based on the target brightness at multiple pixel locations.

[0034] Optionally, the image to be processed includes multiple channels, the first brightness includes the first channel brightness of the multiple channels, and the target reflection brightness includes the target channel reflection brightness of the multiple channels; the image processing module is configured to calculate, for each channel at each pixel location of the image to be processed, the target single-channel brightness of that channel at that pixel location using the following formula based on the first channel brightness, the target opacity, and the target channel reflection brightness: XS k = (1-m)*XN k +m*XD k Among them, XS k The value represents the target single-channel brightness of the k-th channel, and m represents the target opacity. XN k XD represents the brightness of the first channel of the k-th channel. k The target channel reflectance of the k-th channel is represented; the target single-channel reflectance of multiple channels is combined to obtain the target reflectance at the pixel position.

[0035] Optionally, the preset shadow attenuation parameter includes a preset direct reflection brightness and a preset ambient light attenuation factor. The preset direct reflection brightness is used to characterize the reflected light brightness of the target object to the direct illumination source under the preset lighting environment, and the preset ambient light attenuation factor is used to characterize the attenuation factor of the ambient illumination source under the preset lighting environment. The image processing module is configured to obtain the target reflection brightness at each pixel position based on the preset direct reflection brightness, the preset ambient light attenuation factor, and the first brightness.

[0036] Optionally, the preset direct reflection brightness includes the preset direct reflection channel brightness for each channel; the image processing module is configured to calculate, for each pixel location, the target channel reflection brightness for each channel at that pixel location using the following formula, based on the preset direct reflection channel brightness, the preset ambient light attenuation factor, and the brightness of the first channel: Among them, XD K XN represents the target channel reflectance of the k-th channel. k α represents the brightness of the first channel of the k-th channel of the image to be processed. k γ represents the preset direct reflection channel brightness of the k-th channel, and γ represents the preset ambient light attenuation factor; the target channel reflection brightness of multiple channels is used as the target reflection brightness of the pixel position.

[0037] Optionally, the information acquisition module is configured to determine a preset lighting environment, which includes a preset light source, a preset occlusion, a preset camera, and a preset virtual plane; in the preset lighting environment, the preset camera captures the model brightness at each pixel position within the preset virtual plane; and based on the preset virtual plane and the model brightness, determines the light transmission information of the image to be processed in the preset lighting environment.

[0038] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0039] processor;

[0040] Memory used to store processor-executable instructions;

[0041] The processor is configured to perform the steps of the image processing method provided in the first aspect of this disclosure.

[0042] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the steps of the image processing method provided in the first aspect of the present disclosure.

[0043] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: acquiring the light transmittance information of an image to be processed under a preset lighting environment; performing shadow processing on the image to be processed according to a preset shadow attenuation parameter and the light transmittance information to obtain a target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment. Since the preset shadow attenuation parameter can characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment, a target shadow image matching the actual preset lighting environment can be obtained, and since no manual shooting is required, the efficiency of shadow image acquisition can be improved.

[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

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

[0046] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment.

[0047] Figure 2 It is based on Figure 1 The illustrated embodiment shows a flowchart of step S102.

[0048] Figure 3 It is based on Figure 1 The illustrated embodiment shows a flowchart of step S101.

[0049] Figure 4 This is a schematic diagram illustrating a preset lighting environment according to an exemplary embodiment.

[0050] Figure 5 This is a block diagram illustrating an image processing apparatus according to an exemplary embodiment.

[0051] Figure 6 This is a block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0052] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0053] First, the application scenarios of this disclosure are explained. This disclosure can be applied to image processing scenarios, particularly scenarios involving shadow removal from images. To train a preset model for shadow removal, a large number of corresponding shadow and non-shadow images are needed as training data. In related technologies, shadow and non-shadow images can be obtained manually as training data; however, this method is time-consuming, labor-intensive, and inefficient. Besides manual photography, shadow removal from images can also be performed in the following ways:

[0054] 3D shadow rendering is used to process shadows on an image: occlusions are placed and shadows are rendered on the image using ray tracing. The results of this method may be physically inaccurate, but because it cannot adjust the shadow rendering effect based on the material information of the target objects in the image, the rendered result will differ significantly from the actual shadow image.

[0055] Image shadow processing is performed using GANs (Generative Adversarial Networks). This method requires training samples to train the GAN model. However, obtaining training samples is costly and inefficient, resulting in a limited number of available samples and consequently, lower accuracy and fewer shadow types provided by the generated GAN model.

[0056] It is evident that the above method for processing shadows in an image cannot provide an accurate shadow image.

[0057] It should be noted that, in addition to requiring a large number of shadow images when training the preset model for shadow removal, other scenarios, such as virtual reality, also typically require shadow processing on images without shadows in order to display richer and more realistic information about the everyday environment. For example, in a virtual reality scene, the shadow effect of a target object being obscured by buildings or trees also requires shadow processing on the image corresponding to the target object.

[0058] To address the aforementioned issues, this disclosure provides an image processing method, apparatus, storage medium, and electronic device. The method can perform shadow processing on the image under a preset lighting environment based on the light transmittance information and preset shadow attenuation parameters, thereby obtaining a target shadow image corresponding to the image under the preset lighting environment. Since the preset shadow attenuation parameters characterize the reflectance coefficient of the target object in the image under the preset lighting environment, a target shadow image matching the actual preset lighting environment can be obtained. Furthermore, since manual shooting is not required, the efficiency of shadow image acquisition can be improved.

[0059] The present disclosure will now be described in conjunction with specific embodiments.

[0060] Figure 1 This is an image processing method illustrated according to an exemplary embodiment, such as... Figure 1 As shown, the execution subject of this method can be a terminal, and the method can include:

[0061] S101. Obtain the light transmission information of the image to be processed under the preset lighting environment.

[0062] The light transmittance information can be used to characterize the transparency or opacity of the image to be processed under a preset lighting environment. The image to be processed can be a shadowless image.

[0063] S102. Based on the preset shadow attenuation parameters and the light transmission information, perform shadow processing on the image to be processed to obtain the target shadow image corresponding to the image to be processed.

[0064] The preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment.

[0065] It should be noted that the target object can be a target object, target animal, target plant, or target person, etc., and this disclosure does not limit this. The material, color, and shape of the target object will all affect the reflectance coefficient. Therefore, the preset shadow attenuation parameter can be determined based on the material, color, and shape of the target object. In addition, the preset shadow attenuation parameter can include multiple different parameter values ​​to characterize the different reflectance coefficients of target objects with different materials, colors, or shapes under the preset lighting environment.

[0066] Using the method described in the above embodiments of this disclosure, the light transmittance information of the image to be processed under a preset lighting environment is obtained; based on a preset shadow attenuation parameter and the light transmittance information, shadow processing is performed on the image to be processed to obtain a target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment. Since the preset shadow attenuation parameter can characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment, a target shadow image matching the actual preset lighting environment can be obtained, and since no manual shooting is required, the efficiency of shadow image acquisition can be improved.

[0067] Furthermore, the aforementioned preset lighting environment can be one or more, each preset lighting environment corresponds to a light transmission information, and each preset lighting environment can also correspond to multiple preset shadow attenuation factors. In this way, by performing shadow processing based on the combination of multiple light transmission information and multiple preset shadow attenuation factors, diverse and realistic target shadow images can be obtained.

[0068] In another embodiment of this disclosure, the aforementioned light transmission information may include the target opacity at each pixel location of the image to be processed.

[0069] For example, the target opacity at each pixel location can be used to characterize the intensity of light occlusion at that pixel location. If the pixel location is within the umbra, it is completely occluded, the shadow intensity is maximum, and the target opacity at that pixel location can be determined to be 1. If the pixel location is within the penumbra, the light at that pixel location is partially occluded, the shadow intensity is between the minimum and maximum values, and the target opacity at that pixel location can be determined to be a value greater than 0 and less than 1 based on this shadow intensity. If the pixel location is not occluded by shadow, the shadow intensity at that pixel location is minimum, and the target opacity at that pixel location can be determined to be 0.

[0070] Figure 2 It is based on Figure 1 The illustrated embodiment shows a flowchart of step S102, as follows: Figure 2 As shown, step S102 above may include the following steps:

[0071] S1021. Determine the target reflection brightness at each pixel location based on the preset shadow attenuation parameters.

[0072] The target reflectance brightness is used to characterize the reflectance brightness of the target object in the image to be processed under the preset lighting environment.

[0073] Optionally, a preset shadow attenuation parameter can be determined based on the material of the target object, thereby determining the reflected light brightness corresponding to the material of the target object.

[0074] S1022. Based on the target opacity and target reflectivity, perform shadow processing on the image to be processed to obtain the target shadow image.

[0075] In this step, the image to be processed may include multiple pixels. The target brightness at each pixel location can be obtained first; then, a target shadow image can be generated based on the target brightness at multiple pixel locations.

[0076] For example, the brightness of each pixel in the image to be processed can be adjusted to the target brightness to create a shadow effect and obtain the target shadow image.

[0077] The method of obtaining the target brightness at each pixel location may include: obtaining the target brightness at each pixel location based on the first brightness at each pixel location of the image to be processed, the target opacity, and the target reflectance brightness.

[0078] It should be noted that an image can include three channels: red, green, and blue. The aforementioned first brightness can include the first channel brightness of each of the red, green, and blue channels. Conversely, the first channel brightness of the red, green, and blue channels corresponding to a pixel location can also be synthesized to obtain the first brightness of that pixel location. Therefore, the target single-channel brightness of each channel at each pixel location can be calculated first, and then the target brightness of that pixel location can be calculated by combining the target single-channel brightness of the red, green, and blue channels.

[0079] For example, the image to be processed includes multiple channels, the first brightness includes the first channel brightness of the multiple channels, and the target reflection brightness includes the target channel reflection brightness of the multiple channels; the target single channel brightness of the channel at each pixel location of the image to be processed can be calculated using the following formula (1) based on the first channel brightness, the target opacity, and the target channel reflection brightness:

[0080] XS k = (1-m)*XN k +m*XD k (1);

[0081] Among them, XS k XN represents the single-channel brightness of the target in the k-th channel, m represents the opacity of the target, and XN represents the single-channel brightness of the target. k XD represents the brightness of the first channel of the k-th channel. k This represents the target channel reflectance of the k-th channel.

[0082] It should be noted that, in one optional implementation, the above-mentioned XS k XN k XD k The values ​​of both and m can be greater than or equal to 0 and less than or equal to 1.

[0083] Then, the target single-channel brightness of multiple channels can be merged to obtain the target brightness at that pixel location. The specific merging method can be found in existing technologies for merging the brightness of the red, green, and blue channels; this disclosure will not elaborate further.

[0084] By using the above method, the target brightness of each pixel position in the image to be processed can be obtained, thereby completing the shadow processing of the image to be processed, making the processed target shadow image more realistically reflect the shadow effect.

[0085] Furthermore, there can be multiple target opacities and multiple preset shadow attenuation parameters. In this way, multiple target shadow images can be obtained by randomly combining multiple target opacities and multiple shadow attenuation parameters, thereby obtaining richer target shadow images and further improving the efficiency of shadow image acquisition.

[0086] In another embodiment of this disclosure, the aforementioned light transmission information may include the target transparency at each pixel location of the image to be processed. Thus, for each channel at each pixel location of the image to be processed, the target single-channel brightness of that channel at that pixel location can be calculated using the following formula (2) based on the aforementioned first channel brightness, target transparency, and target channel reflectance:

[0087] XS k =n*XN k +(1-n)*XD k (2);

[0088] Among them, XS k XN represents the single-channel brightness of the target in the k-th channel, and n represents the transparency of the target. k XD represents the brightness of the first channel of the k-th channel. k This represents the target channel reflectance of the k-th channel.

[0089] Then, the target single-channel brightness of multiple channels can be merged to obtain the target brightness at that pixel location.

[0090] In another embodiment of this disclosure, the preset shadow attenuation parameter includes a preset direct reflection brightness and a preset ambient light attenuation factor. The preset direct reflection brightness is used to characterize the reflected light brightness of the target object to the direct lighting source under the preset lighting environment. The preset direct reflection brightness may include the preset direct reflection brightness of each channel. The preset ambient light attenuation factor is used to characterize the attenuation factor of the ambient lighting source under the preset lighting environment.

[0091] It should be noted that the preset lighting environment may include a preset light source and a preset obstruction. The preset light source may include a direct lighting source and an ambient lighting source. Based on the position, material, and shape of the target object, the reflected light intensity of the target object to the direct lighting source can be determined, and this reflected light intensity can be used as the preset direct reflected light intensity. Based on the position, material, and shape attributes of the preset obstruction, the attenuation factor of the preset obstruction to the ambient lighting source can be determined, and this attenuation factor can be used as the preset ambient light attenuation factor.

[0092] Furthermore, based on the location, material, and shape of different target objects, multiple preset direct reflection luminances can be determined. Similarly, based on the location, material, and shape of multiple preset obstructions, multiple different preset ambient light attenuation factors can be obtained.

[0093] In step S1022 above, the target reflection brightness of each pixel position can be obtained based on the preset direct reflection brightness, the preset ambient light attenuation factor, and the first brightness.

[0094] For example, the preset direct reflection brightness may include the preset direct reflection channel brightness of each channel; for each pixel location, the target channel reflection brightness of each channel at that pixel location can be calculated using the following formula (3) based on the preset direct reflection channel brightness, the preset ambient light attenuation factor, and the aforementioned first channel brightness:

[0095]

[0096] Among them, XD k XN represents the target channel reflectance of the k-th channel. k α represents the brightness of the first channel of the k-th channel. k γ represents the preset direct reflection channel brightness of the k-th channel, and γ represents the preset ambient light attenuation factor.

[0097] Then, the target channel reflectance of multiple channels can be used as the target reflectance of that pixel location.

[0098] In this way, by presetting the direct reflection brightness and the ambient light attenuation factor, a target reflection brightness that is closer to the target object can be obtained, so that the final target shadow image is more realistic.

[0099] Figure 3 It is based on Figure 1 The illustrated embodiment shows a flowchart of step S101, as follows: Figure 3 As shown, step S101 above may include the following steps:

[0100] S1011. Determine the preset lighting environment.

[0101] The preset lighting environment may include a preset light source, a preset occlusion, a preset camera, and a preset virtual plane.

[0102] For example, in this step, the preset lighting environment can be constructed using Blender (a 3D graphics software). For instance, in Blender, based on preset shape, size, and relative position information, a preset light source, one or more preset occluders, a preset camera, and a virtual plane can be placed to construct the preset lighting environment. For example, Figure 4 This is a schematic diagram illustrating a preset lighting environment according to an exemplary embodiment, such as... Figure 4 As shown, the preset lighting environment may include a preset light source 401, a preset occlusion 402, a preset camera 403, and a preset virtual plane 404.

[0103] S1012. In the preset lighting environment, the model brightness at each pixel position in the preset virtual plane is captured by the preset camera.

[0104] S1013. Based on the preset virtual plane and the brightness of the model, determine the light transmission information of the image to be processed under the preset lighting environment.

[0105] For example, the model brightness at each pixel location can be normalized to a value between 0 and 1, and the normalized value can be used as the light transmission information for that pixel location. If the light transmission information includes the target opacity, then during the above normalization process, the higher the model brightness, the smaller the normalized value; if the light transmission information includes the target transparency, then during the above normalization process, the lower the model brightness, the smaller the normalized value.

[0106] Furthermore, by randomly scaling, translating, and rotating four components in the preset lighting environment (preset light source, preset occluder, preset camera, and preset virtual plane), different light transmission information can be obtained, so as to generate multiple target shadow images based on different light transmission information.

[0107] It should be noted that this light transmission information can be stored in the form of a shadow mask. For example, different light transmission information can be stored using multiple different shadow masks to obtain a rich variety of target shadow images.

[0108] In summary, by employing any of the methods described in the above embodiments of this disclosure, the light transmittance information of the image to be processed under a preset lighting environment is obtained; based on a preset shadow attenuation parameter and the light transmittance information, shadow processing is performed on the image to be processed to obtain a target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment. Since the preset shadow attenuation parameter can characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment, a target shadow image matching the actual preset lighting environment can be obtained, and since no manual shooting is required, the efficiency of shadow image acquisition can be improved.

[0109] Figure 5 This is a block diagram illustrating an image processing apparatus 500 according to an exemplary embodiment, such as... Figure 5 As shown, the device 500 may include:

[0110] The information acquisition module 501 is configured to acquire the light transmission information of the image to be processed under a preset lighting environment;

[0111] The image processing module 502 is configured to perform shadow processing on the image to be processed according to a preset shadow attenuation parameter and the light transmission information to obtain a target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment.

[0112] Optionally, the light transmission information includes the target opacity at each pixel location of the image to be processed; the image processing module 502 is configured to determine the target reflectance brightness at each pixel location according to a preset shadow attenuation parameter, the target reflectance brightness being used to characterize the reflectance brightness of the target object in the image to be processed under the preset lighting environment; and to perform shadow processing on the image to be processed according to the target opacity and the target reflectance brightness to obtain the target shadow image.

[0113] Optionally, the image processing module 502 is configured to obtain the target brightness at each pixel position based on the first brightness at each pixel position of the image to be processed, the target opacity, and the target reflectance brightness; and to generate the target shadow image based on the target brightness at multiple pixel positions.

[0114] Optionally, the image to be processed includes multiple channels, the first brightness includes the first channel brightness of the multiple channels, and the target reflection brightness includes the target channel reflection brightness of the multiple channels; the image processing module 502 is configured to calculate, for each channel at each pixel location of the image to be processed, the target single-channel brightness of that channel at that pixel location using the following formula based on the first channel brightness, the target opacity, and the target channel reflection brightness: XS k = (1-m)*XN k +m*XD k Among them, XS k XN represents the single-channel brightness of the target in the k-th channel, m represents the opacity of the target, and XN represents the single-channel brightness of the target. k XD represents the brightness of the first channel of the k-th channel. k This represents the target channel reflectance of the k-th channel; the target luminance at this pixel location is obtained by merging the single-channel luminances of multiple channels.

[0115] Optionally, the preset shadow attenuation parameter includes a preset direct reflection brightness and a preset ambient light attenuation factor. The preset direct reflection brightness is used to characterize the reflected light brightness of the target object to the direct illumination source under the preset lighting environment, and the preset ambient light attenuation factor is used to characterize the attenuation factor of the ambient illumination source under the preset lighting environment. The image processing module 502 is configured to obtain the target reflection brightness at each pixel position based on the preset direct reflection brightness, the preset ambient light attenuation factor, and the first brightness.

[0116] Optionally, the preset direct reflection brightness includes the preset direct reflection channel brightness for each channel; the image processing module 502 is configured to calculate, for each pixel location, the target channel reflection brightness for each channel at that pixel location based on the preset direct reflection channel brightness, the preset ambient light attenuation factor, and the brightness of the first channel using the following formula: Among them, XD k XN represents the target channel reflectance of the k-th channel. K α represents the brightness of the first channel of the k-th channel. K γ represents the preset direct reflection channel brightness of the k-th channel, and γ represents the preset ambient light attenuation factor; the target channel reflection brightness of multiple channels is used as the target reflection brightness of the pixel position.

[0117] Optionally, the information acquisition module 501 is configured to determine a preset lighting environment, which includes a preset light source, a preset occluder, a preset camera, and a preset virtual plane; in the preset lighting environment, the preset camera captures the model brightness at each pixel position within the preset virtual plane; and based on the preset virtual plane and the model brightness, the light transmission information of the image to be processed in the preset lighting environment is determined.

[0118] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0119] In summary, using the apparatus described in the above embodiments of this disclosure, the light transmittance information of the image to be processed under a preset lighting environment is obtained; based on the preset shadow attenuation parameter and the light transmittance information, shadow processing is performed on the image to be processed to obtain a target shadow image corresponding to the image to be processed; wherein, the preset shadow attenuation parameter is used to characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment. Since the preset shadow attenuation parameter can characterize the reflectance coefficient of the target object in the image to be processed under the preset lighting environment, a target shadow image matching the actual preset lighting environment can be obtained, and since no manual shooting is required, the efficiency of shadow image acquisition can be improved.

[0120] It should be noted that the terminal in this disclosure can be an electronic device such as a smartphone, tablet computer, smartwatch, smart bracelet, PDA (Personal Digital Assistant), CPE (Customer Premise Equipment), etc., and this disclosure does not limit it.

[0121] This disclosure also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of the image processing method provided in this disclosure.

[0122] Figure 6This is a block diagram illustrating an electronic device 600 according to an exemplary embodiment. For example, electronic device 600 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, router, etc.

[0123] Reference Figure 6 The electronic device 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input / output (I / O) interface 612, sensor component 614, and communication component 616.

[0124] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the image processing method described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.

[0125] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0126] Power component 606 provides power to various components of electronic device 600. Power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.

[0127] Multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0128] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.

[0129] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0130] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 can detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0131] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as Wi-Fi, 2G, 3G, 4G, 5G, NB-IoT, eMTC, or other 6G networks, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0132] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the image processing method described above.

[0133] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to complete the image processing method described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0134] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a programmable device, the computer program having a code portion for performing the above-described image processing method when executed by the programmable device.

[0135] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0136] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized by, The method comprises: acquiring light transmission information of a to-be-processed image under a preset lighting environment; performing shadow processing on the to-be-processed image according to a preset shadow attenuation parameter and the light transmission information to obtain a target shadow image corresponding to the to-be-processed image; wherein the preset shadow attenuation parameter is used to represent a reflection coefficient of a target object in the to-be-processed image under the preset lighting environment; the light transmission information comprises target opacity of each pixel position of the to-be-processed image; and the to-be-processed image comprises multiple channels; the performing of the shadow processing on the to-be-processed image according to the preset shadow attenuation parameter and the light transmission information to obtain the target shadow image corresponding to the to-be-processed image comprises: for each channel of each pixel position of the to-be-processed image, determining target single-channel brightness of the channel of the pixel position according to first-channel brightness of multiple channels in first brightness of each pixel position of the to-be-processed image, the target opacity and target reflection brightness; the target reflection brightness is used to represent reflection light brightness of the target object in the to-be-processed image under the preset lighting environment, and the target reflection brightness is determined according to a preset shadow attenuation parameter; combining target single-channel brightness of multiple channels to obtain target brightness of the pixel position; generating the target shadow image according to target brightness of multiple pixel positions.

2. The method of claim 1, wherein, The target reflection brightness comprises target-channel reflection brightness of multiple channels; and the target single-channel brightness is obtained by the following formula: ; wherein, Lk, target represents the target single-channel luminance of the kth channel, m represents the target opacity, Lk, 1 represents the first-channel luminance of the kth channel, Lk, target, k represents the target-channel reflectance luminance of the kth channel.

3. The method of claim 2, wherein, The preset shadow attenuation parameter comprises a preset direct reflection brightness and a preset ambient light attenuation factor; the preset direct reflection brightness is used to represent reflection light brightness of the target object to a direct illumination light source under the preset lighting environment; and the preset ambient light attenuation factor is used to represent an attenuation factor of an environmental illumination light source under the preset lighting environment; the determining of the target reflection brightness of each pixel position according to the preset shadow attenuation parameter comprises: acquiring the target reflection brightness of each pixel position according to the preset direct reflection brightness, the preset ambient light attenuation factor and the first brightness.

4. The method of claim 3, wherein, The preset direct reflection brightness comprises preset direct reflection channel brightness of each channel; and the acquiring of the target reflection brightness of each pixel position according to the preset direct reflection brightness, the preset ambient light attenuation factor and the first brightness comprises: for each pixel position, the target-channel reflection brightness of each channel of the pixel position is calculated according to the preset direct reflection channel brightness, the preset ambient light attenuation factor and the first-channel brightness by the following formula: = ; wherein, represents a target channel reflectance luminance of the kth channel, represents a first channel luminance of the kth channel, represents a preset direct reflectance channel luminance of the kth channel, represents the preset ambient light attenuation factor; target-channel reflection brightness of multiple channels is taken as the target reflection brightness of the pixel position.

5. The method according to any one of claims 1 to 4, characterized in that, The acquiring of the light transmission information of the to-be-processed image under the preset lighting environment comprises: determining a preset lighting environment, the preset lighting environment comprising a preset light source, a preset occlusion, a preset camera and a preset virtual plane; capturing model brightness of each pixel position in the preset virtual plane in the preset lighting environment by the preset camera; According to the preset virtual plane and the model brightness, transmittance information of the to-be-processed image in the preset lighting environment is determined.

6. An image processing apparatus characterized by comprising: The device comprises: An information acquisition module configured to acquire transmittance information of a to-be-processed image in a preset lighting environment; An image processing module configured to perform shadow processing on the to-be-processed image according to preset shadow attenuation parameters and the transmittance information, to obtain a target shadow image corresponding to the to-be-processed image; wherein the preset shadow attenuation parameters are used to represent a reflection coefficient of a target object in the to-be-processed image in the preset lighting environment; the transmittance information comprises target opacity of each pixel position of the to-be-processed image; and the to-be-processed image comprises multiple channels. The performing of the shadow processing on the to-be-processed image according to the preset shadow attenuation parameters and the transmittance information to obtain the target shadow image corresponding to the to-be-processed image comprises: For each channel of each pixel position of the to-be-processed image, a target single-channel brightness of the channel of the pixel position is determined according to a first channel brightness of multiple channels in a first brightness of each pixel position of the to-be-processed image, the target opacity, and a target reflection brightness; the target reflection brightness is used to represent a reflection light brightness of the target object in the to-be-processed image in the preset lighting environment, and the target reflection brightness is determined according to the preset shadow attenuation parameters; target single-channel brightnesses of multiple channels are combined to obtain a target brightness of the pixel position; and the target shadow image is generated according to target brightnesses of multiple pixel positions.

7. An electronic device, comprising: Comprise: A processor; A memory for storing processor-executable instructions; The processor is configured to perform the steps of the method of any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon computer program instructions, wherein, The program instructions are executed by the processor to implement the steps of the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image generation system, program and information storage medium

    JP2004070670A