Pupil localization is a very important preprocessing step in many machine vision applications. Accurate and robust pupil localization especially in non-ideal eye images (such as images with defocusing, motion blur, occlusion etc.) is a challenging task. In this paper, a detailed method to solve this problem is proposed. This method is implemented in three main steps: first, segment the rough pupil region based on Gaussian Mixture Model according to the gray level distribution of eye image; then modify the rough segmentation result using morphological method to minimize the influence of some disturbing factors; last step is to estimate the pupil parameters based on minimizing the least square error. The proposed method is first tested on CASIA iris image dataset, and then on our self-captured iris dataset which with more varieties. Experiments show that the proposed method can perform well for non-ideal eye images of various qualities.