A system for online beam emittance measurements and proton beam characterization