Open access peer-reviewed chapter

# Probabilistic Analysis of Projected Features in Binocular Stereo

By Lorenzo J. Tardón, Isabel Barbancho and Carlos Alberola-López

Submitted: December 5th 2011Reviewed: April 18th 2012Published: July 11th 2012

DOI: 10.5772/46027

## 1. Introduction

Some geometrical relationships between projected primitives in binocular stereo systems will be analysed in the next sections with the aim of providing a characterization from a probabilistic point of view. To this end, we will consider the parallel stereo system model and the well known pinhole camera model .

The characterizations that will be derived will be readily usable as valuable sources of information to solve the correspondence problem in stereo systems  and their nature will be that of a priori information sources in Bayesian models.

To begin with, we will introduce the stereo system model that will be used for the analysis together with the notation that will be employed and the parameters that will be necessary for the calculations. Afterwards, we will use this model to derive the joint probability density function (pdf) of the orientation of the projections on the image planes of arbitrary small edges. In this case, we will find a cumbersome expression so, then, we will focus on the derivation of a tractable pdf of a convenient function of the orientation of the projections.

Later, we will turn our attention to the so called disparity gradient, which defines important relationships between projections in stereo systems. We will find three different usable pdfs of the disparity gradient that can be used to solve the correspondence problem in parallel stereo systems. Finally, a brief summary will be drawn.

## 2. Geometric relationships in the parallel stereo system model

In order to perform our analysis, we consider a common model for stereo image acquisition systems. The two cameras of the stereo system are considered to be identical. These cameras are modelled using the well known pinhole camera model with focal length $f$, parallel optical axes and image planes defined on the same geometric plane , . This description defines the so called parallel stereo system model. An illustration of the geometry and the projection process with this model is represented in Fig. .

For simplicity, the centre of the real world coordinate system is considered to be equidistant to the optical centres of the two cameras of the system (${C}_{l}$and ${C}_{r}$). The optical centers of the cameras are separated a distance $b$: the baseline. As shown in Fig. , the $X$axis is parallel to the linebase $b$and the $Z$axis is perpendicular to the image planes.

In Fig. , $A$and $B$represent the edges of a straight segment $\overline{AB}$of length $\delta$. $A$is located at $\left(X,Y,Z\right)$in the world coordinate system. The segment has an arbitrary orientation described by the angles $\alpha$and $\beta$defined with respect to the $XY$and $XZ$planes, respectively.

The edge points and the segment are projected onto the left and right image planes of our parallel stereo system. Thus, we find the projected points ${A}_{l}$and ${B}_{l}$on the left image and the projected segment ${\delta }_{l}$on the same image. Also, the angle between ${\delta }_{l}$and the horizontal on the left image is denoted ${\theta }_{l}$. Similarly, on the right image plane we find ${A}_{r}$, ${B}_{r}$, ${\delta }_{r}$and the angle ${\theta }_{r}$.

Recall that the optical axes of the two cameras are parallel in our stereo model. Also, we consider that equally numbered horizontal lines on the two image planes comply with the epipolar constraint .

The segments on the image planes that correspond to the projection of the same segment in the real world are partially characterized and related by their respective orientations on the left and right images. This orientation can be analysed to be used to solve the correspondence problem in stereo systems.

Using the model selected, we will focus in the next sections on the orientation of the projection of small straight edges (${\delta }_{l}$and ${\delta }_{r}$). Then, we will also consider a well known feature: the disparity gradient , and we will show how to develop probability characterizations of this feature under different conditions .

## 3. Joint probability density function of the orientation of projected edges

Making use of the geometrical relationships established in the previous section and in Fig. , we will derive a relationship between the location and orientation of the edgel $\delta$ in the real world, and the orientations of its projections described by the angles ${\theta }_{l}$and ${\theta }_{r}$(Fig. ) in the corresponding image planes. Then, under appropriate hypotheses, we will find the description of the joint probabilistic behaviour of the projected angles.

Consider the definitions and the geometry shown in Fig. where the length of the segment $\delta$is arbitrarily small. We can write the location of the projected points in the left and right images using their coordinates on the corresponding image planes . Let ${B}_{l}=\left({B}_{lx},{B}_{ly}\right)$, then, using the geometry involved and using $B$and its projections as starting reference, we can write ${A}_{l}=\left({A}_{lx},{A}_{ly}\right)=\left({B}_{lx}+{\delta }_{l}cos{\theta }_{l},{B}_{ly}+{\delta }_{l}sin{\theta }_{l}\right)$.

Now, let's look at the right ($r$) image. Under the hypotheses described previously, and using the length of the projected edgel on the right image, ${\delta }_{r}$, making use of the fact that the $y$coordinates must be the same in the two images, it is simple to observe that ${\delta }_{l}sin{\theta }_{l}={\delta }_{r}sin{\theta }_{r}$and, so, ${\delta }_{r}=\frac{{\delta }_{l}sin{\theta }_{l}}{sin{\theta }_{r}}$.

After these observations, the coordinates of the projections of $A$and $B$can be written as follows:

$\begin{array}{ccc}& & {A}_{r}=\left({A}_{rx},{A}_{ry}\right)=\left({B}_{rx}+\frac{{\delta }_{l}sin{\theta }_{l}}{sin{\theta }_{r}}cos{\theta }_{r},{B}_{ry}+{\delta }_{l}sin{\theta }_{l}\right)\hfill \\ & & {B}_{r}=\left({B}_{rx},{B}_{ry}\right)\hfill \end{array}$uid2

But our objective must be to find the relation between the projections and the orientation of the edgel in the real world, such orientation is described by the angles $\alpha$and $\beta$in Fig. . Working in this direction, the following relations can be observed:

$\left\{\begin{array}{c}\alpha =arctan\frac{{B}_{z}-{A}_{z}}{{B}_{x}-{A}_{x}}\hfill \\ \beta =arctan\frac{{B}_{y}-{A}_{y}}{\sqrt{{\left({B}_{x}-{A}_{x}\right)}^{2}+{\left({B}_{z}-{A}_{z}\right)}^{2}}}=arcsin\frac{{B}_{y}-{A}_{y}}{\sqrt{{\left({B}_{x}-{A}_{x}\right)}^{2}+{\left({B}_{y}-{A}_{y}\right)}^{2}+{\left({B}_{z}-{A}_{z}\right)}^{2}}}\hfill \end{array}\right\$uid3

On the other hand, using the projection equations of the pinhole camera model , the following relations can be found:

$\begin{array}{ccc}\hfill X& =& -\frac{{x}_{l}b}{{x}_{r}-{x}_{l}}-\frac{b}{2}\hfill \\ \hfill Y& =& -\frac{{y}_{l}b}{{x}_{r}-{x}_{l}}\hfill \\ \hfill Z& =& \frac{fb}{{x}_{r}-{x}_{l}}\hfill \end{array}$uid4

where $\left(X,Y,Z\right)$correspond to the coordinates of a generic point in the real world and $\left({x}_{l},{y}_{l}\right)$, $\left({x}_{r},{y}_{r}\right)$correspond to its projections on the left and right images, respectively.

Now, using eqs. () to () together with eqs. () and (), it is possible to find the expressions of the following terms involved in the calculation of the projected angles:

$\begin{array}{ccc}\hfill & & {B}_{x}-{A}_{x}\hfill \\ & & {B}_{y}-{A}_{y}\hfill \\ & & {B}_{z}-{A}_{z}\hfill \end{array}$uid5

Then, using these expressions in eq. () and writing all the terms as functions of the real world coordinates of $A$, the coordinates of ${B}_{r}$, the camera parameters $f$and $b$and the orientation of the projections of the edgel (${\theta }_{l}$and ${\theta }_{r}$), we find the equations that lead us from $\left(\alpha ,\beta \right)$to $\left({\theta }_{l},{\theta }_{r}\right)$:

$\left\{\begin{array}{c}\alpha =arctan\left[\frac{Zsin\left({\theta }_{r}-{\theta }_{l}\right)}{Xsin\left({\theta }_{r}-{\theta }_{l}\right)-\frac{b}{2}sin\left({\theta }_{r}+{\theta }_{l}\right)}\right]\hfill \\ \beta =arctan\left[\frac{bsin{\theta }_{l}sin{\theta }_{r}-Ysin\left({\theta }_{r}-{\theta }_{l}\right)}{\sqrt{{\left[Xsin\left({\theta }_{r}-{\theta }_{l}\right)-bsin\left({\theta }_{r}+{\theta }_{l}\right)\right]}^{2}+{\left[Zsin\left({\theta }_{r}-{\theta }_{l}\right)\right]}^{2}}}\right]\hfill \end{array}\right\$uid6

After these operations, we are ready to derive the joint pdf of the orientation of the projections of the segment: ${f}_{{\theta }_{l},{\theta }_{r}}\left({\theta }_{l},{\theta }_{r}\right)$. To this end, only the pdf of $\left(\alpha ,\beta \right)$is required at this stage.

Since there is no reason to think differently, we will assume that these two parameters are independent uniform random variables (rv's) ranging from 0 to $\pi$. Under these hypotheses, it is evident that the joint pdf of $\left(\alpha ,\beta \right)$is ${f}_{\alpha \beta }\left(\alpha ,\beta \right)=\frac{1}{{\pi }^{2}}$. So, in order to derive the desired expression, we only need to calculate the modulus of the Jacobian of the transformation :

$|{J}_{d}|=\left|\begin{array}{cc}\frac{\partial \alpha }{\partial {\theta }_{l}}& \frac{\partial \alpha }{\partial {\theta }_{r}}\\ \frac{\partial \beta }{\partial {\theta }_{l}}& \frac{\partial \beta }{\partial {\theta }_{r}}\end{array}\right|$uid7

Thus, we must find the partial derivatives of $\alpha$and $\beta$with respect to ${\theta }_{l}$y ${\theta }_{r}$. These are not simple expressions because of the functions involved. As an example, observe the result obtained for the last element of ${J}_{d}$:

$\begin{array}{c}\frac{\partial \beta }{\partial {\theta }_{r}}=\frac{\left[bsin{\theta }_{l}cos{\theta }_{r}-Ycos\left({\theta }_{r}-{\theta }_{l}\right)\right]\left\{{\left[Xsin\left({\theta }_{r}-{\theta }_{l}\right)-bsin\left({\theta }_{r}+{\theta }_{l}\right)\right]}^{2}+{Z}^{2}{sin}^{2}\left({\theta }_{r}-{\theta }_{l}\right)\right\}-...}{\left\{{\left[Xsin\left({\theta }_{r}-{\theta }_{l}\right)-bsin\left({\theta }_{r}+{\theta }_{l}\right)\right]}^{2}+...}\cdots \hfill \\ \cdots \frac{...\left[bsin{\theta }_{l}sin{\theta }_{r}-Ysin\left({\theta }_{r}-{\theta }_{l}\right)\right]\left\{\left[Xsin\left({\theta }_{r}-{\theta }_{l}\right)-bsin\left({\theta }_{r}+{\theta }_{l}\right)\right]...}{...{Z}^{2}{sin}^{2}\left({\theta }_{r}-{\theta }_{l}\right)+{\left[bsin{\theta }_{l}sin{\theta }_{r}-Ysin\left({\theta }_{r}-{\theta }_{l}\right)\right]}^{2}\right\}...}\cdots \\ \hfill \cdots \frac{...\left[Xcos\left({\theta }_{r}-{\theta }_{l}\right)-bcos\left({\theta }_{r}+{\theta }_{l}\right)\right]+{Z}^{2}sin\left({\theta }_{r}-{\theta }_{l}\right)cos\left({\theta }_{r}-{\theta }_{l}\right)\right\}}{\cdots \sqrt{{\left[Xsin\left({\theta }_{r}-{\theta }_{l}\right)-bsin\left({\theta }_{r}+{\theta }_{l}\right)\right]}^{2}+{Z}^{2}{sin}^{2}\left({\theta }_{r}-{\theta }_{l}\right)}}\end{array}$uid8

Since analytical expressions for all the required terms can be found by direct calculations, it is possible to obtain the desired pdf operating in the usual way :

${f}_{{\theta }_{l},{\theta }_{r}}\left({\theta }_{l},{\theta }_{r}\right)=\frac{1}{{\pi }^{2}}|{J}_{d}|$uid9

Unfortunately, this expression far from being simple because of the complexity of the terms involved. This fact should encourage us to search for a more usable expression capable of statistically describing a certain relation between the orientation of the projected segments. In the next section, we find such expression by using a function of cot ${\theta }_{l}$and cot ${\theta }_{r}$.

## 4. Probability density function of the difference of the cot of the orientation of projected segments

A tractable expression to relate the orientation of projected segments can be found by defining a suitable function of the projected angles shown in Fig. . Let ${f}_{K}\left(k\right)$, with $k$a function of $\left\{{\theta }_{l},{\theta }_{r}\right\}$denote such function.

More specifically, the pdf of the modulus of the difference of the cot of the projected angles in the selected binocular stereo system will be derived.

Taking into account the scene depicted in Fig. , let $\overline{AB}$define, again, a straight segment with arbitrary length $\delta$. The orientation of this segment is described by the angles $\alpha$y $\beta$as shown in the figure.

Now, the location of the edges of the segment in the real world coordinate system will be written as follows:

$A:\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\left({A}_{x},{A}_{y},{A}_{z}\right)=\left(X,Y,Z\right)$uid10
$B:\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\left({B}_{x},{B}_{y},{B}_{z}\right)=\left(X+\delta cos\beta cos\alpha ,Y-\delta sin\beta ,Z-\delta cos\beta sin\alpha \right)$uid11

And taking into account the geometry selected, the coordinates of the projections of the edges of the segment can be written as:

$\begin{array}{ccc}\hfill {A}_{rx}=-\frac{f}{{A}_{z}}\left({A}_{x}-\frac{b}{2}\right)& & {A}_{lx}=-\frac{f}{{A}_{z}}\left({A}_{x}+\frac{b}{2}\right)\hfill \\ \hfill {A}_{ry}=-\frac{f}{{A}_{z}}{A}_{y}& & {A}_{ly}=-\frac{f}{{A}_{z}}{A}_{y}\hfill \end{array}$uid12
$\begin{array}{ccc}\hfill {B}_{rx}=-\frac{f}{{B}_{z}}\left({B}_{x}-\frac{b}{2}\right)& & {B}_{lx}=-\frac{f}{{B}_{z}}\left({B}_{x}+\frac{b}{2}\right)\hfill \\ \hfill {B}_{ry}=-\frac{f}{{B}_{z}}{B}_{y}& & {B}_{ly}=-\frac{f}{{B}_{z}}{B}_{y}\hfill \end{array}$uid13

Now, let

$k=|cot\left({\theta }_{l}\right)-cot\left({\theta }_{r}\right)|$uid14

Substituting the cot functions by the corresponding expressions in terms of the projections of the edges of the segment, using the projection equations () to (), multiplying by ${A}_{z}{B}_{z}$, substituting ${B}_{i}$as a function of the coordinates of $A$and dividing by $cos\beta$, the following expression is found:

$k=\left|\frac{-bsin\alpha }{Ztan\beta -Ysin\alpha }\right|$uid15

This expression will be used to derive the pdf of $k$.

To begin with, the joint pdf of $k$and $\alpha$will be derived. To this end, the following transformation equations will be used:

$\left\{\begin{array}{c}k=\left|\frac{-bsin\alpha }{Ztan\beta -Ysin\alpha }\right|\hfill \\ \alpha =\alpha \hfill \end{array}\right\$uid16

The modulus of the Jacobian of the transformation can be easily determined:

$|J|=\left|\begin{array}{cc}\frac{\partial k}{\partial \alpha }& \frac{\partial k}{\partial \beta }\\ \frac{\partial \alpha }{\partial \alpha }& \frac{\partial \alpha }{\partial \beta }\end{array}\right|=\frac{bsin\alpha Z{sec}^{2}\beta }{{\left(Ztan\beta -Ysin\alpha \right)}^{2}}$uid17

With all this, the joint pdf of $k$and $\alpha$can be readily obtained , :

${f}_{k,\alpha }\left(k,\alpha \right)=\sum _{r}f\left(\alpha \left({k}_{r},{\alpha }_{r}\right),\beta \left({k}_{r},{\alpha }_{r}\right)\right)\frac{1}{|{J}_{r}|}$uid18

where $r$represents the set of roots of the transformation of $\left(\alpha ,\beta \right)$as a function of $\left(k,\alpha \right)$. Two different solutions can be found for this transformation because of the modulus operation in equation ():

$\left\{\begin{array}{c}\left\{\begin{array}{cc}\beta =arctan\left[sin\alpha \left(\frac{kY+b}{kZ}\right)\right],\hfill & withk=\frac{bsin\alpha }{Ztan\beta -Ysinalpha}\hfill \\ \beta =arctan\left[sin\alpha \left(\frac{kY-b}{kZ}\right)\right],\hfill & withk=\frac{-bsin\alpha }{Ztan\beta -Ysinalpha}\hfill \end{array}\right\\hfill \\ \alpha =\alpha \hfill \end{array}\right\$uid19

Assuming, that the orientation angles $\alpha$and $\beta$behave as uniform random variables  with range $\left(0,\pi \right)$and assuming independence, it is clear that $f\left(\alpha ,\beta \right)=\frac{1}{{\pi }^{2}}$. Then, equation () can be written, after substitution of the terms involved as:

${f}_{k,\alpha }\left(k,\alpha \right)=\frac{1}{{\pi }^{2}}{\frac{{\left(Ztan\beta -Ysin\alpha \right)}^{2}}{bsin\alpha Z{sec}^{2}\beta }|}_{\beta =arctan\left[sin\alpha \frac{kY+b}{kZ}\right]}+\frac{1}{{\pi }^{2}}{\frac{{\left(Ztan\beta -Ysin\alpha \right)}^{2}}{bsin\alpha Z{sec}^{2}\beta }|}_{\beta =arctan\left[sin\alpha \frac{kY-b}{kZ}\right]}$uid20

Now, $\alpha$and $\beta$can be expressed in terms of $\alpha$and $k$, making use of the following identity: $sec\left[arctana\right]=\sqrt{1+{a}^{2}}$. Thus, the following expression is found after some simplifications:

${f}_{k,\alpha }\left(k,\alpha \right)=\frac{1}{{\pi }^{2}}\frac{bsin\alpha }{{k}^{2}Z\left[1+{sin}^{2}\alpha {\left(\frac{kY+b}{kZ}\right)}^{2}\right]}+\frac{1}{{\pi }^{2}}\frac{bsin\alpha }{{k}^{2}Z\left[1+{sin}^{2}\alpha {\left(\frac{kY-b}{kZ}\right)}^{2}\right]}$uid21

Now, the last step to reach our objective is to integrate with respect to $\alpha$. The two terms of the previous fdp can be integrated similarly. It will be shown how the first one is handled:

$\begin{array}{c}{I}_{1}={\int }_{\alpha =0}^{\pi }\frac{b}{{\pi }^{2}{k}^{2}Z}\frac{sin\alpha }{\left[1+{sin}^{2}\alpha {\left(\frac{kY+b}{kZ}\right)}^{2}\right]}d\alpha =\left\{\begin{array}{c}cos\alpha =x\\ -sin\alpha d\alpha =dx\end{array}\right\}⇒\hfill \\ \frac{b}{{\pi }^{2}{k}^{2}Z}{\int }_{x\left(\alpha =0\right)}^{x\left(\alpha =\pi \right)}\frac{-dx}{1+\left(1-{x}^{2}\right){\left(\frac{kY+b}{kZ}\right)}^{2}}=\\ \frac{b}{{\pi }^{2}{k}^{2}Z\left[1+{\left(\frac{kY+b}{kZ}\right)}^{2}\right]}{\int }_{x\left(\alpha =0\right)}^{x\left(\alpha =\pi \right)}\frac{-dx}{1-{x}^{2}\frac{{\left(\frac{kY+b}{kZ}\right)}^{2}}{1+{\left(\frac{kY+b}{kZ}\right)}^{2}}}=\left\{\begin{array}{c}x\frac{\frac{kY+b}{kZ}}{\sqrt{1+{\left(\frac{kY+b}{kZ}\right)}^{2}}}=y\\ dx=\frac{\sqrt{1+{\left(\frac{kY+b}{kZ}\right)}^{2}}}{\frac{kY+b}{kZ}}dy\end{array}\right\}⇒\\ \frac{b}{{\pi }^{2}{k}^{2}Z\sqrt{1+{\left(\frac{kY+b}{kZ}\right)}^{2}}\frac{kY+b}{kZ}}{\int }_{y\left(x\left(\alpha =0\right)\right)}^{y\left(x\left(\alpha =\pi \right)\right)}\frac{-dy}{1-{y}^{2}}=\\ \hfill \frac{2b}{{\pi }^{2}k\sqrt{1+{\left(\frac{kY+b}{kZ}\right)}^{2}}\left(kY+b\right)}arctanh\phantom{\rule{0.166667em}{0ex}}\left(\frac{kY+b}{\sqrt{{k}^{2}{Z}^{2}+{\left(kY+b\right)}^{2}}}\right)\end{array}$uid22

The second term can be integrated likewise.

Finally, the target pdf, ${f}_{k}\left(k\right)$, can be written:

$\begin{array}{c}{f}_{k}\left(k\right)=\frac{2b}{{\pi }^{2}k\sqrt{1+{\left(\frac{kY+b}{kZ}\right)}^{2}}\left(kY+b\right)}arctanh\phantom{\rule{0.166667em}{0ex}}\left(\frac{kY+b}{\sqrt{{k}^{2}{Z}^{2}+{\left(kY+b\right)}^{2}}}\right)+\hfill \\ \hfill \frac{2b}{{\pi }^{2}k\sqrt{1+{\left(\frac{kY-b}{kZ}\right)}^{2}}\left(kY-b\right)}arctanh\phantom{\rule{0.166667em}{0ex}}\left(\frac{kY-b}{\sqrt{{k}^{2}{Z}^{2}+{\left(kY-b\right)}^{2}}}\right),\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}k>0\end{array}$uid23

This is the expression we were looking for. The behaviour of this function is represented in Fig. . Figure 2.Probability density function of the modulus of the difference of the cot of the orientation of projected segments (Y=0).

The disparity gradient has been successfully used in the process of establishment of the correspondence relationships in stereo vision systems. Although the probabilistic behaviour of this feature has been used previously , , the process to derive some of the pdfs related to the disparity gradient has not been detailed. In this section, we will focus on the specific procedure to find different approximations of the probabilistic characterization of the disparity gradient. Thus, we will derive several expressions of the pdf of the disparity gradient$DG$represents the random variable whereas $dg$represents a realization of $DG$.:

${f}_{DG}\left(dg\right)$uid26

We will pay attention to the assumptions required to derive the pdfs and to the approximations used in the different cases considered.

The disparity gradient has been successfully used as a source of information to solve the correspondence problem in stereo systems , , , , , , .

Generally speaking, the disparity gradient provides a priori information regarding how the real world scene is projected onto the image planes of a stereo system and, consequently, how different matching points in the projected images must be related in terms of geometrical (disparity related) relationships

The disparity refers to the difference between the coordinates of the projections of a certain point of the 3D world onto the image planes of a stereo system. Obviously, the disparity gradient refers to the rate of change of the disparity between nearby or related points .

Furthermore, it has been confirmed that the human visual system shows certain limitations related to the disparity gradient when matching stereo images . More specifically, it was proved that 1 represents the limit of the disparity gradient for most of the subjects evaluated. On the other hand, other experiments were performed by other authors that showed that, under certain conditions, the disparity gradient can be over that threshold but with low probability. In fact, Pollard  derived a probability function for the disparity gradient in a stereo system with fixation point.

Additionally, the disparity gradient is able to consider other important constraints often employed for the analysis of three dimensional scenes such as figural continuity, ordering of projected features or continuity of the disparity gradient itself , .

### 5.2. Stereo system for the probabilistic analysis of the disparity gradient

In the following sections devoted to the probabilistic analysis of the disparity gradient in a parallel binocular stereo system, the specific geometry that will be considered is shown in Fig. . According to this figure, the locations in the real world of the points $A$and $B$, that define a straight segment with its mid-point at $\left({X}_{0},{Y}_{0},{Z}_{0}\right)$and length $2\delta$, are given by the following expressions:

$\begin{array}{ccc}\hfill A=\left({X}_{0}+\delta cos\beta cos\alpha ,{Y}_{0}+\delta cos\beta sin\alpha ,{Z}_{0}-\delta sin\beta \right)& & \\ \hfill B=\left({X}_{0}-\delta cos\beta cos\alpha ,{Y}_{0}-\delta cos\beta sin\alpha ,{Z}_{0}+\delta sin\beta \right)& \end{array}$uid29

Then, the projections of the edge points of the segment onto the right and left image planes are given by:

$\begin{array}{ccc}\hfill {A}_{r}=\left(-\frac{f}{{A}_{z}}\left({A}_{x}-\frac{b}{2}\right),-\frac{f}{{A}_{z}}{A}_{y}\right)& & \\ \hfill {B}_{r}=\left(-\frac{f}{{B}_{z}}\left({B}_{x}-\frac{b}{2}\right),-\frac{f}{{B}_{z}}{B}_{y}\right)& & \\ \hfill {A}_{l}=\left(-\frac{f}{{A}_{z}}\left({A}_{x}+\frac{b}{2}\right),-\frac{f}{{A}_{z}}{A}_{y}\right)& & \\ \hfill {B}_{l}=\left(-\frac{f}{{B}_{z}}\left({B}_{x}+\frac{b}{2}\right),-\frac{f}{{B}_{z}}{B}_{y}\right)& \end{array}$uid31

In this scenario, the disparity gradient is defined as the quotient between the difference of disparity between the two points observed and their Cyclopean separation :

$dg=\frac{Differenceofdisparity}{Cyclopeanseparation}$uid32

Taking into account that the Cyclopean projections of $A$and $B$are given by the following equation:

$\frac{{A}_{r}+{A}_{l}}{2}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}and\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\frac{{B}_{r}+{B}_{l}}{2}$uid33

and using the disparity vectors associated to the points $A$and $B$given by

$\left({A}_{l}-{A}_{r}\right)\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}and\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\left({B}_{l}-{B}_{r}\right)$uid34

respectively. Then the disparity gradient can be written as follows:

$dg=2\frac{||\left({A}_{r}-{B}_{r}\right)-\left({A}_{l}-{B}_{l}\right)||}{||\left({A}_{r}-{B}_{r}\right)+\left({A}_{l}-{B}_{l}\right)||}$uid35

Now, by substitution of the expressions of ${A}_{l}$, ${B}_{l}$, ${A}_{r}$and ${B}_{r}$, multiplying by ${A}_{z}{B}_{z}$, substituting by their expressions in terms of $\delta$, $\beta$and ${Z}_{0}$, after some simplifications and reordering all the terms, the following expression is found:

$dg=\frac{|bsin\beta |}{||\left(-{X}_{0}sin\beta -{Z}_{0}cos\beta cos\alpha ,-{Y}_{0}sin\beta -{Z}_{0}cos\beta sin\alpha \right)||}$uid36

This is the main equation that will be used to derive different expressions of the disparity gradient in different scenarios.

The following sections describe the scenarios and the procedures issued to derive the different probability density functions.

### 5.3. Primitives centred in the world reference system

In our first scenario, we will be able to derive an exact analytical expression of the pdf of the disparity gradient This expression can be considered to be illustrative of the behaviour of $dg$. Moreover, in the next subsection, we will show how the same expression is found under different conditions and assumptions.

In this first scenario, we will assume that ${X}_{0}=0$, ${Y}_{0}=0$and $\alpha =0$(see Fig. ). Then, the expression of the disparity gradient (eq. ()) is readily simplified to give:

$dg=\frac{b}{{Z}_{0}}|tan\beta |$uid38

We will assume that the angle of orientation $\beta$behaves as a uniform random variable in the range $\left(0,\pi \right)$.

Paying attention to the symmetry of $dg$, it is possible to pose the problem in a more convenient way. Without loss of generality, the modulus of $tan\beta$in eq. () can be removed by simply allowing the random variable $\beta$to be defined as a uniform random variable in $\left(0,\frac{\pi }{2}\right)$. The application of this and other symmetry conditions that will be considered later will allow us to avoid some expressions that involve the calculation of the modulus of certain functions and thus the analysis and some of the expressions involved will remain conveniently more simple.

According to equation (), it is quite simple to obtain the derivative of the disparity gradient with respect to $\beta$. Let $g\left(\beta \right)=dg$, then ${g}^{\text{'}}\left(\beta \right)=\frac{b}{{Z}_{0}{cos}^{2}\beta }$. On the other hand, it is possible to obtain $\beta$as ${g}^{-1}\left(dg\right)=arctan\left(\frac{{Z}_{0}}{b}dg\right)$. Thus, finally, the pdf of $DG$is directly obtained:

${f}_{DG}\left(dg\right)={\frac{\frac{\pi }{2}}{\frac{b}{{Z}_{0}}\left|\frac{1}{{cos}^{2}\beta }\right|}|}_{\beta ={g}^{-1}\left(dg\right)}={\frac{\frac{2{Z}_{0}}{\pi b}}{1+{tan}^{2}\beta }|}_{\beta ={g}^{-1}\left(dg\right)}=\frac{\frac{2{Z}_{0}}{\pi b}}{{\left[tan\left(arctan\left(\frac{{Z}_{0}}{b}dg\right)\right)\right]}^{2}+1}=$
${f}_{DG}\left(dg\right)=\frac{\frac{2}{\pi }\frac{b}{{Z}_{0}}}{d{g}^{2}+{\left(\frac{b}{{Z}_{0}}\right)}^{2}},\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}dg\phantom{\rule{0.166667em}{0ex}}\in \phantom{\rule{0.166667em}{0ex}}\left(0,\infty \right)$uid39

In this expression (eq. () and Fig. ), a unilateral Cauchy probability density function should be identified. In our scenario, this Cauchy function is tuned by the parameters 0 and $\frac{b}{{Z}_{0}}$. The distribution function can be easily found (See Fig. ):

${F}_{DG}\left(dg\right)=\frac{2}{\pi }arctan\left(\frac{{Z}_{0}}{b}dg\right),\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}dg\phantom{\rule{0.166667em}{0ex}}\in \phantom{\rule{0.166667em}{0ex}}\left(0,\infty \right)$uid42

### 5.4. Narrow field of view cameras

In this section, another step in the analysis of the behaviour of the disparity gradient will be done. We will consider a binocular stereo system with cameras of narrow field of view satisfying the epipolar constraint. This is a scenario that can be applied in numerous cases. Moreover, we can consider this scenario as a basic model for the analysis of stereo systems and suitable for practical applications.

In this scenario, the disparity gradient is given by:

$\begin{array}{c}dg=2\frac{||\left(\frac{fb}{{A}_{z}},0\right)-\left(\frac{fb}{{B}_{z}},0\right)||}{||\left(-\frac{2f}{{A}_{z}}\left({X}_{0}+\delta cos\beta cos\alpha \right),-\frac{2f}{{A}_{z}}\left({Y}_{0}+\delta cos\beta sin\alpha \right)\right)...}\cdots \hfill \\ \\ \hfill \cdots \frac{}{...-\left(-\frac{2f}{{B}_{z}}\left({X}_{0}-\delta cos\beta cos\alpha \right),-\frac{2f}{{B}_{z}}\left({Y}_{0}-\delta cos\beta sin\alpha \right)\right)||}\end{array}$uid44

After the substitution of ${A}_{z}$and ${B}_{z}$by their respective expressions in terms of ${X}_{0}$, ${Y}_{0}$, ${Z}_{0}$, $\alpha$, $\beta$and $\delta$and reordering all the terms the following expression can be found:

$dg=\frac{\sqrt{{b}^{2}{sin}^{2}\beta }}{\phantom{\rule{4pt}{0ex}}\sqrt{\left({X}_{0}^{2}+{Y}_{0}^{2}\right){sin}^{2}\beta +{Z}_{0}^{2}{cos}^{2}\beta +2{Z}_{0}sin\beta cos\beta \left({X}_{0}cos\alpha +{Y}_{0}sin\alpha \right)}}$uid45

We will derive the desired pdf making use of this equation.

The fact that the cameras of the stereo system have a narrow field of view implies that the coordinates in the real world of the projected objects should satisfy the following condition: ${Z}_{0}\gg {X}_{0},{Y}_{0}$. On the other hand, the angle $\beta$should not be equal to $\frac{\pi }{2}$(as a matter of fact, being $\beta$a continuous random variable, this conditions represents and event with zero probability).

Under the hypotheses described, removing ${X}_{0}$and ${Y}_{0}$from the expression of the disparity gradient, because of the narrow field approximation, and assuming that ${Z}_{0}\ll {Z}_{0}^{2}$, the following simplified expression is found:

$dg\approx \frac{\sqrt{{b}^{2}{sin}^{2}\beta }}{\sqrt{{Z}_{0}^{2}{cos}^{2}\beta }}=\frac{bsin\beta }{{Z}_{0}|cos\beta |}$uid46

In this scenario, the symmetry of the geometry and the behaviour of the random variables $\alpha$and $\beta$allows us to consider the following range for the uniform random variables $\alpha$and $\beta$: $\left(-\frac{\pi }{2},\frac{\pi }{2}\right)$and $\left(0,\frac{\pi }{2}\right)$, respectively. And then, the expression of the disparity gradient can be written as:

$dg=\frac{bsin\beta }{{Z}_{0}cos\beta }$uid47

Now, in order to derive the behaviour of the disparity gradient, we will observe the region in which the random variable $DG$is smaller than a certain value $dg$. Then, $Prob\left\{DGis given by the probability that the random variables $\alpha$and $\beta$are such that $DG. Let ${C}_{dg}$denote the region in the $\alpha$-$\beta$plane that complies with this condition:

$Prob\left\{DGuid48

This probability can be easily found by integrating the joint pdf of $\alpha$and $\beta$in the region ${C}_{dg}$:

${F}_{DG}\left(dg\right)=\int {\int }_{{C}_{dg}}{f}_{\alpha ,\beta }\left(\alpha ,\beta \right)d\alpha d\beta$uid49

where, according to the selected hypotheses, the joint pdf required is given by ${f}_{\alpha ,\beta }\left(\alpha ,\beta \right)=\frac{2}{{\pi }^{2}}$.

In order to define the region ${C}_{dg}$, eq. () must be used in order to obtain the solutions of $\beta$:

$\beta =arctan\left(\frac{dg{Z}_{0}}{b}\right)$uid50

So, the region in the $\alpha$-$\beta$plane that defines ${C}_{dg}$is given by the following relations:

$\left\{\begin{array}{c}\alpha \in \left(-\frac{\pi }{2},\frac{\pi }{2}\right)\hfill \\ \beta \in \left(0,arctan\left(\frac{dg{Z}_{0}}{b}\right)\right)\hfill \end{array}\right\$uid51

Thus, it is possible to derive the probability distribution function of the disparity gradient solving the following integral:

${F}_{DG}\left(dg\right)={\int }_{\alpha =-\frac{\pi }{2}}^{\alpha =\frac{\pi }{2}}{\int }_{\beta =0}^{\beta =arctan\left(\frac{dg{Z}_{0}}{b}\right)}\frac{2}{{\pi }^{2}}d\beta d\alpha$uid52

which is given by:

${F}_{DG}\left(dg\right)=\frac{2}{\pi }arctan\left(\frac{{Z}_{0}}{b}dg\right)$uid53

Then, the probability density function can be readily obtained:

${f}_{DG}\left(dg\right)=\frac{\frac{2}{\pi }\frac{b}{{Z}_{0}}}{d{g}^{2}+{\left(\frac{b}{{Z}_{0}}\right)}^{2}}$uid54

Observe that, under different conditions and hypotheses, the same expressions for the behaviour of the disparity gradient as in the case of primitives centred in the world coordinate system (Sec. ) have been obtained. Of course, this fact comes from the assumption that ${Z}_{0}\gg {X}_{0},\phantom{\rule{0.166667em}{0ex}}\phantom{\rule{0.166667em}{0ex}}{Y}_{0}$which asymptotically leads to the more specific case in which ${X}_{0}=0$and ${Y}_{0}=0$.

### 5.5. General case. Approximate expression

Under general conditions, a close analytic solution for the probability density function or the probability distribution function of the disparity gradient has not been found. So, we will face the derivation of an approximate solution.

To this end, consider the following approximate expression of the disparity gradient in our stereo system (Fig. ):

$dg=\frac{b}{\sqrt{{X}_{0}^{2}+{Y}_{0}^{2}+{Z}_{0}^{2}{cot}^{2}\beta +2{Z}_{0}cot\beta K\left({X}_{0}+{Y}_{0}\right)}}$uid56

In this expression, obtained after eq. (), the terms $\left({X}_{0}cos\alpha +{Y}_{0}sin\alpha \right)$have been substituted by $K\left({X}_{0}+{Y}_{0}\right)$. Note that $K$should not modify the region in which the disparity gradient is properly defined: $DG\in \left[0,\infty \right)$. Using this idea, it is possible to arrive at the desired goal. Now the procedure is described.

We know that if $\beta \to 0$, then $dg\to 0$. So, we can find a condition to impose on $K$so that $max\left\{DG\right\}\to \infty$. To this end, the minimum of the denominator in eq. () can be found in the usual way, deriving the expression in the square root with respect to $\beta$and finding the roots:

$\frac{\partial }{\partial \beta }\left[{X}_{0}^{2}+{Y}_{0}^{2}+{Z}_{0}^{2}{cot}^{2}\beta +2{Z}_{0}cot\beta K\left({X}_{0}+{Y}_{0}\right)\right]=0$uid57
$-2{Z}_{0}^{2}cot\beta {csc}^{2}\beta -2{Z}_{0}{csc}^{2}\beta K\left({X}_{0}+{Y}_{0}\right)=0$uid58

Now, since $csc\beta \ne 0$$\forall \phantom{\rule{0.166667em}{0ex}}\beta$, the following must be fulfilled:

${Z}_{0}cot\beta +K\left({X}_{0}+{Y}_{0}\right)=0$uid59

Thus, the following relation is found:

$cot\beta =-\frac{K\left({X}_{0}+{Y}_{0}\right)}{{Z}_{0}}$uid60

Recall that in the minimum the denominator in eq. () must be zero. Substituting $cot\beta$according to the previous expression in the denominator of eq. (), the following must be fulfilled:

${X}_{0}^{2}+{Y}_{0}^{2}+{Z}_{0}^{2}{\left[-\frac{K\left({X}_{0}+{Y}_{0}\right)}{{Z}_{0}}\right]}^{2}+2{Z}_{0}\left[-\frac{K\left({X}_{0}+{Y}_{0}\right)}{{Z}_{0}}\right]K\left({X}_{0}+{Y}_{0}\right)=0$uid61

which leads to the following expression:

$K=\sqrt{\frac{{X}_{0}^{2}+{Y}_{0}^{2}}{{\left({X}_{0}+{Y}_{0}\right)}^{2}}}$uid62

Thus, the approximation of the disparity gradient that will be used is given by:

$dg\approx \frac{b}{\sqrt{{X}_{0}^{2}+{Y}_{0}^{2}+{Z}_{0}^{2}{cot}^{2}\beta +2{Z}_{0}\sqrt{{X}_{0}^{2}+{Y}_{0}^{2}}cot\beta }}$uid63

Now, the probability distribution function will be found. Consider ${C}_{dg}$as the region in which $DGand let ${C}_{dg}\left(\alpha ,\beta \right)$denote the region in the $\alpha$-$\beta$plane such that $DG. Then, again:

${F}_{DG}\left(dg\right)=\int {\int }_{{C}_{dg}\left(\alpha ,\beta \right)}{f}_{\alpha ,\beta }\left(\alpha ,\beta \right)d\alpha d\beta$uid64

### Figure 6.

Probability distribution function of the disparity gradient {1}. General case: simulation results (solid line) and analytic approximation (dashed line).

Since $DG$does not depend on $\alpha$(eq. ()), the region ${C}_{dg}\left(\alpha ,\beta \right)$can be defined as a function of $\beta$, exclusively:

${F}_{DG}\left(dg\right)={\int }_{{C}_{dg}\left(\beta \right)}{\int }_{\alpha }{f}_{\alpha ,\beta }\left(\alpha ,\beta \right)d\alpha d\beta ={\int }_{{C}_{dg}\left(\beta \right)}\frac{1}{\pi }d\beta$uid66

In order to define ${C}_{dg}\left(\beta \right)$, $dg$must also be written as a function of $\beta$; the following result if easily obtained:

$cot\beta =-\frac{\sqrt{{X}_{0}^{2}+{Y}_{0}^{2}}}{{Z}_{0}}±\frac{b}{dg{Z}_{0}}$uid67

Let ${\beta }_{1}$and ${\beta }_{2}$represent the two solutions of this equation, then the region ${C}_{dg}\left(\beta \right)$is defined by the following intervals:

${C}_{dg}\left(\beta \right)=\left\{\begin{array}{c}\left(-\frac{\pi }{2},min\left({\beta }_{1},{\beta }_{2}\right)\right)\hfill \\ \bigcup \hfill \\ \left(max\left({\beta }_{1},{\beta }_{2}\right),\frac{\pi }{2}\right)\hfill \end{array}\right\$uid68

With all this, the desired solution, the probability distribution function of the disparity gradient, is given by (Figs. and ):

${F}_{DG}\left(dg\right)\phantom{\rule{-0.166667em}{0ex}}=\phantom{\rule{-0.166667em}{0ex}}1\phantom{\rule{-0.166667em}{0ex}}-\phantom{\rule{-0.166667em}{0ex}}\frac{1}{\pi }\left[arccot\left(\phantom{\rule{-0.166667em}{0ex}}-\frac{\sqrt{{X}_{0}^{2}+{Y}_{0}^{2}}}{{Z}_{0}}-\frac{b}{dg{Z}_{0}}\right)\phantom{\rule{-0.166667em}{0ex}}-\phantom{\rule{-0.166667em}{0ex}}arccot\left(\phantom{\rule{-0.166667em}{0ex}}-\frac{\sqrt{{X}_{0}^{2}+{Y}_{0}^{2}}}{{Z}_{0}}\phantom{\rule{-0.166667em}{0ex}}+\phantom{\rule{-0.166667em}{0ex}}\frac{b}{dg{Z}_{0}}\right)\right]$uid69

### Figure 7.

Probability distribution function of the disparity gradient {2}. General case: simulation results (solid line) and analytic approximation (dashed line).

Note that this solution is mathematically correct, however some considerations must be taken into account so that ${F}_{DG}\left(dg\right)$behaves as a proper probability distribution function sec. 2.2. Specifically, the function $arccot$returns an angular value which, ultimately, can be seen as a periodic function with period $\pi$. This means that there is an infinite number of solutions of $arccot$, although the main solution is often considered to be in the interval $\left(-\frac{\pi }{2},\frac{\pi }{2}\right)$. In our specific development, the function derived behaves properly if the solutions of the function $arccot$are selected in the range $\left(-\pi ,0\right)$.

After the probability distribution function (eq. ()), the probability density function (pdf) of the disparity gradient is readily found :

$\begin{array}{c}{f}_{DG}\left(dg\right)=\frac{1}{\pi }\frac{2bZ\left[d{g}^{2}{Z}_{0}^{2}+{b}^{2}+d{g}^{2}\left({X}_{0}^{2}+{Y}_{0}^{2}\right)\right]}{d{g}^{4}{Z}_{0}^{4}+{b}^{4}+d{g}^{4}{\left({X}_{0}^{2}+{Y}_{0}^{2}\right)}^{2}+2d{g}^{2}{Z}_{0}^{2}{b}^{2}...}\cdots \hfill \\ \hfill \cdots \frac{}{...+2d{g}^{4}{Z}_{0}^{2}\left({X}_{0}^{2}+{Y}_{0}^{2}\right)-2{b}^{2}d{g}^{2}\left({X}_{0}^{2}+{Y}_{0}^{2}\right)}\end{array}$uid71

which is a usable expression of the pdf of the disparity gradient that completes the analysis of the probabilistic behaviour of this parameter under the conditions and hypotheses selected.

## 6. Concluding summary

In this chapter, we have dealt with the probabilistic behaviour of certain relations established between the projection of features onto the image planes of a parallel stereo system. Specifically, we have considered relations between the orientation of projected edgels and the disparity gradient.

The projected edgels are simple features that can be considered in a matching stage . The relation between their orientations constitutes an a priori source of information that, using the models proposed, can be used in the matching processes  of stereo systems. The formulae of the relation between the orientation of the projections derived are perfectly suited for application in Bayesian models for stereo matching .

The disparity gradient is an important parameter for stereo matching systems . In this chapter, it has been analysed under different conditions to find proper probability density functions usable in a probabilistic context.

The functions derived can be used alone to match random dot stereo pairs , , , . Also, these functions can contribute and collaborate with other matching models in the solution of the correspondence problem in stereo systems. Specifically, Bayesian approaches can be employed to solve the correspondence problem  using the proposed models of the disparity gradient .

## Acknowledgements

This work was supported by the Ministerio de Economía y Competitividad of the Spanish Government under Project No. TIN2010-21089-C03-02 and Project No. IPT-2011-0885-430000.

chapter PDF
Citations in RIS format
Citations in bibtex format

## More

© 2012 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## How to cite and reference

### Cite this chapter Copy to clipboard

Lorenzo J. Tardón, Isabel Barbancho and Carlos Alberola-López (July 11th 2012). Probabilistic Analysis of Projected Features in Binocular Stereo, Current Advancements in Stereo Vision, Asim Bhatti, IntechOpen, DOI: 10.5772/46027. Available from:

### Related Content

#### Current Advancements in Stereo Vision

Edited by Asim Bhatti

Next chapter

#### Stereo Algorithm with Anisotropic Reaction-Diffusion Systems

By Atsushi Nomura, Koichi Okada, Hidetoshi Miike, Yoshiki Mizukami, Makoto Ichikawa and Tatsunari Sakurai

#### Stereo Vision

Edited by Asim Bhatti

First chapter

#### Calibration and Sensitivity Analysis of a Stereo Vision-Based Driver Assistance System

By Andras Bodis-Szomoru, Tamas Daboczi and Zoltan Fazekas

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.