Solar power generation has great development potential as an abundant and clean energy source. However, many factors affect the efficiency of the photovoltaic (PV) module; among these factors, outdoor PV modules are inevitably affected by stains, thus reducing the power generation efficiency of the PV panel. This paper proposes a framework for PV module stain detection based on UAV hyperspectral images (HSIs). The framework consists of two stain detection methods: constrained energy minimization (CEM)-based and orthogonal subspace projection (OSP)-based stain detection methods. Firstly, the contaminated PV modules are analyzed and processed to enhance the data’s analytical capability. Secondly, based on the known spectral signature of the PV module, stain detection methods are proposed, including CEM-based stain detection and OSP-based stain detection for PV modules. The experimental results on real data illustrate that, in comparison with contrasting methods, the proposed method achieves stain detection results that closely align with known stain percentages. Additionally, it exhibits a fitting curve similar to the more maturely developed electroluminescence-based methods currently in use.