In Magnetic Resonance Imaging (MRI), intensity inhomogeneity has been an issue affecting the quality of post processing. In this paper, we present a simultaneous segmentation and inhomogeneity correction (IC) method based on active contour algorithm. It uses a generative model which is a modified Mumford-Shah functional proposed by Chan and Vese. The piecewise constant image model in the functional is multiplied by an underlying intensity inhomogeneity field. The inhomogeneity field and piecewise constant function are jointly estimated in an iterative way including solving the associated contour evolution equation and updating corresponding parameters. The algorithm is implemented using the level set framework. Test on MRI leg data shows our method achieves more accurate segmentation and IC results than other related methods in MR images with strong intensity inhomogeneity.