Recognition of objects and scenes in virtual and real environments