Real Time Pattern Recognition in Digital Video with Applications to Safety in Construction Sites