1. An automatic pupillary distance (PD) measuring method using a camera and an user interface (UI), wherein the measuring method is performed using a processor of an electronic device, comprising: notifying a user to move his head position to a center of a captured face image; notifying the user to place a credit card inside a card window; notifying the user to move his head forward or backward to fit within a target elliptical frame, thereby maintaining a correct head posture; and obtaining a measurement of a pupil distance of the user.