Patent ID: 7764321

Claim:
A distance measuring apparatus, comprising: an obtaining means for obtaining image data through imaging; a detection means for detecting a target subject from the image data; a calculation means for calculating the distance to the target subject based on the size of the target subject; a distance measuring means for measuring the distance to the target subject; a determination means for determining a distance, which is based on the distance to the target subject calculated by the calculation means according to the size of the detected target subject and/or the distance to the target subject measured by the distance measuring means, as the subject distance, wherein, the determination means determines the average value of the distance to the target subject calculated by the calculation means and the distance to the target subject measured by the distance measuring means as the subject distance, when the size of the detected target subject is greater than a predetermined size, and the absolute value of difference between the distance to the target subject calculated by the calculation means and the distance to the target subject measured by the distance measuring means is smaller than a predetermined threshold value.