Motor vehicle lane line detection system, its image grayscale processing device and method
By obtaining the actual pixel value of the RGB color image in the motor vehicle lane line detection system and calculating the optimal fusion weight, it is transformed into the target grayscale image, and the problem of low detection accuracy is solved, and high-accuracy lane line detection is achieved under complex lighting conditions.
Patent Information
- Application Number
- CN202210790279.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-06
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-07-06
AI Technical Summary
In the existing motor vehicle lane line detection system, when converting RGB color images into grayscale images based on fixed fusion weights under specific driving scenes or strong light conditions, the accuracy of detecting lane lines is low.
The image grayscale processing device of a motor vehicle lane line detection system is adopted. By obtaining the actual pixel values of the background area and the lane line area in the RGB color image, combining a mathematical model to calculate the optimal fusion weight, and convert it into a target grayscale image to maximize the difference between the background area and the lane line area and improve detection accuracy.
It effectively improves the accuracy of lane line detection, especially under complex lighting conditions, which can detect lane lines faster and more accurately.
Smart Images

Figure CN115171067B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of motor vehicle assisted driving, and in particular, to a motor vehicle lane line detection system, an image grayscale processing device and method thereof. Background Art
[0002] Currently, a motor vehicle lane line detection system is usually installed on a motor vehicle to detect the lane lines on the driving road surface of the motor vehicle, so as to provide auxiliary driving functions such as lane departure warning and lane keeping for the driver.
[0003] The working principle of an existing motor vehicle lane line detection system is mainly as follows: first, an RGB color image of the driving road surface around the motor vehicle is obtained from the video image collected by an in-vehicle camera, then the RGB color image is converted into a single-channel target grayscale image, and then the lane lines are detected from the target grayscale image; among them, the principle of converting the RGB color image into the target grayscale image in the prior art is to fuse the pixel values of the three channels by assigning fixed fusion weights to each channel of the RGB color image to achieve the conversion of the grayscale image.
[0004] However, the inventor found in the specific implementation that in a certain specific driving scenario or under strong light conditions, when converting the RGB color image into a grayscale image based on fixed fusion weights, the accuracy of the fixed fusion weights is difficult to meet the actual scenario requirements, resulting in relatively low accuracy in detecting lane lines from the converted target grayscale image, and even unable to achieve lane line detection. Summary of the Invention
[0005] The technical problem to be solved by the embodiments of the present invention is to provide an image grayscale processing device for a motor vehicle lane line detection system, which can effectively improve the accuracy of lane line detection.
[0006] The further technical problem to be solved by the embodiments of the present invention is to provide a motor vehicle lane line detection system, which can effectively improve the accuracy of lane line detection.
[0007] The further technical problem to be solved by the embodiments of the present invention is to provide an image grayscale processing method for a motor vehicle lane line detection system, which can effectively improve the accuracy of lane line detection.
[0008] To solve the above technical problems, the embodiments of the present invention first provide the following technical solution: an image grayscale processing device for a motor vehicle lane line detection system, comprising:
[0009] A color image acquisition module, connected to an in-vehicle camera, for obtaining an RGB color image of the driving road surface around the motor vehicle from the video image collected by the in-vehicle camera;
[0010] A pixel extraction module, connected to the color image acquisition module, is configured to respectively obtain the actual pixel values corresponding to each pixel point in the background area and the lane line area in the RGB color image according to the pre-stored positional relationship between the background area and the lane line area;
[0011] A fusion weight calculation module, connected to the pixel extraction module, is configured to combine a pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and use the optimal solution as the fusion weight for converting the RGB color image into a target grayscale image. The mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image, with the fusion weight as the independent variable; and
[0012] A grayscale image calculation module, connected to the fusion weight calculation module and the pixel extraction module respectively, is configured to calculate the target grayscale image according to a pre-stored grayscale image fusion formula, the fusion weight, and the actual pixel values.
[0013] Further, the fact that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image specifically means that the difference between the sum of the pixel values of all pixel points in the background area and the sum of the pixel values of all pixel points in the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image.
[0014] Further, the mathematical model is , where , , represents the pixel value of the i-th pixel point in the background area of the target grayscale image, and m represents the total number of pixel points in the background area of the target grayscale image; represents the pixel value of the j-th pixel point in the lane line area of the target grayscale image, and n represents the total number of pixel points in the lane line area of the target grayscale image, are the fusion weights for the R, G, and B channels corresponding to the RGB color image, and R, G, and B respectively represent the pixel values of each pixel in the RGB color image in the corresponding color channels, represents the optimal solution.
[0015] Further, the fusion weight calculation module includes:
[0016] A model transformation unit, configured to transform the mathematical model into a matrix function based on the principle of solving the optimal dimensionality reduction vector, where the between-class scatter matrix , and the within-class scatter matrix , all pixel points in the RGB color image are divided into two types of pixel points belonging to the background area and the lane line area, represents the total number of pixel points of the k-th class, represents the pixel mean of all classes of pixel points in each color channel, represents the pixel mean of the k-th class of pixel points in each color channel, C represents the total number of pixel point classes, represents the p-th pixel point of the k-th class;
[0017] A matrix derivative unit, used to perform matrix derivative on the matrix function according to the between-class scatter matrix and the within-class scatter matrix to obtain the generalized eigenvalue of the matrix function by performing matrix derivative on the matrix function ;
[0018] An eigenvalue decomposition unit, used to perform eigenvalue decomposition on the generalized eigenvalue to obtain the solution of the matrix function ; and
[0019] A fusion weight extraction module, used to extract the target eigenvector with the largest eigenvalue from the solution of the matrix function as the optimal solution of the mathematical model, and use each element in the target eigenvector as the fusion weight of each color channel of the RGB color image .
[0020] On the other hand, to solve the above further technical problems, the embodiment of the present invention further provides the following technical solution: A motor vehicle lane line detection system, including an image grayscale processing device connected to an in-vehicle camera and a lane line detection device connected to the image grayscale processing device for detecting lane lines from a target grayscale image output by the image grayscale processing device, and the image grayscale processing device is the image grayscale processing device described in any one of the above.
[0021] Further, the system further includes:
[0022] A position relationship updating device, connected to the lane line detection device and the pixel extraction module of the image grayscale processing device, and used to update the position relationship between the background area and the lane line area in the pixel extraction module according to the lane lines detected by the lane line detection device.
[0023] On yet another hand, to solve the above further technical problems, the embodiment of the present invention further provides the following technical solution: An image grayscale processing method for a motor vehicle lane line detection system, including the following steps:
[0024] Obtain an RGB color image of the driving road surface around the motor vehicle from the video image collected by the in-vehicle camera;
[0025] Obtain the actual pixel values corresponding to each pixel point in the background area and the lane line area in the RGB color image respectively according to the pre-stored positional relationship between the background area and the lane line area;
[0026] Combine the pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and use the optimal solution as the fusion weight for converting the RGB color image into the target grayscale image. The mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after converting the RGB color image into the target grayscale image, with the fusion weight as the independent variable; and
[0027] Calculate the target grayscale image according to the pre-stored grayscale image fusion formula, the fusion weight, and the actual pixel values.
[0028] Further, the fact that the difference between the background area and the lane line area in the target grayscale image is the largest after converting the RGB color image into the target grayscale image specifically means: the difference between the sum of the pixel values of all pixel points in the background area and the sum of the pixel values of all pixel points in the lane line area in the target grayscale image is the largest after converting the RGB color image into the target grayscale image.
[0029] Further, the mathematical model is , where , , represents the pixel value of the i-th pixel point in the background area of the target grayscale image, and m represents the total number of pixel points in the background area of the target grayscale image; represents the pixel value of the j-th pixel point in the lane line area of the target grayscale image, and n represents the total number of pixel points in the lane line area of the target grayscale image, is the fusion weight for the R, G, and B channels corresponding to the RGB color image, and R, G, and B respectively represent the pixel values of each pixel in the RGB color image in the corresponding color channels, represents the optimal solution.
[0030] Further, the step of combining the pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model and using the optimal solution as the fusion weight for converting the RGB color image into the target grayscale image specifically includes:
[0031] Based on the principle of optimal dimensionality reduction vector solution, transform the mathematical model into a matrix function , where the between-class scatter matrix , and the within-class scatter matrix , all pixel points in the RGB color image are divided into two types of pixel points belonging to the background area and the lane line area respectively. Represents the total number of pixel points of the k-th class. Represents the pixel mean of all classes of pixel points in each color channel. Represents the pixel mean of the k-th class of pixel points in each color channel, C represents the total number of pixel point classes. Represents the p-th pixel point of the k-th class.
[0032] According to the between-class scatter matrix and the within-class scatter matrix Perform matrix derivation on the matrix function to obtain the generalized eigenvalues of the matrix function ;
[0033] Perform eigenvalue decomposition on the generalized eigenvalue to obtain the solution of the matrix function ; and
[0034] Extract the target eigenvector with the largest eigenvalue from the solution of the matrix function as the optimal solution of the mathematical model, and use each element in the target eigenvector as the fusion weight of each color channel of the RGB color image .
[0035] After adopting the above technical solutions, the embodiments of the present invention have at least the following beneficial effects: After the color image acquisition module of the present invention acquires the RGB color image of the driving road surface around the motor vehicle, the pixel extraction module first obtains the actual pixel values corresponding to each pixel point in the background area and the lane line area of the RGB color image according to the pre-stored positional relationship between the background area and the lane line area. Further, the fusion weight calculation module combines the actual pixel values of the current RGB color image to find the optimal solution of the mathematical model. Since the mathematical model takes the fusion weight as the independent variable, and the mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image with the fusion weight as the independent variable. Therefore, for the convenience of subsequent lane line detection, according to the image recognition and detection principle, when the difference between the background area and the lane line area in the target grayscale image is the largest, the lane line can be detected fastest and most accurately, and the optimal solution of the mathematical model is the fusion weight that most conforms to the current RGB color image. Finally, the grayscale image calculation module can calculate the target grayscale image that most conforms to the current scene according to the corresponding grayscale image fusion formula, the calculated fusion weight, and the actual pixel values corresponding to the RGB color image, which can effectively improve the accuracy of lane line detection. Description of the Drawings
[0036] Figure 1 This is the structural principle block diagram of an alternative embodiment of the motor vehicle lane line detection system of the present invention.
[0037] Figure 2 This is the specific structural principle block diagram of the fusion weight calculation module of an alternative embodiment of the image grayscale processing device of the motor vehicle lane line detection system of the present invention.
[0038] Figure 3 This is the structural principle block diagram of another alternative embodiment of the motor vehicle lane line detection system of the present invention.
[0039] Figure 4 This is the step flow chart of an alternative embodiment of the image grayscale processing method of the motor vehicle lane line detection system of the present invention.
[0040] Figure 5 This is the actual image of the RGB color image of an alternative embodiment of the image grayscale processing method of the motor vehicle lane line detection system of the present invention.
[0041] Figure 6 For the image grayscale processing method of the traditional motor vehicle lane line detection system Figure 5 The actual image after grayscale processing.
[0042] Figure 7 For the image grayscale processing method of an alternative embodiment of the motor vehicle lane line detection system of the present invention Figure 5 The actual image after grayscale processing. Detailed implementation manners
[0043] The following further describes the present application in detail with reference to the accompanying drawings and specific embodiments. It should be understood that the following illustrative embodiments and descriptions are only used to explain the present invention and are not intended to limit the present invention. Moreover, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0044] As Figure 1 shown, an alternative embodiment of the present invention provides an image grayscale processing device 1 for a motor vehicle lane line detection system, including:
[0045] A color image acquisition module 10, connected to the vehicle-mounted camera 3, for acquiring an RGB color image of the driving road surface around the motor vehicle from the video image collected by the vehicle-mounted camera 3;
[0046] A pixel extraction module 12, connected to the color image acquisition module 10, for respectively acquiring the actual pixel values of each pixel point in the background area and the lane line area of the RGB color image corresponding to each channel according to the pre-stored positional relationship between the background area and the lane line area;
[0047] The fusion weight calculation module 14, connected to the pixel extraction module 12, is configured to combine a pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and use the optimal solution as the fusion weight for converting the RGB color image into the target grayscale image. The mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image, with the fusion weight as the independent variable; and
[0048] The grayscale image calculation module 16, connected to the fusion weight calculation module 14 and the pixel extraction module 12 respectively, is configured to calculate the target grayscale image according to a pre-stored grayscale image fusion formula (i.e., the following formula 1), the fusion weight, and the actual pixel values.
[0049] After the color image acquisition module 10 in the embodiment of the present invention acquires the RGB color image of the driving road surface around the motor vehicle, the pixel extraction module 12 first acquires the actual pixel values of each pixel point in the background area and the lane line area of the RGB color image in each channel according to the pre-stored positional relationship between the background area and the lane line area. Further, the fusion weight calculation module 14 combines the actual pixel values of the current RGB color image to find the optimal solution of the mathematical model. Since the mathematical model uses the fusion weight as the independent variable and is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image, therefore, for the convenience of subsequent detection of the lane line, according to the image recognition and detection principle, when the difference between the background area and the lane line area in the target grayscale image is the largest, the lane line can be detected fastest and most accurately, and the optimal solution of the mathematical model is the fusion weight that most conforms to the current RGB color image. Finally, the grayscale image calculation module 16 can calculate the target grayscale image that most conforms to the current scene according to the corresponding grayscale image fusion formula, the calculated fusion weight, and the actual pixel values corresponding to the RGB color image, which can effectively improve the accuracy of lane line detection.
[0050] In an optional embodiment of the present invention, the fact that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image specifically means that: the difference between the sum of the pixel values of all pixel points in the background area and the sum of the pixel values of all pixel points in the lane line area in the target grayscale image after the RGB color image is converted into the target grayscale image is the largest. In this embodiment, the fact that the difference between the background area and the lane line area is the largest is reflected in the image parameters as the largest difference between the sum of their pixel values, which is convenient for subsequent calculation of image data.
[0051] In an alternative embodiment of the present invention, the mathematical model is , where , , represents the pixel value of the i-th pixel point in the background area of the target grayscale image, and m represents the total number of pixel points in the background area of the target grayscale image; represents the pixel value of the j-th pixel point in the lane line area of the target grayscale image, and n represents the total number of pixel points in the lane line area of the target grayscale image, are the fusion weights of the R, G, and B channels corresponding to the RGB color image, and R, G, and B respectively represent the pixel values of each pixel of the RGB color image in the corresponding color channels, represents the optimal solution.
[0052] In this embodiment, by using the correlation between pixel points in the image, a unified mathematical relationship of image pixel values is established, and the overall process is relatively simple and convenient for calculation.
[0053] In specific implementation, the establishment process of the mathematical model is as follows:
[0054] First, construct the conversion expression for converting the RGB color image into the target grayscale image g:
[0055] (Formula 1)
[0056] where , , respectively represent the fusion weights of the R, G, and B channels corresponding to the RGB color image, and R, G, B are the pixel values of each pixel point of the RGB color image in the corresponding color channels;
[0057] Further, in combination with Formula 1, the difference D between the total pixel values of the background area and the lane detection area in the target grayscale image g can be expressed by the following formula:
[0058] (Formula 2)
[0059] where represents the total pixel value of the background area in the target grayscale image g calculated according to Formula 1, represents the total pixel value of the lane line area in the target grayscale image g calculated according to Formula 1; according to the principle of image detection and recognition, the larger the difference , the more obvious the features in the lane line area and the background area, which is more conducive to the vehicle lane line detection system to extract the lane line. On the contrary, the features are weaker, which is not conducive to the vehicle lane line detection system to extract the correct lane line;
[0060] Therefore, in order to establish a unified mathematical model for all pixel points in the background area and the lane line area in the target grayscale image g, it is set that , , combined with Formula 1, the sum of all pixel values in the background area can be expressed as:
[0061] (Formula 3)
[0062] Among them, represents the pixel value of the i-th pixel point in the background area, and m represents the total number of pixel points in the background area;
[0063] Similarly, the sum of all pixel values in the lane line area can be expressed as:
[0064] (Formula 4)
[0065] Among them, represents the pixel value of the i-th pixel point in the lane line area, and n represents the total number of pixel points in the lane line area;
[0066] Finally, by combining Formula 3 and Formula 4, a mathematical model that maximizes the difference between the background area and the lane line area in the target grayscale image g when converting the RGB color image into the target grayscale image g can be established as:
[0067] |)(Formula 5)
[0068] Among them, is the optimal solution corresponding to the mathematical model, that is, the optimal fusion weight.
[0069] In an alternative embodiment of the present invention, as Figure 2 shown, the fusion weight calculation module 14 includes:
[0070] A model transformation unit 141, configured to transform the mathematical model into a matrix function based on the principle of solving the optimal dimensionality reduction vector, where the between-class scatter matrix , the within-class scatter matrix , and all pixel points in the RGB color image are divided into two types of pixel points belonging to the background area and the lane line area, represents the total number of pixel points in the k-th class, represents the pixel mean of all classes of pixel points in each color channel, represents the pixel mean of the k-th class of pixel points in each color channel, C represents the total number of pixel point classes, represents the p-th pixel point in the k-th class;
[0071] A matrix derivative unit 143, configured to perform matrix derivative on the matrix function according to the between-class scatter matrix and the within-class scatter matrix to obtain the generalized eigenvalues of the matrix function ;
[0072] An eigenvalue decomposition unit 145, configured to perform eigenvalue decomposition on the generalized eigenvalues to obtain the solution of the matrix function ; and
[0073] A fusion weight extraction module 147, configured to extract the target eigenvector with the largest eigenvalue from the solution of the matrix function as the optimal solution of the mathematical model, and use each element in the target eigenvector as the fusion weight of each color channel of the RGB color image .
[0074] In this embodiment, the optimal dimensionality reduction vector solving principle and matrix-related knowledge process are used to calculate the fusion weight , and the overall steps are relatively simple and the calculation efficiency is relatively high
[0075] In specific implementation, the specific calculation principle of the fusion weight is as follows
[0076] When solving the mathematical model of formula 5, it can be regarded as a problem of solving the optimal dimensionality reduction vector. All pixel points in the RGB color image are divided into two types of pixel points belonging to the background area and the lane line area, so that the distance between pixel points belonging to the same area is as small as possible, and the distance between pixel points belonging to different areas is as large as possible. Therefore, formula 5 can be transformed into solving the following matrix function
[0077] (Formula 6)
[0078] Between-class scatter matrix (Formula 7)
[0079] Within-class scatter matrix (Formula 8)
[0080] Wherein represents the total number of pixel points in the k-th class represents the pixel mean of all classes of pixel points in each color channel represents the pixel mean of the k-th class of pixel points in each color channel, C represents the total number of pixel point classes represents the p-th pixel point in the k-th class
[0081] Furthermore, according to formula 7 and formula 8, the optimal solution in formula 6 It can be obtained through generalized eigenvalue decomposition:
[0082] (Formula 9)
[0083] The above Formula 9 is an identity. By taking the matrix derivative of Formula 6, Formula 9 can be obtained. denotes the eigenvector on the right side of the equation, and the eigenvector The elements inside are the fusion weights. , , .
[0084] Furthermore, by performing eigenvalue decomposition on Formula 9, the solution in Formula 6 is:
[0085] (Formula 10)
[0086] Since this solution is to fuse a three-channel RGB color image into a single-channel target grayscale image g, so d = 3. At the same time, to maximize the difference in the sum of pixels between the background area and the lane detection area of the target grayscale image g during the grayscale conversion process, the optimal solution is equal to the target eigenvector corresponding to the largest eigenvalue in, for example: according to the eigenvalues corresponding to each eigenvector in Formula 10 arranged in descending order, the optimal fusion weights obtained are:
[0087] , , (Formula 11)
[0088] where , , are the fusion weights of the R, G, and B channels in the RGB color image respectively , , .
[0089] Finally, in step S4, substitute the calculated fusion weights , , and the actual pixel values obtained by extraction in step S2 into Formula 1, and the target grayscale image g can be obtained.
[0090] On the other hand, as Figure 1As shown in the figure, an embodiment of the present invention further provides a motor vehicle lane line detection system, including an image grayscale processing device 1 connected to an in-vehicle camera 3 and a lane line detection device 5 connected to the image grayscale processing device 1 for detecting lane lines from a target grayscale image output by the image grayscale processing device 1. The image grayscale processing device 1 is the image grayscale processing device described in the above embodiment. In this embodiment, the motor vehicle lane line detection system adopts the image grayscale processing device 1 as described above, which can effectively improve the accuracy of lane line detection.
[0091] In an alternative embodiment of the present invention, as Figure 3 shown, the system further includes:
[0092] A position relationship updating device 7, connected to the lane line detection device 5 and the pixel extraction module 12 of the image grayscale processing device 1, for updating the position relationship between the background area and the lane line area in the pixel extraction module 12 according to the lane lines detected by the lane line detection device 5. In this embodiment, by further setting the position relationship updating device 7, after the lane line detection device 5 detects the lane lines, the position relationship between the background area and the lane line area is updated again to achieve an overall cycle. During the driving of the motor vehicle, the position relationship between the background area and the lane line area is continuously updated to gradually improve the detection accuracy. Of course, it can be understood that when the motor vehicle lane line detection system is initially operated, the position relationship between the background area and the lane line area in the pixel extraction module 12 can be pre-calibrated by an operator according to experience and pre-stored in the pixel extraction module 12. During the subsequent lane line detection process, the lane lines detected previously are used to update the position relationship between the background area and the lane line area in the pixel extraction module 12.
[0093] On the other hand, as Figure 4 shown, an embodiment of the present invention further provides an image grayscale processing method for a motor vehicle lane line detection system, including the following steps:
[0094] S1: Obtain an RGB color image of the driving road surface around the motor vehicle from the video image collected by the in-vehicle camera 3;
[0095] S2: Respectively obtain the actual pixel values of each pixel point in the background area and the lane line area of the RGB color image corresponding to each channel according to the pre-stored position relationship between the background area and the lane line area;
[0096] S3: Combine the pre - stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and use the optimal solution as the fusion weight for converting the RGB color image into the target grayscale image. The mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image, with the fusion weight as the independent variable; and
[0097] S4: Calculate the target grayscale image according to the pre - stored grayscale image fusion formula, the fusion weight, and the actual pixel values.
[0098] In the embodiment of the present invention, through the above - mentioned method, after obtaining the RGB color image of the driving road surface around the motor vehicle, first obtain the actual pixel values corresponding to each pixel point in the background area and the lane line area of the RGB color image in each channel according to the pre - stored positional relationship between the background area and the lane line area. Further, combine the actual pixel values of the current RGB color image to find the optimal solution of the mathematical model. Since the mathematical model has the fusion weight as the independent variable, and the mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image with the fusion weight as the independent variable, therefore, for the convenience of subsequent lane line detection, according to the image recognition and detection principle, when the difference between the background area and the lane line area in the target grayscale image is the largest, the lane line can be detected fastest and most accurately, and the optimal solution of the mathematical model is the fusion weight that most conforms to the current RGB color image. Finally, according to the corresponding grayscale image fusion formula, calculate the fusion weight and the actual pixel values corresponding to the RGB color image, and then the target grayscale image that most conforms to the current scene can be obtained, which can effectively improve the accuracy of lane line detection.
[0099] In an optional embodiment of the present invention, the fact that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image specifically means that: the difference between the sum of the pixel values of all pixel points in the background area and the sum of the pixel values of all pixel points in the lane line area in the target grayscale image after the RGB color image is converted into the target grayscale image is the largest. In this embodiment, the fact that the difference between the background area and the lane line area is the largest is reflected in the image parameters as the largest difference between the sums of their pixel values, which is convenient for subsequent calculation of image data.
[0100] In an optional embodiment of the present invention, the mathematical model is , where , , represents the pixel value of the i - th pixel point in the background area of the target grayscale image, and m represents the total number of pixel points in the background area of the target grayscale image; represents the pixel value of the j-th pixel point in the lane line area of the target grayscale image, and n represents the total number of pixel points in the lane line area of the target grayscale image. are the fusion weights for the R, G, and B channels corresponding to the RGB color image. R, G, and B respectively represent the pixel values of each pixel in the RGB color image in the corresponding color channels. represents the optimal solution. In this embodiment, by using the correlation between pixel points in the image, a unified mathematical relationship of image pixel values is established, and the overall process is relatively simple and convenient for calculation.
[0101] In an alternative embodiment of the present invention, step S3 specifically includes:
[0102] S31: Based on the principle of optimal dimensionality reduction vector solution, transform the mathematical model into a matrix function , where the between-class scatter matrix , and the within-class scatter matrix . All pixel points in the RGB color image are divided into two types of pixel points belonging to the background area and the lane line area. represents the total number of pixel points in the k-th class. represents the pixel mean of all classes of pixel points in each color channel. represents the pixel mean of the k-th class of pixel points in each color channel, and C represents the total number of pixel point classes. represents the p-th pixel point in the k-th class;
[0103] S32: According to the between-class scatter matrix and the within-class scatter matrix , perform matrix differentiation on the matrix function to obtain the generalized eigenvalues of the matrix function;
[0104] S33: Perform eigenvalue decomposition on the generalized eigenvalues to obtain the solution of the matrix function; and
[0105] S34: Extract the target eigenvector with the largest eigenvalue from the solution of the matrix function as the optimal solution of the mathematical model, and use the elements in the target eigenvector as the fusion weights for each color channel of the RGB color image .
[0106] In this embodiment, the optimal dimensionality reduction vector solution principle and matrix-related knowledge process are used to calculate the fusion weights , and the overall steps are relatively simple and the calculation efficiency is relatively high.
[0107] Finally, referring to Figures 5 - 7 as shown, Figure 5 is the original RGB color image, in which there are multiple illumination and shadow areas on the road surface where the motor vehicle travels. Figure 6 is a conventional gray-scale fusion method (using a fusion weight of i.e. = 0.299, = 0.387, = 0.114) converted target gray-scale image. As can be seen from Figure 6 , in the converted target gray-scale image, bright spots of varying degrees appear in the background area affected by illumination. The gray scale of these bright spots is very close to that of the lane line area. Therefore, when the motor vehicle lane line detection system extracts lane lines based on this gray-scale image, it will be affected by the bright spots in the background area, thus reducing the accuracy and stability of the lane line detection system. Figure 7 is the target gray-scale image converted by using the image gray-scale processing device 1 provided in the present application to solve the optimal fusion weight (i.e. = 0.95, = -0.15, = 0.01). As can be seen from Figure 7 , compared with Figure 6 , the fusion weight calculated by the image gray-scale processing device 1 of the present invention effectively eliminates the bright spots formed in the background area due to illumination, and at the same time, the gray scale of the lane line area and the gray scale of the background area also have obvious distinctiveness. Therefore, it is more conducive to improving the accuracy of the lane line detection system for lane detection.
[0108] If the functions described in the embodiments of the present invention are implemented in the form of software function modules or units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on such an understanding, the part that contributes to the prior art or part of the technical solution of the embodiments of the present invention can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a computing device (which can be a personal computer, a server, a mobile computing device or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present invention. The foregoing storage medium includes: various media such as 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 that can store program codes. Each embodiment in this specification is described in a progressive manner, and the key points of each embodiment are the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other.
[0109] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit of the present invention and the scope protected by the claims. All of these fall within the protection scope of the present invention.
Claims
1. An image grayscale processing device for a motor vehicle lane line detection system, characterized in that The device includes: A color image acquisition module, connected to the vehicle-mounted camera, for acquiring an RGB color image of the driving road surface around the motor vehicle from the video image collected by the vehicle-mounted camera; A pixel extraction module, connected to the color image acquisition module, for respectively obtaining the actual pixel values corresponding to each pixel point in the background area and the lane line area of the RGB color image in each channel according to the pre-stored positional relationship between the background area and the lane line area; A fusion weight calculation module, connected to the pixel extraction module, for combining the pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and taking the optimal solution as the fusion weight for converting the RGB color image into a target grayscale image. The mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image, with the fusion weight as the independent variable; and A grayscale image calculation module, connected to the fusion weight calculation module and the pixel extraction module respectively, for calculating the target grayscale image according to the pre-stored grayscale image fusion formula, the fusion weight, and the actual pixel values.
2. The image grayscale processing device of the motor vehicle lane line detection system according to claim 1, wherein, The fact that the difference between the background area and the lane line area in the target grayscale image after the RGB color image is converted into the target grayscale image is the largest specifically means that the difference between the sum of the pixel values of all pixel points in the background area and the sum of the pixel values of all pixel points in the lane line area in the target grayscale image after the RGB color image is converted into the target grayscale image is the largest.
3. The image grayscale processing device of the motor vehicle lane line detection system according to claim 1 or 2, characterized in that The mathematical model is , where , , represents the pixel value of the i-th pixel point in the background area of the target grayscale image, and m represents the total number of pixel points in the background area of the target grayscale image; represents the pixel value of the j-th pixel point in the lane line area of the target grayscale image, and n represents the total number of pixel points in the lane line area of the target grayscale image, are the fusion weights of the R, G, and B channels corresponding to the RGB color image, and R, G, and B respectively represent the pixel values of each pixel of the RGB color image in the corresponding color channels, represents the optimal solution.
4. The image grayscale processing device of the motor vehicle lane line detection system according to claim 3, characterized in that The fusion weight calculation module includes: A model transformation unit, configured to transform the mathematical model into a matrix function based on the principle of solving the optimal dimensionality reduction vector , where the between-class scatter matrix , the within-class scatter matrix , divides all pixel points in the RGB color image into two types of pixel points belonging to the background region and the lane line region represents the total number of pixel points in the k-th class represents the pixel mean of all classes of pixel points in each color channel represents the pixel mean of the k-th class of pixel points in each color channel, C represents the total number of pixel point classes represents the p-th pixel point in the k-th class A matrix derivative unit, which is used to perform matrix derivative on the matrix function according to the between-class scatter matrix and the within-class scatter matrix to obtain the generalized eigenvalues of the matrix function ; An eigenvalue decomposition unit for performing eigenvalue decomposition on the generalized eigenvalue to obtain the solution of the matrix function ; and The fusion weight extraction module is used to extract, from the solution of the matrix function the target eigenvector with the largest eigenvalue as the optimal solution of the mathematical model, and use each element in the target eigenvector as the fusion weight of each color channel of the RGB color image .
5. A motor vehicle lane line detection system, comprising an image grayscale processing device connected to an in-vehicle camera and a lane line detection device connected to the image grayscale processing device for detecting lane lines from a target grayscale image output by the image grayscale processing device, characterized in that, The image grayscale processing device is the image grayscale processing device according to any one of claims 1-4.
6. The motor vehicle lane line detection system according to claim 5, characterized in that, The system further includes: A position relationship updating device, connected to the lane line detection device and the pixel extraction module of the image grayscale processing device, for updating the positional relationship between the background area and the lane line area in the pixel extraction module according to the lane lines detected by the lane line detection device.
7. An image grayscale processing method for a motor vehicle lane line detection system, characterized in that, The method includes the following steps: Acquiring an RGB color image of the driving road surface around the motor vehicle from the video image collected by the vehicle-mounted camera; Respectively obtaining the actual pixel values corresponding to each pixel point in the background area and the lane line area of the RGB color image in each channel according to the pre-stored positional relationship between the background area and the lane line area; Combining the pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and taking the optimal solution as the fusion weight for converting the RGB color image into a target grayscale image. The mathematical model is constructed based on the principle that the difference between the background area and the lane line area in the target grayscale image is the largest after the RGB color image is converted into the target grayscale image, with the fusion weight as the independent variable; and Calculating the target grayscale image according to the pre-stored grayscale image fusion formula, the fusion weight, and the actual pixel values.
8. The image gray-scale processing method of the motor vehicle lane line detection system according to claim 7, characterized in that, After the RGB color image is converted into the target grayscale image, the difference between the background area and the lane line area in the target grayscale image is the largest, specifically referring to: after the RGB color image is converted into the target grayscale image, the difference between the sum of the pixel values of all pixel points in the background area and the sum of the pixel values of all pixel points in the lane line area in the target grayscale image is the largest.
9. The image grayscale processing method of the motor vehicle lane line detection system according to claim 7 or 8, characterized in that, The mathematical model is , where , , represents the pixel value of the i-th pixel point in the background area of the target grayscale image, and m represents the total number of pixel points in the background area of the target grayscale image; represents the pixel value of the j-th pixel point in the lane line area of the target grayscale image, and n represents the total number of pixel points in the lane line area of the target grayscale image, are the fusion weights of the R, G, and B channels corresponding to the RGB color image, and R, G, and B respectively represent the pixel values of each pixel of the RGB color image in the corresponding color channels, represents the optimal solution.
10. The image grayscale processing method of the motor vehicle lane line detection system according to claim 9, characterized in that, Combining the pre-stored mathematical model and the actual pixel values to calculate the optimal solution of the mathematical model, and using the optimal solution as the fusion weight for converting the RGB color image into the target grayscale image specifically includes: Transform the mathematical model into a matrix function based on the principle of solving the optimal dimensionality reduction vector , where the between-class scatter matrix , the within-class scatter matrix . Divide all pixel points in the RGB color image into two types of pixel points belonging to the background area and the lane line area represents the total number of pixel points in the k-th class represents the pixel mean of all classes of pixel points in each color channel represents the pixel mean of the k-th class of pixel points in each color channel. C represents the total number of pixel point classes represents the p-th pixel point in the k-th class According to the between-class scatter matrix and the within-class scatter matrix perform matrix differentiation on the matrix function to obtain the generalized eigenvalues of the matrix function ; Perform eigenvalue decomposition on the generalized eigenvalue to obtain the solution of the matrix function ; and Extract the target eigenvector with the largest eigenvalue from the solution of the matrix function as the optimal solution of the mathematical model, and use each element in the target eigenvector as the fusion weight of each color channel of the RGB color image .
Citation Information
Patent Citations
Image decolorizing method
CN102542526A
Lane line recognition method and device
CN111046741A