Thermoelastic stress analysis (TSA), performed on metallic components with a high diffusivity coefficient, seldom reaches adiabatic conditions. As a consequence, TSA results are affected by an attenuation whose entity varies locally, preventing the use of TSA as a reliable quantitative investigation means. The recovery of the adiabatic temperature and of the correct value of the first stress invariant, directly linked to it, can only be performed making an assumption on the local stress distribution. This article presents a method for automatically choosing, among a number of stress distribution functions, the one that performs the best correction of the raw TSA data. The implementation of this automatic correction procedure in a computer program allowed the point-by-point correction of whole TSA images. [ABSTRACT FROM AUTHOR]