Regular structures, flat and non-flat, are perceived as regular in a wide range of viewing angles and under varying illumination. In this papers, we exploit this simple observation and develop an invariant measure of pattern regularity. The measure is the maximum of the regularity values obtained for different directions within the pattern. We demonstrate that the regularity feature introduced is reasonably stable under weak perspective of real nonflat structures. The feature is consistent with human perception of texture regularity. It is used for regularity-based image filtering. Examples of invariant detection of periodic structures are shown. Finally, structural defects in regular textures are detected as locations of low regularity.