Trainable COSFIRE filters for vessel delineation with application to retinal images