Towards a Unified Theory of Vision