Analyzing spinal curvatures manually is time-consuming and tedious for clinicians, and intra-observer and inter-observer variability can affect manual measurements. In this study, we developed and evaluated the performance of an automated deep learning-based computer-aided diagnosis (CAD) tool for measuring the sagittal alignment of the spine from X-ray images. The CAD system proposed here performs two functions: deep learning-based lateral spine segmentation and automatic analysis of thoracic kyphosis and lumbar lordosis angles. We utilized 322 datasets with data augmentation for learning and fivefold cross-validation. The segmentation model was based on U-Net, which has multiple applications in medical image processing. Here, we utilized parameter equations and trigonometric functions to design spinal angle measurement algorithms. The kyphosis (T4-T12) and lordosis angle (L1-S1, L1-L5) were automatically measured to help diagnose kyphosis and lordosis. The segmentation model had precision, sensitivity, and dice similarity coefficient values of 90.53 ± 4.61%, 89.53 ± 1.8%, and 90.22 ± 0.62%, respectively. The performance of the CAD algorithm was also verified with the Pearson correlation, Bland-Altman, and intra-class correlation coefficient (ICC) analysis. The proposed angle measurement algorithm exhibited high similarity and reliability during verification. Therefore, CAD can help clinicians in reaching a diagnosis by analyzing the sagittal spinal curvatures while reducing observer-based variability and the required time or effort.