Disparity estimation is important for depth information retrieval, stereoscopic image construction, and light filed image rendering. To develop a high accurate disparity estimation algorithm, in this work, several techniques are adopted. First, unlike existing methods, which adopt feature point matching, n by n block matching, or global matching, we apply superpixels together with an automatic adjusting mechanism to customize the suitable number, size, and shape of windows for each part of an image. Second, since edge should play a more important role for matching, a larger weight is assigned to the pixel with high gradient. Moreover, the dilation operation is applied to consider the surrounding information and the binary cost function is used to achieve an even better result. Simulations show that the proposed algorithm much outperforms existing methods for disparity matching. It can work very well even when an image contains many occluded patterns or tiny objects.