The carbonate rock reservoir with developed reefs has become one of the main pay zones for the hydrocarbon exploration in the Changxing Formation, northern Sichuan Basin. The prediction on the reef bodies distribution is a real challenge for hydrocarbon exploration in this zone. In this paper, based on the simple principle of sedimentary geology that a reef-developed stratum usually displays a large thickness abnormal relative to the adjacent contemporaneous non-reef strata, the top-hat transformation method developed in mathematical morphology is introduced to predict the distribution of reef bodies with satisfactory results. The top-hat transformation method utilized in the paper is suitable for predicting reef bodies in such carbonate reservoirs with weak structure deformation.