Windshield crack detection method

By setting the detection cycle according to the vehicle status, obtaining windshield images for identification and detection, the problem of easy omission in manual detection in the prior art is solved, and accurate identification of windshield cracks and alarm prompts are realized, and driving safety is improved.

CN120219703APending Publication Date: 2025-06-27FORYOU GENERAL ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510198175.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-22
Publication Date
2025-06-27

Smart Images

  • Figure CN120219703A_ABST
    Figure CN120219703A_ABST
Patent Text Reader

Abstract

The invention provides a windshield crack detection method. The method comprises the following steps: step 1, setting a corresponding detection period according to a vehicle state; step 2, acquiring the current state of the vehicle, and acquiring a preset number of current images of the windshield of the vehicle according to the corresponding detection period; 3, identifying the current image, and detecting whether the vehicle windshield has cracks or not; and step 4, if the current image has the crack, giving an alarm prompt according to a preset rule. According to the invention, accurate identification of the windshield crack is realized, and the driving safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of assisted driving, and particularly to a method for detecting windshield cracks. Background Art

[0002] With the popularization of automobiles, vehicles have become a means of transportation for people to travel, greatly expanding the scope of people's activities. As is well known, the windshield is an important part of a vehicle, playing a role in protecting the driver and passengers. However, the windshield may develop cracks due to inevitable factors such as external impact and aging. In particular, cracks located at the edges are not easily noticed by the driver, thus leaving potential safety hazards.

[0003] Currently, the method for detecting windshield cracks is mainly through visual inspection by the naked eye. This manual method requires the driver to frequently observe the windshield, so it is easy to miss. Therefore, there is an urgent need for an automatic, intelligent, efficient, and reliable windshield crack detection solution to save the driver's time and energy. Summary of the Invention

[0004] The present invention provides a method for detecting windshield cracks, aiming to solve the defects in the prior art, achieve accurate identification of windshield cracks, and improve driving safety.

[0005] To achieve the above object, the technical solution adopted by the present invention is as follows:

[0006] The present invention provides a method for detecting windshield cracks, including:

[0007] Step 1: Set a corresponding detection period according to the vehicle state;

[0008] Step 2: Obtain the current state of the vehicle, and obtain a preset number of current images of the vehicle windshield according to the corresponding detection period;

[0009] Step 3: Identify the current image to detect whether there are cracks in the vehicle windshield;

[0010] Step 4: If there are cracks in the current image, give an alarm prompt according to a preset rule.

[0011] Specifically, the Step 3 includes:

[0012] Step 301: Read the current image, select the ROI region, and perform grayscale conversion to generate a first image;

[0013] Step 302: Determine the decision parameter according to the first image;

[0014] Step 303: Process the first image according to the decision parameter to generate a second image;

[0015] Step 304: Determine the double thresholds of the Canny operator according to the second image;

[0016] Step 305: Perform edge detection on the second image through the Canny operator with the set double thresholds to generate a third image;

[0017] Step 306: Perform morphological processing on the third image to generate a final image;

[0018] Step 307: Determine whether the connected region parameters in the final image meet the preset crack feature parameters. If so, it is determined that there is a crack; otherwise, it is determined that there is no crack.

[0019] Specifically, the step 302 includes:

[0020] Step 3021: Obtain the histogram corresponding to the first image and obtain the peak gray level in the histogram;

[0021] Step 3022: Determine the decision parameter according to the peak gray level through a first preset formula.

[0022] Specifically, the first preset formula is:

[0023]

[0024] Among them, J represents the decision coefficient, and B represents the peak gray level.

[0025] Specifically, the step 303 includes: Traverse the first image. If the gray value of the current pixel does not exceed the decision coefficient, set the gray value of the current pixel to 0; otherwise, calculate the gray value of the current pixel according to a second preset formula, and perform Gaussian filtering on the processed image to generate a second image.

[0026] Specifically, the second preset formula is:

[0027] g(i, j) = 40 * log(f(i, j) - J)

[0028] Among them, g(i, j) is the processed gray value, f(i, j) is the current gray value, log() is the logarithmic operation, and J is the decision parameter.

[0029] Specifically, the step 304 includes:

[0030] Step 3041: Calculate the gradient and amplitude of the second image, perform non-maximum suppression, and obtain the global threshold through the ostu algorithm;

[0031] Step 3042: Calculate the gray mean and variance of the second image, and the proportion of pixels with gray values lower than the global threshold;

[0032] Step 3043: Determine a first threshold according to the global threshold and the pixel ratio through a third preset formula;

[0033] Step 3044: Determine a preset multiple of the first threshold as the second threshold.

[0034] Specifically, the third preset formula is:

[0035] T low = α(T + σ s )

[0036] where T low represents the first threshold, T represents the global threshold, α represents the pixel ratio, and σ s represents the gray variance of the second image.

[0037] Specifically, the preset multiple is 2 to 3 times.

[0038] Specifically, the preset rules include:

[0039] If the width or length of the crack is greater than a preset value, a warning is given through a warning light and a warning sound. If the current vehicle state is the driving mode, the driver is further reminded to reduce speed, turn on the hazard lights, and pull over to the side of the road;

[0040] If the width and length of the crack do not exceed the preset value, a warning is given through a warning light.

[0041] The beneficial effects of the present invention are as follows: The present invention sets different detection periods according to different vehicle states, obtains a preset number of current images of the vehicle windshield at the corresponding period according to the current vehicle state, and then identifies the current windshield image to detect whether there is a crack in the windshield. When a crack exists, a warning is given, thereby realizing accurate identification of windshield cracks and improving driving safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a flowchart of the windshield crack detection method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0043] The following specifically illustrates the embodiments of the present invention in conjunction with the drawings. The drawings are only for reference and illustration, and do not constitute a limitation on the protection scope of the present invention patent.

[0044] In the process described in the specification, claims or drawings of the present invention, sequence numbers of each step are included (such as step 10, 20, etc.). The sequence numbers are only used to distinguish each step, and the sequence numbers themselves do not represent any execution order. It should be noted that descriptions such as "first" and "second" in this article are only used to distinguish the described objects, etc., do not represent the sequence, and do not indicate that "first", "second", etc. are different types.

[0045] As Figure 1 shown, this embodiment provides a windshield crack detection method, including:

[0046] Step 1: Set a corresponding detection period according to the vehicle state.

[0047] In this embodiment, the vehicle state includes a start mode and a driving mode.

[0048] The start mode refers to the vehicle being ignited and started from the off state, and its corresponding detection period can be set to perform a detection each time it is started.

[0049] The driving mode refers to the state where the vehicle speed is not 0, and its corresponding detection period can be set to detect once every 1 hour. However, if an external impact is detected, a detection is immediately performed.

[0050] Step 2: Obtain the current state of the vehicle, and obtain a preset number of current images of the vehicle windshield according to the corresponding detection period.

[0051] In specific implementation, the vehicle state can be judged by reading relevant ECU data through a vehicle bus (such as CAN bus, LIN bus, etc.).

[0052] It is easy to understand that before implementing this step, an image sensor device (such as a camera) needs to be installed in the vehicle, or the camera on the existing driving recorder in the vehicle can also be used. In either case, the camera for collecting windshield images must be able to capture the entire area of the windshield.

[0053] The preset number can be set according to the actual situation, for example, 10 frames.

[0054] Step 3: Identify the current image to detect whether there is a crack in the vehicle windshield.

[0055] In this embodiment, step 3 includes:

[0056] Step 301: Read the current image, select the ROI area, and perform grayscale conversion to generate a first image.

[0057] Since the image area captured by the camera is relatively large, only the image of the windshield area needs to be selected for recognition, thus saving computing resources and improving real-time performance.

[0058] Step 302: Determine the decision parameter J according to the first image.

[0059] In this embodiment, step 302 includes:

[0060] Step 3021: Obtain the histogram corresponding to the first image, and obtain the peak gray level B in the histogram.

[0061] Step 3022: Determine the decision parameter J according to the peak gray level B through a first preset formula.

[0062] In this embodiment, the first preset formula is:

[0063]

[0064] where J represents the decision coefficient and B represents the peak gray level.

[0065] Step 303: Process the first image according to the decision parameter J to generate a second image.

[0066] In this embodiment, step 303 includes: Traverse the first image. If the gray level value f(i, j) of the current pixel does not exceed the decision coefficient J, set the gray level value g(i, j) of the current pixel to 0. Otherwise, calculate the gray level value g(i, j) of the current pixel according to a second preset formula, and perform Gaussian filtering on the processed image to generate a second image.

[0067] In this embodiment, the second preset formula is:

[0068] g(i,j) = 40 * log(f(i,j) - J)

[0069] where g(i, j) is the processed gray level value, f(i, j) is the current gray level value, log() is the logarithmic operation, and J is the decision parameter.

[0070] Step 304: Determine the double thresholds of the Canny operator according to the second image.

[0071] In this embodiment, step 304 includes:

[0072] Step 3041: Calculate the gradient and amplitude of the second image, perform non-maximum suppression, and obtain the global threshold T through the ostu algorithm.

[0073] Step 3042: Calculate the gray level mean and variance σ of the second image s, and the pixel ratio α of pixels with gray values lower than the global threshold T.

[0074] In this embodiment, the pixel ratio α = N g / N0, where N g represents the number of pixels with gray values lower than the global threshold T, and N0 represents the total number of pixels in the second image.

[0075] Step 3043: Determine the first threshold T according to the global threshold T and the pixel ratio α through a third preset formula low .

[0076] In this embodiment, the third preset formula is:

[0077] T low = α(T + σ s )

[0078] where, T low represents the first threshold, T represents the global threshold, α represents the pixel ratio, and σ s represents the gray variance of the second image.

[0079] Step 3044: Determine a preset multiple of the first threshold T low as the second threshold T high .

[0080] In this embodiment, the preset multiple is 2 to 3 times.

[0081] Step 305: Perform edge detection on the second image through a Canny operator with double thresholds set to generate a third image.

[0082] Step 306: Perform morphological processing on the third image to generate a final image.

[0083] Step 307: Determine whether the connected region parameters in the final image conform to preset crack characteristic parameters. If so, it is determined that there is a crack; otherwise, it is determined that there is no crack.

[0084] Step 4: If there is a crack in the current image, give an alarm prompt according to a preset rule.

[0085] In this embodiment, the preset rule includes:

[0086] If the width or length of the crack is greater than a preset value, give a prompt through an alarm light and an alarm sound. If the current vehicle state is in the driving mode, further remind the driver to reduce speed, turn on the hazard lights, and pull over to the side of the road;

[0087] If the width and length of the crack do not exceed the preset value, give a prompt through an alarm light.

[0088] The above-disclosed are only the preferred embodiments of the present invention, and thus cannot be used to limit the scope of the patent protection of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention still fall within the scope covered by the present invention.

Claims

1. A windshield crack detection method, characterized in that: include: Step 1: Set the corresponding detection cycle according to the vehicle status; Step 2: obtaining the current state of the vehicle, and obtaining a preset number of current images of the vehicle windshield according to a corresponding detection cycle; Step 3, identifying the current image to detect whether there is a crack on the vehicle windshield; Step 4: If there are cracks in the current image, an alarm is issued according to a preset rule.

2. The windshield crack detection method according to claim 1, characterized in that: The step 3 comprises: Step 301, read the current image, select the ROI area, and grayscale it to generate a first image; Step 302: determining a decision parameter according to the first image; Step 303: Process the first image according to the decision parameter to generate a second image; Step 304: Determine a double threshold of the Canny operator according to the second image; Step 305: Perform edge detection on the second image by setting the dual-threshold Canny operator to generate a third image; Step 306: Perform morphological processing on the third image to generate a final image; Step 307: determine whether the connected area parameters in the final image meet the preset crack characteristic parameters, if yes, determine that a crack exists, otherwise, determine that a crack does not exist.

3. The windshield crack detection method according to claim 2, characterized in that: The step 302 includes: Step 3021: Obtain a histogram corresponding to the first image, and obtain a peak grayscale in the histogram; Step 3022: Determine a decision parameter using a first preset formula according to the peak grayscale.

4. The windshield crack detection method according to claim 3, characterized in that: The first preset formula is: Among them, J represents the determination coefficient and B represents the peak grayscale.

5. The windshield crack detection method according to claim 4, characterized in that: The step 303 includes: traversing the first image, if the grayscale value of the current pixel does not exceed the decision coefficient, setting the grayscale value of the current pixel to 0, otherwise calculating the grayscale value of the current pixel according to a second preset formula, and performing Gaussian filtering on the processed image to generate a second image.

6. The windshield crack detection method according to claim 5, characterized in that: The second preset formula is: g(i,j)=40*log(f(i,j)-J) Among them, g(i,j) is the processed grayscale value, f(i,j) is the current grayscale value, log() is the logarithmic operation, and J is the decision parameter.

7. The windshield crack detection method according to claim 6, characterized in that: The step 304 includes: Step 3041, calculating the gradient and amplitude of the second image, performing non-maximum suppression, and obtaining a global threshold through the OSTU algorithm; Step 3042: Calculate the grayscale mean and variance of the second image, and the proportion of pixels whose grayscale values ​​are lower than the global threshold; Step 3043: determining a first threshold value by using a third preset formula according to the global threshold value and the pixel ratio; Step 3044: determine a preset multiple of the first threshold as the second threshold.

8. The windshield crack detection method according to claim 7, characterized in that: The third preset formula is: T low =α(T+σ s ) Among them, T low represents the first threshold, T represents the global threshold, α represents the pixel ratio, σ s represents the grayscale variance of the second image.

9. The windshield crack detection method according to claim 8, characterized in that: The preset multiple is 2 to 3 times.

10. The windshield crack detection method according to claim 1, characterized in that: The preset rules include: If the width or length of the crack is greater than a preset value, the system will warn you with a warning light or sound. If the vehicle is in driving mode, the system will remind the driver to slow down, turn on the hazard lights, or pull over. If the width and length of the crack do not exceed the preset value, an alarm light will be used to prompt.