Structure determination and correction for distortions in HREM by crystallographic image processing