An attempt to encode images in a way which preserves texture information and minimises lighting and other pesky variations.
Threshold with respect to the centre pixel:
Binary encode with:
This number represents the relationship of the centre pixel with it's neighbours in a way which ignores overall changes in contrast or level.
Obviously it's not too instructive to look at these images, but obviously we are going to try: