Semi-global matching has been widely applied to 3D space reconstruction of real scenes. However, due to high sensitivity to penalty parameters, semi-global matching easily incurs significant amount of matching errors on geometric than other regions. To solve the problems mentioned above, the author detected edges by Edge Drawing, matched edges by modified Generalized Hough Transform, and added matched edge features into semi-global matching optimization. The edge features do not only serve as discontinuity constraints, but also as bases to decide penalty parameters. Through the experiments, it was proved that the disparity errors on discontinuity were finely refined, and the disparity map quality was also effectively improved to support 3D point clouds generation.