## 4 Discussion  
This paper proposes a technical solution that combines adaptive threshold segmentation algorithm and morphological reconstruction operation to extract the defects on wheel X-ray images. The innovation of the algorithm for dynamic threshold segmentation is that in case of defect segmentation, the algorithm focuses on the grayscale variation of the local area, and the size of local area and the grayscale variation can be directly determined by setting the parameters r and T, which is very suitable for the extraction of the hub defect. The morphological reconstruction operation restores the mask image by specifying the marking image. The operation feature is that the area existing in the marking image can be completely restored in the mask image, and the area not in the marking image will completely disappear in the mask image. Combining the algorithm for dynamic threshold segmentation with the morphological reconstruction operation is the max novelty in this paper. Taking the high-threshold segmentation result in the dynamic threshold segmentation algorithm as the marking image, and the low-threshold segmentation result as the mask image, the defect area marked by the high-threshold segmentation result after the reconstruction operation can be completely restored, and the interference area generated by the low-threshold segmentation result can be completely removed, and the accurate extraction of the hub defect is realized.  
Figure 7: Another result of proposed method: (**a**) original image; (**b**) segmentation result of \(r=39\) and \(T_{s}=1\); (**c**) segmentation result of r = 19 and \(T_{s}=5\); (**d**) final result of proposed method.  
Parameters shall be set to match different types and sizes of defects. The choice of the smoothing operator size \(r\) and the small threshold \(T_{s}\) is critical, for it determines what defects will be finally segmented out. Parameters shall be such that the defects are all segmented out and separated from the interference at once. Improper parameters, examples of which are shown in Figures 3 and 7, may lead to failure in defect extraction. Large threshold \(T_{b}\), area \(M_{s}\), and diameter \(M_{d}\) are designed to remove pseudo-defects. Parameter \(T_{b}\) shall be such that maximum interference is discarded without ignoring the defects. Parameter \(M_{s}\) and \(M_{d}\) act to remove the interference that is generated by the hub geometry and is not removable by thresholding. The experiment results show that the proposed method is capable of accurate segmentation of wheel hub defects and in practical applications, it is important to make proper parameter settings.  
Conceptualization, J.Z. and M.W.; Methodology, J.Z.; Software, Z.G. and T.J.; Validation, J.Z., Z.G., and T.J.; Formal Analysis, T.J.; Investigation, Z.G. and T.J.; Resources, M.W.; Data Curation, Z.G. and T.J.; Writing--Original Draft Preparation, J.Z.; Writing--Review & Editing, J.Z. and M.W.; Visualization, J.Z.; Supervision, M.W.; Project Administration, J.Z. and M.W.; Funding Acquisition, M.W.  
This research was funded by National Special Project for the Development of Major Scientific Instruments and Equipment of China (No. 2013 YQ240803) and Scientific and Technological Innovation Programs of Higher Education Institutions in Shanxi Province (2013163).  
The authors declare no conflict of interest.