The output in this code represents the structural similarity index between the two input images. This value can fall into the range [-1, 1] with a value of 1 being a perfect match.
SSIM index may not be restricted to image processing. In fact, because it is a symmetric measure, it can be thought of as a similarity measure for comparing any two signals. The signals can be either discrete or continuous, and can live in a space of arbitrary dimensionality.