The existing NMR equipment is uneven to face the main magnetic field, mostly adopts the hardware method of magnetic field compensation, such as magnetic field compensation, but it brings bad effects such as image artifact and blurred image. In view of the problem of magnetic field inhomogeneous in magnetic resonance imaging, a fractional domain magnetic resonance imaging (fMRI) method under the main magnetic field inhomogeneous is proposed. First, select a layer of living tissue to be imaged, select several points on the layer and measure the intensity of the magnetic field on the layer. Based on the principle of magnetic resonance imaging, establish the model of the magnetic field intensity distribution in the imaging area, and then establish. The polynomial model of the magnetic field can be divided into the second-order polynomial model and the higher-order polynomial model according to whether there is a significant second-order component in the measured magnetic field. Then, the two models are respectively substituted into the free-induction decay (FID) signals of the magnetic resonance. For the second-order model, the fractional Fourier transform tool can be used to solve the spin density function on one layer of the imaged object. The order model needs to obtain the spin density function at a certain level of the imaging object by solving the algebraic equation, thus establishing the MR signal model with any non-uniform main magnetic field. Experimental results show that this method achieves the same effect as the uniform main magnetic field.