One of the key and difficult technologies in the 3DTV system is the generation of the depth. In general, the demands for accuracy and real-time execution cannot be satisfied at the same time. With the development of the algorithms, some local methods are more suitable, but the challenge is to decide an appropriate window for each pixel. We propose a novel local method, which constructs the support windows adaptively only based on the intensity. Our bilateral filtering algorithm is depending on the information of color image so that the edge can be kept clearly. All of the algorithms are based on GPU so that the effectiveness is higher. To demonstrate the effectiveness of the algorithm, it has been tested on the benchmark Middlebury stereo database. The results show that our algorithm has comparable efficiency, and hence it is promising for practical application.