The use of respiration-correlated cone-beam computed tomography (4D-CBCT) appears to be crucial for implementing precise radiation therapy of lung cancer patients. The reconstruction of 4D-CBCT images requires a respiratory phase. In this paper, we propose a novel method based on an image-based phase recognition technique using normalized cross correlation (NCC). We constructed the respiratory phase by searching for a region in an adjacent projection that achieves the maximum correlation with a region in a reference projection along the cranio-caudal direction. The data on 12 lung cancer patients acquired just prior to treatment and on 3 lung cancer patients acquired during volumetric modulated arc therapy treatment were analyzed in the search for the effective area of cone-beam projection images for performing NCC with 12 combinations of registration area and segment size. The evaluation was done by a "recognition rate" defined as the ratio of the number of peak inhales detected with our method to that detected by eye (manual tracking). The average recognition rate of peak inhale with the most efficient area in the present method was 96.4%. The present method was feasible even when the diaphragm was outside the field of view. With the most efficient area, we reconstructed in-treatment 4D-CBCT by dividing the breathing signal into four phase bins; peak exhale, peak inhale, and two intermediate phases. With in-treatment 4D-CBCT images, it was possible to identify the tumor position and the tumor size in moments of inspiration and expiration, in contrast to in-treatment CBCT reconstructed with all projections.