Saturday, October 3, 2015

How to Measure Stereoscopic Deviation using StereoPhoto Maker

In this blog I will describe three ways to measure the stereoscopic deviation in a stereo pair, using the free software StereoPhoto Maker. This is based on a Tutorial published in the Stereogram 20.2 (October 2015). Stereogram is the newsletter of the Ohio Stereo Photographic Society (OSPS) and it has been published since 1997. For subscription information, see

What is Stereoscopic Deviation and Why Should I Care?

If you look at a stereo pair it consists of two seemingly identical pictures. However, the pictures are not identical, but have small differences in the form of displacements in the horizontal direction. It is these displacements (stereoscopic deviations) that are responsible for the sense of depth when the pictures are seen in stereo. So, yes, you should care :)

Here is a stereo pair. Notice that the house is displaced with respect to the tree. This is easier to see if the two images are superimposed:

Back in the good old slide film days, the only practical way to superimpose images was in stereo projection. Today, this is easy to do with digital images and programs like StereoPhoto Maker.

The deviations vary across the image (see the road in this picture), being zero at the “window” (tree in the figure above) and maximum at the furthest object (house). We are usually interested in the maximum stereoscopic deviation (P, I have used the letter P from "parallax" another term for this displacement). For an image to be viewed comfortably, this maximum stereoscopic deviation must be less than a certain amount, which depends on the viewing method. One popular recommendation for projection is to keep the maximum stereoscopic deviation under 3.3% or 1/30.  Note that P has a value of length and it can be measured on film or a camera sensor or a display, so it depends on the image size, but it is more meaningful to divide this deviation by the image width to produce a ratio or %, which does not depend on image size.

So, now that we know what the stereoscopic deviation is, let's address the question, how can we measure it? But, first, let's load up an image to work with. I selected this stereo pair, a close-up of a butterfly. I took this picture during the 2010 NSA Convention. I would like to measure the maximum stereoscopic deviation and answer the question if this image will project well or cause problems. Here it is (in LRL format, click to enlarge and freeview):

But where is the far point in this image (which is responsible for the maximum stereoscopic deviation)? It seems to be in the lower part of the purse. There is black spot there which is easy to see (and measure). I will consider that to be the far point whose deviation I would like to measure.

1. Using SPM’s Auto Alignment report

After auto alignment with SPM, a window pops up with “Auto alignment values.”  Look for the value reported as “disparity of the infinity points” near the bottom. This is reported as a ratio and in this case it is 1/18. This is about twice as large as the recommended 1/30 value. This serves as a warning that there will be excessive deviation in stereo projection.  Here is how the report looks. I have circled the disparity value:

2. Using a grid in SPM

Dennis Green (of the Detroit Stereo Club) made me aware of this method. First, go to anaglyph (or interlaced) mode to overlap the two images. Then go to View -> Grid Setting (bottom of the menu, see the figure below). Set the V Line to 29 (this will divide the image to 30 segments). With just one look you can see which points are within one segment so have the maximum recommended deviation (1/30) or less. For the maximum deviation (shown below) this method gives a value of 2.5 times the recommended value (2.5/30 = 1/12).

3. Using SPM’s Position Alignment X value

At the bottom center of the SPM screen you see this: Position Alignment (x=0, y=0). If you press the R or L arrow keys, the x value changes (pressing the top and bottom arrows changes the y value). So my procedure for measuring deviation is this: Overlap the images (I like to use interlaced because I have an interlaced 3d monitor). Here is what I see. I have highlighted the far points that I will overlap to measure their deviation:

Use the R/L arrow keys to overlap two objects. Read the x displacement. This is the stereoscopic deviation in pixels. Here is what I get:

Divide this by the width of the image to get the % deviation. Using this method I measured 84 pixels for the far points. 84/936 (image width) = 9% or 1/11, which is close to Dennis’ grid method.

Note: the default displacement is 4 pixels every time you press the arrow keys, but this can be changed to a different value through the “Preference” menu shown here (to get to this menu go: Edit, Preferences, Adjustment).

Changing it to 1 pixel will give you the best possible accuracy. This value will also affect how fast the stereo window changes every time you press the arrows, so you might want to bring it back to the default 4 if you have changed it to 1 (4 works well, 1 is a bit too slow).

Note added later: Pierre Meindre mentioned in photo-3d that if you hold the shift key while pressing the arrows, the adjustment is made in 1 pixels increments, no matter what the default is. In this case, there is really little need to lower the default. As a matter of fact, Pierre increased the default to 10 for fast adjustments and then presses the shift key for fine adjustments. The default value of 4 works for me so it is good to know that I do not have to change this, just remember to hold the shift key when I want fine adjustments. (PS. I have now increased the default, like Pierre has done. This works the best for me. The window moves quickly and when I want to slow it down, I press the shift key.)

One last "trick" when using the Position Alignment method: If you press the Home key, the X and Y values are initialized (set to zero).  You can also use this method to measure Y displacements (there should not be any Y displacements in a perfectly aligned image, but they often are because alignment is not or cannot be perfect).

Comparing the Three Methods

Notice that the SPM alignment report gives a smaller deviation than the other two methods. Using the grid or displacement method is more accurate because it is targeted to specific points. The report is based on image alignment which selects a certain number of points used in the alignment. The far point might have been missed (better: "not included") in the alignment. So the alignment report is good for giving you one quick value for the maximum deviation. If you are using auto alignment, you get this value with no extra effort.

The grid allows you to estimate the stereoscopic deviation in the entire image with one glance.

The Position Alignment method allows you to accurately measure the stereoscopic deviation for specific pairs in the image. It is the most accurate but also most time consuming.

Does the Excessive Deviation Matter?  

This is a very good question. The fact that the maximum deviation is excessive does not mean that the image will have a problem in projection. It depends on how prominent the “offending” (showing excessive deviation) part of the images is.

In this particular image it is just a spot on the purse.  One could use photo editing to remove this spot. The attention of the viewer is focused on the butterfly and the hand. The purse is mostly irrelevant and does not draw much attention. In that respect, this image works, even though it has about 3x the recommended maximum deviation. But if the background is prominent and cannot be ignored, then excessive deviation will be a problem. Knowing the maximum stereoscopic deviation is not enough to decide if an image will work or not. You need to see the entire image and make a subjective call.  No matter if the deviation is a problem or not, knowing how to measure it can be useful.

One last comment: I think this image demonstrates the difficulty in taking a close-up of a small object with the Fuji with B = 75mm. A different camera (Panasonic 3D1 with B = 30mm) or a Cyclopital close-up attachment with the Fuji (B = 30mm) would have been a better tool for this particular picture.

Let me know if you have any comments and make sure that you check my other blogs for 3d stereoscopic information.


oktayakdeniz said...

Great tutorial George,Congratulations!

DrT said...

Thank you! :)

Ugo Capeto 3D said...

for what it's worth, you can also use DF2 (Disparity Finder 2) which is available at (software tab)