Two perspective images of a single scene taken by uncalibrated cameras are related by a fundamental matrix, which is the key to solving many computer vision problems. We present a new robust and accurate algorithm to estimate the fundamental matrix, which is suitable for wide baseline stereo pairs. The estimation algorithm includes two stages. The first stage is that more affine invariant matching points are determined by a propagation process. In this stage, an affine iterative optimization model is used to accurately detect matching points at the subpixel level. And a new matching cost function is proposed that is more robust to outliers and more effective for images with single texture and repetitive texture. In the second stage, a resampling model based on the posterior probability is presented in order to optimize the fundamental matrix with more accurate matching points. The experiment results show that our algorithm is very robust to outliers, and the fundamental matrix with high accuracy can be estimated.