Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

stereoAnaglyph

Create red-cyan anaglyph from stereo pair of images

Syntax

J = stereoAnaglyph(I1,I2)

Description

example

J = stereoAnaglyph(I1,I2) combines images I1 and I2 into a red-cyan anaglyph. When the inputs are rectified stereo images, you can view the output image with red-blue stereo glasses to see the stereo effect.

Examples

collapse all

Load parameters for a calibrated stereo pair of cameras.

load('webcamsSceneReconstruction.mat')

Load a stereo pair of images.

I1 = imread('sceneReconstructionLeft.jpg');
I2 = imread('sceneReconstructionRight.jpg');

Rectify the stereo images.

[J1, J2] = rectifyStereoImages(I1, I2, stereoParams);

Create the anaglyph.

A = stereoAnaglyph(J1, J2);

Display the anaglyph. Use red-blue stereo glasses to see the stereo effect.

figure; imshow(A);

Input Arguments

collapse all

Input image I1, specified as an M-by-N-by-3 truecolor image or an M-by-N 2-D grayscale image. I1 and I2 must be real, finite, and nonsparse, and the images must be the same size. If the images are not the same size, use imfuse to pad the smaller image dimension with zeros before creating the anaglyph.

Data Types: single | double | int16 | uint8 | uint16 | logical

Input image I2, specified as an M-by-N-by-3 truecolor image or an M-by-N 2-D grayscale image. I1 and I2 must be real, finite, and nonsparse, and the images must be the same size. If the images are not the same size, use imfuse to pad the smaller image dimension with zeros before creating the anaglyph.

Data Types: single | double | int16 | uint8 | uint16 | logical

Output Arguments

collapse all

Stereo anaglyph output image, returned as an M-by-N-by-3 truecolor image. Output image J is the same size as input images I1 and I2.

Data Types: single | double | int16 | uint8 | uint16 | logical

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2014b