A navigation vanishing point detection method for complex lane scenes
Through LSD straight line detection and motion estimation technology, combined with the average gradient constraint and LOF algorithm, the RANSAC algorithm is used to efficiently detect the vanishing point in the complex environment of the tunnel, solving the problems of uneven illumination and many interference factors in the existing technology, and achieving higher detection accuracy and efficiency.
Patent Information
- Application Number
- CN202110347446.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-03-31
AI Technical Summary
In the complex environment of the roadway, it is difficult for the existing navigation system to effectively detect the vanishing point. Due to the imbalance of illumination, many interference factors and the lack of straight line features, the existing algorithm is not suitable for the complex scene of the roadway.
The LSD straight line detection algorithm is used to extract straight line features, combined with the average gradient constraint and motion estimation technology, the abnormal factor value is calculated through the improved block matching algorithm and LOF algorithm, and the RANSAC random sampling algorithm is used to extract the effective straight line model to determine the vanishing point coordinates.
It improves the accuracy and efficiency of vanishing point detection, effectively eliminates interfering straight lines, is suitable for complex tunnel scenes, and enhances the reliability of the navigation system.
Smart Images

Figure CN113240721B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a navigation vanishing point detection method, which is suitable for use in mine tunnels and is applied to complex tunnel scenes, and belongs to the field of computer vision. Background Art
[0002] Autonomous navigation is the prerequisite for tunnel robots to complete various tasks and operations, and it is also a key factor in giving robots the ability to perceive and act. Due to the complexity, closedness, and particularity of tunnel scenes, the electromagnetic environment of the tunnel is complex, the GPS signal is weak or even lost, and the robot cannot use GPS for positioning and navigation in the tunnel environment. The existing ground navigation system is not suitable for the complex unstructured environment of the tunnel. With the deepening of machine vision research and the development of semiconductor and computer technology, visual information is being increasingly applied to navigation practice. Visual navigation is a method of navigation using visible and invisible light imaging technology. It has the advantages of good concealment, strong autonomy, fast and accurate measurement, as well as low cost and reliability.
[0003] The vanishing point, also known as the vanishing point, is the point in linear perspective where two or more parallel lines extend toward the distant horizon and converge. In an image, the location information of the vanishing point is of great significance for determining the direction and approximate orientation of the road in the image. Therefore, vanishing point detection in the complex environment of closed lanes has become a research hotspot.
[0004] The literature (Liu Zhen, Wang Jiayue, Chen Lijuan. Three-dimensional reconstruction of a single image based on vanishing point optimization [J]. Journal of Zhejiang University of Technology, 2019) proposed a vanishing point detection algorithm that uses straight line parameter information to obtain effective straight lines, and obtains the linear model of straight line parameters through an improved regression algorithm, and then uses the least squares method to solve the vanishing point; the literature (Chu Jun, Wang Li, Zhang Guimei. Building vanishing point detection method using straight line parameter information [J]. Computer Applications, 2013) clusters straight lines in different directions, and proves that the straight line parameters in each direction satisfy the linear distribution relationship, and then uses a robust regression algorithm to establish a linear model of straight line parameters, and removes external points accordingly; the literature (Chen Xiao, Wang Min. A fast vanishing point detection method for artificial scene images [J]. Computer Engineering and Science, 2014) proposes a new method. First, Detect the longer boundary lines in the image and filter and group them. Then, use the constraint relationship between the vanishing point and the focal length to determine the position of the three-way vanishing point and the size of the focal length. Reference (Chen Shizeng, Li Bijun, Zhou Jimiao. Lane line detection using double vanishing points [J]. Bulletin of Surveying and Mapping, 2020) estimates the vanishing points of the left and right lane lines respectively, and constructs a statistical histogram of feature points with the vanishing points as the guide. Then select the straight line that passes through most of the feature points and estimate and update the vanishing point by the overlap between the feature points and the selected lines, and repeat the previous step to obtain a stable vanishing point. Reference (Ding Weili, Li Yong, Wang Wenfeng, et al. Vanishing point detection algorithm for urban road images based on vertical envelope and parallel line pairs [J]. Acta Optica Sinica, 2014) proposes a new vanishing point detection algorithm for urban road images based on vertical envelope and parallel line pairs. Using the vertical lines in the image, a vertical area envelope estimation method is proposed, and the road area segmentation is realized, effectively extracting the parallel line pairs in the road area. The parallel lines in the road area are divided into two categories using the direction grouping strategy, and the intersection points of the approximately symmetrical straight line pairs are calculated. The vanishing points in urban road scenes are estimated by combining Cmeans clustering and statistics. The literature (Luo Xiaosong. Road vanishing point detection based on Weber local features [D]. Chongqing University, 2014) proposes a road vanishing point detection method based on improved WLD. First, the road image is preprocessed to reduce the impact of image noise on the vanishing point detection process. Then, the improved WLD is used to extract the local texture features of the road image. Next, the differential excitation component in the improved WLD is used to extract the salient area of the road to reduce the interference of environmental noise on the detection results. Finally, according to the directional component in the improved WLD and the salient area of the road image, the proposed linear voting mode is used to obtain the main vanishing point of the road image. Summary of the invention
[0005] In view of the shortcomings of the above-mentioned technologies, a navigation vanishing point detection method applied to complex alley scenes is provided to solve the problems of many interference factors, uneven lighting, lack of straight line features, and the existing algorithms are not suitable for complex alley scenes.
[0006] In order to solve the above technical problems, the present invention is applied to a navigation vanishing point detection method for complex lane scenes, which is characterized by the following steps:
[0007] Step 1) the acquired lane scene image is preprocessed by scaling, filtering, and graying in sequence, and then the straight lines in the preprocessed lane scene image are extracted using the LSD straight line detection algorithm;
[0008] Step 2) setting a straight line length threshold to remove interfering straight lines with shorter lengths in the preprocessed lane scene image;
[0009] Step 3) based on the distribution form of the pixels in the digital image, the interference straight lines generated by the shadow area in the image are removed by adding the average gradient constraint;
[0010] Step 4) combining motion estimation technology, introducing a scaling factor on the basis of the traditional block matching algorithm to form an improved block matching algorithm, and using the improved block matching algorithm to obtain the block motion trajectory straight line of adjacent frame images for the preprocessed lane scene image;
[0011] Step 5) convert the obtained block motion trajectory straight line into sample points in the parameter space, and use the LOF algorithm to calculate the abnormal factor value of each sample point;
[0012] Step 6) The abnormal factor value of the sample point and the length of the straight line corresponding to the sample point are used as the standard for measuring the importance of the straight line, and the weight function of the sample point is determined based on this. The straight line in this step includes the straight line remaining after removing the interfering straight line and the generated block motion trajectory straight line;
[0013] Step 7) Finally, the improved RANSAC random sampling algorithm is used to extract the effective straight line model in the sample space, and the vanishing point coordinates in the lane scene image can be calculated based on the effective straight line model.
[0014] The specific contents of step 1) include:
[0015] Step 11) In order to improve the execution efficiency of the algorithm, before extracting the straight line features of the complex scene image of the lane, the resolution of the original image is first reduced. By reducing the resolution of the image, the amount of image data is greatly reduced, the interference of very short straight lines is eliminated, and important straight line features are retained;
[0016] Step 12) In complex lane scenes, since the transmission of digital images is extremely susceptible to electromagnetic interference, a bilateral filtering algorithm is used to remove noise from the image to prevent the noise from affecting the results of straight line feature extraction. The kernel function of the bilateral filtering algorithm is as follows:
[0017]
[0018] Where: w(i,j,p,q) is determined by the spatial domain kernel and the pixel range domain kernel, (i,j) and (p,q) represent the coordinates of two pixel points respectively;
[0019] Step 13) Convert the filtered image into a grayscale image to improve the operation speed of the algorithm. The formula used for image grayscale is as follows:
[0020] Gray(i,j)=0.299R(i,j)+0.578G(i,j)+0.114B(i,j) (2)
[0021] Where: R(i,j), G(i,j), B(i,j) represent the pixel values of the red, green, and yellow channels at coordinate (i,j) in the RGB image respectively;
[0022] Step 14) Use the LSD algorithm to detect the straight lines on the grayscale image, and output the starting and ending coordinates of each straight line in the grayscale image through the LSD algorithm. The starting and ending coordinates of the nth straight line are (x sn ,y sn )、(x zn ,y zn ).
[0023] The specific contents of step 2) include:
[0024] Step 21) According to the (x obtained in step 14) sn ,y sn )、(x zn ,y zn ) Find the length l of the nth line n , set the length threshold to 15 pixels and remove the length l n Lines with ≤15 pixels are selected, otherwise they are retained.
[0025] The specific contents of step 3) include:
[0026] Step 31) Remove the length l n After the interference line with ≤15 pixels is formed, the remaining lines are divided into two groups according to their starting and ending coordinates (x sn ,y sn )、(x zn ,y zn ) Find the equation of the nth line among the remaining lines fn (x n )=y n =kx n +b, then the number of pixels on the nth straight line in the digital image is m n =max{x sn -x zn |,|y sn -y zn |}+1;
[0027] Step 32) If |x zn -x sn |>|y zn -y sn |, calculate f based on the equation of the line n (x n ) and round it up, then the point (x sn ,y sn ) is the pixel point in the area (x sn ,f n (x sn )+1),(x sn ,f n (x sn )-1);
[0028] Step 33) According to step 31) and step 32), all the pixels on the nth line and their neighboring pixels are combined into a point set [(x i ,y i ),i=1,2,…,m n ];
[0029] Step 34) Calculate the gradient amplitude of each pixel in the point set. Assuming that the coordinates of a pixel are (x, y), g(x, y) is the grayscale value of the pixel. The gradient components of the pixel in the x and y directions are calculated by the following formula:
[0030]
[0031] Where: d x (x,y),d y (x, y) represents the gradient components of the pixel in the x direction and y direction respectively;
[0032] Step 35) The gradient amplitude of the pixel is
[0033] Step 36) Use equation (4) to calculate the average gradient amplitude d of each line neighborhood point set avg ,
[0034]
[0035] Step 37) According to d avg The size of the line determines whether the line is generated by the shadow area. If d avg If ≤10, the line is considered to be generated by the shadow area and is removed, otherwise the line is retained;
[0036] Step 38) The straight lines after removing the interfering straight lines are divided into a group and recorded as A = {a1, a2, ..., a n}, where n represents the number of remaining straight lines after removing interfering straight lines.
[0037] The specific contents of step 4) include:
[0038] Step 41) Assume that the resolution of the preprocessed image is W×H and the block side length is N, that is, the image can be divided into blocks of the same size;
[0039] Step 42) Assume that a block in the current frame image is K0, and the coordinates of the central pixel point of the K0 block are (x0, y0). In the next frame image, with (x0, y0) as the center and a distance of 4, search for a total of 8 points in the top, bottom, left, right and diagonal directions;
[0040] Step 43) Find the block [K t ,t=1,2,…,8], use formula (5) to calculate the mean absolute deviation (MAD) between each block and K0:
[0041]
[0042] Where: K 0ij and K ij Represents the pixel value of the pixel at the i-th row and j-th column in the block;
[0043] Step 44) With the block with the smallest MAD value in the previous step as the center and an interval of 2, search for a total of 8 points in the top, bottom, left, right and diagonal directions;
[0044] Step 45) Repeat step 42), halve the interval again, find 8 points above, below, left, right, and diagonally opposite the closest point as the center, and set the scaling factors to 1, That is to say, three different blocks with side lengths of N, N+2, and N+4 are taken, and 24 blocks are generated in this step;
[0045] Step 46) Use the resize function in the OpenCV library to scale the 24 blocks into blocks with a side length of N, and then calculate the MAD value of each block and K0. Assume that the block with the smallest MAD value is K1, and K1 is the block in the next frame image that is most similar to K0;
[0046] Step 47) Connect the center points (x1, y1) and (x0, y0) of the K1 block in the next frame image, and the resulting straight line is the block motion trajectory straight line;
[0047] Step 48) The block motion trajectory straight lines in the image are divided into a group and recorded as B = {a1, a2, ..., a m}, where m represents the number of block motion trajectory lines in the image.
[0048] The specific contents of step 5) include:
[0049] Step 51) grouping the straight line sets A and B obtained in step 38) and step 48) into one group to obtain (m+n) straight lines, and converting all the straight lines into sample points in the (k, b) parameter space, that is, each sample point in the parameter space corresponds to a straight line in the image;
[0050] Step 52) Calculate the outlier factor value of each sample point using the LOF algorithm. Assume that the outlier factor value of the i-th sample point is represented by LOF i , according to LOF i The size of LOF is used to judge the abnormality of the i-th sample point. i The closer it is to 1, the closer the i-th sample point is to normal.
[0051] The specific contents of step 6) include:
[0052] Step 61) The abnormal factor value of the sample point and the length of the straight line corresponding to the sample point are used as the measure of the importance of the sample point. Based on this, the weight function W of the i-th sample point is i The definition is as follows:
[0053]
[0054] Where: l i Indicates the length of the straight line corresponding to the i-th sample point, t i It is the weight used to measure the abnormality of the sample point. i The closer to 1, the i The larger it is, the closer the sample points are to normal.
[0055] The specific contents of step 7) include:
[0056] Step 71) randomly select two sample points (k1, b1) and (k2, b2) in the parameter space, and calculate the equation of the straight line passing through the two points b=c1k+c2, where c1 and c2 are the parameters of the straight line mathematical model;
[0057] Step 72) Calculate the distance dist from other sample points in the parameter space to the straight line, and set the allowable error to ε. If the sample point satisfies the condition dist≤ε, it is marked as an inner point, otherwise it is marked as an outer point;
[0058] Step 73) Calculate the weight of each interior point according to the weight function of formula (6), and sum them up, denoted as sum;
[0059] Step 74) Repeat steps 71), 72), and 73) until all combinations of two sample points are traversed and the maximum value of sum is found. max , and record the corresponding straight line mathematical model b=c1k+c2, the point (c1, c2) is the vanishing point coordinates in the original image.
[0060] The method for calculating the average gradient of straight lines proposed in the present invention can effectively eliminate the straight lines generated by the shadow area in the image, and obtain a more accurate straight line detection result. At the same time, combined with the motion estimation technology, an improved block matching algorithm is used to obtain the block motion trajectory straight line in the image, which solves the problem of lack of straight line features in the lane scene; then the improved block matching algorithm is used to estimate the vanishing point, so that the present invention has higher accuracy of vanishing point detection in the complex environment of the lane. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 Schematic diagram of an image block matching algorithm of a navigation vanishing point detection method applied to a complex alley scene of the present invention;
[0062] Figure 2 It is a schematic diagram of the distribution form of straight lines in the digital image of the present invention;
[0063] Figure 3 This is a schematic diagram of the RANSAC algorithm of the present invention for judging internal and external points;
[0064] Figure 4 It is a flow chart of a vanishing point detection method of a navigation vanishing point detection method applied to complex lane scenes of the present invention. DETAILED DESCRIPTION
[0065] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the protection scope of the present invention.
[0066] like Figure 4As shown, the present invention is a navigation vanishing point detection method applied to complex lane scenes. First, the LSD straight line detection algorithm is used to extract straight line features from the lane scene image to obtain straight line information in the image; then the length threshold is set to remove shorter straight lines in the image, and the interference straight lines generated by the shadow area in the image are removed by adding the average gradient constraint; then the relationship between continuous frame images is fully utilized in combination with the motion estimation technology, and a scaling factor is added on the basis of the traditional block matching algorithm to increase the available straight line information in the image and to assist in vanishing point estimation; finally, after the detected straight line is converted into a sample point in the parameter space, the abnormal factor value of each sample point is calculated by the LOF algorithm, and the abnormal factor value of the sample point and the length of the straight line are used together as the standard for measuring the importance of the sample point, and the weight function of the sample point is designed accordingly, and finally the improved RANSAC algorithm is used to perform regression estimation of the vanishing point. The advantages of this method over other algorithms are: the interference straight line removal effect is good, and the problem of lack of straight line features in complex lane scenes can be solved. The final vanishing point detection accuracy is higher, and it is more suitable for complex lane scenes.
[0067] The navigation vanishing point detection method in a complex lane scene adopted by the present invention is as follows, and the specific steps are as follows:
[0068] Step 1) the acquired lane scene image is preprocessed by scaling, filtering, and graying in sequence, and then a Line Segment Detector (LSD) detection algorithm is used to extract straight lines in the preprocessed lane scene image;
[0069] Step 11) In order to improve the execution efficiency of the algorithm, before extracting the straight line features of the complex lane scene image, the resolution of the original image is first reduced. By reducing the resolution of the image, the amount of image data can be greatly reduced. Although a small part of the details will be lost, the important straight line features can still be retained. At the same time, the interference of some very short straight lines can be eliminated, which has more advantages than disadvantages.
[0070] Step 12) In complex lane scenes, the transmission of digital images is very susceptible to electromagnetic interference, and Gaussian noise and salt and pepper noise are inevitably generated in the image. In order to prevent this part of the noise from affecting the results of straight line feature extraction, a bilateral filtering algorithm is used to remove the noise in the image, where the kernel function of the filtering algorithm is as follows:
[0071]
[0072] Where: w(i,j,p,q) is determined by the spatial domain kernel and the pixel range domain kernel, (i,j) and (p,q) represent the coordinates of two pixel points respectively;
[0073] Step 13) Convert the filtered image into a grayscale image to improve the algorithm's operation speed. The method of graying the image is as follows:
[0074] Gray(i,j)=0.299R(i,j)+0.578G(i,j)+0.114B(i,j) (14)
[0075] Where: R(i,j), G(i,j), B(i,j) represent the pixel values of the red, green, and yellow channels at coordinate (i,j) in the RGB image respectively;
[0076] Step 14) Use the LSD algorithm on the grayscale image to detect the straight line features in the image. The algorithm outputs the starting and ending coordinates of each straight line in the image. Assume that the starting and ending coordinates of the nth straight line are (x sn ,y sn )、(x zn ,y zn ).
[0077] like Figure 2 and Figure 3 As shown, step 2) sets the straight line length threshold to remove the shorter interfering straight lines in the preprocessed lane scene image; specifically, the length l of the nth straight line is calculated based on (xsn, ysn) and (xzn, yzn) n , set the length threshold to 15 pixels, that is, when the length of the line meets l n When the value is ≤15 pixels, the line is removed, otherwise it is retained.
[0078] Step 3) based on the distribution form of the pixels in the digital image, the interference straight lines generated by the shadow area in the image are removed by adding the average gradient constraint;
[0079] Step 31) Remove the length l n After the interference line with ≤15 pixels, the starting and ending coordinates (x sn ,y sn )、(x zn ,y zn ) Find the equation of the nth line f n (x n )=y n =kx n +b, then the number of pixels on the nth straight line in the digital image is m n =max{x sn -x zn |,|y sn -y zn |}+1;
[0080] Step 32) If |xzn -x sn |>|y zn -y sn |, calculate f based on the equation of the line n (x n ) and round it up, then the point (x sn ,y sn ) is the pixel point in the area (x sn ,f n (x sn )+1),(x sn ,f n (x sn )-1);
[0081] Step 33) According to step 31) and step 32), all the pixels on the nth line and their neighboring pixels are combined into a point set [(x i ,y i ),i=1,2,…,m n ];
[0082] Step 34) Calculate the gradient amplitude of each pixel in the point set. Assuming that the coordinates of a pixel are (x, y), g(x, y) is the grayscale value of the pixel. The gradient components of the pixel in the x and y directions are calculated by the following formula:
[0083]
[0084] Where: d x (x,y),d y (x, y) represents the gradient components of the pixel in the x direction and y direction respectively;
[0085] Step 35) The gradient amplitude of the pixel is
[0086] Step 36) Calculate the average gradient amplitude d of each line neighborhood point set avg , the calculation method is as follows:
[0087]
[0088] Step 37) According to d avg The size of the line determines whether it is generated by the shadow area. If d avg If ≤10, the line is considered to be generated by the shadow area and is removed, otherwise the line is retained;
[0089] Step 38) The straight line group after eliminating the interfering straight lines is recorded as A = {a1, a2, ..., a n}, where n represents the number of remaining straight lines after removing interfering straight lines.
[0090] like Figure 1 As shown, step 4) combines motion estimation technology, introduces a scaling factor based on the traditional block matching algorithm, and uses an improved block matching algorithm to obtain the block motion trajectory straight line of adjacent frame images for the pre-processed lane scene image;
[0091] Step 41) Assume that the resolution of the preprocessed image is W×H and the block side length is N, that is, the image can be divided into blocks of the same size;
[0092] Step 42) Assume that a block in the current frame image is K0, and the coordinates of the central pixel point of the K0 block are (x0, y0). In the next frame image, with (x0, y0) as the center and a distance of 4, search for a total of 8 points in the top, bottom, left, right and diagonal directions;
[0093] Step 43) Find the block [K t ,t=1,2,…,8], calculate the mean absolute deviation MAD (Mean Absolute Deviation) between each block and K0, the calculation method is as follows:
[0094]
[0095] Where: K 0ij and K ij Represents the pixel value of the pixel at the i-th row and j-th column in the block;
[0096] Step 44) With the block with the smallest MAD value in the previous step as the center and an interval of 2, search for a total of 8 points in the top, bottom, left, right and diagonal directions;
[0097] Step 45) Repeat step 42) and halve the interval again to find 8 points above, below, left, right, and diagonally opposite the closest point as the center. Set the scaling factors to 1, That is to say, three different blocks with side lengths of N, N+2, and N+4 are taken, which means that 24 blocks are generated in this step;
[0098] Step 46) Use the resize function in the OpenCV library to scale the 24 blocks into blocks with a side length of N, and then calculate the MAD value of each block and K0. Assume that the block with the smallest MAD value is K1, and K1 is the block in the next frame image that is most similar to K0;
[0099] Step 47) Connect the center points (x1, y1) and (x0, y0) of the K1 block in the next frame image, and the resulting straight line is the block motion trajectory straight line;
[0100] Step 48) The block motion trajectory straight lines in the image are divided into a group and recorded as B = {a1, a2, ..., am}, where m represents the number of block motion trajectory lines in the image.
[0101] like Figure 2 As shown, step 5) converts the obtained block motion trajectory straight line into sample points in the parameter space, and uses the LOF (Local Outlier Factor) algorithm to calculate the outlier factor value of each sample point;
[0102] Step 51) grouping the straight line sets A and B obtained in step 38) and step 48) into one group to obtain (m+n) straight lines, and converting all the straight lines into sample points in the (k, b) parameter space, that is, each sample point in the parameter space corresponds to a straight line in the image;
[0103] Step 52) Calculate the outlier factor value of each sample point using the LOF algorithm. Assume that the outlier factor value of the i-th sample point is represented by LOF i , according to LOF i The size of LOF is used to judge the abnormality of the i-th sample point. i The closer it is to 1, the closer the i-th sample point is to normal.
[0104] Step 6) The abnormal factor value of the sample point and the length of the straight line corresponding to the sample point are used together as a criterion for measuring the importance of the straight line (including the straight line remaining after removing the interfering straight line and the generated block motion trajectory straight line), and the weight function of the sample point is determined based on this; specifically, the abnormal factor value of the sample point and the length of the straight line corresponding to the sample point are used together as a criterion for measuring the importance of the sample point. Based on this, the weight function of the i-th sample point is defined as follows:
[0105]
[0106] Where: l i Indicates the length of the straight line corresponding to the i-th sample point, t i It is the weight used to measure the abnormality of the sample point. i The closer to 1, the i The larger it is, the closer the sample points are to normal.
[0107] Step 7) Finally, the improved RANSAC (RANdom SAmple Consensus) algorithm is used to extract the effective straight line model in the sample space, and the vanishing point coordinates in the lane scene image can be obtained based on the effective straight line model;
[0108] Step 71) randomly select two sample points (k1, b1) and (k2, b2) in the parameter space, and calculate the equation of the straight line passing through the two points b=c1k+c2, where c1 and c2 are the parameters of the straight line mathematical model;
[0109] Step 72) Calculate the distance dist from other sample points in the parameter space to the straight line, and set the allowable error to ε. Mark the sample points that meet the condition dist≤ε as internal points, otherwise mark them as external points;
[0110] Step 73) Calculate the weight W of each interior point according to the weight function of formula (18), and sum them up. The sum of the weights of all interior points is recorded as sum;
[0111] Step 74) Repeat steps 71), 72), and 73) until all combinations of two sample points are traversed and the maximum value of sum is found. max , and record the corresponding straight line mathematical model b=c1k+c2, the point (c1, c2) is the vanishing point coordinates in the original image.
Claims
1. A navigation vanishing point detection method for complex lane scenes. Features Here are the steps: Step 1) the acquired lane scene image is preprocessed by scaling, filtering, and graying in sequence, and then the straight lines in the preprocessed lane scene image are extracted using the LSD straight line detection algorithm; Step 2) setting a straight line length threshold to remove interfering straight lines with shorter lengths in the preprocessed lane scene image; Step 3) based on the distribution form of the pixels in the digital image, the interference straight lines generated by the shadow area in the image are removed by adding the average gradient constraint; Step 4) combining motion estimation technology, introducing a scaling factor on the basis of the traditional block matching algorithm to form an improved block matching algorithm, and using the improved block matching algorithm to obtain the block motion trajectory straight line of adjacent frame images for the preprocessed lane scene image; The specific contents of step 4) include: Step 41) Assume that the resolution of the preprocessed image is W×H, and the block length is N, that is, the image is divided into blocks of the same size; Step 42) Assume that a block in the current frame image is K 0 , K 0 The coordinates of the center pixel of the block are (x 0 ,y 0 ), in the next frame image (x 0 ,y 0 ) as the center, with a distance of 4, search for a total of 8 points up, down, left, right and diagonally; Step 43) Find the block [K t ,t=1,2,…,8], use formula (5) to calculate the relationship between each block and K 0 Mean Absolute Deviation (MAD): Where: K 0ij and K tij Represents the pixel value of the pixel at the i-th row and j-th column in the block; Step 44) With the block with the smallest MAD value in the previous step as the center and an interval of 2, search for a total of 8 points in the top, bottom, left, right and diagonal directions; Step 45) Repeat step 42), halve the interval again, find 8 points above, below, left, right, and diagonally opposite the closest point as the center, and set the scaling factors to 1, That is to say, three different blocks with side lengths of N, N+2, and N+4 are taken, and 24 blocks are generated in this step; Step 46) Use the resize function in the OpenCV library to scale the 24 blocks into blocks with a side length of N, and then calculate the relationship between each block and K 0 MAD value, assuming that the block with the smallest MAD value is K 1 , K 1 That is, the next frame image and K 0 Most similar blocks; Step 47) In the next frame image, K 1 The center point of the block (x 1 ,y 1 ) and (x 0 ,y 0 ) are connected, and the resulting straight line is the block motion trajectory straight line; Step 48) The block motion trajectory straight lines in the image are divided into a group and recorded as B = {a 1 ,a 2 ,…,a m }, where m represents the number of straight lines of block motion trajectories in the image; Step 5) convert the obtained block motion trajectory straight line into sample points in the parameter space, and use the LOF algorithm to calculate the abnormal factor value of each sample point; Step 6) The abnormal factor value of the sample point and the length of the straight line corresponding to the sample point are used as the standard for measuring the importance of the straight line, and the weight function of the sample point is determined based on this. The straight line in this step includes the straight line remaining after removing the interfering straight line and the generated block motion trajectory straight line; The specific contents of step 6) include: Step 61) The abnormal factor value of the sample point and the length of the straight line corresponding to the sample point are used as the measure of the importance of the sample point. Based on this, the weight function W of the i-th sample point is i The definition is as follows: Where: l i Indicates the length of the straight line corresponding to the i-th sample point, t i It is the weight used to measure the abnormality of the sample point. i The closer to 1, the i The larger it is, the closer the sample point is to normal. The abnormal factor value of the i-th sample point is expressed as LOF i ; Step 7) Finally, the improved RANSAC random sampling algorithm is used to extract the effective straight line model in the sample space, and the vanishing point coordinates in the lane scene image can be obtained according to the effective straight line model; The content of step 7) includes: Step 71) Randomly select two sample points (k 1 ,b 1 ), (k 2 ,b 2 ), calculate the equation of the line passing through these two points b = c 1 k+c 2 , where c 1 、c 2 are the parameters of the straight line mathematical model; Step 72) Calculate the distance dist from other sample points in the parameter space to the straight line, and set the allowable error to ε. If the sample point satisfies the condition dist≤ε, it is marked as an inner point, otherwise it is marked as an outer point; Step 73) Calculate the weight of each interior point according to the weight function of formula (6), and sum them up, denoted as sum; Step 74) Repeat steps 71), 72), and 73) until all combinations of two sample points are traversed and the maximum value of sum is found. max , and record the corresponding straight line mathematical model b = c 1 k+c 2 , point (c 1 ,c 2 ) is the vanishing point coordinate in the original image.
2. According to claim 1, a navigation vanishing point detection method applied to complex lane scenes, Features: The specific contents of step 1) include: Step 11) In order to improve the execution efficiency of the algorithm, before extracting the straight line features of the complex scene image of the lane, the resolution of the original image is first reduced. By reducing the resolution of the image, the amount of image data is greatly reduced, the interference of very short straight lines is eliminated, and important straight line features are retained; Step 12) In the complex tunnel scene, since the transmission of digital images is very susceptible to electromagnetic interference, a bilateral filtering algorithm is used to remove noise in the image to prevent the noise from affecting the results of straight line feature extraction. The kernel function of the bilateral filtering algorithm is as follows: Where: w(i,j,p,q) is determined by the spatial domain kernel and the pixel range domain kernel, (i,j) and (p,q) represent the coordinates of two pixel points respectively; Step 13) Convert the filtered image into a grayscale image to improve the operation speed of the algorithm. The formula used for image grayscale is as follows: Gray(i,j)=0.299R(i,j)+0.578G(i,j)+0.114B(i,j) (2) Where: R(i,j), G(i,j), B(i,j) represent the pixel values of the red, green, and yellow channels at coordinate (i,j) in the RGB image respectively; Step 14) Use the LSD algorithm to detect the straight lines on the grayscale image, and output the starting and ending coordinates of each straight line in the grayscale image through the LSD algorithm. The starting and ending coordinates of the nth straight line are (x sn ,y sn )、(x zn ,y zn ).
3. According to claim 2, a navigation vanishing point detection method applied to complex lane scenes, Features: The specific contents of step 2) include: Step 21) According to the (x obtained in step 14) sn ,y sn )、(x zn ,y zn ) Find the length l of the nth line n , set the length threshold to 15 pixels and remove the length l n Lines with ≤15 pixels are selected, otherwise they are retained.
4. According to claim 3, a navigation vanishing point detection method applied to complex lane scenes, Features: The specific contents of step 3) include: Step 31) Remove the length l n After the interference line with ≤15 pixels is formed, the remaining lines are divided into two groups according to their starting and ending coordinates (x sn ,y sn )、(x zn ,y zn ) Find the equation of the nth line among the remaining lines f n (x n )=y n =kx n +b, then the number of pixels on the nth straight line in the digital image is m n =max{|x sn -x zn |,|y sn -y zn |}+1; Step 32) If |x zn -x sn |>|y zn -y sn |, calculate f based on the equation of the line n (x n ) and round it up, then the point (x sn ,y sn )’s neighboring pixel is (x sn ,f n (x sn )+1),(x sn ,f n (x sn )-1); Step 33) According to step 31) and step 32), all the pixels on the nth line and their neighboring pixels are combined into a point set [(x i ,y i ),i=1,2,…,m n ]; Step 34) Calculate the gradient amplitude of each pixel in the point set. Assuming that the coordinates of a pixel are (x, y), g(x, y) is the grayscale value of the pixel. The gradient components of the pixel in the x and y directions are calculated by the following formula: Where: d x (x,y),d y (x, y) represents the gradient components of the pixel in the x direction and y direction respectively; Step 35) The gradient amplitude of the pixel is Step 36) Use equation (4) to calculate the average gradient amplitude d of each line neighborhood point set avg , Step 37) According to d avg The size of the line determines whether the line is generated by the shadow area. If d avg If ≤10, the line is considered to be generated by the shadow area and is removed, otherwise the line is retained; Step 38) The straight lines after removing the interfering straight lines are divided into a group and recorded as A = {a 1 ,a 2 ,…,a n }, where n represents the number of remaining straight lines after removing interfering straight lines.
5. According to claim 1, a navigation vanishing point detection method applied to complex lane scenes, Features: The specific contents of step 5) include: Step 51) grouping the straight line sets A and B obtained in step 38) and step 48) into one group to obtain (m+n) straight lines, and converting all the straight lines into sample points in the (k, b) parameter space, that is, each sample point in the parameter space corresponds to a straight line in the image; Step 52) Calculate the outlier factor value of each sample point using the LOF algorithm. Assume that the outlier factor value of the i-th sample point is represented by LOF i , according to LOF i The size of LOF is used to judge the abnormality of the i-th sample point. i The closer it is to 1, the closer the i-th sample point is to normal.
