Vehicle defogging method and apparatus, device, storage medium, program product, and vehicle
Patent Information
- Application Number
- PCT/CN2026/084589
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-03-19
- Filing Date
- 2026-03-19
- Publication Date
- 2026-09-24
Smart Images

Figure CN2026084589_24092026_PF_FP_ABST
Abstract
Description
Vehicle defogging methods, devices, equipment, storage media, program products, and vehicles Cross-references to related applications
[0001] This application claims priority to Chinese patent application No. 202510323376.4, filed on March 19, 2025, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to, but is not limited to, the field of vehicle control technology, specifically to vehicle defogging methods, devices, equipment, storage media, program products, and vehicles. Background Technology
[0003] With the rapid development of the automotive industry, vehicle safety and comfort have become increasingly important concerns for consumers. In cold or damp weather conditions, key areas such as the windshield, side windows, and rearview mirrors are prone to fogging, severely affecting the driver's visibility and increasing driving safety hazards. Therefore, effectively removing fog from vehicles has become a crucial aspect of ensuring driving safety. Summary of the Invention
[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0005] In a first aspect, embodiments of this application provide a vehicle defogging method, the method comprising: acquiring associated data of a target vehicle; wherein the associated data of the target vehicle includes at least one of in-vehicle environment data and out-of-vehicle environment data; determining whether the target vehicle needs to be defogging based on the associated data of the target vehicle; and controlling the target vehicle to perform defogging if the target vehicle needs to be defogging.
[0006] In possible implementations, the in-vehicle environmental data of the target vehicle includes: in-vehicle temperature data and in-vehicle humidity data; the external environmental data includes: external temperature data and external humidity data; and based on the associated data of the target vehicle, determining whether the target vehicle needs defogging includes: determining the temperature difference between the external temperature data and the in-vehicle temperature data; determining the external relative humidity based on the maximum humidity corresponding to the external humidity data and the external temperature data; determining the internal relative humidity based on the maximum humidity corresponding to the internal humidity data and the internal temperature data; and determining that the target vehicle needs defogging if at least one of the external relative humidity and the internal relative humidity is greater than a relative humidity threshold and the temperature difference is greater than a temperature difference threshold.
[0007] In possible implementations, the external environment data includes rainfall data; and based on the associated data of the target vehicle, it is determined whether the target vehicle needs to be defogged, including: when the rainfall data is greater than or equal to a rainfall threshold, it is determined that the target vehicle needs to be defogged.
[0008] In a possible implementation, the associated data of the target vehicle further includes: first image data to be tested of the glass of the target vehicle; determining whether the target vehicle needs defogging based on the associated data of the target vehicle, including: determining a first defogging judgment result based on the first image data to be tested, the labeled image data corresponding to the first image data to be tested, and the target fogging threshold; wherein, the labeled image data corresponding to the first image data to be tested is image data of the glass of the target vehicle collected when the target vehicle does not need defogging; determining whether the target vehicle needs defogging based on the first defogging judgment result.
[0009] In a possible implementation, a first defogging judgment result is determined based on the first image data to be tested, the labeled image data corresponding to the first image data to be tested, and the target fogging threshold. This includes: determining the first gray-level gradient component in the horizontal direction and the second gray-level gradient component in the vertical direction for each pixel in the first image data to be tested; determining the gradient magnitude corresponding to each pixel based on the first and second gray-level gradient components; determining the mean gray-level gradient corresponding to the first image data to be tested based on the gradient magnitude corresponding to each pixel; determining the first defogging judgment result based on the ratio between the mean gray-level gradient and the target gray-level gradient and the target fogging threshold; wherein the target gray-level gradient is calculated from the labeled image data corresponding to the first image data to be tested; and determining whether the target vehicle needs defogging based on the first defogging judgment result, including: determining that the target vehicle needs defogging when the ratio between the mean gray-level gradient and the target gray-level gradient is less than the target fogging threshold.
[0010] In possible implementations, determining whether a target vehicle needs defogging based on the first defogging judgment result includes: using a pre-trained defogging judgment model to obtain a second defogging judgment result based on associated data; and determining whether the target vehicle needs defogging based on the first and second defogging judgment results.
[0011] In a possible implementation, the method further includes: inputting the second image data of the glass component of the target vehicle into a pre-trained defogging judgment model to obtain a third defogging judgment result; repeatedly performing a search operation for the target fogging threshold until the target fogging threshold is determined, wherein the search operation for the target fogging threshold includes: determining a fourth defogging judgment result for the search operation based on the second image data, the labeled image data corresponding to the second image data, and the candidate fogging threshold targeted by the search operation; when the third defogging judgment result and the fourth defogging judgment result are different, determining the next candidate fogging threshold targeted by the next search operation based on a preset value and the candidate fogging threshold targeted by the search operation; when the third defogging judgment result and the fourth defogging judgment result are the same, determining the candidate fogging threshold targeted by the search operation as the target fogging threshold.
[0012] In a possible implementation, determining whether the target vehicle needs defogging based on the associated data of the target vehicle includes: determining the fogging judgment parameters corresponding to the associated data of the target vehicle; wherein the fogging judgment parameters include temperature parameters and humidity parameters, and the associated data of the target vehicle is data that changes in real time; and determining whether the target vehicle needs defogging based on the comparison result between the fogging judgment parameters and the associated data of the target vehicle.
[0013] In a possible implementation, the above method further includes: inputting the associated data into a pre-trained defogging judgment model to obtain the predicted defogging probability corresponding to the associated data, wherein the predicted defogging probability represents the probability that defogging is required under the conditions represented by the associated data; determining the fifth defogging judgment result corresponding to the associated data based on the comparison result between the predicted defogging probability corresponding to the associated data and the defogging probability threshold; and updating the parameters of the pre-trained defogging judgment model when the fifth defogging judgment result corresponding to the associated data is different from the labeled result of the associated data.
[0014] In possible implementations, the associated data may also include: at least one of the following: self-vehicle data and other vehicle data; self-vehicle data may include at least one of the following: seasonal data of the target vehicle, regional location of the target vehicle, and vehicle speed data; other vehicle data may include at least one of the following: seasonal data of other vehicles, regional location of other vehicles, and vehicle speed data.
[0015] In a possible implementation, the above method further includes: using image data collected when the target vehicle meets preset conditions as labeled image data corresponding to the first image data to be tested; wherein the preset conditions include: the current weather is without fog or precipitation, the visibility of the target vehicle's glass is greater than the visibility threshold, the relative humidity is lower than the relative humidity threshold, and the target vehicle's defogging function is not turned on.
[0016] Secondly, embodiments of this application provide a vehicle defogging device, the device comprising: an acquisition module configured to acquire associated data of a target vehicle; wherein the associated data of the target vehicle includes at least one of in-vehicle environment data and out-of-vehicle environment data; a determination module configured to determine whether the target vehicle needs defogging based on the associated data of the target vehicle; and a control module configured to control the target vehicle to perform defogging when the target vehicle needs defogging.
[0017] Thirdly, embodiments of this application provide a computer device, including: at least one memory and at least one processor, the at least one memory and at least one processor being communicatively connected to each other, the at least one memory storing computer instructions, and when the at least one processor executes the computer instructions, executing the vehicle defogging method of the first aspect or any corresponding implementation thereof described above.
[0018] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium storing computer instructions, which, when executed by at least one processor, perform the vehicle defogging method described in the first aspect or any corresponding implementation thereof.
[0019] Fifthly, embodiments of this application provide a computer program product, including computer instructions, which, when executed by at least one processor, perform the vehicle defogging method described in the first aspect or any corresponding implementation thereof.
[0020] Sixthly, embodiments of this application provide a vehicle, including a vehicle defogging device as described in the second aspect above, a computer device as described in the third aspect above, a non-transitory computer-readable storage medium as described in the fourth aspect above, a computer program product as described in the fifth aspect above, or at least one memory and at least one processor, wherein the at least one memory and at least one processor are communicatively connected to each other, the at least one memory stores computer instructions, and the at least one processor executes the vehicle defogging method of the first aspect above or any corresponding implementation thereof by executing the computer instructions.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Other aspects will become clear after reading and understanding the accompanying drawings and detailed description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the specific embodiments of this application, the accompanying drawings used in the description of the specific embodiments will be briefly introduced below. The accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 is a schematic flowchart of a vehicle defogging method according to an embodiment of this application.
[0024] Figure 2 is a schematic flowchart of another vehicle defogging method according to an embodiment of this application.
[0025] Figure 3 is a schematic diagram of a vehicle defogging method according to an embodiment of this application.
[0026] Figure 4 is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0028] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0029] With the rapid development of the automotive industry, vehicle safety and comfort have become increasingly important to consumers. In cold or damp weather, fog easily forms on key areas such as the windshield, side windows, and rearview mirrors, severely affecting the driver's visibility and increasing driving safety hazards. Therefore, effectively removing fog from vehicles is a crucial aspect of ensuring driving safety. Currently, fog on vehicles is often dealt with manually. After the driver notices fogging, they need to manually remove it using methods such as wipers, cloths, or hot water. This process is highly dependent on the driver's vision and judgment; the driver must first visually observe the fogging situation before deciding on the appropriate defogging measures.
[0030] However, the lag in manual defogging primarily lies in the time difference between the driver's detection of fog and their reaction. The driver needs to first visually perceive the fog's presence before deciding to take action (such as turning on the windshield wipers), a process that often leads to a delay in defogging operations. In extreme weather conditions, this lag can seriously threaten driving safety. Therefore, improving the efficiency of vehicle defogging has become a problem that needs to be solved.
[0031] In view of this, embodiments of this application provide a vehicle defogging method, apparatus, device, storage medium, program product, and vehicle.
[0032] This application provides a vehicle defogging method, which can be executed by a computer device on the vehicle, such as a vehicle controller. Figure 1 is a flowchart of the vehicle defogging method according to an embodiment of this application. As shown in Figure 1, the process includes the following steps S101 to S103.
[0033] In step S101, the associated data of the target vehicle is obtained; wherein, the associated data of the target vehicle includes at least one of the in-vehicle environment data and the out-of-vehicle environment data.
[0034] The target vehicle can be any vehicle to which the method provided in this application embodiment can be applied.
[0035] The associated data of the target vehicle can characterize various information about the internal and external environments of the target vehicle. The associated data of the target vehicle includes at least one of the in-vehicle environment data and the external environment data, and can specifically include the following situations: Situation 1: In-vehicle environment data; Situation 2: External environment data; Situation 3: In-vehicle environment data and external environment data.
[0036] As an example, regarding scenario one above: in-vehicle environmental data can include in-vehicle humidity and in-vehicle temperature. For example, the in-vehicle humidity is 90%, and the in-vehicle temperature is 22℃. The logic for determining whether the target vehicle needs defogging can be as follows: if the in-vehicle humidity is higher than a preset threshold (e.g., 85%), and the in-vehicle temperature is moderate (to avoid extreme high or low temperatures affecting the judgment), then the high in-vehicle humidity causes the windows to fog up, making it necessary for the target vehicle to be defogging.
[0037] As an example, regarding scenario one above: in-vehicle environmental data can include in-vehicle air quality. The judgment logic can be that poor air quality leads to poor ventilation inside the vehicle, indirectly increasing the risk of fogging, thus determining that the target vehicle needs defogging.
[0038] As an example, regarding scenario two above: external environmental data can include external temperature and external humidity. The logic for determining whether a target vehicle needs defogging could be that if the external temperature is low and the humidity is high, then the target vehicle needs defogging.
[0039] As an example, regarding scenario two above: external environmental data can include rainfall data. The logic for determining whether a target vehicle needs defogging could be that if the current rainfall indicates heavy rain, then the target vehicle needs defogging.
[0040] As an example, regarding scenario three above: in-vehicle environmental data includes in-vehicle temperature and humidity data; out-of-vehicle environmental data includes out-of-vehicle temperature and humidity data. The judgment logic can be to determine whether the target vehicle needs defogging based on the temperature difference between the inside and outside of the vehicle and the relative humidity.
[0041] In one possible implementation, the associated data for the target vehicle may also include vehicle speed data and target vehicle position data. A defogging decision model can be used to determine whether the target vehicle needs defogging. Cases one through three above, the vehicle speed data, and the target vehicle position data can all be used as inputs to the defogging decision model when determining whether the target vehicle needs defogging.
[0042] As an example, the defogging judgment model can represent a pre-trained model used to determine whether a target vehicle needs defogging. In the embodiments of this application, the defogging judgment model can be a Support Vector Machine (SVM), a neural network model (such as a convolutional neural network), a random forest model, etc., and is not specifically limited thereto.
[0043] In step S102, based on the associated data of the target vehicle, it is determined whether the target vehicle needs to be defogged.
[0044] As can be seen from the above, each of scenarios one through three has its own method for determining whether the target vehicle needs defogging. For example, in-vehicle environmental data can include in-vehicle humidity, and out-of-vehicle environmental data can include out-of-vehicle humidity. A method to determine whether the target vehicle needs defogging could be that the relative humidity of the in-vehicle and / or out-of-vehicle humidity exceeds a relative humidity threshold. Another example: in-vehicle environmental data can include in-vehicle temperature, and out-of-vehicle environmental data can include out-of-vehicle temperature. A method to determine whether the target vehicle needs defogging could be that the temperature difference between the in-vehicle and out-of-vehicle temperatures exceeds a temperature threshold.
[0045] In step S103, if the target vehicle needs to be defogged, the target vehicle is controlled to perform defogging.
[0046] Once it is determined that the target vehicle needs defogging, the defogging function of the target vehicle can be executed by controlling the controller of the target vehicle.
[0047] As an example, performing the defogging function on the target vehicle may include, for example, turning on the windshield defogging, side window defogging, adjusting the temperature and fan speed of the air conditioning system, or turning on the vehicle's windshield wipers, etc., without being specifically limited here.
[0048] The vehicle defogging method provided in this application determines whether the target vehicle has encountered conditions that cause window fogging by using at least one of the in-vehicle environmental data and external environmental data. Once such conditions are detected, the method immediately controls the target vehicle to defog, eliminating the need for manual operation of the vehicle's defogging components by the driver and reducing delays in the defogging operation. Furthermore, the method intelligently adjusts the defogging operation based on in-vehicle and external environmental data, thereby effectively improving the vehicle's defogging performance.
[0049] In one possible implementation, taking scenario three above as an example, when the vehicle defogging method is implemented through a defogging judgment model, it may specifically include: when the user manually activates the defogging function, acquiring the first associated data of the target vehicle, and training the defogging judgment model based on the first associated data of the target vehicle to obtain an updated defogging judgment model, wherein the first associated data includes in-vehicle environment data, out-of-vehicle environment data, vehicle speed data, and target vehicle position data; when the second associated data of the target vehicle is acquired and the user has not manually activated the defogging function, inputting the second associated data of the target vehicle into the defogging judgment model to determine the defogging judgment result; based on the defogging judgment result, determining whether the target vehicle needs to be defogging, and when it is determined that the target vehicle needs to be defogging, controlling the target vehicle to perform defogging.
[0050] It should be noted that the defogging judgment model is a pre-trained defogging judgment model. The first and second associated data can be different associated data. For example, the first associated data can include temperature data and humidity data; where the temperature data in the first associated data can be M1 and the humidity data in the first associated data can be N1. The second associated data can also include temperature data and humidity data; where the temperature data in the second associated data can be M2 and the humidity data in the second associated data can be N2.
[0051] Users can manually activate the defogging function by clicking the defogging function button. After the user manually activates the defogging function, the vehicle controller can respond to the user's trigger operation by turning on the vehicle's electric heater, thereby achieving the purpose of defogging.
[0052] In practice, during vehicle operation, the defogging judgment model needs to determine in real time whether the vehicle needs defogging based on the target vehicle's primary associated data. When a user manually activates the defogging function, the user's defogging requirement is that the vehicle needs defogging. If the defogging judgment model determines that the vehicle does not need defogging, then the model's defogging judgment result is inaccurate and contradicts the user's defogging requirement. Therefore, it is necessary to train the defogging judgment model to improve its accuracy and obtain an updated model.
[0053] As an example, when the defogging judgment model can be a support vector machine, the training process of the defogging judgment model can be as follows: First, the geographical location needs to be partitioned and the season needs to be distinguished on the cloud platform. The geographical location and season need to be encoded and represented by specific hexadecimal values, which are used in the neural network model code to distinguish the data between different regions and seasons.
[0054] The in-vehicle environment data, out-of-vehicle environment data, vehicle speed data, and target vehicle position data are used as features input into the neural network model. The result of whether the defogging function is activated is used as the target value (0 or 1) (for example, the target value is calculated using the sigmoid function). The dataset is divided into training, test, and validation sets using the train_test_split function. The training set is used as the model training data input, and the model is trained using Support Vector Machine (SVM) functions from the sklearn library or TensorFlow / Keras deep learning library functions.
[0055] The validation set separated from the dataset is used to validate the defogging judgment model. The hyperparameters of the machine learning model are adjusted by grid search to reduce misclassification and clarify the decision boundary. The model's learning results are evaluated by accuracy and recall metrics.
[0056] The updated defogging judgment model can be validated using a test set to obtain a more complete scenario classification of whether users enable or disable the defogging function, making it applicable to real-world new data.
[0057] The updated defogging judgment model can be used for example: In spring, user A is driving on the Guangdong coastal expressway. The temperature difference between the inside and outside of the car severely affects visibility, so user A manually turns on the defogging function (corresponding to southern coastal areas, spring, heavy rain, and expressway respectively; matching user behavior as manually turning on the defogging function - assigned value 1). The updated defogging judgment model can be used when, in spring, user A is driving on the Guangdong coastal expressway and the temperature difference between the inside and outside of the car severely affects visibility, the target vehicle needs defogging. In winter, user A is driving back to their hometown in Hubei. They stop at a rest area and are caught in a sudden downpour, but user A does not need defogging. Therefore, matching user behavior results in defogging not being turned on (assigned value 0). The updated defogging judgment model can be used when, in winter, user A is driving back to their hometown in Hubei. They stop at a rest area and are caught in a sudden downpour, the target vehicle does not need defogging.
[0058] The vehicle defogging method provided in this application training method trains a defogging judgment model by acquiring in-vehicle environmental data, out-of-vehicle environmental data, vehicle speed data, and target vehicle position data. Based on the defogging judgment model, it determines whether the target vehicle needs defogging. It can intelligently determine whether the target vehicle needs defogging and can immediately control the target vehicle to perform defogging when the target vehicle meets the defogging conditions, thereby improving the efficiency of vehicle defogging.
[0059] In addition, considering that the user manually activates the defogging function, the judgment result of the defogging judgment model is inconsistent with the user's defogging needs, when the user manually activates the defogging function, it is necessary to train the defogging judgment model based on the correlation data of the target vehicle to improve the accuracy of the defogging judgment model, so that the defogging judgment model can better meet the user's defogging needs, thereby improving the accuracy of vehicle defogging.
[0060] This application provides a vehicle defogging method, which can be executed by a computer device on the vehicle, such as a vehicle controller. Figure 2 is a flowchart of another vehicle defogging method according to an embodiment of this application. As shown in Figure 2, the process includes the following steps S201 to S203.
[0061] In step S201, the associated data of the target vehicle is obtained. Please refer to step S101 of the embodiment shown in Figure 1 for details, which will not be repeated here.
[0062] In step S202, based on the associated data of the target vehicle, it is determined whether the target vehicle needs to be defogged.
[0063] Specifically, the in-vehicle environment data of the target vehicle includes: in-vehicle temperature data and in-vehicle humidity data; the out-of-vehicle environment data includes: out-of-vehicle temperature data and out-of-vehicle humidity data; wherein, the above step S202 includes the following steps S2021 to S2024.
[0064] In step S2021, the temperature difference between the outside temperature data and the inside temperature data is determined based on the outside temperature data and the inside temperature data.
[0065] Outside temperature data represents the current temperature of the external environment of the target vehicle. Inside temperature data represents the current temperature of the internal environment of the target vehicle. In practice, when determining the outside and inside temperature data, the outside temperature data can be subtracted from the inside temperature data to obtain the temperature difference.
[0066] As an example, when the outside temperature is 20°C and the inside temperature is 15°C, the temperature difference can be 5°C.
[0067] In step S2022, the relative humidity outside the vehicle is determined based on the maximum humidity corresponding to the outside humidity data and the outside temperature data.
[0068] External humidity data characterizes the current humidity information of the target vehicle's external environment. Maximum humidity characterizes the maximum amount of water vapor that the air can contain at the current temperature of the target vehicle's external environment, and can be expressed as the humidity at which the relative humidity reaches 100%. In practice, the outdoor relative humidity can be calculated using external humidity data and the maximum humidity at the corresponding external temperature.
[0069] As an example, the relative humidity outside the vehicle can be calculated using the following formula: Relative humidity outside the vehicle = (Humidity outside the vehicle / Maximum humidity at the outside temperature) * 100%.
[0070] As an example, the relative humidity outside the vehicle can also be determined using the following formula: RH1 = e1 / E1 × 100%; where RH1 is the relative humidity outside the vehicle, e1 is the actual water vapor pressure outside the vehicle, and E1 is the saturated water vapor pressure outside the vehicle. In the embodiments of this application, the actual water vapor pressure outside the vehicle can be determined by the humidity outside the vehicle, and the saturated water vapor pressure outside the vehicle can be determined by the maximum humidity at the outside temperature.
[0071] In step S2023, the relative humidity inside the vehicle is determined based on the maximum humidity corresponding to the vehicle interior humidity data and the vehicle interior temperature data.
[0072] In-vehicle humidity data characterizes the current humidity information inside the target vehicle. Maximum humidity characterizes the maximum amount of water vapor the air can contain at the current temperature inside the target vehicle, and can be expressed as the humidity at 100% relative humidity. In practice, the in-vehicle relative humidity can be calculated using in-vehicle humidity data and the maximum humidity at the corresponding in-vehicle temperature.
[0073] In step S2024, if at least one of the relative humidity outside the vehicle and the relative humidity inside the vehicle is greater than the relative humidity threshold, and the temperature difference is greater than the temperature difference threshold, it is determined that the target vehicle needs to be defogging.
[0074] The relative humidity threshold can be used to determine whether the relative humidity is too high. In this embodiment, the relative humidity threshold can be, but is not limited to, 90%, etc., and is not specifically limited here. The temperature difference threshold can be used to determine whether the temperature difference is too high. In this embodiment, the temperature difference threshold can be, but is not limited to, 5°C, etc., and is not specifically limited here. Specifically, whether the target vehicle needs defogging is determined by judging at least one of the external relative humidity, the internal relative humidity, and the temperature difference.
[0075] As an example, if a vehicle has been parked overnight in cold and foggy weather, with an outside temperature of -2°C and an outside humidity of 95%, and the interior of the vehicle has maintained a certain temperature and humidity due to passenger use the previous night, with an interior temperature of 10°C and an interior humidity of 50%, then the vehicle needs to be defogged.
[0076] As an example, the relative humidity threshold is 90%, and the temperature difference threshold is 5°C. If the relative humidity outside the vehicle is 95%, the relative humidity inside the vehicle is 65%, and the temperature difference is 8°C, then because both the relative humidity outside the vehicle and the temperature difference are greater than the threshold, it is determined that the vehicle needs to be defogged.
[0077] In step S203, if the target vehicle needs defogging, the target vehicle is controlled to perform defogging. Please refer to step S103 of the embodiment shown in Figure 1 for details, which will not be repeated here.
[0078] The vehicle defogging method provided in this application can detect subtle changes in the vehicle's internal and external environments in real time by using the temperature difference between the vehicle's interior and exterior temperatures, as well as the relative humidity inside and outside the vehicle. That is, it can quickly capture subtle changes in the vehicle's internal and external environments, whether through small fluctuations in temperature or increases or decreases in humidity, and thus accurately determine whether the vehicle needs defogging based on these subtle changes.
[0079] In one possible implementation, the external environment data also includes rainfall data. In this embodiment, step S202 further includes: when the rainfall data is greater than or equal to a rainfall threshold, determining that the target vehicle needs defogging.
[0080] Rainfall data can characterize the real-time rainfall information of the vehicle's environment. Rainfall thresholds can be used to indicate whether the current rainfall meets the conditions for triggering defogging operations.
[0081] In practice, rainfall information about the target vehicle's environment can be obtained in real time through rain sensors installed on the vehicle or other meteorological data sources. A reasonable rainfall threshold can be preset based on historical meteorological data, user preferences, and other factors. The real-time rainfall data is then compared with the rainfall threshold. If the rainfall data is greater than or equal to the threshold (i.e., the rainfall is heavy and may cause the windshield to fog up), the target vehicle is determined to need defogging; conversely, if the rainfall data is less than the threshold, the target vehicle is determined not to need defogging.
[0082] In one possible implementation, the rainfall threshold can be set according to different regions or determined based on historical data. No specific limitation is made here, and it can be implemented by those skilled in the art.
[0083] As an example, in humid and rainy areas, where rainfall is frequent and abundant, the rainfall threshold can be set relatively high. In dry and arid areas, where rainfall is scarce and in small amounts, the rainfall threshold can be set relatively low to ensure that defogging operations are triggered promptly even under limited rainfall conditions.
[0084] As an example, the rainfall threshold setting can be further optimized by analyzing historical meteorological data of the target vehicle's location, particularly rainfall amount and frequency. For instance, if historical data shows that rainfall frequently exceeds a specific value during a certain period and is accompanied by windshield fogging, that value can be used as the rainfall threshold.
[0085] The vehicle defogging method provided in this application can distinguish the rainy weather conditions of the vehicle by detecting rainfall data in the external environment data, such as heavy rain, moderate rain, and light rain, and can determine the distribution of raindrops on the vehicle's glass components, so that even considering only rainfall data, it can accurately determine whether the vehicle needs to be defogged.
[0086] In order to adjust the defogging power of the target vehicle, in one possible implementation, the above vehicle defogging method may further include: when the rainfall data is greater than or equal to the rainfall threshold, inputting the rainfall data and vehicle speed data into the defogging control model, determining the defogging power, and controlling the target vehicle to perform defogging based on the defogging power.
[0087] When a vehicle needs defogging, the first step is to check if the rainfall data is greater than or equal to a rainfall threshold. In this embodiment, the rainfall threshold indicates whether it is raining. When the rainfall data is greater than or equal to the rainfall threshold, the rainfall data and vehicle speed data are input into the defogging control model to determine the defogging power, and the vehicle is defogging according to the defogging power. For example, at low speeds and with less rainfall, the defogging heating power is reduced; conversely, at higher speeds, the highest heating power is used. By adjusting the defogging power, the temperature emitted by the vehicle's defogging heater can be controlled, thereby controlling the target vehicle to perform defogging.
[0088] The vehicle defogging method provided in this application embodiment can dynamically adjust the defogging power based on real-time rainfall data and vehicle speed data. The defogging power calculated by the model is more accurate, avoiding the problems of over-defogging or incomplete defogging that may be caused by traditional fixed-power defogging.
[0089] In one possible implementation, the associated data of the target vehicle further includes: first image data to be tested of the glass component of the target vehicle. In this embodiment, step S202 further includes step S301.
[0090] In step S301, a first defogging judgment result is determined based on the first image data to be tested of the glass component of the target vehicle, the labeled image data corresponding to the first image data to be tested, and the target fogging threshold; wherein, the labeled image data is the image data of the glass component of the target vehicle collected when the target vehicle does not need defogging.
[0091] The first image data to be tested can be image data of the glass components of the target vehicle (such as the windshield, rear windshield, front camera, rearview mirror, etc.). In the embodiments of this application, the first image data to be tested can be real-time image data, which can be detected by the vehicle's image sensors, etc., and is not specifically limited here.
[0092] The target fogging threshold can be configured to determine whether the grayscale gradient of the first test image changes due to fogging. The labeled image data corresponding to the first test image data is the image data of the glass components of the target vehicle collected when the target vehicle does not require defogging; that is, the labeled image data corresponding to the first test image data can be pre-collected data.
[0093] In practice, a camera or other image acquisition device can be used to acquire the first image data of the target vehicle's glass components. Annotated image data of the target vehicle's glass components acquired when defogging is not required can also be retrieved from the storage system.
[0094] When determining the first defogging judgment result, image processing algorithms can be used to determine the difference between the mean grayscale gradient of the first test image data and the grayscale gradient of the corresponding labeled image data. Based on the comparison between the grayscale gradient ratio of the first test image data and the grayscale gradient of the corresponding labeled image data and the target fogging threshold, it is determined whether the clarity of the glass component in the first test image data is lower than the baseline level of the clarity of the glass component in the labeled image data, thereby determining whether the target vehicle needs defogging. For example: if the first test image shows significant fog or water droplets on the glass component, affecting the clarity of the field of view, and the baseline level of the clarity of the glass component in the corresponding labeled image data is no fog or water droplets, and the clarity of the glass component in the first test image data is lower than the baseline level in the corresponding labeled image data, then it is determined that the vehicle needs defogging.
[0095] Specifically, step S301 includes steps S3011 to S3014.
[0096] In step S3011, the first gray-level gradient component in the horizontal direction and the second gray-level gradient component in the vertical direction of each pixel in the first image data to be tested are determined.
[0097] A pixel can represent the smallest unit in an image, and each pixel contains information such as color and brightness. In this embodiment, the first image data to be tested can be grayscale image data. The first grayscale gradient component can represent the rate of change of brightness in the horizontal direction. The second grayscale gradient component can represent the rate of change of brightness in the vertical direction.
[0098] In practice, the grayscale difference between each pixel in the image data under test and its horizontally adjacent pixels can be calculated to obtain the grayscale gradient in the horizontal direction. Similarly, the grayscale difference between each pixel in the image data under test and its vertically adjacent pixels can be calculated to obtain the grayscale gradient in the vertical direction.
[0099] In step S3012, the gradient magnitude corresponding to each pixel is determined based on the first gray-level gradient component and the second gray-level gradient component.
[0100] The gradient magnitude of each pixel can be calculated using the Pythagorean theorem or equivalent methods, combining the grayscale gradient components in the horizontal and vertical directions. In this embodiment, the gradient magnitude can indicate the overall intensity of the brightness change of that pixel.
[0101] In step S3013, the mean grayscale gradient of the first image data to be tested is determined based on the gradient magnitude of each pixel.
[0102] The mean grayscale gradient is obtained by calculating the average gradient magnitude of all pixels in the image. The mean grayscale gradient indicates the overall brightness variation of the image and can be used to assess image sharpness.
[0103] In step S3014, a first defogging judgment result is determined based on the ratio between the mean gray-level gradient and the target gray-level gradient and the target fogging threshold. When the ratio between the mean gray-level gradient and the target gray-level gradient is less than the target fogging threshold, it is determined that the target vehicle needs to be defogging. The target gray-level gradient is calculated from the labeled image data corresponding to the first image data to be tested.
[0104] The target grayscale gradient is the average grayscale gradient of the labeled image data corresponding to the first image data to be tested. Specifically, the ratio of the average grayscale gradient of the second image data to the target grayscale gradient is calculated. This ratio is then compared to a target fogging threshold. If the ratio is less than the target fogging threshold, the target vehicle needs to be defogged. In this embodiment, the target fogging threshold can be, but is not limited to, 0.7, 0.6, or 0.5, and can be set according to actual conditions.
[0105] As an example, in the initial judgment stage, the target gray-level gradient G = the mean gray-level gradient G0, and the fogging parameter G0 / G = 1 is calculated; when G0 is much smaller than G, it is judged that the probability of fogging is high and the vehicle needs to be defogging, and output 1 (the vehicle needs to be defogging); otherwise, output 0 (the vehicle does not need to be defogging).
[0106] In step S302, based on the first defogging judgment result, it is determined whether the target vehicle needs to be defogged.
[0107] After determining the initial defogging assessment result, it can be directly used to determine whether the target vehicle needs defogging. For example, if the initial defogging assessment result is "defogging," then the target vehicle needs defogging.
[0108] Specifically, step S302 includes steps S3021 and S3022.
[0109] In step S3021, a second defogging judgment result is obtained by using a pre-trained defogging judgment model based on the associated data.
[0110] The associated data can be used as input to the pre-trained defogging judgment model, and the second defogging judgment result can be used as output to the pre-trained defogging judgment model.
[0111] In step S3022, based on the first defogging judgment result and the second defogging judgment result, it is determined whether the target vehicle needs to be defogged.
[0112] Whether a vehicle needs defogging can be determined by combining the first and second defogging judgment results. In this embodiment, when any one or more of the first and second defogging judgment results indicate that the vehicle needs defogging, it is determined that the target vehicle needs defogging.
[0113] The vehicle defogging method provided in this application introduces the first test image data of the glass component of the target vehicle to increase the conditions for determining whether the vehicle needs to be defogging, and combines the defogging judgment result determined by the labeled image data and the target fogging threshold as the basis for determining whether the vehicle needs to be defogging, thereby improving the accuracy of vehicle defogging judgment.
[0114] Furthermore, by determining the first gray-level gradient component in the horizontal direction and the second gray-level gradient component in the vertical direction of each pixel in the image data to be tested, precise information about the gray-level changes of each pixel in the image can be determined. Then, based on the horizontal and vertical gray-level gradient components of each pixel and the average gradient magnitude of all pixels in the image data to be tested, the average gray-level gradient is obtained. By comparing the ratio of the average gray-level gradient to the target gray-level gradient with a fogging threshold, the difference in gray-level gradient between the image to be tested and the target image can be quantified, thereby accurately determining whether the vehicle needs defogging.
[0115] In addition, the first image data to be tested of the target vehicle's glass, the labeled image data, and the first defogging judgment result determined by the target fogging threshold are introduced as a judgment condition for determining whether the vehicle needs to be defogged. The determination of whether the vehicle needs to be defogged is not based solely on the first defogging judgment result, but rather on the combination of the first defogging judgment result and the predicted result (e.g., the second defogging judgment result). This avoids misjudgment of vehicle defogging due to inaccurate judgment of the defogging judgment model, thereby improving the accuracy of vehicle defogging judgment.
[0116] In one possible implementation, the above method further includes steps S401 to S404.
[0117] In step S401, the second image data of the glass component of the target vehicle is input into the pre-trained defogging judgment model to obtain the third defogging judgment result.
[0118] The third defogging judgment result can indicate whether the vehicle needs defogging based on the defogging judgment model. Specifically, the second image data of the glass component can be used as the input to the defogging judgment model, and the third defogging judgment result can be used as the output of the defogging judgment model.
[0119] In step S402, the search operation for the target fogging threshold is repeatedly performed until the target fogging threshold is determined. The search operation for the target fogging threshold includes: determining the fourth defogging judgment result for the search operation based on the second image data to be tested of the glass component of the target vehicle, the labeled image data corresponding to the second image data to be tested, and the candidate fogging threshold for the search operation.
[0120] In step S403, when the third defogging judgment result and the fourth defogging judgment result are different, the candidate fogging threshold for the next search operation is determined according to the preset value and the candidate fogging threshold targeted by the search operation.
[0121] The preset value can be set manually. In the embodiments of this application, the preset value can be 2%, 3%, etc., and no specific limitation is made here.
[0122] In practice, if the third and fourth defogging judgment results differ, it indicates that the fourth defogging judgment result obtained from image processing is inaccurate. In this case, it is necessary to adjust the candidate fogging threshold according to a preset value to determine the candidate fogging threshold for the next search operation. For example, in some embodiments of this application, adjusting the candidate fogging threshold according to a preset value to determine the candidate fogging threshold for the next search operation may mean increasing or decreasing the candidate fogging threshold by a preset value to obtain the candidate fogging threshold for the next search operation.
[0123] In step S404, when the third defogging judgment result and the fourth defogging judgment result are the same, the candidate fogging threshold targeted by the search operation is determined as the target fogging threshold.
[0124] When the third defogging judgment result and the fourth defogging judgment result are the same, that is, when the candidate fogging threshold targeted by the search operation corresponding to the fourth defogging judgment result can satisfy the configuration to determine whether the gray-scale gradient of the second image under test changes due to fogging, the candidate fogging threshold targeted by the search operation can be determined as the target fogging threshold.
[0125] The vehicle defogging method provided in this application embodiment indicates that the fourth defogging judgment result obtained through image processing is inaccurate when the third defogging judgment result and the fourth defogging judgment result are different. It is necessary to adjust the candidate fogging threshold and determine the target fogging threshold. That is, the candidate fogging threshold targeted by the target fogging threshold search operation is continuously adjusted according to the preset value so that when the third defogging judgment result and the fourth defogging judgment result are the same, the target fogging threshold is accurately determined.
[0126] In one possible implementation, step S202 above includes steps S501 and S502.
[0127] In step S501, based on the associated data of the target vehicle, fogging judgment parameters corresponding to the associated data of the target vehicle are determined; wherein, the fogging judgment parameters include temperature parameters and humidity parameters, and the associated data of the target vehicle is data that changes in real time.
[0128] Fogging judgment parameters can characterize the conditions for determining whether a vehicle needs defogging based on correlated data. In the embodiments of this application, fogging judgment parameters may include temperature parameters and humidity parameters.
[0129] In practice, fogging judgment parameters can be determined based on the associated data of the target vehicle. In this embodiment, the associated data changes in real time, meaning that the latest associated data can be continuously acquired, allowing the fogging judgment parameters to be updated in real time as well.
[0130] As an example, a mapping table between fogging judgment parameters and related data can be used to determine the fogging judgment parameters corresponding to different related data. Real-time analysis of fogging judgment parameters enables the target vehicle to determine whether it needs defogging under different conditions such as different regions, temperatures, and humidity levels.
[0131] In step S502, based on the comparison results between the fogging judgment parameters and the correlation data of the target vehicle, it is determined whether the target vehicle needs to be defogging.
[0132] After determining the fogging detection parameters, the need for defogging can be determined by comparing the fogging detection parameters with the associated data of the target vehicle. For example, if the temperature parameter in the fogging detection parameters is T1, and the associated data includes the outside temperature and the inside temperature of the vehicle, and the difference between the outside temperature and the inside temperature is T2, then the target vehicle needs defogging if T2 is greater than T1.
[0133] The vehicle defogging method provided in this application embodiment allows temperature and humidity parameters to be varied through correlation data. The correlation data is real-time changing data, meaning that different temperature and humidity parameters can be determined based on different correlation data. Then, by using the correlation data and the corresponding fogging judgment parameters, it is possible to accurately determine whether the target vehicle needs defogging.
[0134] In one possible implementation, the above method further includes steps S601 to S603.
[0135] In step S601, the associated data is input into the pre-trained defogging judgment model to obtain the predicted defogging probability corresponding to the associated data. The predicted defogging probability represents the probability that defogging needs to be performed under the conditions represented by the associated data.
[0136] In step S602, the fifth defogging judgment result corresponding to the associated data is determined based on the comparison result between the predicted defogging probability and the defogging probability threshold corresponding to the associated data.
[0137] The associated data is input into a pre-trained defogging judgment model. The model calculates a predicted defogging probability based on the input data and compares this probability with a defogging probability threshold. If the predicted probability is greater than or equal to the threshold, the vehicle is determined to need defogging; otherwise, it is determined not to need defogging. The comparison result between the predicted and threshold probabilities is then compared with the labeled results in the training data to determine whether the parameters of the pre-trained defogging judgment model need updating.
[0138] In step S603, when the fifth defogging judgment result corresponding to the associated data is different from the annotation result of the associated data, the parameters of the pre-trained defogging judgment model are updated.
[0139] If the fifth defogging judgment result corresponding to the associated data is different from the labeled result of the associated data, it indicates that the prediction performance of the pre-trained defogging judgment model needs to be improved. In this case, the parameters of the pre-trained defogging judgment model should be updated to improve the model's prediction accuracy. For example, in some embodiments of this application, when the user's actual operation result differs from the model's judgment result, it is necessary to train the model based on the associated data corresponding to the user's actual operation. In this case, the associated data corresponding to the user's actual operation can be used as new associated data, and the user's actual operation result can be used as the corresponding labeled result. Then, the model parameters are updated based on the new associated data and the corresponding labeled result.
[0140] The vehicle defogging method provided in this application continuously updates the model's parameters through associated data, enabling the model to better adapt to various real-world situations and improving the accuracy of determining whether a target vehicle needs defogging. Furthermore, the performance of a pre-trained defogging judgment model often depends on its generalization ability when faced with new, unseen data. By continuously updating the parameters of the pre-trained defogging judgment model with new associated data and corresponding annotation results for the target vehicle, the model's adaptability to new data can be enhanced, improving its generalization performance.
[0141] In one possible implementation, the associated data further includes at least one of the following: self-vehicle data and other vehicle data; self-vehicle data includes at least one of the following: seasonal data of the target vehicle, regional location of the target vehicle, and vehicle speed data; other vehicle data includes at least one of the following: seasonal data of other vehicles, regional location of other vehicles, and vehicle speed data.
[0142] The associated data of the target vehicle can include not only its own data but also data from other vehicles. In this embodiment, the data from other vehicles can be received by a cloud server and sent to the target vehicle.
[0143] The vehicle defogging method provided in this application addresses the significant differences in the likelihood of window fogging under different seasons, regions, and vehicle speeds. By introducing more dimensional data (season, location, and speed), the model can gain a more comprehensive understanding of the current environmental conditions, thereby improving the accuracy of determining whether a target vehicle needs defogging.
[0144] In order to accurately determine the labeled image data, in one possible implementation, the above method further includes: using image data collected when the target vehicle meets preset conditions as labeled image data; wherein the preset conditions include: the current weather is without fog or precipitation, the visibility of the target vehicle's glass is greater than the visibility threshold, the relative humidity is lower than the relative humidity threshold, and the target vehicle's defogging function is not turned on.
[0145] No fog and no precipitation indicates the absence of fog and precipitation in the weather conditions. The visibility threshold can be set according to the actual situation and is not specifically limited here. Relative humidity can be characterized as the ratio of the water vapor content in the air to the maximum amount of water vapor that the air can contain at the current temperature.
[0146] In practice, the system acquires real-time weather conditions through weather sensors installed on the vehicle or external weather data sources. Visibility of glass components such as the windshield is assessed using cameras or sensors inside the vehicle. Relative humidity data is acquired in real-time using a humidity sensor on the vehicle. The vehicle's control system monitors whether the user has manually activated the defroster function. All of this information is combined to determine if the current state meets preset conditions (i.e., no fogging or precipitation, visibility of glass components greater than a threshold, relative humidity below a relative humidity threshold, and defroster not activated). If the preset conditions are met, image data is captured using the vehicle's cameras and saved as labeled image data.
[0147] The vehicle defogging method provided in this application can accurately reflect the clarity of the vehicle's glass components under current weather conditions, such as no fog, no precipitation, and the visibility of the vehicle's glass components being greater than the visibility threshold, by collecting image data under preset conditions. This allows for the accurate determination of images of the vehicle's glass components that do not require defogging, thereby more accurately predicting whether the vehicle needs defogging.
[0148] Please refer to Figure 3, which is a schematic diagram of a vehicle defogging method according to an embodiment of this application.
[0149] Acquire relevant vehicle data. This data can include temperature, humidity, rainfall, and image data. Real-time temperature is measured by temperature sensors located inside and outside the vehicle and uploaded to a cloud server. The Electronic Control Unit (ECU) obtains the interior humidity (H_in), exterior humidity (H_out), interior temperature (T_in), and exterior temperature (T_out) values from humidity and temperature sensors at regular intervals (e.g., 5 seconds). By comparing the real-time humidity with the maximum humidity at the current temperature using the interior and exterior humidity sensors, the ECU calculates the interior relative humidity and exterior relative humidity. If either the interior or exterior relative humidity exceeds a relative humidity threshold (e.g., 90%), and the temperature difference exceeds a temperature difference threshold (e.g., 5°C), a risk of fogging is identified, and the vehicle requires defogging.
[0150] By measuring the current rainfall information using a rain sensor and classifying rainfall levels according to national standards, a rainfall level of ≥ moderate rain can be recorded as indicating that the vehicle needs defogging. When the vehicle activates the defogging function, the wiper controller can be activated simultaneously in conjunction with the rain sensor to ensure the wipers clear the vehicle's field of vision, maximizing the clearing of the front and rear views.
[0151] A fogging detection algorithm based on processed images captured by a camera can determine whether a vehicle needs defogging. When no fogging is detected, the image is first converted from color to grayscale. An edge detection operator is used to obtain the grayscale gradient value of each pixel, and the grayscale gradient magnitude is calculated. The target grayscale gradient G is then obtained for all pixel grayscale gradient magnitudes. The mean grayscale gradient G0 is calculated for different values in the real-time acquired image. If G0 is significantly lower than G (i.e., the ratio of the mean grayscale gradient to the target grayscale gradient is less than the fogging threshold), then the probability of fogging is considered high, and the vehicle needs defogging.
[0152] For example, in winter, when the car's heating is on and the car is coming out of an underground parking lot, if the relative humidity is determined to be less than 90% and it is determined that it is not raining outside, but because the outside temperature is lower and there is a large temperature difference compared to the inside of the car, the short-term temperature difference of the glass causes water vapor to condense. At this time, if the camera image recognition calculation parameter G0 / G is less than the threshold, it is determined that the vehicle needs to be defogging.
[0153] The vehicle defogging method provided in this application determines whether conditions causing window fogging have occurred inside the vehicle by using any one of the following: in-vehicle environmental data, out-of-vehicle environmental data, and test image data of the vehicle's glass components. Once fogging conditions are detected, the defogging program is immediately initiated without requiring manual operation of the vehicle's defogging components by the driver, thereby reducing the delay in defogging operation. Furthermore, the defogging operation is intelligently adjusted based on in-vehicle and out-of-vehicle environmental data and test image data of the glass components, thereby effectively improving the vehicle's defogging performance.
[0154] This application also provides a vehicle defogging device for implementing the above embodiments and implementation methods, and details already described will not be repeated. As used below, the term "module" can refer to software, hardware, or a combination of software and hardware that implements a predetermined function. Although the device described in the following embodiments is exemplified by a software implementation, hardware implementations, or a combination of software and hardware, are also possible and contemplated.
[0155] This application provides a vehicle defogging device, which includes: an acquisition module configured to acquire associated data of a target vehicle; wherein the associated data of the target vehicle includes at least one of in-vehicle environment data and out-of-vehicle environment data; a determination module configured to determine whether the target vehicle needs to be defogging based on the associated data of the target vehicle; and a control module configured to control the target vehicle to perform defogging when the target vehicle needs to be defogging.
[0156] In some possible implementations, the in-vehicle environmental data of the target vehicle includes: in-vehicle temperature data and in-vehicle humidity data; the external environmental data includes: external temperature data and external humidity data; wherein, the determining module includes: a first determining unit, used to determine the temperature difference between the external temperature data and the internal temperature data based on the external temperature data and the internal temperature data; a second determining unit, used to determine the external relative humidity based on the maximum humidity corresponding to the external humidity data and the external temperature data; a third determining unit, used to determine the internal relative humidity based on the maximum humidity corresponding to the internal humidity data and the internal temperature data; and a fourth determining unit, used to determine that the target vehicle needs to be defogging if at least one of the external relative humidity and the internal relative humidity is greater than a relative humidity threshold and the temperature difference is greater than a temperature difference threshold.
[0157] In some possible implementations, the external environment data also includes rainfall data; the determination module also includes: a fifth determination unit, used to determine that the target vehicle needs to be defogging when the rainfall data is greater than or equal to the rainfall threshold.
[0158] In some possible implementations, the associated data of the target vehicle also includes: first image data to be tested of the glass of the target vehicle, and the determining module further includes: a sixth determining unit, used to determine a first defogging judgment result based on the first image data to be tested of the glass of the target vehicle, the labeled image data corresponding to the first image data to be tested, and the target fogging threshold; wherein, the labeled image data corresponding to the first image data to be tested is image data of the glass of the target vehicle collected when the target vehicle does not need defogging; and a seventh determining unit, used to determine whether the target vehicle needs to be defogging based on the first defogging judgment result.
[0159] In one possible implementation, the sixth determining unit includes: a first determining subunit, used to determine a first gray-level gradient component in the horizontal direction and a second gray-level gradient component in the vertical direction for each pixel in the first image data to be tested; a second determining subunit, used to determine the gradient magnitude corresponding to each pixel based on the first gray-level gradient component and the second gray-level gradient component; a third determining subunit, used to determine the mean gray-level gradient corresponding to the first image data to be tested based on the gradient magnitude corresponding to each pixel; and a detection determining subunit, used to determine that the target vehicle needs to be defogging if the ratio of the mean gray-level gradient to the target gray-level gradient is less than a fogging threshold, wherein the target gray-level gradient is calculated from the labeled image data corresponding to the first image data to be tested.
[0160] In one possible implementation, the seventh determining unit includes: a fourth determining subunit, used to obtain a second defogging judgment result based on the associated data using a pre-trained defogging judgment model; and a fifth determining subunit, used to determine whether the target vehicle needs to be defogged based on the first defogging judgment result and the second defogging judgment result.
[0161] In some possible implementations, the above-mentioned device further includes: a training module, used to input the second test image data of the glass component of the target vehicle into a pre-trained defogging judgment model to obtain a third defogging judgment result; and a repetitive execution module, used to repeatedly execute the search operation for the target fogging threshold until the target fogging threshold is determined. The search operation for the target fogging threshold includes: determining a fourth defogging judgment result for the search operation based on the second test image data of the glass component of the target vehicle, the labeled image data corresponding to the second test image data, and the candidate fogging threshold for the search operation; when the third defogging judgment result and the fourth defogging judgment result are different, determining the next candidate fogging threshold for the next search operation based on a preset value and the candidate fogging threshold for the search operation; and when the third defogging judgment result and the fourth defogging judgment result are the same, determining the candidate fogging threshold for the search operation as the target fogging threshold.
[0162] In some possible implementations, the determining module further includes: an eighth determining unit, used to determine the fogging judgment parameters corresponding to the target vehicle's associated data based on the associated data of the target vehicle; wherein the fogging judgment parameters include temperature parameters and humidity parameters, and the associated data of the target vehicle is data that changes in real time; and a ninth determining unit, used to determine whether the target vehicle needs to be defogging based on the comparison result between the fogging judgment parameters and the associated data of the target vehicle.
[0163] In some possible implementations, the above apparatus further includes: a training subunit, used to input associated data into a pre-trained defogging judgment model to obtain the predicted defogging probability corresponding to the associated data, wherein the predicted defogging probability represents the probability that defogging needs to be performed under the conditions represented by the associated data; a comparison subunit, used to determine the fifth defogging judgment result corresponding to the associated data based on the comparison result between the predicted defogging probability corresponding to the associated data and the defogging probability threshold; and an updating subunit, used to update the parameters of the pre-trained defogging judgment model when the fifth defogging judgment result corresponding to the associated data is different from the labeled result of the associated data.
[0164] In some possible implementations, the associated data also includes at least one of the following: self-vehicle data and other vehicle data; self-vehicle data includes at least one of the following: seasonal data of the target vehicle, regional location of the target vehicle, and vehicle speed data; other vehicle data includes at least one of the following: seasonal data of other vehicles, regional location of other vehicles, and vehicle speed data.
[0165] In some possible implementations, the above-mentioned device further includes: a labeled image data determination module, used to use image data collected when the target vehicle meets preset conditions as labeled image data corresponding to the first image data to be tested; wherein the preset conditions include: the current weather is without fog and precipitation, the visibility of the glass of the target vehicle is greater than the visibility threshold, the relative humidity is lower than the relative humidity threshold, and the defogging function of the target vehicle is not turned on.
[0166] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0167] The vehicle defogging device in this application embodiment is presented in the form of a functional unit. Here, a functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0168] This application also provides a computer device having the above-described vehicle defogging device.
[0169] Please refer to Figure 4, which is a schematic diagram of a computer device provided in an optional embodiment of this application. As shown in Figure 4, the computer device includes one or more processors 10, one or more memories 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components communicate with each other using different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in memory to display graphical information of a GUI (Graphical User Interface) on external input / output devices (such as display devices coupled to the interface). In some optional embodiments, multiple processors and / or multiple buses can be used with multiple memories, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4 uses one processor 10 as an example.
[0170] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0171] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to execute the instructions to implement the method shown in the above embodiments.
[0172] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0173] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0174] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means; Figure 4 shows an example of a connection via a bus.
[0175] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diode displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0176] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0177] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0178] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the scope of this application, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for defrosting a vehicle, comprising: Obtain associated data of the target vehicle; wherein the associated data of the target vehicle includes at least one of in-vehicle environment data and out-of-vehicle environment data; Based on the associated data of the target vehicle, determine whether the target vehicle needs defogging; When the target vehicle needs to be defogged, control the target vehicle to perform defogging.
2. The vehicle defogging method according to claim 1, wherein, The in-vehicle environmental data includes: in-vehicle temperature data and in-vehicle humidity data; the out-of-vehicle environmental data includes: out-of-vehicle temperature data and out-of-vehicle humidity data; and based on the associated data of the target vehicle, determining whether the target vehicle needs defogging includes: Determine the temperature difference between the outside temperature data and the inside temperature data; The relative humidity outside the vehicle is determined based on the maximum humidity corresponding to the outside temperature data and the outside humidity data. The relative humidity inside the vehicle is determined based on the in-vehicle humidity data and the maximum humidity corresponding to the in-vehicle temperature data. If at least one of the external relative humidity and the internal relative humidity is greater than a relative humidity threshold, and the temperature difference is greater than a temperature difference threshold, then the target vehicle is determined to require defogging.
3. The vehicle defogging method according to claim 1 or 2, wherein, The external environmental data includes rainfall data; and based on the associated data of the target vehicle, determining whether the target vehicle needs defogging includes: when the rainfall data is greater than or equal to a rainfall threshold, determining that the target vehicle needs defogging.
4. The vehicle defogging method according to any one of claims 1 to 3, wherein, The associated data of the target vehicle also includes: first image data to be tested of the glass components of the target vehicle, wherein determining whether the target vehicle needs defogging based on the associated data of the target vehicle includes: Based on the first image data to be tested, the labeled image data corresponding to the first image data to be tested, and the target fogging threshold, a first defogging judgment result is determined; wherein, the labeled image data corresponding to the first image data to be tested is the image data of the glass component of the target vehicle collected when the target vehicle does not require defogging; Based on the first defogging judgment result, determine whether the target vehicle needs defogging.
5. The vehicle defogging method according to claim 4, wherein, The step of determining the first defogging judgment result based on the first image data to be tested, the labeled image data corresponding to the first image data to be tested, and the target fogging threshold includes: Determine the first gray-level gradient component in the horizontal direction and the second gray-level gradient component in the vertical direction for each pixel in the first image data to be tested; The gradient magnitude of each pixel is determined based on the first gray-scale gradient component and the second gray-scale gradient component. The mean grayscale gradient of the first image data to be tested is determined based on the gradient magnitude corresponding to each pixel. The first defogging judgment result is determined based on the ratio between the mean gray-level gradient and the target gray-level gradient, and the target fogging threshold; wherein the target gray-level gradient is calculated from the labeled image data corresponding to the first image data to be tested.
6. The vehicle defogging method according to claim 5, wherein, Based on the first defogging judgment result, determining whether the target vehicle needs defogging includes: Using a pre-trained defogging judgment model, a second defogging judgment result is obtained based on the associated data; Based on the first defogging judgment result and the second defogging judgment result, determine whether the target vehicle needs to be defogged.
7. The vehicle defogging method according to claim 6 further includes: The second image data of the glass component of the target vehicle is input into the pre-trained defogging judgment model to obtain the third defogging judgment result; Repeatedly perform the lookup operation for the target fogging threshold until the target fogging threshold is determined. The lookup operation for the target fogging threshold includes: Based on the second image data to be tested, the labeled image data corresponding to the second image data to be tested, and the candidate fogging threshold targeted by the search operation, the fourth defogging judgment result targeted by the search operation is determined; When the third defogging judgment result and the fourth defogging judgment result are different, the next candidate fogging threshold for the next search operation is determined according to the preset value and the candidate fogging threshold targeted by the search operation. When the third defogging judgment result and the fourth defogging judgment result are the same, the candidate fogging threshold targeted by the search operation is determined as the target fogging threshold.
8. The vehicle defogging method according to claim 6 further includes: The associated data is input into the pre-trained defogging judgment model to obtain the predicted defogging probability corresponding to the associated data. The predicted defogging probability represents the probability that defogging needs to be performed under the conditions represented by the associated data. Based on the comparison result between the predicted defogging probability and the defogging probability threshold corresponding to the associated data, the fifth defogging judgment result corresponding to the associated data is determined; When the fifth defogging judgment result corresponding to the associated data is different from the annotation result of the associated data, the parameters of the pre-trained defogging judgment model are updated.
9. The vehicle defogging method according to any one of claims 1 to 8, wherein, The step of determining whether the target vehicle needs defogging based on the associated data of the target vehicle includes: Based on the associated data of the target vehicle, fogging judgment parameters corresponding to the associated data of the target vehicle are determined; wherein, the fogging judgment parameters include temperature parameters and humidity parameters, and the associated data of the target vehicle is data that changes in real time; Based on the comparison results between the fogging judgment parameters and the associated data of the target vehicle, it is determined whether the target vehicle needs to be defogged.
10. The vehicle defogging method according to claim 4, further comprising: The image data collected when the target vehicle meets the preset conditions is used as the labeled image data corresponding to the first image data to be tested; wherein, the preset conditions include: the current weather is without fog and precipitation, the visibility of the target vehicle's glass is greater than the visibility threshold, the relative humidity is lower than the relative humidity threshold, and the target vehicle's defogging function is not turned on.
11. The vehicle defogging method according to any one of claims 1 to 10, wherein, The associated data also includes at least one of: vehicle data and other vehicle data; The vehicle data includes at least one of the following: the seasonal data of the target vehicle, the geographical location of the target vehicle, and the vehicle speed data of the target vehicle. The other vehicle data includes at least one of the following: the season in which the other vehicles are located, the geographical location of the other vehicles, and the speed data of the other vehicles.
12. A vehicle defrosting device, comprising: The acquisition module is configured to acquire associated data of a target vehicle; wherein the associated data of the target vehicle includes at least one of in-vehicle environment data and out-of-vehicle environment data; The determination module is configured to determine whether the target vehicle needs defogging based on the associated data of the target vehicle; The control module is configured to control the target vehicle to perform defogging when the target vehicle needs to be defogging.
13. A computer device, comprising: At least one processor; as well as At least one memory is communicatively connected to the at least one processor, the at least one memory storing computer instructions that, when executed by the at least one processor, implement the vehicle defogging method as described in any one of claims 1 to 11.
14. A non-transitory computer-readable storage medium storing computer instructions that, when executed by at least one processor, implement the vehicle defogging method as described in any one of claims 1 to 11.
15. A computer program product comprising computer instructions that, when executed by at least one processor, implement the vehicle defogging method as described in any one of claims 1 to 11.
16. A vehicle comprising: The vehicle defogger according to claim 12, or The computer device according to claim 13, or The non-transitory computer-readable storage medium according to claim 14, or The computer program product according to claim 15, or At least one processor; and at least one memory communicatively connected to the at least one processor, the at least one memory storing computer instructions, the at least one processor executing the computer instructions to perform the vehicle defogging method of any one of claims 1 to 11.