Cardiac magnetic resonance image (MRI) has been widely used in diagnosis of cardiovascular diseases because of its noninvasive nature and high image quality. The evaluation standard of physiological indexes in cardiac diagnosis is essentially the accuracy of segmentation of left ventricle (LV) and right ventricle (RV) in cardiac MRI. In this paper, we propose a novel Nested Capsule Dense Network (NCDN) structure based on the FC-DenseNet model and capsule convolution-capsule deconvolution. Different from the traditional symmetric single codec network structure such as U-net, NCDN uses multiple codecs instead of a single codec to achieve multi-resolution, which makes it possible to save more spatial information and improve the robustness of the model. The proposed model is tested on three datasets that includes York University Cardiac MRI dataset, Automated Cardiac Diagnosis Challenge (ACDC-2017), and local dataset. The results show that the proposed NCDN outperforms the state-of-the-art methods.