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.
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.