CN117325804A - Automatic defogging method, device, equipment and medium for camera - Google Patents

Automatic defogging method, device, equipment and medium for camera Download PDF

Info

Publication number
CN117325804A
CN117325804A CN202311148309.0A CN202311148309A CN117325804A CN 117325804 A CN117325804 A CN 117325804A CN 202311148309 A CN202311148309 A CN 202311148309A CN 117325804 A CN117325804 A CN 117325804A
Authority
CN
China
Prior art keywords
camera
fog
defogging
level
degree
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311148309.0A
Other languages
Chinese (zh)
Inventor
卢鹏飞
刘潇
李洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Commercial Vehicle Co Ltd
Original Assignee
Dongfeng Commercial Vehicle Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongfeng Commercial Vehicle Co Ltd filed Critical Dongfeng Commercial Vehicle Co Ltd
Priority to CN202311148309.0A priority Critical patent/CN117325804A/en
Publication of CN117325804A publication Critical patent/CN117325804A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60SSERVICING, CLEANING, REPAIRING, SUPPORTING, LIFTING, OR MANOEUVRING OF VEHICLES, NOT OTHERWISE PROVIDED FOR
    • B60S1/00Cleaning of vehicles
    • B60S1/02Cleaning windscreens, windows or optical devices
    • B60S1/56Cleaning windscreens, windows or optical devices specially adapted for cleaning other parts or devices than front windows or windscreens
    • B60S1/60Cleaning windscreens, windows or optical devices specially adapted for cleaning other parts or devices than front windows or windscreens for signalling devices, e.g. reflectors
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60SSERVICING, CLEANING, REPAIRING, SUPPORTING, LIFTING, OR MANOEUVRING OF VEHICLES, NOT OTHERWISE PROVIDED FOR
    • B60S1/00Cleaning of vehicles
    • B60S1/02Cleaning windscreens, windows or optical devices
    • B60S1/023Cleaning windscreens, windows or optical devices including defroster or demisting means
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60SSERVICING, CLEANING, REPAIRING, SUPPORTING, LIFTING, OR MANOEUVRING OF VEHICLES, NOT OTHERWISE PROVIDED FOR
    • B60S1/00Cleaning of vehicles
    • B60S1/02Cleaning windscreens, windows or optical devices
    • B60S1/54Cleaning windscreens, windows or optical devices using gas, e.g. hot air
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/52Elements optimising image sensor operation, e.g. for electromagnetic interference [EMI] protection or temperature control by heat transfer or cooling elements

Abstract

The application discloses an automatic defogging method, device, equipment and medium for a camera, wherein images shot by the camera are input into a trained fog detection model to obtain the defogging degree of the camera; determining the fogging level of the camera according to the fogging degree of the camera; and starting a corresponding defogging mode according to the defogging level of the camera so as to defog the camera. The automatic defogging device has the advantages that the defogging degree of the camera is accurately identified, the influence of external road environment is avoided, different defogging modes can be opened according to the different defogging degrees, automatic and rapid defogging is realized, and the driving safety of a vehicle is effectively improved.

Description

Automatic defogging method, device, equipment and medium for camera
Technical Field
The application relates to the technical field of intelligent control, in particular to an automatic defogging method, device, equipment and medium for a camera.
Background
In the case of the autopilot system, a camera has become an integral part, one of the most important sensors. When the camera fails and cannot work normally, the automatic driving function cannot be used basically.
The cab of the automatic driving vehicle is provided with the forward camera, the mounting position of the camera is on the front windshield, and in the running process of the vehicle, particularly in winter, the front windshield of the cab and the camera lens are easy to generate fog due to large temperature difference between the inside and the outside of the vehicle, and when the fog is large, the image of the camera becomes more and more blurred, so that the automatic driving function is influenced. When fog is generated in front of the camera, the image acquired by the camera is blurred, errors occur in the perception algorithm of the automatic driving system when the target and the lane line are identified, the front target cannot be accurately identified, the problems of missing detection and false detection, the lane line which cannot be identified or identified by the lane line is distorted, the type is wrong, the distance is shortened and the like are caused, and the problems of the target and the lane line can lead to degradation of the automatic driving function and even safety accidents.
The prior art scheme is that a camera with forward shooting angle is used for acquiring an image in front of a vehicle head, and then whether the camera is fogged or not is determined based on the definition of objects in the shot image and the similarity between the objects. However, in the actual vehicle driving process, the driving speed is higher, the vehicle shake is larger, the photographed image is not clear, the fog state of the camera is detected based on the unclear image, the possibility of false detection is higher, the similarity between objects is higher in a single road scene in the driving process, false detection is easy to occur, and the fog is not timely. And if fog is generated before the vehicle is started or the vehicle generates fog in continuous curves, the fog generating state cannot be identified, and the automatic defogging function cannot be started, so that potential safety hazards are buried for the automatic driving function.
Therefore, how to accurately judge the fog situation of the camera and quickly defog the camera is a technical problem to be solved.
Disclosure of Invention
The main aim of the application is to provide an automatic defogging method, device, equipment and cut-off for a camera, which aims to solve the technical problems.
In a first aspect, the present application provides a method for automatically defogging a camera, the method comprising the steps of:
inputting an image shot by a camera into a trained fog detection model to obtain the fog degree of the camera;
determining the fogging level of the camera according to the fogging degree of the camera;
and starting a corresponding defogging mode according to the defogging level of the camera so as to defog the camera.
In some embodiments, the method further comprises the step of training the mist detection model, comprising:
dividing images shot by a plurality of cameras when the cameras are fogged into a training set and a testing set of a fog detection model;
training the mist detection model through the training set, and calculating the losses of a classification task and a regression task of the mist detection model through a loss function;
and updating the network weight of the fog detection model according to the loss of the fog detection model by using a back propagation algorithm until the accuracy of the fog degree of the camera output by the fog detection model is greater than a preset accuracy threshold after the test set is input into the fog detection model, so as to obtain a trained fog detection model.
In some embodiments, dividing images captured when a plurality of cameras fogs into a training set and a test set of a fog detection model includes:
labeling the fogging degree of N images in the images shot when the M cameras are fogged;
training an original fog detection model through the marked N images to obtain a pre-trained fog detection model;
inputting L images which are not marked in the M images into a pre-trained fog detection model, marking the fog degree of the L images through the pre-trained fog detection model, and obtaining a marking result of the fog degree of the L images;
checking the labeling results of the L images, and adjusting the fogging degree results of the images with unqualified labeling results;
and (3) turning, scaling, mean value normalization and tone change processing are carried out on the M marked images, and the M processed images are divided into a training set and a testing set of a fog detection model.
In some embodiments, the method further includes starting a corresponding defogging mode according to a defogging level of the camera to defog the camera, and further including:
and controlling the vehicle-mounted air conditioner to start a corresponding defogging mode according to the defogging level of the camera, and adjusting the defogging mode of the vehicle-mounted air conditioner according to the variation of the defogging level so as to defog the camera.
In some embodiments, the method for controlling the vehicle-mounted air conditioner to start a corresponding defogging mode according to the defogging level of the camera, and adjusting the defogging mode of the vehicle-mounted air conditioner according to the variation of the defogging level, so as to defog the camera includes:
if the fog level of the camera is the first level, the vehicle-mounted air conditioner does not start a fog mode;
if the fog level of the camera is the second level, controlling the vehicle-mounted air conditioner to start a first fog removal mode, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and is maintained for a preset period of time;
if the fog level of the camera is the third level, controlling the vehicle-mounted air conditioner to start a second fog removal mode, controlling the vehicle-mounted air conditioner to adjust to the first fog removal mode after the fog level of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and the preset duration is maintained;
and if the fog degree of the camera is at a fourth level, controlling the vehicle-mounted air conditioner to start a third fog removing mode, controlling the vehicle-mounted air conditioner to adjust to a second fog removing mode after the fog degree of the camera is reduced to the third level and the preset duration is maintained, controlling the vehicle-mounted air conditioner to adjust to a first fog removing mode after the fog degree of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removing mode after the fog degree of the camera is reduced to the first level and the preset duration is maintained.
In some embodiments, the vehicle-mounted air conditioner has different wind power gear in different defogging modes, wherein the wind power gear of the third defogging mode is greater than that of the second defogging mode, and the wind power gear of the second defogging mode is greater than that of the first defogging mode.
In some embodiments, the determining the fog level of the camera according to the fog level of the camera includes:
when the fogging degree of the camera is lower than 25%, determining that the fogging degree of the camera is of a first grade;
when the fogging degree of the camera is greater than or equal to 25% and less than 50%, determining that the fogging degree of the camera is of a second grade;
when the fogging degree of the camera is greater than or equal to 50% and less than 75%, determining that the fogging degree of the camera is of a third grade;
and determining that the fogging degree of the camera is a fourth grade when the fogging degree of the camera is greater than or equal to 50% and less than or equal to 100%.
In a second aspect, the present application further provides an automatic defogging device for a camera, the device comprising:
the acquisition module is used for inputting the image shot by the camera into the trained fog detection model so as to acquire the fog degree of the camera;
the determining module is used for determining the fogging level of the camera according to the fogging degree of the camera;
and the defogging module is used for opening a corresponding defogging mode according to the defogging level of the camera so as to defog the camera.
In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program when executed by the processor implements the steps of the method for automatically defogging a camera as described above.
In a fourth aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for automatically defogging a camera as described above.
The application provides an automatic defogging method, device, equipment and medium for a camera, wherein images shot by the camera are input into a trained fog detection model to obtain the defogging degree of the camera; determining the fogging level of the camera according to the fogging degree of the camera; and starting a corresponding defogging mode according to the defogging level of the camera so as to defog the camera. The automatic defogging device has the advantages that the defogging degree of the camera is accurately identified, the influence of external road environment is avoided, different defogging modes can be opened according to the different defogging degrees, automatic and rapid defogging is realized, and the driving safety of a vehicle is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an automatic defogging method for a camera according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a training process of a mist detection model;
FIG. 3 is a schematic diagram of a testing process of the mist detection model;
FIG. 4 is a schematic block diagram of an automatic defogging device for a camera according to an embodiment of the present application;
fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
The embodiment of the application provides an automatic defogging method, device, equipment and medium for a camera. The automatic defogging method of the camera can be applied to computer equipment, and the computer equipment can be electronic equipment such as a vehicle body controller, a vehicle-mounted computer and the like.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flow chart of an automatic defogging method for a camera according to an embodiment of the present application.
As shown in fig. 1, the method includes steps S1 to S3.
S1, inputting an image shot by a camera into a trained fog detection model to acquire the fog degree of the camera.
It is worth to say that in the vehicle driving process, images are collected in real time through the camera, then the collected images are input into a trained fog detection model, and the images are detected in real time through the fog detection model, so that the fog degree of the camera is determined in real time.
In some embodiments, the mist detection model may need to be trained before the trained mist detection model is used to detect images captured by the camera to obtain the degree of fogging of the camera. The step of training the mist detection model comprises the following steps: dividing images shot by a plurality of cameras when the cameras are fogged into a training set and a testing set of a fog detection model; training the mist detection model through the training set, and calculating the losses of a classification task and a regression task of the mist detection model through a loss function; and updating the network weight of the fog detection model according to the loss of the fog detection model by using a back propagation algorithm until the accuracy of the fog degree of the camera output by the fog detection model is greater than a preset accuracy threshold after the test set is input into the fog detection model, so as to obtain a trained fog detection model.
It is worth noting that, for the accurate identification of fog in the picture, the key precondition of determining the fog degree of the camera and subsequent automatic defogging is that there are more false detections in an indirect way such as object definition, similarity and the like, the application adopts a direct way to identify the fog, the most direct characteristic of the fog is a white-in-white one, obvious white fuzzy parts exist on the image shot by the camera, the fog degree is different, the degree of the white fuzzy parts is also different, a deep learning detection algorithm is applied to train a fog detection model, and the fog degree under various working conditions is detected.
Exemplary, as shown in fig. 2, the mist detection model includes three parts, namely a basic backbone network, a feature fusion network and a prediction network, the basic backbone network adopts a deep convolution network for image classification, then the feature fusion network fuses features extracted from the basic backbone network for subsequent classification and regression, a common method is a feature pyramid structure, and finally, the prediction network performs classification and regression. The method is characterized in that a tag matching module is further arranged when the mist detection model is trained, a true value is mainly provided for a detector, a target detection method of an intersection ratio criterion is commonly used during training, an aiming frame is distributed to a corresponding object according to the intersection ratio between the aiming frame and the object true frame, the tag matching is based on a tag classification and matching structure, losses of a classification task and a regression task are calculated by adopting a loss function, and network weights of the mist detection model are updated by utilizing a counter propagation algorithm, so that the detection effect of the mist detection model is improved.
It should be noted that after training the mist detection model, the mist detection model may be tested using a test set. The fog detection model outputs the fog degree in a given image in a test stage, and as shown in fig. 3, mainly comprises the processes of inputting the image, detecting a network, post-processing, outputting a detection result and the like. For a given image, we first generate classification and regression results using a trained test network, and in general, the same image will generate multiple test results, thus requiring a post-processing step to preserve one test result and remove other redundant test results. After the fog detection model outputs a detection result, namely, the fog degree of the camera is output, the result output by the model is compared with an actual result, when the detection rate and the accuracy rate reach more than 95%, the training of the fog detection model can be considered to be completed, the camera can accurately identify a fog scene, and the fog degree can be detected in real time without depending on an external road environment as long as the controller and the camera are electrified.
As a preferred embodiment, the images in the training set and the test set of the mist detection model need to be preprocessed before they are subdivided. Dividing images shot by a plurality of cameras during fogging into a training set and a testing set of a fog detection model, and comprising the following steps: labeling the fogging degree of N images in the images shot when the M cameras are fogged; training an original fog detection model through the marked N images to obtain a pre-trained fog detection model; inputting L images which are not marked in the M images into a pre-trained fog detection model, marking the fog degree of the L images through the pre-trained fog detection model, and obtaining a marking result of the fog degree of the L images; checking the labeling results of the L images, and adjusting the fogging degree results of the images with unqualified labeling results; and (3) turning, scaling, mean value normalization and tone change processing are carried out on the M marked images, and the M processed images are divided into a training set and a testing set of a fog detection model.
The method comprises the steps of selecting images shot by a plurality of cameras when the cameras are fogged as original images to perform characteristic engineering, obtaining an original data set required by model training, performing data enhancement and other operations on the original data set, and dividing the data set into a training set and a testing set. In a specific operation, the task marking is carried out on the fog degree of a small part of pictures (N) in the original data set (M). Then training a weaker fog detection model into a pre-training fog detection model based on a small part of marked pictures, and pre-marking the fog degree of the remaining pictures (L pictures) in the original data set by using the model. Because the training samples of the pre-trained mist detection model are fewer, the labeling result is inaccurate, and therefore, after the pre-labeling is completed, the pictures which are not matched with the actual pictures in the labeling are manually adjusted, and all the labeled pictures can be obtained. After the marked picture is obtained, the diversification of training data, such as overturn, scaling, mean normalization, tone change and the like, can be enhanced through preprocessing, and then the processed picture is divided into a training set and a testing set according to a preset proportion, so that the detection capability of a detection network is improved.
And S2, determining the fogging level of the camera according to the fogging degree of the camera.
In this embodiment, the levels are classified into 4 levels according to different degrees of fogging, and when the degree of fogging of the camera is lower than 25%, the degree of fogging of the camera is determined to be a first level; when the fogging degree of the camera is greater than or equal to 25% and less than 50%, determining that the fogging degree of the camera is of a second grade; when the fogging degree of the camera is greater than or equal to 50% and less than 75%, determining that the fogging degree of the camera is of a third grade; and determining that the fogging degree of the camera is a fourth grade when the fogging degree of the camera is greater than or equal to 50% and less than or equal to 100%.
And S3, starting a corresponding defogging mode according to the defogging level of the camera so as to defog the camera.
In one embodiment, when the automatic defogging method of the camera is applied to a vehicle-mounted camera, the vehicle-mounted air conditioner is controlled to start a corresponding defogging mode according to the defogging level of the camera, and the defogging mode of the vehicle-mounted air conditioner is adjusted according to the change of the defogging level so as to defog the camera.
In still another specific embodiment, if the fogging level of the camera is the first level, the vehicle-mounted air conditioner does not start the defogging mode. When the fogging degree is less than 25%, the recognition of the target and the lane line by the map is not influenced, and the automatic driving is not influenced.
And if the fog level of the camera is the second level, controlling the vehicle-mounted air conditioner to start a first fog removal mode, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and the preset duration is maintained. When the fog degree is greater than or equal to 25% and less than 50%, the camera is in a slight fog state, has a certain influence on automatic driving, and needs to start a fog removing mode, the camera sends signals to a vehicle body control module BCM, the BCM controls a vehicle-mounted air conditioner, a front windshield automatic fog removing mode 1 is started, and when the fog degree which is continuously recognized in real time for 2 minutes by the camera is less than 25%, the camera exits from the automatic fog removing mode.
And if the fog level of the camera is the third level, controlling the vehicle-mounted air conditioner to start a second fog removal mode, controlling the vehicle-mounted air conditioner to adjust to the first fog removal mode after the fog level of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and the preset duration is maintained. When the fog degree is greater than or equal to 50% and less than 75%, the automobile is in a medium fog state, the influence on automatic driving is increased, the automobile is required to be degraded, a fog removing mode is required to be started, a camera sends a signal to a BCM, the BCM controls an automobile-mounted air conditioner, an automatic fog removing mode 2 of a front windshield is started, when the fog degree which is recognized in real time by the camera for 2 minutes is greater than or equal to 25% and less than 50%, the automobile is switched into the automatic fog removing mode 1, and when the fog degree which is recognized in real time by the camera for 2 minutes is less than 25%, the automobile is exited.
And if the fog degree of the camera is at a fourth level, controlling the vehicle-mounted air conditioner to start a third fog removing mode, controlling the vehicle-mounted air conditioner to adjust to a second fog removing mode after the fog degree of the camera is reduced to the third level and the preset duration is maintained, controlling the vehicle-mounted air conditioner to adjust to a first fog removing mode after the fog degree of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removing mode after the fog degree of the camera is reduced to the first level and the preset duration is maintained. Namely, when the fog degree is greater than 75%, the automobile is in a serious fog state, the automatic driving function is not started, a fog removing mode is required to be started, a camera sends a signal to a BCM, the BCM controls an on-vehicle air conditioner, the automatic fog removing mode 3 of the front windshield is started, when the fog degree of the real-time identification of the camera is greater than or equal to 50% and less than 75%, the automobile is switched to the automatic fog removing mode 2, when the fog degree of the real-time identification of the camera is greater than or equal to 25% and less than 50%, the automobile is switched to the automatic fog removing mode 1, and when the fog degree of the real-time identification of the camera is less than 25% and the camera is 2 minutes, the automobile is exited.
It is worth to say that the wind power gear of on-vehicle air conditioner is different under different defogging modes, wherein, the wind power gear of third defogging mode is greater than the second defogging mode, the wind power gear of second defogging mode is greater than first defogging mode.
The automatic defogging mode is divided into 3 grades by an exemplary way, and the air conditioner wind power is 10 grades, the automatic defogging mode is 1, the wind power is 3 grades, and the temperature is 25 ℃; automatic defogging mode 2, wind power 6 gear and temperature 25 ℃; automatic defogging mode 3, wind power 10 gear and temperature 25 ℃.
In a specific real-time example, in the running process of a vehicle, due to the temperature difference between the inside and the outside, fog is generated in the vehicle, fog is generated on a front windshield and a camera lens, certain influence exists on automatic driving, the degree of the fog of a detected image is between 25% and 50%, at the moment, the camera sends a signal to a BCM, the BCM opens an automatic defogging mode 1, and is closed after the fog is dissipated.
In another specific real-time example, the vehicle is parked at the roadside and is not started, fog is generated on the front windshield glass and the camera lens, after the power is turned on, the image fog degree shot by the camera is detected to be more than 75%, the recognition of the target and the lane line fails, the automatic driving cannot be used, at the moment, the camera sends a signal to the BCM, the BCM starts an automatic defogging mode 3, and the BCM is closed after the fog is gradually dissipated. It should be understood that the vehicle-mounted camera is usually installed near the front windshield of the vehicle, and when the front windshield is fogged, the image shot by the camera also generates a white blurring effect, so in this embodiment, the foggy degree of the image is detected through the foggy detection model, and the same detection effect is provided for foggy of the camera and foggy of the front windshield.
The application provides an automatic defogging method for a camera, which is characterized in that an image shot by the camera is input into a trained fog detection model to obtain the defogging degree of the camera; determining the fogging level of the camera according to the fogging degree of the camera; and starting a corresponding defogging mode according to the defogging level of the camera so as to defog the camera. The automatic defogging device has the advantages that the defogging degree of the camera is accurately identified, the influence of external road environment is avoided, different defogging modes can be opened according to the different defogging degrees, automatic and rapid defogging is realized, and the driving safety of a vehicle is effectively improved.
Referring to fig. 4, fig. 4 is a schematic block diagram of an automatic defogging device for a camera according to an embodiment of the present application.
As shown in fig. 4, the apparatus includes:
the acquisition module is used for inputting the image shot by the camera into the trained fog detection model so as to acquire the fog degree of the camera;
the determining module is used for determining the fogging level of the camera according to the fogging degree of the camera;
and the defogging module is used for opening a corresponding defogging mode according to the defogging level of the camera so as to defog the camera.
Wherein the device is also used for:
dividing images shot by a plurality of cameras when the cameras are fogged into a training set and a testing set of a fog detection model;
training the mist detection model through the training set, and calculating the losses of a classification task and a regression task of the mist detection model through a loss function;
and updating the network weight of the fog detection model according to the loss of the fog detection model by using a back propagation algorithm until the accuracy of the fog degree of the camera output by the fog detection model is greater than a preset accuracy threshold after the test set is input into the fog detection model, so as to obtain a trained fog detection model.
Wherein the device is also used for:
labeling the fogging degree of N images in the images shot when the M cameras are fogged;
training an original fog detection model through the marked N images to obtain a pre-trained fog detection model;
inputting L images which are not marked in the M images into a pre-trained fog detection model, marking the fog degree of the L images through the pre-trained fog detection model, and obtaining a marking result of the fog degree of the L images;
checking the labeling results of the L images, and adjusting the fogging degree results of the images with unqualified labeling results;
and (3) turning, scaling, mean value normalization and tone change processing are carried out on the M marked images, and the M processed images are divided into a training set and a testing set of a fog detection model.
Wherein, the defogging module is still used for:
and controlling the vehicle-mounted air conditioner to start a corresponding defogging mode according to the defogging level of the camera, and adjusting the defogging mode of the vehicle-mounted air conditioner according to the variation of the defogging level so as to defog the camera.
Wherein, the defogging module is still used for:
if the fog level of the camera is the first level, the vehicle-mounted air conditioner does not start a fog mode;
if the fog level of the camera is the second level, controlling the vehicle-mounted air conditioner to start a first fog removal mode, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and is maintained for a preset period of time;
if the fog level of the camera is the third level, controlling the vehicle-mounted air conditioner to start a second fog removal mode, controlling the vehicle-mounted air conditioner to adjust to the first fog removal mode after the fog level of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and the preset duration is maintained;
and if the fog degree of the camera is at a fourth level, controlling the vehicle-mounted air conditioner to start a third fog removing mode, controlling the vehicle-mounted air conditioner to adjust to a second fog removing mode after the fog degree of the camera is reduced to the third level and the preset duration is maintained, controlling the vehicle-mounted air conditioner to adjust to a first fog removing mode after the fog degree of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removing mode after the fog degree of the camera is reduced to the first level and the preset duration is maintained.
The vehicle-mounted air conditioner is different in wind power gear under different defogging modes, wherein the wind power gear of the third defogging mode is larger than that of the second defogging mode, and the wind power gear of the second defogging mode is larger than that of the first defogging mode.
Wherein the determining module is further configured to:
when the fogging degree of the camera is lower than 25%, determining that the fogging degree of the camera is of a first grade;
when the fogging degree of the camera is greater than or equal to 25% and less than 50%, determining that the fogging degree of the camera is of a second grade;
when the fogging degree of the camera is greater than or equal to 50% and less than 75%, determining that the fogging degree of the camera is of a third grade;
and determining that the fogging degree of the camera is a fourth grade when the fogging degree of the camera is greater than or equal to 50% and less than or equal to 100%.
It should be noted that, for convenience and brevity of description, specific working procedures of the above-described apparatus and each module and unit may refer to corresponding procedures in the foregoing embodiments, and are not repeated herein.
The apparatus provided by the above embodiments may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 5.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a body controller.
As shown in fig. 5, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor to perform any of the methods of automatically defogging a camera.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in the non-volatile storage medium that, when executed by the processor, causes the processor to perform any of the methods for automatically defogging a camera.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored thereon, where the computer program includes program instructions, where the method implemented when the program instructions are executed may refer to the embodiments of the present application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An automatic defogging method for a camera, comprising the following steps:
inputting an image shot by a camera into a trained fog detection model to obtain the fog degree of the camera;
determining the fogging level of the camera according to the fogging degree of the camera;
and starting a corresponding defogging mode according to the defogging level of the camera so as to defog the camera.
2. The method of automatic defogging a camera of claim 1, further comprising the step of training the fog detection model, comprising:
dividing images shot by a plurality of cameras when the cameras are fogged into a training set and a testing set of a fog detection model;
training the mist detection model through the training set, and calculating the losses of a classification task and a regression task of the mist detection model through a loss function;
and updating the network weight of the fog detection model according to the loss of the fog detection model by using a back propagation algorithm until the accuracy of the fog degree of the camera output by the fog detection model is greater than a preset accuracy threshold after the test set is input into the fog detection model, so as to obtain a trained fog detection model.
3. The method for automatically defogging a camera according to claim 2, wherein the dividing the image photographed when a plurality of cameras are fogged into a training set and a test set of a fog detection model comprises:
labeling the fogging degree of N images in the images shot when the M cameras are fogged;
training an original fog detection model through the marked N images to obtain a pre-trained fog detection model;
inputting L images which are not marked in the M images into a pre-trained fog detection model, marking the fog degree of the L images through the pre-trained fog detection model, and obtaining a marking result of the fog degree of the L images;
checking the labeling results of the L images, and adjusting the fogging degree results of the images with unqualified labeling results;
and (3) turning, scaling, mean value normalization and tone change processing are carried out on the M marked images, and the M processed images are divided into a training set and a testing set of a fog detection model.
4. The automatic defogging method of a camera according to claim 1, wherein a corresponding defogging mode is turned on according to a defogging level of the camera to defog the camera, further comprising:
and controlling the vehicle-mounted air conditioner to start a corresponding defogging mode according to the defogging level of the camera, and adjusting the defogging mode of the vehicle-mounted air conditioner according to the variation of the defogging level so as to defog the camera.
5. The automatic defogging method for a camera according to claim 4, wherein controlling a vehicle-mounted air conditioner to turn on a corresponding defogging mode according to a defogging level of the camera, and adjusting the defogging mode of the vehicle-mounted air conditioner according to a variation of the defogging level, to defog the camera, comprises:
if the fog level of the camera is the first level, the vehicle-mounted air conditioner does not start a fog mode;
if the fog level of the camera is the second level, controlling the vehicle-mounted air conditioner to start a first fog removal mode, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and is maintained for a preset period of time;
if the fog level of the camera is the third level, controlling the vehicle-mounted air conditioner to start a second fog removal mode, controlling the vehicle-mounted air conditioner to adjust to the first fog removal mode after the fog level of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removal mode after the fog level of the camera is reduced to the first level and the preset duration is maintained;
and if the fog degree of the camera is at a fourth level, controlling the vehicle-mounted air conditioner to start a third fog removing mode, controlling the vehicle-mounted air conditioner to adjust to a second fog removing mode after the fog degree of the camera is reduced to the third level and the preset duration is maintained, controlling the vehicle-mounted air conditioner to adjust to a first fog removing mode after the fog degree of the camera is reduced to the second level and the preset duration is maintained, and controlling the vehicle-mounted air conditioner to exit the fog removing mode after the fog degree of the camera is reduced to the first level and the preset duration is maintained.
6. The method for automatically defogging a camera according to claim 5, wherein:
the vehicle-mounted air conditioner is different in wind power gear under different defogging modes, wherein the wind power gear of the third defogging mode is larger than that of the second defogging mode, and the wind power gear of the second defogging mode is larger than that of the first defogging mode.
7. The method for automatically defogging a camera according to claim 5, wherein said determining a fogging level of said camera according to a fogging level of said camera comprises:
when the fogging degree of the camera is lower than 25%, determining that the fogging degree of the camera is of a first grade;
when the fogging degree of the camera is greater than or equal to 25% and less than 50%, determining that the fogging degree of the camera is of a second grade;
when the fogging degree of the camera is greater than or equal to 50% and less than 75%, determining that the fogging degree of the camera is of a third grade;
and determining that the fogging degree of the camera is a fourth grade when the fogging degree of the camera is greater than or equal to 50% and less than or equal to 100%.
8. An automatic defogging device of camera, characterized in that includes:
the acquisition module is used for inputting the image shot by the camera into the trained fog detection model so as to acquire the fog degree of the camera;
the determining module is used for determining the fogging level of the camera according to the fogging degree of the camera;
and the defogging module is used for opening a corresponding defogging mode according to the defogging level of the camera so as to defog the camera.
9. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program when executed by the processor performs the steps of the method of automatic defogging of a camera according to any of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the automatic defogging method of a camera of any of the claims 1 to 7.
CN202311148309.0A 2023-09-06 2023-09-06 Automatic defogging method, device, equipment and medium for camera Pending CN117325804A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311148309.0A CN117325804A (en) 2023-09-06 2023-09-06 Automatic defogging method, device, equipment and medium for camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311148309.0A CN117325804A (en) 2023-09-06 2023-09-06 Automatic defogging method, device, equipment and medium for camera

Publications (1)

Publication Number Publication Date
CN117325804A true CN117325804A (en) 2024-01-02

Family

ID=89294134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311148309.0A Pending CN117325804A (en) 2023-09-06 2023-09-06 Automatic defogging method, device, equipment and medium for camera

Country Status (1)

Country Link
CN (1) CN117325804A (en)

Similar Documents

Publication Publication Date Title
CN107292386B (en) Vision-based rain detection using deep learning
US11586856B2 (en) Object recognition device, object recognition method, and object recognition program
KR20180025591A (en) Control method and apparatus of vision sensor for automatic driving car
US10803340B2 (en) Method and apparatus for license plate recognition using multiple fields of view
US10635910B2 (en) Malfunction diagnosis apparatus
CN110852274A (en) Intelligent rainfall sensing method and device based on image recognition
CN110415544B (en) Disaster weather early warning method and automobile AR-HUD system
CN110135235B (en) Glare processing method and device and vehicle
JP2008028957A (en) Image processing apparatus for vehicle
CN109703465B (en) Control method and device for vehicle-mounted image sensor
US20240029444A1 (en) Correction of images from a panoramic-view camera system in the case of rain, incident light and contamination
CN112101147A (en) Vehicle-mounted intelligent recognition detection system
US9308918B2 (en) Object collision warning system and method for a motor vehicle
KR20190095567A (en) Method and apparatus of identifying object
CN111824003A (en) Control method and control system of car lamp
KR102211903B1 (en) Method And Apparatus for Photographing for Detecting Vehicle Occupancy
CN110774975A (en) Intelligent light control method and device based on image recognition
JP2010033321A (en) Evaluation system for image processing algorithm
CN117325804A (en) Automatic defogging method, device, equipment and medium for camera
CN113752940B (en) Control method, equipment, storage medium and device for tunnel entrance and exit lamp
US20230186644A1 (en) A vision system and method for a motor vehicle
JP2020088604A (en) Travel control device, control method, and program
CN116547726A (en) Correction of images of an imaging device during rain, incident light and dirt
CN111756987B (en) Control method and device of vehicle-mounted camera and vehicle-mounted image capturing system
DE102019219389B4 (en) Method, computer program and device for reducing expected limitations of a sensor system of a means of transportation due to environmental influences during operation of the means of transportation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination