M-File Help: anaglyph | View code for anaglyph |
Convert stereo images to an anaglyph image
a = anaglyph(left, right) is an anaglyph image where the two images of a stereo pair are combined into a single image by coding them in two different colors. By default the left image is red, and the right image is cyan.
anaglyph(left, right) as above but display the anaglyph.
a = anaglyph(left, right, color) as above but the string color describes the color coding as a string with 2 letters, the first for left, the second for right, and each is one of:
'r' | red |
'g' | green |
'b' | green |
'c' | cyan |
'm' | magenta |
a = anaglyph(left, right, color, disp) as above but allows for disparity correction. If disp is positive the disparity is increased, if negative it is reduced. These adjustments are achieved by trimming the images. Use this option to make the images more natural/comfortable to view, useful if the images were captured with a stereo baseline significantly different the human eye separation (typically 65mm).
Load the left and right images
L = iread('rocks2-l.png', 'reduce', 2); R = iread('rocks2-r.png', 'reduce', 2);
then display the anaglyph for viewing with red-cyan glasses
anaglyph(L, R);
© 1990-2012 Peter Corke.