Quantitative phase imaging (QPI) has emerged as a practical technique for acquiring structural information from phase objects. Digital holography can realize phase detection, but it is limited by a spatial bandwidth product or affected by the overlap of conjugate images. The phase retrieval algorithm serves as an effective tool for QPI dealing with intensity patterns. Traditional phase retrieval algorithms heavily rely on strong support constraints or high data redundancy to accurately reconstruct the sample image. However, in single-frame phase retrieval algorithms, the precise acquisition of support constraints is notably challenging. The multiple-measurement spends much time on data acquisition and is unsuitable for dynamic sample observation. In this paper, we propose a novel, to the best of our knowledge, quantitative phase imaging method that utilizes only two in-line holograms. We have developed a phase retrieval algorithm based on ptychography, which eliminates twin-image and separates illumination background. The proposed method achieves high data utilization efficiency and can be employed for dynamic imaging.