Method and device for measuring illumination intensity of home environment, and electronic equipment
By segmenting the target area from the home environment image, converting it into a grayscale image and calculating the brightness gradient, combined with the white balance and deep learning model, the problem of the measurement limitations of the light sensor is solved and the accuracy of the light intensity measurement is improved.
Patent Information
- Application Number
- CN202410909142.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-10
AI Technical Summary
In existing light measurement methods, the light sensor can only measure the light intensity at its location and cannot fully obtain the lighting conditions of the entire environment, resulting in reduced light intensity measurement accuracy.
By segmenting the target area from the collected home environment image, converting it into a target grayscale image, calculating the local brightness and brightness gradient, combining the white balance algorithm and the deep learning model, correcting the color deviation and exposure parameters, and determining the light intensity of the home environment.
It achieves a more comprehensive measurement of the illumination situation in the target area, improves the accuracy of light intensity measurement, avoids the limitation of the sensor position, and can measure the light intensity more accurately.
Smart Images

Figure CN118624015A
Abstract
Description
Technical Field
[0001] This application relates to the field of smart homes, and more specifically, to a method, apparatus, and electronic device for measuring the light intensity of a home environment. Background Technology
[0002] As smart home devices become more widespread, their complexity and capabilities are also increasing. Smart home devices are able to perform an increasing number of tasks, such as light measurement.
[0003] The related technology discloses a method for measuring illumination, which uses an illumination sensor to directly measure ambient brightness.
[0004] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art:
[0005] Although related technologies can directly obtain light intensity using light sensors, the data from this method is usually limited to the location of the sensor and cannot comprehensively obtain the lighting conditions of the entire environment, thus reducing the accuracy of light intensity measurement.
[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0007] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0008] This application provides a method, apparatus, and electronic device for measuring the light intensity in a home environment, thereby improving the accuracy of light intensity measurement.
[0009] In some embodiments, the method for measuring the light intensity of a home environment includes: determining a target home area image in an acquired home environment image; converting the target home area image into a target grayscale image and calculating the local brightness of the target grayscale image; and calculating the brightness gradient of the target home area based on the local brightness to determine the light intensity of the home environment.
[0010] Optionally, converting the target home area image into a target grayscale image includes: correcting the color deviation in the target home area image using a white balance algorithm; and converting the corrected target home area image into a target grayscale image.
[0011] Optionally, a white balance algorithm is used to correct color deviations in the target home area image, including: determining the target lighting mode based on the ambient light intensity value and / or user instructions, and adjusting the white balance parameters and / or exposure parameters of the target home area image according to the parameters in the target lighting mode to correct color deviations in the target home area image; or, a deep learning model is used to adjust the white balance parameters and / or exposure parameters of the target home area image based on the ambient light intensity to correct color deviations in the target home area image.
[0012] Optionally, calculating the local brightness of the target grayscale image includes: dividing the target grayscale image into one or more regions; calculating the average color value of each region to obtain the local brightness of each region.
[0013] Optionally, the brightness gradient of the target home area is calculated based on the local brightness, including: determining the gradient in the X direction and the gradient in the Y direction of the i-th region based on the local brightness of the i-th region of the target grayscale image; where i = 1, 2, 3, ..., n, and n represents the number of regions; calculating the illumination gradient vector of the i-th region based on the gradient in the X direction and the gradient in the Y direction; and determining the brightness gradient of the target home area based on the illumination gradient vectors of different regions of the target grayscale image.
[0014] Optionally, the illumination gradient vector of the i-th region is calculated based on the gradients in the X and Y directions, including calculating the illumination gradient vector according to the following formula:
[0015]
[0016] Among them, E i Let X be the illumination gradient vector of the i-th region. i Let Y be the gradient of the i-th region in the X direction. i Let be the gradient of the i-th region in the Y direction.
[0017] Optionally, the light intensity of the home environment can be determined as follows: determine the brightness gradient of different target home areas in the home environment; based on the brightness gradient of different target home areas, obtain multiple gradient vectors and generate a gradient map to determine the light intensity of the home environment.
[0018] Optionally, the method for measuring the light intensity of a home environment further includes: after determining the light intensity of the home environment, obtaining a home environment lighting dataset including home environment images and light intensity labels; training an initial light intensity visual model using the home environment lighting dataset to obtain a target light intensity visual model, so as to use the target light intensity visual model to measure the light intensity of the home environment.
[0019] In some embodiments, the apparatus for measuring the light intensity of a home environment includes a memory and a processor, the memory storing a computer program and the processor being configured to execute the method for measuring the light intensity of a home environment as described above through the computer program.
[0020] In some embodiments, an electronic device is provided, comprising: an electronic device body; and a device for measuring the light intensity of a home environment, as described above, mounted on the electronic device body.
[0021] The method, apparatus, and electronic device for measuring the light intensity of a home environment provided in this application can achieve the following technical effects:
[0022] In this embodiment, the target area is segmented from the acquired home environment image, the image of the target area is converted into a target grayscale image, and then the change in light intensity is determined based on the calculated brightness of the target grayscale image. This allows for a more accurate measurement of the light intensity in the target area. Compared to related technologies that are limited by the sensor's location and thus cannot comprehensively obtain the overall lighting conditions of the environment, this application does not use a sensor to measure light intensity. Therefore, it is not limited by the sensor's location and can more comprehensively obtain the lighting conditions of the target area, improving the accuracy of light intensity measurement.
[0023] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of the hardware environment for a method of measuring the light intensity of a home environment according to an embodiment of this application;
[0027] Figure 2 This is a schematic diagram of a method for measuring the light intensity in a home environment, provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of another method for measuring the light intensity of a home environment provided in an embodiment of this application;
[0029] Figure 4 This is a schematic diagram of another method for measuring the light intensity in a home environment provided in an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of another method for measuring the light intensity in a home environment provided in an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of an illumination gradient vector provided in an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of another method for measuring the light intensity in a home environment provided in an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of a device for measuring the light intensity of a home environment, provided in an embodiment of this application. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0035] It should be noted that the terms "first," "second," etc., used in the embodiments described in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0036] According to one aspect of the embodiments of this application, a method for measuring the light intensity of a home environment is provided. This method for measuring the light intensity of a home environment is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-described method for measuring the light intensity of a home environment can be applied to, for example... Figure 1The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0037] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0038] It should be understood that Figure 1 The number of terminal devices and servers shown is merely illustrative. Depending on actual needs, there can be any number of terminal devices and servers. For example, one terminal device can correspond to multiple servers.
[0039] Combination Figure 2 As shown in the embodiment of this application, a method for measuring the light intensity of a home environment is provided, comprising:
[0040] S201, The server determines the target home area image in the collected home environment images.
[0041] S202, the server converts the target home area image into a target grayscale image and calculates the local brightness of the target grayscale image.
[0042] S203, the server calculates the brightness gradient of the target home area based on the local brightness to determine the light intensity of the home environment.
[0043] The method provided in this application segmentes a target area from a collected home environment image, converts the target area image into a target grayscale image, and then determines the change in light intensity based on the calculated brightness of the target grayscale image, thus enabling a more accurate measurement of the light intensity in the target area. This application is not limited by the sensor's location, allowing for a more comprehensive acquisition of the lighting conditions in the target area and improving the accuracy of light intensity measurement.
[0044] exist Figure 2 In the illustrated embodiment, the method runs on a server. In other embodiments, the method can also run on a terminal device. Details are omitted here. In practical applications, the steps implemented by the terminal device and the server can be configured according to the actual situation.
[0045] Optionally, converting the target home area image into a target grayscale image includes: correcting the color deviation in the target home area image using a white balance algorithm; and converting the corrected target home area image into a target grayscale image.
[0046] Combination Figure 3 As shown in the embodiment of this application, another method for measuring the light intensity of a home environment is provided, including:
[0047] S301, The server determines the target home area image in the collected home environment images.
[0048] S302, the server uses a white balance algorithm to correct color deviations in the target home area image.
[0049] S303, the server converts the corrected target home area image into a target grayscale image and calculates the local brightness of the target grayscale image.
[0050] S304, the server calculates the brightness gradient of the target home area based on the local brightness to determine the light intensity of the home environment.
[0051] This allows for the accurate reproduction of an object's colors in its real-world environment, resulting in more accurate images and thus improved light intensity accuracy. For example, white balance algorithms can employ the gray-world assumption method or the maximum inter-class variance method.
[0052] In practical applications, a weighted average method is used to convert the corrected target residential area image into a target grayscale image. For example, the following formula is used to convert the corrected image into the target grayscale image:
[0053] gray=0.2989×red+0.5870×green+0.1140×blue
[0054] Where gray represents luminance, red represents the red luminance component, green represents the green luminance component, and blue represents the blue luminance component.
[0055] The corrected target residential area image is also converted to a target grayscale image using a simple averaging method. For example, the corrected image is converted to a target grayscale image using the following formula:
[0056] gray = (red + green + blue) / 3
[0057] Where gray represents luminance, red represents the red luminance component, green represents the green luminance component, and blue represents the blue luminance component.
[0058] Optionally, a white balance algorithm is used to correct color deviations in the target home area image, including: determining the target lighting mode based on the ambient light intensity value, and adjusting the white balance parameters and / or exposure parameters of the target home area image based on the parameters in the target lighting mode, so as to correct color deviations in the target home area image.
[0059] The target lighting modes include incandescent mode, and / or, daylight mode, and / or, low light mode, and / or, cloudy mode, and / or, grass mode. White balance parameters include the weights and / or offsets for each RGB channel. Exposure parameters include exposure time, and / or, focal length, and / or, ISO. This allows for more accurate image processing, thereby improving the accuracy of light intensity measurement.
[0060] For example, if the ambient light intensity range is set to 100 to 200, and the current ambient light intensity is 85, you can choose a cloudy mode or a low-light mode to increase exposure parameters, such as increasing the ISO. For instance, if the system sets the standard white color temperature to 6500 Kelvin, and the current color temperature is detected to be 3000 Kelvin, indicating the image is too warm (yellowish), you can increase the weight of the green and blue channels and decrease the weight of the red channel.
[0061] It should be understood that in practical applications, the parameters for each target lighting mode and the corresponding range of ambient light intensity values for each target lighting mode are set according to the scenario and user needs. This application does not impose any limitations on this.
[0062] Optionally, a white balance algorithm is used to correct color deviations in the target home area image, including: determining the target mode according to user instructions, and adjusting the white balance parameters and / or exposure parameters of the target home area image according to the parameters in the target lighting mode, so as to correct color deviations in the target home area image.
[0063] For example, users can provide commands through a graphical user interface, command-line interface, or other interactive methods, such as switching to grass mode. Upon receiving the command, the system sets the white balance and exposure parameters corresponding to the grass mode, thereby controlling the brightness and detail of the image. This allows users to more precisely control the image processing effects, improving the user experience.
[0064] Optionally, a white balance algorithm is used to correct color deviations in the target home area image, including: using a deep learning model to adjust the white balance parameters and / or exposure parameters of the target home area image according to the parameters in the target lighting mode, so as to correct color deviations in the target home area image.
[0065] The white balance parameters include the weights and / or offsets for each RGB channel, while the exposure parameters include exposure time, and / or focal length, and / or ISO. This allows the system to automatically learn and understand the optimal image processing strategies under different lighting conditions, helping to more accurately adjust white balance and exposure parameters, adapting to various scene changes, and improving the user experience.
[0066] For example, a deep learning model may include a CNN or a Faster R-CNN.
[0067] Optionally, calculating the local brightness of the target grayscale image includes: dividing the target grayscale image into one or more regions; calculating the average color value of each region to obtain the local brightness of each region.
[0068] Combination Figure 4 As shown in the embodiment of this application, a method for measuring the light intensity of a home environment is provided, comprising:
[0069] S401, the server determines the target home area image in the collected home environment images.
[0070] S402, the server converts the target home area image into a target grayscale image.
[0071] S403, the server divides the target grayscale image into one or more regions.
[0072] S404: The server calculates the average color value of each region to obtain the local brightness of each region.
[0073] S405: The server calculates the brightness gradient of the target home area based on the local brightness to determine the light intensity of the home environment.
[0074] This allows us to obtain brightness information from different regions of the target grayscale image, which helps in analyzing the details and texture of the image, and thus aids in subsequent monitoring of illumination changes in the target area.
[0075] For example, a grid-based method can be used to divide a desktop grayscale image into M×N regions, such as 10×10 or 20×20. Then, the illumination intensity of each region is calculated.
[0076] Optionally, the illumination intensity of each region can be calculated, including: calculating the average color value of each region to obtain the illumination intensity of each region. This allows for the quantification of the illumination intensity of each region, which is helpful for subsequent monitoring of illumination changes in the target region.
[0077] For example, let's say the target area is the desktop. First, the desktop grayscale image can be divided into M×N regions using a grid method, such as 10×10 or 20×20. Then, iterate through all pixels in the desktop grayscale image to obtain the grayscale value of all pixels in each region. Finally, sum the grayscale values of all pixels and divide by the total number of pixels to obtain the average color value of each region, which represents the illumination intensity of each region.
[0078] Optionally, calculating the local brightness of the target grayscale image includes: inputting the target grayscale image into a deep learning model to obtain the local brightness of the target grayscale image. This allows for model prediction of local brightness, providing more accurate analysis results and helping to handle complex lighting conditions and scene changes.
[0079] Optionally, the brightness gradient of the target home area is calculated based on the local brightness, including: determining the gradient in the X direction and the gradient in the Y direction of the i-th region based on the local brightness of the i-th region of the target grayscale image; where i = 1, 2, 3, ..., n, and n represents the number of regions; calculating the illumination gradient vector of the i-th region based on the gradient in the X direction and the gradient in the Y direction; and determining the brightness gradient of the target home area based on the illumination gradient vectors of different regions of the target grayscale image.
[0080] Combination Figure 5 As shown in the embodiment of this application, a method for measuring the light intensity of a home environment is provided, comprising:
[0081] S501, the server determines the target home area image in the collected home environment images.
[0082] S502, the server converts the target home area image into a target grayscale image and calculates the local brightness of the target grayscale image.
[0083] S503, the server determines the gradient in the X direction and the gradient in the Y direction of the i-th region based on the local brightness of the i-th region of the target grayscale image; where i = 1, 2, 3, ..., n, and n represents the number of regions.
[0084] S504, the server calculates the illumination gradient vector of the i-th region based on the gradient in the X direction and the gradient in the Y direction.
[0085] S505: The server determines the brightness gradient of the target home area based on the illumination gradient vectors of different areas of the target grayscale image.
[0086] This allows for the quantification of changes in light intensity within the image, which helps improve the performance and accuracy of subsequent steps. For example... Figure 6 As shown, each region has X and Y directions, with the X and Y directions perpendicular to each other. For each region, edge detection operators such as Sobel or Prewitt can be used to obtain the x- and y-directional gradients of the image in that region. The gradients in the two directions are combined into a lighting gradient vector, whose magnitude represents the intensity of the brightness change in that region. In practical applications, the local brightness of the target grayscale image can be input into a deep learning model to obtain changes in lighting intensity. This allows for the prediction of lighting intensity changes through a deep learning model, providing more accurate analysis results.
[0087] For example, the system can use historical data and deep learning models to predict the brightness trend of a target area over a future period. For instance, based on sunshine hours and current office lighting conditions, the system can predict the light intensity for the next few hours. When light sources are added or removed from the environment, the system can identify and predict the impact of these changes on ambient brightness in advance.
[0088] Optionally, the illumination gradient vector of the i-th region is calculated based on the gradients in the X and Y directions, including calculating the illumination gradient vector according to the following formula:
[0089]
[0090] Among them, E i Let X be the illumination gradient vector of the i-th region. i Let Y be the gradient of the i-th region in the X direction. i Let be the gradient of the i-th region in the Y direction.
[0091] For example, if X i A larger value in the X direction indicates that the light intensity in that area varies drastically in the X direction, and there may be edges or textures present. i The larger the value of E, the more drastic the change in light intensity in that area. i A sudden increase in the value of a light source in a certain area may indicate a significant change in the lighting conditions of that area. Significant changes include darkening, brightening, the addition of a new light source to the scene, the removal of a light source from the scene, or objects blocking part of the light source.
[0092] For example, if Xi A larger value in the X direction indicates that the light intensity in that area varies drastically in the X direction, and there may be edges or textures present. i The larger the value of E, the more drastic the change in light intensity in that area. i A sudden increase in the value of a light source in a certain area may indicate a significant change in the lighting conditions of that area. Significant changes include darkening, brightening, the addition of a new light source to the scene, the removal of a light source from the scene, or objects blocking part of the light source.
[0093] Optionally, the light intensity of the home environment can be determined as follows: determine the brightness gradient of different target home areas in the home environment; based on the brightness gradient of different target home areas, obtain multiple gradient vectors and generate a gradient map to determine the light intensity of the home environment.
[0094] In the embodiments disclosed herein, such as Figure 6 As shown, a lighting gradient vector is synthesized from the gradients in each direction. A gradient map is generated based on the gradient vector of each region. In practical applications, the gradient value is calculated at each pixel (or the center of a small grid) to generate a new image as a gradient map. This new image shows the brightness changes of all areas on the entire desktop screen, thus displaying the lighting intensity changes of the target grayscale image. By observing and analyzing the generated gradient map, it is possible to determine whether there is a significant change in light in a certain part, or whether there is a clear gradient trend overall. In addition, the gradient magnitude (using methods such as heatmaps) and gradient direction arrows can be processed and displayed simultaneously. This provides a more comprehensive understanding of the lighting conditions of the target area and improves the accuracy of light intensity measurement.
[0095] Optionally, after generating the gradient map, the process also includes analyzing the gradient map to obtain analysis results. This helps to infer the lighting direction and intensity in different areas of the scene, which is helpful for subsequent understanding of the scene's lighting conditions, eliminating the effects of uneven lighting, or performing lighting compensation.
[0096] Optionally, the method for measuring the light intensity of a home environment further includes: after determining the light intensity of the home environment, obtaining a home environment lighting dataset including home environment images and light intensity labels; training an initial light intensity visual model using the home environment lighting dataset to obtain a target light intensity visual model, so as to use the target light intensity visual model to measure the light intensity of the home environment.
[0097] Combination Figure 7 As shown in the embodiment of this application, a method for measuring the light intensity of a home environment is provided, comprising:
[0098] S701, the server determines the target home area image in the collected home environment images.
[0099] S702, the server converts the target home area image into a target grayscale image and calculates the local brightness of the target grayscale image.
[0100] S703: The server calculates the brightness gradient of the target home area based on the local brightness to determine the light intensity of the home environment.
[0101] S704, the server obtains a home environment lighting dataset that includes home environment images and light intensity labels.
[0102] S705 The server uses a home environment lighting dataset to train an initial light intensity visual model to obtain a target light intensity visual model, which is then used to measure the light intensity of the home environment.
[0103] In this embodiment of the disclosure, a home environment lighting dataset containing home environment images and light intensity labels can be collected. This dataset can be used to train an initial light intensity visual model. The trained target light intensity visual model can measure the light intensity of the home environment through the home environment images.
[0104] Combination Figure 8 As shown, this application embodiment provides a device 80 for measuring the light intensity of a home environment, including a processor 800 and a memory 801. Optionally, the device 80 may further include a communication interface 802 and a bus 803. The processor 800, communication interface 802, and memory 801 can communicate with each other via the bus 803. The communication interface 802 can be used for information transmission. The processor 800 can call logical instructions in the memory 801 to execute the method for measuring the light intensity of a home environment described in the above embodiment.
[0105] Furthermore, the logic instructions in the aforementioned memory 801 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0106] The memory 801, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 800 executes functional applications and data processing by running the program instructions / modules stored in the memory 801, that is, it implements the method for measuring the light intensity of the home environment in the above embodiments.
[0107] The memory 801 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 801 may include high-speed random access memory and may also include non-volatile memory.
[0108] This disclosure provides an electronic device, including: an electronic device body, and the aforementioned device for measuring the light intensity of a home environment. The device for measuring the light intensity of a home environment is mounted on the electronic device body. The mounting relationship described herein is not limited to placement within the electronic device body, but also includes mounting connections with other components of the electronic device, including but not limited to physical connections, electrical connections, or signal transmission connections. Those skilled in the art will understand that the device for measuring the light intensity of a home environment can be adapted to suitable electronic device bodies to achieve other feasible embodiments.
[0109] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A method for measuring light intensity in a home environment, characterized in that: include: Determining a target home area image in the collected home environment image; Convert the target home area image into a target grayscale image and calculate the local brightness of the target grayscale image; Based on the local brightness, the brightness gradient of the target home area is calculated to determine the light intensity of the home environment.
2. The method according to claim 1, characterized in that Convert the target home area image into a target grayscale image, including: Use white balance algorithm to correct color deviation in the target home area image; Convert the corrected target home area image into a target grayscale image.
3. The method according to claim 2, characterized in that Use the white balance algorithm to correct color deviations in the target home area image, including: determining a target lighting mode according to the ambient light intensity value and / or a user instruction, and adjusting white balance parameters and / or exposure parameters of the target home area image according to parameters in the target lighting mode to correct color deviation in the target home area image; or Using a deep learning model, the white balance parameters and / or exposure parameters of the target home area image are adjusted according to the ambient light intensity to correct the color deviation in the target home area image.
4. The method according to claim 1, wherein Calculate the local brightness of the target grayscale image, including: Divide the target grayscale image into one or more regions; The average color value of each area is calculated to obtain the local brightness of each area.
5. The method according to claim 1, wherein Calculate the brightness gradient of the target home area based on the local brightness, including: According to the local brightness of the i-th region of the target grayscale image, determine the gradient of the i-th region in the X direction and the gradient in the Y direction; where i = 1, 2, 3, ..., n, where n represents the number of regions; Calculate the illumination gradient vector of the i-th region based on the gradient in the X direction and the gradient in the Y direction; The brightness gradient of the target home area is determined based on the illumination gradient vectors of different areas of the target grayscale image.
6. The method according to claim 5, characterized in that According to the gradient in the X direction and the gradient in the Y direction, the illumination gradient vector of the i-th region is calculated, including calculating the illumination gradient vector according to the following formula: Among them, E i is the illumination gradient vector of the i-th region, X i is the gradient of the i-th region in the X direction, Y i is the gradient of the i-th region in the Y direction.
7. The method according to claim 1, characterized in that Determine the light intensity in your home as follows: Determine the brightness gradient of different target home areas in the home environment; Based on the brightness gradients of different target home areas, multiple gradient vectors are obtained and a gradient map is generated to determine the light intensity of the home environment.
8. The method according to any one of claims 1 to 7, characterized in that Also includes: After determining the light intensity of the home environment, a home environment light dataset including a home environment image and a light intensity label is obtained; The initial light intensity vision model is trained using the home environment lighting dataset to obtain a target light intensity vision model, which is then used to measure the light intensity of the home environment.
9. A device for measuring light intensity in a home environment, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method for measuring light intensity in a home environment according to any one of claims 1 to 8 through the computer program.
10. An electronic device, characterized in that: include: Electronic device body; The device for measuring light intensity in a home environment as claimed in claim 9 is installed on an electronic device body.
