A lane line image segmentation method based on FOACID-multiOtsu algorithm
Patent Information
- Application Number
- CN202311513263.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-14
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-11-14
AI Technical Summary
[0003]为了解决现有技术中的问题,本发明提供了一种基于FOACID-multiOtsu的车道线图像分割算法,以解决由传统FOA算法局部最优所引发的车道线图像多阈值分割失败问题
[0062]与现有的技术方案相比,本发明的车道线图像分割方法将果蝇个体嗅觉差异性考虑在内,由此增强了果蝇群体的生物样性,并消除了由于个体差异性所导致的错误寻优路径,最终可使得multiOtsu算法所面对的高维度优化问题收敛于全局最优解,并且本专利所提出的FOACID算法并未在原始的FOA算法基础上引入额外超参数及计算量,因此本发明所提出的FOACID-multiOtsu算法可快速、准确地实现车道线图像分割任务。
Smart Images

Figure CN117635955B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine vision technology, specifically relating to a lane line image segmentation method based on the FOACID-multiOtsu algorithm. Background Technology
[0002] Introducing metaheuristic algorithms into the multiOtsu algorithm has been favored by many engineers for improving image segmentation speed. Among these, the Fruit Fly Optimization (FOA) algorithm, a classic metaheuristic, is widely used due to its excellent convergence speed and relatively few hyperparameters. However, traditional FOA algorithms often get stuck in local optima when dealing with high-dimensional optimization problems such as lane line image segmentation, which are also addressed by the multiOtsu algorithm. Once FOA gets stuck in local optima, it directly leads to segmentation errors in the multiOtsu algorithm, ultimately failing to achieve satisfactory segmentation results and hindering subsequent image processing tasks. Therefore, it is necessary to improve the traditional FOA algorithm mechanism to overcome the aforementioned local optima problem, thereby enabling fast and accurate lane line image segmentation. Summary of the Invention
[0003] To address the problems in the prior art, this invention provides a lane line image segmentation algorithm based on FOACID-multiOtsu, which solves the problem of lane line image multi-threshold segmentation failure caused by the local optima of the traditional FOA algorithm.
[0004] To achieve the above-mentioned technical objectives, the present invention adopts the following technical solutions.
[0005] A lane line image segmentation method based on the FOACID-multiOtsu algorithm includes the following steps:
[0006] S1. Preprocess the road images captured by the vehicle-mounted forward-looking camera;
[0007] S2. Extend the one-dimensional Otsu algorithm to multiple dimensions to obtain the multi-threshold multiOtsu segmentation algorithm;
[0008] S3. Establish a FOA algorithm that takes into account individual differences, namely the FOACID algorithm;
[0009] S4. Combine the multiOtsu segmentation algorithm obtained in step S2 with the FOACID algorithm obtained in step S3 to obtain a lane line image segmentation algorithm based on FOACID-multiOtsu:
[0010] S5. Lane line region image segmentation based on FOACID-multiOtsu algorithm.
[0011] Furthermore, the specific steps for preprocessing the road image captured by the vehicle-mounted forward-looking camera in step S1 are as follows:
[0012] For the road images captured by the vehicle-mounted forward-facing camera, firstly, the ROI (Region of Interest) area is defined.
[0013] Then, the image of the selected ROI region is converted to grayscale to eliminate redundant color information;
[0014] Finally, a Gaussian filtering algorithm is used to eliminate interference noise generated during image acquisition, completing the preprocessing of the road images.
[0015] Furthermore, the specific steps for obtaining the multi-threshold multiOtsu segmentation algorithm in step S2 are as follows:
[0016] Assuming that the road ahead image acquired in step S1 is converted to grayscale, and the grayscale image pixels are divided into M classes based on their grayscale values, denoted as C1, C2, ..., C60, respectively. M The corresponding segmentation threshold is T = {t1, t2, ..., t} M-1}, and denote the number of pixels with a grayscale value of l as f. l Therefore, its proportion in the total pixels N is:
[0017]
[0018] Therefore, the proportion of the Q-th class pixels to the total number of pixels can be obtained as w. Q (T):
[0019]
[0020] Then the average gray value μ of the Q-th class pixel can be obtained. Q (T):
[0021]
[0022] Clearly, the mean grayscale value μ of the entire image is:
[0023]
[0024] and,
[0025] Therefore, the formula for calculating inter-class variance in multi-threshold segmentation scenarios is obtained:
[0026]
[0027] At this point, it is only necessary to find the optimal threshold sequence T. * The goal is to maximize the inter-class variance, at which point T... * The optimal threshold sequence corresponding to multi-threshold segmentation is:
[0028]
[0029] This involves generalizing Otsu's algorithm from one-dimensional to multi-dimensional Otsu's, resulting in the multiOtsu segmentation algorithm. Essentially, this is a high-dimensional optimization problem, and its key lies in determining the optimal threshold sequence T. * To maximize the inter-class variance.
[0030] Furthermore, considering that the multiOtsu segmentation algorithm is essentially a high-dimensional optimization problem, the feasible region is a high-dimensional space C of [0, 255]. M-1 The FOACID algorithm is an optimization algorithm for high-dimensional optimization problems. The specific steps for establishing the FOACID algorithm in step S3 include the following sub-steps:
[0031] (1) In the feasible region C of the optimization problem M-1 Randomly initialize the fruit fly positions within the system;
[0032] (2) After considering the individual differences of each fruit fly, the fruit flies were grouped into multiple fruit fly subgroups;
[0033] (3) The positions of each fruit fly subgroup are updated independently;
[0034] (4) Obtain the global optimal solution based on fruit fly subgroup communication.
[0035] Furthermore, the sub-step (1) is performed within the feasible region C of the optimization problem. M-1 The specific steps for randomly initializing the fruit fly positions include:
[0036] First, let the total number of fruit flies be N, and the maximum number of iterations be E. Then, within the feasible region of the optimization problem, C... M-1 The positions of each fruit fly are randomly initialized, and the coordinates of the i-th fruit fly are marked as X. i =(x i1 ,x i2 ,…,x i4 The dimension of the optimization problem is k. Then, the positions of each fruit fly are substituted into the fitness function F(·) to calculate the fitness value corresponding to each fruit fly position, as shown in equation (7).
[0037] fi i =F(X) i (7)
[0038] And put it into the fitness array Fitness = {f1, f2, ..., fN}
[0039] Furthermore, the specific steps of sub-step (2), which involves grouping fruit flies after considering individual differences, include:
[0040] First, select the top n fitness values from the fitness array Fitness obtained in sub-step (1). and the corresponding fruit fly locations The fitness ratio of each fruit fly position is calculated as shown in Equation (8), where n takes a value between (4, 10).
[0041]
[0042] Subsequently, based on the fitness ratio of each fruit fly position, the remaining fruit flies X = {X1,,X2,…X3} are grouped into groups X = {X1,,X2,…X3}. i ,…X N}, Divided into n groups, as shown in equation (9),
[0043] G = {G1, G2, ..., G} n}, and [num(G1), num(G2),..., num(G n )]=Proportion (9)
[0044] Where Gn represents the nth group, also known as the nth fruit fly subgroup. Where X n1 Let Gn represent the first fruit fly in the nth group, and num(Gn) be the number of fruit flies in the nth group.
[0045] Finally, P n The positions of the fruit flies in the data are added to each fruit fly subgroup according to formula (10).
[0046]
[0047] The above completes the fruit fly grouping operation considering the individual differences of each fruit fly.
[0048] Furthermore, the specific steps for updating the positions of each fruit fly subgroup independently in sub-step (3) are as follows:
[0049] First, each fruit fly subgroup independently undertakes the optimization task. The positions of each fruit fly in the current subgroup are taken as feasible solutions to the optimization problem and substituted into the fitness function F(·). The fitness value of each fruit fly position in the current subgroup is calculated according to Equation (7), and the position of the fruit fly with the maximum fitness value is found and denoted as W. j (e) Its fitness value is Where e is the current iteration number, e = (1, 2, ..., E), and j is the fruit fly subgroup number, i.e., j = (1, 2, ..., n).
[0050] Subsequently, based on position W j (e) Update the positions of the remaining fruit flies in subgroup j as shown in equation (11).
[0051] X i =Wj (e) +Random, X i ≠W j (e) And X i ∈G j (11)
[0052] Here, Random is a random array taking values of (-0.5, 0.5), and its dimension is the same as X. i Consistent,
[0053] Finally, the iteration terminates when the current fruit fly subgroup reaches the pre-given maximum number of iterations and the above operations have traversed the current fruit fly subgroup.
[0054] If the current fruit fly subgroup has not reached the pre-given maximum number of iterations, then continue to repeat the above steps for optimizing the fruit fly subgroup.
[0055] If the current fruit fly subgroup reaches the pre-given maximum number of iterations, and the above operations have not traversed the current fruit fly subgroup, then the optimization task steps will be carried out by the next group of fruit fly subgroups.
[0056] Furthermore, the predetermined number of iterations is determined by the number of image segmentation categories, which increases as M increases.
[0057] Furthermore, the specific steps in sub-step (4) for obtaining the global optimal solution based on fruit fly subgroup communication are as follows:
[0058] The different fruit fly subgroups communicate with each other and compare the maximum fitness values found by each subgroup. Find the maximum value S and the corresponding fruit fly position W, which is the global optimal solution to the optimization problem of the FOACID algorithm.
[0059] Furthermore, the specific steps in step S4 to obtain the lane line image segmentation algorithm based on FOACID-multiOtsu are as follows:
[0060] Equation (5) is used as the fitness function of the FOACID algorithm, and during the fruit fly position initialization phase, the position X of each fruit fly is set to... i =(x i1 ,x i2 ,…,xi4 )=(t1,t2,…,t M-1 This means that the multiOtsu segmentation algorithm and the FOACID algorithm are combined to obtain a lane image segmentation algorithm based on FOACID-multiOtsu.
[0061] Furthermore, the specific steps for lane line region image segmentation based on the FOACID-multiOtsu algorithm in step S5 are as follows: the preprocessed image from step S1 is fed into the FOACID-multiOtsu algorithm to complete lane line region image segmentation.
[0062] Compared with existing technical solutions, the lane line image segmentation method of the present invention takes into account the olfactory differences of individual fruit flies, thereby enhancing the biodiversity of the fruit fly population and eliminating erroneous optimization paths caused by individual differences. Ultimately, it can make the high-dimensional optimization problem faced by the multiOtsu algorithm converge to the global optimum. Furthermore, the FOACID algorithm proposed in this patent does not introduce additional hyperparameters and computational load on the basis of the original FOA algorithm. Therefore, the FOACID-multiOtsu algorithm proposed in this invention can quickly and accurately achieve the lane line image segmentation task. Attached Figure Description
[0063] Figure 1 This is a flowchart illustrating a lane line image segmentation method based on the FOACID-multiOtsu algorithm of the present invention.
[0064] Figure 2 A schematic diagram of the FOACID algorithm established in this invention;
[0065] Figure 3 This is a schematic diagram comparing the optimization results of the FOACID algorithm proposed in this invention with the original FOA algorithm in the Schaffer function.
[0066] Figure 4 This is a diagram showing the lane line image segmentation result based on the FOACID-multiOtsu algorithm of this invention. Detailed Implementation
[0067] The present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0068] This invention provides a lane line image segmentation method based on the FOACID-multiOtsu algorithm. The proposed FOACID-multiOtsu algorithm takes into account the olfactory differences among individual fruit flies, thereby enhancing the biodiversity of the fruit fly population and eliminating erroneous optimization paths caused by individual differences. Ultimately, it enables the high-dimensional optimization problem faced by multiOtsu to converge to the global optimum, and can quickly and accurately achieve the lane line image segmentation task.
[0069] According to an embodiment of the present invention, refer to the appendix Figure 1 The method for lane line image segmentation based on the FOACID-multiOtsu algorithm, as shown, includes the following steps:
[0070] Step 1: Preprocess the road images captured by the vehicle-mounted forward-looking camera;
[0071] Specifically, firstly, the region of interest (ROI) is defined to eliminate environmental interference factors such as the sky background and the road in front; secondly, the ROI image is processed into grayscale to eliminate redundant color information; finally, a Gaussian filtering algorithm is used to eliminate interference noise generated during image acquisition, thus completing image preprocessing.
[0072] The one-dimensional Otsu algorithm is extended to multiple dimensions to obtain the multi-threshold multiOtsu segmentation algorithm;
[0073] Specifically, suppose we need to classify the pixels of a grayscale image into M classes based on their grayscale values, namely C1, C2, ..., C6. M The corresponding segmentation threshold is T = {t1, t2, ..., t} M-1 And let f be the number of pixels with a grayscale value of l. l Therefore, its proportion in the total pixels N is:
[0074]
[0075] Therefore, the proportion of the Q-th class pixels to the total number of pixels can be obtained as w. Q (T):
[0076]
[0077] This allows us to obtain the average gray level μ of the Q-th class pixels. Q (T):
[0078]
[0079] Clearly, the mean grayscale value μ of the entire image is:
[0080]
[0081] and
[0082] This leads to the formula for calculating inter-class variance in multi-threshold segmentation scenarios:
[0083]
[0084] Simply find the threshold sequence T * The goal is to maximize the inter-class variance, at which point T... * The optimal threshold sequence corresponding to multi-threshold segmentation is:
[0085]
[0086] At this point, the generalization from one-dimensional Otsu's algorithm to multi-dimensional Otsu's algorithm has been completed, resulting in the multiOtsu algorithm. It can be seen that it is essentially a high-dimensional optimization problem, and its key lies in determining the optimal threshold sequence T. * To maximize the inter-class variance.
[0087] Step 3: Establish a new FOA (Focusing on Individual Differences) algorithm that takes into account individual differences (FOACID).
[0088] Step 3 consists of 4 sub-steps. Sub-step 1: In the feasible region C of the optimization problem... M-1 Sub-step 1: Initialize the positions of fruit flies randomly; Sub-step 2: After considering the individual differences of each fruit fly, group the fruit flies into multiple fruit fly subgroups; Sub-step 3: Update the positions of each fruit fly subgroup independently; Sub-step 4: Obtain the global optimal solution based on communication between fruit fly subgroups.
[0089] Sub-step 1: In the feasible region C of the optimization problem M-1 Randomly initialize the fruit fly positions within the system;
[0090] For details, please refer to Figure 2 First, let the total number of fruit flies be N, and the maximum number of iterations be E. Considering that the multiOtsu segmentation algorithm is essentially a high-dimensional optimization problem, the feasible region is a high-dimensional space C of [0, 255]. M-1 Subsequently, within the feasible region of the optimization problem, C M-1 The positions of each fruit fly are randomly initialized, and the coordinates of the i-th fruit fly are marked as X. i =(x i1 x i2 , ..., x ik The dimension of the optimization problem is k. Then, each fruit fly position is substituted into the fitness function F(·) to calculate the fitness value corresponding to each position, as shown in equation (7).
[0091] f i =F(X) i (7)
[0092] And put them into the fitness array Fitness = {f1, f2, ..., f N}
[0093] Sub-step 2: After considering the individual differences of each fruit fly, group the fruit flies into multiple fruit fly subgroups;
[0094] At this point, the original FOA algorithm's approach of directly updating the positions of other fruit flies based on the position corresponding to the maximum fitness value is abandoned. This approach leads to a sharp drop in the diversity of the fruit fly population with each position update, posing a significant risk of local optima. Furthermore, relying solely on the position of the maximum fitness value to update the positions of other fruit flies does not consider the differences in olfactory abilities among individual fruit flies. That is, the objective fitness value of a fruit fly's current position may differ from its subjectively obtained fitness value. Additionally, a poor fitness at the current position does not necessarily mean that the current position is far from the global optimum; this phenomenon is particularly common in high-dimensional optimization problems. Therefore, this patent proposes a FOA algorithm that considers individual differences, called the FOACID algorithm. The key idea of this algorithm is to select the top n fitness values from the Fitness array obtained in the above steps. and the corresponding fruit fly locations The fitness ratio of each position is calculated as shown in Equation (8), where n takes the value between (4, 10).
[0095]
[0096] Then, based on this fitness ratio, the remaining fruit flies X = {X1, ..., X2} are grouped into groups of 1, 2, ..., X3. i , ...X N}, Divide the remaining fruit flies into n groups, as shown in equation (9). The technical approach of grouping the remaining fruit flies according to their fitness ratio takes into account both the differences between individual fruit flies and the fact that positions with higher fitness values often have a higher confidence level of being closer to the global optimum.
[0097] G = {G1, G2, ..., G} n}, and [num(G1), num(G2),..., num(G n )]=Proportion (9)
[0098] Where Gn represents the nth group, also known as the nth fruit fly subgroup. Where X n1Let Gn represent the first fruit fly in the nth group, and num(Gn) represent the number of fruit flies in the nth group.
[0099] Then P n The positions of the fruit flies in the data are added to each fruit fly subgroup according to formula (4).
[0100]
[0101] This completes a method for grouping fruit flies that takes into account individual differences.
[0102] Sub-step 3: The positions of each fruit fly subgroup are updated independently;
[0103] Then refer to Figure 2 Each fruit fly subgroup independently undertakes the optimization task. That is, the positions of each fruit fly in the current subgroup are taken as feasible solutions to the optimization problem and substituted into the fitness function. The fitness value of each position in the current subgroup is calculated according to Equation (1), and the position with the maximum fitness value is found and denoted as W. j (e) Its fitness value is Where e is the current iteration number, e = (1, 2, ..., E), and j is the fruit fly subgroup number, i.e., j = (1, 2, ..., n). Then, based on the position W... j (e) Update the positions of the remaining fruit flies in the fruit fly subgroup j as shown in equation (11).
[0104] X i =W j (e) +Random, x i ≠W j (e) And X i ∈G j (11)
[0105] Where Random is a random array with values ranging from (-0.5, 0.5), and its dimension is the same as X. i Consistent.
[0106] Finally, the iteration terminates when the current fruit fly subgroup reaches the pre-given maximum number of iterations and the above operations have traversed the current fruit fly subgroup.
[0107] If the current fruit fly subgroup has not reached the pre-given maximum number of iterations, then continue to repeat the above steps for optimizing the fruit fly subgroup.
[0108] If the current fruit fly subgroup reaches the pre-given maximum number of iterations, and the above operation has not traversed the current fruit fly subgroup, then the optimization task steps will be carried out by the next fruit fly subgroup.
[0109] like Figure 2As shown, repeat the above steps until all subgroups have been traversed and each subgroup has reached the pre-given maximum number of iterations.
[0110] Sub-step 4: Obtain the global optimal solution based on fruit fly subgroup communication.
[0111] Finally, the different fruit fly populations communicated with each other and compared the maximum fitness values found by each population. Find the maximum value S and the corresponding fruit fly position W, which is the global optimal solution to the optimization problem.
[0112] The FOACID algorithm proposed in this patent, compared with the original FOA algorithm in the optimization results of the Schaffer function, is as follows: Figure 3 As shown, the Schaffer function has an infinite number of local maxima, but only one global maximum, with a value of 1. (This is achieved through...) Figure 3 It is known that the original FOA algorithm gets stuck in a local optimum. However, the FOACID algorithm proposed in this patent takes into account the differences between individual fruit flies and implements a proportional grouping search strategy based on this. In the end, the fruit fly subgroup 2 successfully found the global optimum of the Schaffer function.
[0113] Step four: Combine the multiOtsu segmentation algorithm with the FOACID algorithm to obtain a lane line image segmentation algorithm based on FOACID-multiOtsu.
[0114] Specifically, the above analysis reveals that the key to multi-threshold image segmentation lies in finding the corresponding segmentation threshold sequence, which is essentially the M-1 dimension optimization problem corresponding to equation (5). Therefore, equation (5) is used as the fitness function of the FOACID algorithm, and during the initialization phase of the fruit fly positions, the X values of each fruit fly position are set to... i =(x i1 x i2 , ..., x ik ) = (t1, t2, ..., t M-1 In this way, the optimal segmentation threshold sequence can be found using the FOACID algorithm proposed in this patent, without going through a tedious exhaustive search process. This completes the combination of the multiOtsu segmentation algorithm and the FOACID algorithm, resulting in a lane image segmentation algorithm based on FOACID-multiOtsu.
[0115] Step 5: Perform lane line region image segmentation based on the FOACID-multiOtsu algorithm.
[0116] Specifically, such as Figure 1As shown, the preprocessed image is fed into the FOACID-multiOtsu algorithm to complete lane line region image segmentation. Figure 4 The image shows the lane line segmentation result based on the FOACID-multiOtsu algorithm, where the lane line regions are marked in red.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A lane line image segmentation method based on the FOACID-multiOtsu algorithm, characterized in that, Includes the following steps: S1. Preprocess the road images captured by the vehicle-mounted forward-looking camera; S2. Extend the one-dimensional Otsu algorithm to multiple dimensions to obtain the multi-threshold multiOtsu segmentation algorithm; S3. Establish a FOA algorithm that takes into account individual differences, namely the FOACID algorithm; The specific steps for establishing the FOACID algorithm in step S3 include the following sub-steps: (1) In the feasible region of the optimization problem Randomly initialize the fruit fly positions within the system; The sub-step (1) is within the feasible region of the optimization problem. The specific steps for randomly initializing the fruit fly positions include: First, let the total number of fruit flies be N, and the maximum number of iterations be... Then, within the feasible region of the optimization problem The positions of each fruit fly are randomly initialized within the inner circle, and the first... Coordinates of only fruit flies That is, the dimension of the optimization problem is Then, the positions of each fruit fly are substituted into the fitness function. The fitness value corresponding to each fruit fly position is calculated, as shown in Equation (7). And put it into the fitness array (2) After considering the individual differences of each fruit fly, the fruit flies are grouped into multiple fruit fly subgroups; The specific steps for grouping the fruit flies after considering individual differences in sub-step (2) include: First, the fitness array obtained in sub-step (1) Select the fitness values that rank the top n. and the corresponding fruit fly locations Therefore, the fitness ratio of each fruit fly position is calculated, as shown in equation (8), where The value is between (4, 10); Subsequently, based on the fitness ratio of each fruit fly position, the remaining fruit flies were... Divided into The group is shown in equation (9). in Indicates the first Group, also known as the first A swarm of fruit flies, ,in Indicates the first The first fruit fly in the group, For the first The number of fruit flies contained in the group. Finally, The positions of the fruit flies in the data are added to each fruit fly subgroup according to formula (10). The above completes the fruit fly grouping operation considering the individual differences of each fruit fly; (3) The positions of each fruit fly subgroup are updated independently; (4) Obtain the global optimal solution based on fruit fly subgroup communication; S4. Combine the multiOtsu segmentation algorithm obtained in step S2 with the FOACID algorithm obtained in step S3 to obtain a lane line image segmentation algorithm based on FOACID-multiOtsu. S5. Lane line region image segmentation based on FOACID-multiOtsu algorithm.
2. The lane line image segmentation method based on the FOACID-multiOtsu algorithm according to claim 1, characterized in that, The specific steps for preprocessing the road ahead image captured by the vehicle-mounted forward-looking camera in step S1 are as follows: For the road images captured by the vehicle-mounted forward-facing camera, firstly, the ROI (Region of Interest) area is defined. Then, the image of the selected ROI region is converted to grayscale to eliminate redundant color information; Finally, a Gaussian filtering algorithm is used to eliminate interference noise generated during image acquisition, completing the preprocessing of the road images.
3. The lane line image segmentation method based on the FOACID-multiOtsu algorithm according to claim 1, characterized in that, The specific steps for obtaining the multi-threshold multiOtsu segmentation algorithm in step S2 are as follows: After converting the road-ahead image acquired in step S1 to grayscale, the pixels of the grayscale image are divided into [various categories] based on the grayscale values. Classes, respectively denoted as , … The corresponding segmentation threshold is and set the grayscale value The number of pixels is denoted as Therefore, its proportion in the total pixels N is: Therefore, the proportion of the Q-th class pixels to the total number of pixels can be obtained as follows: : The average gray level of the Q-th class pixel can be obtained. : Average grayscale value of the overall image for: and , Therefore, the formula for calculating inter-class variance in multi-threshold segmentation scenarios is obtained: At this point, it is only necessary to find the optimal threshold sequence. The goal is to maximize the inter-class variance. The optimal threshold sequence corresponding to multi-threshold segmentation is: This involves generalizing Otsu's algorithm from one-dimensional to multi-dimensional Otsu's, resulting in the multiOtsu segmentation algorithm. Essentially, this is a high-dimensional optimization problem, and its key lies in determining the optimal threshold sequence. To maximize the inter-class variance.
4. The lane line image segmentation method based on the FOACID-multiOtsu algorithm according to claim 1, characterized in that, The specific steps for updating the independent positions of each fruit fly subgroup in sub-step (3) are as follows: First, each fruit fly subgroup independently undertakes an optimization task, substituting the positions of each fruit fly in the current subgroup as feasible solutions to the optimization problem into the fitness function. Then, calculate the fitness value of each fruit fly position in the current fruit fly subpopulation according to equation (7), and find the fruit fly position with the highest fitness value and record it as . Its fitness value is ,in This represents the current iteration number. , Numbering the fruit fly subgroups , Subsequently, based on location Update fruit fly swarm The positions of the remaining fruit flies are shown in equation (11). in It is a random array with values ranging from (-0.5, 0.5), and its dimension is... Consistent, Finally, the iteration terminates when the current fruit fly subgroup reaches the pre-given maximum number of iterations and the above operations have traversed the current fruit fly subgroup. If the current fruit fly subgroup has not reached the pre-given maximum number of iterations, then continue to repeat the above steps for optimizing the fruit fly subgroup. If the current fruit fly subgroup reaches the pre-given maximum number of iterations, and the above operation has not traversed the current fruit fly subgroup, then the optimization task steps will be carried out by the next fruit fly subgroup.
5. The lane line image segmentation method based on the FOACID-multiOtsu algorithm according to claim 4, characterized in that, The specific steps in sub-step (4) for obtaining the global optimal solution based on fruit fly subgroup communication are as follows: The different fruit fly subgroups communicate with each other and compare the maximum fitness values found by each subgroup. Find the maximum value from it. and the corresponding fruit fly locations That is, the global optimal solution corresponding to the optimization problem of the FOACID algorithm.
6. The lane line image segmentation method based on the FOACID-multiOtsu algorithm according to any one of claims 3-5, characterized in that, The specific steps for obtaining the lane line image segmentation algorithm based on FOACID-multiOtsu in step S4 are as follows: Equation (5) is used as the fitness function of the FOACID algorithm, and during the fruit fly position initialization phase, the positions of each fruit fly are set... This means that the multiOtsu segmentation algorithm and the FOACID algorithm were combined to obtain a lane image segmentation algorithm based on FOACID-multiOtsu.
7. The lane line image segmentation method based on the FOACID-multiOtsu algorithm according to claim 1, characterized in that, The specific steps for lane line region image segmentation based on the FOACID-multiOtsu algorithm in step S5 are as follows: the preprocessed image from step S1 is fed into the FOACID-multiOtsu algorithm to complete lane line region image segmentation.
Citation Information
Patent Citations
Image segmentation method fusing IFOA and F-ISODATA
CN107680099A
System and method for using images for automatic visual inspection with machine learning
US20200005422A1