Towards invariance in gait recognition