To detect precisely small and dim targets in a complicated background with ocean waves and cloud clutters, a new algorithm is presented which picks up the sea-sky line at first, then efficiently detects the targets on the special region under sky, ocean, and nearby the sea-sky line. On the basis of the line gray characteristics of sea and sky, this algorithm combines the gradient method and morphologic operation to segment the sub-band image in a potential area of sea-sky line, further to fit the sea-sky line by Hough transform to implement the precise location of the sea-sky line. The experiment result shows that this method can extract the sea-sky line from the complicated sea-sky background and can detect the small targets fast and efficiently. For a 256 pixel256 pixel file, the sea-sky line can be located in 4.1 ms and a small target can be detected in 5.3 ms, which demonstrates that the algorithm can meet the requirements of high frame image processing in real time.