Using global information to refine local patterns for texture representation and classification