To ensure the simultaneous matching and coordination of multiple assembly holes and module axis in the automatic docking of spacecraft segments, cabin docking attitude recognition method based on the feature constraint of holes is proposed. Firstly, the assembly hole images on the docking end face of the cabin section are collected using a binocular vision measurement system. After a series of image processing such as denoising, edge detection, arc matching, fitting ellipses, and deduplication, the assembly hole is evaluated based on Topsis ellipses to obtain two-dimensional information. Then, a binocular elliptical cone model is established to solve the attitude direction of holes. Afterwards taking the optimal attitude matching of holes as the goal, the optimal mathematical model of the overall attitude estimation of the cabin was established to maximize projection vector modulus-length sum, which was made of the common projection vector in the attitude direction of these holes. The model was solved by genetic algorithm (GA) method, and the optimal attitude direction of large cabin was obtained. The simulation case showed that the effectiveness of the proposed method was verified by comparing with the ideal attitude and the accuracy of the method was tested on the experimental bench. The relative error of the actual deflection attitude angle of the module and the calculated attitude angle is 1.92%, which meets the requirements of the attitude estimation of large cabin.