A straight line detection algorithm is presented. The algorithm separates row and column edges from edge image using their primitive shapes. The edges are labeled, and the principal component analysis (PCA) is performed for each labeled edges. With the principal components, the algorithm detects straight lines and their orientations, which is useful for various intensive applications. Our algorithm overcomes the disadvantages of Hough transform (HT) and other algorithms, i.e. unknown grouping of collinear lines, complexity and local ambiguities. The experimental results show the efficiency of our algorithm.