With the development of economic globalization, coastal harbors have become an increasingly important gateway for international trade. Synthetic aperture radar (SAR) is an important microwave sensor with high resolution imaging capability. Harbor detection in SAR images is of great significance for timely obtaining coastal intelligence of a country. However, due to its complexity and diversity, harbor detection is challenging. In this paper, a harbor detection method based on multidirectional one-dimensional scanning is proposed. First, discrete coastline to obtain control points, and multiple directions are selected at each control point, values of scanned pixels in each direction are recorded to obtain the representation vector. Then, design a onedimensional convolutional neural network for harbor features identification of representation vectors. Finally, the harbors are located by clustering feature points. The proposed method can extract vectors to characterize the distribution of land, waters, and wharfs. Therefore, the problem of object detection in twodimensional images is transformed into the identification of representation vectors. The method is effective for harbors with various scales and forms and has low computational complexity. Experimental results on spaceborne SAR images demonstrate the effectiveness of the proposed method.