Rearview mirror control method and vehicle
By acquiring real-time images of the area behind the vehicle and recognizing the characteristics of the light spots, the problem of glare caused by strong light reflected from the exterior rearview mirrors has been solved, achieving precise anti-glare control of the exterior rearview mirrors and reducing driving safety risks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-08
- Publication Date
- 2026-03-10
AI Technical Summary
When a vehicle is driving in low light conditions, the reflection of strong light from the exterior rearview mirrors causes glare, which affects the driver's vision. Existing technology makes it difficult to accurately control the anti-glare function of the exterior rearview mirrors.
By acquiring real-time images of the area behind the vehicle, identifying light spot characteristics, determining whether the light source will cause glare risk to the exterior rearview mirrors, and triggering anti-glare control when necessary.
Precisely triggers the anti-glare function of the exterior rearview mirror, reducing driving safety risks and improving the anti-glare effect.
Smart Images

Figure CN121625959A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle control technology, and in particular to a rearview mirror control method and a vehicle. Background Technology
[0002] When a vehicle is driving at night or in low-light conditions, strong light shining on the surface of the vehicle's exterior rearview mirror and reflecting off the mirror onto the driver's eyes can easily cause glare, resulting in blurred vision, reduced ability to recognize the surrounding traffic environment, and thus increased driving safety risks.
[0003] In related technologies, the optical sensor of the vehicle's interior rearview mirror is typically used to sense ambient light and then simultaneously control both the interior and exterior rearview mirrors to activate their anti-glare functions. However, this control method focuses on the anti-glare requirements of the interior rearview mirror, only controlling the exterior rearview mirror as a secondary function. This makes it difficult to adapt to actual usage scenarios, resulting in poor anti-glare performance of the exterior rearview mirrors. Summary of the Invention
[0004] This application provides a rearview mirror control method and vehicle to solve the technical problem of poor anti-glare effect of exterior rearview mirrors in related technologies.
[0005] In a first aspect, embodiments of this application provide a rearview mirror control method, including: When the vehicle is driving in a preset environment, an image of the area behind the vehicle is acquired; The image is processed to obtain the light spots in the image; Based on the light spot, determine whether there is a risk of glare when the light source corresponding to the light spot shines on the exterior rearview mirror of the vehicle. If the light source corresponding to the light spot causes glare when it shines on the exterior rearview mirror, then the exterior rearview mirror is subject to anti-glare control.
[0006] This embodiment of the application monitors the rear light source situation in real time when the vehicle is driving in a preset environment, i.e., when the vehicle is in a scenario where there is a risk of glare. For example, it acquires an image of the area behind the vehicle in real time, then processes the image to obtain a light spot representing the light source. Based on this light spot, when it is determined that the light source corresponding to the light spot will cause a glare risk when it shines on the exterior rearview mirror, anti-glare control is applied to the exterior rearview mirror. In this way, since the determination of whether there is a glare risk and whether anti-glare is needed for the exterior rearview mirror is based on the actual situation of the rear light source of the vehicle, it adapts to the actual use scenario of the exterior rearview mirror, thereby accurately triggering the anti-glare control of the exterior rearview mirror, effectively improving its anti-glare effect, and thus reducing driving safety risks.
[0007] In one possible implementation, determining whether a glare risk will occur when the light source corresponding to the light spot illuminates the vehicle's exterior rearview mirror, based on the light spot, includes: Feature extraction is performed on the light spot to obtain the feature data of the light spot; Based on the characteristic data of the light spot, it is determined whether there is a risk of glare when the light source corresponding to the light spot shines on the exterior rearview mirror.
[0008] In this embodiment, for the acquired image of the area behind the vehicle, the light source appears in the image as a light spot, and the characteristics of the light source are reflected in the corresponding light spot. Therefore, by extracting features from the light spot, the characteristics of the corresponding light source can be determined based on the obtained feature data of the light spot. Based on this, it can be accurately determined whether the corresponding light source is one that will cause glare risk when it shines on the exterior rearview mirror.
[0009] In one possible implementation, determining whether a glare risk will occur when the light source corresponding to the light spot illuminates the exterior rearview mirror based on the characteristic data of the light spot includes: Based on the characteristic data of the light spot, the light spot that meets the preset conditions is taken as the target light spot; Based on the characteristic data of the target light spot, it is determined whether there is a risk of glare when the light source corresponding to the target light spot shines on the exterior rearview mirror.
[0010] Here, preset conditions are used to exclude invalid interference spots. Based on the feature data of the spots, the spots are first screened to filter out invalid interference spots in advance, that is, to filter out light sources that will not cause glare risk in advance, so as to reduce the basis for misjudgment, improve the accuracy of glare risk judgment, and at the same time reduce the amount of processing required for subsequent glare risk judgment and improve response speed.
[0011] In one possible implementation, there are multiple light spots, and the feature data includes the brightness and size of the light spots; The step of selecting target light spots based on the characteristic data of the light spots and meeting preset conditions includes: For each light spot, determine whether the brightness of the light spot is greater than a preset brightness threshold and whether the size of the light spot is greater than a preset size threshold; A light spot whose brightness is greater than the preset brightness threshold and whose size is greater than the preset size threshold is selected as the target light spot.
[0012] In this embodiment, the light spots are screened based on their brightness and size. This allows for the early filtering out of light spots with low brightness and small size, which means that light spots corresponding to light sources that will not cause glare risk can be accurately filtered out. The light sources corresponding to the target light spots that are retained are those that may cause glare risk, thereby improving the accuracy of subsequent glare risk assessment.
[0013] In one possible implementation, there are multiple target light spots; there are multiple feature data. The step of determining whether a glare risk will occur when the light source corresponding to the target light spot illuminates the exterior rearview mirror based on the feature data of the target light spot includes: For each spot in the target light spot, the glare quantization value of the light spot is obtained according to the feature data of the light spot and the corresponding weights; Determine whether the glare quantization value of each spot in the target light spot is greater than a preset glare threshold; If there is a spot in the target light spot whose glare quantification value is greater than the preset glare threshold, it is determined that the light source corresponding to the target light spot will cause glare risk when it shines on the exterior rearview mirror.
[0014] This embodiment considers the limitations of single-feature data of a light spot. Specifically, a single feature of a light spot cannot accurately determine whether the light source corresponding to the spot is a strong light source, such as the high beams of a vehicle approaching from behind. Therefore, this embodiment uses multiple feature data of the target light spot to comprehensively assess glare risk. This avoids the limitations of judging glare risk based on a single feature data of the light spot, improves the accuracy of judging whether the light source corresponding to the target light spot will cause glare risk, and reduces false positives. Furthermore, the aforementioned multiple feature data belong to different dimensions, respectively characterizing the visual shape of the light spot, its planar position, and the dynamic changes of the corresponding light source. Judging glare risk based on feature data of the light spot in different dimensions achieves dimensional complementarity, avoiding the shortcomings of judging with single-dimensional feature data and reducing the false positive rate.
[0015] Furthermore, by assigning different weights to different characteristic data of light spots based on their varying importance in determining glare risk, it is possible to accurately identify whether a corresponding light source will cause glare risk when it shines on the exterior rearview mirror.
[0016] In one possible implementation, the feature data includes the brightness, size, shape, and position of the light spot; For each spot in the target light spot, the glare quantization value of the light spot is obtained based on its characteristic data and corresponding weights, including: For each spot in the target light spot, the roundness of the light spot is determined according to its shape, and the offset of the light spot from the horizontal central axis of the image is determined according to its position in the image. The glare quantization value of the light spot is obtained based on the brightness and corresponding weight, size and corresponding weight, roundness and corresponding weight, and offset and corresponding weight.
[0017] In one possible implementation, the feature data includes the flicker frequency, displacement, and duration of the light source corresponding to the light spot; For each spot in the target light spot, the glare quantization value of the light spot is obtained based on its characteristic data and corresponding weights, including: For each spot in the target light spot, the glare quantization value of the light spot is obtained according to the flicker frequency and corresponding weight of the light source corresponding to the light spot, the displacement and corresponding weight, and the duration and corresponding weight.
[0018] In one possible implementation, acquiring an image of the area behind the vehicle when the vehicle is traveling in a preset environment includes: While the vehicle is in motion, the illuminance of the external environment is acquired, and it is determined whether the illuminance is less than a preset illuminance threshold. If the illuminance is less than the preset illuminance threshold, it is determined that the vehicle is driving in the preset environment, and an image of the preset area behind the rear windshield of the vehicle is acquired.
[0019] In this embodiment, when the vehicle is in a low-light environment, such as at night, if strong light, such as the high beams of a vehicle behind, shines on the surface of the vehicle's exterior rearview mirror and is reflected, and this reflected light acts on the driver's eyes, the large brightness difference between the reflected light and the surrounding low-light environment exceeds the range that the human eye can tolerate, easily causing glare and resulting in eye discomfort and blurred vision for the driver. Therefore, when the illuminance of the external environment is less than a preset illuminance threshold, the vehicle is considered to be in a low-light environment, and the vehicle is in a scenario where glare risk may occur.
[0020] In one possible implementation, processing the image to obtain the light spot in the image includes: The image is preprocessed, and pixels in the preprocessed image whose brightness is greater than a set brightness value are marked as target pixels. The target pixels are aggregated to obtain an initial light spot; The initial light spot is morphologically optimized to obtain an independent light spot.
[0021] Here, the image is preprocessed to reduce invalid noise interference, suppress overexposure in bright areas, enhance details in dark areas, and improve the accuracy of subsequent spot detection. When determining the spot, initial spots can be obtained quickly and efficiently through brightness-based initial screening and aggregation processing. Finally, morphological optimization of the initial spots ensures that the final output spots are independent, complete, and have clear boundaries, providing high-quality spots for subsequent glare risk assessment.
[0022] Secondly, embodiments of this application provide a rearview mirror control device, including: The acquisition module is used to acquire images of the area behind the vehicle when the vehicle is driving in a preset environment.
[0023] The module is used to process the image to obtain the light spots in the image.
[0024] The determination module is used to determine, based on the light spot, whether there is a risk of glare when the light source corresponding to the light spot shines on the exterior rearview mirror of the vehicle.
[0025] The control module is used to perform anti-glare control on the exterior rearview mirror when there is a risk of glare when the light source corresponding to the light spot illuminates the exterior rearview mirror.
[0026] Thirdly, embodiments of this application provide a vehicle including a memory and a controller, wherein the memory stores a computer program that can run on the controller, and the controller executes the computer program to implement the rearview mirror control method as described in any of the first aspects.
[0027] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a controller, implements the rearview mirror control method as described in any of the first aspects.
[0028] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0029] 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. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application; Figure 2 This is a schematic flowchart of a rearview mirror control method provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a rearview mirror control method provided in another embodiment of this application; Figure 4 This is a schematic diagram of the structure of a rearview mirror control device provided in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of a vehicle provided in one embodiment of this application. Detailed Implementation
[0032] The present application will be described more clearly below with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the function of the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0033] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0034] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0035] In the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0036] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0037] Furthermore, the term "multiple" mentioned in the embodiments of this application should be interpreted as two or more.
[0038] Vehicle rearview mirrors are designed to provide a clear image so that drivers can clearly observe vehicles approaching from behind and to the sides, intersections, etc. Therefore, exterior rearview mirrors have high reflectivity to ensure image clarity. However, when driving at night or in low-light conditions, if strong light, such as the high beams of a vehicle behind, shines on the surface of the exterior rearview mirror, its high reflectivity means it absorbs almost no light, reflecting most of it. When this reflected light reaches the driver's eyes, it easily causes glare, leading to eye discomfort, blurred vision, and reduced ability to perceive the surrounding traffic environment, increasing driving safety risks. Therefore, anti-glare control measures are necessary for exterior rearview mirrors.
[0039] In related technologies, the optical sensors of the vehicle's interior rearview mirror are typically used to sense ambient light and then simultaneously control both the interior and exterior rearview mirrors to activate their anti-glare functions. In other words, this anti-glare control is designed specifically for the interior rearview mirror's anti-glare requirements and focuses on its triggering conditions. The exterior rearview mirrors are only controlled incidentally, making it difficult to adapt to their actual usage scenarios. This results in inaccurate anti-glare triggering for the exterior rearview mirrors, leading to poor anti-glare performance and an inability to effectively avoid the risk of glare from strong light.
[0040] Based on the above problems, the inventors considered that if the situation of the light source behind the vehicle could be directly monitored, and the light source behind the vehicle was identified as one that would cause glare to the exterior rearview mirror, the anti-glare function of the exterior rearview mirror could be activated. This would avoid the shortcomings of related technologies where controlling the anti-glare function of the interior rearview mirror would also control the exterior rearview mirror, making it difficult to adapt to the actual usage scenarios of the exterior rearview mirror. This would achieve the goal of accurately triggering the anti-glare function of the exterior rearview mirror and improving its anti-glare effect. Specifically, images of the light source behind the vehicle can be collected. Since the light source appears as a light spot on the image, and the characteristics of the light source are reflected in the light spot, the characteristics of the light spot representing the light source in the image can be used to determine whether the light source will cause glare when it shines on the exterior rearview mirror.
[0041] In other words, in the embodiments of this application, when the vehicle is driving in a preset environment, i.e., in a scenario where the vehicle may be at risk of glare, the situation of the light source behind the vehicle is monitored in real time, such as by acquiring an image of the area behind the vehicle in real time. This image is then processed to obtain a light spot representing the light source. Based on this light spot, when it is determined that the light source corresponding to the light spot would cause a glare risk when it shines on the exterior rearview mirror, anti-glare control is applied to the exterior rearview mirror. In this way, because the determination of whether the exterior rearview mirror will pose a glare risk and whether anti-glare is needed is based on the actual situation of the light source behind the vehicle, it adapts to the actual usage scenario of the exterior rearview mirror, thereby enabling precise anti-glare control of the exterior rearview mirror, effectively improving its anti-glare effect, and thus reducing driving safety risks.
[0042] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
[0043] First refer to Figure 1 , Figure 1 This illustration schematically depicts an application scenario provided according to an embodiment of this application. The device involved in this application scenario may include a controller and a camera. The camera is a rear-view camera, which can be positioned at the center inside the rear windshield of a vehicle, for acquiring images of the area behind the vehicle, such as an image of a preset area behind the rear windshield. Alternatively, the camera can be positioned above the license plate frame in the trunk of the vehicle to acquire images of the area behind the vehicle; no specific limitation is made here. This embodiment describes an example where the camera is positioned at the center inside the rear windshield of the vehicle.
[0044] When the controller detects that the vehicle is driving in a preset environment, it controls the camera to acquire an image of the rear of the vehicle. Then, the controller processes the image to obtain a light spot in the image. Based on the light spot, when it is determined that the light source corresponding to the light spot will cause glare risk when it shines on the vehicle's exterior rearview mirror, it performs anti-glare control on the exterior rearview mirror.
[0045] Optionally, the aforementioned controller can be an in-vehicle controller, an external controller, or a combination of both. It is a hardware device with data storage, processing, and analysis functions. Taking an in-vehicle controller as an example, it can be an Electronic Control Unit (ECU), etc.
[0046] For example, the device in this application scenario may also include a light intensity sensor for collecting the light intensity of the external environment of the vehicle, so that the controller can identify whether the vehicle is in a preset environment, such as whether it is at night or in other low-light environments, based on the aforementioned light intensity. The light intensity sensor uses its photosensitive element (such as a photodiode or photoresistor) to convert the ambient light signal into an electrical signal, and outputs the light intensity after calibration.
[0047] The following is combined with Figure 1 Application scenarios, refer to Figures 2-3 This application describes a rearview mirror control method according to exemplary embodiments thereof. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Rather, the embodiments of this application can be applied to any applicable scenario.
[0048] refer to Figure 2 , Figure 2 This is a schematic flowchart of a rearview mirror control method provided in an embodiment of this application. Figure 2 As shown, the method in the embodiments of this application may include: Step 201: When the vehicle is driving in a preset environment, acquire an image of the area behind the vehicle.
[0049] In low-light environments, the pupils of the human eye are dilated to adapt to the low light. If strong light, such as the high beams of a car behind, shines on the surface of the vehicle's exterior rearview mirror, most of the light will be reflected due to the high reflectivity of the mirror. When the reflected light acts on the driver's eyes, the reflected light creates a huge brightness difference with the surrounding low-light environment, exceeding the range that the human eye can tolerate, causing eye discomfort and blurred vision for the driver.
[0050] Therefore, the aforementioned preset environment refers to an environment where the illuminance is less than a preset illuminance threshold, i.e., a low-light environment such as nighttime. When a vehicle is detected driving in this preset environment, it is considered to be in a scenario where glare risk may occur. The preset illuminance threshold can be 5 lux (lx). In this case, the situation of light sources behind the vehicle is monitored in real time, i.e., images of the area behind the vehicle, such as an image of a preset area behind the rear windshield, are acquired in real time to subsequently determine whether the aforementioned light sources will cause glare risk based on the acquired images.
[0051] Step 202: Process the image to obtain the light spots in the image.
[0052] Because the brightness of the light source behind the vehicle is greater than the brightness of the surrounding environment, the light source will appear in the image as a spot. Here, a spot refers to a local area in the image where the brightness is significantly higher than the surrounding area. When there are multiple light sources behind the vehicle, there will also be multiple spots in the image, each spot corresponding to a different light source.
[0053] In some embodiments, when obtaining light spots in an image, the image can be preprocessed. Pixels in the preprocessed image whose brightness is greater than a set brightness value are marked as target pixels. Then, the target pixels are aggregated to obtain initial light spots, and the initial light spots are morphologically optimized to obtain independent light spots.
[0054] After obtaining the image of the area behind the vehicle, the image is first preprocessed, including noise reduction and dynamic range adjustment. Noise reduction methods such as Gaussian filtering or median filtering are used to reduce invalid noise interference and retain valid information. Then, the dynamic range of the noise-reduced image is adjusted, such as using High Dynamic Range (HDR) image fusion or histogram equalization. This is because in low-light scenes such as nighttime, the contrast between light and dark areas is large, and the difference in brightness far exceeds the image's native dynamic range. Without adjustment, the image may suffer from loss of detail in dark areas and overexposure in bright areas. Therefore, this embodiment performs dynamic range adjustment to effectively suppress overexposure in bright areas and enhance detail in dark areas.
[0055] Next, the preprocessed image is used to determine the light spots. First, pixels with brightness greater than a set brightness value are marked as target pixels, while pixels with brightness less than or equal to the set brightness value are considered background pixels, thus completing the initial screening of target pixels. Then, target pixels are aggregated based on connected component analysis. For example, the pixel connectivity rule can be set to 8-neighbor connectivity. That is, for a given pixel, if any pixel adjacent to it in the top, bottom, left, right, and diagonal is a target pixel, then these two pixels are determined to be in the same connected region. Each independent connected region is used as an initial light spot. At the same time, initial light spots with fewer pixels than a set number can be removed to reduce noise interference, resulting in multiple effective initial light spots.
[0056] After obtaining the initial light spots, morphological optimization is performed. First, morphological erosion is applied to each initial light spot to eliminate edge burrs and minor adhesions, refining the spot outline. Then, morphological dilation is performed on each processed initial light spot to restore the main outline of the spot and avoid loss of effective areas. Finally, connected component detection and segmentation are performed on the eroded and dilated initial light spots, and the initial light spots that are still adhered are segmented according to the brightness gradient, ultimately obtaining independent light spots with clear boundaries, no voids, and no adhesions.
[0057] In this embodiment, the image is preprocessed to reduce invalid noise interference, suppress overexposure in bright areas, enhance details in dark areas, and improve the accuracy of subsequent spot detection. When determining the spot, initial spots can be obtained quickly and efficiently through brightness-based initial screening and aggregation processing. Finally, morphological optimization of the initial spots ensures that the final output spots are independent, complete, and have clear boundaries, providing high-quality spots for subsequent glare risk assessment.
[0058] Step 203: Based on the light spot, determine whether there is a risk of glare when the light source corresponding to the light spot shines on the vehicle's exterior rearview mirror.
[0059] As mentioned above, when acquiring an image of the area behind the vehicle, the light source behind the vehicle will appear in the image as a light spot, and the characteristics of the light source will be reflected in the corresponding light spot. Therefore, based on the characteristic data of the light spot in the image, the characteristics of the corresponding light source can be obtained. Based on this, it can be determined whether the corresponding light source is one that would cause glare risk when it shines on the exterior rearview mirror. In this embodiment, it is considered that strong light, such as the high beam of a vehicle approaching from behind, will cause glare risk when it shines on the vehicle's exterior rearview mirror. Therefore, by determining whether the corresponding light source is a strong light source, such as the high beam of a vehicle approaching from behind, based on the characteristic data of the light spot, it can be determined whether the corresponding light source will cause glare risk when it shines on the exterior rearview mirror.
[0060] Optionally, the feature data of the light spot may include brightness, position, and the flicker frequency of the corresponding light source. The brightness of the light spot can be represented by pixel brightness, and the position of the light spot is its location in the image, which can be represented by pixel coordinates.
[0061] When the brightness of the light spot is higher than the average brightness, it is considered that the light source corresponding to the light spot is bright, belonging to the characteristics of a strong light source such as the high beam of a vehicle approaching from behind. This can be used to distinguish between vehicle high beams, other types of vehicle lights, streetlights, and neon lights. When the position of the light spot in the image is near the horizontal central axis of the image, it corresponds to the high beam of a vehicle approaching from behind. This can also be used to distinguish between vehicle high beams, streetlights, and neon lights. It should be noted that the distance between the high beam of a vehicle approaching from behind and the ground is usually within a certain range. When the camera capturing the image is installed at the center inside the rear windshield of the vehicle, the position of the light spot corresponding to the high beam of the vehicle approaching from behind is concentrated near the horizontal central axis of the image. Therefore, the horizontal central axis of the image is used as a reference baseline. In practice, the position of the reference baseline in the image can be flexibly calibrated according to the actual installation position of the camera, that is, according to the viewing angle of the image captured by the camera, to ensure that the light spot corresponding to the high beam of the vehicle approaching from behind is located near the reference baseline.
[0062] Since vehicle high beams are usually LED lights with high-frequency flashing, when the flashing frequency of the light spot corresponding to the light source is high, it is considered to be a characteristic of the high beams of a vehicle approaching from behind. Based on this, it is possible to distinguish between vehicle high beams, streetlights, and neon lights.
[0063] Therefore, when the detected light spot brightness exceeds a certain value, the distance between the light spot's position in the image and the horizontal central axis of the image (in this embodiment, all distances are positive values) is less than a certain value, and the flicker frequency of the light source corresponding to the light spot exceeds a certain frequency value, it is considered that the light source corresponding to the light spot is the high beam of a vehicle approaching from behind. In other words, when the light source corresponding to the light spot shines on the vehicle's exterior rearview mirror, it will cause a glare risk. The aforementioned brightness, distance, and frequency values can be set according to the actual scenario and requirements. For example, the brightness value can be set based on the average brightness of the high beams of different vehicles, the distance value can be set based on the position of the high beams of different vehicles in the image captured by the camera at the corresponding camera installation position, and the frequency value can be set based on the average flicker frequency of the high beams of different vehicles (when they are LED lights).
[0064] It should be noted that, considering the limitations of single-feature data of the light spot—that is, a single feature of the light spot cannot accurately determine whether the light source corresponding to the light spot is a strong light source such as the high beam of a vehicle approaching from behind, nor can it accurately determine whether the corresponding light source will cause glare risk when it shines on the exterior rearview mirror—this embodiment extracts multiple feature data of the light spot and makes a comprehensive judgment on glare risk based on these multiple feature data. This avoids the limitations of judging glare risk based on a single feature data of the light spot, improves the accuracy of judging whether the light source corresponding to the light spot will cause glare risk, and reduces misjudgments.
[0065] Furthermore, the aforementioned multiple feature data of the light spot belong to different dimensions, respectively characterizing the visual morphology, planar position, and dynamic changes of the corresponding light source. Glare risk assessment based on the feature data of the light spot in different dimensions achieves dimensional complementarity, avoiding the shortcomings of single-dimensional feature data assessment, reducing the false judgment rate, and accurately identifying whether a glare risk will occur when the corresponding light source illuminates the exterior rearview mirror.
[0066] As mentioned above, there may be multiple light sources behind a vehicle, and correspondingly, there may be multiple light spots in the image. It is understandable that for each light spot, if it is determined that the light source corresponding to that spot would cause a glare risk when it shines on the vehicle's exterior rearview mirror, then it is assumed that anti-glare control should be implemented on the exterior rearview mirror.
[0067] In addition, this embodiment acquires images of the area behind the vehicle in real time, and processes the acquired images in each glare risk assessment cycle. Based on the light spots in the obtained images, it determines whether the corresponding light source will cause glare risk when it shines on the vehicle's exterior rearview mirror.
[0068] Step 204: If the light source corresponding to the light spot will cause glare risk when it shines on the exterior rearview mirror, then anti-glare control will be implemented on the exterior rearview mirror.
[0069] When it's determined that a light source corresponding to a glare spot illuminating the exterior rearview mirror will cause a glare risk—that is, when the corresponding light source is determined to be a strong light source such as the high beams of a vehicle approaching from behind—anti-glare control is implemented for the exterior rearview mirror, activating its anti-glare function. For example, the color of the exterior rearview mirror surface can be controlled. By changing the color of the mirror surface, the reflectivity of the exterior rearview mirror is reduced, and its light absorption capacity is increased, reducing the amount of light reflected into the driver's eyes, thus achieving anti-glare. Of course, other methods can also be used to achieve anti-glare for the exterior rearview mirror; specific limitations are not discussed here.
[0070] As mentioned above, when an image of the area behind a vehicle is acquired, the light source behind the vehicle will appear in the image as a light spot, and the characteristics of the light source will be reflected in the corresponding light spot. Therefore, in this embodiment, glare risk is judged based on the light spot in the image that can represent the light source. Since the actual situation of the light source behind the vehicle is taken into account, it is adapted to the actual usage scenario of the exterior rearview mirror, and can accurately determine whether the exterior rearview mirror has a glare risk and whether there is an anti-glare requirement, thereby accurately triggering the anti-glare function of the exterior rearview mirror and improving its anti-glare effect.
[0071] In some embodiments, after anti-glare control is applied to the exterior rearview mirror, if it is determined within a preset number of glare risk judgment cycles that the light source corresponding to each light spot in the image will not cause glare risk when it shines on the vehicle's exterior rearview mirror, that is, there is no strong light source behind the vehicle, then the anti-glare function of the exterior rearview mirror is turned off.
[0072] The rearview mirror control method provided in this application, when the vehicle is driving in a preset environment, i.e., in a scenario where the vehicle may be at risk of glare, monitors the situation of the light source behind the vehicle in real time, such as acquiring an image of the area behind the vehicle in real time. Then, the image is processed to obtain a light spot representing the light source in the image. Based on this light spot, when it is determined that the light source corresponding to the light spot would cause a glare risk when it shines on the rearview mirror, anti-glare control is applied to the rearview mirror. In this way, because the determination of whether the rearview mirror will pose a glare risk and whether anti-glare is needed is based on the actual situation of the light source behind the vehicle, it adapts to the actual usage scenario of the rearview mirror, thereby accurately triggering the anti-glare control of the rearview mirror, effectively improving its anti-glare effect, and thus reducing driving safety risks.
[0073] In addition, the embodiments of this application further refine how to judge glare risk based on light spot, so as to accurately control the anti-glare of the exterior rearview mirror.
[0074] Figure 3 This is a flowchart illustrating a rearview mirror control method according to another embodiment of this application. Figure 3 As shown, the method in the embodiments of this application may include: Step 301: When the vehicle is driving in a preset environment, acquire an image of the area behind the vehicle.
[0075] In some embodiments, when acquiring an image of the area behind the vehicle, the illuminance of the external environment can be acquired while the vehicle is in motion, and it can be determined whether the illuminance is less than a preset illuminance threshold. If the illuminance is less than the preset illuminance threshold, it is determined that the vehicle is in a preset environment, and an image of a preset area behind the rear windshield of the vehicle is acquired.
[0076] Here, when a vehicle is in a low-light environment, such as at night, if strong light, such as the high beams of a vehicle behind, shines on the surface of the vehicle's exterior rearview mirror and is reflected, and this reflected light acts on the driver's eyes, the large brightness difference between the reflected light and the surrounding low-light environment exceeds the range that the human eye can tolerate, easily causing glare and resulting in eye discomfort and blurred vision for the driver. Therefore, when the illuminance of the external environment is less than a preset illuminance threshold, the vehicle is considered to be in a low-light environment, and the vehicle is in a scenario where glare risk may occur.
[0077] Step 302: Process the image to obtain the light spots in the image.
[0078] In this embodiment, the acquired image can be preprocessed, including noise reduction and dynamic range adjustment, to reduce invalid noise interference and retain valid information. Pixels with brightness greater than a set brightness value in the preprocessed image are marked as target pixels. Then, the target pixels are aggregated to obtain initial light spots, and the initial light spots are morphologically optimized to finally obtain independent light spots with clear boundaries and no adhesion.
[0079] The specific implementation methods and principles of steps 301 to 302 can be referred to the relevant descriptions in the foregoing embodiments, and will not be repeated here.
[0080] Step 303: Extract features from the light spot to obtain feature data of the light spot. Based on the feature data of the light spot, determine whether there is a risk of glare when the light source corresponding to the light spot shines on the exterior rearview mirror.
[0081] Among them, there are multiple feature data of the light spot, and each feature data can belong to different dimensions.
[0082] In this embodiment, for the acquired image of the area behind the vehicle, the light source appears in the image as a light spot, and the characteristics of the light source are reflected in the corresponding light spot. Therefore, by extracting features from the light spot, the characteristics of the corresponding light source can be determined based on the obtained feature data of the light spot. Based on this, it is possible to accurately determine whether the corresponding light source is one that will cause glare risk when it shines on the exterior rearview mirror.
[0083] In some embodiments, when determining whether there is a risk of glare based on the characteristic data of the light spot, it is possible to A1. Based on the characteristic data of the light spot, the light spot that meets the preset conditions is taken as the target light spot.
[0084] A2. Based on the characteristic data of the target light spot, determine whether there is a risk of glare when the light source corresponding to the target light spot shines on the exterior rearview mirror.
[0085] Here, preset conditions are used to exclude invalid interference spots. Based on the feature data of the spots, the spots are first screened to filter out invalid interference spots in advance, that is, to filter out light sources that will not cause glare risk in advance, so as to reduce the basis for misjudgment, improve the accuracy of glare risk judgment, and at the same time reduce the amount of processing required for subsequent glare risk judgment and improve response speed.
[0086] In some embodiments, the feature data includes the brightness and size of the light spot. When the target light spot is obtained, for each light spot, it is determined whether the brightness of the light spot is greater than a preset brightness threshold and whether the size of the light spot is greater than a preset size threshold. The light spot with a brightness greater than the preset brightness threshold and a size greater than the preset size threshold is taken as the target light spot.
[0087] For each light spot, if the brightness of the light spot is less than or equal to a preset brightness threshold, it indicates that the light source corresponding to the light spot has low brightness and is not a strong light source that would cause glare risk; therefore, the light spot and its corresponding light source can be directly excluded. If the size of the light spot is less than or equal to a preset size threshold, it indicates that the light source corresponding to the light spot has a limited illumination range and weak energy concentration; it is also not a strong light source that would cause glare risk, and the light spot and its corresponding light source can be directly excluded. Thus, the light sources corresponding to the remaining target light spots are those that may cause glare risk.
[0088] In this embodiment, the light spots are screened based on their brightness and size. This allows for the early filtering out of light spots with low brightness and small size, which means that light spots corresponding to light sources that will not cause glare risk can be accurately filtered out. The light sources corresponding to the target light spots that are retained are those that may cause glare risk, thereby improving the accuracy of subsequent glare risk assessment.
[0089] In some embodiments, when determining whether there is a risk of glare based on the characteristic data of the target light spot, it is possible to B1. For each spot in the target light spot, obtain the glare quantization value of the spot based on its characteristic data and corresponding weights.
[0090] B2. Determine whether the glare quantization value of each spot in the target light spot is greater than the preset glare threshold.
[0091] B3. If there is a spot in the target light spot with a glare quantification value greater than the preset glare threshold, it is determined that the light source corresponding to the target light spot will cause glare risk when it shines on the exterior rearview mirror.
[0092] Here, there are multiple feature data for the light spot, such as its brightness, size, shape, and position, as well as the flicker frequency, displacement, and duration of the light source corresponding to the light spot. Among them, the brightness of the light spot can be the average brightness or maximum brightness of the pixels included in the light spot, the size of the light spot can be the total number of pixels included in the light spot or the physical size of the light spot, and the position of the light spot refers to the position of the light spot in the image, which can be represented by pixel coordinates.
[0093] The flicker frequency, displacement, and duration of the light source corresponding to the light spot can be obtained from multiple consecutively acquired images within the glare risk assessment period. For example, for displacement, the actual displacement of the light source corresponding to the light spot can be obtained by comparing the pixel displacement of the same light spot in multiple images with the preset pixel displacement and actual displacement. For duration, the duration of the corresponding light source can be obtained by the duration of the same light spot appearing in multiple images. For flicker frequency, the flicker frequency of the same light spot can be obtained by acquiring multiple images using a high frame rate camera.
[0094] The greater the brightness of the light spot, the more closely the corresponding light source is considered to conform to the characteristics of a strong light source. Regarding the size of the light spot, vehicle high beams typically appear as small but bright spots in the image. In the previous steps, target light spots were selected based on a preset size threshold. This preset size threshold can be set based on the average size of the high beams of different vehicles in the images captured by the camera. Therefore, the smaller the size of the selected target light spot, the more closely the corresponding light source is considered to conform to the characteristics of a strong light source, such as the high beams of a vehicle approaching from behind.
[0095] Regarding the shape of the light spot, since the core design of a vehicle's high beam is to focus and project light directly, the light spot presented in the image by a high beam is usually circular or nearly circular, while other headlights may be rectangular, etc. Here, the roundness of the light spot is used to characterize its shape. The greater the roundness of the light spot, the more it is considered to correspond to the characteristics of a strong light source, such as the high beam of a vehicle approaching from behind.
[0096] Regarding the position of the light spot, as mentioned above, the distance between the vehicle's high beams and the ground is usually within a certain range. When the camera capturing the image is installed at the center of the inner side of the rear windshield, the position of the light spot corresponding to the high beams of the vehicle behind in the image is concentrated near the horizontal central axis of the image. Here, the position of the light spot is characterized by the offset of the light spot from the horizontal central axis of the image. The smaller the offset of the light spot, the more it is considered that the corresponding light source is consistent with the characteristics of a strong light source such as the high beams of the vehicle behind.
[0097] As mentioned above, the high beams of vehicles are usually LED lights with high-frequency flashing. When the flashing frequency of the light source corresponding to the light spot is high, it is considered that the light source corresponds to the characteristics of a strong light source, such as the high beams of a vehicle approaching from behind.
[0098] For the displacement corresponding to the light spot, the high beam of the vehicle behind moves with the movement of its vehicle. Therefore, under normal circumstances, when the light source is a high beam, the displacement is less than the displacement of a fixed light source (such as a street lamp). In other words, when the displacement of the light source corresponding to the light spot is small, it is considered that the light source corresponding to it conforms to the characteristics of a strong light source such as the high beam of the vehicle behind.
[0099] Additionally, it should be noted that the displacement of the light source corresponding to the light spot is used to characterize the dynamic changes of the light source. In this embodiment, the speed, acceleration, etc. of the light source corresponding to the light spot can also be used to characterize the dynamic changes of the light source.
[0100] Regarding the duration of the light source corresponding to the light spot, if the light source only appears briefly, such as a flashing light, it is considered not to be a continuous strong light source. In other words, if the duration of the light source corresponding to the light spot is short, it is considered that the light source does not meet the characteristics of a strong light source, such as the high beam of a car behind.
[0101] Meanwhile, considering that different feature data of light spots are of different importance in judging glare risk, different weights are assigned to different feature data of light spots. The higher the weight, the higher the importance of the corresponding feature data in judging glare risk.
[0102] In some embodiments, for each spot in the target light spot, when obtaining the glare quantization value of the light spot, the glare quantization value of the light spot can be obtained based on the brightness of the light spot and the corresponding weight k1, the size and the corresponding weight k2, the roundness and the corresponding weight k3, the offset and the corresponding weight k4, the flicker frequency and the corresponding weight k5, the displacement and the corresponding weight k6, and the duration and the corresponding weight k7.
[0103] Here, for each spot in the target light spot, in order to eliminate the differences in dimensions and numerical ranges of various feature data, the brightness, size, roundness, and offset of the spot can be normalized. For example, the normalized brightness W can be obtained based on the ratio between the brightness of the spot and the brightness reference value; the normalized size X can be obtained based on the ratio between the size and the size reference value; the normalized roundness Y can be obtained based on the ratio between the roundness and the roundness reference value; and the normalized offset Z can be obtained based on the ratio between the offset and the offset reference value. The brightness reference value can be set to a large value, such as 255 if the image is an 8-bit grayscale image. The size reference value can be set to a large value, the roundness reference value can be set to 1, and the offset reference value can be set based on the distance between the bottom edge of the image and the horizontal central axis, such as directly setting it to the distance between the bottom edge of the image and the horizontal central axis.
[0104] Regarding the flicker frequency, displacement, and duration corresponding to the light spot, when the flicker frequency is greater than a first frequency threshold, the value P corresponding to the flicker frequency is determined to be a first preset value, such as 1. When the flicker frequency is greater than a second frequency threshold but less than or equal to the first frequency threshold, the value P corresponding to the flicker frequency is determined to be a second preset value, such as 0.5. When the flicker frequency is less than or equal to the second frequency threshold, the value P corresponding to the flicker frequency is determined to be a third preset value, such as 0.1. That is, the higher the flicker frequency, the larger its corresponding value P. The first frequency threshold can be set according to the average frequency of the high beams (when using LED lights) of different vehicles, with the first frequency threshold being greater than the second frequency threshold, which in turn is greater than the third frequency threshold.
[0105] Similarly, when the displacement is less than or equal to the first displacement threshold, the value Q corresponding to the displacement is determined to be a first preset value, such as 1. When the displacement is greater than the first displacement threshold and less than or equal to the second displacement threshold, the value Q corresponding to the displacement is determined to be a second preset value, such as 0.5. When the displacement is greater than the second displacement threshold, the value Q corresponding to the displacement is determined to be a third preset value, such as 0.1. That is, the smaller the displacement, the larger its corresponding value Q. The third displacement threshold can be set based on the average displacement per unit time of different vehicles driving normally in low-light conditions, with the first displacement threshold being less than the second displacement threshold and less than the third displacement threshold.
[0106] When the duration exceeds a first time threshold, the value R corresponding to the duration is set to a first preset value, such as 1. When the duration exceeds a second time threshold but is less than or equal to the first time threshold, the value R corresponding to the duration is set to a second preset value, such as 0.5. When the duration is less than or equal to the second time threshold, the value R corresponding to the duration is set to a third preset value, such as 0.1. In other words, the shorter the duration, the smaller the corresponding value R. The third time threshold can be set based on the duration of strong light that will not cause glare risk, with the first time threshold being greater than the second time threshold, which in turn is greater than the third time threshold.
[0107] It should be noted that the first, second, and third preset values mentioned above can be set to values between [0,1] according to actual conditions and requirements. The frequency threshold, displacement threshold, and time threshold mentioned above can also be set to other values according to actual scenarios and requirements.
[0108] Then, the glare quantization value D can be obtained: D=W k1+[1-min(1, X)] k2+Y k3+[1-min(1, Z)] k4+P k5+Q k6+R k7 For each spot in the target light spot, after comprehensive judgment based on multiple feature data of the light spot, the glare quantification value corresponding to the light spot is obtained. When the glare quantification value corresponding to the light spot is greater than the preset glare threshold, it is considered that the light source corresponding to the light spot has the characteristics of a strong light source such as the high beam of a car coming from behind. In other words, when the corresponding light source shines on the exterior rearview mirror, it will cause glare risk.
[0109] Here, considering the limitations of single-feature data of the light spot—that is, the inability to accurately determine whether the light spot corresponds to a strong light source, such as the high beams of a vehicle approaching from behind—this embodiment makes a comprehensive judgment on glare risk based on multiple feature data of the target light spot. This avoids the limitations of judging glare risk based on a single feature data of the light spot, improves the accuracy of judging whether the light source corresponding to the target light spot will cause glare risk, and reduces misjudgments. Furthermore, the aforementioned multiple feature data belong to different dimensions, respectively characterizing the visual shape of the light spot, its planar position, and the dynamic changes of the corresponding light source. Judging glare risk based on feature data of the light spot in different dimensions achieves dimensional complementarity, avoiding the shortcomings of judgment based on single-dimensional feature data and reducing the misjudgment rate.
[0110] Furthermore, by assigning different weights to different characteristic data of light spots based on their varying importance in determining glare risk, it is possible to accurately identify whether a corresponding light source will cause glare risk when it shines on the exterior rearview mirror.
[0111] Optionally, to quickly assess glare risk, a certain number of feature data points can be randomly selected from multiple feature data points of the target light spot to obtain a glare quantification value. It is important to note that the weights of the feature data points need to be adjusted accordingly to ensure that the sum of the weights of the aforementioned certain number of feature data points is 1.
[0112] For example, for each spot in the target light spot, when obtaining the glare quantization value of the light spot, the ellipticity of the light spot can be determined according to the shape of the light spot, and the offset of the light spot from the horizontal central axis of the image can be determined according to the position of the light spot in the image. Based on the brightness and corresponding weights, size and corresponding weights, ellipticity and shape and corresponding weights, and offset and position and corresponding weights, the glare quantization value of the light spot is obtained.
[0113] For example, for each spot in the target light spot, when obtaining the glare quantization value of the light spot, the glare quantization value of the light spot can also be obtained according to the flicker frequency and corresponding weight of the light source corresponding to the light spot, the displacement and corresponding weight, and the duration and corresponding weight.
[0114] The specific real-time method can be referred to the relevant content in the foregoing embodiments, and will not be repeated here.
[0115] Step 304: If the light source corresponding to the light spot will cause glare risk when it shines on the exterior rearview mirror, then anti-glare control will be implemented on the exterior rearview mirror.
[0116] When a target light spot contains a glare quantification value greater than a preset glare threshold, it is determined that the light source corresponding to the target light spot will cause glare risk when it shines on the exterior rearview mirror. In this case, anti-glare control is implemented on the rearview mirror. For example, the color of the exterior rearview mirror surface can be controlled. By changing the color of the mirror surface, the reflectivity of the exterior rearview mirror to light is reduced, and the light absorption capacity of the exterior rearview mirror is increased, thus achieving anti-glare. Of course, other methods can also be used to achieve anti-glare for the exterior rearview mirror.
[0117] Here, the specific implementation method and principle of step 304 can be referred to the relevant description in the foregoing embodiments, and will not be repeated here.
[0118] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0119] Figure 4This is a schematic diagram of the structure of a rearview mirror control device provided in one embodiment of this application. Figure 4 As shown, the rearview mirror control device provided in this embodiment may include: an acquisition module 401, a obtaining module 402, a determining module 403, and a control module 404.
[0120] The acquisition module 401 is used to acquire an image of the rear of the vehicle when the vehicle is driving in a preset environment.
[0121] The module 402 is used to process the image to obtain the light spots in the image.
[0122] The determination module 403 is used to determine, based on the light spot, whether there is a risk of glare when the light source corresponding to the light spot shines on the exterior rearview mirror of the vehicle.
[0123] The control module 404 is used to perform anti-glare control on the exterior rearview mirror when there is a risk of glare when the light source corresponding to the light spot illuminates the exterior rearview mirror.
[0124] In one possible implementation, the determining module 403 is further used for: Feature extraction is performed on the light spot to obtain the feature data of the light spot; Based on the characteristic data of the light spot, it is determined whether there is a risk of glare when the light source corresponding to the light spot shines on the exterior rearview mirror.
[0125] In one possible implementation, the determining module 403 is further used for: Based on the characteristic data of the light spot, the light spot that meets the preset conditions is taken as the target light spot; Based on the characteristic data of the target light spot, it is determined whether there is a risk of glare when the light source corresponding to the target light spot shines on the exterior rearview mirror.
[0126] In one possible implementation, there are multiple light spots, and the feature data includes the brightness and size of the light spots; the determining module 403 is further configured to: For each light spot, determine whether the brightness of the light spot is greater than a preset brightness threshold and whether the size of the light spot is greater than a preset size threshold; A light spot whose brightness is greater than the preset brightness threshold and whose size is greater than the preset size threshold is selected as the target light spot.
[0127] In one possible implementation, there are multiple target light spots; there are multiple feature data; the determining module 403 is further configured to: For each spot in the target light spot, the glare quantization value of the light spot is obtained according to the feature data of the light spot and the corresponding weights; Determine whether the glare quantization value of each spot in the target light spot is greater than a preset glare threshold; If there is a spot in the target light spot whose glare quantification value is greater than the preset glare threshold, it is determined that the light source corresponding to the target light spot will cause glare risk when it shines on the exterior rearview mirror.
[0128] In one possible implementation, the feature data includes the brightness, size, shape, and position of the light spot; the determining module 403 is further configured to: For each spot in the target light spot, the roundness of the light spot is determined according to its shape, and the offset of the light spot from the horizontal central axis of the image is determined according to its position in the image. The glare quantization value of the light spot is obtained based on the brightness and corresponding weight, size and corresponding weight, roundness and corresponding weight, and offset and corresponding weight.
[0129] In one possible implementation, the feature data includes the flicker frequency, displacement, and duration of the light source corresponding to the light spot; the determining module 403 is further configured to: For each spot in the target light spot, the glare quantization value of the light spot is obtained according to the flicker frequency and corresponding weight of the light source corresponding to the light spot, the displacement and corresponding weight, and the duration and corresponding weight.
[0130] In one possible implementation, the acquisition module 401 is also used for: While the vehicle is in motion, the illuminance of the external environment is acquired, and it is determined whether the illuminance is less than a preset illuminance threshold. If the illuminance is less than the preset illuminance threshold, it is determined that the vehicle is driving in the preset environment, and an image of the preset area behind the rear windshield of the vehicle is acquired.
[0131] In one possible implementation, module 402 is also used for: The image is preprocessed, and pixels in the preprocessed image whose brightness is greater than a set brightness value are marked as target pixels. The target pixels are aggregated to obtain an initial light spot; The initial light spot is morphologically optimized to obtain an independent light spot.
[0132] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0133] Figure 5This is a schematic diagram of the structure of a vehicle provided in one embodiment of this application. Figure 5 As shown, the vehicle 500 in this embodiment includes a controller 510 and a memory 520, wherein the memory 520 stores a computer program 521 that can run on the controller 510. When the controller 510 executes the computer program 521, it implements the steps in any of the above method embodiments, for example... Figure 2 Steps 201 to 204 are shown. Alternatively, when the controller 510 executes the computer program 521, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 4 The functions of modules 401 to 404 are shown.
[0134] For example, computer program 521 may be divided into one or more modules / units, one or more of which are stored in memory 520 and executed by controller 510 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of computer program 521 in vehicle 500.
[0135] Those skilled in the art will understand that Figure 5 This is merely an example of a vehicle and does not constitute a limitation on the vehicle. It may include more or fewer components than shown, or combinations of certain components, or different components, such as input / output devices, network access devices, buses, etc.
[0136] The controller 510 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0137] The memory 520 can be an internal storage unit of the vehicle, such as a hard drive or memory, or an external storage device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. The memory 520 can also include both internal and external storage devices. The memory 520 is used to store computer programs and other programs and data required by the vehicle. The memory 520 can also be used to temporarily store data that has been output or will be output.
[0138] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0139] An embodiment of this application also provides a computer-readable storage medium storing a computer program that, when executed by a controller, implements the above-described rearview mirror control method.
[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0141] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0142] In the embodiments provided in this application, it should be understood that the disclosed devices / vehicles and methods can be implemented in other ways. For example, the device / vehicle embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0145] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a controller, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0146] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method of controlling a rearview mirror, characterized by, The method comprises: obtaining an image behind the vehicle when the vehicle is driving in a preset environment; processing the image to obtain a light spot in the image; determining, based on the light spot, whether the light source corresponding to the light spot will cause a glare risk when the light source irradiates an outside rearview mirror of the vehicle; if the light source corresponding to the light spot will cause a glare risk when the light source irradiates the outside rearview mirror, performing anti-glare control on the outside rearview mirror.
2. The rear-view mirror control method according to claim 1, characterized by, The determination, based on the light spot, of whether the light source corresponding to the light spot will cause a glare risk when the light source irradiates the outside rearview mirror of the vehicle comprises: extracting features of the light spot to obtain feature data of the light spot; judging, according to the feature data of the light spot, whether the light source corresponding to the light spot will cause a glare risk when the light source irradiates the outside rearview mirror.
3. The rear-view mirror control method according to claim 2, characterized by, The judgment, according to the feature data of the light spot, of whether the light source corresponding to the light spot will cause a glare risk when the light source irradiates the outside rearview mirror comprises: according to the feature data of the light spot, taking a light spot satisfying a preset condition in the light spot as a target light spot; judging, based on the feature data of the target light spot, whether the light source corresponding to the target light spot will cause a glare risk when the light source irradiates the outside rearview mirror.
4. The rear-view mirror control method according to claim 3, characterized by The light spot has multiple light spots, and the feature data comprises brightness and size of the light spot. The taking, according to the feature data of the light spot, of a light spot satisfying a preset condition in the light spot as a target light spot comprises: for each light spot, judging whether the brightness of the light spot is greater than a preset brightness threshold and whether the size of the light spot is greater than a preset size threshold; taking, as the target light spot, a light spot whose brightness is greater than the preset brightness threshold and whose size is greater than the preset size threshold.
5. The method of claim 3, wherein The target light spot has multiple target light spots, and the feature data has multiple feature data. The judgment, based on the feature data of the target light spot, of whether the light source corresponding to the target light spot will cause a glare risk when the light source irradiates the outside rearview mirror comprises: for each light spot in the target light spot, obtaining a glare quantization value of the light spot according to each feature data of the light spot and a corresponding weight; respectively judging whether the glare quantization value of each light spot in the target light spot is greater than a preset glare threshold; if there is a light spot whose glare quantization value is greater than the preset glare threshold in the target light spot, it is determined that the light source corresponding to the target light spot will cause a glare risk when the light source irradiates the outside rearview mirror.
6. The rear-view mirror control method according to claim 5, characterized by The feature data comprises brightness, size, shape and position of the light spot. The obtaining, for each light spot in the target light spot, of a glare quantization value of the light spot according to each feature data of the light spot and a corresponding weight comprises: for each light spot in the target light spot, determining a roundness of the light spot according to a shape of the light spot, and determining an offset amount of the light spot from a horizontal central axis of the image according to a position of the light spot in the image; obtaining a glare quantization value of the light spot based on the brightness of the light spot and a corresponding weight, the size of the light spot and a corresponding weight, the roundness of the light spot and a corresponding weight of the shape, and the offset amount of the light spot and a corresponding weight of the position.
7. The rear-view mirror control method according to claim 5, wherein The feature data comprises a flicker frequency, a displacement and a duration of a light source corresponding to the light spot. The glare quantization value of each of the target glares is obtained according to the feature data and the corresponding weight of the glare. The glare quantization value of each of the target glares is obtained according to the flicker frequency and the corresponding weight, the displacement and the corresponding weight, and the duration and the corresponding weight of the corresponding light source of the glare.
8. The rearview mirror control method according to any one of claims 1 to 7, wherein The image behind the vehicle is obtained when the vehicle is driving in the preset environment. The light intensity of the outside environment is obtained when the vehicle is driving, and it is determined whether the light intensity is less than a preset light intensity threshold. If the light intensity is less than the preset light intensity threshold, it is determined that the vehicle is driving in the preset environment, and an image of a preset area behind the rear windshield of the vehicle is obtained.
9. The rearview mirror control method according to any one of claims 1 to 7, wherein The image is processed to obtain glares in the image, including: The image is preprocessed, and in the preprocessed image, a pixel point with a brightness greater than a brightness setting value is marked as a target pixel point; The target pixel points are aggregated to obtain initial glares; The initial glares are morphologically optimized to obtain independent glares.
10. A vehicle comprising a memory and a controller, said memory having stored therein a computer program operable on said controller, characterised in that, The controller executes the computer program to implement the rearview mirror control method according to any one of claims 1 to 9.