I am doing a project on Drowsiness Detection system for cars where i am using webcam which was later modified to work as a infrared webcam during both day and night condition.Our principle is , for each change in frame I want to generate a pulse that will be fed to two infrared illuminators which should glow alternately, synchronizing with frames captured by the webcam (i.e30 fps).I am working on a software called SCILAB similar to matlab which has its own source code for image processing .I am working with windows pc.So this above mention software is going to display ,capture and process each and every frames.Its not necessary to save any kind of datas regarding pulse generations apart from generating pulses for PWM.Thus my only requirement for this project is to have a system which can generate electrical pulses for every change in frames.