Self-cleaning method and system for camera
By using a control module and drive chip to control the drive motor to drive the cleaning mechanical structure for self-cleaning in the mine working environment, the problem of declining imaging quality of mine cameras is solved, and a highly efficient self-cleaning effect is achieved.
Patent Information
- Application Number
- CN202510811700.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-11-04
AI Technical Summary
In the mining environment, the image quality of binocular cameras deteriorates due to dust and oily contaminants. Existing cleaning methods are inefficient and pose safety hazards, while existing automatic cleaning devices are power-consuming and unsuitable.
The control module receives camera images in real time for multi-dimensional quality assessment, and the drive chip converts signals to control the drive motor to drive the cleaning mechanical structure for self-cleaning, including the left and right swinging of the cleaning mechanical structure, which is a silicone brush.
It enables automatic activation of the cleaning function when image quality deteriorates, improving cleaning efficiency and response speed, ensuring effective cleaning of camera lenses, and avoiding cleaning loops.
Smart Images

Figure CN120897050A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of camera cleaning, and in particular to a camera self-cleaning method and system. BACKGROUND
[0002] In a mine working environment, binocular cameras are often used for monitoring and detection tasks. However, due to high dust concentration and high humidity in the mine, and the presence of oily contaminants, the camera surface is easily contaminated, resulting in a decline in imaging quality and affecting normal work. The existing cleaning method mainly relies on manual periodic cleaning, which is inefficient and poses a safety hazard to manual operation in harsh environments. In addition, some existing automatic cleaning devices have complex structures and high power consumption, which are not suitable for mine environments. SUMMARY
[0003] The present application aims to at least partially solve one of the technical problems in the related art.
[0004] To this end, a first object of the present application is to provide a camera self-cleaning method to achieve efficient self-cleaning of binocular cameras.
[0005] A second object of the present application is to provide a camera self-cleaning system.
[0006] A third object of the present application is to provide an electronic device.
[0007] A fourth object of the present application is to provide a computer-readable storage medium.
[0008] A fifth object of the present application is to provide a computer program product.
[0009] To achieve the above objects, a first aspect of the present application provides a camera self-cleaning method, comprising:
[0010] The control module receives the camera shooting image, performs multi-dimensional quality assessment on the shooting image, obtains an image quality score, and sends a cleaning control signal according to the image quality score;
[0011] The drive chip receives the cleaning control signal and converts it into a drive signal to send to the drive motor;
[0012] The drive motor drives the cleaning mechanical structure to clean based on the drive signal.
[0013] To achieve the above objects, a second aspect of the present application provides a camera self-cleaning system, comprising:
[0014] The control module is connected with the camera, the driving chip is connected with the control module and the driving motor, and the cleaning mechanical structure is fixed on the driving motor.
[0015] The control module is configured to receive a photographed image of the camera, perform multi-dimensional quality evaluation on the photographed image to obtain an image quality score, and send a cleaning control signal according to the image quality score.
[0016] The driving chip is configured to receive the cleaning control signal and convert the cleaning control signal into a driving signal to send to the driving motor.
[0017] The driving motor is configured to drive the cleaning mechanical structure to perform cleaning based on the driving signal.
[0018] To achieve the above object, the third aspect of the present application provides an electronic device, comprising: a processor, and a memory connected with the processor in communication;
[0019] The memory stores computer execution instructions.
[0020] The processor executes the computer execution instructions stored in the memory to implement the method of the first aspect.
[0021] To achieve the above object, the fourth aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the method of the first aspect.
[0022] To achieve the above object, the fifth aspect of the present application provides a computer program product, comprising a computer program, which is executed by a processor to implement the method of the first aspect.
[0023] The camera self-cleaning method and system provided by the present application receive the photographed image of the camera in real time through the control module, perform multi-dimensional quality analysis on the photographed image to determine the image quality score, and determine whether the current camera needs to start cleaning according to the image quality score. Compared with the periodic cleaning or manual cleaning method of the prior art, the cleaning function is started when the image shooting quality is not good, the resource utilization is improved, the driving chip is instructed by the control module when the camera is self-cleaning, the driving motor is started to open the camera self-cleaning, the response speed of the driving cleaning mechanical structure is guaranteed, and the cleaning efficiency is improved.
[0024] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0025] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description, taken in conjunction with the following drawings of exemplary embodiments of the present application, and where:
[0026] Figure 1 A flowchart of a camera self-cleaning method provided by an embodiment of the present application;
[0027] Figure 2 A flowchart of another camera self-cleaning method provided by an embodiment of the present application;
[0028] Figure 3 A structural diagram of a camera self-cleaning system provided by an embodiment of the present application;
[0029] Figure 4 A partial circuit diagram of a camera self-cleaning system provided by an embodiment of the present application. DETAILED DESCRIPTION
[0030] The embodiments of the present application are described in detail below with reference to the accompanying drawings, in which the same or similar components have the same or similar designations and functions throughout. The embodiments described below are exemplary and are intended to explain the present application, and are not to be understood as limiting the present application.
[0031] A camera self-cleaning method and system of an embodiment of the present application are described below with reference to the accompanying drawings.
[0032] Figure 1 A flowchart of a camera self-cleaning method provided by an embodiment of the present application. As shown in Figure 1 the method includes the following steps:
[0033] S101, the control module receives a camera shooting image, performs multi-dimensional quality evaluation on the shooting image, obtains an image quality score, and sends a cleaning control signal according to the image quality score.
[0034] In some embodiments, the control module can be a Field-Programmable Gate Array (FPGA), and the FPGA can repeatedly configure the logic function through a hardware description language.
[0035] It can be understood that the control module is connected to the camera through a wired or wireless connection, so that the control module can receive a shooting image shot by the camera in real time, and analyze the image quality of the shooting image. When the image quality is poor, it indicates that the current camera lens may have dirt or foreign matter affecting the imaging quality, and the camera lens needs to be cleaned.
[0036] Optionally, the control module can receive the camera shooting image in real time and perform image quality analysis, or can receive the camera shooting image periodically and perform image quality analysis, for example, the camera is operated for half an hour, and the receiving of the real-time shooting image and the image quality analysis are performed once, to determine whether the camera self-cleaning needs to be performed again.
[0037] Optionally, the multi-dimensional quality evaluation of the shooting image can include multi-dimensional evaluation of sharpness, color restoration degree, and noise level, and when the sharpness is low, the color restoration degree is poor, or the noise level is high, it is determined that the current image quality is poor, that is, the image quality score is low; accordingly, when the image quality score is low, it indicates that the camera lens may be dirty or other factors affecting the imaging quality, and the camera self-cleaning is started.
[0038] Optionally, when the image quality score is lower than the preset threshold, the control module can send a cleaning control signal, that is, the FPGA sends a cleaning control signal to indicate the start of the camera self-cleaning process.
[0039] S102, the driving chip receives the cleaning control signal and converts it into a driving signal sent to the driving motor.
[0040] In some embodiments, the driving chip can be an MS8837 chip, which is a direct current motor driving chip specially designed for low voltage scenes, has an H-bridge motor driver, can realize the control functions of forward rotation, reverse rotation and stop of the motor, and also has functions of low temperature protection and low voltage protection; in this embodiment, the FPGA controls the low level effective sleep control pin nSLEEP of the driving chip MS8837, so that the driving chip can receive the cleaning control signal sent by the FPGA, and convert the cleaning control signal into a driving signal suitable for the direct current motor.
[0041] Further, the driving signal is sent to the driving motor, and in this embodiment, the driving motor is a direct current motor, and the specific direct current motor model parameters can be: working voltage 12V, power 7W, rotating speed 5-600r / min, current 580mA, and weight 190g.
[0042] S103, the driving motor drives the cleaning mechanical structure based on the driving signal.
[0043] Optionally, the cleaning mechanical structure can be a silica gel brush, a feather brush, or a superfine fiber brush, etc. used for lens cleaning structure, and in this embodiment, the cleaning mechanical structure is a silica gel brush.
[0044] After the driving chip sends the driving signal to the driving motor, the driving motor moves based on the indication of the driving signal and drives the silica gel brush to swing left and right; in the embodiment, the selected DC motor has a torque of about 6.5-15 kg·cm when the rotating speed of the motor shaft is 10-30 r / min, and can drive a silica gel brush with a length of about 10 cm to swing left and right for cleaning, so as to realize the self-cleaning function of the camera.
[0045] In the embodiment, the control module receives the shooting image of the camera in real time, and performs multi-dimensional quality analysis on the shooting image to determine the image quality score, and determines whether the current camera needs to start cleaning according to the image quality score. Compared with the periodic cleaning or manual cleaning method of the prior art, the application starts the cleaning function when the image shooting quality is not good, improves the resource utilization, and when the camera is self-cleaning, the control module instructs the driving chip to control the driving motor to drive the cleaning mechanical structure. The response speed of the camera self-cleaning is faster, and the cleaning efficiency is improved.
[0046] On the basis of the above embodiment, Figure 2 Another flowchart of the self-cleaning of the camera provided by the embodiment of the application is shown in the figure. Figure 2 As shown in the figure, the method comprises the following steps:
[0047] S201, the control module receives the shooting image of the camera.
[0048] In the embodiment of the application, the implementation method of step S201 can be realized by any one of the embodiments of the present disclosure, which is not limited here and will not be repeated.
[0049] S202, the gradient value of each pixel in the shooting image is obtained, and the sharpness of the shooting image is obtained according to the gradient value.
[0050] Optionally, the gradient value of each pixel in the shooting image can be obtained based on the Sobel operator.
[0051] In some embodiments, a gradient vector can be constructed based on the gradient value of each pixel, and the gradient vector is represented as: wherein, is the gradient of I in the horizontal direction (x direction), is the gradient of I in the vertical direction (y direction).
[0052] Further, the sharpness of the shooting image can be obtained based on the gradient vector, and the calculation of the sharpness can be:
[0053]
[0054] wherein, is the operation of the module of the gradient vector, Sums of the modulus of the gradient vectors of all pixels in the photographed image; N is the total number of pixels; C is the sharpness.
[0055] Further, the sharpness can also be normalized to map the sharpness value to the interval [0, 1].
[0056] S203, obtaining noise information in the photographed image, and determining the noise interference degree of the photographed image according to the noise information.
[0057] In some embodiments, the information of noise points in the photographed image can be obtained as the noise information, and the noise point types can include low-frequency noise, high-frequency noise, salt and pepper noise, or Gaussian noise. For example, the image can be converted into a frequency domain through Fourier transform to identify the low-frequency noise and the high-frequency noise, and the noise points in the image can also be identified through histogram inspection or mean value calculation to obtain the noise information in the photographed image.
[0058] Optionally, the ratio of the number of noise points to the number of other normal pixel points in the photographed image can be taken as the noise interference degree of the photographed image.
[0059] Optionally, the photographed image can also be divided into at least two sub-images, and the local variance of the pixels in each sub-image can be obtained. For example, the sub-image size is set to 8*8, the photographed image is divided into multiple sub-images according to the size, and the local variance of the pixels in each sub-image is calculated. It can be understood that the calculation process of the local variance is also to obtain the average value of all pixels in the sub-image, and the variance of the sub-image is calculated based on the pixel value of each pixel point and the average value, as the local variance of the sub-image.
[0060] Further, after obtaining the local variances of all sub-images, the maximum variance and the minimum variance in the local variances are screened, the maximum variance in the sub-image is taken as the signal variance, and the minimum variance in the sub-image is taken as the noise variance; the signal-to-noise ratio is calculated according to the signal variance and the noise variance, as the noise interference degree.
[0061] Optionally, the calculation of the noise interference degree can be:
[0062]
[0063] wherein, SNR is the signal-to-noise ratio, that is, the noise interference degree in the embodiment; is the signal variance, that is, the maximum variance of the sub-image; is the noise variance, that is, the minimum variance of the sub-image.
[0064] Further, the noise interference degree can be normalized, for example, a ratio of the current actual noise interference degree to the maximum noise interference degree is calculated, and a difference between the unit number 1 and the ratio is taken as the current normalized noise interference degree, so as to improve the subsequent data analysis efficiency.
[0065] In S204, the color restoration degree of the photographed image is determined according to the color information in the photographed image.
[0066] Optionally, color channel data corresponding to the photographed image can be acquired as the color information, and the color channel data includes a luminance channel value L, a red-green color axis value a, and a yellow-blue color axis value b. In this embodiment, the photographed image is converted to a Lab color space to obtain the values of the luminance channel, the red-green color axis, and the yellow-blue color axis, and the color channel data is obtained.
[0067] The standard color data is determined based on the color correction matrix of the camera. In this embodiment, the color correction matrix of the camera can be calculated based on the color card data, and the original signal of the camera is mapped to a standard space. The color correction matrix is calculated in the camera calibration stage, and the calculation method is to test the color card with standard color values. After the binocular camera photographs the color card, the original RGB value of each color block is extracted from the photographed unprocessed original RAW image. The color correction matrix of the camera is calculated by comparing the RGB values of the photographed data and the standard data. The real standard color data is calculated according to the photographed image and the color correction matrix of the camera.
[0068] Further, the color restoration degree of the photographed image is determined according to the difference between the color channel data and the standard color data. Optionally, the calculation of the color restoration degree is as follows:
[0069]
[0070] Wherein, L1, a1 and b1 are respectively the standard L value, the standard a value and the standard b value in the standard color data; L, a and b are respectively the L value, the a value and the b value in the color channel data of the photographed image.
[0071] Further, the color restoration degree can be normalized. The normalization processing method can be as follows:
[0072]
[0073] Wherein, A' is the normalized color restoration degree; A is the color restoration degree before normalization; A threshold is a preset color restoration threshold; is the minimum value of 1 or .
[0074] S205, determine the image quality score based on the definition, noise interference degree and color restoration degree.
[0075] Optionally, the weights corresponding to the definition, noise interference degree and color restoration degree can be obtained respectively; the definition, noise interference degree and color restoration degree are weighted and summed based on the weights to obtain the image quality score.
[0076] It can be understood that the weight values corresponding to the definition, noise interference degree and color restoration degree add up to 1.
[0077] Optionally, the calculation of the image quality score can be represented as:
[0078] Q=W c *C′+W s *SNR′+W a *A′
[0079] Wherein, Q is the image quality score; W c , W s and W a are the weights corresponding to the definition, noise interference degree and color restoration degree respectively; C' is the normalized definition; SNR' is the normalized noise interference degree; A' is the normalized color restoration degree.
[0080] S206, issue a cleaning control signal according to the image quality score.
[0081] Optionally, the quality threshold of experimental calibration can be obtained, and the image quality score is compared with the quality threshold; when the image quality score is lower than the quality threshold, it indicates that the camera needs to be cleaned, and then the FPGA issues a cleaning control signal; accordingly, if the image quality score is greater than or equal to the quality threshold, camera cleaning is not needed.
[0082] In some embodiments, the quality threshold can be 0.6, and in other embodiments, the quality threshold can be other values.
[0083] S207, the driving chip receives the cleaning control signal and converts it into a driving signal to send to the driving motor.
[0084] It can be understood that the FPGA is connected with the nSLEEP pin of the driving chip MS8837, and the FPGA issues a cleaning control signal, that is, the nSLEEP pin is pulled low to the low level to start the cleaning process, and after the driving chip receives the cleaning control signal, it is converted into a driving signal to send to the driving motor to control the driving motor.
[0085] In the embodiment of the present application, the implementation method of step S207 can be implemented by any of the embodiments of the present disclosure, and here it is not limited, and will not be repeated.
[0086] S208, driving the motor to drive the cleaning mechanical structure to clean based on the driving signal.
[0087] In the embodiment, the cleaning mechanical structure is a silica gel brush, and the driving motor drives the silica gel brush to rotate based on the driving signal; in some embodiments, the direction of motion of the silica gel brush can also be changed at regular intervals, for example, the driving motor is initially driven to rotate forward to drive the silica gel brush to clean from left to right, and after 1 second, the driving motor is driven to rotate reversely to drive the silica gel brush to clean from right to left.
[0088] In some embodiments, limit switches can also be provided at both ends of the glass to be cleaned by the camera, and the limit switches are used to determine whether the cleaning mechanical structure has cleaned to the edge, and the limit switches feed back the real-time state to the control module in response to the touch of the cleaning mechanical structure; that is, when the silica gel brush touches a limit switch at both ends of the glass to be cleaned, it indicates that the silica gel brush has cleaned from the initial position to one end of the edge, and the state of the touched limit switch changes to a closed state, and the closed state is fed back to the control module.
[0089] The control module sends an indication signal according to the real-time state; the driving chip controls the driving motor to reverse according to the indication signal to change the cleaning direction of the cleaning mechanical structure; it can be understood that after the driving motor reverses, the real-time state of the original limit switch changes from closed to open, and the real-time state changes until the next touch of the silica gel brush, so that the silica gel brush can clean the entire area of the glass to be cleaned by the camera, and the cleaning effect is improved.
[0090] In some embodiments, the number of times of touching the limit switch can be used to determine whether to stop cleaning, for example, each limit switch is set to be touched at least 3 times to complete one cleaning, that is, the silica gel brush reciprocates at least 3 times to complete the cleaning process of the glass to be cleaned by the camera, and a cleaning end indication is issued.
[0091] In some embodiments, the cleaning time of the cleaning mechanical structure can also be obtained; in response to the cleaning time reaching a preset cleaning duration, the control module issues a cleaning end indication to stop driving the cleaning mechanical structure to clean.
[0092] For example, it is assumed that the preset cleaning duration in the embodiment is 1 minute, and the timing starts when the cleaning mechanical structure starts to clean, and when the silica gel brush touches the limit switch again when the cleaning time reaches 1 minute, the control module issues a cleaning end indication to stop driving the cleaning mechanical structure to clean, so that the silica gel brush returns to the normal position, and the silica gel brush does not block the camera's line of sight.
[0093] In some embodiments, after the camera self-cleaning is completed once, the post-cleaning shooting image can also be captured, and the image quality analysis of the shooting image is continued by the control module to obtain the image quality score to determine whether further cleaning is needed. If the image quality score is still below the quality threshold, a new round of camera self-cleaning is started again until the image quality score of the shooting image captured by the camera is higher than the quality threshold, or the self-cleaning is stopped when the maximum number of cleanings is reached.
[0094] Optionally, the maximum number of cleanings in the present embodiment is 5 to avoid a cleaning dead loop caused by dirt that cannot be cleaned automatically.
[0095] In the present embodiment, the control module performs image quality evaluation on the shooting image in terms of sharpness, noise interference level, and color restoration level after receiving the shooting image, and obtains the final image quality score by weighted summation of the sharpness, noise interference level, and color restoration level, thereby more fully evaluating the image quality. When the image quality score does not meet the quality threshold, it is determined that the camera needs to be cleaned, and the control module FPGA issues a cleaning control signal. After the driving chip receives the cleaning control signal, it is converted into a driving signal and sent to the driving motor. The driving motor drives the silica gel brush to clean based on the driving signal, and limit switches are installed at both ends of the camera to be cleaned glass to determine whether the cleaning mechanical structure has cleaned to the edge, so as to ensure that the silica gel brush can clean the entire area of the glass to be cleaned and improve the cleaning effect. When the cleaning time reaches the preset cleaning time, a cleaning end indication is issued, and image quality re-inspection is performed at the end of cleaning. If the quality is not good, repeated cleaning is continued until the stop condition is met to ensure better camera cleaning effect, or the cleaning is stopped in time and a warning is given when the cleaning cannot be completed to avoid a cleaning dead loop caused by dirt that cannot be cleaned automatically.
[0096] To implement the above-mentioned embodiments, the present application further provides a camera self-cleaning system.
[0097] Figure 3 A structural schematic diagram of a camera self-cleaning system provided by the present embodiment is shown in FIG. 3. Figure 3 As shown in FIG. 3, the camera self-cleaning system 300 comprises:
[0098] a control module 301, a driving chip 302, a driving motor 303, and a cleaning mechanical structure 304; the control module 301 is connected with the camera, the driving chip 302 is connected with the control module 301 and the driving motor 303, and the cleaning mechanical structure 304 is fixed on the driving motor 303. In the present embodiment, the cleaning mechanical structure 304 is fixed on the shaft of the driving motor 303 and rotates with the shaft of the motor.
[0099] The control module 301 is configured to receive a camera image, perform multi-dimensional quality assessment on the camera image, obtain an image quality score, and send a cleaning control signal according to the image quality score.
[0100] The driving chip 302 is configured to receive the cleaning control signal and convert the cleaning control signal into a driving signal and send the driving signal to the driving motor 303.
[0101] The driving motor 303 is configured to drive the cleaning mechanical structure 304 to clean based on the driving signal.
[0102] In some embodiments, the control module 301 uses an FPGA as a control core of the system, and controls the driving chip through an internal logic circuit; the driving chip 302 uses an MS8837 chip, the FPGA controls an nSLEEP pin of the MS8837 to switch a working mode of the system; the driving motor 303 uses a direct current motor, and the cleaning mechanical structure 304 is a silica gel brush made of a flame-retardant material, which is soft and has good elasticity and cleaning effect.
[0103] Optionally, after the system is powered on, the FPGA initializes and configures related parameters of the MS8837 chip, including setting a frequency (such as 20 kHz) and an initial duty cycle (such as 5%) of a pulse width modulation (PWM) signal, and setting the nSLEEP pin to a high level to make the MS8837 chip enter a normal working mode.
[0104] Further, the control module 301 obtains a camera image collected by a camera, performs multi-dimensional quality assessment on the camera image according to a built-in algorithm of the FPGA, including clarity, noise interference degree, and color restoration degree, obtains an image quality score, and sends a cleaning control signal when the image quality score is lower than a quality threshold, that is, the FPGA sends a PWM signal to the MS8837, the driving chip 302 converts the cleaning control signal into a motor driving signal and sends the motor driving signal to the driving motor 303, to control the direct current motor to rotate forward and drive the cleaning mechanical structure 304 (the silica gel brush) to move from an initial position to one end.
[0105] In some embodiments, the system 300 further includes at least two limit switches, which are respectively installed at two ends of a camera glass to be cleaned and connected with the control module 301; in response to the cleaning mechanical structure 304 touching any limit switch, the limit switch changes a state and feeds back a real-time state to the control module 301; that is, when the silica gel brush touches the limit switches at two ends of the glass to be cleaned, the limit switches are closed and feed back the closed state to the FPGA.
[0106] The control module 301 receives the real-time state of the limit switch and sends an instruction signal to the drive chip 302; the drive chip 302 controls the drive motor 303 to reverse according to the instruction signal, so as to change the cleaning direction of the cleaning mechanical structure; that is, to drive the silica gel brush to move to the other end, when the silica gel brush touches the limit switch at the other end, the limit switch at the other end is closed and feedback to the FPGA, the FPGA sends an instruction signal to change the cleaning direction of the cleaning mechanical structure, until the cleaning is completed.
[0107] In some embodiments, the system 300 further comprises a timing module connected with the control module; the timing module in this embodiment can be a timer.
[0108] In response to the drive motor driving the cleaning mechanical structure to clean based on the driving signal, the timing module starts timing the cleaning duration; that is, when the drive motor starts driving the silica gel brush to clean, the FPGA starts the timer to time, in response to the cleaning duration reaching the preset cleaning duration, the timing module sends an end instruction to the control module; assuming that the preset cleaning duration is 1 minute, when the cleaning duration reaches 1 minute, the timer feedbacks the end instruction to the FPGA; the control module sends a cleaning end instruction to the drive chip based on the end instruction to stop driving the cleaning mechanical structure to clean.
[0109] In some embodiments, the control module can also wait after receiving the end instruction, receive the next limit switch closing instruction, and the FPGA executes the cleaning end instruction based on the end instruction to stop driving the silica gel brush to clean, for example, when the cleaning duration reaches 1 minute, the silica gel brush is in the process of cleaning from left to right, when the silica gel brush reaches the right end and touches the right end limit switch, the FPGA formally issues the cleaning end to end this cleaning process, to ensure that the silica gel brush is returned to the original position and does not hinder the camera's shooting line of sight.
[0110] In some embodiments, after the system is powered on, the timer of the timing module also needs to be cleared and whether the timer is cleared is rechecked, and the H-bridge drive mode (forward / reverse control) is configured.
[0111] In some embodiments, after a self-cleaning process is completed, image quality rechecking can also be performed, that is, after the self-cleaning is completed, the shooting image captured by the camera is continuously acquired, and the image quality score of the shooting image is acquired, if the image quality score is greater than or equal to the quality threshold, it proves that the self-cleaning is completed; otherwise, if the image quality score is still less than the quality threshold, it indicates that the self-cleaning fails, and a new self-cleaning process is continued until the stop condition is met.
[0112] Optionally, the stop condition can be that the image quality score after cleaning is greater than or equal to the quality threshold, or the maximum cleaning number is reached, and the maximum cleaning number in this embodiment is 5, to avoid excessive self-cleaning from falling into a dead loop.
[0113] In some embodiments, if the re-inspected image quality score is still not greater than or equal to the quality threshold after reaching the maximum number of cleaning times, the FPGA control stops all actions of the system and activates a fault indicator light, while alarming through the communication interface to trigger an abnormal processing mode of operation.
[0114] On the basis of the above-mentioned embodiments, Figure 4 A partial circuit schematic diagram of a self-cleaning system of a camera provided by the embodiments of the present application includes power supplies, a driving chip, limit switches, and motor interfaces of a DC motor. In the driving chip, nSLEEP, MOTOR_IN1, and MOTOR_IN2 are FPGA interfaces for sleep mode control (high level greater than 0.8 V: normal operation; low level less than 0.4 V), PWM control input 1 (high level active), and PWM control input 2 (high level active), respectively, and details are not described herein. OUT1 and OUT2 in the driving chip are H-bridge output 1 and H-bridge output 2, respectively, and are connected to both ends of the motor. The power supplies are used for powering the motor and the system, respectively, and are compatible with the FPGA. One of the power supplies drives the voltage change of OUT1 and OUT2 through the internal circuit of the VM pin. The pull-down resistors R63 and R64 avoid floating and prevent false triggering of the motor action. When the silica gel brush touches the limit switch, the SWITCH corresponding to the limit switch changes from low level to high level. Pin 3 in the limit switch 1 and the limit switch 2 is in a normally closed NC state and is conductive with pin 3 when the limit switch is not pressed. Since pin 3 is grounded through the NC pin, the FPGA IO port detects a low level. Pin 2 is in a normally open NO state and is conductive with pin 3 when the limit switch is pressed. Since pin 3 is connected to VCC through the pull-up resistor, the FPGA IO port detects a high level.
[0115] Optionally, the control logic of MOTOR_IN1 (IN1 in the table) and MOTOR_IN2 (IN2 in the table) is described, as shown in Table 1.
[0116] Table 1
[0117] nSLEEP IN1 IN2 OUT1 OUT2 Function 0 X X Z Z Sleep mode (all outputs high configuration) 1 0 0 Z Z Free stop (no drive current) 1 0 1 L H Reverse rotation (OUT1 low, OUT2 high) 1 1 0 H L Forward rotation (OUT1 high, OUT2 low) 1 1 1 L L Brake mode (short circuit brake)
[0118] As shown in the above table, when nSLEEP is 0, the device is in sleep mode, all outputs are in high configuration, and the device is in a low-power standby state. When IN1 and IN2 are both 0, the device has no driving current and is in a free stop state. When IN1 is 0 and IN2 is 1, OUT1 is low and OUT2 is high, and the device rotates in reverse. When IN1 is 1 and IN2 is 0, OUT1 is high and OUT2 is low, and the device rotates in the forward direction. When IN1 and IN2 are both 1, OUT1 and OUT2 are both low, and the device is short-circuited at both ends to brake and enter the brake state.
[0119] In the embodiment of the present application, after receiving the photographed image, the control module 301 performs image quality evaluation on the photographed image in three dimensions of definition, noise interference degree and color restoration degree, and weighted sum of the definition, noise interference degree and color restoration degree to obtain the final image quality score, which more fully evaluates the image quality. When the image quality score does not meet the quality threshold, it is determined that the camera needs to be cleaned, and the control module 301 sends a cleaning control signal. After the driving chip 302 receives the cleaning control signal, it is converted into a driving signal and sent to the driving motor 303. The driving motor 303 drives the cleaning mechanical structure 304 to clean based on the driving signal. The system installs limit switches at both ends of the camera to be cleaned glass to reflect whether the cleaning mechanical structure 304 cleans to the edge, ensuring that it can clean the entire area of the glass to be cleaned, improving the cleaning effect. At the same time, the timer is used to obtain the cleaning time, and when the cleaning time reaches the preset cleaning time, the control module 301 controls the system to end the cleaning. At the end of cleaning, image quality re-inspection can also be performed, and repeated cleaning is continued when the quality is not up to standard until the quality threshold is met, ensuring better camera cleaning effect, or stopping cleaning in time and warning when cleaning cannot be completed to avoid cleaning dead loop caused by dirt that cannot be cleaned automatically.
[0120] In order to realize the above-mentioned embodiment, the present application further provides an electronic device, comprising: a processor and a memory in communication connection with the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to realize the method provided by the foregoing embodiments.
[0121] In order to realize the above-mentioned embodiment, the present application further provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to realize the method provided by the foregoing embodiments.
[0122] In order to realize the above-mentioned embodiment, the present application further provides a computer program product, comprising a computer program, which is executed by the processor to realize the method provided by the foregoing embodiments.
[0123] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the present application comply with relevant laws and regulations and do not violate public order and good customs.
[0124] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.
[0125] This application is intended to provide an implementation scheme for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.
[0126] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0127] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0128] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0129] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions stored in a computer readable medium, which can be executed by an instruction execution system, apparatus or device, such as a computer-based system, a processor-based system, or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or a combination of them. For the purposes of this specification, a "computer readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus or device. The computer readable medium can be a computer readable storage medium or a computer readable signal medium. The computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, a portable computer diskette (magnetic), a RAM (random access memory), a ROM (read only memory), an EPROM (erasable programmable ROM), EEPROM (electrically erasable programmable ROM), a storage
[0130] It should be understood that aspects of the application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. As such, in some embodiments, specifically configured hardware can be used to implement at least some of the functionality described herein. In another embodiment, software or firmware can be used to implement at least some of the functionality described herein, which would be processed by a general purpose computer or processor. Specifically, any of the following technologies, or combinations thereof, can be used to implement at least some of the functionality described herein: discrete logic circuits having logic gates for implementing logic functions upon data signals, application specific integrated circuits having logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and others.
[0131] Those of skill in the art would understand that information and signals can be represented using any of a variety of technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that can be referenced throughout the above description can be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
[0132] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0133] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A self-cleaning method for a camera, characterized in that, include: The control module receives images captured by the camera, performs multi-dimensional quality assessment on the captured images, obtains an image quality score, and issues a cleaning control signal based on the image quality score. The driver chip receives the cleaning control signal and converts it into a drive signal, which is then sent to the drive motor. The drive motor drives the cleaning mechanical structure to perform cleaning based on the drive signal.
2. The method according to claim 1, characterized in that, The process of performing a multi-dimensional quality assessment on the captured image to obtain an image quality score includes: Obtain the gradient value of each pixel in the captured image, and obtain the sharpness of the captured image based on the gradient value; Obtain noise information from the captured image, and determine the noise interference level of the captured image based on the noise information; Based on the color information in the captured image, determine the degree of color reproduction of the captured image; The image quality score is determined based on the sharpness, the level of noise interference, and the degree of color reproduction.
3. The method according to claim 2, characterized in that, Determining the noise interference level of the captured image based on the noise information includes: The captured image is segmented into at least two sub-images, and the local variance of pixels in each sub-image is obtained; The maximum variance in the sub-image is taken as the signal variance, and the minimum variance in the sub-image is taken as the noise variance; The signal-to-noise ratio is calculated based on the signal variance and the noise variance, and is used as the degree of noise interference.
4. The method according to claim 2, characterized in that, Determining the color reproduction degree of the captured image based on the color information in the captured image includes: The color channel data corresponding to the captured image is obtained as color information. The color channel data includes the luminance channel value L, the red-green axis value a, and the yellow-blue axis value b. Standard color data is determined based on the camera's color correction matrix; The degree of color reproduction of the captured image is determined based on the difference between the color channel data and the standard color data.
5. The method according to claim 2, characterized in that, The process of determining the image quality score based on the sharpness, the level of noise interference, and the degree of color reproduction includes: The weights corresponding to the sharpness, the noise interference level, and the color reproduction level are obtained respectively; The image quality score is obtained by weighting and summing the sharpness, the noise interference level, and the color reproduction level based on the weights.
6. The method according to claim 1, characterized in that, The method further includes: In response to the cleaning mechanical structure touching the limit switch, the limit switch will feed back its real-time status to the control module; The control module sends an indication signal based on the real-time status. The drive chip controls the drive motor to reverse according to the indication signal, so as to change the cleaning direction of the cleaning mechanical structure.
7. The method according to claim 1 or 6, characterized in that, The method further includes: Obtain the cleaning time of the cleaning mechanical structure; In response to the cleaning time reaching the preset cleaning duration, the control module issues a cleaning end instruction to stop driving the cleaning mechanical structure to perform cleaning.
8. A self-cleaning system for a camera, characterized in that, The system includes: The system includes a control module, a drive chip, a drive motor, and a cleaning mechanism; the control module is connected to the camera, the drive chip is connected to both the control module and the drive motor, and the cleaning mechanism is fixed to the drive motor. The control module is used to receive images captured by the camera, perform multi-dimensional quality assessment on the captured images to obtain an image quality score, and issue a cleaning control signal based on the image quality score. The drive chip is used to receive the cleaning control signal and convert it into a drive signal to send to the drive motor; The drive motor is used to drive the cleaning mechanical structure to perform cleaning based on the drive signal.
9. The system according to claim 8, characterized in that, The system also includes at least two limit switches, which are respectively installed at both ends of the camera glass to be cleaned and connected to the control module; In response to the cleaning mechanical structure touching any of the limit switches, the limit switches change their state and feed back the real-time status to the control module. The control module receives the real-time status of the limit switch and sends an indication signal to the drive chip; The drive chip controls the drive motor to reverse according to the indication signal, so as to change the cleaning direction of the cleaning mechanical structure.
10. The system according to claim 8 or 9, characterized in that, The system further includes a timing module, which is connected to the control module; In response to the drive motor driving the cleaning mechanical structure to perform cleaning based on the drive signal, the timing module starts timing the cleaning duration; In response to the cleaning time reaching the preset cleaning time, the timing module sends an end command to the control module; The control module sends a cleaning end indication to the driver chip based on the end command to stop driving the cleaning mechanical structure to perform cleaning.