## 5 Object Depth Modelling
Here, \(\mathrm{h}(\mathrm{x})\) is given by a circularly symmetric 2D Gaussian function \(\mathrm{h}(\mathrm{x})=\frac{1}{\sqrt{2\pi\sigma^{2}}}\mathrm{exp}\left(\frac{- \mathrm{x}^{2}}{2\sigma^{2}}\right)\), where \(\sigma\) is a function of the depth at a given point \(\mathrm{f}(\mathrm{d}_{\mathrm{i}},\mathrm{d}_{\mathrm{f}})\). Here, the depth is associated with two possible variables \(\mathrm{d}_{\mathrm{i}}\) and \(\mathrm{d}_{\mathrm{f}}\). The increase in the blurring effect in its turn causes a non-linear increase in \(\mathrm{D}_{\mathrm{CoC}}\). Thus, it yields:  
\[\sigma_{\mathrm{m}}=\mathrm{f}(\mathrm{D}_{\mathrm{CoC}}), \tag{7}\]  
where \(\mathrm{f}(. )\) represents a mathematical function. The effect of the lens, assuming a Gaussian PSF, \(\mathrm{p}(\mathrm{x})\), on the captured contour can additionally improve the model as:  
\[\begin{array}{c}\mathrm{f}(\mathrm{x})=(\mathrm{Au}(\mathrm{x})+\mathrm{B}) \otimes\mathrm{g}(\mathrm{x})  
It is notable to consider when the object position is at the focal distance. In that case, \(\sigma_{\rm m}=0\) and \(\rm g(x)=1\) in Equation (8). Then, the gradient of edges for such objects is calculated as  
\[\
abla(f_{\rm focal}(x))=\frac{A}{\sqrt{2\pi\sigma_{1}^{2}}}e^{\frac{-x^{2}}{2 \sigma_{1}^{2}}}. \tag{11}\]  
The result of detected edges which are contaminated by any tolerable blurring effect (i.e., when the object distance is still in the range of the DOF) or nontolerable blurring effect (i.e., when the object distance is outside the range of the DOF due to unintentional motion or defocus blur) can be compared to the same detected edges in the focal plane as  
\[\frac{\
abla(f(x))}{\
abla(f_{\rm focal}(x))}=\sqrt{\frac{\sigma_{1}^{2}}{ \sigma_{\rm m}^{2}+\sigma_{1}^{2}}}e^{(\frac{-x^{2}}{2\sigma_{\rm m}^{2}+2 \sigma_{1}^{2}}+\frac{x^{2}}{2\sigma_{1}^{2}})}. \tag{12}\]  
Equation (12) indicates an important result which can be used for detecting any blurring effect. The amplitude part of the equation shows the ratio of amplitudes (i.e., due to possible intensity changes) on an edge before and after any blurring effect. However, obtaining the equation assumes that the same edge is detected in and out of focal plane positions, which are difficult tasks in practice. Thus, to use the mentioned result and solve the practical issue, let us consider an estimation of \(\rm g(x)\) in Equation (8) as  
\[\hat{g}(x)=\frac{1}{\sqrt{2\pi\sigma_{\rm v}^{2}}}e^{\frac{-x^{2}}{2\sigma_{ \rm v}^{2}}}, \tag{13}\]  
which is a variable Gaussian model in which the model is modified by varying its standard deviation, \(\sigma_{\rm v}\). Let us assume the change in \(\sigma_{\rm v}\) is linear, monotonic, and in a limited optional range, i.e., \(\sigma_{\rm v}=f(d_{\rm v})=d_{\rm v}\), and the range of \(d_{\rm v}\) is chosen optionally. Now, assume we have a database of images containing sharp and blur images caused by unintentional motion or defocus blurring effects. If the database images are captured by the same capturing device and have different content, some pairs of sharp and blurred images of the database can be used in a training procedure to classify blurred images, even without the existence of their sharp counterpart, as follows. For the training set of images, the edges and the intensity values along the edges (i.e., the amplitude) of each image can be detected and computed, respectively. Using the amplitude part of Equation (12) and substituting \(\hat{g}(x)\) instead of \(\rm g(x)\), for a sharp image, it yields:  
Figure 5:0  
where \(T_{d\rm v}\) is a measurable value representing the ratio of intensity values of the pixels which are along the edges in the sharp and the generated blurred images. As long as the \(T_{d\rm v}\) values are obtained as a consequence of \(\hat{g}(x)\), the values represent the relative distances (i.e., the relative depth) between the generated blurred and the sharp image.