CN113358090A - Distance measurement method based on single camera - Google Patents

Distance measurement method based on single camera Download PDF

Info

Publication number
CN113358090A
CN113358090A CN202110605955.XA CN202110605955A CN113358090A CN 113358090 A CN113358090 A CN 113358090A CN 202110605955 A CN202110605955 A CN 202110605955A CN 113358090 A CN113358090 A CN 113358090A
Authority
CN
China
Prior art keywords
camera
target object
distance
focal length
line
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.)
Pending
Application number
CN202110605955.XA
Other languages
Chinese (zh)
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.)
Wenzhou Medical University
Original Assignee
Wenzhou Medical University
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 Wenzhou Medical University filed Critical Wenzhou Medical University
Priority to CN202110605955.XA priority Critical patent/CN113358090A/en
Publication of CN113358090A publication Critical patent/CN113358090A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The invention discloses a distance measuring method based on a single camera in the technical field of distance measurement, which estimates the linear distance between the camera and a target object when only one camera is available, and comprises the following implementation steps: selecting 2 parallel marking lines in the horizontal or vertical direction on a target object; setting 2 parallel range lines with the same direction as the target object sign line on a camera screen; adjusting the focal length facing the target object to enable the target object sign line to coincide with the camera screen range line and take a picture, and recording the camera focal length value; moving forwards or backwards for a certain distance along the connecting line direction of the target object and the camera; adjusting the focal length again to enable the mark line of the target object to coincide with the range line of the camera screen, taking a picture and recording the focal distance value of the camera; the linear distance between the camera and the target object when the camera takes a picture for the first time can be calculated through a camera imaging principle formula. The method only needs to use a single camera, does not add other equipment, does not relate to a complex image processing technology, and is simple and easy to implement.

Description

Distance measurement method based on single camera
Technical Field
The invention belongs to the technical field of distance measurement, and particularly relates to a method for estimating a linear distance between a camera and a target object by using a single camera.
Background
The distance measurement is closely related to our life, such as a distance sensor in a mobile phone, a car reversing radar, navigation and the like. In order to obtain more accurate ranging results, most ranging methods use one or more specialized devices or sensors, such as laser radar, GPS (global positioning system), camera, optical or acoustic sensor, etc., and have severe application conditions, complex calculation methods, and high technical requirements and application thresholds. Thanks to the popularization of smart phones and digital cameras and the development of machine vision and image processing technologies, the use of camera ranging becomes one of the conventional means of ranging. As for the camera, there are a monocular camera, a binocular camera, and a special camera having a function of measuring depth, distance, and the like, and a general camera such as a mobile phone camera, a digital camera, and the like used for photographing or recording video is most contacted or used by people. When only such a general-purpose camera is provided around us, it is often difficult to satisfy the implementation requirements of most accurate distance measurement methods. At this time, it is feasible to estimate the distance between itself and the target object by the camera. Therefore, the invention is mainly used for solving the problem of estimating the distance by using a single general camera.
Some single-camera ranging methods or systems have been disclosed, but basically rely on other sensors or devices, and often involve complicated machine vision or image processing techniques, which require programming to implement, for example: patent documents CN111473766A (2020.07.31), CN107390209A (2017.11.24), CN103759701B (2016.03.09), and CN106500658B (2019.03.29) rely on GPS, a direction sensor, or a distance sensor that is mounted on the terminal itself; patent documents CN112489116A (2021.03.12), CN111141218A (2020.05.12), CN101858741A (2010.10.13), and CN101858742A (2010.10.13) relate to complicated image processing techniques such as target object recognition and stereo image matching: patent document CN102175228B (2012.09.05) relates to achieving size conversion between a reference scale and image pixels, and patent document CN101206380B (2011.08.24) relates to modifying a program built in a digital camera, all of which can be achieved only by programming.
Similar to the method (CN103759701B, 2016.03.09) for mobile phone intelligent distance measurement based on the android platform, the pitch angle and the roll angle of the mobile phone when the distance measurement point is shot are obtained by using a direction sensor built in the mobile phone, the height of a camera is obtained, and then the distance is calculated according to a triangle formula. The method cannot be applied to other camera mobile phones and common digital cameras except smart phones because of the dependence on the built-in direction sensor of the mobile phone.
Another document similar to the present invention is a distance measuring method (CN102175228B, 2012.09.05) based on a mobile terminal, which obtains the distance moved by the terminal under the condition of presetting a reference object or a reference scale, and then calculates the real distance according to the triangle similarity principle by combining the reference object or the reference scale. The method is not dependent on other sensors of the terminal, is convenient, but needs to be preset with a reference object or a reference scale.
Disclosure of Invention
In order to further reduce the threshold of using the single-camera ranging technology, the invention provides an effective method capable of rapidly estimating the distance in a simple equipment environment. The method is independent of other sensors or devices besides the camera, and can be realized without programming. In order to measure the linear distance between the camera and the target object, the technical scheme comprises the following steps:
(1) and selecting a target object marking line. Selecting 2 characteristic lines parallel to the horizontal direction or the vertical direction on a target object as marking lines, such as a boundary line of the target object, a window frame or a stand column on a building wall surface and the like;
(2) a camera range line is set. 2 lines which are in the same direction as the marking lines in the step (1) and are parallel are arranged on the camera screen to be used as range lines, the frame lines of the camera screen, the reference lines built in a camera program, camera focusing frame line and the like can be directly used, and a marker pen can be used for drawing on the surface of the camera screen;
(3) and aligning the target object for photographing. Keeping the camera horizontal, facing the target object, adjusting the focal length of the camera to make the selected target object mark line coincide with the range line on the camera screen and take a picture, and recording the focal length f of the camera at the moment1. Here, the focal length and the focal length in the following text both refer to equivalent focal lengths, and can be displayed on a screen when the digital camera focuses or obtained by viewing image attribute information. Let L be the distance between the camera and the target object at this time1I.e. the distance value to be solved;
(4) the camera is moved. And moving forwards or backwards for a distance h along the connecting line direction of the target object and the camera, and estimating the distance value. Without precision measuring tools such as rulers, it is recommended that the travel distance be preset to be an integer multiple of the available known length object for evaluation, such as a4 paper, books, cell phone screens, etc. Forward here means the direction toward the target object, h is negative, andand h is a positive value. Let L be the distance between the camera and the target object at this time2Has L2=L1+h;
(5) And aligning the target object again for photographing. Keeping the camera horizontal, facing the target object, adjusting the focal length of the camera to make the selected target object mark line coincide with the range line on the camera screen again and take a picture, and recording the focal length f of the camera at the moment2
(6) The distance is calculated. According to the camera imaging principle, there are
Figure BSA0000243508870000021
Wherein WISize of the object imaged, WOIs the size of the object, f is the focal length during imaging, and L is the object distance during imaging. Maintaining imaging size W due to two shotsIInvariable, have
Figure BSA0000243508870000022
L in (4)2Into, there is
Figure BSA0000243508870000023
Is calculated to
Figure BSA0000243508870000024
Due to h, f1And f2All are known, and the distance value L to be solved between the camera and the target object can be calculated1
Further, the camera movement distance h in the step (4) can be adjusted, the steps (4) - (6) are repeatedly executed for multiple times, and the average value of multiple distance values to be solved is calculated, so that the measurement accuracy of the final distance is improved.
Compared with the prior art, the invention has the following beneficial effects:
(1) the invention provides a new single-camera ranging solution, which is different from the prior art in the implementation method.
(2) The invention uses a single camera for distance measurement, does not need to add or rely on other equipment, does not need programming, saves cost, has simple calculation and further reduces technical difficulty.
(3) The camera ranging method has the advantages that the application range of camera ranging is expanded, and the camera ranging method can be used for smart phones, common cameras and any shooting devices capable of obtaining the focal length of photos.
Drawings
FIG. 1 is a schematic view of a target object. Wherein E isL、ER、EL、EBAre respectively the left, right, upper and lower boundary lines of the target object, SL、SRIs 2 characteristic lines which are parallel in the vertical direction on the surface of the target object.
Fig. 2 is a schematic view of a camera screen. Wherein, the solid line EL、ER、EL、EBRespectively the left, right, upper and lower frame lines of the camera screen, the dotted lines are the screen reference lines of the built-in program display of the camera, and SL、SBAre 2 reference lines parallel in the vertical direction.
Fig. 3 is a state in which the 2-entry object marker line on the camera screen coincides with the screen range line at the time of photographing. To facilitate the display of the situation when the lines coincide, the camera reference lines are drawn as thicker dashed lines in fig. 2 and 3.
Fig. 4 is a schematic view of imaging in two shots.
Detailed Description
The invention is further illustrated by the following figures and examples.
In this embodiment, a camera carried by a single android phone is required to estimate a linear distance between the camera and a target object, and the implementation method is as follows:
(1) in the target object shown in FIG. 1, upper, lower, left and right boundary lines EL、ER、EL、EBA pair of vertical parallel characteristic lines S with the surface of the objectL、SRClearly visible, the characteristic line S of the surface of the object is selectedL、SRIs a sign line.
(2) Opening the camera parameter setting program, displaying the screen reference lines, and selecting 2 parallel reference lines S in the vertical direction as shown in FIG. 2L、SRAs the screen range line.
(3) As shown in FIG. 4, the target object is located at point A2 marker lines S on the target objectL、SRWidth between WO. And the camera is positioned at the point B when the 1 st picture is taken, and AB is the distance to be solved. When taking a picture, 2 marking lines S of the target object are enabled by adjusting the focal length of the cameraL、SRWith 2 range lines S on the screenL、SRThe images were superimposed and photographed as shown in FIG. 3. When taking the 1 st photograph, the object is imaged at the D point, SL、SRWidth between, i.e. image width, WIAt an object distance of L1Focal length of f1
Then AB is equal to L1,BD=f1
(4) And moving backwards a distance h on a connecting line between the target object and the camera. In this embodiment, h is 4 × 297(mm) by moving the sheet by 4 times based on the long side of the a4 sheet carried around. After the movement, the camera is located at point C.
(5) Adjusting the focal length of the camera to make 2 marking lines S of the target object againL、SRWith 2 range lines S on the screenL、SRThe images are superposed and photographed, the object is imaged at the point E, and the image width is still W1At the time, the object distance is L2Focal length of f2
Then AC ═ L2,CE=f2BC is h, and L2=L1+h,
(6) According to the imaging principle
Figure BSA0000243508870000031
Is provided with
Figure BSA0000243508870000032
To obtain
Figure BSA0000243508870000033
Focal length f due to 2 times of photographing1、f2Can be obtained by a camera, the moving distance h is known, and the distance L to be calculated can be calculated1

Claims (5)

1. A distance measurement method based on a single camera is characterized by comprising the following steps:
(1) selecting 2 characteristic lines parallel to the horizontal direction or the vertical direction on the target object as marking lines;
(2) setting 2 range lines which have the same direction as the selected sign line in the step (1) and are parallel to the selected sign line on a camera screen;
(3) keeping the camera horizontal, facing the target object, adjusting the focal length of the camera to enable the target object mark line to coincide with the range line on the camera screen and take a picture, and recording the focal length value of the camera at the moment;
(4) moving the camera forward or backward for a distance along the connecting line direction of the target object and the camera, and estimating the distance value;
(5) adjusting the focal length of the camera to enable the selected target object sign line to coincide with the camera screen range line again and take a picture, and recording the focal length value of the camera at the moment;
(6) and calculating a distance value to be measured according to a camera imaging principle formula and the recorded focal length value and moving distance.
2. A single-camera based ranging method as claimed in claim 1, characterized in that there is a pair of parallel feature lines clearly visible in the horizontal or vertical direction on the target object.
3. A single-camera based range finding method as claimed in claim 1, wherein the size of the target object image is ensured to be constant in two shots by making the selected target object mark line coincide with the camera screen range line.
4. A single-camera based distance measuring method according to claim 1, wherein the object distance and the camera focal length are changed simultaneously while ensuring that the size of the image of the object to be photographed is not changed.
5. A single-camera based ranging method according to claim 1, wherein the distance calculation formula is as follows:
to-be-measured distanceSeparation device
Figure FSA0000243508860000011
Wherein L is1Is the linear distance between the camera and the target object during the first photographing, i.e. the distance to be measured, h is the linear distance moved by the camera during the second photographing, f1Is the focal length of the camera during the first photograph, f2The focal length of the camera during the second photographing.
CN202110605955.XA 2021-05-23 2021-05-23 Distance measurement method based on single camera Pending CN113358090A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110605955.XA CN113358090A (en) 2021-05-23 2021-05-23 Distance measurement method based on single camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110605955.XA CN113358090A (en) 2021-05-23 2021-05-23 Distance measurement method based on single camera

Publications (1)

Publication Number Publication Date
CN113358090A true CN113358090A (en) 2021-09-07

Family

ID=77530762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110605955.XA Pending CN113358090A (en) 2021-05-23 2021-05-23 Distance measurement method based on single camera

Country Status (1)

Country Link
CN (1) CN113358090A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116182786A (en) * 2023-04-28 2023-05-30 昆山迈致治具科技有限公司 Monocular vision ranging method, camera and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102506814A (en) * 2011-11-10 2012-06-20 河北汉光重工有限责任公司 Passive visible light monocular distance measuring device
CN103134489A (en) * 2013-01-29 2013-06-05 北京凯华信业科贸有限责任公司 Method of conducting target location based on mobile terminal
TW201348676A (en) * 2012-05-30 2013-12-01 Hon Hai Prec Ind Co Ltd Electronic device with distance detection function and method thereof
CN104197901A (en) * 2014-09-19 2014-12-10 成都翼比特科技有限责任公司 Image distance measurement method based on marker
CN105091847A (en) * 2014-04-16 2015-11-25 联想(北京)有限公司 Distance measurement method and electronic device thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102506814A (en) * 2011-11-10 2012-06-20 河北汉光重工有限责任公司 Passive visible light monocular distance measuring device
TW201348676A (en) * 2012-05-30 2013-12-01 Hon Hai Prec Ind Co Ltd Electronic device with distance detection function and method thereof
CN103134489A (en) * 2013-01-29 2013-06-05 北京凯华信业科贸有限责任公司 Method of conducting target location based on mobile terminal
CN105091847A (en) * 2014-04-16 2015-11-25 联想(北京)有限公司 Distance measurement method and electronic device thereof
CN104197901A (en) * 2014-09-19 2014-12-10 成都翼比特科技有限责任公司 Image distance measurement method based on marker

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116182786A (en) * 2023-04-28 2023-05-30 昆山迈致治具科技有限公司 Monocular vision ranging method, camera and medium

Similar Documents

Publication Publication Date Title
EP3033733B1 (en) Stereo yaw correction using autofocus feedback
JP6195915B2 (en) Image measuring device
TWI577961B (en) Method for measuring size, electronic apparatus with camera, and program used for electric machine
US10506225B2 (en) Method of calibrating a camera
CN107084680B (en) Target depth measuring method based on machine monocular vision
KR100671529B1 (en) Drawing method of three-dimensional cubic map using multi aerial photograph image
CN102833486B (en) The method and device of face displaying ratio in a kind of real-time adjusting video images
JP5715735B2 (en) Three-dimensional measurement method, apparatus and system, and image processing apparatus
WO2011125937A1 (en) Calibration data selection device, method of selection, selection program, and three dimensional position measuring device
CN109084688B (en) Binocular vision distance measurement method based on variable-focus camera
CN111192235A (en) Image measuring method based on monocular vision model and perspective transformation
KR101709317B1 (en) Method for calculating an object's coordinates in an image using single camera and gps
US20200221064A1 (en) Combined stereoscopic and phase detection depth mapping in a dual aperture camera
CN105180802A (en) Identification method and device of object size information
CN113358090A (en) Distance measurement method based on single camera
WO2018076529A1 (en) Scene depth calculation method, device and terminal
CN106959378B (en) Single width motion blur image speed calculation method
JP4752319B2 (en) Image recognition apparatus and image recognition method
JP2008224323A (en) Stereoscopic photograph measuring instrument, stereoscopic photograph measuring method, and stereoscopic photograph measuring program
JP5925109B2 (en) Image processing apparatus, control method thereof, and control program
US20170069109A1 (en) Method and apparatus for measuring an object
WO2018161322A1 (en) Depth-based image processing method, processing device and electronic device
KR101010140B1 (en) Measuring system for a subject using geographic information system
CN115077468B (en) Zoom ranging method and device
CN111272070B (en) Structured light reference image acquisition device and 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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210907