The primate visual system has an impressive ability to generalize and to discriminate between numerous objects and it is robust to many geometrical transformations as well as lighting conditions. The study of the visual system has been an active research field in neurophysiology for more than half a century. The construction of computational models of visual neurons can help us gain insight in the processing of information in visual cortex which we can use to provide more robust solutions to computer vision applications. Here, we demonstrate how inspiration from the functions of shape-selective V4 neurons can be used to design trainable filters for visual pattern recognition. We call this approach COSFIRE, which stands for Combination of Shifted Filter Responses. We illustrate how a COSFIRE filter can be configured to be selective for the spatial arrangement of lines and/or edges that form the shape of a given prototype pattern. Finally, we demonstrate the effectiveness of the COSFIRE approach in three applications: the detection of vascular bifurcations in retinal fundus images, the localization and recognition of traffic signs in complex scenes and the recognition of handwritten digits. This work is a further step in understanding how visual information is processed in the brain and how information on pixel intensities is converted into information about objects. We demonstrate how this understanding can be used for the design of effective computer vision algorithms.