Ghost imaging (GI) offers great potential with respect to conventional imaging techniques. However, there are still some obstacles for reconstructing images with high quality, especially in the case the orthogonal measurement matrix is impossible to construct. In this paper, we propose a new scheme based on orthogonaltriangular (QR) decomposition, named QR decomposition ghost imaging (QRGI) to reconstruct a better image with good quality. In the scheme, we can change the randomly non-orthogonal measurement matrix into orthonormal matrix by performing QR decomposition in two cases. (1) When the random measurement matrix is square, it can be first decomposed into an orthogonal matrix Q and an upper triangular matrix R. Then let the off-diagonal values of R equal to 0.0, the diagonal elements of R equal to a constant k, where k is the average of all values of the main diagonal, so the resulting measurement matrix can be obtained. (2) When the random measurement matrix is with full rank, we first compute its transpose, and followed with above QR operation. Finally, the image of the object can be reconstructed by correlating the new measurement matrix and corresponding bucket values. Both experimental and simulation results verify the feasibility of the proposed QRGI scheme. Moreover, the results also show that the proposed QRGI scheme could improve the imaging quality comparing to traditional GI (TGI) and differential GI (DGI). Besides, in comparison with the singular value decomposition ghost imaging (SVDGI), the imaging quality and the reconstruction time by using QRGI are similar to those by using SVDGI, while the computing time (the time-consuming on the light patterns computation) is substantially shortened.