Least squares information measure The normal distribution is :P(x, \mu, \sigma) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{(x-\mu)^2}{2\sigma^2} } Probability is related to information content described by
message length L, :P(x) = 2^{-L(x)} :L(x) = -\log_2{P(x)} so, :L(x, \mu, \sigma) = \log_2(\sigma\sqrt{2\pi}) + \frac{(x-\mu)^2}{2\sigma^2} \log_2 e For the purposes of comparing stereoscopic images, only the relative message length matters. Based on this, the information measure
I, called the Sum of Squares of Differences (SSD) is, :I(x, \mu, \sigma) = \frac{(x-\mu)^2}{\sigma^2} where, :L(x, \mu, \sigma) = \log_2(\sigma\sqrt{2\pi}) + I(x, \mu, \sigma) \frac{\log_2 e}{2} Because of the cost in processing time of squaring numbers in SSD, many implementations use Sum of Absolute Difference (SAD) as the basis for computing the information measure. Other methods use normalized cross correlation (NCC).
Information measure for stereoscopic images The
least squares measure may be used to measure the information content of the stereoscopic images, given depths at each point z(x, y). Firstly the information needed to express one image in terms of the other is derived. This is called I_m. A
color difference function should be used to fairly measure the difference between colors. The color difference function is written
cd in the following. The measure of the information needed to record the color matching between the two images is, :I_m(z_1, z_2) = \frac{1}{\sigma_m^2} \sum_{x, y}\operatorname{cd}(\operatorname{color}_1(x, y + \frac{k}{z_1(x, y)}), \operatorname{color}_2(x, y))^2 An assumption is made about the smoothness of the image. Assume that two pixels are more likely to be the same color, the closer the voxels they represent are. This measure is intended to favor colors that are similar being grouped at the same depth. For example, if an object in front occludes an area of sky behind, the measure of smoothness favors the blue pixels all being grouped together at the same depth. The total measure of smoothness uses the distance between voxels as an estimate of the expected standard deviation of the color difference, :I_s(z_1, z_2) = \frac{1}{2 \sigma_h^2} \sum_{i : \{1, 2\}} \sum_{x_1, y_1} \sum_{x_2, y_2} \frac{\operatorname{cd}(\operatorname{color}_i(x_1, y_1), \operatorname{color}_i(x_2, y_2))^2}{(x_1 - x_2)^2 + (y_1 - y_2)^2 + (z_i(x_1, y_1) - z_i(x_2, y_2))^2} The total information content is then the sum, :I_t(z_1, z_2) = I_m(z_1, z_2) + I_s(z_1, z_2) The z component of each pixel must be chosen to give the minimum value for the information content. This will give the most likely depths at each pixel. The minimum total information measure is, :I_{\operatorname{min}} = \min{\{i : i = I_t(z_1, z_2)\}} The depth functions for the left and right images are the pair, :(z_1, z_2) \in \{(z_1, z_2) : I_t(z_1, z_2) = I_{\operatorname{min}} \} == Methods of implementation ==