# disparity error to x and y accuracy

This question talks about the depth error ($$\Delta$$Z) as a function of disparity error ($$\Delta$$D).

I want to do the same for X and Y

How would we quantify $$\Delta$$X and $$\Delta$$Y w.r.t. $$\Delta$$D

I think I understand the question - you're looking for how the 3D position of the object is affected if you have mis-judged the depth.

I think the answer lies in considering the nature of the camera system - it's kind of like polar (spherical) coordinates being mapped to a plane, such that each pixel represents a particular azimuth and elevation angle.

If your camera has a field of view of 60 degrees (+/- 30 degrees), then each pixel is going to represent some sliver of angle of your field of view, where the particular angular delta is the inverse of your resolution.

Consider this graphic:

Say you're looking at a house exterior (black) and the interior wall (red/green) through some open doors or windows. Red would be the incorrect depth estimate to the interior wall and green is the corrected estimate.

:EDIT: - Totally botched the math earlier, so I rewrote the paragraph below:

Since you're projecting your angular view onto that distance, the object in front of you has no x/y shift if you've estimated the depth wrong because $$x = r\sin{\theta} = 0$$ if your $$\theta = 0$$, regardless of $$r$$. However, as your objects get more on the edge of your field of view, the look angle $$\theta$$ gets larger and your x/y estimates get worse.

:EDIT: - I actually screwed up these equations originally. My mistake was starting with $$x = z\cos{\theta}$$, when it doesn't - it's polar, which doesn't use $$z$$! It uses $$r$$! Consider then the relationship between $$\Delta z$$ and $$\Delta r$$:

Now you can see that $$\Delta z$$ is the vertical/depth projection of the change in radial distance $$\Delta r$$ (theta is defined as the look angle away from broadside):

$$\Delta z = \cos{\theta} \Delta r \\$$

which can be restated as:

$$\Delta r = \frac{1}{\cos{\theta}} \Delta z \\$$

Now this makes more sense. By this definition, too, $$x$$ is the horizontal projection of the radial distance, as stated above:

$$x = r \sin{\theta} \\$$

Keep in mind that it looks like the sine/cosine functions are flipped, but that's because the look angle is away from broadside/vertical.

Continuing on to the equations as they should have been:

$$x_{est} = r_{est} \sin{\theta} = \frac{1}{\cos{\theta}} z_{est} \sin{\theta} \\ x_{act} = r_{act} \sin{\theta} = \frac{1}{\cos{\theta}} z_{act} \sin{\theta} \\ \Delta x = x_{act}-x_{est} = \frac{1}{\cos{\theta}} z_{act} \sin{\theta} - \frac{1}{\cos{\theta}} z_{est} \sin{\theta} \\$$

Now you can reduce $$\frac{1}{\cos{\theta}} \sin{\theta}$$ down to $$\tan{\theta}$$ and continue along as:

$$\Delta x = z_{act} \tan{\theta} - z_{est} \tan{\theta} \\ \Delta x = \Delta z \tan{\theta} \\$$ where, from the question you linked,

$$\Delta z = \frac{z^2}{b f}\Delta D \\$$