CN110458888A - Distance measuring method, device, storage medium and electronic equipment based on image - Google Patents

Distance measuring method, device, storage medium and electronic equipment based on image Download PDF

Info

Publication number
CN110458888A
CN110458888A CN201910668596.5A CN201910668596A CN110458888A CN 110458888 A CN110458888 A CN 110458888A CN 201910668596 A CN201910668596 A CN 201910668596A CN 110458888 A CN110458888 A CN 110458888A
Authority
CN
China
Prior art keywords
image
target object
length
range
target
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
CN201910668596.5A
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.)
Cloudminds Robotics Co Ltd
Original Assignee
Cloudminds Inc
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 Cloudminds Inc filed Critical Cloudminds Inc
Priority to CN201910668596.5A priority Critical patent/CN110458888A/en
Publication of CN110458888A publication Critical patent/CN110458888A/en
Pending legal-status Critical Current

Links

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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

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

Abstract

This disclosure relates to a kind of distance measuring method based on image, device, storage medium and electronic equipment, it is related to electronic measuring technology field, this method comprises: obtaining the image to be processed of the image acquisition device of terminal, according to preset recognizer, determine the band of position in image to be processed where target object, according to the parameter information of the size of preset target object, the band of position and image collecting device, the measurement distance between target object and terminal is determined.The disclosure can quickly, simply determine the distance between target object and terminal, calculation amount is small, and time delay is low, and only needs an image collecting device that ranging can be realized, and reduces hardware cost according to position of the target object in image to be processed.

Description

Distance measuring method, device, storage medium and electronic equipment based on image
Technical field
This disclosure relates to electronic measuring technology field, and in particular, to a kind of distance measuring method based on image, is deposited device Storage media and electronic equipment.
Background technique
With the continuous development of terminal technology, robot has been introduced into many technical fields, each to help people to complete Kind job task.For the robot that needs constantly move during the work time, for the task that preferably fulfils assignment, warp Often need robot measurement and preassigned target object (such as: can be the mankind, the product on production line, in house The distance between household electrical appliance etc.), so that it is determined that the position of target object.In the prior art, it is generally required that in robot It is provided at least two cameras while acquiring multiple image, and utilize the algorithm of stereoscopic vision (English: Stereo Vision) Carry out ranging, calculates complicated, hardware cost height.
Summary of the invention
Purpose of this disclosure is to provide a kind of distance measuring method based on image, device, storage medium and electronic equipment, to It is complicated to solve distance-measurement computation existing in the prior art, the high problem of hardware cost.
To achieve the goals above, according to the first aspect of the embodiments of the present disclosure, a kind of ranging side based on image is provided Method, which comprises
Obtain the image to be processed of the image acquisition device of terminal;
According to preset recognizer, the band of position in the image to be processed where target object is determined;
Believed according to the parameter of the size of the preset target object, the band of position and described image acquisition device Breath, determines the measurement distance between the target object and the terminal.
Optionally, described according to preset recognizer, determine the position in the image to be processed where target object Region, comprising:
According to the recognizer, identifies and whether there is the target object in the image to be processed;
If there are the target objects in the image to be processed, the band of position is determined.
Optionally, the parameter information includes the size of the sensitive chip of described image acquisition device, the figure to be processed The resolution ratio and image-forming range of picture, the image-forming range are between the camera lens optical center and imaging plane of described image acquisition device The focal length of distance or described image acquisition device;
The size according to the preset target object, the parameter of the band of position and described image acquisition device Information determines the measurement distance between the target object and the terminal, comprising:
Determine the first pixel quantity that the band of position includes in a first direction, the first direction be with it is described at As plane is parallel and perpendicular to the direction on ground, or direction that is parallel with the imaging plane and being parallel to ground;
According to the size of the target object, the first length of the target object in said first direction is determined;
According to the size of the resolution ratio and the sensitive chip, determine that the sensitive chip is right in said first direction The second length of the second pixel quantity and the sensitive chip answered in said first direction;
According to first pixel quantity, first length, second pixel quantity, second length and described Image-forming range, determines the target object and the target range of the terminal in this second direction, and the second direction is It is parallel to ground, and perpendicular to the direction of the imaging plane;
According to the target range, the measurement distance is determined.
Optionally, described according to first pixel quantity, first length, second pixel quantity, described Two length and the image-forming range determine the target object and the target range of the terminal in this second direction, packet It includes:
According to second pixel quantity, second length and the image-forming range, determined according to the first preset algorithm Normalize focal length;
First preset algorithm includes:
Wherein, f is the normalization focal length, and H is second pixel quantity, and OO' is the image-forming range, LimIt is described Second length;
It is true according to the second preset algorithm according to first pixel quantity, first length and the normalization focal length The fixed target range;
Second preset algorithm includes:
Wherein, OL is the target range, and AB is first length, hABFor first pixel quantity.
Optionally, described according to the target range, determine that the measurement distance includes:
Using the target range as the measurement distance;Or,
According to the target range, the image-forming range and third length, the measurement is determined according to third preset algorithm Distance, the third length are the center of the band of position and the center length in said first direction of the imaging plane Degree;
The third preset algorithm includes:
Wherein, OC is the measurement distance, and OL is the target range, and OO' is the image-forming range, and O'C' is described the Three length.
According to the second aspect of an embodiment of the present disclosure, a kind of range unit based on image is provided, described device includes:
Obtain module, the image to be processed of the image acquisition device for obtaining terminal;
Identification module, for determining the position in the image to be processed where target object according to preset recognizer Set region;
Range finder module, for being acquired according to the size of the preset target object, the band of position and described image The parameter information of device determines the measurement distance between the target object and the terminal.
Optionally, the identification module includes:
Submodule is identified, for identifying and whether there is the target in the image to be processed according to the recognizer Object;
Submodule is determined, if determining the band of position for there are the target objects in the image to be processed.
Optionally, the parameter information includes the size of the sensitive chip of described image acquisition device, the figure to be processed The resolution ratio and image-forming range of picture, the image-forming range are between the camera lens optical center and imaging plane of described image acquisition device The focal length of distance or described image acquisition device;
The range finder module includes:
First ranging submodule, the first pixel quantity for including in a first direction for determining the band of position, institute Stating first direction is direction with the imaging plane parallel and perpendicular to ground, or parallel with the imaging plane and be parallel to The direction on ground;
The first ranging submodule, is also used to the size according to the target object, determines the target object in institute State the first length on first direction;
The first ranging submodule, is also used to the size according to the resolution ratio and the sensitive chip, determine described in Sensitive chip in said first direction corresponding second pixel quantity and the sensitive chip in said first direction Two length;
Second ranging submodule, for according to first pixel quantity, first length, second pixel number Amount, second length and the image-forming range, determine the target object and the mesh of the terminal in this second direction Subject distance, the second direction is to be parallel to ground, and perpendicular to the direction of the imaging plane;
The second ranging submodule is also used to determine the measurement distance according to the target range.
Optionally, the second ranging submodule is used for:
According to second pixel quantity, second length and the image-forming range, determined according to the first preset algorithm Normalize focal length;
First preset algorithm includes:
Wherein, f is the normalization focal length, and H is second pixel quantity, and OO' is the image-forming range, LimIt is described Second length;
It is true according to the second preset algorithm according to first pixel quantity, first length and the normalization focal length The fixed target range;
Second preset algorithm includes:
Wherein, OL is the target range, and AB is first length, hABFor first pixel quantity.
Optionally, the second ranging submodule is used for:
Using the target range as the measurement distance;Or,
According to the target range, the image-forming range and third length, the measurement is determined according to third preset algorithm Distance, the third length are the center of the band of position and the center length in said first direction of the imaging plane Degree;
The third preset algorithm includes:
Wherein, OC is the measurement distance, and OL is the target range, and OO' is the image-forming range, and O'C' is described the Three length.
According to the third aspect of an embodiment of the present disclosure, a kind of computer readable storage medium is provided, calculating is stored thereon with The step of machine program, the distance measuring method based on image that realization first aspect provides when which is executed by processor.
According to a fourth aspect of embodiments of the present disclosure, a kind of electronic equipment is provided, comprising:
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, with realize first aspect provide based on The step of distance measuring method of image.
Through the above technical solutions, the disclosure obtains the image to be processed of image acquisition device first, later according to Preset recognizer identifies the band of position in image to be processed where target object, finally according to preset target object Size, the band of position and image collecting device parameter information, determine the measurement between target object and image collecting device Distance.The disclosure can quickly, simply determine target object and image according to position of the target object in image to be processed The distance between acquisition device, calculation amount is small, and time delay is low, and only needs an image collecting device that ranging can be realized, drop Low hardware cost.
Other feature and advantage of the disclosure will the following detailed description will be given in the detailed implementation section.
Detailed description of the invention
Attached drawing is and to constitute part of specification for providing further understanding of the disclosure, with following tool Body embodiment is used to explain the disclosure together, but does not constitute the limitation to the disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow chart of distance measuring method based on image shown according to an exemplary embodiment;
Fig. 2 is the positional diagram of image collecting device and target object in method according to Fig. 1;
Fig. 3 is the flow chart of another distance measuring method based on image shown according to an exemplary embodiment;
Fig. 4 is the flow chart of another distance measuring method based on image shown according to an exemplary embodiment;
Fig. 5 is position view of the target object on image to be processed in method according to Fig.4,;
Fig. 6 is a kind of block diagram of range unit based on image shown according to an exemplary embodiment;
Fig. 7 is the block diagram of another range unit based on image shown according to an exemplary embodiment;
Fig. 8 is the block diagram of another range unit based on image shown according to an exemplary embodiment;
Fig. 9 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Before the distance measuring method based on image, device, storage medium and the electronic equipment of disclosure offer are provided, first Application scenarios involved by each embodiment of the disclosure are introduced.Terminal, which can be, in the application scenarios any needs to move Robot, unmanned plane, vehicle etc., can be set an image collecting device in the terminal, which can be with It is camera or camera, for acquiring image to be processed.In physical environment locating for terminal, there are target objects, according to end Hold the difference of locating physical environment, target object for example can be the mankind, the product on production line, the household electrical appliance in house, Barrier etc. in road, target object can be preset by the user of using terminal, can also have terminal to automatically select.
Fig. 1 is a kind of flow chart of distance measuring method based on image shown according to an exemplary embodiment, such as Fig. 1 institute Show, method includes the following steps:
Step 101, the image to be processed of the image acquisition device of terminal is obtained.
Step 102, according to preset recognizer, the band of position in image to be processed where target object is determined.
For example, the image collecting device of terminal can acquire figure to be processed according to preset frequency acquisition, resolution ratio Whether picture identifies later according to preset recognizer comprising target object in image to be processed, if including in image to be processed Target object, then it is determined that the band of position of the target object in image to be processed.The band of position can be a coordinate range, Indicate the coordinate range of the band of position where target object in the coordinate system of image to be processed.Wherein, recognizer example It such as can be SSD (English: Single Shot MultiBox Detector, Chinese: the more box detectors of single-shot) algorithm, YOLO (English: You Only Look Once) algorithm or Faster-RCNN (English: Faster-Regions with Convolutional Neural Network features) image recognition algorithms such as algorithm.
Step 103, according to the parameter information of the size of preset target object, the band of position and image collecting device, really The measurement distance to set the goal between object and terminal.
It is exemplary, after determining the band of position, the position between target object and the center of image to be processed can be passed through The size for setting relationship and preset target object determines target object and terminal in conjunction with the parameter information of image collecting device Between measurement distance.Wherein, the size of target object, which can be, pre-sets, and user pre-selects target by terminal Object, it is determined that after target object, then the size of target object is also confirmable.The size of target object can be One fixed value, be also possible to target object size statistical characteristics (such as: according to the sample of a large amount of target objects, determine Target object size average value, median etc.), the mode that terminal obtains the size of target object can be a variety of: for example: user In selection target object, while the size of typing target object;Or it can be by plurality of target object and every kind of target object Corresponding size is stored in advance in the terminal in the way of table or chained list, after determining target object, passes through the side tabled look-up Formula determines the corresponding size of target object;It can also be the big of the target object that terminal is obtained from server or internet It is small.
Specifically, the parameter information of image collecting device for example may include the optical center position of the camera lens of image collecting device Set, the center of imaging plane, the resolution ratio of the image to be processed of image acquisition device, image collecting device it is photosensitive The size of chip.By taking positional diagram shown in Fig. 2 as an example, O is the optical center of camera lens, and O ' is the center of imaging plane, In, sensitive chip or the plane where sensor devices that imaging plane is image collecting device.A and B is respectively object For body perpendicular to the boundary point on the direction of ground, C is the center of target object, and according to pinhole imaging system principle, A ' and B ' are respectively The A and B of target object are by the optical center of camera lens, picture on imaging plane, and C ' is the C of target object by the optical center of camera lens, Picture on imaging plane.L for the extended line of AB and OO ' intersection point on straight line.Can so determine OL and OO ' ratio Value, and AB is identical as the ratio of A ' B ', thus can basis, the resolution ratio of image to be processed, size determine that target object exists Size (can be understood as A ' B ') on imaging plane, to further be determined according to the size of target object, the band of position Measurement distance between target object and terminal.Wherein, where measurement distance can be target object and camera lens between plane The distance between the optical center of camera lens (i.e. OC) is arrived at distance (i.e. OL), the center (i.e. point C) for being also possible to target object.
As soon as only needing width in the disclosure includes the image to be processed of target object, target object can be quickly and easily acquired The distance between terminal, without being equipped with additional hardware device for terminal, do not need yet to multiple image carry out coordinate conversion, The complicated calculations such as alignment, therefore calculation amount and time delay can be substantially reduced, be conducive to terminal and realize real time distance.Further, Image to be processed can also be handled according to preset algorithm, to obtain the azimuth angle theta and pitch angle ψ of target object, knot The measurement distance d determined in step 103 is closed, the positioning to target object may be implemented, it can obtain target object with mirror The optical center O of head is the coordinate (d, θ, ψ) that the spherical coordinate of coordinate origin is fastened.
In conclusion the disclosure obtains the image to be processed of the image acquisition device of terminal first, later according to pre- If recognizer, the band of position in image to be processed where target object is identified, finally according to preset target object Size, the band of position and image collecting device parameter information, determine the measurement distance between target object and terminal.The disclosure The distance between target object and terminal can be quickly, simply determined according to position of the target object in image to be processed, Calculation amount is small, and time delay is low, and only needs an image collecting device that ranging can be realized, and reduces hardware cost.
Fig. 3 is the flow chart of another distance measuring method based on image shown according to an exemplary embodiment, such as Fig. 3 institute Show, step 102 may include following implementations:
Step 1021, it according to recognizer, identifies in image to be processed with the presence or absence of target object.
Step 1022, if there are target objects in image to be processed, the band of position is determined.
For example, after image acquisition device to image to be processed, figure to be processed is identified first, in accordance with recognizer It whether there is target object as in, if there are target objects in image to be processed, then by target object in image to be processed The region at place is as the band of position.If target object is not present in image to be processed, indicate that current image to be processed is not necessarily to Ranging is carried out, step 101 can be back to, continue to obtain next image to be processed.
Fig. 4 is the flow chart of another distance measuring method based on image shown according to an exemplary embodiment, such as Fig. 4 institute Show, parameter information include the resolution ratio of image to be processed, image collecting device sensitive chip size and image-forming range, In, image-forming range is the distance between camera lens optical center and imaging plane of image collecting device, or is image collecting device Focal length.
The specific implementation of step 103 may include:
Step 1031, determine that the first pixel quantity that the band of position includes in a first direction, first direction are and imaging Direction of the plane parallel and perpendicular to ground, or direction that is parallel with imaging plane and being parallel to ground.
Step 1032, according to the size of target object, the first length of target object in a first direction is determined.
For example, first direction can be and imaging plane parallel and perpendicular to ground direction, be also possible to at As plane is parallel and is parallel to the direction on ground.By taking positional diagram shown in Fig. 2 as an example, first direction is flat with imaging Face parallel and perpendicular to ground direction (i.e. the direction of AB line), then the first length of target object in a first direction is For AB, by taking target object is face as an example, then AB indicates the length of face.Image to be processed (figure to be processed as shown in Figure 5 As the plane at place is imaging plane) on, dash area is target object in the band of position of image to be processed, a ' and b ' The projection of respectively A ' and B ' in a first direction, the length for being a ' b ' for the distance of the band of position in a first direction, into The pixel quantity that can be determined a ' b ' and include of one step.It can be by the shooting angle of control image collecting device, so that target Object with imaging plane be it is parallel, then a ' b '=A ' B ', then the pixel quantity that a ' b ' includes can be wrapped as A ' B ' The the first pixel quantity h containedAB
Step 1033, according to the size of resolution ratio and sensitive chip, sensitive chip in a first direction corresponding is determined The second length of two pixel quantities and sensitive chip in a first direction.
It is exemplary, according to the resolution ratio (W*H) of image to be processed and the size (L of sensitive chipin*Lim), it can determine sense Optical chip corresponding second pixel quantity and the second length in a first direction.Resolution ratio with image to be processed is 800*600 For, then indicating that sensitive chip can acquire 800 pixels on the direction for be parallel to ground, in the direction perpendicular to ground 600 pixels of upper acquisition.By taking the size of sensitive chip is 2.5cm*2cm as an example, then indicating that sensitive chip is being parallel to ground Length on the direction in face is 2.5cm, and the length on the flat direction perpendicular to ground is 2cm.If first direction is and imaging Plane is parallel and perpendicular to the direction on ground, then the second pixel quantity is 600, the second length is 2cm, i.e. the second pixel quantity For H, the second length is Lim, then, it is known thatIf first direction is parallel with imaging plane and is parallel to ground Direction, then the second pixel quantity is 800, the second length is 2.5cm, i.e. the second pixel quantity is W, and the second length is Lin
Step 1034, according to the first pixel quantity, the first length, the second pixel quantity, the second length and image-forming range, really Set the goal object and the target range of terminal in a second direction, and second direction is to be parallel to ground, and perpendicular to imaging plane Direction.
Step 1035, according to target range, measurement distance is determined.
Specifically, first direction is in imaging plane perpendicular to ground by taking positional diagram shown in Fig. 2 as an example Direction (i.e. the direction of AB line), then, it is known thatFurther, in conjunction withIt can obtain It arrives
Specifically, the target range in step 1034 can be divided into two steps to obtain:
Step A) according to the second pixel quantity, the second length and image-forming range, it determines and normalizes according to the first preset algorithm Focal length.
First preset algorithm includes:
Wherein, f is normalization focal length, and H is the second pixel quantity, and OO' is image-forming range, LimFor the second length.
Step B) according to the first pixel quantity, the first length and normalization focal length, target is determined according to the second preset algorithm Distance.
Second preset algorithm includes:
Wherein, OL is target range, and AB is the first length, hABFor the first pixel quantity.
In another implementation, step 1035 includes two kinds of implementations:
Mode one, using target range as measurement distance.Or,
Mode two determines measurement distance according to third preset algorithm according to target range, image-forming range and third length, Third length is the center of the band of position and the center length in a first direction of imaging plane.
Third preset algorithm includes:
Wherein, OC is measurement distance, and OL is target range, and OO' is image-forming range, and O'C' is third length.
Exemplary, when at a distance from measuring terminals are between target object, for a user, the distance of concern can divide For two classes, one kind is the distance between plane (i.e. OL) where target object and camera lens, using target object as face for, in order to It does not allow between people and terminal interfere with each other and leads to terminal cisco unity malfunction, while avoiding breaking down due to terminal yet, injury To people, therefore the distance between people and terminal can be limited, under the scene people between terminal at a distance from be OL.It is another kind of It is that the center (i.e. point C) of target object is arrived the distance between the optical center of camera lens (i.e. OC), such as in positioning application scenarios, is determined The azimuth of target object and pitch angle, in conjunction with the distance between terminal and target object both available target object with The optical center of camera lens is the coordinate that the spherical coordinate of coordinate origin is fastened, in this scenario, the distance between target object and terminal As OC.OL can be both determined by step 1034.
If user, can be directly by mesh in step 1035 it is desirable that the distance between plane where target object and camera lens Subject distance OL is exported as measurement distance, if user it is desirable that target object center between the optical center of camera lens away from From then can determine OC according to third preset algorithm.
By taking positional diagram shown in Fig. 2 as an example, first direction be imaging plane on perpendicular to ground direction (i.e. The direction of AB line), in right angled triangle OO ' C ', there is relationship between OO ', OC ' and O ' C ':And becauseUnder the premise of having acquired OL in step 1034, that Known to
In conclusion the disclosure obtains the image to be processed of the image acquisition device of terminal first, later according to pre- If recognizer, the band of position in image to be processed where target object is identified, finally according to preset target object Size, the band of position and image collecting device parameter information, determine the measurement distance between target object and terminal.The disclosure The distance between target object and terminal can be quickly, simply determined according to position of the target object in image to be processed, Calculation amount is small, and time delay is low, and only needs an image collecting device that ranging can be realized, and reduces hardware cost.
Fig. 6 is a kind of block diagram of range unit based on image shown according to an exemplary embodiment, as shown in fig. 6, The device 200 includes:
Obtain module 201, the image to be processed of the image acquisition device for obtaining terminal.
Identification module 202, for determining the position in image to be processed where target object according to preset recognizer Region.
Range finder module 203, for the parameter according to the size of preset target object, the band of position and image collecting device Information determines the measurement distance between target object and terminal.
Fig. 7 is the block diagram of another range unit based on image shown according to an exemplary embodiment, such as Fig. 7 institute Show, identification module 202 includes:
Submodule 2021 is identified, for according to recognizer, identifying in image to be processed with the presence or absence of target object.
Submodule 2022 is determined, if determining the band of position for there are target objects in image to be processed.
Fig. 8 is the block diagram of another range unit based on image shown according to an exemplary embodiment, such as Fig. 8 institute Show, parameter information include the resolution ratio of image to be processed, image collecting device sensitive chip size and image-forming range, In, image-forming range is the coke of the distance between camera lens optical center and imaging plane of image collecting device or image collecting device Away from.Range finder module 203 includes:
First ranging submodule 2031, the first pixel quantity for including in a first direction for determining the band of position, the One direction is and direction of the imaging plane parallel and perpendicular to ground or direction that is parallel with imaging plane and being parallel to ground.
First ranging submodule 2031, is also used to the size according to target object, determines target object in a first direction The first length.
First ranging submodule 2031 is also used to the size according to resolution ratio and sensitive chip, determines sensitive chip The second length of corresponding second pixel quantity and sensitive chip in a first direction on one direction.
Second ranging submodule 2032, for according to the first pixel quantity, the first length, the second pixel quantity, the second length Degree and image-forming range, determine target object and the target range of terminal in a second direction, second direction to be parallel to ground, and Perpendicular to the direction of imaging plane.
Second ranging submodule 2032 is also used to determine measurement distance according to target range.
Specifically, the second ranging submodule 2032 can be used for executing following steps:
Step A) according to the second pixel quantity, the second length and image-forming range, it determines and normalizes according to the first preset algorithm Focal length.
First preset algorithm includes:
Wherein, f is normalization focal length, and H is the second pixel quantity, and OO' is image-forming range, LimFor the second length.
Step B) according to the first pixel quantity, the first length and normalization focal length, target is determined according to the second preset algorithm Distance.
Second preset algorithm includes:
Wherein, OL is target range, and AB is the first length, hABFor the first pixel quantity.
In another implementation, the second ranging submodule 2032 can be used for executing following steps:
Step C) using target range as measurement distance.Or,
Step D) according to target range, image-forming range and third length, measurement distance is determined according to third preset algorithm, the Three length are the center of the band of position and the center length in a first direction of imaging plane.
Third preset algorithm includes:
Wherein, OC is measurement distance, and OL is target range, and OO' is image-forming range, and O'C' is third length.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
In conclusion the disclosure obtains the image to be processed of the image acquisition device of terminal first, later according to pre- If recognizer, the band of position in image to be processed where target object is identified, finally according to preset target object Size, the band of position and image collecting device parameter information, determine the measurement distance between target object and terminal.The disclosure The distance between target object and terminal can be quickly, simply determined according to position of the target object in image to be processed, Calculation amount is small, and time delay is low, and only needs an image collecting device that ranging can be realized, and reduces hardware cost.
Fig. 9 is the block diagram of a kind of electronic equipment 300 shown according to an exemplary embodiment.As shown in figure 9, the electronics is set Standby 300 may include: processor 301, memory 302.The electronic equipment 300 can also include multimedia component 303, input/ Export one or more of (I/O) interface 304 and communication component 305.
Wherein, processor 301 is used to control the integrated operation of the electronic equipment 300, above-mentioned based on image to complete All or part of the steps in distance measuring method.Memory 302 is for storing various types of data to support in the electronic equipment 300 operation, these data for example may include any application or method for operating on the electronic equipment 300 Instruction and the relevant data of application program, such as contact data, the message of transmitting-receiving, picture, audio, video etc..This is deposited Reservoir 302 can realize by any kind of volatibility or non-volatile memory device or their combination, for example, it is static with Machine accesses memory (Static Random Access Memory, abbreviation SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, abbreviation EEPROM), erasable programmable Read-only memory (Erasable Programmable Read-Only Memory, abbreviation EPROM), programmable read only memory (Programmable Read-Only Memory, abbreviation PROM), and read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or CD.Multimedia component 303 may include screen and audio component.Wherein Screen for example can be touch screen, and audio component is used for output and/or input audio signal.For example, audio component may include One microphone, microphone is for receiving external audio signal.The received audio signal can be further stored in storage Device 302 is sent by communication component 305.Audio component further includes at least one loudspeaker, is used for output audio signal.I/O Interface 304 provides interface between processor 301 and other interface modules, other above-mentioned interface modules can be keyboard, mouse, Button etc..These buttons can be virtual push button or entity button.Communication component 305 is for the electronic equipment 300 and other Wired or wireless communication is carried out between equipment.Wireless communication, such as Wi-Fi, bluetooth, near-field communication (Near Field Communication, abbreviation NFC), 2G, 3G or 4G or they one or more of combination, therefore corresponding communication Component 305 may include: Wi-Fi module, bluetooth module, NFC module.
In one exemplary embodiment, electronic equipment 300 can be by one or more application specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device, Abbreviation DSPD), programmable logic device (Programmable Logic Device, abbreviation PLD), field programmable gate array (Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics member Part is realized, for executing the above-mentioned distance measuring method based on image.
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should The step of above-mentioned distance measuring method based on image is realized when program instruction is executed by processor.For example, this computer-readable is deposited Storage media can be the above-mentioned memory 302 including program instruction, and above procedure instruction can be by the processor of electronic equipment 300 301 execute to complete the above-mentioned distance measuring method based on image.
In a further exemplary embodiment, a kind of computer program product is also provided, which includes energy Enough computer programs executed by programmable device, which has uses when being executed by the programmable device In the code section for executing the above-mentioned distance measuring method based on image.
In conclusion the disclosure obtains the image to be processed of the image acquisition device of terminal first, later according to pre- If recognizer, the band of position in image to be processed where target object is identified, finally according to preset target object Size, the band of position and image collecting device parameter information, determine the measurement distance between target object and terminal.The disclosure The distance between target object and terminal can be quickly, simply determined according to position of the target object in image to be processed, Calculation amount is small, and time delay is low, and only needs an image collecting device that ranging can be realized, and reduces hardware cost.
The preferred embodiment of the disclosure is described in detail in conjunction with attached drawing above, still, the disclosure is not limited to above-mentioned reality The detail in mode is applied, in the range of the technology design of the disclosure, a variety of letters can be carried out to the technical solution of the disclosure Monotropic type, these simple variants belong to the protection scope of the disclosure.
It is further to note that specific technical features described in the above specific embodiments, in not lance In the case where shield, can be combined in any appropriate way, in order to avoid unnecessary repetition, the disclosure to it is various can No further explanation will be given for the combination of energy.
In addition, any combination can also be carried out between a variety of different embodiments of the disclosure, as long as it is without prejudice to originally Disclosed thought equally should be considered as disclosure disclosure of that.

Claims (12)

1. a kind of distance measuring method based on image, which is characterized in that the described method includes:
Obtain the image to be processed of the image acquisition device of terminal;
According to preset recognizer, the band of position in the image to be processed where target object is determined;
According to the size of the preset target object, the parameter information of the band of position and described image acquisition device, really Measurement distance between the fixed target object and the terminal.
2. determination is described wait locate the method according to claim 1, wherein described according to preset recognizer Manage the band of position in image where target object, comprising:
According to the recognizer, identifies and whether there is the target object in the image to be processed;
If there are the target objects in the image to be processed, the band of position is determined.
3. method according to claim 1 or 2, which is characterized in that the parameter information includes described image acquisition device Sensitive chip size, the resolution ratio and image-forming range of the image to be processed, the image-forming range be described image acquisition The focal length of the distance between camera lens optical center and imaging plane of device or described image acquisition device;
It is described to be believed according to the parameter of the size of the preset target object, the band of position and described image acquisition device Breath, determines the measurement distance between the target object and the terminal, comprising:
Determine that the first pixel quantity that the band of position includes in a first direction, the first direction are flat with the imaging Direction of the face parallel and perpendicular to ground, or direction that is parallel with the imaging plane and being parallel to ground;
According to the size of the target object, the first length of the target object in said first direction is determined;
According to the size of the resolution ratio and the sensitive chip, determine that the sensitive chip is corresponding in said first direction The second length of second pixel quantity and the sensitive chip in said first direction;
According to first pixel quantity, first length, second pixel quantity, second length and the imaging Distance, determines the target object and the target range of the terminal in this second direction, and the second direction is parallel In ground, and perpendicular to the direction of the imaging plane;
According to the target range, the measurement distance is determined.
4. according to the method described in claim 3, it is characterized in that, it is described according to first pixel quantity, it is described first long Degree, second pixel quantity, second length and the image-forming range determine the target object and the terminal in institute State the target range in second direction, comprising:
According to second pixel quantity, second length and the image-forming range, normalizing is determined according to the first preset algorithm Change focal length;
First preset algorithm includes:
Wherein, f is the normalization focal length, and H is second pixel quantity, and OO' is the image-forming range, LimIt is described second Length;
According to first pixel quantity, first length and the normalization focal length, institute is determined according to the second preset algorithm State target range;
Second preset algorithm includes:
Wherein, OL is the target range, and AB is first length, hABFor first pixel quantity.
5. according to the method described in claim 3, it is characterized in that, described according to the target range, determine the measurement away from From including:
Using the target range as the measurement distance;Or,
According to the target range, the image-forming range and third length, the measurement distance is determined according to third preset algorithm, The third length is the center of the band of position and the center length in said first direction of the imaging plane;
The third preset algorithm includes:
Wherein, OC is the measurement distance, and OL is the target range, and OO' is the image-forming range, and O'C' is that the third is long Degree.
6. a kind of range unit based on image, which is characterized in that described device includes:
Obtain module, the image to be processed of the image acquisition device for obtaining terminal;
Identification module, for determining the position area in the image to be processed where target object according to preset recognizer Domain;
Range finder module, for according to the size of the preset target object, the band of position and described image acquisition device Parameter information, determine the measurement distance between the target object and the terminal.
7. device according to claim 6, which is characterized in that the identification module includes:
Submodule is identified, for identifying and whether there is the target object in the image to be processed according to the recognizer;
Submodule is determined, if determining the band of position for there are the target objects in the image to be processed.
8. device according to claim 6 or 7, which is characterized in that the parameter information includes described image acquisition device Sensitive chip size, the resolution ratio and image-forming range of the image to be processed, the image-forming range be described image acquisition The focal length of the distance between camera lens optical center and imaging plane of device or described image acquisition device;
The range finder module includes:
First ranging submodule, the first pixel quantity for including in a first direction for determining the band of position, described One direction is with the imaging plane parallel and perpendicular to the direction on ground, or parallel with the imaging plane and be parallel to ground Direction;
The first ranging submodule, is also used to the size according to the target object, determines the target object described The first length on one direction;
The first ranging submodule, is also used to the size according to the resolution ratio and the sensitive chip, determines described photosensitive Chip corresponding second pixel quantity and the sensitive chip in said first direction second long in said first direction Degree;
Second ranging submodule, for according to first pixel quantity, first length, second pixel quantity, institute State the second length and the image-forming range, determine the target object and the target of the terminal in this second direction away from It is to be parallel to ground from, the second direction, and perpendicular to the direction of the imaging plane;
The second ranging submodule is also used to determine the measurement distance according to the target range.
9. device according to claim 8, which is characterized in that the second ranging submodule is used for:
According to second pixel quantity, second length and the image-forming range, normalizing is determined according to the first preset algorithm Change focal length;
First preset algorithm includes:
Wherein, f is the normalization focal length, and H is second pixel quantity, and OO' is the image-forming range, LimIt is described second Length;
According to first pixel quantity, first length and the normalization focal length, institute is determined according to the second preset algorithm State target range;
Second preset algorithm includes:
Wherein, OL is the target range, and AB is first length, hABFor first pixel quantity.
10. device according to claim 8, which is characterized in that the second ranging submodule is used for:
Using the target range as the measurement distance;Or,
According to the target range, the image-forming range and third length, the measurement distance is determined according to third preset algorithm, The third length is the center of the band of position and the center length in said first direction of the imaging plane;
The third preset algorithm includes:
Wherein, OC is the measurement distance, and OL is the target range, and OO' is the image-forming range, and O'C' is that the third is long Degree.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The step of any one of claim 1-5 the method is realized when execution.
12. a kind of electronic equipment characterized by comprising
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize described in any one of claim 1-5 The step of method.
CN201910668596.5A 2019-07-23 2019-07-23 Distance measuring method, device, storage medium and electronic equipment based on image Pending CN110458888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910668596.5A CN110458888A (en) 2019-07-23 2019-07-23 Distance measuring method, device, storage medium and electronic equipment based on image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910668596.5A CN110458888A (en) 2019-07-23 2019-07-23 Distance measuring method, device, storage medium and electronic equipment based on image

Publications (1)

Publication Number Publication Date
CN110458888A true CN110458888A (en) 2019-11-15

Family

ID=68483225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910668596.5A Pending CN110458888A (en) 2019-07-23 2019-07-23 Distance measuring method, device, storage medium and electronic equipment based on image

Country Status (1)

Country Link
CN (1) CN110458888A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111457895A (en) * 2020-03-31 2020-07-28 彩虹无人机科技有限公司 Target size calculation and display method for photoelectric load of unmanned aerial vehicle
CN111736140A (en) * 2020-06-15 2020-10-02 杭州海康微影传感科技有限公司 Object detection method and camera equipment
CN112102398A (en) * 2020-09-10 2020-12-18 腾讯科技(深圳)有限公司 Positioning method, device, equipment and storage medium
CN112584015A (en) * 2020-12-02 2021-03-30 达闼机器人有限公司 Object detection method, device, storage medium and electronic equipment
CN113838118A (en) * 2021-09-08 2021-12-24 杭州逗酷软件科技有限公司 Distance measuring method and device and electronic equipment
CN114111704A (en) * 2020-08-28 2022-03-01 华为技术有限公司 Method and device for measuring distance, electronic equipment and readable storage medium
WO2024103932A1 (en) * 2022-11-16 2024-05-23 腾讯科技(深圳)有限公司 Distance measurement method and apparatus, and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103063193A (en) * 2012-11-30 2013-04-24 青岛海信电器股份有限公司 Method and device for ranging by camera and television
CN104197901A (en) * 2014-09-19 2014-12-10 成都翼比特科技有限责任公司 Image distance measurement method based on marker
US20160154999A1 (en) * 2014-12-02 2016-06-02 Nokia Technologies Oy Objection recognition in a 3d scene
CN107509070A (en) * 2017-09-29 2017-12-22 歌尔科技有限公司 Three-dimensional image acquisition device and method
CN109489620A (en) * 2019-01-12 2019-03-19 内蒙古农业大学 A kind of monocular vision distance measuring method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103063193A (en) * 2012-11-30 2013-04-24 青岛海信电器股份有限公司 Method and device for ranging by camera and television
CN104197901A (en) * 2014-09-19 2014-12-10 成都翼比特科技有限责任公司 Image distance measurement method based on marker
US20160154999A1 (en) * 2014-12-02 2016-06-02 Nokia Technologies Oy Objection recognition in a 3d scene
CN107509070A (en) * 2017-09-29 2017-12-22 歌尔科技有限公司 Three-dimensional image acquisition device and method
CN109489620A (en) * 2019-01-12 2019-03-19 内蒙古农业大学 A kind of monocular vision distance measuring method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
冯莹莹等: "《智能监控视频中运动目标跟踪方法研究》", 30 June 2018, 吉林大学出版社 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111457895A (en) * 2020-03-31 2020-07-28 彩虹无人机科技有限公司 Target size calculation and display method for photoelectric load of unmanned aerial vehicle
CN111457895B (en) * 2020-03-31 2022-04-22 彩虹无人机科技有限公司 Target size calculation and display method for photoelectric load of unmanned aerial vehicle
CN111736140A (en) * 2020-06-15 2020-10-02 杭州海康微影传感科技有限公司 Object detection method and camera equipment
CN114111704A (en) * 2020-08-28 2022-03-01 华为技术有限公司 Method and device for measuring distance, electronic equipment and readable storage medium
WO2022042275A1 (en) * 2020-08-28 2022-03-03 华为技术有限公司 Distance measurement method, apparatus, electronic device, and readable storage medium
CN112102398A (en) * 2020-09-10 2020-12-18 腾讯科技(深圳)有限公司 Positioning method, device, equipment and storage medium
CN112584015A (en) * 2020-12-02 2021-03-30 达闼机器人有限公司 Object detection method, device, storage medium and electronic equipment
CN113838118A (en) * 2021-09-08 2021-12-24 杭州逗酷软件科技有限公司 Distance measuring method and device and electronic equipment
CN113838118B (en) * 2021-09-08 2024-07-09 杭州逗酷软件科技有限公司 Distance measurement method and device and electronic equipment
WO2024103932A1 (en) * 2022-11-16 2024-05-23 腾讯科技(深圳)有限公司 Distance measurement method and apparatus, and device and storage medium

Similar Documents

Publication Publication Date Title
CN110458888A (en) Distance measuring method, device, storage medium and electronic equipment based on image
JP6626954B2 (en) Imaging device and focus control method
US10061182B2 (en) Systems and methods for autofocus trigger
US10375377B2 (en) Information processing to generate depth information of an image
JP2021509515A (en) Distance measurement methods, intelligent control methods and devices, electronic devices and storage media
CN108401457A (en) A kind of control method of exposure, device and unmanned plane
KR20200139229A (en) Position and attitude estimation method, apparatus, electronic device and storage medium
KR102138845B1 (en) Device, system and method for providing auto-focus function based on object distance information
JP4813517B2 (en) Image processing apparatus, image processing program, image processing method, and electronic apparatus
KR20160028490A (en) Image processing apparatus, image processing method, and imaging system
CN108668086B (en) Automatic focusing method and device, storage medium and terminal
KR20200117562A (en) Electronic device, method, and computer readable medium for providing bokeh effect in video
CN110072078A (en) Monitor camera, the control method of monitor camera and storage medium
CN104104870B (en) Filming control method, imaging control device and capture apparatus
CN111489288A (en) Image splicing method and device
KR20220123218A (en) Target positioning method, apparatus, electronic device, storage medium and program
US20220086309A1 (en) Depth map determination method and electronic device to which same method is applied
CN112504473B (en) Fire detection method, device, equipment and computer readable storage medium
CN109242782A (en) Noise processing method and processing device
CN113959398B (en) Distance measurement method and device based on vision, drivable equipment and storage medium
CN109374919B (en) Method and device for determining moving speed based on single shooting device
CN112541940B (en) Article detection method and system
CN106101539A (en) A kind of self-shooting bar angle regulation method and self-shooting bar
KR20220018396A (en) Methods and apparatuses, systems, electronic devices, storage media and computer programs for associating objects
KR20200036264A (en) Method and electronic device for auto focusing

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
TA01 Transfer of patent application right

Effective date of registration: 20210303

Address after: 201111 2nd floor, building 2, no.1508, Kunyang Road, Minhang District, Shanghai

Applicant after: Dalu Robot Co.,Ltd.

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: Shenzhen Qianhaida Yunyun Intelligent Technology Co.,Ltd.

TA01 Transfer of patent application right
CB02 Change of applicant information

Address after: 201111 Building 8, No. 207, Zhongqing Road, Minhang District, Shanghai

Applicant after: Dayu robot Co.,Ltd.

Address before: 201111 2nd floor, building 2, no.1508, Kunyang Road, Minhang District, Shanghai

Applicant before: Dalu Robot Co.,Ltd.

CB02 Change of applicant information