Limited by the complexity and analysis efficiency of image processing, traditional photovoltaic fault diagnosis methods based on image recognition are difficult to achieve real-time monitoring and large-scale fault classification and location. To address this problem, a photovoltaic detection algorithm based on shape factor and improved watershed segmentation was proposed. Firstly, a photovoltaic module segmentation algorithm was designed on the basis of shape factor. And the shape factor was defined as the ratio of the area to the perimeter of ??the connected region. It has scale and rotation invariance, and is able to extract the contours of photovoltaic modules with different scales in complex backgrounds to avoid interference of background areas on fault diagnosis. Secondly, the watershed algorithm was improved by iterative H value, the over-segmentation phenomenon was suppressed by adjusting the local minimum value, and the fault classification and precise location of the segmented photovoltaic module image were performed. Finally, in order to achieve remote control, the human-computer interaction interface designed by Qt Designer software was embedded in Raspberry Pi, and the intranet penetration and Virtual Network Console (VNC) were configured. At the same time, the drone was equipped with a Raspberry Pi and a high-definition camera to achieve real-time monitoring and fault diagnosis of photovoltaic station during flight. Experimental results show that the comprehensive accuracy of the proposed algorithm for identifying photovoltaic faults is 85.19%, which is 9.38 percentage points higher than that of the traditional watershed algorithm, and the over-segmentation rate is reduced by 26.1 percentage points, indicating that the proposed algorithm can control the over-segmentation phenomenon more effectively and improve the accuracy of fault diagnosis.