CN108007426B - Camera ranging method - Google Patents

Camera ranging method Download PDF

Info

Publication number
CN108007426B
CN108007426B CN201711226725.2A CN201711226725A CN108007426B CN 108007426 B CN108007426 B CN 108007426B CN 201711226725 A CN201711226725 A CN 201711226725A CN 108007426 B CN108007426 B CN 108007426B
Authority
CN
China
Prior art keywords
object distance
value
code word
pitch angle
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711226725.2A
Other languages
Chinese (zh)
Other versions
CN108007426A (en
Inventor
杨少军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Eeasy Electronic Tech Co ltd
Original Assignee
Zhuhai Eeasy Electronic Tech Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Eeasy Electronic Tech Co ltd filed Critical Zhuhai Eeasy Electronic Tech Co ltd
Priority to CN201711226725.2A priority Critical patent/CN108007426B/en
Publication of CN108007426A publication Critical patent/CN108007426A/en
Application granted granted Critical
Publication of CN108007426B publication Critical patent/CN108007426B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B13/00Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
    • G03B13/32Means for focusing
    • G03B13/34Power focusing
    • G03B13/36Autofocus systems

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Studio Devices (AREA)
  • Measurement Of Optical Distance (AREA)

Abstract

The invention discloses a camera ranging method, which mainly comprises the following steps: 1. code word value-object distance table calibration, which refers to calibrating three code word values (input parameters of a lens driver unit) in different postures (horizontal, overlooking and looking up) -object distance tables according to needs; 2. aiming at a target object, performing automatic focusing to obtain a unit codeword value of a current lens driver; 3. acquiring a pitch angle measured by a gyroscope unit; 4. and calculating the actual distance between the lens driver unit code word value and the target object by combining the pitch angle and the code word value-object distance table. The method can be compatible with various intelligent devices such as smart phones, tablet computers and the like; in addition, due to the introduction of the gyroscope unit, the problem that measurement values are different due to different measurement postures is solved, and the result is more accurate.

Description

Camera ranging method
Technical Field
The invention relates to the field of electronic information systems, in particular to a camera ranging method.
Background
The conventional handheld distance measuring device is generally provided with a signal transmitting device and a signal receiving device, and the distance between the conventional handheld distance measuring device and a target object is estimated by measuring the interval between the signal transmitting time and the reflected signal receiving time, wherein the conventional signals are ultrasonic waves, infrared rays, laser and the like.
Along with the popularization of intelligent devices such as smart phones and tablet computers, the way for people to obtain information is more and more convenient, the functions of the intelligent devices such as the mobile phones are more and more abundant, and if the distance measuring function can be integrated into the intelligent devices, the cost for people to obtain the functions can be greatly reduced.
At present, some schemes have proposed to integrate the ranging function into smart devices such as mobile phones, which are mainly divided into three methods: the first method comprises the following steps: a signal transmitting device and a signal receiving device are additionally arranged on the mobile phone, and the distance is calculated by measuring the flight time of the signals; the second method comprises the following steps: using a binocular camera, using two cameras with different positions to shoot the same object at the same time, and calculating the distance between the binocular camera and the target object by measuring the phase difference of the target object in two images; the third method comprises the following steps: and (3) calculating the distance of the target object by measuring the image distance after focusing by using the monocular camera and combining the parameters of the camera lens. The first method and the second method need extra hardware cost and are not easy to popularize in a large scale, the third method is simple and easy to implement, does not need extra cost and is easy to popularize, but the problems that the existing monocular camera distance measurement is inaccurate in optical parameter estimation, the measurement result is greatly influenced by the measurement attitude and the like need to be solved.
Disclosure of Invention
In order to solve the problems that the existing monocular camera ranging has inaccurate optical parameter estimation, large measurement result influence by measurement attitude and the like, the invention provides a camera ranging method, which is different from other monocular camera ranging systems, does not need to accurately know the specific parameters of a camera lens, and only needs to obtain code word values (input parameters of a lens driver unit) -an object distance meter under three groups of different attitudes (horizontal, overlook and upward) in a calibration mode; meanwhile, a gyroscope unit is introduced into the method, and the problem of different measurement values caused by different postures in measurement is solved by introducing calculation of the pitch angle, so that the result is more accurate. It should be understood that the detailed description and specific examples, while indicating the scope of the disclosure, are intended for purposes of illustration only and are not intended to limit the scope of the disclosure.
To achieve the object of the present invention, the present invention first provides a camera ranging system, which mainly comprises: an image sensor unit, a lens driver unit, an auto-focus unit, and a gyroscope unit.
Further, the invention also provides a camera ranging method, which mainly comprises the following steps.
Step one, calibrating a code word value-object distance table, calibrating three groups of code word values (input parameters of a lens driver unit) under different postures (horizontal, overlooking and looking up) -object distance tables according to requirements, wherein the more the number of the calibrated object distances is, the more accurate the subsequent measurement is, and generally, the object distance calibration needs to measure at least the code word values of the lens driver after focusing is accurate under the object distances of 7cm, 10cm, 15cm, 20cm, 30cm, 50cm, 100cm, 200cm and 300 cm.
Step two, executing an automatic focusing algorithm, namely a method for controlling a lens driver unit to perform lens displacement adjustment through a certain strategy to finally enable the target object to be imaged most clearly, wherein the automatic focusing algorithm is further determined by an automatic focusing unit and comprises but is not limited to a full search method, a hill climbing method and the like; after the automatic focusing is completed, the current lens driver unit codeword value needs to be acquired for subsequent calculations.
And step three, acquiring a pitch angle, and acquiring the pitch angle under the current measurement attitude by reading data of the gyroscope unit.
And step four, calculating the object distance, and calculating the actual distance between the target object and the lens driver by combining the unit code word value, the pitch angle and the code word value-object distance table of the lens driver through an interpolation method.
The lens image distance adjusting process required by automatic focusing is completed by a lens driver driving the lens, because the lens has weight, under different measuring postures, the same image distance is required to be kept, the electromagnetic force E required to be generated by the lens driver is different, under the condition of the same image distance, the gravity borne by the lens is assumed to be M, the elastic force of an elastic sheet of the automatic focusing lens is assumed to be D, when the horizontal posture is measured, the requirement E is D, when the upward posture is measured, the requirement E is D-M, when the upward posture is measured, the requirement E is D + M, therefore, under the same image distance and the same object distance, the requirements of three different postures on the electromagnetic force generated by the lens driver are different, and the problem of the measuring posture difference is caused, the invention introduces a gyroscope unit to obtain the measuring pitch angle, and then, according to a code word value-object distance table under three groups of different postures which are calibrated in advance, the problem of poor measurement posture can be solved.
Drawings
Fig. 1 is a schematic structural diagram of a camera ranging system according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of a camera ranging method according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of three different measurement positions (horizontal, top and bottom measurement) according to an embodiment of the present invention.
Fig. 4 is a schematic view of the pitch angle according to an embodiment of the present invention.
FIG. 5 is a diagram of a codeword value-object distance table according to an embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Fig. 1 shows a specific embodiment of a camera ranging system according to the present invention, where the camera ranging system 101 mainly includes: an image sensor unit 102, a lens unit 103, a lens driver unit 104, an auto focus unit 105, and a gyroscope unit 106.
The image sensor unit 102, mainly referred to as a CCD or CMOS light sensing device in a specific embodiment, is a device that can convert an optical signal into an electrical signal. The lens unit 103, in a specific embodiment, mainly refers to an optical device located in front of the image sensor for collecting light to generate an image. The lens driver unit 104, in a specific embodiment, mainly includes a motor driving circuit and a lens motor, where the motor driving circuit refers to a circuit device capable of controlling the current of the lens motor, and generally, by controlling the code word value of the motor driving circuit, the output current of the circuit can be controlled, and then the lens motor is controlled to adjust the position of the lens unit 103. The auto-focus unit 105, in a specific embodiment, mainly refers to a device for obtaining an optimal imaging position of a lens by measuring a sharpness value of an image of a target object during a lens moving process, and generally the device is embedded in an image processor (ISP). The gyroscope unit 106, in certain embodiments, is primarily a device that can determine the current attitude of the equipment, which can act as a horizontal, vertical, pitch, heading, and angular velocity sensor.
Fig. 2 shows a specific embodiment of a camera ranging method according to the present invention, where the camera ranging method mainly includes: step 201, code word value-object distance calibration, step 202, an automatic focusing algorithm is executed, step 203, a pitch angle is obtained, and step 204, an object distance is calculated.
The step 201 code word value-object distance calibration refers to calibrating at least code word values (input parameters of the lens driver unit) in three different postures (horizontal, overlook and upward view) -object distance table according to needs, wherein the horizontal, overlook and upward view postures are as shown in fig. 3, generally, the object distance calibration at least needs to measure the focused lens driver code word values in 7cm, 10cm, 15cm, 20cm, 30cm, 50cm, 100cm, 200cm and 300cm object distances, the subsequent measurement is more accurate as the number of the calibrated object distances is larger, fig. 5 shows an embodiment of a group of horizontal posture code word value-object distance table, in a specific embodiment, the horizontal posture code word value-object distance table HOR _ TBL [ n ] [ m ], the overlook posture code word value-object distance table n _ TBL [ n ] [ m ], the upward posture code word value-object distance table UP _ TBL [ n ] [ m ], then N ranges from 1 to N (assuming that the number of object distances to be calibrated is N), and m ranges from 1 to 2(1 represents the code word value component and 2 represents the object distance component), generally, in this particular embodiment, the code word value-object distance table calibration is performed in the order of the object distance from small to large.
The step 202 of executing an automatic focusing algorithm refers to a method for controlling a lens driver unit to perform lens displacement adjustment through a certain strategy so as to finally make the imaging of the target object be clearest, and further, the automatic focusing algorithm is determined by an automatic focusing unit, including but not limited to a full search method, a hill climbing method and the like; after the automatic focusing is completed, the current lens driver unit codeword value needs to be acquired for subsequent calculations.
The step 203 of obtaining the pitch angle, as shown in fig. 4, means that the pitch angle θ under the current measurement attitude is obtained by reading data of the gyroscope unit, the value range of θ is-90 ° to 90 °, generally, when θ takes the value of-90 °, it represents the overlooking attitude, and when θ takes the value of 90 °, it represents the overlooking attitude.
The step 204 of calculating the object distance refers to calculating the actual distance to the target object by an interpolation method by combining the unit code word value of the lens driver, the pitch angle and the code word value-object distance table. Assuming that the unit codeword value of the lens driver is C and the pitch angle is θ when focusing is completed, the method for calculating the target object distance is given below:
acquiring object distance estimated values under three postures according to three code word value-object distance tables under different postures:
assuming that the corresponding TBL [ n ] [ m ] lookup table index ind when the lookup codeword value is C, the ind satisfies the condition: TBL [ ind ] [1] > C, and TBL [ ind ] [1] ≦ C, then the current object distance D obtained through linear interpolation is:
Figure GDA0002440257470000041
Figure GDA0002440257470000042
then the method can respectively obtain the object distance estimated values under three postures, and the object distance estimated values of the horizontal, upward and downward views are assumed to be corresponding HORs respectivelyD,UPD,DOWND
Step two, according to the HORD,UPD,DOWNDWhen the pitch angle is theta, the final object distance F can be obtainedDThe method comprises the following steps:
when theta is greater than or equal to-90 DEG and less than 0 DEG, FDIs HORD+sinθ(HORD-DOWND)。
When theta is 0 DEG or more and less than 90 DEG, FDIs HORD-sinθ(HORD-UPD)。
The invention can well solve the problem of inaccurate estimation of the optical parameters at present by introducing a code word value-object distance calibration table and flexibly setting the calibration number; in addition, the gyroscope unit is introduced to measure the pitch angle, so that the problem that the measurement attitude has great influence when the object distance is measured at present can be well solved.
The foregoing is directed to the preferred embodiment of the present invention and it is understood by those skilled in the art that various changes may be made without departing from the spirit and scope of the invention.

Claims (5)

1. A camera ranging method mainly comprises the following steps: firstly, calibrating a code word value-object distance table; step two, executing an automatic focusing algorithm; acquiring a pitch angle theta, wherein the pitch angle theta ranges from-90 degrees to 90 degrees; step four, calculating the object distance, and obtaining the current object distance D through linear interpolation as follows:
Figure FDA0002440257460000011
wherein C is the value of the unit codeword of the lens driver at the time of completion of focusing, TBL [ ind ]][1]Codeword value representing the index component of the codeword value-object distance table, TBL [ index + 1]][1]Codeword value, TBL [ ind ], representing the index +1 component of the codeword value-object distance table][2]An object distance value, TBL [ ind + 1], representing the index value-the index component of the object distance table][2]Representing the code word value-the object distance value of the ind +1 th component of the object distance table; the final object distance FD is then:
when theta is greater than or equal to-90 DEG and less than 0 DEG, FDIs HORD+sinθ(HORD-DOWND);
When theta is 0 DEG or more and less than 90 DEG, FDIs HORD-sinθ(HORD-UPD);
Wherein, HORDFor horizontal object distance estimation, UPDFor an upward object distance estimate, DOWNDLooking down the object distance estimate.
2. The camera ranging method according to claim 1, wherein the code word value-object distance table calibration step mainly refers to calibrating three code word value-object distance tables in different postures according to needs.
3. The camera ranging method according to claim 1, wherein the step of executing the auto-focus algorithm is a method of controlling a lens driver unit to adjust lens displacement through a certain strategy, so as to finally make a target object image clearest.
4. The camera ranging method according to claim 1, wherein the step of obtaining the pitch angle mainly comprises obtaining the pitch angle at the current measurement attitude by reading data of a gyroscope unit.
5. The camera ranging method according to claim 1, wherein the step of calculating the object distance mainly includes calculating an actual distance to the target object by an interpolation method in combination with a lens driver unit codeword value, a pitch angle, and a codeword value-object distance table.
CN201711226725.2A 2017-11-29 2017-11-29 Camera ranging method Active CN108007426B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711226725.2A CN108007426B (en) 2017-11-29 2017-11-29 Camera ranging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711226725.2A CN108007426B (en) 2017-11-29 2017-11-29 Camera ranging method

Publications (2)

Publication Number Publication Date
CN108007426A CN108007426A (en) 2018-05-08
CN108007426B true CN108007426B (en) 2020-10-16

Family

ID=62054800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711226725.2A Active CN108007426B (en) 2017-11-29 2017-11-29 Camera ranging method

Country Status (1)

Country Link
CN (1) CN108007426B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109211186B (en) * 2018-09-13 2021-03-02 国网福建省电力有限公司 Method for rapidly measuring distance between two points in space in non-contact manner
TWI693829B (en) * 2018-12-24 2020-05-11 緯創資通股份有限公司 Electronic device and method for measuring distance from image thereof
CN109708529B (en) * 2018-12-26 2020-07-24 中国科学院长春光学精密机械与物理研究所 Laser focusing striking system and method
CN111637837B (en) * 2020-06-03 2022-04-08 龙永南 Method and system for measuring size and distance of object by monocular camera
CN111623776B (en) * 2020-06-08 2022-12-02 昆山星际舟智能科技有限公司 Method for measuring distance of target by using near infrared vision sensor and gyroscope

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103837129B (en) * 2014-02-27 2016-06-08 华为终端有限公司 Distance-finding method in a kind of terminal, device and terminal
CN104215216B (en) * 2014-08-21 2018-02-09 深圳市金立通信设备有限公司 A kind of range unit and terminal
CN104613930B (en) * 2015-01-04 2017-05-17 宇龙计算机通信科技(深圳)有限公司 Method and device for measuring distance as well as mobile terminal
CN106197366A (en) * 2016-08-01 2016-12-07 珠海格力电器股份有限公司 The treating method and apparatus of range information

Also Published As

Publication number Publication date
CN108007426A (en) 2018-05-08

Similar Documents

Publication Publication Date Title
CN108007426B (en) Camera ranging method
EP3469306B1 (en) Geometric matching in visual navigation systems
EP3389268B1 (en) Depth information acquisition method and apparatus, and image collection device
CN108226906B (en) A kind of scaling method, device and computer readable storage medium
CN110455258B (en) Monocular vision-based unmanned aerial vehicle ground clearance measuring method
US20150009295A1 (en) Three-dimensional image acquisition apparatus and image processing method using the same
WO2019080052A1 (en) Attitude calibration method and device, and unmanned aerial vehicle
CN113701745B (en) External parameter change detection method, device, electronic equipment and detection system
CN105874384B (en) Based on a variety of distance measuring methods with burnt system, method and camera system
CN111862180B (en) Camera set pose acquisition method and device, storage medium and electronic equipment
WO2017024673A1 (en) Target positioning system and method based on radio frequency and binocular vision
WO2019080046A1 (en) Drift calibration method and device for inertial measurement unit, and unmanned aerial vehicle
CN205333856U (en) Low -cost laser rangefinder based on ordinary camera chip
CN113358231B (en) Infrared temperature measurement method, device and equipment
CN103528562A (en) Method for detecting distance of human eyes and display terminal based on single camera
US11233961B2 (en) Image processing system for measuring depth and operating method of the same
KR101674298B1 (en) Method for distance calculation using a camera lens focal length information
CN111105465B (en) Camera device calibration method, device, system electronic equipment and storage medium
CN105025219A (en) Image acquisition method
CN108053468B (en) Monocular vision focusing stack acquisition and scene reconstruction method
CN115950435A (en) Real-time positioning method for unmanned aerial vehicle inspection image
JP2006309450A (en) Image recognition device and image recognition method
CN113959398B (en) Distance measurement method and device based on vision, drivable equipment and storage medium
CN113034615B (en) Equipment calibration method and related device for multi-source data fusion
CN112985388B (en) Combined navigation method and system based on large-displacement optical flow method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant