Production safety has always been a paramount concern for coal preparation plants. With the widespread availability of video capture equipments, using monitoring videos to enhance the warning capabilities and detection functionalities for equipment malfunctions has become a priority. This paper will focus on the problem of the conveyor belt deviation detection which occurs frequently in the coal preparation plants. Nowadays, most conveyor belt edge detection algorithms can only detect straight edges and cannot adapt to edge shapes. In addition, some algorithms cannot be applied in scenarios with external influences such as strong changes in illumination, excessive image exposure, or water accumulation. In response to these shortcomings, this paper proposes an algorithm with enhanced robustness that can adaptively detect conveyor belt edges. Experiments show that this algorithm has good illumination equalization effect, edge detection effect and accuracy, deviation detection accuracy, and works well in various situations. At the same time, this algorithm has already been successfully implemented for use in coal mining production.