Wouldn’t it be great if we could just choose a location in our stereoscopic image and then automatically change the screen depth to exactly that point? Have you ever tried to place a 2d object like text in a Stereo scene and had to hand-animate the separation to keep it in the correct screen depth? Well, both of these tasks can be completed instantly by using something called a Disparity Map.
Disparity simply means difference, so a Disparity map is a measurement of the difference between two things. We can call a Stereo Disparity map something that measures the difference between two views, the left and right view. Let’s say pixel A describes some feature in our scene in the left view. Well, we can find that feature and a very similar pixel in the right image and measure the difference in the x coordinate from the right to the left. That will give us the disparity between the two views and if we did this with every pixel, we would get a Stereo Pixel Disparity map. In other words, a Stereo Pixel Disparity map describe what X offset a pixel would have to make to move from the left view into the correct position in the right.
Now, measuring this for every pixel would take some time, but there is a shortcut we can use. Depth and Disparity maps have a mathematical relationship with each other. You can convert a Depth map into a Disparity map using the simple equation of Disparity = 1/Depth. Now, this will not give you a correct Stereo Pixel Disparity Map, but it’s the first step to unlocking this powerful tool.