The invention discloses a camera distance measuring method and
system. The
system comprises an
image sensor unit, a lens unit, a lens driving device unit, an automatic focusing unit and a
gyroscope unit. The method mainly comprises the following steps: 1, calibrating a codon value-
object distance table, namely, calibrating the codon value (input parameter of the lens driving device unit)-
object distance table under three groups of different postures (horizontal posture, overlook posture and elevation posture) as requirement; 2, automatically focusing a target object to obtain the codon value of the current lens driving device unit; 3, acquiring the overlook angle and the
elevation angle measured by the
gyroscope unit; and 4, calculating the actual distance to the target
object based on thecodon value, the overlook angle and the
elevation angle of the lens driving device unit. The method and the
system can be compatible to various smart devices, such as a
smart phone, a
laptop and thelike; in addition, the
gyroscope unit is introduced, so that the problem that different measuring postures lead to different measuring values can be solved, as a result, the result accuracy is improved.