Abstract Many objects that appears in digital images are bounded by straight lines. Curves are often detected as series of edges. The detection of the straightness of those edge sequences is a major problem in image interpretation. In this paper the RULI chain code is used for encoding geometric configurations. Rosenfeld ( IEEE Trans. Comput. C-23, 1974, 1264–1269) and Ronse ( Pattern Recognit. Lett. 3, 1985, 323–326) used the “chord property” to identify straight lines. While this test takes O(n ∗ ∗ 2) steps, the algorithm discussed in this paper only takes O( n) steps, where n is the number of code elements. Furthermore, the algorithm calculates the interval that delimits the slope of the straight line.