||In recent years, 3D endoscopic imaging has played an important role in the development of the medical industry, making it easy for medical doctors to judge the visual depth of ulcers or tumors and thereby decreasing the risk of unnecessary damages to other tissues. A traditional 2D endoscopic image can be converted into a 3D view through depth estimation and the use of a depth image-based rendering method. However, the application of depth estimation may be too time-consuming for use with current medical equipment. With the current equipment, the estimated depth map may also be drastically altered, causing the converted view to have unavoidable defects such as geometric distortion and hole effects. As a result of these dramatic changes, the depth map will have holes of different sizes and directions. Therefore, this paper presents the techniques of hierarchical similarity analysis and content-adaptive filtering as a means to transform the 2D image into a 3D view quickly and precisely. In order to reduce the computing time, this paper adopts hierarchical similarity analysis to separate images into different sizes in order to analyze the similarity and depth information estimation. After depth map estimation, a preprocessing procedure that applies respective Gaussian filters to different sizes and directions of holes is used to achieve the optimization of the depth map. As a result, this method not only reduces the system computation time, making it appropriate for use with current medical equipment, but also improves the 3D view quality for medical doctors.