At present, diesel generators have been widely used in many industrial fields around the world. Due to the characteristics of small loss, fast start-up speed and high power generation rate, diesel generator can effectively guarantee the emergency power supply of related fields and departments. In this paper, infrared thermography is mainly used to collect the infrared thermogram of diesel generator. Then, the infrared images are processed by bilateral filters, and then the infrared images are accurately located by classification. The experimental results prove the accuracy of this method.