A method for identifying indoor and outdoor scenes and an electronic device
By using information detection from optical and laser devices, combined with flicker and noise analysis, indoor and outdoor scenes can be identified and shooting modes adjusted, solving the difficulties of electronic devices in identification and photography, and improving positioning and shooting effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-04
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies struggle to effectively identify indoor and outdoor scenes, impacting the positioning, navigation, and photo mode selection functions of electronic devices.
By acquiring the flicker information of the photosensitive device and the laser histogram information of the laser device, the presence of artificial light sources in the environment is detected, and the scene type is determined based on noise level information and threshold comparison. The shooting mode is then adjusted in combination with time and location information.
Accurately identify indoor and outdoor scenes, improve the positioning accuracy and photo quality of electronic devices, and enhance the shooting quality in outdoor scenes.
Smart Images

Figure CN122149660A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method and electronic device for recognizing indoor and outdoor scenes. Background Technology
[0002] Currently, electronic devices require location services in many scenarios to identify indoor or outdoor environments.
[0003] For example, in some scenarios, electronic devices may need to locate their own position and identify whether they are currently indoors or outdoors, in order to assist in indoor navigation, geofencing monitoring, recommending indoor and outdoor sports activities, determining the availability of GPS positioning, and automatically turning off Wi-Fi connection if the user is outdoors.
[0004] In a photography scenario, the electronic device needs to identify whether the target scene is indoors or outdoors in order to further identify the type of shooting mode. For example, it can identify whether the shooting mode is sunset mode, moon mode, or cloudy mode, and then perform corresponding processing based on the identified shooting mode.
[0005] Therefore, how to identify indoor or outdoor scenes is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] This application provides a method and electronic device for identifying indoor or outdoor scenes.
[0007] To achieve the above objectives, this application adopts the following technical solution:
[0008] Firstly, this application provides a method for recognizing indoor and outdoor scenes, which may include:
[0009] The process involves acquiring flicker information from a photosensitive device, then detecting the presence of artificial light sources in the environment of the electronic device based on this flicker information, obtaining the detection results, acquiring the laser histogram information corresponding to each pixel of the laser device, and determining the mean value of the noise level information detected by the laser device based on each laser histogram information. Finally, based on the comparison result of this mean value with a first noise threshold and the detection results, it can be determined whether the target scene or target object is in an outdoor scene or an indoor scene. The mean value of the noise level information detected by the laser device reflects the magnitude of the detected ambient light noise. The larger the mean value, the greater the influence of ambient light noise on the detected noise level information. Since outdoor scenes are generally more affected by ambient light noise, while indoor scenes are generally less affected, and by determining whether the presence of artificial light sources in the environment of the electronic device can determine whether the ambient light noise is caused by artificial light sources, it is possible to determine whether the target scene or target object is in an outdoor scene or an indoor scene.
[0010] In some possible implementations, the mean value of the noise level information detected by the laser device is determined based on each laser histogram information. Specifically, this can be:
[0011] The corresponding laser histogram information is obtained from each laser histogram. Then, the corresponding noise level information and crosstalk status can be obtained from each laser histogram. It can then be determined whether the crosstalk status is abnormal. For example, it can be determined whether the error between the crosstalk status value and the crosstalk status value in the ideal state corresponding to the noise level information is within a preset difference. If the error is within the preset difference, the crosstalk status is considered normal, and the noise level information is not suppressed; therefore, no compensation for the noise level information is needed. If the error is outside the preset difference, the crosstalk status is considered abnormal, and the noise level information is suppressed; therefore, compensation for the noise level information is needed.
[0012] Finally, the mean value of the noise level information detected by the laser device is determined based on each compensated noise level information.
[0013] In some possible implementations, the target scene or object is determined to be either an outdoor or indoor scene based on the comparison and detection results. Specifically, this can be achieved by:
[0014] If the electronic device is currently in a photography scene and the comparison result indicates that the average noise level is greater than the first noise threshold, it means that the noise detected by the laser device is significantly affected by ambient light noise. If it is also determined that there are no artificial light sources in the environment where the electronic device is located, then the ambient light noise can be determined to be generated by natural light, and the target scene can be determined to be an outdoor scene. If the electronic device is in a photography scene and the comparison result indicates that the average noise level is less than or equal to the noise threshold, it means that the noise detected by the laser device is less affected by ambient light noise. If it is also determined that there are no artificial light sources in the environment where the electronic device is located, the target scene can be determined to be an indoor scene. If the electronic device is in a non-photography scene and the comparison result indicates that the average noise level is greater than the first noise threshold, it means that the noise detected by the laser device is significantly affected by ambient light noise. If it is also determined that there are no artificial light sources in the environment where the electronic device is located, then the ambient light noise can be determined to be generated by natural light, and the target object can be determined to be an outdoor scene. If the electronic device is in a photography scene and the comparison result indicates that the average noise level is less than or equal to the noise threshold, it means that the noise detected by the laser device is less affected by ambient light noise. If it is also determined that there are no artificial light sources in the environment where the electronic device is located, the target object can be determined to be an indoor scene. This allows you to determine whether the target object or scene is indoors or outdoors.
[0015] In some possible implementations, when the target scene is determined to be an outdoor scene, this application can also determine the type of shooting mode corresponding to the target scene according to preset scene recognition rules. For example, in this embodiment, shooting modes include sunset mode, moon mode, sun mode, and cloudy mode. The type of shooting mode corresponding to the target scene is determined to perform different processing for different shooting scenes. For instance, when sunset mode is triggered, the camera's exposure and white balance settings can be adjusted to enhance the saturation and contrast of colors in the sky, capturing the warm tones of the sunset and details of the sky. When sun mode is triggered, the electronic device can adjust exposure and ISO to avoid overexposure and capture details of the sun, while also performing HDR enhancement. When moon mode is triggered, the electronic device can perform HDR enhancement and ghosting removal. When cloudy mode is triggered, the electronic device can adjust white balance and exposure compensation to adapt to lower light conditions and enhance the color and contrast of the image to compensate for the reduced natural light due to cloud cover.
[0016] For example, solar patterns can be identified in the following ways:
[0017] This application embodiment can obtain the timestamp of the current moment, and combine it with the location information of the electronic device. If the timestamp indicates that the current location of the electronic device is during the day and the noise map is determined to be consistent with the characteristics of the sun, then the current shooting mode can be determined to be the sun mode, and the electronic device can trigger the sun mode.
[0018] Specifically, whether a noise map conforms to solar characteristics can be determined by the following method: the maximum noise in the noise map is identified as the center of the sun, and the noise in the noise map is determined to be the maximum at the center of the sun. Then, the noise gradually decreases from the center of the sun along the surrounding area. If so, it can be determined that the noise map conforms to solar characteristics.
[0019] For example, sunset patterns can be identified in the following ways:
[0020] The system can obtain the current timestamp and combine it with the location information of the electronic device. If the timestamp indicates that the current location of the electronic device is in the sunset phase and the noise map is determined to match the characteristics of the sun, then the current shooting mode can be determined to be the sunset mode, thereby triggering the sunset mode. The electronic device can then perform corresponding processing. The sunset phase can be determined based on the current timestamp and the location information of the electronic device.
[0021] The current timestamp is 18:20 on December 1, 2024. The location information of the electronic device indicates that it is in Xinjiang. The season corresponding to the timestamp is winter. The sunset time in Xinjiang during winter is generally 18:00-19:00. Therefore, the sunset period can be determined to be one hour before and after sunset, that is, the sunset period is 17:00-20:00. It can be seen that the current timestamp indicates that the current location of the electronic device is in the sunset period. And since the noise map is determined to be consistent with the characteristics of the sun, the current shooting mode can be determined to be sunset mode, thus triggering sunset mode. Figure 10 As shown, the electronic device can then perform the corresponding processing.
[0022] For example, a cloudy day pattern can be identified in the following ways:
[0023] It can be determined whether the noise level fluctuation in the noise concentration area of the noise map is small, i.e., whether the noise map conforms to the characteristics of the sun. Specifically, the maximum noise value in the noise map can be determined. With the maximum noise value as the center, a noise concentration area is selected according to a preset window. Then, it can be determined whether the noise level fluctuation in the noise concentration area of the noise map is small, i.e., whether it is less than the preset fluctuation level. This can be determined by comparing the standard deviation with the preset standard deviation threshold. If the standard deviation of the noise level in the noise concentration area is less than the preset standard deviation threshold, it can be considered that the noise level fluctuation in the noise concentration area of the noise map is less than the preset fluctuation level, i.e., the noise level fluctuation in the noise concentration area of the noise map is small. If the noise level fluctuation in the noise concentration area of the noise map is small, it means that the sun was not detected, i.e., the noise map does not conform to the characteristics of the sun.
[0024] Then it can be determined whether the average value of the compensated noise level information is within the preset range. If it is determined that the noise level fluctuation in the noise concentration area of the noise map is small and the average value of the compensated noise level information is within the preset range, then the cloudy mode is triggered.
[0025] For example, the moon pattern can be identified in the following ways:
[0026] To determine whether the maximum noise in the noise map is less than the third noise threshold, it's important to note that the moon reflects sunlight, making moonlight relatively dimmer than sunlight. Consequently, in moon mode, the maximum noise in the noise map is significantly lower than in the sun mode. Therefore, the third noise threshold can be determined based on the maximum noise in the noise map under sun mode.
[0027] To determine whether the average noise level of the noise concentration area is less than the fourth noise threshold, it should be noted that in the Moon mode, the average noise level of the noise concentration area in the noise map is much lower than that in the Sun mode. The fourth noise threshold here can be determined based on the average noise level of the noise concentration area in the Sun mode noise map.
[0028] If the maximum noise is determined to be less than the third noise threshold and the average noise level in the noise concentration area is determined to be less than the fourth noise threshold, then the moon mode is triggered.
[0029] Secondly, this application provides an electronic device, including: a processor and a memory;
[0030] The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the method described in the first aspect.
[0031] Thirdly, this application provides a computer storage medium including computer instructions that, when executed on a mobile terminal, cause the electronic device to perform the method described in the first aspect. Attached Figure Description
[0032] Figure 1 A schematic diagram of a camera application's shooting preview interface provided in an embodiment of this application;
[0033] Figure 2 A flowchart illustrating an indoor / outdoor scene recognition method provided in this application embodiment;
[0034] Figure 3 A schematic diagram of a generated laser histogram provided in an embodiment of this application;
[0035] Figure 4A flowchart illustrating a method for identifying solar patterns provided in this application embodiment;
[0036] Figure 5 A cloudy day scene and corresponding noise map are provided for embodiments of this application;
[0037] Figure 6 This application provides an embodiment of a halogen lamp scene and a corresponding noise diagram;
[0038] Figure 7 A noise diagram corresponding to the sun and a halogen lamp is provided for an embodiment of this application;
[0039] Figure 8 A schematic diagram illustrating an electronic device triggering a solar mode, provided as an embodiment of this application;
[0040] Figure 9 A flowchart illustrating a method for identifying sunset patterns provided in this application embodiment;
[0041] Figure 10 A schematic diagram illustrating an electronic device triggering a solar mode, provided as an embodiment of this application;
[0042] Figure 11 A flowchart illustrating a method for identifying cloudy day patterns provided in this application embodiment;
[0043] Figure 12 A schematic diagram illustrating the triggering of a cloudy mode on an electronic device, as provided in an embodiment of this application;
[0044] Figure 13 A flowchart illustrating a method for identifying moon patterns provided in this application embodiment;
[0045] Figure 14 A schematic diagram illustrating the triggering of a moon mode by an electronic device, as provided in an embodiment of this application;
[0046] Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0047] Figure 16 This application provides a software architecture for an electronic device. Detailed Implementation
[0048] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.
[0049] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0050] Currently, electronic devices require location services in many scenarios to identify indoor or outdoor environments.
[0051] For example, in some scenarios, electronic devices may need to locate their own position and identify whether they are currently indoors or outdoors. Based on the location results, they can assist in indoor navigation, geofencing monitoring, recommending indoor and outdoor service cards, recommending appropriate sun protection measures or indoor ventilation strategies, recommending indoor and outdoor sports, reminding users to leave indoor spaces, determining the availability of GPS positioning, and automatically turning off Wi-Fi connections when detecting whether the user is outdoors.
[0052] In photo-taking scenarios, such as Figure 1 As shown, Figure 1 This is a schematic diagram of the shooting preview interface of a camera application. The shooting preview interface of the camera application may include functional controls such as shooting control 101. The electronic device needs to identify whether the target scene in the shooting preview interface is an indoor scene or an indoor-outdoor scene in order to further identify the type of shooting mode in the shooting scene. For example, it can identify whether the shooting mode is sunset mode, moon mode, or cloudy mode, and then perform corresponding processing according to the identified shooting mode.
[0053] Therefore, how to identify indoor or outdoor scenes is a technical problem that urgently needs to be solved by those skilled in the art.
[0054] In view of this, this application proposes a method for identifying indoor and outdoor scenes, including: acquiring laser histogram information corresponding to each pixel of a laser device; determining the mean value of noise level information detected by the laser device based on each laser histogram information; acquiring flicker information of a photosensitive device; detecting whether there is an artificial light source in the environment where the electronic device is located based on the flicker information; obtaining a detection result; and determining whether the target scene or target object is in an outdoor scene or an indoor scene based on the comparison result of the mean value and a first noise threshold and the detection result. The mean value of noise level information detected by the laser device can reflect the noise level of the detected ambient light. The larger the mean value, the greater the influence of ambient light noise on the detected noise level information. Since outdoor scenes are generally more affected by ambient light noise, while indoor scenes are generally less affected by ambient light noise, and by determining whether there is an artificial light source in the environment where the electronic device is located, it can be determined whether the ambient light noise is caused by an artificial light source, thereby determining whether the target scene or target object is in an outdoor scene or an indoor scene.
[0055] To make the technical solution of this application clearer and easier to understand, the following description, in conjunction with the above embodiments and corresponding drawings, using an electronic device as the executing entity and the operating system in the electronic device being the Android operating system, introduces the indoor and outdoor scene recognition method provided by the embodiments of this application, which can be referred to as Embodiment 1. Figure 2 As shown, the indoor / outdoor scene recognition method provided in Embodiment 1 of this application may include:
[0056] S21. Obtain the flicker information of the photosensitive device.
[0057] The photosensitive device of the electronic device detects the flicker frequency of the light source to obtain flicker information, that is, the flicker information of the photosensitive device. The photosensitive device is also called a flicker device or a light source flicker detection sensor, which can be used to reduce or eliminate shooting interference caused by the flicker of artificial light sources.
[0058] The processor of an electronic device can acquire the flicker information of the photosensitive device.
[0059] S22. Detect whether there is an artificial light source in the environment where the electronic device is located based on the flicker information of the photosensitive device.
[0060] The processor of an electronic device can detect the presence of artificial light sources in the environment in which the electronic device is located based on the flicker information of the photosensitive device.
[0061] For example, since artificial light sources (such as AC-driven incandescent lamps, high-pressure mercury lamps, and straight-tube fluorescent lamps) usually have a specific flicker frequency, the processor can determine whether the flicker frequency of the light source is a specific flicker frequency based on the flicker information. For example, it can determine whether the flicker frequency of the light source is 50Hz, 60Hz, or 100Hz. If it is determined that the flicker frequency of the light source is a specific flicker frequency, it can be determined that the detection result indicates that there is an artificial light source in the environment where the electronic device is located. If it is determined that the flicker frequency of the light source is not a specific flicker frequency, for example, the flicker frequency of the light source is 8.8Hz, it can be determined that there is no artificial light source in the environment where the electronic device is located. It should be noted that the specific flicker frequency here can be set by those skilled in the art according to actual needs. 50Hz, 60Hz, and 100Hz are just examples and are not limited here.
[0062] S23. Obtain the laser histogram information of the laser device detection.
[0063] Laser devices in electronic devices can detect laser histogram information. These laser devices are active sensors that use laser technology for distance measurement. Their working principle is based on the emission and reception of laser light; the distance to a target object is calculated by measuring the time difference between the laser pulse's emission and reception. Laser devices can be either lidar sensors or depth cameras; this is not a limitation.
[0064] For example, a laser device can emit laser pulses at a preset frequency in a specified direction. Once the emitted laser pulses come into contact with a target object, scattering occurs, and some of the scattered light is reflected back along the original path. The laser device receives the reflected photon signals and can calculate the time of flight of each photon signal. Each photon signal may include information such as the distance between the target object and the laser device, and reflectivity. The time of flight refers to the total time it takes for a photon to travel from the laser device to the target object and back to the laser device. The time to complete the round trip is the time it takes for the photon to travel to and from the target object.
[0065] Laser devices can sort all received photon signals according to their time of flight. The sorted photon signals are then grouped into time intervals, and the number of photon signals within each time interval is counted. The number of photon signals falling within each time interval is calculated. This number represents the frequency of the photon signals received within that time range.
[0066] Based on the statistical results, a laser histogram corresponding to each pixel is generated. For example, the generated laser histogram could be as follows: Figure 3As shown, the horizontal axis of the histogram can represent the flight time (or distance, since the speed of light is constant and flight time can be directly converted to distance), and the vertical axis represents the number of photon signals received within that time range.
[0067] like Figure 3 Signal peaks will be generated in the laser histogram shown, for example, with Figure 3 Taking the generation of two signal peaks in the laser histogram as an example, with peak A and peak B as examples, the peak value of each signal peak can represent a specific distance, and the height of the peak can represent the reflection intensity at that distance. By analyzing these peaks, the position and size of the target object can be determined. Figure 3 The histogram shown may also include noise regions, for example Figure 3 As shown in region C, region C represents the noise level information of the received ambient light. This noise level information refers to the intensity and characteristics of the noise signal generated by ambient light (such as sunlight, moonlight, starlight, and various scattered light) entering the laser device when measuring the distance to a target object. Here, the ambient light noise can be 940nm. These noise signals may interfere with the effective detection of the target by the laser device. It should be noted that the laser device can include multiple pixels, each corresponding to a laser histogram. Therefore, the laser histogram corresponding to each pixel of the laser device can be obtained based on the above principle.
[0068] After the laser device generates a laser histogram, the processor of the electronic device can obtain laser histogram information from the laser histogram (laser histogram information may include, for example, noise level information, signal peak information, etc.).
[0069] S24. Obtain noise level information and crosstalk status from the laser histogram information.
[0070] The processor can obtain the corresponding noise level information and crosstalk state, also known as Xtalk state, from each laser histogram.
[0071] Crosstalk refers to the phenomenon where an optical signal emitted from the transmitter is reflected after hitting the glass back cover and then received by the receiver. Crosstalk can be identified by abnormal peaks in the histogram. These abnormal peaks may indicate that photon signals from adjacent channels are interfering with each other, meaning that the photon signal received by one channel affects the reading of another channel.
[0072] S25. Compensate for noise level information using crosstalk status.
[0073] The processor of an electronic device can use crosstalk status to compensate for noise level information.
[0074] For example, if a laser device comprises 1200 pixels, 1200 laser histograms can be generated (each pixel can correspond to one laser histogram). The processor can obtain the corresponding laser histogram information from each laser histogram. Furthermore, the processor can obtain the corresponding noise level information and crosstalk status from each laser histogram. Then, it can determine whether the crosstalk status is abnormal; if it is abnormal, the processor can use the crosstalk status to compensate for the corresponding noise level information.
[0075] Specifically, when electronic devices leave the factory, the correspondence between the noise level information detected by the laser device and the ideal crosstalk state can be calibrated. For example, when the noise level information is 200, according to the correspondence, the value of the crosstalk state under the ideal state should be 1000. As another example, when the noise level information is 300, according to the correspondence, the value of the crosstalk state under the ideal state should be 800. The processor can acquire the noise level information and the corresponding crosstalk state value for each laser histogram. Then, it determines whether the error between the crosstalk state value and the crosstalk state value under the ideal state corresponding to the noise level information is within a preset difference. If the error is within the preset difference, the crosstalk state is considered normal, and the noise level information is not suppressed. In this case, there is no need to compensate for the noise level information using the crosstalk state. If the error is outside the preset difference, the crosstalk state is considered abnormal, and the noise level information is suppressed. In this case, compensation for the noise level information using the crosstalk state is required. It should be noted that the preset difference can be set according to actual needs, for example, it can be set to 100. This is not a limitation here.
[0076] For example, taking a preset difference value of 100, if the processor obtains a noise level of 200 for a certain laser histogram and a crosstalk state value of 800, and considering that the ideal crosstalk state value should be 1000 when the noise level is 200, then this crosstalk state can be determined to be an abnormal state requiring compensation for the noise level information. For example, the noise level information can be compensated using the crosstalk state based on phase noise compensation algorithms and crosstalk error compensation methods.
[0077] S26. Using the comparison results of the mean of the compensated noise level information and the first noise threshold, as well as the detection results, determine whether the target scene or the target object is in an outdoor scene or an indoor scene.
[0078] The electronic device can determine the average noise level information after compensation of the laser histogram information for each pixel. For example, it can determine the average noise level information after compensation of 1200 laser histogram information. Then, it can compare the average noise level with a first noise threshold, and then compare the magnitude of the average noise level with the noise threshold. The first noise threshold can be determined according to the device noise of the laser device. For example, if the device noise is 100, then the first noise threshold needs to be higher than the device noise. For example, it can be set to 150. Of course, it should be noted that 150 here is just an example. Those skilled in the art can set the value of the first noise threshold according to actual needs, such as 130 or 140, etc., without limitation.
[0079] In some possible implementations, the electronic device can determine whether it is currently in a photo-taking scene. If the electronic device is currently in a photo-taking scene and the comparison result indicates that the average noise value is greater than the first noise threshold, it means that the noise detected by the laser device is greatly affected by ambient light noise, and it can be determined that the target scene (here, the target scene can refer to the scene displayed in the camera application preview interface of the electronic device) is an outdoor scene.
[0080] If the electronic device is currently in a photo-taking scenario and the comparison result indicates that the average noise value is less than or equal to the noise threshold, it means that the noise detected by the laser device is less affected by ambient light noise, and it can be determined that the target scene is an indoor scene.
[0081] If the electronic device is currently in a non-photography scene and the comparison result indicates that the average noise value is greater than the first noise threshold, it means that the noise detected by the laser device is greatly affected by ambient light noise, and it can be determined that the target object (here, the target object refers to the electronic device) is in an outdoor scene.
[0082] If the electronic device is currently in a non-photography scene and the comparison result indicates that the noise mean is less than or equal to the noise threshold, it means that the noise detected by the laser device is less affected by ambient light noise, and it can be determined that the target object is in an indoor scene.
[0083] Furthermore, to further improve the accuracy of determining whether the target object and scene are indoors or outdoors, flicker information can be used for judgment. If the comparison results indicate that the target object (referring to the electronic device) is outdoors, flicker information can be used to determine whether there is an artificial light source in the environment. If the electronic device is currently in a non-photographing scene, the comparison result indicates that the average noise level is greater than a first noise threshold, and it is determined that there is no artificial light source in the environment, then the target object (referring to the electronic device) is outdoors. If the device is currently in a non-photographing scene, the comparison result indicates that the average noise level is less than or equal to the first noise threshold, and the detection result indicates that there is no artificial light source in the environment, then the target object is indoors.
[0084] If the comparison results determine that the target scene is outdoors, further judgment can be made using flicker information. This involves determining whether there is an artificial light source in the environment where the electronic device is located. If the electronic device is currently in a photography scene, the comparison result indicates that the average noise level is greater than a first noise threshold, and it is determined that there is no artificial light source in the environment where the electronic device is located, then the target scene can be determined to be outdoors. If the electronic device is currently in a photography scene, and the comparison result indicates that the average noise level is less than or equal to the first noise threshold, and the detection result indicates that there is no artificial light source in the environment where the electronic device is located, then the target scene can be determined to be indoors.
[0085] In this embodiment, the electronic device can acquire the flicker information of the photosensitive device and detect whether there is an artificial light source in the environment where the electronic device is located based on the flicker information of the photosensitive device. The electronic device can acquire the laser histogram information corresponding to each pixel of the laser device, obtain the noise level information and crosstalk status from the laser histogram information, and then determine whether the crosstalk status is abnormal. If it is abnormal, the corresponding noise level information can be compensated using the crosstalk status. Then, the average value of the compensated noise level information can be compared with a first noise threshold. If the electronic device is currently in a photography scene and the comparison result indicates that the average noise value is greater than the first noise threshold, it means that the noise detected by the laser device is greatly affected by ambient light noise. If it is also determined that there is no artificial light source in the environment where the electronic device is located, it can be determined that the ambient light noise is generated by natural light, and the target scene can be determined to be an outdoor scene. If the electronic device is in a photography scene and the comparison result indicates that the average noise value is less than or equal to the noise threshold, it means that the noise detected by the laser device is less affected by ambient light noise. If it is also determined that there is no artificial light source in the environment where the electronic device is located, the target scene can be determined to be an indoor scene. If the electronic device is in a non-photographing scenario and the comparison result indicates that the average noise value is greater than the first noise threshold, it means that the noise detected by the laser device is significantly affected by ambient light noise. If it is also determined that there are no artificial light sources in the environment where the electronic device is located, then the ambient light noise can be determined to be generated by natural light, and the target object can be determined to be in an outdoor scene. If the electronic device is in a photographing scenario and the comparison result indicates that the average noise value is less than or equal to the noise threshold, it means that the noise detected by the laser device is less affected by ambient light noise. If it is also determined that there are no artificial light sources in the environment where the electronic device is located, then the target object can be determined to be in an indoor scene. In this way, it is possible to determine whether the target object or the target scene is in an indoor or outdoor scene.
[0086] Example 1 mainly describes how to identify whether the target scene or formation is indoors or outdoors. When the target scene is outdoors and in a photography scenario, the electronic device can also identify different shooting modes in the photography scenario according to preset scene recognition rules (i.e., the recognition methods in Examples 2, 3, 4, and 5). For example, in this application embodiment, the shooting modes are sunset mode, moon mode, sun mode, and cloudy mode. Different processing can be performed for different photography scenarios. For example, when sunset mode is triggered, the camera's exposure and white balance settings can be adjusted to enhance the saturation and contrast of colors in the sky, capture the warm tones of the sunset and the details of the sky. When sun mode is triggered, the electronic device can adjust the exposure and ISO to avoid overexposure and capture the details of the sun, and can also perform HDR enhancement. When moon mode is triggered, the electronic device can perform HDR enhancement and ghosting removal. When cloudy mode is triggered, the electronic device can adjust the white balance and exposure compensation to adapt to lower light conditions and enhance the color and contrast of the image to compensate for the reduction of natural light due to cloud cover. It should be noted that this application only uses sunset mode, moon mode, sun mode and cloudy mode as examples for the description. Those skilled in the art can also set other shooting modes according to actual needs. For example, the shooting mode can also be rain mode and snow mode. When rain mode or snow mode is triggered, the electronic device can adjust the exposure, contrast and saturation to enhance the shooting effect in rain or snow.
[0087] The method for identifying solar patterns provided in this application, which can be referred to as Embodiment Two, will be described below with reference to the accompanying drawings. Figure 4 As shown, it includes:
[0088] S41. Obtain the flicker information of the photosensitive device.
[0089] S42. Detect the presence of artificial light sources in the environment of electronic devices based on the flicker information of photosensitive devices.
[0090] S43. Obtain the laser histogram information of the laser device detection.
[0091] S43. Obtain the laser histogram information of the laser device detection.
[0092] S44. Obtain noise level information and crosstalk status from the laser histogram information.
[0093] S45. Compensate for noise level information using crosstalk status.
[0094] S46. Using the comparison results of the mean of the compensated noise level information and the first noise threshold, as well as the detection results, determine whether the target scene or the target object is in an outdoor scene or an indoor scene.
[0095] Steps S41 to S46 in this embodiment are similar in principle to steps S21 to S26 in Embodiment 1, and will not be described in detail here. For details, please refer to the description in Embodiment 1.
[0096] S47. Determine whether the noise map matches solar characteristics.
[0097] The processor of an electronic device can generate a noise map using the compensated noise level information in each laser histogram, and then determine whether the noise map conforms to solar characteristics. For example, the processor can use a noise generation algorithm to generate the noise map by interpolating random values or gradients of surrounding vertices, such as... Figure 5 As shown, Figure 5 (a) in the image is a scene shot on a cloudy day. Figure 5 (b) in the image is the noise map corresponding to the cloudy scene, such as... Figure 6 As shown, Figure 6 (a) in the image shows a scene shot with halogen lamps. Figure 6 (b) in the diagram is the noise diagram corresponding to the halogen lamp scene. Figure 5 In Figure (b) and Figure (6), the horizontal and vertical axes are pixel coordinates, and the color represents the intensity of noise. The noise map, also known as a noise spectrum or noise texture, is a graphical representation of the noise distribution in an image or signal. In the embodiments of this application, the noise map can characterize the noise level of each pixel of the laser device.
[0098] For example, a way to determine whether a noise map conforms to solar characteristics is to identify the maximum noise in the noise map as the center of the sun, determine whether the noise in the noise map is the largest at the center of the sun, and then gradually decrease the noise from the center of the sun along the surrounding area. If so, it can be determined that the noise map conforms to solar characteristics.
[0099] In some possible ways of implementation, such as Figure 7 As shown, Figure 7 (a) in the diagram is the noise map corresponding to the sun. Figure 7 (b) in the diagram is the noise map corresponding to the halogen lamp. It can be seen that they are quite similar. Since step S42 can identify that there is no artificial light source in the current environment of the electronic device, if it is determined that the noise map matches the characteristics of the sun, it can be determined that the current shooting mode is the sun mode, and the sun mode is triggered so that the electronic device can perform the corresponding processing.
[0100] In some possible implementations, in order to further and more accurately determine that the shooting mode is the sun mode and improve the accuracy of recognizing the sun mode, this application embodiment can also obtain the current time stamp and combine the timestamp and the location information of the electronic device to make a further judgment, as shown in step S48.
[0101] S48. Obtain the current timestamp. If the timestamp indicates that it is currently daytime and the noise map matches the solar characteristics, then determine to trigger the solar mode.
[0102] This application embodiment can also obtain the current timestamp and combine it with the location information of the electronic device. If the timestamp indicates that the current location of the electronic device is during the day and the noise map is determined to match the characteristics of the sun, then the current shooting mode can be determined to be the sun mode, and the electronic device can trigger the sun mode. Figure 8 As shown, the electronic device can then perform the corresponding processing.
[0103] In some possible implementations, timestamps can also be used to identify the sun at different times; for example, the distribution of the visible spectrum in an image differs between the midday sun and sunset. Electronic devices can then adjust the exposure and ISO based on the identified time.
[0104] The method for identifying sunset patterns provided in this application, which can be referred to as Embodiment Three, is described below with reference to the accompanying drawings. Figure 9 As shown, it includes:
[0105] S91. Obtain the flicker information of the photosensitive device.
[0106] S92. Detect the presence of artificial light sources in the environment of electronic devices based on the flicker information of photosensitive devices.
[0107] S93. Obtain laser histogram information for laser device detection.
[0108] S93. Obtain laser histogram information for laser device detection.
[0109] S94. Obtain noise level information and crosstalk status from laser histogram information.
[0110] S95. Compensate for noise level information using crosstalk status.
[0111] S96. Using the comparison results of the mean of the compensated noise level information and the first noise threshold, as well as the detection results, determine whether the target scene or the target object is in an outdoor scene or an indoor scene.
[0112] Steps S91 to S96 in this embodiment are similar in principle to steps S21 to S26 in Embodiment 1, and will not be described in detail here. For details, please refer to the description in Embodiment 1.
[0113] S97. Determine whether the noise map matches solar characteristics.
[0114] Step S97 in this embodiment is similar in principle to step S47 in embodiment two, and will not be described in detail here. For details, please refer to the description in embodiment two.
[0115] S98. Obtain the current timestamp. If the timestamp indicates that the current time is in the sunset phase and the noise map matches the characteristics of the sun, then determine to trigger the sunset mode.
[0116] The processor can obtain the current timestamp and combine it with the location information of the electronic device. If the timestamp indicates that the current location of the electronic device is in the sunset stage and the noise map is determined to be consistent with the characteristics of the sun, then the current shooting mode can be determined to be the sunset mode, thereby triggering the sunset mode. The electronic device can then perform corresponding processing. The sunset stage can be determined based on the current timestamp and the location information of the electronic device.
[0117] For example, if the current timestamp is 18:20 on December 1, 2024, and the location information of the electronic device indicates that the device is in Xinjiang, and the season corresponding to the timestamp is winter, then the sunset time in Xinjiang during winter is generally 18:00-19:00. Therefore, the sunset period can be determined to be one hour before and after sunset, i.e., 17:00-20:00. It can be seen that the current timestamp indicates that the current location of the electronic device is during sunset. Furthermore, if the noise map matches the characteristics of the sun, then the current shooting mode can be determined to be sunset mode, thus triggering sunset mode. Figure 10 As shown, the electronic device can then perform the corresponding processing.
[0118] It should be noted that if the processor simultaneously recognizes that the current shooting mode is both sun mode and sunset mode, the sunset mode will be triggered first.
[0119] The method for identifying cloudy weather patterns provided in this application, which can be referred to as Embodiment Four, is described below with reference to the accompanying drawings. Figure 11 As shown, it includes:
[0120] S111. Obtain the flicker information of the photosensitive device.
[0121] S112. Detect whether there is an artificial light source in the environment where the electronic device is located based on the flicker information of the photosensitive device.
[0122] S113. Obtain the laser histogram information of the laser device detection.
[0123] S113. Obtain the laser histogram information of the laser device detection.
[0124] S114. Obtain noise level information and crosstalk status from the laser histogram information.
[0125] S115. Compensate for noise level information using crosstalk status.
[0126] S116. Using the comparison results of the mean of the compensated noise level information and the first noise threshold, as well as the detection results, determine whether the target scene or the target object is in an outdoor scene or an indoor scene.
[0127] S117. Determine whether the noise level fluctuation in the noise concentration area of the noise map is small.
[0128] The processor can determine whether the noise level fluctuations in areas of concentrated noise in the noise map are small.
[0129] For example, the processor can determine the maximum noise value in the noise map, select a noise concentration area with the maximum noise value as the center according to the preset window, and then determine whether the noise level fluctuation in the noise concentration area of the noise map is small, that is, whether it is less than the preset fluctuation level. Through step S116, it can be determined that the target scene is an outdoor scene, and thus the noise level is strong. If the noise level fluctuation in the noise concentration area of the noise map is small, it means that the sun has not been detected, that is, the noise map does not meet the characteristics of the sun.
[0130] Specifically, standard deviation is an important parameter for measuring the degree of noise fluctuation. The processor can then calculate the standard deviation of the noise concentration area. The smaller the standard deviation, the smaller the fluctuation in the noise level, and the more stable the noise level; the larger the standard deviation, the greater the fluctuation in the noise level, and the less stable the noise level. Thus, by comparing the standard deviation with a preset standard deviation threshold, it can be determined whether the noise level fluctuation in the noise concentration area of the noise map is small. If the standard deviation of the noise level in the noise concentration area is less than the preset standard deviation threshold, then the noise level fluctuation in the noise concentration area of the noise map can be considered less than the preset fluctuation level, i.e., the noise level fluctuation in the noise concentration area of the noise map is small. Conversely, if the standard deviation of the noise level in the noise concentration area is greater than or equal to the preset standard deviation threshold, then the noise level fluctuation in the noise concentration area of the noise map can be considered greater than or equal to the preset fluctuation level, i.e., the noise level fluctuation in the noise concentration area of the noise map is large. It should be noted that the standard deviation threshold here can be preset according to actual needs and is not subject to further limitations here.
[0131] S118. Determine whether the mean value of the compensated noise level information is within the preset range.
[0132] The processor can determine whether the average value of the compensated noise level information is within the preset range. It should be noted that in cloudy scenarios, the sun may be obscured by clouds, and thus the average value of the compensated noise level information in cloudy mode is much lower than that in sun mode.
[0133] If the average value of the compensated noise level information is determined to be greater than the first noise threshold in step S116, and the average value of the compensated noise level information is less than the second noise threshold, then it can be determined that the average value of the compensated noise level information is within the preset range. This indicates that the current scene is outdoors and no sun is detected in the current noise map. The second noise threshold can be determined based on the average value of the compensated noise level information in the sun mode. For example, if the average value of the compensated noise level information in the sun mode is 150, then the second noise threshold can be set to 100. Of course, this is just an example. Those skilled in the art can set it according to their needs, and it is not limited here.
[0134] S119. If it is determined that the noise level fluctuation in the noise concentration area of the noise map is small and the average value of the compensated noise level information is within the preset range, then the cloudy mode is triggered.
[0135] If, through steps S117 and S118, it is determined that the noise level fluctuation in the noise concentration area of the noise map is small and the average value of the compensated noise level information is within a preset range, then the cloudy mode is triggered. Figure 12 As shown, the electronic device can then perform the corresponding processing.
[0136] The method for recognizing moon patterns provided in this application, which can be referred to as Embodiment Five, will be described below with reference to the accompanying drawings. Figure 13 As shown, it includes:
[0137] S131. Obtain the flicker information of the photosensitive device.
[0138] S132. Detect the presence of artificial light sources in the environment of electronic devices based on the flicker information of photosensitive devices.
[0139] S133. Obtain the laser histogram information of the laser device detection.
[0140] S134. Obtain noise level information and crosstalk status from the laser histogram information.
[0141] S135. Compensate for noise level information using crosstalk status.
[0142] S136. Using the comparison results of the mean of the compensated noise level information and the first noise threshold, as well as the detection results, determine whether the target scene or the target object is in an outdoor scene or an indoor scene.
[0143] Steps S131 to S136 in this embodiment are similar in principle to steps S21 to S26 in Embodiment 1, and will not be described in detail here. For details, please refer to the description in Embodiment 1.
[0144] S137. Determine whether the maximum noise is less than the third noise threshold.
[0145] The processor can determine whether the maximum noise in the noise map is less than the third noise threshold. It should be noted that the moon reflects the sun's light, so the moonlight is relatively dimmer than the sunlight. Therefore, in the moon mode, the maximum noise in the noise map is much lower than the maximum noise in the sun mode noise map.
[0146] Then, it is determined whether the maximum noise of the noise map is less than the third noise threshold. This third noise threshold can be determined based on the maximum noise of the noise map under solar mode. For example, if the maximum noise of the noise map under solar mode is 200, then the third noise threshold can be set to 150. Of course, this is just an example, and those skilled in the art can set it according to their needs, which is not limited here.
[0147] S138. Determine whether the average noise level in the noise concentration area is less than the fourth noise threshold.
[0148] The processor can determine whether the noise level of the noise concentration area is less than the noise threshold. It should be noted that in the Moon mode, the noise level of the noise concentration area in the noise map is much lower than that in the Sun mode.
[0149] Then, it is determined whether the average noise level of the noise concentration area is less than the fourth noise threshold. The fourth noise threshold can be determined based on the average noise level of the noise concentration area in the noise map under solar mode. For example, if the average noise level of the noise concentration area in the noise map under solar mode is 150, then the fourth noise threshold can be set to 100. Of course, this is just an example. Those skilled in the art can set it according to their needs, and there is no limitation here.
[0150] S139. If it is determined that the maximum noise is less than the third noise threshold and the average noise level in the noise concentration area is less than the fourth noise threshold, then the moon mode is triggered.
[0151] If it is determined through steps 137 and S138 that the maximum noise is less than the third noise threshold and the average noise level in the noise concentration area is less than the fourth noise threshold, then the cloudy mode is triggered, and the electronic device can perform the corresponding processing.
[0152] In some possible implementations, to further and more accurately determine that the shooting mode is the pre-moon mode and improve the accuracy of moon mode recognition, embodiments of this application can also obtain the current timestamp and combine it with the location information of the electronic device. If the timestamp indicates that the current location of the electronic device is at night, and the maximum noise is determined to be less than the third noise threshold, and the average noise level of the noise concentration area is determined to be less than the fourth noise threshold, then the current shooting mode can be determined to be the moon mode, thereby triggering the moon mode. Figure 14 As shown, the electronic device can then perform the corresponding processing.
[0153] The method provided in this application can be executed on an electronic device. In some embodiments, the electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (PDA), wearable electronic device, smartwatch, etc. This application does not impose any special limitations on the specific form of the above-mentioned electronic device. In this embodiment, the structure of the electronic device can be as follows: Figure 15 As shown, Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0154] like Figure 15 As shown, the electronic device may include a processor 1501, a sensor module 1502, a display screen 1503, a laser device 1504, and a light sensor 1505, etc. The sensor module 1502 may include a touch sensor 1502A, etc.
[0155] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0156] Processor 1501 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0157] The controller can serve as the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.
[0158] The laser device 1504 is an active sensor that uses laser technology for distance measurement. Its working principle is based on the emission and reception of laser light; the distance to a target object is calculated by measuring the time difference between the laser pulse emission and reception. The laser device can be either a lidar sensor or a depth camera; no specific limitation is made here.
[0159] The 1505 optical sensor, also known as a flicker sensor or light source flicker detection sensor, can be used to reduce or eliminate shooting interference caused by flickering of artificial light sources.
[0160] The processor 1501 can also be used to acquire the laser histogram information corresponding to each pixel of the laser device, determine the mean value of the noise level information detected by the laser device based on each laser histogram information, acquire the flicker information of the photosensitive device, detect whether there is an artificial light source in the environment where the electronic device is located based on the flicker information, obtain the detection result, and determine whether the target scene or target object is in an outdoor scene or an indoor scene based on the comparison result of the mean value and the first noise threshold and the detection result.
[0161] In some embodiments, the processor 1501 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, a universal asynchronous receiver / transmitter (UART) interface, or a mobile industry processor interface (MIPI).
[0162] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 1501 may include multiple I2C buses. The processor 1501 can couple to the sensor module 1502 through different I2C bus interfaces. For example, the processor 1501 can couple to the sensor module 1502 through an I2C interface, enabling the processor 1501 and the sensor module 1502 to communicate via the I2C bus interface, thereby realizing the touch function of the electronic device.
[0163] The electronic device implements display functions through a GPU, sensor module 1502, and application processor. The GPU is a microprocessor for image processing, connecting the sensor module 1502 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 1501 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0164] Sensor module 1502 is used to display images, videos, etc. Sensor module 1502 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N sensor modules 1502, where N is a positive integer greater than 1.
[0165] The sensor module 1502 of the electronic device can display a series of graphical user interfaces (GUIs), which serve as the main screen of the electronic device. Generally, the sensor module 1502 of the electronic device has a fixed size, and only a limited number of controls can be displayed within it. A control is a GUI element, a software component contained within an application, that controls all data processed by the application and interactive operations related to that data. Users can interact with controls through direct manipulation, thereby reading or editing information related to the application. Generally, controls can include visual interface elements such as icons, widgets, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0166] Sensor module 1502, also known as a "touch device," can be disposed on a touchscreen, which is composed of sensor modules 1502 and 1502. Sensor module 1502 detects touch operations applied to or near it. The touch sensor transmits the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through sensor module 1502. In other embodiments, sensor module 1502 may also be disposed on the surface of the electronic device, in a different location.
[0167] The software architecture of this application is described below. The software architecture of the electronic device of this application can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example for illustrative purposes. Figure 16 As shown:
[0168] like Figure 16 As shown, the software architecture of the electronic device in this application can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example for illustrative purposes.
[0169] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system libraries, and the kernel layer.
[0170] The application layer may include a series of application packages. For example, it may include camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.
[0171] The application framework layer provides applications with an application programming interface (API) and a programming framework. The application framework layer includes some predefined functions. In this embodiment, the application framework may include a view system and a display system Android Interface Definition Language (AIDL) interface, as well as an Activity Recognition Management Service (ARMS).
[0172] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface for setting up an application may include views for displaying text and views for displaying images.
[0173] The application layer and framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0174] The kernel layer is the layer between hardware and software. The kernel layer provided in this application embodiment includes a display driver, an audio driver, and a sensor driver.
[0175] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0176] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for recognizing indoor and outdoor scenes, characterized in that, include: The system acquires the flicker information of the photosensitive device, detects whether there is an artificial light source in the environment where the electronic device is located based on the flicker information, and obtains the detection result. The laser histogram information corresponding to each pixel of the laser device is obtained, and the mean value of the noise level information detected by the laser device is determined based on each laser histogram information. Based on the comparison between the mean and the first noise threshold, and the detection results, it is determined whether the target scene or the target object is in an outdoor scene or an indoor scene.
2. The method according to claim 1, characterized in that, The step of determining the mean value of the noise level information detected by the laser device based on each laser histogram information includes: Obtain the corresponding noise level information and crosstalk status for each laser histogram; The crosstalk state is used to compensate for the corresponding noise level information; The mean value of the noise level information detected by the laser device is determined based on each compensated noise level information.
3. The method according to claim 1 or 2, characterized in that, If the electronic device is not in a photo-taking scenario, based on the comparison results and the detection results, it is determined whether the target scene or target object is in an outdoor scene or an indoor scene, including: If the comparison result indicates that the noise mean is greater than the first noise threshold and the detection result indicates that there is no artificial light source in the environment where the electronic device is located, then it is determined that the target object is in an outdoor scene. If the comparison result indicates that the noise mean is less than or equal to the first noise threshold and the detection result indicates that there is no artificial light source in the environment where the electronic device is located, then the target object is determined to be in an indoor scene.
4. The method according to claim 1 or 2, characterized in that, If the electronic device is in a photo-taking scenario, based on the comparison results and detection results, it is determined whether the target scene or target object is in an outdoor scene or an indoor scene, including: If the comparison result indicates that the noise mean is greater than the first noise threshold and the detection result indicates that there is no artificial light source in the environment where the electronic device is located, then the target scene is determined to be an outdoor scene. If the comparison result indicates that the noise mean is less than or equal to the first noise threshold and the detection result indicates that there is no artificial light source in the environment where the electronic device is located, then the target scene is determined to be an indoor scene.
5. The method according to claim 4, characterized in that, When the target scene is determined to be an outdoor scene, the method further includes: Based on preset scene recognition rules, the type of shooting mode corresponding to the target scene is determined.
6. The method according to claim 5, characterized in that, The step of determining the type of shooting mode corresponding to the target scene according to preset scene recognition rules includes: Determine the noise map detected by the laser device and the timestamp corresponding to the current moment; If the timestamp indicates that the electronic device is currently in daylight and the noise map matches the characteristics of the sun, then the shooting mode is determined to be a solar mode.
7. The method according to claim 5, characterized in that, The step of determining the type of shooting mode corresponding to the target scene according to preset scene recognition rules includes: Determine the noise map detected by the laser device and the timestamp corresponding to the current moment; If the timestamp indicates that the electronic device is currently in the sunset phase and the noise map matches the characteristics of the sun, then the shooting mode type is determined to be sunset mode, and the sunset phase is determined based on the timestamp and the location information of the electronic device.
8. The method according to claim 5, characterized in that, The step of determining the type of shooting mode corresponding to the target scene according to preset scene recognition rules includes: Determine the maximum noise and the noise concentration area in the noise map detected by the laser device; If the maximum noise is less than the third noise threshold and the average noise level of the noise concentration area is less than the fourth noise threshold, then the shooting mode type is determined to be Moon Mode.
9. The method according to claim 5, characterized in that, The step of determining the type of shooting mode corresponding to the target scene according to preset scene recognition rules includes: Determine the noise concentration region in the noise map detected by the laser device; If the noise level fluctuation in the noise concentration area is less than the preset fluctuation level and the mean value is less than the second noise threshold, then the shooting mode type is determined to be cloudy mode.
10. An electronic device, characterized in that, include: Processor and memory; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1-9.
11. A computer storage medium, characterized in that, Used to store computer instructions, which, when executed on an electronic device, perform the method as described in any one of claims 1-9.