Alignment of Stereo Images

Although not as commonplace as they once were, stereo images still have their place in ophthalmic diagnostic imaging. Besides, viewing 3D images can be fun! The success or failure of a stereo image is highly dependent on alignment of the two photographs that make up the stereo pair. Misalignment of stereo images can cause eyestrain or make it difficult to perceive a stereo effect. So it’s important to understand the basic principles of stereopsis and image alignment in order to create effective stereo pairs.

Stereopsis is the ability of the brain to construct a visual sense of depth by merging flat, two-dimensional images from two different vantage points. Stereo photography is the attempt to recreate the three dimensional effect using two photographs of the same subject. A lateral shift in viewing angle between each photograph simulates the difference in perspective between each eye.

stereo pair
Stereo pair of fibrovascular proliferation in diabetic retinopathy. Shifting the fundus camera laterally between sequential frames creates enough parallax to produce a stereo effect. When viewed in stereo, the fibrovascular traction will appear dramatically elevated.

There are a variety of methods that can be used to combine the individual left and right photographs for viewing as a stereo pair. The goal is to present the left and right images simultaneously but independently to each eye, allowing the brain to fuse them in stereo. Optical stereoscopes utilize mirrors, lenses, or prisms to accomplish this. Stereo projection can be done through cross-polarization, synchronized shutter glasses, or with anaglyph color encoding.

The anaglyph method is often maligned, in part because of its historical association with poorly aligned “B movies” and comic books. Despite it’s dubious reputation, anaglyph encoding is a simple but effective method of presenting stereo images in a PowerPoint presentation or for display on a web page. Many of the alignment principles discussed here apply to all stereo encoding methods, but the emphasis of this article is on creating anaglyph stereo images.

Creating Anaglyphs

Instead of employing optics or polarization to create a stereo effect, the anaglyph method uses complementary colors to encode and deliver stereo information. In principle, any pair of true complementary colors can be combined to form a full spectrum of white light, but most often red and cyan are the colors used.

The anaglyph method uses complementary colors to encode and deliver stereo information. The left image of a stereo pair provides the red component and the right image provides the blue and green (cyan) components. When the components are superimposed, a full spectrum anaglyph stereo image results (center). Anaglyph images can be viewed with glasses that use corresponding red and cyan colored filters.

Left and right images are rendered in complementary colors and superimposed to form an anaglyph that can be viewed in stereo with eyewear that utilize filters in corresponding complementary colors. These filters transmit the target color while blocking its complement so that each eye sees only the intended half of the pair. The brain mixes the colors and perceives a composite grayscale or color stereo image.

gray-color2
The anaglyph method works very well with black-and-white photographs, but color images may lose saturation and contrast when converted to anaglyph. A red-green flickering effect commonly referred to as retinal rivalry, or color bombardment, can sometimes occur when a color anaglyph contains large areas of bright red, green or blue. Viewing difficulties can also be the result of poorly matched color filters.

There are various methods for creating anaglyphs in image editing programs such as Photoshop. The specific technique may vary depending on what version of these programs you are working with, but the concept is usually the same: copy the red component of the left image and paste it in place of the red component of the right image. Images need to be in RGB color mode when using these methods.

stereophotomaker
Stereophotomaker is a freeware program for creating stereo images that includes options for several viewing methods including anaglyph.

Software programs designed specifically for constructing anaglyphs from stereo pairs can be used as an alternative to the Photoshop method. These programs simplify the process by automating the individual steps for anaglyph creation. Some applications also offer other stereo viewing options including: side-by-side, interlaced, page flip, etc. The better stereo programs offer basic image editing tools and facilitate easy registration of pairs. Controls include vertical and horizontal shift and in some cases incremental rotation. They automatically crop overlapped borders and permit resizing. Rendering options typically include red/green, red/blue, or red/cyan combinations for grayscale anaglyphs. Color anaglyphs are typically rendered in red/cyan.

It is important to differentiate between blue and cyan (equal parts green and blue) when rendering or viewing anaglyphs. Many sources refer to both of these colors as “blue” which can lead to some confusion in matching anaglyphs with the correct eyewear.

Binocular Symmetry

Binocular symmetry is an important element of constructing effective stereo pairs. This means that both images should be the same size and magnification as well as similar in color balance, contrast and exposure. This especially holds true when creating anaglyphs. Uneven exposure between image pairs can adversely affect the final product. This can be mitigated by digitally adjusting the contrast and brightness of each half of the image pair for consistency before converting to anaglyph.

Left: Even illumination of the fundus is often sacrificed in order to obtain adequate stereo separation through a small pupil. Exposure asymmetry between halves of the stereo pair can result in an uneven appearance when viewed as a pair. Right: The contrast and brightness of the individual stereo images can be adjusted for consistency before combining in anaglyph form. This will improve the overall appearance of the stereo image.

Even when both images are consistent in overall appearance, binocular asymmetry can occur if the subject displays a high percentage of one of the anaglyph encoding colors.

This color fundus image of optic cupping and a cotton wool spot suffers from loss of saturation and retinal rivalry because of the predominant red/orange color.

For example, if the subject is predominantly red, like a fundus photo, the cyan filter of the viewing eyewear blocks most of the red tones, reducing the light that reaches the right eye. Conversely, the red viewing filter transmits a high percentage of red, making the image appear bright on the left side. The asymmetry caused by this brightness imbalance can adversely affect color saturation, reduce the stereo effect, and cause a flickering effect associated with retinal rivalry in subjects that contain areas of solid, bright red.

Rotational 1 b
Color stereo images that display a wide range of colors will usually work as anaglyphs. This stereo image of a cataract does not lose much saturation and color when viewed with anaglyph eyewear.

If exposure is well balanced between the left and right images of a pair, the resulting anaglyph will appear mostly normal in color (for color images) or neutral gray (for grayscale anaglyphs).

Image enhancement

Any desired image editing enhancements should be done to the individual images of a stereo pair before converting to anaglyph form. Make sure that both images are the same size and scale. Adjustments to brightness, contrast, color balance, or sharpness should also be done to the images before combining in anaglyph form. Shifting the color balance to add a small amount of yellow to color fundus photographs will sometimes improve the final result. A slight increase in contrast and saturation beforehand may help to compensate for the typical loss of saturation in color anaglyphs. Avoid oversaturation however, since this can lead to the problems associated with retinal rivalry.

When making a large series of anaglyphs, edit all images for size and resolution, name or number the files in sequential order, and store them in one folder to streamline the process. Batch conversion of multiple stereo pairs is possible in some software programs. This technique should only be used if the stereo base is consistent for all stereo pairs, such as images from a simultaneous stereo camera.

Alignment

To adjust alignment in a stereo software program (or Photoshop), open the left and right images and combine them in anaglyph form to view the red/cyan overlay. First, use the alignment tools to shift the red image channel to eliminate any vertical displacement or rotation between layers. This step can usually be done without wearing anaglyph glasses.

Next, adjust the horizontal displacement while wearing anaglyph glasses to view the results. Horizontal displacement is necessary to achieve a stereo effect, but the amount of separation should be carefully controlled. This is mostly a subjective judgment, but observing the principles of parallax and the “stereo window” can be helpful.

fig 5
Left: Horizontal displacement of the stereo image is adjusted to align the near point of interest (the fingers holding the lens) resulting in neutral or slightly positive parallax. The stereo effect appears at, or behind, the plane of the stereo window. Right: Horizontal displacement is adjusted so that image alignment occurs deeper in the scene (the indirect ophthalmoscope). This results in negative parallax that causes the hand and lens to appear as if they are coming out of the printed page.

The border surrounding a stereo image provides a viewing reference plane commonly known as the stereo window. In the case of fundus photography, the round or elliptical black mask of the fundus camera becomes the stereo window. Parallax describes the horizontal separation in the image pair as well as the depth effect in relation to the stereo window. Parallax can be classified as neutral, positive, or negative. Neutral parallax places the nearest object in a scene at the plane of the stereo window. Positive parallax produces an image as seen through the stereo window or behind the screen. Negative parallax results in an off-screen effect appearing in viewer space.

weaver 7stereo
This stereo pair has been adjusted to the nearest point in the subject creating neutral parallax.

Adjust the horizontal shift to place the image in an optimum position for comfortable viewing relative to the stereo window. It is common practice to align the principle subject or nearest object in a scene, placing it close to the plane of the stereo window. An added benefit of aligning the near point of interest is that the anaglyph will appear sharpest at the point of registration. It can be tempting to make all objects appear as if they are coming out of the screen or off the printed page, but overuse of negative parallax can cause viewing difficulties due to a separation of accommodation and convergence planes.

Accommodation and convergence normally coincide at the same point. Optical stereoscopes preserve the coincidence of accommodation and convergence, but a breakdown of this relationship occurs when viewing stereo images on a monitor or projection screen. Our eyes accommodate at the plane of the screen but converge based on screen parallax. Experienced viewers are sometimes able to overcome the conflicting visual cues much like the ability to “free-view” 35 mm stereo pairs that can be learned with practice.

Another conflict of depth cues can arise when the border of the stereo window intersects an object with negative parallax. Limiting negative parallax will ensure that most of your audience will be able to appreciate a stereo effect without difficulty.

A conflict of depth cues can occur when an area of negative parallax intersects the boundary of the stereo window. The effect is more troublesome along vertical borders. The elevated appearance of this retinal flattens out on the left border of the image.
In this example, negative parallax causes the asteroid hyalosis to appear as if it’s coming off the page in the area just inferior to the optic disc. If you look toward the bottom or to the right edge of the image it appears to flatten due to contradictory depth cues.
Negative parallax is present in the center of this image, but it does not come in contact with the edges of the stereo window. A conflict of depth cues is avoided and the elevated lesion appears to come out of the monitor.

Although this process may sound complicated, it only takes a few seconds to align most stereo images. The stereo effect usually appears more pronounced the farther an observer is from the screen, so it may help to occasionally move back from the monitor, or zoom out, to get a better idea of how the depth effect will look when projected. Zoom in to ensure that the image is accurately superimposed at the point of interest. Once properly aligned, anaglyphs can be saved in a file format compatible with PowerPoint and inserted in a presentation in the usual manner. JPEG files are a good choice that is supported by most stereo programs.

Basic principles of stereo alignment

  • Make sure that both images are the same size and scale.
  • Image enhancements should be done before converting to anaglyph.
  • Avoid over-saturation, which can lead to problems associated with retinal rivalry.
  • Adding yellow to color fundus photographs may improve results.
  • Align the principle subject or nearest object in a scene.
  • Eliminate any vertical displacement or rotation between layers.
  • Horizontal displacement is necessary to achieve a stereo effect.
  • Observe the principles of parallax and the “stereo window”.
  • Neutral parallax places the nearest object in a scene at the plane of the stereo window.
  • Positive parallax produces an image as seen through the stereo window or behind the screen.
  • Negative parallax results in an off-screen effect appearing in viewer space.
  • The border surrounding a stereo image provides a viewing reference plane known as the stereo window.
  • A conflict of depth cues occurs when the border of the stereo window intersects an object with negative parallax.