Abstract::According to the characteristic of anti-ship infrared imaging missile ship target ,a new method was proposed ,which uses neighborhood median combined with contrast stretch to suppress background and enhance targets , then uses improved linear fit to locate the horizontal region. The experiment result with ship target infrared image shows that this method can locate precisely the horizontal region and assures the validity and real2time of image segmentation