Automobile rearview mirror image enhancement processing method and device and storage medium

By obtaining the segmentation threshold and width threshold of the historical raindrop grayscale map, identifying and optimizing the raindrop area in the real-time rear view, and adjusting the clarity using the search matrix, the problem of unused raindrop shape characteristics in the prior art is solved, improving the image enhancement effect of rainy days and improving driving safety.

CN120235767AActive Publication Date: 2025-07-01TIANJIN SMR HUAXIANG AUTOMOTIVE PARTS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510728307.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-07-01
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

The existing car rearview mirror image enhancement technology fails to enhance image based on the shape characteristics of the raindrops themselves during rainy days, resulting in poor image enhancement effect.

Method used

By obtaining the first and second segmentation thresholds of the historical raindrop grayscale map, combining the historical width threshold, identifying and optimizing the raindrop area in the real-time rear view, and adjusting the clarity of the raindrop part using the search matrix.

Benefits of technology

It improves the recognition and clarity of the raindrop part, improves the image enhancement effect in rainy scenes, and enhances driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235767A_ABST
    Figure CN120235767A_ABST
Patent Text Reader

Abstract

The invention discloses an automobile rearview mirror image enhancement processing method and device and a storage medium, and relates to the technical field of automobile rearview mirror image enhancement, and the method comprises the following steps: obtaining a first segmentation threshold value and a second segmentation threshold value based on a historical raindrop gray-scale map; obtaining a historical width threshold value based on the historical raindrop grey-scale map, the first segmentation threshold value and the second segmentation threshold value; acquiring a real-time automobile rear view, and marking the real-time automobile rear view as a real-time rear view; performing graying processing on the real-time rear view to obtain a real-time rear view grey-scale map; obtaining an optimized region based on the real-time rearview grey-scale map, the first segmentation threshold, the second segmentation threshold and the historical width threshold; performing definition optimization on the optimization area in the real-time rear view to obtain an optimized rear view; the method is used for solving the problem that an existing automobile rearview image enhancement technology cannot perform image enhancement based on the shape features of raindrops, so that the image enhancement effect is poor in a rainy scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automotive rearview image enhancement, and particularly to a method, device, and storage medium for enhancing the image of an automotive rearview mirror. Background Technique

[0002] With the continuous development of intelligent driving, the safety and intelligence of automobiles have been continuously improved. For example, traditional rearview mirrors have blind spots in the field of vision. Therefore, the images captured by the camera are projected onto the rearview mirror to effectively eliminate the blind spots in the field of vision and provide a wider field of vision; However, in rainy days, the raindrops on the rearview mirror image cause the image to be blurred, reducing driving safety. Therefore, the raindrop part can be recognized. However, in the existing raindrop recognition, it fails to recognize based on the shape characteristics of the raindrops themselves, resulting in low recognition accuracy. At the same time, the existing method for improving clarity adjusts the clarity of the raindrop part through a square matrix, and this square matrix fails to combine the raindrop shape for clarity adjustment, resulting in poor clarity adjustment. For example, in the patent application with the publication number CN118644568A, a method, device, vehicle-mounted device, and readable storage medium for generating a rearview mirror image are disclosed. This solution fails to perform image enhancement based on the shape characteristics of raindrops themselves in rainy days, resulting in poor imaging effects. The existing automotive rearview image enhancement technology fails to perform image enhancement based on the shape characteristics of raindrops themselves, resulting in poor image enhancement effects in rainy scenarios. Summary of the Invention

[0003] The present invention aims to solve at least one of the technical problems in the prior art to some extent. By obtaining a first segmentation threshold and a second segmentation threshold based on a historical raindrop grayscale image; obtaining a historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold; obtaining a real-time rear view of the vehicle, marked as the real-time rear view; performing grayscale processing on the real-time rear view to obtain a real-time rearview grayscale image; obtaining an optimized area based on the real-time rearview grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; and optimizing the clarity of the optimized area in the real-time rear view to obtain an optimized rear view; to solve the problem that the existing automotive rearview image enhancement technology fails to perform image enhancement based on the shape characteristics of raindrops themselves, resulting in poor image enhancement effects in rainy scenarios.

[0004] To achieve the above object, the present application provides a method for enhancing the image of an automotive rearview mirror, including the following steps: Obtain images of the first number of raindrop parts in the rear view of the vehicle, marked as the historical raindrop image; Perform grayscale processing on the historical raindrop image to obtain a historical raindrop grayscale image; Obtain a first segmentation threshold and a second segmentation threshold based on the historical raindrop grayscale image; Obtain the historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold; Obtain the real-time rear view of the vehicle and mark it as the real-time rear view; Perform grayscale processing on the real-time rear view to obtain the real-time rear view grayscale image; obtain the optimized area based on the real-time rear view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; Optimize the clarity of the optimized area in the real-time rear view to obtain the optimized rear view; Perform geometric transformation and visual adjustment on the optimized rear view and then display it.

[0005] Furthermore, performing grayscale processing on the historical raindrop image to obtain the historical raindrop grayscale image includes the following sub-steps: Obtain the RGB values of each pixel point in the historical raindrop grayscale image and mark them as the historical raindrop RGB values; Use the grayscale conversion formula to convert all the historical raindrop RGB values in the historical raindrop grayscale image into grayscale values to obtain the historical raindrop grayscale image.

[0006] Furthermore, obtaining the first segmentation threshold and the second segmentation threshold based on the historical raindrop grayscale image includes the following sub-steps: Mark the grayscale value of each pixel point in the historical raindrop grayscale image as the historical raindrop grayscale value; Sort the historical raindrop grayscale values from smallest to largest and mark them as Yd1 to Yd i ; Obtain the number of historical raindrop grayscale values and mark it as the historical raindrop gray degree number; Calculate the first quantity ratio as: B1 = o1 * Sh, where B1 is the first quantity ratio, o1 is the first quantity coefficient, and the range of o1 is: (0, 0.5), and Sh is the historical raindrop gray degree number; If the first quantity ratio is an integer, mark Yd (B1) as the first position value; if the first quantity ratio is not an integer, obtain the integers on both sides of B1, marked as B1z and B1y respectively, and calculate the average value of Yd (B1z) and Yd (B1y) and mark it as the first position value; Calculate the second quantity coefficient as: o2 = [(1 / o1) - 1] * o1; where o2 is the second quantity coefficient; Calculate the second quantity ratio as: B2 = o2 * Sh, where B2 is the second quantity ratio; If the second quantity ratio is an integer, mark Yd (B2) as the second position value; if the second quantity ratio is not an integer, obtain the integers on both sides of B2, marked as B2z and B2y respectively, and calculate the average value of Yd (B2z) and Yd (B2y)The mean value is marked as the second position value; If 0.5 * B1 is an integer, mark Yd (0.5*B1) as Dj; if 0.5 * B1 is not an integer, obtain the integers on the left and right sides of 0.5 * B1, mark them as Bzz and Bzy respectively, and calculate the mean value of Yd (Bzz) and Yd (Bzy) The mean value is marked as Dj.

[0007] Further, obtaining the first segmentation threshold and the second segmentation threshold based on the historical raindrop grayscale image further includes the following sub-steps: Calculate the first segmentation threshold as: F1 = Dj - (Dj - W1) / [(0.5 - o1) / 0.5]; where F1 is the first segmentation threshold; W1 is the first position value; Calculate the second segmentation threshold as: F2 = Dj + (W2 - Dj) / [(o2 - 0.5) / 0.5]; where F2 is the second segmentation threshold; W2 is the second position value.

[0008] Further, obtaining the historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold includes the following sub-steps: Set the historical raindrop grayscale values in the historical raindrop grayscale image that are greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold to 0, and set the historical raindrop grayscale values that are less than the first segmentation threshold or greater than the second segmentation threshold to 255 to obtain a historical raindrop binary image; Mark the area where the grayscale value of the pixel points in the historical raindrop binary image is 0 as the raindrop area; Establish a rectangular coordinate system, marked as the historical interval coordinate system; place the raindrop area in the first quadrant of the historical interval coordinate system; Obtain the coordinates of a pixel point with the smallest abscissa in the raindrop area, marked as the historical reference point, draw a straight line parallel to the Y-axis through the historical reference point, marked as the first straight line; rotate the first straight line 180° with the historical reference point as the rotation center, and obtain the farthest distance from a point in the raindrop area to the first straight line during the rotation process, marked as the historical rotation distance, and obtain the minimum value of the historical rotation distance, marked as the historical width; Obtain the historical width of all raindrop areas; Obtain the maximum value of the historical width, marked as the historical threshold width.

[0009] Further, obtaining the optimized area based on the real-time rear-view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold includes the following sub-steps: Set the historical raindrop gray values in the real-time rear-view gray image that are greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold to 0, and set the historical raindrop gray values in the historical raindrop gray image that are less than the first segmentation threshold or greater than the second segmentation threshold to 255 to obtain the real-time rear-view binary image; Mark the area where the gray value of the pixel points in the real-time rear-view binary image is 0 as the initial area; Establish a rectangular coordinate system and mark it as the real-time interval coordinate system; place the real-time rear-view binary image in the first quadrant of the real-time interval coordinate system, and at the same time ensure that the two sides of the real-time rear-view binary image coincide with the horizontal axis and the vertical axis of the real-time interval coordinate system respectively; Obtain the coordinates of a pixel point with the smallest abscissa in the initial area and mark it as the real-time reference point. Draw a straight line parallel to the Y-axis through the real-time reference point and mark it as the second straight line; rotate the second straight line 180° with the real-time reference point as the rotation center, and obtain the farthest distance from a point in the initial area to the second straight line during the rotation process and mark it as the real-time rotation distance. Obtain the minimum value of the real-time rotation distance and mark it as the real-time width; Judge whether the real-time width is less than or equal to the historical width threshold. If so, mark the initial area as the final area; obtain the contour coordinates of the final area.

[0010] Furthermore, obtaining the optimized area based on the real-time rear-view gray image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold further includes the following sub-steps: Establish a rectangular coordinate system and mark it as the optimization coordinate system; place the real-time rear-view image in the first quadrant of the optimization coordinate system, and at the same time ensure that the two sides of the real-time rear-view image coincide with the horizontal axis and the vertical axis of the optimization coordinate system respectively; Based on the contour coordinates of the final area, obtain the position of the final area in the real-time rear-view image in the optimization coordinate system, and mark the final area in the real-time rear-view image as the optimized area.

[0011] Furthermore, optimizing the clarity of the optimized area in the real-time rear-view image to obtain the real-time rear-view image includes the following sub-steps: Mark the pixel points in the optimized area as optimized area pixel points; Mark the pixel points on the contour of the optimized area as optimized contour pixel points; Establish a 3*3 pixel matrix centered on each optimized contour pixel point and mark it as the search matrix; obtain the pixel points in the search matrix that are not optimized contour pixel points and mark them as the first search pixel points. Establish a new search matrix centered on each first search pixel point and obtain the pixel points in the new search matrix that are not optimized area pixel points and the first search pixel points and mark them as the second search pixel points; Calculate the average value of the RGB values of all the first search pixel points and the second search pixel points and mark it as the search RGB average; Set the RGB value of each pixel in the optimized area of the real-time rear view to the corresponding searched RGB average value to obtain the optimized view.

[0012] This application provides an electronic device, including a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the above method are run.

[0013] This application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are run.

[0014] Advantages of the present invention: The present invention obtains a first segmentation threshold and a second segmentation threshold based on a historical raindrop grayscale image; obtains a historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold; obtains a real-time rear view of a vehicle, marked as the real-time rear view; performs grayscale processing on the real-time rear view to obtain a real-time rear view grayscale image; obtains an optimized area based on the real-time rear view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; performs clarity optimization on the optimized area in the real-time rear view to obtain an optimized view. The advantage is that, based on the recognition of the shape characteristics of raindrops themselves, the recognition degree of the raindrop part is improved, which is convenient for subsequent processing of the correct raindrop part; The present invention builds a search matrix. The advantage is that, through the search matrix, adjustment can be made based on the raindrop shape, and the accuracy and clarity of the image are improved compared with using a square matrix for adjustment. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flowchart of the steps of the method of the present invention; Figure 2 is a schematic diagram of the historical rotation distance of the present invention; Figure 3 is a schematic diagram of the historical width of the present invention; Figure 4 is a schematic diagram of the search matrix of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0016] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0017] Embodiment 1, please refer to Figure 1 As shown, this application provides a method for enhancing the image of an automotive rearview mirror, including the following steps: Step S1, obtain images of the first number of raindrop parts in the rear view of the vehicle, marked as historical raindrop images; the first number is set to 10, and 10 historical raindrop images are obtained for extracting the features of raindrops in the rear view of the vehicle. Step S2, perform grayscale processing on the historical raindrop images to obtain historical raindrop grayscale images; Step S2 includes the following sub-steps: Step S201, obtain the RGB values of each pixel point in the historical raindrop grayscale image, marked as historical raindrop RGB values; Step S202, use the grayscale conversion formula to convert all historical raindrop RGB values in the historical raindrop grayscale image into grayscale values to obtain the historical raindrop grayscale image; In practical applications, the average grayscale conversion formula is: C = (R + G + B) / 3, where C is the grayscale value, and R, G, and B are the three channel values of the historical raindrop RGB values. For example, if the R, G, and B of a historical raindrop RGB value are 245, 235, and 234, then the grayscale value is: c = (245 + 235 + 234) / 3 = 238, and the calculation result is rounded to an integer.

[0018] Step S3, obtain the first segmentation threshold and the second segmentation threshold based on the historical raindrop grayscale image; Step S3 includes the following sub-steps: Step S301, mark the grayscale value of each pixel point in the historical raindrop grayscale image as the historical raindrop grayscale value; Step S302, sort the historical raindrop grayscale values from smallest to largest and mark them as Yd1 to Yd i ; Step S303, obtain the number of historical raindrop grayscale values, marked as the number of historical raindrop grayscales; Step S304, calculate the first quantity ratio: B1 = o1 * Sh, where B1 is the first quantity ratio, o1 is the first quantity coefficient, and the range of o1 is: (0, 0.5), and Sh is the number of historical raindrop grayscales; the first position value selects the value distributed in the smaller half area. Therefore, o1 is set in the range of 0 to 0.5, and a middle value can be selected, which can ensure that the selected first position value has the representativeness of the smaller half area of the numerical values, preferably 0.25; Step S305, if the first quantity ratio is an integer, mark Yd (B1) as the first position value; if the first quantity ratio is not an integer, obtain the integers on both sides of B1, marked as B1z and B1y respectively, and calculate the mean value of Yd (B1z) and Yd (B1y) and mark it as the first position value; Step S306, calculate the second quantity coefficient as: o2 = [(1 / o1) - 1] * o1; where o2 is the second quantity coefficient; o2 is the symmetric value of o1 with 0.5 as the symmetry point; when o1 is 0.25, o2 is 0.75; Step S307, calculate the second quantity ratio as: B2 = o2 * Sh, where B2 is the second quantity ratio; Step S308, if the second quantity ratio is an integer, mark Yd (B2) as the second position value; if the second quantity ratio is not an integer, obtain the integers on both sides of B2, mark them as B2z and B2y respectively, and calculate the mean value of Yd (B2z) and Yd (B2y) and mark it as the second position value; Step S309, if 0.5 * B1 is an integer, mark Yd (0.5*B1) as Dj; if 0.5 * B1 is not an integer, obtain the integers on both sides of 0.5 * B1, mark them as Bzz and Bzy respectively, and calculate the mean value of Yd (Bzz) and Yd (Bzy) and mark it as Dj; Step S310, calculate the first segmentation threshold as: F1 = Dj - (Dj - W1) / [(0.5 - o1) / 0.5]; where F1 is the first segmentation threshold; W1 is the first position value; Step S311, calculate the second segmentation threshold as: F2 = Dj + (W2 - Dj) / [(o2 - 0.5) / 0.5]; where F2 is the second segmentation threshold; W2 is the second position value. Because the raindrops have higher average brightness due to the reflection and refraction of daytime light and vehicle lights, the historical raindrop gray values can be regarded as uniformly distributed within a certain range. Based on the first position value, the first position value, and Dj, the minimum and maximum values of the historical raindrop gray values in the ideal uniform situation can be calculated. Based on the minimum and maximum values, abnormal historical raindrop gray values with larger or smaller areas can be screened out, improving the accuracy of obtaining the range of raindrop gray values; In practical applications, for example, when the historical raindrop gray degree is 10000, o1 is 0.25, o1 is 0.75, calculate the first quantity ratio as: B1 = o1 * Sh = 0.25 * 10000 = 2500. If 2500 is an integer, mark the specific value 212 corresponding to Yd (2500) as the first position value, calculate the second quantity ratio as: B2 = o2 * Sh = 0.75 * 10000 = 7500. Since 7500 is an integer, mark the specific value 237 corresponding to Yd (2500) as the second position value. Because 0.5 * B1 = 0.5 * 10000 = 5000 is an integer, mark Yd (5000)The corresponding specific value 224 is marked as Dj. The first segmentation threshold is obtained as: F1 = 224 - (224 - 212) / [(0.5 - 0.25) / 0.5] = 200. The second segmentation threshold is obtained as: F2 = 224 + (237 - 224) / [(0.75 - 0.5) / 0.5] = 250.

[0019] Step S4: Obtain the historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold. Step S4 includes the following sub-steps: Step S401: Set the historical raindrop grayscale values greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold in the historical raindrop grayscale image to 0, and set the historical raindrop grayscale values less than the first segmentation threshold or greater than the second segmentation threshold to 255 to obtain the historical raindrop binary image. Step S402: Mark the area with the grayscale value of 0 of the pixel points in the historical raindrop binary image as the raindrop area. Step S403: Establish a rectangular coordinate system, marked as the historical interval coordinate system; place the raindrop area in the first quadrant of the historical interval coordinate system. Step S404: Obtain the coordinates of a pixel point with the smallest abscissa in the raindrop area, marked as the historical reference point, draw a straight line parallel to the Y-axis through the historical reference point, marked as the first straight line; rotate the first straight line 180° with the historical reference point as the rotation center, and obtain the maximum distance from a point in the raindrop area to the first straight line during the rotation process, marked as the historical rotation distance, obtain the minimum value of the historical rotation distance, marked as the historical width; when obtaining the image, the raindrop is in motion, so the obtained raindrop is usually circular or long strip-shaped. When it is in the long strip shape, the length distribution range of the raindrop is large, while the width of the raindrop is within a certain range. Therefore, the historical width is used to determine whether it is a raindrop. Step S405: Obtain the historical width of all raindrop areas. Step S406: Obtain the maximum value of the historical width, marked as the historical threshold width. In practical applications, set the historical raindrop grayscale values greater than or equal to 200 and less than or equal to 250 in the historical raindrop grayscale image to 0, and set the historical raindrop grayscale values less than the first segmentation threshold or greater than the second segmentation threshold to 255 to obtain the historical raindrop binary image. Please refer to Figure 2 And Figure 3 As shown, a historical width is 1.5 mm. If the maximum value of all historical widths is 6 mm, then the historical threshold width is 6 mm.

[0020] Step S5: Obtain the real-time rear view of the vehicle, marked as the real-time rear view.

[0021] Step S6, perform grayscale processing on the real-time rear view to obtain a real-time rear-view grayscale image; obtain an optimized area based on the real-time rear-view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; Step S6 includes the following sub-steps: Step S601, set the historical raindrop grayscale values that are greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold in the real-time rear-view grayscale image to 0, and set the historical raindrop grayscale values that are less than the first segmentation threshold or greater than the second segmentation threshold in the historical raindrop grayscale image to 255 to obtain a real-time rear-view binary image; Step S602, mark the area where the grayscale value of the pixel points in the real-time rear-view binary image is 0 as the initial area; Step S603, establish a rectangular coordinate system, marked as the real-time interval coordinate system; place the real-time rear-view binary image in the first quadrant of the real-time interval coordinate system, and at the same time ensure that the two sides of the real-time rear-view binary image coincide with the horizontal axis and the vertical axis of the real-time interval coordinate system respectively; Step S604, obtain the coordinates of a pixel point with the smallest abscissa in the initial area, marked as the real-time reference point, draw a straight line parallel to the Y-axis through the real-time reference point, marked as the second straight line; rotate the second straight line 180° with the real-time reference point as the rotation center, and obtain the farthest distance from a point in the initial area to the second straight line during the rotation process, marked as the real-time rotation distance, and obtain the minimum value of the real-time rotation distance, marked as the real-time width; Step S605, determine whether the real-time width is less than or equal to the historical width threshold. If so, mark the initial area as the final area; obtain the contour coordinates of the final area.

[0022] Step S606, establish a rectangular coordinate system, marked as the optimization coordinate system; place the real-time rear view in the first quadrant of the optimization coordinate system, and at the same time ensure that the two sides of the real-time rear view coincide with the horizontal axis and the vertical axis of the optimization coordinate system respectively; the real-time rear view and the real-time rear-view binary image have the same size in order to share the position information of the two images, the coordinates of the optimization coordinate system and the real-time interval coordinate system are the same, and they are placed in the same way at the same time; Step S607, obtain the position of the final area in the real-time rear view in the optimization coordinate system based on the contour coordinates of the final area, and mark the final area in the real-time rear view as the optimized area; In practical applications, when the real-time width is 3mm, 3mm is less than the historical width threshold of 6mm, and the initial area is marked as the final area, because it can be determined that the part with a larger real-time width is not a raindrop and does not need to be optimized.

[0023] Step S7, perform clarity optimization on the optimized area in the real-time rear view to obtain an optimized rear view; Step S7 includes the following sub-steps: Step S701: Mark the pixel points within the optimization region as optimization region pixel points; Step S702: Mark the pixel points on the contour of the optimization region as optimization contour pixel points; Step S703: Establish a 3*3 pixel matrix centered on each optimization contour pixel point, marked as the search matrix; Obtain the pixel points in the search matrix that are not optimization contour pixel points, marked as the first search pixel points. Establish a new search matrix centered on each first search pixel point, and obtain the pixel points in the new search matrix that are neither optimization region pixel points nor first search pixel points, marked as the second search pixel points; This method can obtain the surrounding pixel points of the optimization region, and all the first search pixel points form a circle of pixel points spreading outward from the optimization region; Step S704: Calculate the average value of the RGB values of all the first search pixel points and the second search pixel points, marked as the search RGB average value; Step S705: Set the RGB value of each optimization region pixel point in the real-time rear view to the corresponding search RGB average value to obtain the optimized view; In practical applications, please participate Figure 4 As shown, the search RGB average value is to calculate the R value, G value, and B value respectively. For example, the three RGB values of the first search pixel point and the second search pixel point are: (120, 130, 123), (123, 131, 124), and (125, 132, 125). Calculate 120 + 123 + 125 ≈ 123; 130 + 131 + 132 = 131, calculate 123 + 124 + 125 = 124. Keep the calculation result as an integer, then the search RGB average value is (123, 131, 124), and set the RGB value of the corresponding optimization region pixel points to (123, 131, 124).

[0024] Step S8: Perform geometric transformation and visual adjustment on the optimized view and then display it; After the transformation, make the optimized view consistent with the imaging of the rearview mirror for visual viewing.

[0025] Embodiment 2. The present application further provides an electronic device, which may include: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus. The memory stores computer-readable instructions, and the processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, the steps in a method for image enhancement processing of a vehicle rearview mirror are run to achieve the following functions: obtaining images of a first number of raindrop parts in the vehicle rearview, and marking them as historical raindrop images; performing grayscale processing on the historical raindrop images to obtain historical raindrop grayscale images; obtaining a first segmentation threshold and a second segmentation threshold based on the historical raindrop grayscale images; obtaining a historical width threshold based on the historical raindrop grayscale images, the first segmentation threshold, and the second segmentation threshold; obtaining a real-time vehicle rearview, and marking it as a real-time rearview; performing grayscale processing on the real-time rearview to obtain a real-time rearview grayscale image; obtaining an optimized area based on the real-time rearview grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; performing sharpness optimization on the optimized area in the real-time rearview to obtain an optimized rearview; performing geometric transformation and visual adjustment on the optimized rearview and then displaying it.

[0026] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical disks and other various media that can store program codes.

[0027] Embodiment 3. The present application also provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute an image enhancement processing method for a vehicle rearview mirror provided by each of the above methods. The method includes: obtaining images of a first number of raindrop parts in a vehicle rearview, and marking them as historical raindrop images; performing grayscale processing on the historical raindrop images to obtain historical raindrop grayscale images; obtaining a first segmentation threshold and a second segmentation threshold based on the historical raindrop grayscale images; obtaining a historical width threshold based on the historical raindrop grayscale images, the first segmentation threshold, and the second segmentation threshold; obtaining a real-time vehicle rearview, and marking it as a real-time rearview; performing grayscale processing on the real-time rearview to obtain a real-time rearview grayscale image; obtaining an optimized area based on the real-time rearview grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; performing sharpness optimization on the optimized area in the real-time rearview to obtain an optimized rearview; performing geometric transformation and visual adjustment on the optimized rearview and then displaying it.

[0028] Embodiment 4. The present application also provides a computer-readable storage medium. The present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in an image enhancement processing method for a vehicle rearview mirror as described above are run to achieve the following functions: obtaining images of a first number of raindrop parts in a vehicle rearview, and marking them as historical raindrop images; performing grayscale processing on the historical raindrop images to obtain historical raindrop grayscale images; obtaining a first segmentation threshold and a second segmentation threshold based on the historical raindrop grayscale images; obtaining a historical width threshold based on the historical raindrop grayscale images, the first segmentation threshold, and the second segmentation threshold; obtaining a real-time vehicle rearview, and marking it as a real-time rearview; performing grayscale processing on the real-time rearview to obtain a real-time rearview grayscale image; obtaining an optimized area based on the real-time rearview grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; performing sharpness optimization on the optimized area in the real-time rearview to obtain an optimized rearview; performing geometric transformation and visual adjustment on the optimized rearview and then displaying it.

[0029] Through the description of the above embodiments, the embodiments of the present invention can be provided as a method, a system, or a computer program product. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0030] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of systems, modules, and units can be in electrical, mechanical, or other forms.

[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image enhancement processing method for a vehicle rearview mirror, characterized in that, It includes the following steps: Obtain images of the first number of raindrop parts in the rear view of the vehicle, marked as the historical raindrop image; Perform grayscale processing on the historical raindrop image to obtain the historical raindrop grayscale image; Obtain the first segmentation threshold and the second segmentation threshold based on the historical raindrop grayscale image; Obtain the historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold; Obtain the real-time rear view of the vehicle, marked as the real-time rear view; Perform grayscale processing on the real-time rear view to obtain the real-time rear view grayscale image; Obtain the optimized area based on the real-time rear view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold; Optimize the clarity of the optimized area in the real-time rear view to obtain the optimized rear view; Perform geometric transformation and visual adjustment on the optimized rear view and then display it.

2. The method for enhancing the image of an automotive rearview mirror according to claim 1, wherein Performing grayscale processing on the historical raindrop image to obtain the historical raindrop grayscale image includes the following sub-steps: Obtain the RGB values of each pixel point in the historical raindrop grayscale image, marked as the historical raindrop RGB values; Use the grayscale conversion formula to convert all the historical raindrop RGB values in the historical raindrop grayscale image into grayscale values to obtain the historical raindrop grayscale image.

3. The method for enhancing an image of an automotive rearview mirror according to claim 2, wherein Obtaining the first segmentation threshold and the second segmentation threshold based on the historical raindrop grayscale image includes the following sub-steps: Mark the grayscale value of each pixel point in the historical raindrop grayscale image as the historical raindrop grayscale value; Sort the historical raindrop grayscale values from smallest to largest and label them as Yd1 to Yd respectively i ; Obtain the number of historical raindrop grayscale values, marked as the number of historical raindrop grays; Calculate the first quantity ratio as: B1 = o1 * Sh, where B1 is the first quantity ratio, o1 is the first quantity coefficient, and the range of o1 is: (0, 0.5), and Sh is the number of historical raindrop grays; If the first quantity ratio is an integer, mark Yd (B1) as the first position value; if the first quantity ratio is not an integer, obtain the integers on both sides of B1, mark them as B1z and B1y respectively, and calculate the mean value of Yd (B1z) and Yd (B1y) and mark it as the first position value; Calculate the second quantity coefficient as: o2 = [(1 / o1) - 1] * o1; where o2 is the second quantity coefficient; Calculate the second quantity ratio as: B2 = o2 * Sh, where B2 is the second quantity ratio; If the second quantity ratio is an integer, mark Yd (B2) as the second position value; if the second quantity ratio is not an integer, obtain the integers on both sides of B2, mark them as B2z and B2y respectively, and calculate the mean value of Yd (B2z) and Yd (B2y) , and mark it as the second position value; If 0.5*B1 is an integer, mark Yd (0.5*B1) as Dj; if 0.5*B1 is not an integer, obtain the integers on the left and right sides of 0.5*B1, mark them as Bzz and Bzy respectively, and calculate the mean of Yd (Bzz) and Yd (Bzy) and mark it as Dj.

4. The method for enhancing the image of an automotive rearview mirror according to claim 3, wherein, Obtaining the first segmentation threshold and the second segmentation threshold based on the historical raindrop grayscale image further includes the following sub-steps: Calculate the first segmentation threshold as: F1 = Dj - (Dj - W1) / [(0.5 - o1) / 0.5]; Where F1 is the first segmentation threshold; W1 is the first position value; Calculate the second segmentation threshold as: F2 = Dj + (W2 - Dj) / [(o2 - 0.5) / 0.5]; where F2 is the second segmentation threshold; W2 is the second position value.

5. A method for enhancing the image of an automotive rearview mirror according to claim 4, characterized in that, Obtaining the historical width threshold based on the historical raindrop grayscale image, the first segmentation threshold, and the second segmentation threshold includes the following sub-steps: Set the historical raindrop grayscale values that are greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold in the historical raindrop grayscale image to 0, and set the historical raindrop grayscale values that are less than the first segmentation threshold or greater than the second segmentation threshold to 255 to obtain the historical raindrop binary image; Mark the area where the grayscale value of the pixel points in the historical raindrop binary image is 0 as the raindrop area; Establish a plane rectangular coordinate system, marked as the historical interval coordinate system; place the raindrop area in the first quadrant of the historical interval coordinate system; Obtain the coordinates of a pixel point with the smallest abscissa in the raindrop area, mark it as the historical reference point, draw a straight line parallel to the Y-axis through the historical reference point, and mark it as the first straight line; rotate the first straight line 180° with the historical reference point as the rotation center, and obtain the farthest distance from a point in the raindrop area to the first straight line during the rotation process, mark it as the historical rotation distance, and obtain the minimum value of the historical rotation distance, mark it as the historical width; Obtain the historical widths of all raindrop areas; Obtain the maximum value of the historical widths, and mark it as the historical threshold width.

6. The method for enhancing the image of an automotive rearview mirror according to claim 5, wherein Obtaining the optimized area based on the real-time rear-view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold includes the following sub-steps: Set the historical raindrop grayscale values in the real-time rear-view grayscale image that are greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold to 0, and set the historical raindrop grayscale values in the historical raindrop grayscale image that are less than the first segmentation threshold or greater than the second segmentation threshold to 255, to obtain the real-time rear-view binary image; Mark the area where the grayscale value of the pixel points in the real-time rear-view binary image is 0 as the initial area; Establish a plane rectangular coordinate system, marked as the real-time interval coordinate system; place the real-time rear-view binary image in the first quadrant of the real-time interval coordinate system, and at the same time satisfy that two sides of the real-time rear-view binary image coincide with the horizontal axis and the vertical axis of the real-time interval coordinate system respectively; Obtain the coordinates of a pixel point with the smallest abscissa in the initial area, mark it as the real-time reference point, draw a straight line parallel to the Y-axis through the real-time reference point, and mark it as the second straight line; rotate the second straight line 180° with the real-time reference point as the rotation center, and obtain the farthest distance from a point in the initial area to the second straight line during the rotation process, mark it as the real-time rotation distance, and obtain the minimum value of the real-time rotation distance, mark it as the real-time width; Judge whether the real-time width is less than or equal to the historical width threshold. If so, mark the initial area as the final area; obtain the contour coordinates of the final area.

7. A method for enhancing the image of an automotive rearview mirror according to claim 6, characterized in that, Obtaining the optimized area based on the real-time rear-view grayscale image, the first segmentation threshold, the second segmentation threshold, and the historical width threshold further includes the following sub-steps: Establish a plane rectangular coordinate system, marked as the optimized coordinate system; place the real-time rear-view image in the first quadrant of the optimized coordinate system, and at the same time satisfy that two sides of the real-time rear-view image coincide with the horizontal axis and the vertical axis of the optimized coordinate system respectively; Obtain the position of the final area in the real-time rear-view image in the optimized coordinate system based on the contour coordinates of the final area, and mark the final area in the real-time rear-view image as the optimized area.

8. A method for enhancing the image of an automotive rearview mirror according to claim 7, characterized in that, Performing clarity optimization on the optimized area in the real-time rear-view image to obtain the real-time rear-view image includes the following sub-steps: Mark the pixel points in the optimized area as optimized area pixel points; Mark the pixel points on the contour of the optimized area as optimized contour pixel points; Establish a 3*3 pixel matrix centered on each optimized contour pixel point, marked as the search matrix; obtain the pixel points in the search matrix that are not optimized contour pixel points, mark them as the first search pixel points, establish a new search matrix centered on each first search pixel point, and obtain the pixel points in the new search matrix that are not optimized area pixel points and the first search pixel points, mark them as the second search pixel points; Obtain the average value of the RGB values of all the first search pixel points and the second search pixel points, and mark it as the search RGB average value; Set the RGB value of each optimized region pixel point in the real-time rear view to the corresponding search RGB average value to obtain the optimized view.

9. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1-8 are run.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps in the method according to any one of claims 1-8 are run.

Citation Information

Patent Citations

  • Rearview mirror image generation method and device, vehicle-mounted equipment and readable storage medium

    CN118644568A

  • Self-adaptive threshold segmentation method for grayscale image

    CN113129326A

  • Image binarization processing method and device

    CN115909353A

  • OCC image decoding method based on connected domain centroid extraction

    CN117459835A

  • Method, device and equipment for detecting use effect of anti-hair loss product and medium

    CN117808756A