Traditional stereoscopic images are generated using multiple color-cameras. With the popularity of depth capture devices, it becomes a possible way to generate stereoscopic images by use of color and depth images. During the generating process, holes are created because of visual occlusion or reflective material. Based on color and depth images from RGB-D camera, this study explores the technology of generating stereoscopic images and filling the holes. First, use the DIBR algorithm to generate the left-eye and right-eye images respectively, and then propose an improved inpainting method to fill the hole. To verify the actual effect of stereoscopic images, the head-mounted display is used to view the inpainted stereoscopic images.