Stereo matching is a challenging issue in multicamera scene reconstruction, and recently many methods have been proposed in different contexts. This paper presents a template based stereo matching algorithm using graph-cut. First, a set of non-overlapping templates are derived from the reference image (left or right image) to represent the scene structure. Each template is assigned to a corresponding disparity value in order to obtain an energy function which is applied to construct a graph. The minimum cut on the graph by using graph-cut also minimizes the energy function. Experimental results on the Middlebury test set show that the proposed algorithm can obtain satisfactory stereo matching results and is competitive with the state-of-the-art algorithms.