Egg size is a crucial indicator for consumer evaluation and quality grading. The main goal of this study is to measure eggs' major and minor axes based on deep learning and single-view metrology. In this paper, we designed an egg-carrying component to obtain the actual outline of eggs. The Segformer algorithm was used to segment egg images in small batches. This study proposes a single-view measurement method suitable for eggs. Experimental results verified that the Segformer could obtain high segmentation accuracy for egg images in small batches. The mean intersection over union of the segmentation model was 96.15%, and the mean pixel accuracy was 97.17%. The R-squared was 0.969 (for the long axis) and 0.926 (for the short axis), obtained through the egg single-view measurement method proposed in this paper.