Learning-based approach for vision problems