A Low-Cost Gesture Recognition System for Rehabilitation and Movement Assessment