Development and Validation of Algorithms for Automatic and Real-Time Characterization of Drowsiness