A Real-time Recognition Algorithm of Scenes on Smartphones