To address the issues of distortion and poor segmentation results in weld defect image segmentation, the crack and porosity welding defect images in the rim production process were taken as the research object. An improved particle swarm optimization algorithm based on simulated annealing is proposed for the three-threshold image segmentation of welding defects. First, a three-dimensional Otsu model is constructed using the grayscale value, average grayscale value, and median grayscale value of the image. Next, an adaptive inertia weight and asymmetric learning factor were introduced and integrated into the SA strategy to enhance the algorithm’s solving efficiency and ability to escape local optima. Finally, the SA-IPSO algorithm was used to optimize the three-dimensional Otsu model to obtain the optimal threshold and corresponding defect segmentation image. Various algorithms and models are employed to segment welding defect images. The results show that for crack and porosity defect images, the proposed improved algorithm outperforms the comparison algorithms in terms of peak signal-to-noise ratio and structural similarity evaluation metrics. The proposed method accelerates algorithm convergence while preventing distortion in segmentation results, thereby improving segmentation accuracy.
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |