Digitization of ECG paper records based on density and prediction methods