At present, automatic image matting methods primarily focus on portraits and hard edge targets, which gives them a limited ability to deal with low-resolution, complex, and blurred non-portrait targets. To address these issues, the current paper proposes an automatic image matting method called TGMatting. This method automatically optimizes Trimap generation through three modules: the U²S-Net pre-segmentation module, which is based on the U²-Net network, enhances segmentation by removing null convolutions and reducing oversampling interference; the BGTrimap module, which is also based on U²-Net, refines edge regions using optimized dilation-erosion methods and Manhattan distance for seed point sparsification, thus ensuring accurate region growth and background information removal; and in the last module, edges are transformed into mixed-pixel regions using Sobel operator and non-local-means denoising binarization, and a Trimap map is automatically generated by combining OTSU segmentation with pre-segmentation results, thus achieving fully automated processing. Finally, a transparency mask is obtained via FBAMatting, which enables interaction-<br/>free automatic matting. The experimental results demonstrate that the improved U²S-Net network reduces MAE by 0.003 on the SOD-Spider test set, enhances accurate detection of significant regions in low-resolution images compared to U²S-Net, and reduces BGTrimap"s sum of absolute difference value by about 10% compared to other Trimap generation methods in IFMatting and KNN Matting.
Read more