A river boundary detection method based on polarization image
Through polarization image processing and dual-channel thresholding method, the accuracy and real-time detection of river boundary lines of unmanned ships under severe weather conditions are solved, and efficient and accurate detection of river boundary lines is achieved.
Patent Information
- Application Number
- CN202310640670.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-05-31
AI Technical Summary
When existing unmanned ships detect river boundary lines, it is difficult for conventional sensors to achieve accurate detection in severe weather conditions, especially in strong sunlight reflections and haze environments. The image processing algorithm is complex and not real-time, and the robustness and accuracy are insufficient.
The river boundary line detection method based on polarized images is adopted, and the river scene data is obtained through the polarized image acquisition device, specular reflection and high-light area elimination are performed. Combined with the time and spatial domain processing, the fitted curve equation of the river boundary line is extracted, and the asynchronous parallel dual-channel threshold method and two-stage curve segment extraction method are used.
It effectively suppresses the interference of water surface light reflection and high-light area, enhances the river boundary feature information, improves the robustness and accuracy of river boundary detection, and meets the real-time perception needs of unmanned ships in complex environments.
Smart Images

Figure CN116797619B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent perception of unmanned ships, and in particular to a river boundary line detection method based on polarization images. Background Art
[0002] In recent years, unmanned watercraft (USV) technology has played an increasingly important role in patrolling, monitoring, and security missions. UUVs operating in inland waterways need to detect channel boundaries to determine the drivable area on the water surface. Narrow channel boundary detection is a crucial component of intelligent perception for UUVs. Because the water surface boundary is unknown, detecting the drivable area in a river is difficult. For computers, rivers lack clear boundaries to distinguish between areas within and outside the channel boundary.
[0003] Structured rivers are relatively standard and well-defined urban structures. These rivers have clear bank boundaries, a relatively simple background environment, and distinct geometric features at the river's edge. Therefore, these detection issues can be addressed by using inexpensive cameras as sensors and image processing algorithms to detect effective boundary lines, providing a low-cost perception solution for autonomous unmanned vessels.
[0004] Existing technologies for river boundary detection use conventional visible light cameras operating in the visible light band, resulting in unclear images in foggy conditions, at night, or in low-light environments. Furthermore, the water's surface reflects strong sunlight on clear days, exposing the camera to large areas and rendering the captured image inaccurate. These conditions hinder image processing algorithms from accurately detecting river channels. LiDAR (LiDAR) is expensive and suffers from strong interference in foggy and hazy conditions, leading to significant errors in detection data. Therefore, conventional sensors are not suitable for use in adverse weather conditions.
[0005] In practical applications, there is a lot of noise interference in the images obtained by USV, especially in the following situations:
[0006] (1) When the sunlight is strong, there are many rays of light and reflections on the water surface. When the sunlight is incident on the water surface, strong reflected radiation is formed in the mirror direction, forming the mirror reflection of the water body.
[0007] (2) There are waves on the water surface, and flashes are formed on the top of the waves, forming a large area of highlight area;
[0008] (3) The boundary between the river bank and the water surface is unclear;
[0009] (4) The color of the sky is similar to that of the water surface, so it is unreliable to judge this area based on the position alone.
[0010] Although image processing methods currently exist for the above-mentioned extreme driving conditions, among these existing methods, those based on ordinary images have complex computational processes and are difficult to meet real-time requirements; those based on polarization images are mostly scenario-specific and are difficult to meet the requirements of water surface environments; and conventional river boundary detection methods have low accuracy and robustness, making it difficult to meet the high-precision requirements of unmanned perception systems. Summary of the Invention
[0011] The purpose of the present invention is to provide a river boundary line detection method based on polarization images to solve the problems raised in the above background technology.
[0012] To achieve the above object, the present invention provides the following technical solutions:
[0013] A method for detecting river boundary lines based on polarization images, comprising the following steps:
[0014] Step 1: Obtain image data of the river scene in front of the unmanned boat through a polarization image acquisition device;
[0015] Step 2: Extract polarization characteristic images at different angles, process the water surface polarization characteristic images, and remove mirror reflections and highlight areas to obtain a denoised image.
[0016] Step 3: Process the image after noise reduction in step 2 to obtain the fitting curve equation of the river boundary line.
[0017] As a further solution of the present invention: the elimination of the specular reflection and highlight area in step 2 includes the following steps:
[0018] Step 2.1, obtain polarization images of the four polarization directions of polarization angles θ = 0, π / 4, π / 2, 3π / 4,
[0019]
[0020] Where S0, S1, S2 are Stokes vector parameters, and θ is the polarization angle;
[0021] Step 2.2: Generate a time domain polarization radiation pattern by suppressing the time domain specular reflection and obtain the time domain highlight elimination result I time ; Select the polarization direction perpendicular to the polarization angle to generate the polarization radiation pattern I ⊥ ,Pick Polarization radiation pattern with the strongest suppression effect on specular reflection light in the vertical direction
[0022]
[0023] When the imaging environment and detection equipment remain unchanged, the amount of reflected light fluctuates little over time. By using this characteristic, the I ⊥ Composed image sequence, time domain fusion is performed, that is, the minimum gray value of the corresponding pixel in the time series image is assigned to the final image I time (x,y)
[0024]
[0025] I time (x,y)=min{I m (x,y,t1),I m (x,y,t2),…,I m (x,y,t nt )}
[0026] where t1, t2, …, t nt is a continuous time series;
[0027] Step 2.3: Generate a spatial domain polarization radiation pattern by suppressing the spatial domain specular reflection, and obtain the spatial domain highlight elimination result I space ;
[0028] Step 2.4: Fuse the spatiotemporal specular reflection suppression images to obtain a fused image of the final specular reflection elimination result.
[0029] As a further solution of the present invention: the spatial domain highlight removal process in step 2.3 includes the following steps:
[0030] Step 2.3.1. Select the polarized radiation pattern with the strongest suppression effect on specular reflection light from the four polarized radiation patterns, and select the region R with strong light from it through the clustering algorithm. k ,
[0031]
[0032] Among them, Ig θ (x,y) is the grayscale value of the image pixel, δ g is the high light intensity threshold;
[0033] Step 2.3.2, calculate the linear polarization degree DOP and polarization angle AOP of polarized light,
[0034]
[0035] Among them, S0, S1, S2, and S3 are Stokes vector parameters S = [S0, S1, S2, S3]. Four polarization angles of 0°, 45°, 90°, and 135° are selected, and the light intensity information obtained is used to calculate the relevant polarization information. Among them, S0 represents the total intensity image of the light wave, that is, I; S1 is the intensity difference of linearly polarized light in the horizontal and vertical directions; S2 is the intensity difference of linearly polarized light in the 45° direction and 135° direction; S3 represents the intensity difference between right-handed and left-handed circularly polarized light;
[0036] Step 2.3.3, respectively in the highlight area R k (k=1,2…m r ) Perform gradient feature fusion on the polarization degree and polarization angle images:
[0037] Step 2.3.4: Sum the specular reflected light to obtain the spatial domain polarization image processing result
[0038]
[0039] Among them, m r The highlight area R k The number of .
[0040] As a further solution of the present invention: the gradient fusion process in step 2.3.3 includes the following steps:
[0041] Step 2.3.3.1, normalize the polarization degree image and the polarization angle image;
[0042]
[0043] Step 2.3.3.2, calculate the gradient features of the polarization degree image and the polarization angle image;
[0044] The two images are respectively in R k The gradient feature calculation within the region is as follows
[0045]
[0046] Where M and N represent the width and height of the image respectively, ΔI x (x,y) and ΔI y (x,y) represents the first-order difference of the image f(x,y) in the x and y directions respectively, and the calculation method is as follows
[0047] ΔI x (x,y)=f(x,y)-f(x-1,y)
[0048] ΔI y (x,y)=f(x,y)-f(x,y-1)
[0049] Step 2.3.3.3: Perform weighted fusion of the polarization degree image and the polarization angle image. The fusion formula of the polarization degree image and the polarization angle image is as follows:
[0050]
[0051] Among them F p,k Indicates the highlight area R k The image after the polarization information gradient feature fusion, G AOP and G DOP are the gradient features corresponding to the polarization angle and polarization degree images, respectively. μ is the weight coefficient. The polarization angle image contains more information than the polarization degree image, so 0.5<μ<1 is set.
[0052] As a further solution of the present invention: the fusion in step 2.4 includes the following steps:
[0053] Step 2.4.1 Select I time and I space R k Sub-image corresponding to the region and Perform fusion and calculate covariance
[0054]
[0055] and the covariance matrix
[0056]
[0057] Where n is the sub-image and The total number of pixels, is the i-th pixel of the corresponding sub-image, is the pixel mean of the corresponding sub-image, * represents the complex conjugate;
[0058] Step 2.4.2: Calculate the eigenvalues λ1 and λ2 and eigenvectors v1 and v2 of the covariance matrix C to obtain the diagonal matrix D and the matrix V, where V is a reversible matrix consisting of the eigenvectors.
[0059]
[0060] Step 2.4.3 Take the eigenvector v = [v1, v2] corresponding to the maximum eigenvalue T , calculate the weighting coefficient ξ of the sub-image:
[0061]
[0062] Step 2.4.4 Calculate the fused sub-image
[0063] Step 2.4.5 Repeat the above steps until all highlight areas are fused, and then add these processed sub-images to the original image to obtain the complete fused image F(x,y)
[0064]
[0065] In the formula Indicates that only sub-images are replaced and superimposed, K f is the number of sub-images, and f(x,y) is the original polarization image.
[0066] As a further solution of the present invention: the acquisition of the fitting curve of the river boundary in step 3 includes the following steps:
[0067] Step 3.1, pre-process the image and reduce noise;
[0068] Step 3.2: Extract the river edge features asynchronously and in parallel through dual-channel thresholds, and fuse the dual-channel extraction results to obtain the river boundary feature pixel candidate points C. cand ;
[0069] Step 3.3: Extract the river boundary line features through a two-stage curve segment extraction method and fit the curve equation.
[0070] As a further solution of the present invention: the step 3.2 dual-channel threshold asynchronous parallel means edge feature extraction and image segmentation feature two-channel asynchronous parallel calculation of the river edge, the river boundary feature pixel candidate point C cand It is to merge the binary image edge pixel values obtained by edge feature extraction and image segmentation features, that is:
[0071] C cand =C edge ∪C seg ;
[0072] Where: C edge is the candidate point set obtained by edge feature extraction; C seg It is the set of candidate points obtained by image segmentation features.
[0073] As a further solution of the present invention: the candidate point set C edge The candidate point set C is obtained by using Gaussian directional filter to extract the river edge features in any direction. edge ;
[0074] In order to extract edge information, a second-order Gaussian directional filter is used to detect the river edge in any possible direction. The method is based on the directional derivative operator of the Gaussian function G(x,y) being directional controllable.
[0075]
[0076] Where x, y are Cartesian coordinates, and σ is the variance of the Gaussian kernel;
[0077] First, the basic filter is obtained by calculating the Gaussian directional derivative;
[0078] The second-order Gaussian directional filter for river channel edge extraction is calculated based on the basic filter, which is calculated by the directional derivatives in the x and y directions:
[0079]
[0080] Secondly, the basic filters are combined by the direction angle to obtain the filter response that can be calculated in any direction. The combination formula is:
[0081]
[0082] Where θ represents the direction angle. Two variable direction filters are used in the algorithm to extract the edge features of the left and right river channels respectively.
[0083] Finally, in order to highlight the edge line features of the river channel, the binarization method is used to set the threshold to obtain the edge extraction result:
[0084]
[0085] Get the candidate point set C edge ={(x,y)|I edge (x,y)=255}, where G thresh is the threshold;
[0086] As a further solution of the present invention: the candidate point set C seg First, the Gaussian mixture model GMM is used to segment the image and obtain the area image I where the water surface is located. water (u,v);
[0087] The distribution of GMM input data is a mixture of a set of multivariate Gaussian distributions, and the probability density function is:
[0088]
[0089] where π k is the weight of the kth Gaussian component, 0≤π k ≤1 and the sum is equal to 1, x represents the data point, K G is the total number of components, μ k and ∑ k are the mean and covariance parameters of the k-th component multivariate Gaussian function;
[0090] Each component follows a multivariate normal distribution, and its probability density function is:
[0091]
[0092] Where d is the number of dimensions, μ is the d-dimensional mean vector, Σ is the covariance matrix, and |Σ| is the determinant of Σ;
[0093] The feature vector of GMM is a four-dimensional vector containing red, green, and blue (RGB) values and the Sobel operator that minimizes non-edge noise.
[0094] x(k)=[R(u,v),G(u,v),B(u,v),S(u,v)]
[0095] Where x is the feature vector of the cropped ROI image, k is the index of x, and (u,v) is the image coordinate;
[0096] Secondly, the river and non-river areas obtained by image segmentation are determined to extract the water edge as the river boundary candidate point set C seg ;
[0097] Select I water The largest connected area of (u,v) is taken as the possible river area, the convex hull that can cover the river area is calculated, and then the river boundary point area C that needs to be fitted is found and separated. seg ;
[0098] ΔI(u,v)=I(u,v)-I(u-1,v)
[0099]
[0100] Get the candidate point set C seg ={(u,v)|I bd (u,v)=255}, where W thresh is the threshold.
[0101] As a further solution of the present invention: obtaining the fitting curve equation includes the following steps:
[0102] Step 3.3.1, the first stage of C cand Boundary points extract a set of small curve segments;
[0103] The small line segment set Q is obtained by clustering algorithm, and the small line segment set is composed of n s The continuous edge pixels p(x,y) are composed of points. i (x i ,y i ) and p j (x j ,y j ) are considered continuous when they meet the following conditions and are clustered together;
[0104] dist(p i ,p j )=|x i -x j |+|y i -y j | <d0
[0105] p i (x i ,y i )∈Q,p j (x j ,y j )∈Q, i≠j,
[0106] Where d0 is the distance threshold of continuous points;
[0107] Step 3.3.2, fitting a quadratic curve model to the edge points within the small curve segment;
[0108] The shape of the river channel is represented by a quadratic curve, and the quadratic equation of the river channel boundary line is defined as follows
[0109] x=f(y)=a0+a1y+a2y 2
[0110] When a2=0, it means that the boundary line model is a straight line, corresponding to the scenario where the river channel model is a straight line;
[0111] Fit a quadratic polynomial to m points (x i ,y i ), i=1,2,…m, by solving m equations and 3 unknowns a0, a1, a2, we get:
[0112]
[0113] The model solution process can be written as a matrix equation:
[0114] AX=B
[0115]
[0116] Define the residual e of the model k Used to solve the best model, it is defined as follows:
[0117]
[0118] Solve the residual e of the model k The minimization process can be calculated by solving the equations:
[0119] (A T A) X = A T B
[0120] Given the specific form of matrix A, substituting the matrix into the equation and explicitly performing matrix multiplication, the solution to the equation simplifies to:
[0121]
[0122] From the above formula, we can see that the matrix to be solved is symmetrical. The elements in the matrix are repeated, and the calculation results of the solution process can be reused, thereby reducing the computational cost. In order to prevent the numerical stability of the polynomial from being affected by the divergence of the point set, we improve the stability by normalizing the point set.
[0123] Step 3.3.3: In the second stage, cluster the small curve segments and group the small line segments, and group the small line segments with the same direction and collinearity into the same group;
[0124] By calculating the confidence level of curve similarity, small segments that are close and collinear are clustered together. Specifically, the judgment is made based on the coefficient difference and the shortest distance between the segments. The calculation formula is as follows:
[0125]
[0126]
[0127] Δd represents the curve l i and l j The shortest distance between them can be simplified by discrete sampling method. Δc is the difference of coefficients. α and β represent the weights of Δd and Δc in judging similarity. λ is the threshold of collinearity. represents the coefficients of the curve equation;
[0128] Step 3.3.4: Select the optimal boundary line from the clustered small line segments in the previous step and determine the left and right boundaries of the river channel;
[0129] The left and right boundaries must satisfy the following relationship
[0130] dist(L left ,L right )≥T d
[0131] len(L left) )≥T len ,len(L right) )≥T len
[0132] nums(L left ,L right )≥T n
[0133] nums(L left ,L right )=argmax{NUM(cond{f′ left (y k )·f′ right (y k )<0})}
[0134] Among them L left and L right The clustering result is the clustering of small line segments in the left and right boundary areas of the river. dist(L left ,L right ) is the distance between the two line segments, len(·) is the length of the line segment, T d and T len is the distance and length threshold, nums(L left ,L right ) represents the maximum number of points that simultaneously satisfy the opposite (positive and negative) directions of the tangent lines of the corresponding points in the horizontal direction of the left and right boundaries, cond{·} represents the satisfied conditional relationship, NUM(·) represents the number of points, and argmax{·} represents the maximum value that satisfies the condition;
[0135] Step 3.3.5: Combine the point sets of the left and right boundary line segments obtained in the previous step, and use the improved RANSAC algorithm to accurately fit the curve equations of the left and right boundary lines. The specific steps are as follows:
[0136] Step 3.3.5.1. Initialize the channel boundary model parameter vector Param = 0, the number of iterations k = 0, obtain the channel boundary feature point set P from the previous step, the internal point set H = NULL, the optimal parameter vector best_Param = NULL, the optimal score best_score = 0, and the maximum number of iterations is set according to the upper limit of the number of iterations K, iterations = INT(ξ*K) (ξ>1), where INT represents rounding up:
[0137]
[0138] where p exp is the probability that the expected iteration can get the correct result, w is the proportion of internal points, n inliers and n outliers are the number of interior and exterior points, respectively, and m is the number of model points on the river boundary line;
[0139] Step 3.3.5.2. Randomly select n points from P, where n = 3. The first point is random, and the y values of the points selected subsequently do not overlap with the previously selected points. Calculate Param = [a0, a1, a2] using these points. T , and add these n points to the interior point set H;
[0140] Step 3.3.5.3: For any point p i (x i , y i ), where p i ∈P, calculate err(p i ). If err(p i ) < E th , then add p i to the inlier set H. Repeat this step until all points have been judged. Here, err(p i ) is the error:
[0141] err(p i ) = |x i - a0 - a1y - a2y i 2 |
[0142] Step 3.3.5.4: If the number of inliers count(H) < T th or Param does not meet the requirements and H = NULL, then go to Step 3.3.5.2; otherwise, execute the next step;
[0143] Step 3.3.5.5: Take all points in the inlier set T, recalculate the parameter Param using the least squares method, and calculate the score score of the currently obtained inlier set k . If score k > best_score, then best_score = score k , best_Param = Param, H = NULL, the iteration number k = k + 1. The fitting score is calculated as follows:
[0144]
[0145] Step 3.3.5.6: If k < iterations, repeat Steps 3.3.5.2 - 3.3.5.5 until the iteration number meets the requirements.
[0146] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0147] 1. By performing polarization processing on the acquired river channel scene map, the present invention eliminates specular reflection and high - light areas in the picture through polarization processing, reducing the influence of water surface light reflection on the river channel boundary detection algorithm;
[0148] 2. The present invention proposes a polarization image fusion method based on the time domain, spatial domain, and gradient features, which makes the extraction of polarization feature images have the strongest high - light suppression effect, can enhance the feature information of the water surface boundary, and reduce the interference of invalid information in the image;
[0149] 3. The present invention provides an asynchronous parallel dual-channel threshold method for extracting river edge pixel features, which makes edge feature extraction more accurate and robust for river edge pixel extraction in various complex river environment scenes, and accelerates processing speed through asynchronous parallel operation;
[0150] 4. The present invention provides a method for extracting the characteristic equation of the river boundary line based on a two-stage curve segment extraction method. The two-stage design filters out redundant and noisy information while retaining key feature information, enhancing robustness and improving the boundary line fitting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0151] Figure 1 This is the main flow chart of the river boundary detection and evaluation method of the present invention;
[0152] Figure 2 This is a flow chart of the present invention for removing the highlight area on the water surface caused by specular reflection through polarization image processing;
[0153] Figure 3 This is a flow chart of extracting river edge points based on the asynchronous parallel dual-channel threshold method of the present invention;
[0154] Figure 4 This is a flow chart of extracting the curve equation of the river boundary line based on the two-stage curve segment extraction method of the present invention;
[0155] Figure 5 This is a schematic diagram of the tangent direction of points on the left and right boundary lines of the river channel of the present invention. DETAILED DESCRIPTION
[0156] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0157] See also Figure 1-5 In an embodiment of the present invention, a method for detecting river boundary lines based on polarization images includes the following steps:
[0158] Step 1: Acquire an image of the river scene in front of the unmanned boat. In this embodiment, a polarization camera installed in front of the unmanned boat captures the image of the river scene.
[0159] Step 2: Extract polarization feature images at different angles from the river scene image, process the water surface polarization feature image, and remove mirror reflection and highlight areas to obtain a denoised image;
[0160] The elimination of specular reflection and highlight areas in step 2 includes the following steps:
[0161] Step 2.1, obtain polarization images of the four polarization directions of polarization angles θ = 0, π / 4, π / 2, 3π / 4,
[0162]
[0163] Where S0, S1, S2 are Stokes vector parameters, and θ is the polarization angle;
[0164] Step 2.2: Generate a time domain polarization radiation pattern by suppressing the time domain specular reflection and obtain the time domain highlight elimination result I time ; Select the polarization direction perpendicular to the polarization angle to generate the polarization radiation pattern I ⊥ ,Pick Polarization radiation pattern with the strongest suppression effect on specular reflection light in the vertical direction
[0165]
[0166] When the imaging environment and detection equipment remain unchanged, the amount of reflected light fluctuates little over time. By using this characteristic, the I ⊥ Composed image sequence, time domain fusion is performed, that is, the minimum gray value of the corresponding pixel in the time series image is assigned to the final image I time (x,y)
[0167]
[0168] I time (x,y)=min{I m (x,y,t1),I m (x,y,t2),…,I m (x,y,t nt )}
[0169] where t1, t2, …, t nt is a continuous time series;
[0170] Step 2.3: Generate a spatial domain polarization radiation pattern by suppressing the spatial domain specular reflection, and obtain the spatial domain highlight elimination result I space ;
[0171] The spatial domain highlight removal process includes the following steps:
[0172] Step 2.3.1. Select the polarized radiation pattern with the strongest suppression effect on specular reflection light from the four polarized radiation patterns, and select the region R with strong light from it through the clustering algorithm. k ,
[0173]
[0174] Among them, Ig θ (x,y) is the grayscale value of the image pixel, δ g is the high light intensity threshold;
[0175] Step 2.3.2, calculate the linear polarization degree DOP and polarization angle AOP of polarized light,
[0176]
[0177] Among them, S0, S1, S2, and S3 are Stokes vector parameters S = [S0, S1, S2, S3]. Four polarization angles of 0°, 45°, 90°, and 135° are selected, and the light intensity information obtained is used to calculate the relevant polarization information. Among them, S0 represents the total intensity image of the light wave, that is, I; S1 is the intensity difference of linearly polarized light in the horizontal and vertical directions; S2 is the intensity difference of linearly polarized light in the 45° direction and 135° direction; S3 represents the intensity difference between right-handed and left-handed circularly polarized light;
[0178] The polarizer in the polarization camera sensor is microscopically implemented by a wire grid polarizer under each lens on the sensor. The polarizer has polarization angles of 0°, 45°, 90°, and 135° in four pixel groups, corresponding to I0, I 45 , I 90 and I 135 , respectively represent the polarized light of different polarization angles that can be transmitted;
[0179] Degree of polarization (I DOP ) image is mainly used to indicate the amount of linear polarization component in the reflected light, polarization angle (I AOP ) image is mainly used to represent the phase difference between the two components of radiation. DOP and I AOP The image can enhance the feature information of the target object by effectively fusing the two, so the next step is to perform fusion processing based on the gradient features of the two.
[0180] Step 2.3.3, respectively in the highlight area R k (k=1,2…m r ) Perform gradient feature fusion on the polarization degree and polarization angle images:
[0181] The gradient fusion process includes the following steps:
[0182] Step 2.3.3.1, normalize the polarization degree image and the polarization angle image;
[0183] When fusing polarization information images, the two images are first normalized. Normalization can make I DOP Image and I AOP The images are in the same range;
[0184]
[0185] Step 2.3.3.2, calculate the gradient features of the polarization degree image and the polarization angle image;
[0186] The two images are respectively in R k The gradient feature calculation within the region is as follows
[0187]
[0188] Where M and N represent the width and height of the image respectively, ΔI x (x,y) and ΔI y (x,y) represents the first-order difference of the image f(x,y) in the x and y directions respectively, and the calculation method is as follows
[0189] ΔI x (x,y)=f(x,y)-f(x-1,y)
[0190] ΔI y (x,y)=f(x,y)-f(x,y-1)
[0191] Step 2.3.3.3: Perform weighted fusion on the polarization degree image and the polarization angle image. The average gradient expresses the degree of change in the subtle parts of the image and can be used to express the clarity of the image. Therefore, by utilizing the gradient characteristics to fuse the two, the fusion formula of the polarization degree image and the polarization angle image is as follows:
[0192]
[0193] Among them F p,k Indicates the highlight area R k The image after the polarization information gradient feature fusion, G AOP and G DOP are the gradient features corresponding to the polarization angle and polarization degree images, respectively. μ is the weight coefficient. The polarization angle image contains more information than the polarization degree image, so 0.5<μ<1 is set.
[0194] Step 2.3.4: Sum the specular reflected light to obtain the spatial domain polarization image processing result
[0195]
[0196] Among them, m r is the highlight area R kNumber of
[0197] Step 2.4: Fuse the spatiotemporal specular suppression images to obtain the final specular elimination result, which can effectively suppress the highlight area to obtain a fused image without saturated pixels and improve the contrast of the water bank edge relative to the water surface background. time with I space In the highlight R k The corresponding sub-areas are fused, and the fusion steps are as follows
[0198] Step 2.4.1 Select I time and I space R k Sub-image corresponding to the region and Perform fusion and calculate covariance
[0199]
[0200] and the covariance matrix
[0201]
[0202] Where n is the sub-image and The total number of pixels, is the i-th pixel of the corresponding sub-image, is the pixel mean of the corresponding sub-image, * represents the complex conjugate;
[0203] Step 2.4.2: Calculate the eigenvalues λ1 and λ2 and eigenvectors v1 and v2 of the covariance matrix C to obtain the diagonal matrix D and the matrix V, where V is a reversible matrix consisting of the eigenvectors.
[0204]
[0205] Step 2.4.3 Take the eigenvector v = [v1, v2] corresponding to the maximum eigenvalue T , calculate the weighting coefficient ξ of the sub-image:
[0206]
[0207] Step 2.4.4 Calculate the fused sub-image
[0208] Step 2.4.5 Repeat the above steps until all highlight areas are fused, and then add these processed sub-images to the original image to obtain the complete fused image F(x,y)
[0209]
[0210] In the formula Indicates that only sub-images are replaced and superimposed, K f is the number of sub-images, and f(x,y) is the original polarization image.
[0211] Step 3: Process the image after noise reduction in step 2 to obtain the fitting curve equation of the river boundary line.
[0212] The acquisition of the fitting curve of the river boundary includes the following steps:
[0213] Step 3.1, pre-process the image and reduce noise;
[0214] Step 3.2: Extract the river edge features asynchronously and in parallel through dual-channel thresholds, and fuse the dual-channel extraction results to obtain the river boundary feature pixel candidate points C. cand ;
[0215] The step 3.2 dual-channel threshold asynchronous parallel means edge feature extraction and image segmentation feature two-channel asynchronous parallel calculation of the river edge, the river boundary feature pixel candidate point C cand It is to merge the binary image edge pixel values obtained by edge feature extraction and image segmentation features, that is:
[0216] C cand =C edge ∪C seg ;
[0217] Where: C edge is the candidate point set obtained by edge feature extraction; C seg It is the set of candidate points obtained by image segmentation features.
[0218] The candidate point set C edge The candidate point set C is obtained by using Gaussian directional filter to extract the river edge features in any direction. edge ;
[0219] In order to extract edge information, a second-order Gaussian directional filter is used to detect the river edge in any possible direction. The method is based on the directional derivative operator of the Gaussian function G(x,y) being directional controllable.
[0220]
[0221] Where x, y are Cartesian coordinates, σ is the variance of the Gaussian kernel, and the Gaussian directional filter is composed of a set of basic filters with separable properties, making edge detection more flexible and faster;
[0222] First, the basic filter is obtained by calculating the Gaussian directional derivative;
[0223] The second-order Gaussian directional filter for river channel edge extraction is calculated based on the basic filter, which is calculated by the directional derivatives in the x and y directions:
[0224]
[0225]
[0226] Secondly, the basic filters are combined by the direction angle to obtain the filter response that can be calculated in any direction. The combination formula is:
[0227]
[0228] Where θ represents the direction angle. Two variable direction filters are used in the algorithm to extract the edge features of the left and right river channels respectively.
[0229] Finally, in order to highlight the edge line features of the river channel, the binarization method is used to set the threshold to obtain the edge extraction result:
[0230]
[0231] Get the candidate point set C edge ={(x,y)|I edge (x,y)=255}, where G thresh is the threshold;
[0232] The candidate point set C seg First, the Gaussian mixture model GMM is used to segment the image and obtain the area image I where the water surface is located. water (u,v);
[0233] The distribution of GMM input data is a mixture of a set of multivariate Gaussian distributions, and the probability density function is:
[0234]
[0235] where π k is the weight of the kth Gaussian component, 0≤π k ≤1 and the sum is equal to 1, x represents the data point, K G is the total number of components, μ k and ∑ k are the mean and covariance parameters of the k-th component multivariate Gaussian function;
[0236] Each component follows a multivariate normal distribution, and its probability density function is:
[0237]
[0238] Where d is the number of dimensions, μ is the d-dimensional mean vector, Σ is the covariance matrix, and |Σ| is the determinant of Σ;
[0239] The feature vector of GMM is a four-dimensional vector containing red, green, and blue (RGB) values and the Sobel operator that minimizes non-edge noise.
[0240] x(k)=[R(u,v),G(u,v),B(u,v),S(u,v)]
[0241] Where x is the feature vector of the cropped ROI image, k is the index of x, and (u,v) is the image coordinate;
[0242] Secondly, the river and non-river areas obtained by image segmentation are determined to extract the water edge as the river boundary candidate point set C seg ;
[0243] Select I water The largest connected area of (u,v) is taken as the possible river area, the convex hull that can cover the river area is calculated, and then the river boundary point area C that needs to be fitted is found and separated. seg ;
[0244] ΔI(u,v)=I(u,v)-I(u-1,v)
[0245]
[0246] Get the candidate point set C seg ={(u,v)|I bd (u,v)=255}, where W thresh is the threshold.
[0247] Step 3.3: Extract the river boundary line features through a two-stage curve segment extraction method and fit the curve equation;
[0248] like Figure 4 As shown in the figure, the two-stage curve segment extraction method first obtains small line segments at the river boundary and then applies a clustering algorithm to divide these small line segments into different groups. These two stages are designed to filter out redundant and noisy information while retaining key information. The second stage clusters small line segments that are aligned in the same direction and on the same line, which can improve detection accuracy.
[0249] Obtaining the fitting curve equation includes the following steps:
[0250] Step 3.3.1, the first stage of C cand Boundary points extract a set of small curve segments;
[0251] The small line segment set Q is obtained by clustering algorithm, and the small line segment set is composed of n s The continuous edge pixels p(x,y) are composed of points. i (xi ,y i ) and p j (x j ,y j ) are considered continuous when they meet the following conditions and are clustered together;
[0252] dist(p i ,p j )=|x i -x j |+|y i -y j | <d0
[0253] p i (x i ,y i )∈Q,p j (x j ,y j )∈Q, i≠j,
[0254] Where d0 is the distance threshold;
[0255] Step 3.3.2, fitting a quadratic curve model to the edge points within the small curve segment;
[0256] The shape of the river channel is represented by a quadratic curve, and the quadratic equation of the river channel boundary line is defined as follows
[0257] x=f(y)=a0+a1y+a2y 2
[0258] When a2=0, it means that the boundary line model is a straight line, corresponding to the scenario where the river channel model is a straight line;
[0259] Fit a quadratic polynomial to m points (x i ,y i ), i=1,2,…m, by solving m equations and 3 unknowns a0, a1, a2, we get:
[0260]
[0261] The model solution process can be written as a matrix equation:
[0262] AX=B
[0263]
[0264] Define the residual e of the model k Used to solve the best model, it is defined as follows:
[0265]
[0266] Solve the residual e of the modelk The minimization process can be calculated by solving the equations:
[0267] (A T A) X = A T B
[0268] Given the specific form of matrix A, substituting the matrix into the equation and explicitly performing matrix multiplication, the solution to the equation simplifies to:
[0269]
[0270] From the above formula, we can see that the matrix to be solved is symmetrical. The elements in the matrix are repeated, and the calculation results of the solution process can be reused, thereby reducing the computational cost. In order to prevent the numerical stability of the polynomial from being affected by the divergence of the point set, we improve the stability by normalizing the point set.
[0271] Step 3.3.3: In the second stage, cluster the small curve segments and group the small line segments, and group the small line segments with the same direction and collinearity into the same group;
[0272] By calculating the confidence level of curve similarity, small segments that are close and collinear are clustered together. Specifically, the judgment is made based on the coefficient difference and the shortest distance between the segments. The calculation formula is as follows:
[0273]
[0274] Δd represents the curve l i and l j The shortest distance between them can be simplified by discrete sampling method. Δc is the difference of coefficients. α and β represent the weights of Δd and Δc in judging similarity. λ is the threshold of collinearity. represents the coefficients of the curve equation;
[0275] Step 3.3.4: Select the optimal boundary line from the clustered small line segments in the previous step and determine the left and right boundaries of the river channel;
[0276] like Figure 5 As shown, the small line segments on the same side of the boundary have the same direction, while the two small line segments on the opposite river boundaries have opposite directions. We can screen out the optimal left and right boundary lines by counting the number of points in two opposite directions in the cluster. In addition, we select the area in the middle part of the river channel. For the left boundary line, we select the rightmost boundary, and for the right boundary line, we select the leftmost boundary. The left and right boundaries must satisfy the following relationship.
[0277] dist(L left ,L right)≥T d
[0278] len(L left) )≥T len ,len(L right) )≥T len
[0279] nums(L left ,L right )≥T n
[0280] nums(L left ,L right )=argmax{NUM(cond{f′ left (y k )·f′ right (y k )<0})}
[0281] Among them L left and L right The clustering result is the clustering of small line segments in the left and right boundary areas of the river. dist(L left ,L right ) is the distance between the two line segments, len(·) is the length of the line segment, T d and T len is the distance and length threshold, nums(L left ,L right ) represents the maximum number of points that simultaneously satisfy the opposite (positive and negative) directions of the tangent lines of the corresponding points in the horizontal direction of the left and right boundaries, cond{·} represents the satisfied conditional relationship, NUM(·) represents the number of points, and argmax{·} represents the maximum value that satisfies the condition;
[0282] Step 3.3.5: Combine the point sets of the left and right boundary line segments obtained in the previous step, and use the improved RANSAC algorithm to accurately fit the curve equations of the left and right boundary lines. The specific steps are as follows:
[0283] Step 3.3.5.1. Initialize the channel boundary model parameter vector Param = 0, the number of iterations k = 0, obtain the channel boundary feature point set P from the previous step, the internal point set H = NULL, the optimal parameter vector best_Param = NULL, the optimal score best_score = 0, and the maximum number of iterations is set according to the upper limit of the number of iterations K, iterations = INT(ξ*K) (ξ>1), where INT represents rounding up:
[0284]
[0285] where p expis the probability that the expected iteration can obtain the correct result, w is the proportion of inliers, and n inliers and n outliers are the numbers of inliers and outliers respectively, and m is the number of points on the river boundary line model;
[0286] Step 3.3.5.2: Randomly select n points from P, where n = 3, and the first point is random. Subsequently selected points do not have the same y value as the previously selected points. Calculate Param = [a0, a1, a2] through these points T , and add these n points to the inlier set H;
[0287] Step 3.3.5.3: For any point p i (x i , y i ), where p i ∈P, calculate err(p i ). If err(p i ) < E th , then add p i to the inlier set H. Repeat this step until all points have been judged. Here, err(p i ) is the error:
[0288] err(p i ) = |x i - a0 - a1y - a2y i 2 |
[0289] Step 3.3.5.4: If the number of inliers count(H) < T th or Param does not meet the requirements and H = NULL, then go to Step 3.3.5.2; otherwise, execute the next step;
[0290] Step 3.3.5.5: Take all the points in the inlier set T, use the least squares method to refit and recalculate the parameter Param, and calculate the score of the currently obtained inlier set k . If score k > best_score, then best_score = score k , best_Param = Param, H = NULL, the iteration number k = k + 1. The fitting score is calculated as follows:
[0291]
[0292] Step 3.3.5.6: If k < iterations, repeat Steps 3.3.5.2 - 3.3.5.5 until the iteration number meets the requirements.
[0293] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
[0294] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A river boundary detection method based on polarization image, characterized in that: The following steps are involved: Step 1: Obtain image data of the river scene in front of the unmanned boat through a polarization image acquisition device; Step 2: Extract polarization characteristic images at different angles, process the water surface polarization characteristic images, and remove mirror reflections and highlight areas to obtain a denoised image. Step 3: Process the image after noise reduction in step 2 to obtain the fitting curve equation of the river boundary line; The acquisition of the fitting curve of the river boundary in step 3 includes the following steps: Step 3.1, pre-process the image and reduce noise; Step 3.2: Extract the river edge features asynchronously and in parallel through dual-channel thresholds, and fuse the dual-channel extraction results to obtain the river boundary feature pixel candidate points C. cand ; The step 3.2 dual-channel threshold asynchronous parallel means edge feature extraction and image segmentation feature two-channel asynchronous parallel calculation of the river edge, the river boundary feature pixel candidate point C cand It is to merge the binary image edge pixel values obtained by edge feature extraction and image segmentation features, that is: C cand =C edge ∪C seg ; Where: C edge is the candidate point set obtained by edge feature extraction; C seg The candidate point set obtained for image segmentation features; Step 3.3: Extract the river boundary line features through a two-stage curve segment extraction method and fit the curve equation; Step 3.3.1, the first stage of C cand Boundary points extract a set of small curve segments; Step 3.3.2, fitting a quadratic curve model to the edge points within the small curve segment; Step 3.3.3: In the second stage, cluster the small curve segments and group the small line segments, and group the small line segments with the same direction and collinearity into the same group; Step 3.3.4: Select the optimal boundary line from the clustered small line segments in the previous step and determine the left and right boundaries of the river channel; Step 3.3.5: Merge the point sets of the left and right boundary line segments obtained in the previous step, and use the improved RANSAC algorithm to accurately fit the curve equations of the left and right boundary lines respectively.
2. The method for detecting river boundary lines based on polarization images according to claim 1, characterized in that: The elimination of specular reflection and highlight areas in step 2 includes the following steps: Step 2.1, obtain polarization images of the four polarization directions of polarization angles θ = 0, π / 4, π / 2, 3π / 4, Where S0, S1, S2 are Stokes vector parameters, and θ is the polarization angle; Step 2.2: Generate a time domain polarization radiation pattern by suppressing the time domain specular reflection and obtain the time domain highlight elimination result I time ; Select the polarization direction perpendicular to the polarization angle to generate the polarization radiation pattern I ⊥ ,Pick Polarization radiation pattern with the strongest suppression effect on specular reflection light in the vertical direction When the imaging environment and detection equipment remain unchanged, the amount of reflected light fluctuates little over time. By using this characteristic, the I ⊥ Composed image sequence, time domain fusion is performed, that is, the minimum gray value of the corresponding pixel in the time series image is assigned to the final image I time (x,y) I time (x,y)=min{I m (x,y,t1),I m (x,y,t2),…,I m (x,y,t nt )} where t1, t2, …, t nt is a continuous time series; Step 2.3: Generate a spatial domain polarization radiation pattern by suppressing the spatial domain specular reflection, and obtain the spatial domain highlight elimination result I space ; Step 2.4: Fuse the spatiotemporal specular reflection suppression images to obtain a fused image of the final specular reflection elimination result.
3. The method for detecting river boundary lines based on polarization images according to claim 2, characterized in that: The spatial domain highlight removal process in step 2.3 includes the following steps: Step 2.3.
1. Select the polarized radiation pattern with the strongest suppression effect on specular reflection light from the four polarized radiation patterns, and select the region R with strong light from it through the clustering algorithm. k , Among them, Ig θ (x,y) is the grayscale value of the image pixel, δ g is the high light intensity threshold; Step 2.3.2, calculate the linear polarization degree DOP and polarization angle AOP of polarized light, Among them, S0, S1, S2, and S3 are Stokes vector parameters S = [S0, S1, S2, S3]. Four polarization angles of 0°, 45°, 90°, and 135° are selected, and the light intensity information obtained is used to calculate the relevant polarization information. Among them, S0 represents the total intensity image of the light wave, that is, I; S1 is the intensity difference of linearly polarized light in the horizontal and vertical directions; S2 is the intensity difference of linearly polarized light in the 45° direction and 135° direction; S3 represents the intensity difference between right-handed and left-handed circularly polarized light; Step 2.3.3, respectively in the highlight area R k Perform gradient feature fusion on polarization degree and polarization angle images, k = 1, 2…m r : Step 2.3.4: Sum the specular reflected light to obtain the spatial domain polarization image processing result Among them, m r is the highlight area R k The number of .
4. The method for detecting river boundary lines based on polarization images according to claim 3, characterized in that: The gradient fusion process in step 2.3.3 includes the following steps: Step 2.3.3.1, normalize the polarization degree image and the polarization angle image; Step 2.3.3.2, calculate the gradient features of the polarization degree image and the polarization angle image; The two images are respectively in R k The gradient feature calculation within the region is as follows Where M and N represent the width and height of the image respectively, ΔI x (x,y) and ΔI y (x,y) represents the first-order difference of the image f(x,y) in the x and y directions respectively, and the calculation method is as follows ΔI x (x,y)=f(x,y)-f(x-1,y) Δc y (x,y)=f(x,y)-f(x,y-1) Step 2.3.3.3: Perform weighted fusion of the polarization degree image and the polarization angle image. The fusion formula of the polarization degree image and the polarization angle image is as follows: Among them F p,k Indicates the highlight area R k The image after the polarization information gradient feature fusion, G AOP and G DOP are the gradient features corresponding to the polarization angle and polarization degree images, respectively. μ is the weight coefficient. The polarization angle image contains more information than the polarization degree image, so 0.5<μ<1 is set.
5. The method for detecting river boundary lines based on polarization images according to claim 2, characterized in that: The fusion in step 2.4 includes the following steps: Step 2.4.1 Select I time and I space R k Sub-image corresponding to the region and Perform fusion and calculate covariance and covariance matrix Where n is the sub-image and The total number of pixels, is the i-th pixel of the corresponding sub-image, is the pixel mean of the corresponding sub-image, * represents the complex conjugate; Step 2.4.2: Calculate the eigenvalues λ1 and λ2 and eigenvectors v1 and v2 of the covariance matrix C to obtain the diagonal matrix D and the matrix V, where V is a reversible matrix consisting of the eigenvectors. Step 2.4.3 Take the eigenvector v = [v1, v2] corresponding to the maximum eigenvalue T , calculate the weighting coefficient ξ of the sub-image: Step 2.4.4 Calculate the fused sub-image Step 2.4.5 Repeat the above steps until all highlight areas are fused, and then add these processed sub-images to the original image to obtain the complete fused image F(x,y) In the formula Indicates that only sub-images are replaced and superimposed, K f is the number of sub-images, and f(x,y) is the original polarization image.
6. The method for detecting river boundary lines based on polarization images according to claim 1, characterized in that: The candidate point set C edge The candidate point set C is obtained by using Gaussian directional filter to extract the river edge features in any direction. edge ; In order to extract edge information, a second-order Gaussian directional filter is used to detect the river edge in any possible direction. The method is based on the directional derivative operator of the Gaussian function G(x,y) being directional controllable. Where x, y are Cartesian coordinates, and σ is the variance of the Gaussian kernel; First, the basic filter is obtained by calculating the Gaussian directional derivative; The second-order Gaussian directional filter for river channel edge extraction is calculated based on the basic filter, which is calculated by the directional derivatives in the x and y directions: Secondly, the basic filters are combined by the direction angle to obtain the filter response that can be calculated in any direction. The combination formula is: Where θ represents the direction angle. Two variable direction filters are used in the algorithm to extract the edge features of the left and right river channels respectively. Finally, in order to highlight the edge line features of the river channel, the binarization method is used to set the threshold to obtain the edge extraction result: Get the candidate point set C edge ={(x,y)|I edge (x,y)=255}, where G thresh is the threshold.
7. The method for detecting river boundary lines based on polarization images according to claim 1, characterized in that: The candidate point set C seg First, the Gaussian mixture model GMM is used to segment the image and obtain the area image I where the water surface is located. water (u,v); The distribution of GMM input data is a mixture of a set of multivariate Gaussian distributions, and the probability density function is: where π k is the weight of the kth Gaussian component, 0≤π k ≤1 and the sum is equal to 1, x represents the data point, K G is the total number of components, μ k and ∑ k are the mean and covariance parameters of the k-th component multivariate Gaussian function; Each component follows a multivariate normal distribution, and its probability density function is: Where d is the number of dimensions, μ is the d-dimensional mean vector, Σ is the covariance matrix, and |Σ| is the determinant of Σ; The feature vector of GMM is a four-dimensional vector containing the red, green, and blue RGB values and the Sobel operator that minimizes non-edge noise. x(k)=[R(u,v),G(u,v),B(u,v),S(u,v)] Where x is the feature vector of the cropped ROI image, k is the index of x, and (u,v) is the image coordinate; Secondly, the river and non-river areas obtained by image segmentation are determined to extract the water edge as the river boundary candidate point set C seg ; Select I water The largest connected area of (u,v) is taken as the possible river area, the convex hull covering the river area is calculated, and then the river boundary point area C that needs to be fitted is found and separated. seg ; ΔI(u,v)=I(u,v)-I(u-1,v) Get the candidate point set C seg ={(u,v)|I bd (u,v)=255}, where W thresh is the threshold.
8. The method for detecting river boundary lines based on polarization images according to claim 1, characterized in that: The acquisition of the fitting curve equation comprises the following steps: Step 3.3.1, the first stage of C cand Boundary points extract a set of small curve segments; The small line segment set Q is obtained by clustering algorithm, and the small line segment set is composed of n s The continuous edge pixels p(x,y) are composed of points. i (x i ,y i ) and p j (x j ,y j ) are considered continuous when they meet the following conditions and are clustered together; dist(p i ,p j )=|x i -x j |+|y i -y j |<d0 p i (x i ,y i )∈Q,p j (x j ,y j )∈Q,i≠j, Where d0 is the distance threshold of continuous points; Step 3.3.2, fitting a quadratic curve model to the edge points within the small curve segment; The shape of the river channel is represented by a quadratic curve, and the quadratic equation of the river channel boundary line is defined as follows x=f(y)=a0+a1y+a2y 2 When a2=0, it means that the boundary line model is a straight line, corresponding to the scenario where the river channel model is a straight line; Fit a quadratic polynomial to m points (x i ,y i ), i=1,2,…m, by solving m equations and 3 unknowns a0, a1, a2, we get: The model solution process is written as a matrix equation: AX=B Define the residual e of the model k Used to solve the best model, it is defined as follows: Solve the residual e of the model k The minimization process is calculated by solving the system of equations: (A T A)X=A T B Given the specific form of matrix A, substituting the matrix into the equation and explicitly performing matrix multiplication, the solution to the equation simplifies to: From the above formula, we can see that the matrix to be solved is symmetrical. The elements in the matrix are repeated, and the calculation results are reused in the solution process, thereby reducing the computational cost. In order to prevent the numerical stability of the polynomial from being affected by the divergence of the point set, we improve the stability by normalizing the point set. Step 3.3.3: In the second stage, cluster the small curve segments and group the small line segments, and classify the small line segments with the same direction and collinearity into the same group; By calculating the confidence level of curve similarity, small segments that are close and collinear are clustered together. The specific judgment is based on the coefficient difference and the shortest distance between the segments. The calculation formula is as follows: Δd represents the curve l i and l j The shortest distance between them can be simplified by discrete sampling method. Δc is the difference of coefficients. α and β represent the weights of Δd and Δc in judging similarity. λ is the threshold of collinearity. represents the coefficients of the curve equation; Step 3.3.4: Select the optimal boundary line from the clustered line segments in the previous step and determine the left and right boundaries of the river channel; The left and right boundaries must satisfy the following relationship dist(L left ,L right )≥T d len(L left) )≥T len ,len(L right) )≥T len nums(L left ,L right )≥T n nums(L left ,L right )=argmax{NUM(cond{f′ left (y k )·f′ right (y k )<0})} Among them L left and L right The clustering result is the clustering of small line segments in the left and right boundary areas of the river. dist(L left ,L right ) is the distance between the two line segments, len(·) is the length of the line segment, T d and T len is the distance and length threshold, nums(L left ,L right ) represents the maximum number of points that simultaneously satisfy the opposite (positive and negative) directions of the tangent lines of the corresponding points in the horizontal direction of the left and right boundaries, cond{·} represents the satisfied conditional relationship, NUM(·) represents the number of points, and argmax{·} represents the maximum value that satisfies the condition; Step 3.3.5: Combine the point sets where the left and right boundary small line segment sets obtained in the previous step are located, and respectively accurately fit the curve equations of the left and right boundary lines through an improved RANSAC algorithm. The specific steps are as follows: Step 3.3.5.1: Initialize the river channel boundary line model parameter vector Param = 0, the iteration number k = 0, obtain the river channel boundary feature point set P in the previous step, the inlier set H = NULL, the optimal parameter vector best_Param = NULL, the optimal score best_score = 0, and the maximum iteration number iterations is set according to the iteration number upper limit value K, iterations = INT(ξ * K), ξ > 1, INT represents rounding up: where p exp is the probability that the iteration can get the correct result, w is the proportion of internal points, n inliers and n outliers are the number of interior and exterior points, respectively, and m is the number of model points on the river boundary line; Step 3.3.5.
2. Randomly select n points from P, where n = 3. The first point is random, and the y values of the points selected subsequently do not overlap with the previously selected points. Calculate Param = [a0, a1, a2] using these points. T , and add these n points to the interior point set H; Step 3.3.5.3, for any point p i (x i ,y i ), p i ∈P, calculate err(p i ), if err(p i ) <E th , then p i Add to the inner point set H, repeat this step until all points are judged, where err(p i ) is the error: err(p i )=|x i -a0-a1y-a2y i 2 | Step 3.3.5.4, if the number of inliers count(H) <T th Or if Param does not meet the requirements and H = NULL, go to step 3.3.5.2, otherwise go to the next step; Step 3.3.5.5, take all points in the inlier set T, use the least squares method to recalculate the parameter Param, and calculate the current inlier set score score k , if score k >best_score then best_score=score k , best_Param = Param, H = NULL, number of iterations k = k + 1, where the fitting score is calculated as follows: Step 3.3.5.6: If k < iterations, repeat steps 3.3.5.2 - 3.3.5.5 until the iteration number meets the requirements.
Citation Information
Patent Citations
Image processing method for calculating polarization direction and polarization degree of optical wave
CN108801464A
River bank line detection and autonomous cruise method for unmanned ship
CN114879685A