Image segmentation algorithm based on top-hat transformation

Aiming at the common problem of image segmentation effect caused by uneven illumination background, and to find an adaptive image segmentation algorithm, the combination of adaptive median method and wavelet transform method were applied to image denoising firstly, and contrast stretching transform function was applied to effect the enhancement of image. Then, we used the top-hat transform algorithm to improve the problem that the global threshold OTSU method to split the image was not satisfactory. We choose apples as the experimental object to verify the feasibility of the algorithm. Through experimental analysis, we know that the algorithm constructed in this paper has higher running speed, higher accuracy, and better adaptability and stability.