In order to estimate intensity and direction of pressure acted on oil well in horizontal, this paper proposes an algorithm of ellipse fitting based on least square method for sections of oil well with ultrasonic imaging logging data. Five parameters about ellipse corresponding to the sections of oil well are extracted and their geometry deformations and direction are estimated. The tested results show that the fitting algorithm is robust and the estimating error of parameter is small, which have very important practical significance on processing the well logging.