BEAMETR: Automatic and Accurate Measurement of Electron Beam Size