Remote sensing using passive solar illumination in the Short-Wave Infrared spectrum is exposed to strong intensity variation in the spectral bands due to atmospheric changing conditions and spectral absorption. More robust spectral analysis methods, insensitive to these effects, are increasingly required to improve the accuracy of the data analysis in the field and extend the use of the system to "non ideal" illumination condition. A computational hyperspectral image analysis method (named HIAM) for deriving optimal reflectance indices for use in remote sensing of soil moisture content is detailed and demonstrated. Using histogram analysis of hyperspectral images of wet and dry soil, contrast ratios and wavelength pairings were tested to find a suitable spectral index to recover soil moisture content. Measurements of local soil samples under laboratory and field conditions have been used to demonstrate the robustness of the index to varying lighting conditions, while publicly available databases have been used to test across a selection of soil classes. In both cases, the moisture was recovered with RMS error better than 5%. As the method is independent of material type, this method has the potential to also be applied across a variety of biological and man-made samples.