Coal industry, as one of the basic industries of China's national economic development, provides support for the industrialization, informatization and modernization of China's social development directly. However, due to the complexity and triviality of mine environment, coal mine safety accidents often occur. In this paper, aiming at the safety problem caused by foreign body blocking in underground coal mine, the research of foreign body edge detection algorithm based on improved Canny operator is carried out. Firstly, the wavelet packet noise estimation method is used to estimate the mine tunnel noise, and then the noise level estimation is used as the noise reduction parameter of Canny operator to improve the edge detection effect of Canny operator to mine foreign body. The experimental results show that the improved Canny operator can overcome the influence of environmental noise on the detection results of foreign body edge, and the effect is excellent.