Anti-fog method and device, electronic equipment and computer readable storage medium
By acquiring the air temperature and humidity in the electronic device, determining the dew point temperature, and performing power consumption reduction processing based on the difference between the ambient temperature and the dew point temperature, the problem of decreasing quality due to mist formation when the camera acquires images is solved, and a higher quality image acquisition is achieved.
Patent Information
- Application Number
- CN202311213220.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-28
AI Technical Summary
When a camera in an electronic device acquires images, fog or condensate will appear on the glass window, which affects the quality of image acquisition. How to avoid this situation has become an urgent problem.
By obtaining the air temperature and relative humidity in the installation space, determining the dew point temperature, and comparing it with the external ambient temperature, when the external ambient temperature is greater than the dew point temperature and the difference is within a certain threshold range, power consumption reduction processing is performed to reduce the heat generation inside the electronic device, avoid the rapid increase in the temperature, and thus prevent the formation of mist.
By reducing the heat generation of electronic devices, maintaining the appropriate difference between the dew point temperature and the external ambient temperature, avoiding the formation of fog, ensuring that the camera can acquire images normally, and improving the quality of image acquisition.
Smart Images

Figure CN119718052A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image acquisition technology, and in particular to an anti-fog method, device, electronic device, and computer-readable storage medium. Background Art
[0002] With the popularity of electronic devices such as mobile phones and tablets, users' demand for the image acquisition capabilities of electronic devices is increasing. At present, most electronic devices are equipped with one or more cameras for image acquisition, video calls and other functions. When these cameras collect images, they do so through a glass window. Since electronic devices are not completely sealed, water vapor in the air will enter the inside of the electronic device. The ambient temperature of the electronic device and the temperature inside the window will change with different usage environments and the heat generated by the electronic device. In this process, fog will be generated on the glass window and even condensed into condensed water, which will have an adverse effect on the image acquisition quality of the camera. How to avoid fogging on the glass window has become an urgent problem to be solved. Summary of the invention
[0003] Embodiments of the present application provide an anti-fog method, an apparatus, an electronic device, and a computer-readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides an anti-fogging method, which is applied to an electronic device, wherein the electronic device includes a camera, and the electronic device has an installation space for installing the camera, and the camera is installed in the installation space; the method includes:
[0005] Obtain the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space based on the air temperature and relative humidity; obtain the external ambient temperature; when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to a first threshold and greater than or equal to a second threshold, perform power consumption reduction processing, wherein the second threshold is less than the first threshold.
[0006] In a second aspect, the embodiment of the present application also provides an anti-fog device, which is applied to an electronic device, wherein the electronic device includes a camera, and the electronic device has an installation space for installing the camera, and the camera is installed in the installation space; the device includes a dew point acquisition module, an ambient temperature acquisition module, and an execution module. The dew point acquisition module is used to obtain the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space according to the air temperature and relative humidity; the ambient temperature acquisition module is used to obtain the external ambient temperature; and the execution module is used to perform power consumption reduction processing when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is greater than or equal to a first threshold.
[0007] In a third aspect, an embodiment of the present application also provides an electronic device, including a camera, a processor and a memory, wherein the camera is electrically connected to the processor, and the memory is coupled to the processor; the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above-mentioned anti-fog method.
[0008] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above-mentioned anti-fog method.
[0009] The anti-fog method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain the air temperature and relative humidity in the installation space, determine the dew point temperature, and then compare it with the ambient temperature of the environment in which the electronic device is located. When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to a first threshold and greater than or equal to a second threshold, power consumption reduction processing is performed. By reducing power consumption, the heat generated inside the electronic device is reduced, and a rapid increase in temperature in the installation space is avoided. In this way, since the difference between the dew point temperature and the external ambient temperature is relatively large, fog will not be generated, ensuring that the camera can collect images normally, thereby improving the quality of image collection. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solution of the application, the drawings required for use in the implementation will be briefly introduced below. Obviously, the drawings described below are only some implementation methods of the application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 It is a structural schematic diagram of an electronic device proposed in an embodiment of the present application.
[0012] Figure 2 yes Figure 1 Schematic diagram of the disassembled structure of the housing assembly in the electronic device shown in FIG.
[0013] Figure 3 yes Figure 1 Schematic diagram of the installation structure of a camera in an electronic device is shown in FIG.
[0014] Figure 4 It is a flow chart of an anti-fog method provided in an embodiment of the present application.
[0015] Figure 5 It is an enthalpy-humidity diagram provided in an embodiment of the present application.
[0016] Figure 6 It is a flow chart of another anti-fog method provided in an embodiment of the present application.
[0017] Figure 7 This is a flow chart of another anti-fog method provided in an embodiment of the present application.
[0018] Figure 8 It is a flow chart of step S250 in an anti-fog method provided in an embodiment of the present application.
[0019] Fig. 9 This is a flow chart of another anti-fog method provided in an embodiment of the present application.
[0020] Fig.10 It is a structural block diagram of an anti-fog device provided in an embodiment of the present application.
[0021] Fig.11 This is a structural block diagram of another anti-fog device provided in an embodiment of the present application.
[0022] Fig.12 It is a structural block diagram of an electronic device provided in an embodiment of the present application.
[0023] Fig.13 It is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] As used in the embodiments of the present application, "electronic devices" include, but are not limited to, devices configured to receive / send communication signals via a wireline connection (e.g., via a public switched telephone network (PSTN), a digital subscriber line (DSL), a digital cable, a direct cable connection, and / or another data connection / network) and / or via a wireless interface (e.g., for a cellular network, a wireless local area network (WLAN), a digital television network such as a DVB-H network, a satellite network, an AM-FM broadcast transmitter, and / or another communication terminal). Communication terminals configured to communicate via a wireless interface may be referred to as "wireless communication terminals", "wireless terminals", "electronic devices" and / or "mobile terminals". Examples of electronic devices include, but are not limited to, satellite or cellular phones; personal communication system (PCS) terminals that may combine cellular radiotelephones with data processing, fax, and data communication capabilities; PDAs that may include radiotelephones, pagers, Internet / intranet access, web browsers, notepads, calendars, and / or global positioning system (GPS) receivers; and conventional laptop and / or palmtop receivers, game consoles, or other electronic devices that include radiotelephone transceivers.
[0026] See also Figure 1 , Figure 1 The structure of an electronic device 100 is shown. In this application, for ease of description, the electronic device 10 is described by taking a mobile phone as an example. The electronic device 10 includes a housing assembly 20, a display screen (not shown), a mainboard 50, a battery (not shown), etc. The mainboard 50 and the battery are both arranged in the housing assembly 20.
[0027] See also Figure 2 The housing assembly 20 includes a middle frame 21, a front shell 25 and a rear shell 26. Specifically, the middle frame 21 includes a middle plate and a frame. The frame is arranged around the edge of the middle plate, protrudes from the middle plate, and the frame protrudes from the middle plate on both sides of the middle plate. The front shell 25 and the rear shell 26 are respectively assembled on the two sides of the middle plate, and the front shell 25 and the rear shell 26 are assembled and fixed to the frame; the rear shell 26, the middle frame 21 and the front shell 25 form a cavity together, and the mainboard 50 is arranged in the cavity and fixed to the middle plate, and the cavity can also be used to set antennas, processors and other components.
[0028] The middle frame 21 may be an integrated middle frame 21, wherein the frame and the middle plate may be integrated to form a sufficient structural strength. The middle plate may be partially or entirely made of metal material, which is not limited here. For example, in a more specific embodiment, the middle plate may be a metal plate made of magnesium alloy as a substrate, and the frame may be made of plastic material, which is injection molded on the substrate to form an integrated middle frame 21.
[0029] The middle plate has a first side and a second side opposite to each other, wherein the front shell 25 is mounted on the first side of the middle plate, and the rear shell 26 is mounted on the second side of the middle plate. The frame is connected to the edge of the middle plate and extends toward the first side and the second side of the middle plate at the same time. The frame has an inner surface 262, and the inner surface 262 can be formed into a ring. The middle plate is connected to the inner surface 262 of the frame, that is, the inner surface 262 is arranged around the middle plate.
[0030] The display screen is mounted on the front shell 25. The display screen can use an LCD (Liquid Crystal Display) screen to display information. The LCD screen can be a TFT (Thin Film Transistor) screen or an IPS (In-Plane Switching) screen or an SLCD (Splice Liquid Crystal Display) screen. In other embodiments, the display screen can use an OLED (Organic Light-Emitting Diode) screen to display information. The OLED screen can be an AMOLED (Active Matrix Organic Light Emitting Diode) screen or a Super AMOLED (Super Active Matrix Organic Light Emitting Diode) screen or a Super AMOLED Plus (Super Active Matrix Organic Light Emitting Diode Plus) screen, which will not be described in detail here.
[0031] Various electronic components are arranged on the mainboard 50, including but not limited to processors, memory, antenna modules, speakers, receivers, etc., which are not specifically limited here. Pads (not shown) are arranged on the mainboard 50, and the electronic components are connected to the circuits on the mainboard 50 by being soldered to the pads.
[0032] Please combine Figure 1 and Figure 2 The electronic device 10 further includes a camera 100. The camera 100 may be one or more, which is not specifically limited herein. The camera 100 may be installed on the rear shell 26 as a rear camera, or installed on the front shell 25 as a front camera, or may be installed on both the rear shell 25 and the front shell 26. In this embodiment, the camera 100 is installed on the rear shell 26 as an example for detailed description.
[0033] Please refer again Figure 2The rear shell 26 has an inner surface 262 and an outer surface 261 facing each other. It can be understood that the inner surface 262 refers to the surface located inside in the assembled state, that is, the inner surface 262 is located on the side surface of the shell close to the accommodating space. The outer surface 261 refers to the surface of the shell exposed in the assembled state, that is, the inner surface 262 is located on the side surface of the shell away from the accommodating space. The rear shell 26 is provided with an assembly hole 263, which passes through the inner surface 262 and the outer surface 261. The assembly hole 263 can be located at any position of the rear shell 26, which is not limited here.
[0034] The assembly hole 263 can be a bar-shaped hole, or a hole of various cross-sections such as a circular hole, a square hole, etc. In one embodiment, the assembly hole 263 is a bar-shaped hole and extends along the length direction of the rear shell 26, and the assembly hole 263 can be set close to the end of the length direction of the rear shell 26 to reserve sufficient space for setting the battery.
[0035] See also Figure 3 , the surface of the middle frame 21 facing the inner surface 262 of the rear shell 26 is provided with a substrate 101, and the substrate 101 is used to carry the camera 100. As an embodiment, the substrate 101 is provided with a groove, and the camera 100 can be installed in the groove. The groove of the substrate 101 corresponds to the assembly hole 263, and the edge of the substrate 101 and the inner surface 262 of the rear shell 26 are sealed by arranging foam. At this time, an installation space 102 is formed between the substrate 101 and the rear shell 26. The camera 100 is arranged in the installation space 102 during assembly. A collection window 80 is arranged at the assembly hole 263. The collection window 80 can be made of glass or light-transmitting plastic, light-transmitting ceramic material, etc. The collection window 80 closes the assembly hole 263, thereby providing protection for the camera 100. When the camera 100 collects images, light enters the installation space 102 from the collection window 80 and is then collected by the camera 100. The installation space 102 is a nearly closed space. Since the foam cannot completely isolate the air, some water vapor will still enter the installation space 102 .
[0036] In some embodiments, the collection window 80 may be located outside the electronic device 10, that is, disposed on the outer surface 261 of the rear shell 26. In some embodiments, the collection window 80 may also be disposed on the inner surface 262 of the rear shell 26, which is not limited here. At the same time, in some embodiments, the electronic device 10 may also include a heating device 81, which is used to heat the collection window 80. For example, the heating device 81 may be a heating wire disposed on the surface of the collection window 80, which generates heat by powering on, and by heating the collection window 80, the mist on the collection window 80 may be evaporated. Of course, the heating device 81 may also be other heating devices 81, which are not limited in this application.
[0037] The electronic device 10 further includes a temperature sensor 60 and a humidity sensor 70, which are disposed in the installation space 102 and are used to collect the air temperature and relative humidity in the installation space 102, respectively. In addition, the electronic device 10 may further include a plurality of NTC sensors (not shown), which are negative temperature coefficient thermistors. The plurality of NTC sensors may obtain the ambient temperature in the environment where the electronic device 10 is located, and each NTC sensor may be used to collect the ambient temperature. By fitting the ambient temperature information collected by the plurality of NTC sensors, the accuracy of the measured value of the ambient temperature may be further improved.
[0038] During the image acquisition process of the camera 100, fog or condensation may be generated on the acquisition window 80. The main reasons are as follows:
[0039] 1. The external environment temperature of the electronic device 10 decreases, for example, when entering outdoors from indoors in winter, the saturated vapor pressure in the installation space 102 of the camera 100 decreases. When the saturated vapor pressure is ≤ the water vapor partial pressure, condensation water is easily generated on the outer surface 261 of the collection window 80. At this time, the user can usually manually wipe the collection window 80 to eliminate the condensation water.
[0040] 2. The temperature inside the installation space 102 of the camera 100 increases. For example, the camera 100 generates heat when working for a long time, charging, or playing games. The water vapor in the installation space 102 of the camera 100 increases, and the dew point temperature increases. When the dew point temperature is ≥ the external space temperature, fog is easily generated on the inner surface 262 of the collection window 80. At this time, since the fog is formed on the inner surface 262 of the collection window 80, the user cannot remove it by manual wiping and can only use the camera 100 normally after the fog disappears naturally.
[0041] Therefore, the inventor of the present application proposes the method, device, electronic device and storage medium in the embodiments of the present application to improve the above problems. The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0042] This embodiment provides an anti-fogging method. Figure 4 , the method comprises the following steps:
[0043] Step S110: Acquire the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space according to the air temperature and relative humidity.
[0044] Among them, the air temperature in the installation space refers to the ambient temperature inside the installation space, and the relative humidity in the installation space refers to the air humidity in the environment inside the installation space. In one implementation, the air temperature in the installation space can be collected by a temperature sensor disposed in the installation space, and the relative humidity in the installation space can be collected by a humidity sensor disposed in the installation space.
[0045] The dew point temperature refers to the temperature at which air is cooled to saturation while keeping the water vapor content in the air constant and the air pressure fixed, also known as the dew point. The dew point temperature in the installation space refers to the dew point inside the installation space where the camera is located. This dew point temperature is associated with the air temperature and relative humidity of the installation space. By obtaining the air temperature and relative humidity in the installation space, the dew point temperature in the installation space can be calculated.
[0046] In a more specific implementation, the dew point temperature in the installation space can be calculated in the following manner:
[0047]
[0048] Among them,
[0049] Among them, T is the air temperature, Td is the dew point temperature, RH is the relative humidity, and a and b are constants. When 0°C < T < 60°C, a can be taken as 17.27 and b can be taken as 237.7°C.
[0050] Through the above method, the dew point temperature under the current air temperature and relative humidity can be obtained.
[0051] In some implementations, the above corresponding mapping relationship can be pre-stored locally. After the air temperature and relative humidity in the installation space are obtained in step S110, the above mapping relationship is called to calculate the corresponding dew point temperature in real time. In other implementations, the above mapping relationship can also be stored in the server. After the electronic device obtains the air temperature and relative humidity in the installation space each time, a calculation request is sent to the server. The server calculates the corresponding dew point temperature based on the air temperature and relative humidity information in the installation space uploaded by the electronic device and then sends it to the server.
[0052] In some implementations, in step S110, obtaining the air temperature and relative humidity in the installation space can be performed in real time. For example, the air temperature and relative humidity information in the installation space are collected every predetermined time period, and the dew point temperature is calculated accordingly. The predetermined time period can be 1 minute, 5 minutes, etc., which is not limited here. In other implementations, the air temperature and relative humidity information in the installation space can be collected only when the user needs to use the camera.
[0053] For example, step S110 may be performed in the following manner: in response to a user instruction to call the camera, the air temperature and relative humidity in the installation space are obtained, and the dew point temperature in the installation space is determined according to the air temperature and relative humidity.
[0054] The advantage of this implementation is that, on the one hand, it can reduce the power consumption of the temperature sensor and the humidity sensor, and at the same time, it can save the resource occupation of the processor of the electronic device and improve the response speed of the user when performing other operations. In addition, since the power consumption of the temperature sensor and the humidity sensor is reduced, it can avoid the temperature rise in the installation space caused by the high heat generated by the temperature sensor and the humidity sensor when they are working. As mentioned above, the temperature rise in the installation space is the main reason for the fogging of the collection window. Therefore, it can play a further anti-fogging effect.
[0055] Of course, in some other embodiments, there are many other ways to determine the dew point temperature in the installation space based on the air temperature and relative humidity. For example, pre-collect the dew point temperature values under different air temperatures and relative humidity, and draw the following diagram: Figure 5 The enthalpy-humidity diagram shown is stored locally in the electronic device. When the dew point temperature needs to be obtained, the dew point temperature value can be directly determined by comparing it with the obtained air temperature and relative humidity.
[0056] Step S120: Acquire the external environment temperature.
[0057] The external ambient temperature refers to the ambient temperature of the environment in which the electronic device is located. Preferably, the external ambient temperature here may refer to the ambient temperature within a preset distance from the electronic device, and the preset distance may be, for example, 0.5 m. Collecting the ambient temperature at a position close to the electronic device can more truly reflect the temperature changes on the surfaces on both sides of the collection window of the electronic device, and thus more accurately determine whether the collection window of the electronic device may produce atomization. In some embodiments, the external ambient temperature can be collected by an NTC sensor. In other embodiments, the external ambient temperature can also be collected by other means, such as by setting a temperature sensor on the housing of the electronic device to directly obtain the ambient temperature outside the electronic device.
[0058] Step S130: When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to a first threshold and greater than or equal to a second threshold, power consumption reduction processing is performed, wherein the second threshold is less than the first threshold.
[0059] The difference between the external ambient temperature and the dew point temperature directly reflects the saturation of the air in the current installation space. When the external ambient temperature is greater than the dew point temperature, it indicates that the air in the installation space is not yet saturated. When the external ambient temperature is equal to the dew point temperature, it indicates that the air in the installation space is saturated and atomization will begin to occur. When the external ambient temperature is less than the dew point temperature, it indicates that the air in the installation space is oversaturated and obvious atomization will occur. Therefore, to ensure that the acquisition window does not have atomization, the external ambient temperature must always be greater than the dew point temperature.
[0060] When the difference between the external ambient temperature and the dew point temperature is greater than or equal to the first threshold, and the external ambient temperature is greater than the dew point temperature, it indicates that fog may be generated on the inner surface of the collection window (i.e., the surface facing the installation space). Therefore, by performing power consumption reduction processing, the heat generation of the electronic device is reduced to avoid the temperature in the installation space inside the electronic device from rising too fast, so that the dew point temperature will not rise quickly. This is to maintain a sufficient difference between the dew point temperature and the external ambient temperature to avoid the formation of fog on the inner surface of the collection window. In a more specific embodiment, the first threshold value may be, for example, 2.5°C-3.5°C, and further, the first threshold value may be, for example, 3°C. The second threshold value may be, for example, 1.5°C-2.5°C, and further, the first threshold value may be, for example, 2°C. It is understandable that in some other implementation schemes, the first threshold value and the second threshold value may also be other values, which are not limited in this embodiment.
[0061] In this embodiment, when the difference between the external environment temperature and the dew point temperature is greater than or equal to the first threshold, the power reduction operation is started. The advantage of such execution is that since the first threshold is greater than 0, when the difference between the external environment temperature and the dew point temperature is greater than or equal to the first threshold, the acquisition window will not be fogged. At this time, the power reduction operation is started, which can reduce the heat generated by the electronic device, so that the temperature in the installation space of the camera will not rise rapidly, and then the current dew point temperature is kept unchanged or only slightly increased, ensuring that the difference between the external environment temperature and the dew point temperature is always greater than 0, and avoiding the generation of fog in the acquisition window. In this way, fog can be avoided as much as possible during the whole process of using the camera of the electronic device, ensuring the continuous use of the camera and reducing the impact on user use.
[0062] Specifically, in a more specific embodiment, step S130 may be performed in the following manner: disabling an auxiliary algorithm, where the auxiliary algorithm is used to process images acquired by a camera.
[0063] Among them, the auxiliary algorithm is the image processing algorithm built into the camera, which is used to process the images obtained by the camera. Although the installation space is not a completely enclosed space, it is surrounded by the substrate, foam and back shell. Therefore, the temperature rise in the installation space is mainly caused by the heat generated by the camera when it is working and the heat generated by other parts of the electronic equipment when they are working. The heat generated by the camera itself can be reduced by disabling the auxiliary algorithm, thereby avoiding a rapid rise in temperature in the installation space, which leads to an increase in dew point temperature.
[0064] In another more specific implementation, step S130 may be performed in the following manner: reducing the display brightness of the display screen.
[0065] By reducing the display brightness of the display screen, the heat generated by the electronic device can be reduced, which means that the heat generated by other components of the electronic device during operation is reduced and transferred into the installation space, thereby avoiding a rapid increase in temperature in the installation space, which leads to an increase in dew point temperature.
[0066] In another more specific implementation, step S130 may be performed in the following manner: disabling an auxiliary algorithm, the auxiliary algorithm being used to process an image acquired by a camera, and reducing the display brightness of the display screen.
[0067] By disabling the auxiliary algorithm, the heat generated by the camera itself can be reduced. At the same time, by reducing the display brightness of the display, the heat generated by the electronic device can be reduced, which reduces the heat generated by other components of the electronic device during operation and transfers into the installation space, thereby avoiding a rapid increase in temperature in the installation space, which leads to an increase in dew point temperature.
[0068] It is understandable that, in some other implementations, executing the power consumption reduction operation may also be shutting down non-essential background applications of the electronic device or controlling the electronic device to enter a low power consumption mode, etc., and this embodiment does not specifically limit this.
[0069] The anti-fog method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain the air temperature and relative humidity in the installation space, determine the dew point temperature, and then compare it with the ambient temperature of the environment in which the electronic device is located. When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the first threshold and greater than or equal to the second threshold, power consumption reduction processing is performed. By reducing power consumption, the heat generated inside the electronic device is reduced, and a rapid increase in temperature in the installation space is avoided. In this way, since the difference between the dew point temperature and the external ambient temperature is relatively large, fog will not be generated, ensuring that the camera can collect images normally, thereby improving the quality of image collection.
[0070] Based on the above anti-fog method, the present application embodiment also provides another anti-fog method, see Figure 6 The anti-fog method provided in this embodiment may further include the following steps S210 to S240. It should be understood that the anti-fog method in this embodiment has the same or corresponding implementation steps as those in the above embodiment. The specific description of these same or corresponding implementation steps can refer to the contents provided in the above embodiment, and this embodiment will not be repeated.
[0071] Step S210: Acquire the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space according to the air temperature and relative humidity.
[0072] Step S220: Obtain the external environment temperature.
[0073] Step S230: When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to a first threshold and greater than or equal to a second threshold, perform power reduction processing, wherein the second threshold is less than the first threshold.
[0074] After step S230 executes the power reduction operation, the temperature in the installation space of the camera may continue to rise, or when the external ambient temperature changes (decreases), the difference between the external ambient temperature and the dew point temperature may reach the first threshold. At this time, the probability of fog appearing in the acquisition window will further increase, so step S240 can continue to be executed.
[0075] Step S240: When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the second threshold and greater than or equal to the third threshold, turn off the camera, wherein the third threshold is less than the second threshold.
[0076] When the difference between the external ambient temperature and the dew point temperature is greater than or equal to the second threshold, the air in the installation space is close to saturation, and the probability of atomization on the inner surface of the acquisition window is very high, and even atomization begins to occur. Therefore, if the camera is still used at this time, the light will be affected by the refraction of the atomized droplets when entering the installation space through the acquisition window, which may cause the light to be deflected, and the image formed may be distorted, so the quality of the collected image is poor. At this time, turning off the camera can not only avoid collecting images of poor quality, but also because after turning off the camera, the camera acts as a heat source in the installation space, the heat is reduced, which will cause the air temperature and relative humidity in the installation space to change, thereby reducing the dew point temperature, reducing the probability of atomization or alleviating atomization.
[0077] In a more specific embodiment, the third threshold value may be, for example, 0.5° C.-1.5° C., and further, the third threshold value may be, for example, 1° C. It is understandable that in some other embodiments, the third threshold value may also be other values, which is not limited in this embodiment.
[0078] It can be understood that when the external environment temperature is greater than the dew point temperature, and the difference between the external environment temperature and the dew point temperature is less than the third threshold, the inner surface of the acquisition window will begin to show obvious fogging. Figure 7 As shown, step S250 may be further performed.
[0079] In some embodiments, the electronic device may have multiple cameras, and when the multiple cameras are installed, they are located in different installation spaces. When the camera in step S240 is turned off, other cameras can be switched to perform image acquisition.
[0080] Step S250: Start the heating device.
[0081] When the heating device is started, the collection window can be heated to re-vaporize the atomized water droplets condensed on the collection window. At the same time, the ambient temperature outside the electronic device is increased, that is, the temperature of the outer surface of the collection window is increased, so that the difference between the ambient temperature and the dew point temperature increases, and the atomized water is re-vaporized to eliminate the atomization phenomenon.
[0082] In a more specific embodiment, see Figure 8 , step S250 may include steps S251-S253.
[0083] Step S251: Determine the heating time according to the difference between the external environment temperature and the dew point temperature.
[0084] When the difference between the external ambient temperature and the dew point temperature is larger, the heating time can be shorter. Conversely, when the difference between the external ambient temperature and the dew point temperature is larger, the heating time can be longer. Specifically, a mapping relationship between the heating time and the difference between the external ambient temperature and the dew point temperature can be established in advance. When the difference between the external ambient temperature and the dew point temperature is determined, the corresponding heating time is determined according to the aforementioned mapping relationship. At the same time, when the heating device is started, it can be started with a fixed output power, and the same output power is maintained throughout the heating process, which can facilitate the control of the heating amount during the heating process. Of course, in some other embodiments, when the heating device is started, it can also be started with a non-fixed output power, and the output power can be adjusted as needed during the heating process.
[0085] Step S252: starting the heating device according to the heating time.
[0086] After the heating device is started to heat the acquisition window, the atomized droplets formed on the acquisition window are re-vaporized, and the camera can be turned on again to resume image acquisition. When the heating time is over, the heating device can be turned off.
[0087] In some cases, during the heating process, the heating time may not end, but the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the first threshold. For example, the user's usage environment changes and the ambient temperature fluctuates. For example, when the ambient temperature rises, there is no need to continue heating, so step S253 can be executed.
[0088] Step S253: when the external environment temperature is greater than the dew point temperature, and the difference between the external environment temperature and the dew point temperature is less than or equal to a first threshold, turning off the heating device.
[0089] After turning off the heating device, the power consumption of the electronic equipment can be further reduced, electricity can be saved, and at the same time, heat accumulation in the installation space can be avoided.
[0090] The anti-fog method, device, electronic device and computer-readable storage medium provided in the embodiment of the present application obtain the air temperature and relative humidity in the installation space, determine the dew point temperature, and then compare it with the ambient temperature of the environment in which the electronic device is located. When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the first threshold and greater than or equal to the second threshold, perform power consumption reduction processing, reduce the heat generated inside the electronic device by reducing power consumption, and avoid rapid temperature increase in the installation space. In this way, since the difference between the dew point temperature and the external ambient temperature is relatively large, fog will not be generated, ensuring that the camera can normally collect images and improve the quality of image collection. At the same time, when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the second threshold and greater than or equal to the third threshold, turn off the camera to avoid affecting the image collection quality.
[0091] Based on the above anti-fog method, the present application embodiment also provides another anti-fog method, see Fig. 9 The anti-fog method provided in this embodiment may further include the following steps S310 to S330. It should be understood that the anti-fog method in this embodiment has the same or corresponding implementation steps as those in the above embodiment. The specific description of these same or corresponding implementation steps can refer to the contents provided in the above embodiment, and this embodiment will not be repeated.
[0092] Step S310: Acquire the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space according to the air temperature and relative humidity.
[0093] Step S320: Obtain the external environment temperature.
[0094] Step S330: When the external environment temperature is greater than the dew point temperature, and the difference between the external environment temperature and the dew point temperature is greater than or equal to the first threshold, power consumption reduction processing is performed to start the heating device.
[0095] In step S330, the power consumption reduction operation and the starting of the heating device are performed simultaneously, which can reduce the temperature in the installation space on the one hand, and increase the temperature on the outer surface of the collection window on the other hand, that is, increase the ambient temperature of the environment in which the electronic device is located, and quickly increase the difference between the external ambient temperature and the dew point temperature, thereby avoiding the occurrence of atomization.
[0096] It can be understood that, for the specific implementation method of executing the power consumption reduction operation, reference can be made to the relevant content of the aforementioned step S130, and for the specific implementation method of starting the heating device, reference can be made to the relevant content of the aforementioned step S250, which will not be repeated in this embodiment.
[0097] The anti-fog method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain the air temperature and relative humidity in the installation space, determine the dew point temperature, and then compare it with the ambient temperature of the environment in which the electronic device is located. When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the first threshold and greater than or equal to the second threshold, power consumption reduction processing is performed. By reducing power consumption, the heat generated inside the electronic device is reduced to avoid a rapid increase in temperature in the installation space. At the same time, heating is performed by a heating device to increase the ambient temperature of the environment in which the electronic device is located. In this way, since the difference between the dew point temperature and the external ambient temperature is relatively large, fog will not be generated, ensuring that the camera can collect images normally, thereby improving the quality of image collection.
[0098] See also Fig.10 The embodiment of the present application proposes an anti-fog device 400, which is applied to an electronic device, wherein the electronic device includes a camera, and the electronic device has an installation space for installing the camera, and the camera is installed in the installation space. In a specific embodiment, the anti-fog device 400 includes a dew point acquisition module 410, an ambient temperature acquisition module 420, and an execution module 440.
[0099] The dew point acquisition module 410 is used to acquire the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space according to the air temperature and relative humidity.
[0100] The ambient temperature acquisition module 420 is used to acquire the external ambient temperature.
[0101] The execution module 430 is used to perform power reduction processing when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is greater than or equal to the first threshold. In some embodiments, the execution module 430 is used to reduce the display brightness of the display screen when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is greater than or equal to the first threshold. In some embodiments, the execution module 430 is used to disable the auxiliary algorithm when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is greater than or equal to the first threshold. The auxiliary algorithm is used to process the image acquired by the camera. In some embodiments, the execution module 430 is used to perform power reduction processing and start the heating device when the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is greater than or equal to the first threshold.
[0102] In some embodiments, see Fig.11 The anti-fog device 400 may further include a closing module 440, which is used to close the camera when the external environment temperature is greater than the dew point temperature and the difference between the external environment temperature and the dew point temperature is less than or equal to the second threshold and greater than or equal to the third threshold, wherein the third threshold is less than the second threshold. In some embodiments, the execution module 430 is also used to start the heating device.
[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0104] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0105] The anti-fog device 400 provided in the embodiment of the present application obtains the air temperature and relative humidity in the installation space, determines the dew point temperature, and then compares the dew point temperature with the ambient temperature of the environment in which the electronic device is located. When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to the first threshold and greater than or equal to the second threshold, a power consumption reduction process is performed. By reducing power consumption, the heat generated inside the electronic device is reduced, and a rapid increase in temperature in the installation space is avoided. In this way, since the difference between the dew point temperature and the external ambient temperature is relatively large, fog will not be generated, ensuring that the camera can collect images normally, thereby improving the quality of image collection.
[0106] See also Fig.12This embodiment further provides an electronic device 500, and the aforementioned anti-fogging method can be applied to the electronic device 500 of this embodiment. The electronic device 500 includes a display screen 506, one or more cameras 501, a heating device 503, a temperature sensor 507, a humidity sensor 508, one or more NTC sensors 505, and one or more (only one is shown in the figure) processors 502 and a memory 504 coupled to each other.
[0107] The display screen 506, the camera 501, the heating device 503, the temperature sensor 507, the humidity sensor 508, and the NTC sensor 505 are all electrically connected to the processor 502, and can perform predetermined operations under the control of the processor 502. The display screen 506 can display a display interface and is used for human-computer interaction with a user. The camera 501 can be used to collect image information, the heating device 503 is used to heat the collection window of the camera 501, the temperature sensor 507 is used to collect the air temperature in the installation space of the camera 501, the humidity sensor 508 is used to collect the relative humidity in the installation space of the camera 501, and the NTC sensor 505 is used to collect the ambient temperature of the environment in which the electronic device 500 is located. Among them, the memory 504 stores a program that can execute the contents of the aforementioned embodiments, and the processor 302 can execute the program stored in the memory 504.
[0108] Among them, the processor 502 may include one or more processing cores. The processor 502 uses various interfaces and lines to connect various parts of the entire electronic device 500, and executes various functions and processes data of the electronic device 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 504, and calling data stored in the memory 504. Optionally, the processor 502 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 502 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 502, but may be implemented separately through a communication chip.
[0109] The memory 504 may include a random access memory (RAM) or a read-only memory (ROM). The memory 504 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 504 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 500 during use. It will be appreciated that the electronic device 500 in the present application may be a mobile phone or smart phone (e.g., an iPhone TM-based phone, an Android TM-based phone), a portable gaming device (e.g., a Nintendo DS TM, a PlayStation Portable TM, a Gameboy Advance TM, an iPhone TM), a laptop, a PDA, a portable Internet device, a music player, and a data storage device, other handheld devices, and devices such as watches, earphones, pendants, headphones, etc. The electronic device 500 may also be other wearable devices (e.g., head mounted devices (HMD) such as electronic glasses, electronic clothes, electronic bracelets, electronic necklaces, electronic tattoos, electronic devices 500, or smart watches).
[0110] The electronic device 500 can also be any one of a plurality of electronic devices 500, including but not limited to cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, video recorders, cameras, other media recorders, radios, medical devices, vehicle transportation instruments, calculators, programmable remote controls, pagers, laptop computers, desktop computers, printers, netbook computers, personal digital assistants (PDAs), portable multimedia players (PMPs), Moving Picture Experts Group (MPEG-1 or MPEG-2) Audio Layer 3 (MP3) players, portable medical devices, and digital cameras and combinations thereof.
[0111] See also Fig.13, an embodiment of the present application provides a block diagram of the structure of a computer-readable storage medium. The computer-readable medium 1000 stores program code, and the program code can be called by a processor to execute the anti-fog method described in any of the above method embodiments. The computer-readable storage medium 1000 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. Optionally, the computer-readable storage medium 1000 includes a non-volatile computer-readable medium (non-transitory computer-readable storage medium). The computer-readable storage medium 1000 has storage space for program code 1100 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1100 can be compressed, for example, in an appropriate form.
[0112] In this specification, the specific features or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they contradict each other. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not drive the essence of the corresponding technical solutions away from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An anti-fogging method, characterized in that: Applied to an electronic device, the electronic device includes a camera, the electronic device has an installation space for installing the camera, and the camera is installed in the installation space; the method includes: Acquiring the air temperature and relative humidity in the installation space, and determining the dew point temperature in the installation space according to the air temperature and the relative humidity; Get the external ambient temperature; When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to a first threshold and greater than or equal to a second threshold, power consumption reduction processing is performed, wherein the second threshold is less than the first threshold.
2. The anti-fogging method according to claim 1, characterized in that: The method further comprises: When the external ambient temperature is greater than the dew point temperature, and the difference between the external ambient temperature and the dew point temperature is less than or equal to a second threshold and greater than or equal to a third threshold, the camera is turned off, wherein the third threshold is less than the second threshold.
3. The anti-fogging method according to claim 2, characterized in that: The electronic device further comprises a heating device, and the heating device is used to heat the acquisition window of the camera; After closing the camera, the method further includes: The heating device is activated.
4. The anti-fogging method according to any one of claims 1 to 3, characterized in that: The electronic device further includes a display screen, and the performing of the power consumption reduction process includes: The display brightness of the display screen is reduced.
5. The anti-fogging method according to any one of claims 1 to 3, characterized in that: The electronic device further includes a display screen, and the performing of the power consumption reduction process includes: An auxiliary algorithm is disabled, the auxiliary algorithm being used to process images acquired by the camera.
6. The anti-fogging method according to claim 1, characterized in that: The electronic device further comprises a heating device, and the heating device is used to heat the acquisition window of the camera; When the external environment temperature is greater than the dew point temperature, and the difference between the external environment temperature and the dew point temperature is greater than or equal to a first threshold, performing power consumption reduction processing; comprising: When the external environment temperature is greater than the dew point temperature, and the difference between the external environment temperature and the dew point temperature is greater than or equal to a first threshold, a power reduction process is performed to start the heating device.
7. The anti-fogging method according to claim 6, characterized in that: The starting of the heating device comprises: Determining a heating time according to a difference between the external environment temperature and the dew point temperature; Starting the heating device according to the heating duration; When the external environment temperature is greater than the dew point temperature, and the difference between the external environment temperature and the dew point temperature is less than or equal to a first threshold, the heating device is turned off.
8. An anti-fog device, characterized in that: Applied to an electronic device, the electronic device includes a camera, the electronic device has an installation space for installing the camera, and the camera is installed in the installation space; the device includes: a dew point acquisition module, used to acquire the air temperature and relative humidity in the installation space, and determine the dew point temperature in the installation space according to the air temperature and the relative humidity; An ambient temperature acquisition module is used to obtain the external ambient temperature; The execution module is used to execute power consumption reduction processing when the external environment temperature is greater than the dew point temperature and the difference between the external environment temperature and the dew point temperature is greater than or equal to a first threshold.
9. An electronic device, characterized in that: include: Camera; A processor, wherein the camera is electrically connected to the processor; as well as a memory coupled to the processor; The memory stores instructions, which, when executed by the processor, enable the processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.