Windows are important elements of building facade. Therefore, window extraction is of significant value to building structural analysis and facade reconstruction. With respect to the inner structural feature and the distribution regularity among windows, this paper proposed a window extract method based on automatic sample selection and distribution regularity constraint. Firstly, sample selection was performed by a template matching method to select a number of window samples, both the positive and the negative, from one selected window sample. Secondly, JointBoost classifier, trained by the window samples, was employed to achieve preliminary window extraction. Then, windows distribution regularity model, which includes horizontal direction, vertical direction, point of interest and similarity, was defined and reconstructed using the preliminary window extraction. Finally, the final window extraction result was achieved by optimizing preliminary window extraction result on the constraint of distribution regularity model. The experiments proved that the proposed method has high extraction ratio and accurate ratio on images with complicated background, complex window structure and perspective distortion.