View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Stereo Matching

4.7 | 13 ratings Rate this file 59 Downloads (last 30 days) File Size: 4.74 MB File ID: #28522 Version: 1.3
image thumbnail

Stereo Matching


Wim Abbeloos (view profile)


20 Aug 2010 (Updated )

A GUI demonstrates an efficient stereo matching algorithm.

| Watch this File

File Information


This function performs the computationally expensive step of matching two rectified and undistorted stereo images. The output is a dense disparity map. If camera parameters are known, this allows for three dimensional reconstruction.

Two graphical user interfaces demonstrate the algorithm.

Please note this function requires the Image Processing Toolbox!

[spdmap, dcost, pcost, wcost] = stereomatch(imgleft, imgright, windowsize, disparity, spacc)

The standard images included are from
[1] D. Scharstein and R. Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International Journal of Computer Vision, 47(1/2/3):7-42, April-June 2002.
[2] D. Scharstein and R. Szeliski. High-accuracy stereo depth maps using structured light. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2003), volume 1, pages 195-202, Madison, WI, June 2003.

Please do provide feedback.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Other requirements Image Processing Toolbox
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
24 Aug 2015 mohsen falahi



Comment only
25 Feb 2015 Hassan elmadany

could you give me some comments at each step ...some steps i do not know use create it

Comment only
02 Jul 2014 Javier

Javier (view profile)

Thank you for your code. How can I set the right image as the reference image? Thank you!

11 Apr 2014 BERNARD


Comment only
15 Dec 2013 Fitroh Amaluddin

thankss. helpfull,,

Comment only
15 Nov 2013 David

David (view profile)

What is the purpose of the multiplicator option

Comment only
25 Sep 2013 Qingbi

Qingbi (view profile)

11 Apr 2013 nt

nt (view profile)


27 Feb 2013 Michael

The "reconstruction" image is "upside down" compared to the reference and target.

06 Oct 2012 Bashar Alsadik

nice GUI and coding... what if I want to test my own images?

28 Jun 2012 SHAFIQUL

Very Nice !!

22 Mar 2012 Yiting

Yiting (view profile)

19 Aug 2011 David Provencher

There seems to be an error in the integral image technique. The filtering window should be

h = zeros(WS+2,WS+2,'double');
h(1,1) = 1; h(1,WS-1) = -1;
h(WS-1,1) = -1; h(WS-1,WS-1) = 1;

that is, for a 3x3 summing window, the filtering window must be 5x5 to implement the algorithm correclty (see and note that points A, B and C are outside the summing window)

I tested this with a simple matrix for validation. Otherwise, thanks for the useful code.

05 Jul 2011 Hossein Babaee

13 May 2011 Vishnu

Vishnu (view profile)

This program shows a disparity map but if i want to save the disparity map to a file how can I do that ?

Comment only
06 May 2011 sas

sas (view profile)


19 Apr 2011 Yang Li

The file works very well. Just run stereovision.m it will come up with a GUI.

09 Mar 2011 Aaron Wetzler

Please give instructions on how to run. Code doesnt run nor do fig files.

27 Sep 2010 1.1

Adjusted description

12 Sep 2012 1.3

Updated to include an App file for R2012b

Contact us