Lighting estimation method, lighting estimation device, storage medium and electronic device

By judging the scene type of the image and determining the illumination estimation strategy, the problem of inaccurate illumination estimation in the existing technology is solved, accurate illumination parameter estimation is achieved in different scenes, and the pertinence and applicability of illumination estimation are improved.

CN113537193BActive Publication Date: 2024-09-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110802702.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-15
Publication Date
2024-09-13
Estimated Expiration
2041-07-15

AI Technical Summary

Technical Problem

Existing technology cannot accurately and effectively perform illumination estimation based on actual scene types, especially in multi-light source and single-light source scenes, where the illumination parameter estimation results vary greatly.

Method used

By obtaining the image to be processed, determining its scene type, and determining the corresponding illumination estimation strategy according to the scene type, the illumination parameters of the image are estimated.

Benefits of technology

It achieves targeted lighting estimation based on different scene types, obtains more accurate and effective lighting parameters, has the ability to flexibly switch strategies, and is suitable for a variety of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113537193B
    Figure CN113537193B
Patent Text Reader

Abstract

The present disclosure provides an illumination estimation method, an illumination estimation device, a computer-readable storage medium and an electronic device, and relates to the field of computer technology. The illumination estimation method comprises: obtaining an image to be processed whose illumination parameters are to be estimated; processing the image to be processed to determine the scene type of the scene in the image to be processed; determining an illumination estimation strategy for the image to be processed according to the scene type; and using the illumination estimation strategy to perform illumination estimation on the image to be processed to determine the illumination parameters of the image to be processed. The present disclosure can perform accurate and effective illumination estimation under different scene types.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of computer technology and multimedia technology, many image capture devices or applications have emerged for image capture. In order to make each object captured in the image have a better and more realistic lighting effect, the existing technology usually uses some auxiliary shooting equipment, such as special devices such as depth cameras, fisheye cameras or light field cameras, to calculate the lighting conditions in the shooting scene; or place some auxiliary markers with known geometric structures in the shooting scene, and capture or infer the lighting information of each object in the real scene by analyzing the auxiliary markers.

[0003] However, the above-mentioned illumination estimation methods are often relatively simple. For example, in multi-light source scenes (such as indoor scenes) or single-light source scenes (such as outdoor scenes), due to factors such as the position and number of light sources, the illumination parameters are different. When the same illumination estimation method is used to process images, the illumination estimation results are not much different. In other words, the existing technology cannot accurately and effectively estimate the illumination of images according to the actual scene type. Summary of the invention

[0004] The present disclosure provides a lighting estimation method, a lighting estimation device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent improving the problem in the prior art that it is difficult to perform targeted lighting estimation according to actual scenes.

[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0006] According to a first aspect of the present disclosure, there is provided a method for illumination estimation, comprising: obtaining an image to be processed whose illumination parameters are to be estimated; processing the image to be processed to determine a scene type of a scene in the image to be processed; determining an illumination estimation strategy for the image to be processed based on the scene type; and performing illumination estimation on the image to be processed using the illumination estimation strategy to determine illumination parameters of the image to be processed.

[0007] According to a second aspect of the present disclosure, there is provided a lighting estimation device, comprising: a module for acquiring an image to be processed, for acquiring an image to be processed whose lighting parameters are to be estimated; a module for determining a scene type, for processing the image to be processed, and determining the scene type of the scene in the image to be processed; a module for determining an estimation strategy, for determining, according to the scene type, a lighting estimation strategy for the image to be processed; and a module for obtaining lighting parameters, for performing lighting estimation on the image to be processed using the lighting estimation strategy, and determining the lighting parameters of the image to be processed.

[0008] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the illumination estimation method of the first aspect and possible implementation methods thereof are implemented.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the illumination estimation method of the first aspect and possible implementation thereof by executing the executable instructions.

[0010] The technical solution disclosed in this disclosure has the following beneficial effects:

[0011] Obtain an image to be processed for which illumination parameters are to be estimated; process the image to be processed to determine the scene type of the scene in the image to be processed; determine the illumination estimation strategy for the image to be processed according to the scene type; use the illumination estimation strategy to perform illumination estimation on the image to be processed and determine the illumination parameters of the image to be processed. On the one hand, this exemplary embodiment, from the perspective that different scene types have different illumination effects, determines the scene type of the scene in the image to be processed to determine an illumination estimation strategy that is more in line with the current scene type, and the illumination parameters obtained are more accurate and effective; on the other hand, this exemplary embodiment uses a simple judgment process, that is, it can realize flexible switching of corresponding illumination estimation strategies for illumination estimation in different application scenarios, has strong pertinence and scene applicability, and has a simple process and good illumination estimation effect.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0014] Figure 1 A schematic diagram showing a system architecture in this exemplary embodiment;

[0015] Figure 2 A structural diagram of an electronic device according to the exemplary embodiment is shown;

[0016] Figure 3 A flow chart of a method for estimating illumination in this exemplary embodiment is shown;

[0017] Figure 4A sub-flow chart of a method for estimating illumination in this exemplary embodiment is shown;

[0018] Figure 5 A sub-flow chart showing another illumination estimation method in this exemplary embodiment;

[0019] Figure 6 A schematic diagram showing the effect of performing illumination estimation on an image to be processed of an outdoor scene type in this exemplary embodiment;

[0020] Figure 7 A schematic diagram showing the effect of performing illumination estimation on an image to be processed of an indoor scene type in this exemplary embodiment;

[0021] Figure 8 A flowchart showing another illumination estimation method in this exemplary embodiment is shown;

[0022] Fig. 9 A structural diagram of a lighting estimation device in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0023] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0024] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0025] An exemplary embodiment of the present disclosure provides a method for estimating illumination. Figure 1 1 shows a system architecture diagram of the operating environment of this exemplary embodiment. Figure 1As shown, the system architecture 100 may include a user terminal 110 and a server 120, which communicate with each other through a network. For example, the user terminal 110 may send an image to be processed to the server 120 for processing, and the server 120 may also return the illumination estimation result to the user terminal 110. The user terminal 110 includes but is not limited to a smart phone, a tablet computer, a game console, a wearable device, etc.; the server 120 refers to a backend server that provides Internet services.

[0026] It should be understood that Figure 1 The number of each device is only exemplary. According to actual needs, any number of clients can be set, or the server can be a cluster formed by multiple servers.

[0027] The illumination estimation method provided in the embodiments of the present disclosure may be executed by the user terminal 110, for example, after the user terminal 110 captures an image, the illumination of the image is estimated to obtain corresponding illumination parameters; it may also be executed by the server 120, for example, after the user terminal 110 acquires the image, the user terminal 110 may upload the image to the server 120, so that the server 120 performs illumination estimation on the image, etc. The present disclosure does not make any specific limitation on this.

[0028] An exemplary embodiment of the present disclosure provides an electronic device for implementing a method for estimating illumination, which may be Figure 1 The user terminal 110 or the server 120 in the embodiment of the present invention. The electronic device at least comprises a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the illumination estimation method by executing the executable instructions.

[0029] Below Figure 2 Taking the mobile terminal 200 in the example, the structure of the above electronic device is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 2 The construction in can also be applied to fixed type equipment.

[0030] like Figure 2As shown, the mobile terminal 200 may specifically include: a processor 210, an internal memory 221, an external memory interface 222, a USB (Universal Serial Bus) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294 and a SIM (Subscriber Identification Module) card interface 295, etc.

[0031] The processor 210 may include one or more processing units, for example: the processor 210 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc. The encoder may encode (i.e., compress) the image or video data; the decoder may decode (i.e., decompress) the bitstream data of the image or video to restore the image or video data. The mobile terminal 100 may support one or more encoders and decoders.

[0032] In some implementations, the processor 210 may include one or more interfaces, and may be connected to other components of the mobile terminal 200 via different interfaces.

[0033] The internal memory 221 may be used to store computer executable program codes, which may include instructions. The internal memory 221 may include volatile memory, non-volatile memory, etc. The processor 210 executes various functional applications and data processing of the mobile terminal 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.

[0034] The external memory interface 222 can be used to connect an external memory, such as a Micro SD card, to expand the storage capacity of the mobile terminal 200. The external memory communicates with the processor 210 through the external memory interface 222 to implement a data storage function, such as storing music, video and other files.

[0035] The USB interface 230 is an interface that complies with USB standard specifications and can be used to connect a charger to charge the mobile terminal 200, or to connect headphones or other electronic devices.

[0036] The charging management module 240 is used to receive charging input from a charger. While the charging management module 240 is charging the battery 242, it can also power the device through the power management module 241; the power management module 241 can also monitor the status of the battery.

[0037] The wireless communication function of the mobile terminal 200 can be implemented by antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the mobile terminal 200. The wireless communication module 260 can provide wireless communication solutions including WLAN (Wireless Local Area Networks) (such as Wi-Fi (Wireless Fidelity) network), BT (Bluetooth), GNSS (Global Navigation Satellite System), FM (Frequency Modulation), NFC (Near Field Communication), IR (Infrared) and the like applied to the mobile terminal 200.

[0038] The mobile terminal 200 can realize a display function and display a user interface through a GPU, a display screen 290 and an AP.

[0039] The mobile terminal 200 can realize the shooting function through the ISP, camera module 291, encoder, decoder, GPU, display screen 290 and AP, and can also realize the audio function through the audio module 270, speaker 271, receiver 272, microphone 273, headphone interface 274 and AP.

[0040] The sensor module 280 may include a depth sensor 2801 , a pressure sensor 2802 , a gyroscope sensor 2803 , an air pressure sensor 2804 , etc., to implement different sensing detection functions.

[0041] Indicator 292 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc. Motor 293 may generate vibration prompts, and may also be used for touch vibration feedback, etc. Buttons 294 include a power button, a volume button, etc.

[0042] The mobile terminal 200 may support one or more SIM card interfaces 295 for connecting a SIM card to implement functions such as calls and data communications.

[0043] Figure 3 An exemplary process of the illumination estimation method is shown, which can be performed by the server 110 or the client 120, including the following steps S310 to S340:

[0044] Step S310, obtaining an image to be processed whose illumination parameters are to be estimated.

[0045] The image to be processed refers to an image for which illumination parameter estimation is required, and may be an image of various types, such as a person image, a plant image, an animal image, or a building image, etc. The image to be processed may include one or more objects, such as a person, a plant, an animal, a building, etc., or other objects such as a table, a door, a window, a chair, a television, and food, etc.

[0046] In this exemplary embodiment, the image to be processed can be obtained in a variety of ways, for example, it can be directly collected by a camera configured in the terminal device; it can also be obtained from the image frame of the video stream; it can also be downloaded from the network or the cloud; or it can be obtained by intercepting a partial image from an existing image as needed, etc. The present disclosure does not make specific limitations on this.

[0047] In an exemplary embodiment, the above step S310 may include:

[0048] An image frame sequence for which illumination parameters are to be estimated is obtained, and valid frames in the image frame sequence are used as images to be processed.

[0049] Among them, the image frame sequence refers to a sequence of image frames arranged in a certain order, such as a time order, such as a video stream or a media stream. In this exemplary embodiment, the image frame sequence can be obtained first, for example, by directly collecting video stream data through the camera of the terminal device, or downloading the video stream data, etc. Considering that some images may not be able to accurately perform illumination estimation, or the image quality is poor, there is no need to perform illumination estimation, such as the camera is not aimed at the object being photographed, or the image is taken when the camera is facing the ground, or the image taken contains a large obstruction that has a great impact on the integrity of the picture, etc. Based on the above reasons, this exemplary embodiment can monitor each image frame in the image frame sequence to determine whether it is a valid frame, filter invalid frames, and use valid frames as images to be processed for illumination estimation, so as to prevent the waste of additional computing resources caused by illumination estimation of invalid frames, or interference with illumination estimation of other image frames.

[0050] In an exemplary embodiment, after acquiring the image frame sequence of the illumination parameters to be estimated, the illumination estimation method may further include the following steps:

[0051] Determine the camera extrinsic parameters of each image frame in the image frame sequence;

[0052] The camera optical axis direction corresponding to each image frame is determined according to the camera external parameters, and the image frame whose angle between the camera optical axis direction and the horizontal plane is less than a preset angle threshold is determined as a valid frame.

[0053] Considering that when the camera direction is greatly different from the scene being photographed, such as when it is facing the ground or the sky, the image will usually not contain an object, or contain fewer objects, and thus the need for illumination estimation of such images to restore the illumination effect of the object in the real scene is relatively weak, therefore, this exemplary embodiment can determine the valid frame from the camera shooting direction. Specifically, the camera extrinsic parameters of each image frame can be determined first, such as the rotation matrix and the translation matrix, and then the camera extrinsic parameters can be converted into Euler angle data, which can reflect the position of the camera, that is, the terminal device where the camera is located, in space, and further the camera optical axis direction can be determined according to the Euler angle. Among them, the camera optical axis direction refers to the straight line direction of the camera mirror and the focus, which can be considered as the direction of the camera when shooting. When the angle between the camera optical axis direction and the horizontal plane is less than the preset angle threshold, it means that the direction of the current camera is not completely deviated from the object being photographed, and the current image can be determined as a valid frame. The preset angle threshold can be customized according to actual needs. For example, the preset angle threshold can be set to 60 degrees. Then, when the angle between the camera optical axis direction and the horizontal plane is greater than or equal to 60 degrees, the image is considered to be an invalid frame.

[0054] Step S320: Process the image to be processed and determine the scene type of the scene in the image to be processed.

[0055] Among them, the scene in the image to be processed is the scene environment being photographed, and the scene type refers to the category attribute related to the light source. The scene type can be divided from multiple angles, for example, it can be a single light source scene type or a multi-light source scene type; it can also be an outdoor scene type or an indoor scene type. Usually, because there are multiple artificial light sources in the indoor environment, such as a plurality of turned-on fluorescent lamps or LED (Light-Emitting Diode Light) lamps in the room, the indoor scene can be considered as a multi-light source scene type, and in the outdoor scene without artificial light sources, when the daylight is used as the light source, it can usually be considered as a single light source scene type, etc. It should be noted that in some special scenes, such as indoors with good daylight, there may be a situation where the daylight source and the lamp light source coexist, which can be considered as a multi-light source scene type, and it can also be determined according to the intensity of the daylight source whether it can be divided into a single light source scene type, etc., and the present disclosure does not make specific restrictions on this.

[0056] This exemplary embodiment can determine the scene type of the scene by processing the image to be processed. For example, it can extract light source features from the image to be processed and analyze it to determine whether it is a single-light source scene type or a multi-light source scene type; or it can use a pre-trained machine learning model to perform image recognition, and judge based on the objects contained in the recognized image whether the current image to be processed is an image taken indoors or outdoors, etc. The present disclosure does not make specific limitations on this.

[0057] After obtaining the image to be processed, the image to be processed can be preprocessed, such as image denoising, image enhancement, etc., and further, the image can be copied based on the original image to be processed, the copied image can be used for image recognition, and the illumination estimation process can be performed based on the original image to be processed, etc.

[0058] Specifically, in an exemplary embodiment, Figure 4 As shown, the above step S320 may include the following steps:

[0059] Step S410, backing up the image to be processed and cropping the backup image according to the target size;

[0060] Step S420, normalizing the pixel values ​​in the cropped backup image to obtain an intermediate image;

[0061] Step S430: performing scene type recognition on the intermediate image to determine the scene type of the scene in the image to be processed.

[0062] In order to improve the accuracy of scene type recognition of the image to be processed, perform lighting estimation on the image to be processed that is complete and has more image information, and determine the corresponding lighting parameters, this exemplary embodiment can first back up the image to be processed, and perform a preprocessing process for other scene type recognition on the backed-up image, recognize the scene type based on the backup image, and then, based on the scene type recognition result, perform a lighting estimation process based on the image to be processed.

[0063] Specifically, considering that some areas in the image, such as edge areas, may include a lot of irrelevant information. In order to improve image processing efficiency and reduce the amount of calculation, after obtaining the backup image of the image to be processed, the backup image can be cropped according to the target size to determine the main area in the image to be processed, wherein the target size can be customized as needed, and the cropping method can also include multiple methods, for example, the minimum side of the backup image (such as the wide side of the rectangle) can be fixed unchanged, and then the midpoint of the maximum side (such as the long side of the rectangle) is used as a reference to determine the size to be cropped on the left and right, and then the backup image is cropped. Further, the image can be compressed to the target size according to a preset ratio, such as 360*240 pixels.

[0064] For the cropped backup image, the exemplary embodiment may also normalize the pixel values ​​of the pixels included therein to the range of [-1, 1] to facilitate subsequent image processing. Finally, the intermediate image is processed, such as using the intermediate image as input data of a machine learning model to identify the scene type, etc., to determine the scene type of the scene in the image to be processed.

[0065] It should be noted that this exemplary embodiment backs up the image to be processed, identifies the scene type based on the backup image, and performs lighting estimation based on the complete image to be processed, thereby avoiding the situation where direct recognition processing of the image to be processed causes loss of image information and affects the lighting estimation effect.

[0066] In an exemplary embodiment, if Figure 5 As shown, the above step S320 may include the following steps:

[0067] Step S510, identifying objects in the image to be processed by using a neural network model to obtain an object recognition result of the image to be processed;

[0068] Step S520: determining the scene type of the scene in the image to be processed according to the object recognition result.

[0069] Among them, the scene in the image to be processed usually includes a variety of elements, such as tables, chairs, beds, televisions, tea cups, and part of the door frame, etc., which can be regarded as objects contained in the image to be processed. The neural network model can determine the objects included or may be included in the image to be processed by extracting and analyzing the image features of the image to be processed, and the object recognition result can refer to which objects are included or may be included in the image to be processed, or the results of those categories of objects. In this exemplary embodiment, the neural network model can be a classification model, which can predict different types of objects included or may be included in the image to be processed, and determine the predicted probability value of each object, which probability value can reflect the possibility of the object in the image to be processed. Specifically, the backbone network of the neural network model can be EfficientNet-lite0-EfficientNet-lite7, MobileNet or multi-size transformer, etc., and the recognition results of various objects are obtained by connecting a softmax layer.

[0070] Furthermore, considering that factors such as the type and quantity of objects included in the image to be processed are different under different scene types, the scene type of the scene in the image to be processed can be determined based on the object recognition result. For example, a bed, a television, etc. are generally in an indoor scene, while a tree, a bench, etc. are generally in an outdoor scene, etc. Specifically, this exemplary embodiment can determine the scene type according to the object recognition result by a voting algorithm or a classification algorithm.

[0071] In order to improve the accuracy of determining the scene type, in an exemplary embodiment, the above object recognition result is the probability of the object in the image to be processed, for example, the probability of the bed in the image to be processed is 90%, the probability of the TV in the image to be processed is 89%, the probability of the bench in the image to be processed is 10%, etc. The probability of the object in the image to be processed can reflect the objects that may actually exist in the image to be processed. Further, the above step S520 may include the following steps:

[0072] Voting for the belonging category of the objects whose probability is in the top preset number of rankings, wherein the belonging category is the indoor scene category or the outdoor scene category;

[0073] The scene type of the scene in the image to be processed is determined according to the attribution category that wins the voting result.

[0074] This exemplary embodiment can determine the objects with probabilities ranking in the top preset number from the object recognition results. For example, the probabilities of a bed, a stool, a water cup, a potted plant, a television, and a bench in the image to be processed are 90%, 60%, 51%, 50%, 89%, and 29%, respectively. Then, the objects with the top three probabilities can be determined to be a bed, a television, and a stool. Further, by judging that the bed, the television, and the stool belong to the objects under the indoor scene category, it is determined that the scene type in the image to be processed is an indoor scene type. In actual applications, the object recognition results in the image to be processed may include more objects and the probabilities of the objects, which are only exemplified here. In addition, the preset number can be customized according to actual needs, for example, the preset number can be set to 10; the preset number can also be determined according to the total number of objects in the object recognition results. For example, when the total number of objects is large, a larger preset number can be set, and so on. The present disclosure does not make specific limitations on this.

[0075] This exemplary embodiment can use an algorithm or model to vote on the belonging categories of a preset number of objects. When voting, different weights can be set for objects with different rankings. For example, when voting for the top 10 objects, a higher weight can be set for the top 2 objects in probability ranking, and a lower weight can be set for the bottom 8 objects; or different weights can be set for objects in different probability rankings, etc. Further, according to the voting results, the scene type is determined. For example, when voting for the top 10 objects in probability ranking, a weight of 2 is set for the top 2 objects in probability ranking, and a weight of 1 is set for the bottom 8 objects in probability ranking. The total number of votes is 12, and the belonging category with more than 6 votes in the voting results is considered to be the winner. When the objects belonging to the indoor scene category have 7 votes and the objects belonging to the outdoor scene category have 5 votes, it can be determined that there are more objects in the indoor scene category, or the objects in the image to be processed basically belong to the indoor scene category. Therefore, it can be further determined that the scene type of the scene in the image to be processed is the indoor scene type.

[0076] It should be noted that the above process of determining the scene type may be performed on the image to be processed, or may be performed on an intermediate image generated by backing up the image to be processed, etc., and the present disclosure does not make any specific limitation on this.

[0077] Step S330: determining an illumination estimation strategy for the image to be processed according to the scene type.

[0078] Taking into account the differences in lighting effects between single-light source scene types or outdoor scene types, multi-light source scene types or indoor scene types, this exemplary embodiment may adopt targeted lighting estimation strategies to perform lighting estimation on the processed image according to the scene type, wherein the lighting estimation strategies may include multiple ones, such as lighting estimation strategies under outdoor scene types, or lighting estimation strategies under indoor scene types, etc.

[0079] Step S340: perform illumination estimation on the image to be processed using an illumination estimation strategy to determine illumination parameters of the image to be processed.

[0080] Furthermore, after determining the corresponding lighting estimation strategy, the lighting estimation is performed on the image to be processed using the lighting estimation strategy that is consistent with the current scene type, and the corresponding lighting parameters can be calculated. The lighting parameters may differ based on the different scene types in the image to be processed. For example, in an indoor scene type, the lighting parameters may be the position of the main light source or the brightness of the main light source and other lighting parameters. In an outdoor scene type, the lighting parameters may be the position of the sunlight source or the intensity of the sunlight source and other lighting parameters.

[0081] In an exemplary embodiment, when the scene type is an outdoor scene type, the illumination estimation strategy is an outdoor scene illumination estimation model, and the step S340 may include:

[0082] The outdoor factors are simulated by the outdoor scene illumination estimation model, and illumination estimation is performed on the image to be processed to determine the illumination parameters of the image to be processed in the outdoor scene.

[0083] Among them, outdoor factors refer to elements in the outdoor environment that affect the lighting parameters, such as the sun, sky, etc. The outdoor scene lighting estimation model can simulate the lighting parameters of the entire day through multiple parameters, such as the position and azimuth of the sun, the clarity or turbidity of the sky, and the exposure of the sun. Furthermore, when the pre-trained outdoor scene lighting estimation model is used to process the image to be processed, the position and intensity of the sun as a light source and the environmental map parameters of the sky, such as azimuth, exposure, turbidity, etc., can be output. Figure 6 A schematic diagram showing the effect of performing illumination estimation on an image to be processed of an outdoor scene type is shown.

[0084] In an exemplary embodiment, when the scene type is an indoor scene type, the illumination estimation strategy is an indoor scene illumination estimation model, and the step S340 may include:

[0085] An indoor scene illumination estimation model is used to estimate the illumination of the image to be processed, and illumination parameters of multiple spherical Gaussians in the image to be processed are obtained.

[0086] In this exemplary embodiment, an illumination model can be constructed, and according to the spherical Gaussian distribution function, the spherical Gaussian in the illumination model is mapped to the image, the spherical Gaussian is used to simulate the light source, and the illumination of the image to be processed is estimated by the indoor scene illumination estimation model, and the illumination parameters of the spherical Gaussian are solved, so as to obtain the illumination parameters of the image to be processed, which may include the position of the light source in the image to be processed, the intensity of the light source, etc. In addition, the processing based on the indoor scene illumination estimation model can also determine whether the current image to be processed contains outdoor sunlight and other results according to the illumination estimation result. The above-mentioned indoor scene illumination model can be obtained by training a neural network model with sample images, sample spherical Gaussians, and illumination parameter labels of sample spherical Gaussians. Figure 7 A schematic diagram showing the effect of performing illumination estimation on an image to be processed of an indoor scene type is shown.

[0087] Figure 8 A flowchart of another illumination estimation method in this exemplary embodiment is shown, which may specifically include the following steps:

[0088] Step S810, obtaining an image frame sequence of illumination parameters to be estimated;

[0089] Step S820, determining whether the current frame image in the image frame sequence is a valid frame;

[0090] If the current frame image is not a valid frame, switch to the next frame image as the current frame image, and jump to step S820 to determine the valid frame;

[0091] If the current frame image is a valid frame, execute

[0092] Step S830, taking the valid frame as the image to be processed, and performing image processing on the image to be processed to generate an intermediate image, wherein the image processing may include image backup, image cropping, pixel value normalization, etc.;

[0093] Step S840, using a lightweight neural network to perform object recognition on the intermediate image;

[0094] Step S850, voting on the scene type of the intermediate image according to the object recognition result to determine the scene type of the scene in the image to be processed;

[0095] When the voting result is an indoor scene type, execute

[0096] Step S860, using an indoor scene illumination estimation model to perform illumination estimation on the image to be processed, and determining illumination parameters of the image to be processed;

[0097] When the voting result is outdoor scene type, execute

[0098] Step S870: Use an outdoor scene illumination estimation model to perform illumination estimation on the image to be processed, and determine illumination parameters of the image to be processed.

[0099] In summary, in this exemplary embodiment, an image to be processed whose illumination parameters are to be estimated is obtained; the image to be processed is processed to determine the scene type of the scene in the image to be processed; according to the scene type, an illumination estimation strategy for the image to be processed is determined; and illumination estimation is performed on the image to be processed using the illumination estimation strategy to determine the illumination parameters of the image to be processed. On the one hand, this exemplary embodiment starts from the perspective that different scene types have different illumination effects, and judges the scene type of the scene in the image to be processed to determine an illumination estimation strategy that is more in line with the current scene type, and the illumination parameters obtained are more accurate and effective; on the other hand, this exemplary embodiment uses a simple judgment process, that is, it can realize flexible switching of corresponding illumination estimation strategies for illumination estimation in different application scenarios, and has strong pertinence and scene applicability, a simple process, and good illumination estimation effect.

[0100] The exemplary embodiment of the present disclosure also provides a lighting estimation device. Fig. 9 As shown, the illumination estimation device 900 may include: a module 910 for acquiring an image to be processed, for acquiring an image to be processed whose illumination parameters are to be estimated; a module 920 for determining a scene type of the image to be processed, and determining a scene type of the scene in the image to be processed; a module 930 for determining an illumination estimation strategy for the image to be processed according to the scene type; and a module 940 for obtaining illumination parameters for performing illumination estimation on the image to be processed using the illumination estimation strategy, and determining illumination parameters of the image to be processed.

[0101] In an exemplary embodiment, the module for acquiring images to be processed includes: a valid frame acquisition unit, which is used to acquire an image frame sequence of illumination parameters to be estimated, and use valid frames in the image frame sequence as images to be processed.

[0102] In an exemplary embodiment, the above-mentioned illumination estimation device also includes: a camera extrinsic parameter determination unit, which is used to determine the camera extrinsic parameters of each image frame in the image frame sequence after acquiring the image frame sequence of illumination parameters to be estimated; a valid frame determination unit, which is used to determine the camera optical axis direction corresponding to each image frame according to the camera extrinsic parameters, and determine the image frame whose angle between the camera optical axis direction and the horizontal plane is less than a preset angle threshold as a valid frame.

[0103] In an exemplary embodiment, the scene type determination module includes: a cropping unit, which is used to back up the image to be processed and crop the backup image according to the target size; a normalization unit, which is used to normalize the pixel values ​​in the cropped backup image to obtain an intermediate image; and a scene recognition unit, which is used to perform scene type recognition on the intermediate image to determine the scene type of the scene in the image to be processed.

[0104] In an exemplary embodiment, the scene type determination module includes: an object recognition unit, which is used to recognize objects in the image to be processed through a neural network model to obtain an object recognition result of the image to be processed; and a scene type determination unit, which is used to determine the scene type of the scene in the image to be processed based on the object recognition result.

[0105] In an exemplary embodiment, the object recognition result is the probability of the object in the image to be processed; the scene type determination unit includes: a voting subunit, used to vote for the belonging category of objects whose probabilities are ranked in the top preset number, wherein the belonging category is an indoor scene category or an outdoor scene category; a type determination subunit, used to determine the scene type of the scene in the image to be processed according to the belonging category that wins the voting result.

[0106] In an exemplary embodiment, the scene type includes an outdoor scene type or an indoor scene type.

[0107] In an exemplary embodiment, when the scene type is an outdoor scene type, the lighting estimation strategy is an outdoor scene lighting estimation model; the lighting parameter acquisition module includes: a first estimation unit, used to simulate outdoor factors through an outdoor scene lighting estimation model, and perform lighting estimation on the image to be processed, and determine the lighting parameters of the image to be processed in the outdoor scene.

[0108] In an exemplary embodiment, when the scene type is an indoor scene type, the lighting estimation strategy is an indoor scene lighting estimation model; the lighting parameter acquisition module includes: a first estimation unit, used to use the indoor scene lighting estimation model to perform lighting estimation on the image to be processed, and obtain the lighting parameters of multiple spherical Gaussians in the image to be processed.

[0109] The specific details of each part of the above device have been described in detail in the implementation method part, so they will not be repeated here.

[0110] The exemplary embodiments of the present disclosure further provide a computer-readable storage medium, which can be implemented in the form of a program product, including program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification, for example, to execute Figure 3 , Figure 4 , Figure 5 or Figure 8 The program product may be in the form of a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0111] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0112] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0113] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0114] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0115] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or implementations combining hardware and software aspects, which may be collectively referred to herein as "circuit", "module" or "system". Those skilled in the art will readily think of other implementations of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0116] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for estimating illumination, characterized in that: include: Obtaining an image to be processed for which illumination parameters are to be estimated; Processing the image to be processed to determine the scene type of the scene in the image to be processed; The scene type includes an outdoor scene type or an indoor scene type; Determining, according to the scene type, a lighting estimation strategy for the image to be processed; Using the illumination estimation strategy to perform illumination estimation on the image to be processed, and determining illumination parameters of the image to be processed; When the scene type is an outdoor scene type, the illumination estimation strategy is an outdoor scene illumination estimation model; The adopting the illumination estimation strategy to perform illumination estimation on the image to be processed to determine illumination parameters of the image to be processed includes: The outdoor factors are simulated by the outdoor scene illumination estimation model, and illumination estimation is performed on the image to be processed to determine the illumination parameters of the image to be processed in the outdoor scene; When the scene type is an indoor scene type, the illumination estimation strategy is an indoor scene illumination estimation model; The adopting the illumination estimation strategy to perform illumination estimation on the image to be processed to determine illumination parameters of the image to be processed includes: An indoor scene illumination estimation model is used to perform illumination estimation on the image to be processed, and illumination parameters of multiple spherical Gaussians in the image to be processed are obtained.

2. The method according to claim 1, characterized in that The step of obtaining the image to be processed for which the illumination parameters are to be estimated comprises: An image frame sequence for which illumination parameters are to be estimated is acquired, and valid frames in the image frame sequence are used as images to be processed.

3. The method according to claim 2, characterized in that After acquiring the image frame sequence to be estimated the illumination parameters, the method further comprises: Determining camera extrinsics for each image frame in the image frame sequence; The camera optical axis direction corresponding to each image frame is determined according to the camera extrinsic parameter, and the image frame whose angle between the camera optical axis direction and the horizontal plane is less than a preset angle threshold is determined as a valid frame.

4. The method according to claim 1, characterized in that: The step of processing the image to be processed to determine the scene type of the scene in the image to be processed includes: Backing up the image to be processed, and cropping the backup image according to the target size; Normalizing the pixel values ​​in the cropped backup image to obtain an intermediate image; The scene type is identified on the intermediate image to determine the scene type of the scene in the image to be processed.

5. The method according to claim 1, characterized in that The step of processing the image to be processed to determine the scene type of the scene in the image to be processed includes: Performing recognition processing on the object in the image to be processed by using a neural network model to obtain an object recognition result of the image to be processed; The scene type of the scene in the image to be processed is determined according to the object recognition result.

6. The method according to claim 5, characterized in that The object recognition result is the probability of the object in the image to be processed; The step of determining the scene type of the scene in the image to be processed according to the object recognition result includes: Voting for the belonging category of the objects whose probabilities are in the top preset number of rankings, wherein the belonging category is an indoor scene category or an outdoor scene category; The scene type of the scene in the image to be processed is determined according to the attribution category that wins the voting result.

7. A lighting estimation device, characterized in that: include: A module for acquiring an image to be processed, used for acquiring an image to be processed whose illumination parameters are to be estimated; A scene type determination module, used to process the image to be processed and determine the scene type of the scene in the image to be processed; the scene type includes an outdoor scene type or an indoor scene type; An estimation strategy determination module, used to determine the illumination estimation strategy of the image to be processed according to the scene type; An illumination parameter acquisition module, used to perform illumination estimation on the image to be processed by adopting the illumination estimation strategy, and determine the illumination parameters of the image to be processed; When the scene type is an outdoor scene type, the illumination estimation strategy is an outdoor scene illumination estimation model; The adopting the illumination estimation strategy to perform illumination estimation on the image to be processed and determining the illumination parameters of the image to be processed is configured as follows: The outdoor factors are simulated by the outdoor scene illumination estimation model, and illumination estimation is performed on the image to be processed to determine the illumination parameters of the image to be processed in the outdoor scene; When the scene type is an indoor scene type, the illumination estimation strategy is an indoor scene illumination estimation model; The adopting the illumination estimation strategy to perform illumination estimation on the image to be processed and determining the illumination parameters of the image to be processed is configured as follows: An indoor scene illumination estimation model is used to perform illumination estimation on the image to be processed, and illumination parameters of multiple spherical Gaussians in the image to be processed are obtained.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 6 by executing the executable instructions.

Citation Information

Patent Citations

  • Indoor scene illumination environment estimation method based on single image

    CN108460841A

  • 3D illumination estimation method and electronic equipment

    CN110458902A

  • Illumination estimation from a single image

    US20180260975A1