CN112733678A - Ranging method, ranging device, computer equipment and storage medium - Google Patents

Ranging method, ranging device, computer equipment and storage medium Download PDF

Info

Publication number
CN112733678A
CN112733678A CN202011634520.XA CN202011634520A CN112733678A CN 112733678 A CN112733678 A CN 112733678A CN 202011634520 A CN202011634520 A CN 202011634520A CN 112733678 A CN112733678 A CN 112733678A
Authority
CN
China
Prior art keywords
target
preset
distance
acquisition point
original image
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
CN202011634520.XA
Other languages
Chinese (zh)
Inventor
陈海波
陈讯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenlan Artificial Intelligence Shenzhen Co Ltd
Original Assignee
Shenlan Artificial Intelligence Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenlan Artificial Intelligence Shenzhen Co Ltd filed Critical Shenlan Artificial Intelligence Shenzhen Co Ltd
Priority to CN202011634520.XA priority Critical patent/CN112733678A/en
Publication of CN112733678A publication Critical patent/CN112733678A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/56Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30248Vehicle exterior or interior
    • G06T2207/30252Vehicle exterior; Vicinity of vehicle
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application relates to the technical field of image processing and laser ranging, and provides a ranging method, a ranging device, computer equipment and a storage medium, wherein the ranging method comprises the following steps: acquiring original image data of a target scene through a target camera; determining an interest region in the original image data according to a preset interest region determination rule; carrying out target detection on the interest area to obtain a target object in the original image data; carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to the aerial view; and acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and the preset transformation ratio. By means of the method and the device, the success rate of target detection is improved through the fine detection of the target in the interest area; and the target detection, the target tracking and the target ranging can be realized by combining a monocular perception algorithm, and the scheme has low cost.

Description

Ranging method, ranging device, computer equipment and storage medium
Technical Field
The present application relates to the field of image processing and laser ranging technologies, and in particular, to a ranging method, apparatus, computer device, and storage medium.
Background
Under the scene of automatic driving or anti-collision (pedestrian protection) of a vehicle, the distance between the vehicle and a target object (a front vehicle, a pedestrian and a lane line) needs to be measured, and the distance measurement methods commonly adopted in the prior art include methods of multi-sensor fusion, camera fusion, millimeter wave radar or laser radar and the like.
Multi-sensor information fusion (MSIF) is an information processing process that uses computer technology to automatically analyze and integrate information and data from multiple sensors or multiple sources under certain criteria to complete needed decision and estimation.
The traditional multi-camera fusion method only adopts an image sensor mode, a laser scanning range finder is introduced to obtain point cloud data of a scene on the basis of obtaining image information by using the image sensor, depth information of the scene is obtained by using the point cloud data, focusing depth is selected according to the depth information, time complexity is reduced, and therefore distance measurement is achieved.
The method for realizing target perception and distance measurement at the intersection by multi-sensor fusion, camera fusion, millimeter wave radar or laser radar has the problems of high cost and difficulty in solving time synchronization among the sensors.
Disclosure of Invention
The application provides a distance measuring method, a distance measuring device, computer equipment and a storage medium, so as to realize low-cost distance measurement.
The application provides a distance measurement method, which comprises the following steps:
acquiring, by a target camera disposed on a target vehicle, raw image data of a target scene;
determining an interest region in the original image data according to a preset interest region determination rule;
carrying out target detection on the interest area to obtain a target object in the original image data;
carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to a bird's-eye view;
and acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
According to the distance measuring method provided by the application, the preset transformation ratio comprises a preset transverse transformation ratio and a preset longitudinal transformation ratio, the preset lateral transformation ratio is obtained based on a lateral pixel distance and a lateral real distance on the aerial view, the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance on the aerial view, the lateral pixel distance is the pixel distance of the first preset acquisition point and the third preset acquisition point in the aerial view in the X-axis direction, the transverse real distance is the actual distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction, the longitudinal pixel distance is a pixel distance of a second preset acquisition point and a third preset acquisition point in the aerial view in the Y-axis direction, the longitudinal real distance is the actual distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction.
According to the ranging method provided by the application, the preset transformation scale represents the proportional transformation relation between the aerial view and the real world.
According to the distance measuring method provided by the application, the preset transverse transformation ratio is obtained based on the transverse pixel distance and the transverse true distance, and the calculation formula is as follows:
kx=X/x,
wherein k isxRepresenting the preset horizontal transformation scale, X representing the horizontal real distance, and X representing the horizontal pixel distance;
the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance, and the calculation formula is as follows:
ky=Y/y,
wherein k isyRepresenting said preset longitudinal transformation ratio, Y tableThe vertical true distance is shown and y represents the vertical pixel distance.
According to a distance measurement method provided by the present application, determining an interest region in the original image data according to a preset interest region determination rule includes:
predicting a running area of the target vehicle according to the steering angle of the target vehicle to obtain a preliminary prediction area;
projecting the preliminary prediction region to the original image data according to the internal reference and the external reference of the target camera, and determining a predicted driving region in the original image data;
and determining an interest area in the original image data according to the predicted driving area and the preset image area.
According to the distance measuring method provided by the application, the step of predicting the running area of the target vehicle according to the steering angle of the target vehicle and acquiring a preliminary prediction area comprises the following steps:
acquiring a steering angle of the target vehicle;
and predicting a running boundary line of the target vehicle according to the steering angle by taking the current position of the target vehicle as an initial position, and determining the preliminary prediction region according to the running boundary line obtained through prediction.
The present application further provides a distance measuring device, including:
an original image acquisition module for acquiring original image data of a target scene by a target camera, the target camera being arranged on a target vehicle;
the interest area determining module is used for determining an interest area in the original image data according to a preset interest area determining rule;
the target detection module is used for carrying out target detection on the interest area to obtain a target object in the original image data;
the target tracking module is used for carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data and converting the motion track to a bird's eye view;
and the distance measuring module is used for acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
According to the application, a distance measuring device further comprises: the preset transformation ratio comprises a preset transverse transformation ratio and a preset longitudinal transformation ratio, the preset transverse transformation ratio is obtained based on the transverse pixel distance and the transverse real distance on the aerial view, the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance on the aerial view, the lateral pixel distance is the pixel distance of the first preset acquisition point and the third preset acquisition point in the aerial view in the X-axis direction, the transverse real distance is the actual distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction, the longitudinal pixel distance is a pixel distance of a second preset acquisition point and a third preset acquisition point in the aerial view in the Y-axis direction, the longitudinal real distance is the actual distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction.
The application further provides a vehicle, including above-mentioned range unit.
The present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the ranging method according to any one of the above methods when executing the computer program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the ranging method as described in any of the above.
According to the distance measuring method, the distance measuring device, the computer equipment and the storage medium, the interest area in the original image data is determined, the target detection is carried out on the interest area, the fine detection of the target in the interest area is realized, and the success rate of the target detection is improved; and only a camera needs to be arranged on the target vehicle, and a monocular perception algorithm is combined, so that target detection, target tracking and target ranging can be realized, and the scheme is low in cost.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a ranging method provided in the present application;
FIG. 2 is a schematic diagram illustrating an offline calibration of an aerial view according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a distance measuring device provided in the present application;
fig. 4 is a schematic physical structure diagram of an electronic device provided in the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Another prior art is a prior art based on visual monocular distance measurement, a target distance can be calculated through a camera installation height, an angle and camera internal parameters, or a distance can be directly estimated through a neural network, but the distance is calculated through the camera height angle and the internal parameters, the ground is flat, if a slope occurs, the distance calculation is deviated, the monocular distance can be recovered through a depth learning algorithm, but the calculation amount is large, and the data labeling process is difficult.
As shown in fig. 1, a distance measurement method provided in an embodiment of the present application includes:
110, acquiring raw image data of a target scene by a target camera, the target camera being arranged in a target vehicle;
in the embodiment of the application, the target camera is generally fixed on the target vehicle, and the target scene is shot by the target camera under the condition that the target camera is fixed, so that original image data of the target scene is obtained.
The target camera here may include various color cameras or black and white cameras, such as RGB color cameras, and accordingly, the acquired raw image data is a color image.
120, determining an interest region in the original image data according to a preset interest region determination rule;
the interest area refers to an area in which a user is interested or needs to pay attention, and taking intelligent driving as an example, the interest area may be a related area to which an automobile may travel at the next moment.
In this embodiment, a ROI (region of interest) determination rule is pre-configured, and a corresponding ROI is determined in the original image data based on the preset region of interest determination rule, so as to perform further refined target detection on the ROI.
130, performing target detection on the interest region to obtain a target object in the original image data;
and carrying out target detection on the interest area, detecting each target object in the interest area, and obtaining the position of each target object, wherein the target object can be a moving object or a static object, and comprises a pedestrian, a vehicle and a traffic line.
For common target detection algorithms, almost all the most advanced target detection algorithms at present are based on deep learning, and the algorithms can be mainly divided into two categories: a two-stage (two stage) target detection algorithm and a one-stage (one stage) target detection algorithm.
The two-stage algorithm may also be called a candidate region (region pro-posal) based algorithm. The algorithm firstly processes an input picture to find candidate regions possibly containing target objects, and then uses a classifier to classify the target objects on the candidate regions.
The single-stage target detection algorithm does not need to generate a candidate region, and a target detection result can be directly obtained from the picture. The earliest single-stage target detection algorithm starts from a neural network-based object recognition and positioning algorithm (YOLO for short), and the YOLO can simultaneously obtain the position and the category of a target object by processing a picture Only Once.
140, performing target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to a bird's eye view;
and then tracking each target object in the original image data to obtain a motion track of each target object on the original image data.
The track tracking of the moving target is an indispensable link in a video monitoring system, the tracking of the target object can be generally divided into two parts, namely feature extraction and target tracking, wherein the extracted target features can be roughly divided into the following parts:
(1) the color histogram of the target area is used as a feature, and the color feature has rotation invariance, is not influenced by the change of the size and the shape of the target object, and is approximately distributed in the color space.
(2) The contour characteristic of the target is high in algorithm speed, and the method has a good effect under the condition that the target is partially shielded.
(3) The tracking effect of the texture features of the target is improved compared with the tracking effect of the contour features.
The target tracking algorithm can be roughly divided into the following four algorithms:
(1) the method can quickly find the position most similar to the target through fewer iteration times, and the effect is good. It does not solve the problem of occlusion of the target and does not adapt to changes in shape and size of the target object, etc. The improved algorithm has a self-adaptive mean shift (camshift) algorithm, the method can adapt to the change of the size and the shape of a target object, and has a good tracking effect, but when the background color and the target color are close to each other, the area of the target is easy to be enlarged, and finally the target tracking loss is possibly caused.
(2) Target tracking based on Kalman (Kalman) filtering, the method is to consider a motion model of an object to obey a Gaussian model to predict the motion state of a target, and then to update the state of a target object according to errors by comparing with an observation model, and the precision of the algorithm is not very high.
(3) And (3) resampling the distribution of the particles through the current tracking result every time based on the target tracking of the particle filtering, diffusing the particles according to the distribution of the particles, re-observing the state of the target through the diffusion result, and finally normalizing and updating the state of the target. The algorithm has the characteristics of extremely high tracking speed, can solve the problem of partial shielding of the target, and is increasingly used in the process of practical engineering application.
(4) Based on a method of modeling a target object. The method needs to know what the tracked target object is in advance through a priori knowledge, such as a vehicle, a pedestrian, a human face and the like. The actual tracking is performed by modeling the target to be tracked and then reusing the model. The method has the defects that the target object to be tracked must be known in advance, and then the specified target object is tracked, so that the popularization is relatively poor.
Conventional trajectory tracking algorithms, such as particle filter algorithms and contour-based object tracking algorithms, can achieve better object tracking effects.
The method can adopt target tracking based on particle filtering and tracking based on contour, wherein the target tracking based on particle filtering comprises a stage of initializing and extracting target object characteristics, a characteristic search stage, a decision stage and a particle resampling stage; the outline-based tracking algorithm provides more accurate shape description, and the main idea of the method is to find a target area of a current frame by using a target model established in a previous frame, wherein the model can be a color histogram, an edge or an outline of the target area. Contour-based object tracking methods can be broadly classified into shape matching, contour tracking. The former searches for the characteristics of the target in the current frame, and the latter deduces the position of the initial contour in the current frame through a state space model or a direct minimum energy function.
The target object tracking algorithm in the embodiment of the present application may be a particle filter-based target tracking algorithm or a contour-based tracking algorithm, and may be specifically selected according to actual requirements, which is not limited herein.
And 150, acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
Acquiring a tracking track of each target object on original image data, transforming the tracking track of the target object on the original image data to a bird's-eye view corresponding to a target scene, namely acquiring the tracking track of the target object on the bird's-eye view, and calculating an actual distance between each target object and a target camera by combining a preset transformation ratio, wherein the preset transformation ratio represents a proportional corresponding relation between the bird's-eye view and a real world.
The actual distance refers to the actual distance from a certain point of the motion trail to the target camera.
The embodiment of the application solves the problems of target sensing and distance measurement in the information exchange scene from the vehicle to the outside, and realizes target detection, target tracking and target distance measurement by arranging the target camera on the target vehicle and combining a monocular sensing algorithm, and sends a sensing result to the vehicle to realize the interaction between the vehicle and the outside information.
According to the distance measuring method, the interest area in the original image data is determined, the target detection is carried out on the interest area, the target in the interest area is finely detected, and the success rate of the target detection is improved; and only a camera needs to be arranged on the target vehicle, and a monocular perception algorithm is combined, so that target detection, target tracking and target ranging can be realized, and the scheme is low in cost.
On the basis of the above embodiment, preferably, the preset transformation ratio includes a preset transverse transformation ratio and a preset longitudinal transformation ratio, the preset lateral transformation ratio is obtained based on a lateral pixel distance and a lateral real distance on the aerial view, the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance on the aerial view, the lateral pixel distance is the pixel distance of the first preset acquisition point and the third preset acquisition point in the aerial view in the X-axis direction, the transverse real distance is the actual distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction, the longitudinal pixel distance is a pixel distance of a second preset acquisition point and a third preset acquisition point in the aerial view in the Y-axis direction, the longitudinal real distance is the actual distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction.
Specifically, before offline calibration work is performed, a first preset acquisition point, a second preset acquisition point and a third preset acquisition point are calibrated in the real world randomly or according to a certain rule, and an actual distance between the first preset acquisition point and the third preset acquisition point and an actual distance between the second preset acquisition point and the third preset acquisition point in the real world are measured. By using the three acquisition points as measurement tags, in a normal situation, the first preset acquisition point and the third preset acquisition point are positioned on a horizontal line, the second preset acquisition point and the third preset acquisition point are positioned on a vertical line, the first preset acquisition point, the second preset acquisition point and the third preset acquisition point form a right triangle, the second preset acquisition point is a right-angle vertex of the right triangle, and the first preset acquisition point and the third preset acquisition point are the remaining two vertexes.
In the corresponding aerial view, the transverse pixel distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction is calculated, and then the longitudinal pixel distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction is calculated.
And measuring the true distance between the first preset acquisition point and the third preset acquisition point, namely the transverse true distance, and measuring the true distance between the second preset acquisition point and the third preset acquisition point, namely the longitudinal true distance.
And then, calculating a preset transverse transformation ratio based on the transverse pixel distance and the transverse real distance.
Specifically, in the embodiment of the present application, the horizontal true distance is divided by the horizontal pixel distance, and the preset horizontal transformation ratio is calculated.
And then, calculating a preset longitudinal transformation ratio based on the longitudinal pixel distance and the longitudinal real distance.
In the embodiment of the application, the longitudinal true distance is divided by the longitudinal pixel distance to obtain the preset longitudinal transformation ratio.
On the basis of the above embodiment, preferably, the preset transformation scale represents a scaling transformation relationship between the bird's eye view and the real world.
Specifically, as shown in fig. 2, for convenience of calibration, the bird's eye view is a perspective view drawn by looking down the ground relief from a certain point at a high altitude by a high viewpoint perspective method according to the perspective principle. Simply, looking down an area in the air, the image is more realistic than a plan view.
The preset transformation scale in the embodiment of the invention represents a scaling relationship between the bird's-eye view and the real world, which is scaled up or down.
In conclusion, the accurate monocular distance measuring effect can be achieved through simple data offline calibration in the embodiment of the application.
On the basis of the foregoing embodiment, preferably, the preset lateral transformation ratio is obtained based on the lateral pixel distance and the lateral true distance, and the calculation formula is as follows:
kx=X/x,
wherein k isxRepresenting the preset horizontal transformation scale, X representing the horizontal real distance, and X representing the horizontal pixel distance;
specifically, by dividing the lateral true distance by the lateral pixel distance, a value of the preset lateral transformation ratio can be obtained.
The preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance, and the calculation formula is as follows:
ky=Y/y,
wherein k isyRepresenting the preset longitudinal transformation scale, Y representing the longitudinal true distance, and Y representing the longitudinal pixel distance.
Specifically, the preset vertical transformation ratio can be obtained by dividing the vertical true distance by the vertical pixel distance.
On the basis of the foregoing embodiment, preferably, the performing target detection on the interest region to obtain the target object in the interest region specifically includes:
and carrying out target detection on the interest region based on an object identification and positioning algorithm of a neural network to obtain each target object in the interest region.
The object recognition and positioning algorithm based on the neural network refers to the aforementioned YOLO algorithm, and the maximum advantage of the YOLO is that the operation speed is very fast, and compared with the previous two-stage target detection algorithm, the speed of the YOLO has obvious advantages.
On the basis of the foregoing embodiment, preferably, performing target tracking on the target object to obtain a motion trajectory of the target object on the original image data includes:
and performing target detection on the original image data based on a multi-target tracking algorithm to obtain a target object in the original image data.
Specifically, based on the multi-target tracking algorithm, the multi-target tracking algorithm may be the aforementioned target tracking algorithm based on particle filtering, or may also be a target tracking algorithm based on a contour, which may be specifically selected according to actual needs, and the embodiment of the present application is not specifically limited herein.
On the basis of the foregoing embodiment, preferably, the determining the region of interest in the original image data according to a preset region of interest determination rule includes:
predicting a running area of the target vehicle according to the steering angle of the target vehicle to obtain a preliminary prediction area;
projecting the preliminary prediction region to the original image data according to the internal reference and the external reference of the target camera, and determining a predicted driving region in the original image data;
and determining an interest area in the original image data according to the predicted driving area and the preset image area.
The predicted travel area is an area where the target vehicle is likely to travel after the raw image data is acquired.
In the present embodiment, the prediction target vehicle predicts the travel region in the original image according to a preset prediction rule. The preset rule may be any method for predicting the travel area of the target vehicle. For example, the preset rule may be a method of predicting according to the steering angle of the target vehicle or a method of predicting according to the lane line.
Since the predicted driving area extends through the entire original image, in order to determine a smaller and currently more important interest area according to the predicted driving area, it is necessary to set an image preset area so as to determine the interest area according to an overlapping portion of the predicted driving area and the image preset area. The preset image area refers to a fixed position area in an empirically obtained image, and the determination rule of the preset image area is included in the determination rule of the region of interest.
The steering angle is a traveling direction of the target vehicle with respect to the world coordinate system. Generally, the world coordinate system is established with the target vehicle as a standard, such as with the center of the target vehicle as the origin, and specifies three axis directions. In an intelligent driving automobile, a world coordinate system is established by taking an automobile body as a standard, and a steering angle is specifically a driving direction angle of a front wheel relative to the world coordinate system.
Since the steering angle reflects the traveling direction of the target vehicle to some extent, the traveling direction of the target vehicle is predicted from the steering angle of the target vehicle, and a preliminary prediction region in the world coordinate system is obtained from the current position of the traveling vehicle and the predicted traveling direction. It will be appreciated that the current position and the predicted direction of travel are relative to the world coordinate system.
And further projecting the preliminary prediction region to the original image according to the internal reference and the external reference of the target camera, wherein the projection region of the preliminary prediction region in the original image is the predicted driving region. The external parameters comprise parameters such as the position and the orientation of the target camera in a world coordinate system and are used for converting world coordinates into target camera coordinates; the internal parameters comprise parameters such as focal length and distortion of the target camera, and are used for converting the target camera coordinates into image coordinates.
It is understood that the world coordinates are coordinates in a world coordinate system, the target camera coordinates are coordinates in a target camera, and the image coordinates are coordinates in an image coordinate system. In the three coordinate systems, a world coordinate system and a target camera coordinate system are three-dimensional coordinate systems, wherein the target camera coordinate system is established by taking a target camera as a standard, and the world coordinate system can be converted into the target camera coordinate system through translation and rotation; the image coordinate system refers to a two-dimensional coordinate system established on an imaging plane, namely a pixel coordinate system of an original image.
In a specific embodiment, each point in the preliminary prediction region is projected to a point determined in the imaging plane through internal reference and external reference of the target camera, and a projection region formed by each projection point is used as a predicted driving region in the original image.
In another specific embodiment, each point on the boundary line of the preliminary prediction region may be projected to a point determined in the imaging plane by internal reference and external reference of the target camera, a projected boundary line composed of each projected point may be used as the boundary line of the predicted driving region in the original image, and the predicted driving region may be determined from the boundary line of the predicted driving region.
On the basis of the foregoing embodiment, preferably, the predicting a travel region of the target vehicle according to the steering angle of the target vehicle, and acquiring a preliminary prediction region includes:
acquiring a steering angle of the target vehicle;
and predicting a running boundary line of the target vehicle according to the steering angle by taking the current position of the target vehicle as an initial position, and determining the preliminary prediction region according to the running boundary line obtained through prediction.
The steering angle may be detected by a steering angle sensor mounted on the target vehicle, and the current position of the target vehicle includes starting positions of both sides of the target vehicle when the original image is captured, for example, the current position of the target vehicle includes positions of front wheels of both sides when the original image is captured.
Specifically, the steering angle detected by the steering angle sensor is acquired, starting positions on two sides of the target vehicle are respectively used as starting positions, straight lines are made according to the steering angle, the two obtained straight lines are predicted driving boundary lines, and an area between the two driving boundary lines is a preliminary prediction area. The driving boundary line is predicted by using the steering angle and the current position of the target vehicle, a preliminary prediction area can be rapidly and accurately determined, and the preliminary prediction area is further projected into the original image to obtain a predicted driving area in the original image.
The present application provides a ranging apparatus, as shown in fig. 3, the apparatus includes an original image acquisition module 301, an interest region determination module 302, a target detection module 303, a target tracking module 304, and a distance measurement module 305, wherein:
the original image acquisition module 301 is configured to acquire original image data of a target scene through a target camera, where the target camera is disposed on a target vehicle;
the interest region determining module 302 is configured to determine an interest region in the original image data according to a preset interest region determining rule;
the target detection module 303 is configured to perform target detection on the interest region to obtain a target object in the original image data;
the target tracking module 304 is configured to perform target tracking on the target object, acquire a motion trajectory of the target object on the original image data, and convert the motion trajectory to a bird's eye view;
the distance measuring module 305 is configured to obtain an actual distance between the target object and the target camera according to a motion trajectory of the target object on the bird's eye view and a preset transformation ratio.
The original image acquisition module 301 acquires original image data of a target scene through a target camera and sends the original image data to the interest area determination module 302, the interest area determination module 302 obtains an interest area in the original image data according to a predetermined interest area rule and sends the interest area to the target detection module 303, the target detection module 303 performs target detection on the interest area to detect a target object in the interest area and sends the detected target object to the target tracking module 304, the target tracking module 304 tracks each target object to obtain a motion track of the target object and converts the motion track to a bird's-eye view, and the distance measurement module 305 obtains an actual distance between the target object and the target camera according to the motion track of the target object on the bird's-eye view in combination with a preset transformation ratio.
The present embodiment is an embodiment of an apparatus corresponding to the method described above, and please refer to the embodiment of the method for details, wherein a specific implementation manner of the embodiment of the method is consistent with that described in the embodiment of the method, and the embodiment of the apparatus is not described herein again.
On the basis of the above embodiment, it is preferable to further include: the preset transformation ratio comprises a preset transverse transformation ratio and a preset longitudinal transformation ratio, the preset transverse transformation ratio is obtained based on the transverse pixel distance and the transverse real distance on the aerial view, the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance on the aerial view, the lateral pixel distance is the pixel distance of the first preset acquisition point and the third preset acquisition point in the aerial view in the X-axis direction, the transverse real distance is the actual distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction, the longitudinal pixel distance is a pixel distance of a second preset acquisition point and a third preset acquisition point in the aerial view in the Y-axis direction, the longitudinal real distance is the actual distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction.
Specifically, before offline calibration work is performed, a first preset acquisition point, a second preset acquisition point and a third preset acquisition point are calibrated in the real world, and an actual distance between the first preset acquisition point and the third preset acquisition point and an actual distance between the second preset acquisition point and the third preset acquisition point in the real world are measured. By using the three acquisition points as measurement tags, in a normal situation, the first preset acquisition point and the third preset acquisition point are positioned on a horizontal line, the second preset acquisition point and the third preset acquisition point are positioned on a vertical line, the first preset acquisition point, the second preset acquisition point and the third preset acquisition point form a right triangle, the second preset acquisition point is a right-angle vertex of the right triangle, and the first preset acquisition point and the third preset acquisition point are the remaining two vertexes.
In the corresponding aerial view, the transverse pixel distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction is calculated, and then the longitudinal pixel distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction is calculated.
And measuring the true distance between the first preset acquisition point and the third preset acquisition point, namely the transverse true distance, and measuring the true distance between the second preset acquisition point and the third preset acquisition point, namely the longitudinal true distance.
On the basis of the above embodiment, preferably, the preset transformation scale represents a scaling transformation relationship between the bird's eye view and the real world.
For convenience of calibration, the bird's eye view is a perspective view drawn by looking down the ground from a certain point at a high altitude by a high viewpoint perspective method according to the perspective principle. Simply, looking down an area in the air, the image is more realistic than a plan view.
The preset transformation scale in the embodiment of the invention represents a scaling relationship between the bird's-eye view and the real world, which is scaled up or down.
The embodiment of the application also provides a vehicle, which comprises the distance measuring device, the distance measuring device is used for measuring the distance between the vehicle and an external target object, the distance is transmitted to the vehicle, the vehicle carries out subsequent application according to the distance, such as automatic driving or collision prevention and other operations, and interaction between the vehicle and external information is realized.
The present application provides an electronic device, as shown in fig. 4, the electronic device may include: a processor (processor)410, a communication Interface 420, a memory (memory)430 and a communication bus 440, wherein the processor 410, the communication Interface 420 and the memory 430 are communicated with each other via the communication bus 440. Processor 410 may invoke logic instructions in memory 430 to perform a ranging method comprising:
acquiring, by a target camera disposed on a target vehicle, raw image data of a target scene;
determining an interest region in the original image data according to a preset interest region determination rule;
carrying out target detection on the interest area to obtain a target object in the original image data;
carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to a bird's-eye view;
and acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
In addition, the logic instructions in the memory 430 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the ranging method provided by the above methods, the method comprising:
acquiring, by a target camera disposed on a target vehicle, raw image data of a target scene;
determining an interest region in the original image data according to a preset interest region determination rule;
carrying out target detection on the interest area to obtain a target object in the original image data;
carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to a bird's-eye view;
and acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
In yet another aspect, the present application also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor, is implemented to perform the ranging method provided above, the method comprising:
acquiring, by a target camera disposed on a target vehicle, raw image data of a target scene;
determining an interest region in the original image data according to a preset interest region determination rule;
carrying out target detection on the interest area to obtain a target object in the original image data;
carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to a bird's-eye view;
and acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (11)

1. A method of ranging, comprising:
acquiring, by a target camera disposed on a target vehicle, raw image data of a target scene;
determining an interest region in the original image data according to a preset interest region determination rule;
carrying out target detection on the interest area to obtain a target object in the original image data;
carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data, and converting the motion track to a bird's-eye view;
and acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
2. The ranging method according to claim 1, wherein the preset transformation ratio includes a preset transverse transformation ratio and a preset longitudinal transformation ratio, the preset lateral transformation ratio is obtained based on a lateral pixel distance and a lateral real distance on the aerial view, the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance on the aerial view, the lateral pixel distance is the pixel distance of the first preset acquisition point and the third preset acquisition point in the aerial view in the X-axis direction, the transverse real distance is the actual distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction, the longitudinal pixel distance is a pixel distance of a second preset acquisition point and a third preset acquisition point in the aerial view in the Y-axis direction, the longitudinal real distance is the actual distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction.
3. The ranging method according to claim 1, wherein the preset transformation scale represents a scaling transformation relationship between the bird's eye view and a real world.
4. A ranging method as claimed in claim 2 or 3, characterized in that said preset lateral transformation ratio is obtained based on the lateral pixel distance and the lateral true distance, and the calculation formula is as follows:
kx=X/x,
wherein k isxRepresenting the preset horizontal transformation scale, X representing the horizontal real distance, and X representing the horizontal pixel distance;
the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance, and the calculation formula is as follows:
ky=Y/y,
wherein k isyRepresenting the preset longitudinal transformation scale, Y representing the longitudinal true distance, and Y representing the longitudinal pixel distance.
5. The range finding method according to any one of claims 1 to 3, wherein the determining the region of interest in the original image data according to a preset region of interest determination rule comprises:
predicting a running area of the target vehicle according to the steering angle of the target vehicle to obtain a preliminary prediction area;
projecting the preliminary prediction region to the original image data according to the internal reference and the external reference of the target camera, and determining a predicted driving region in the original image data;
and determining an interest area in the original image data according to the predicted driving area and the preset image area.
6. The distance measuring method according to claim 5, wherein the predicting the travel area of the target vehicle from the steering angle of the target vehicle, obtaining a preliminary prediction area, comprises:
acquiring a steering angle of the target vehicle;
and predicting a running boundary line of the target vehicle according to the steering angle by taking the current position of the target vehicle as an initial position, and determining the preliminary prediction region according to the running boundary line obtained through prediction.
7. A ranging apparatus, comprising:
an original image acquisition module for acquiring original image data of a target scene by a target camera, the target camera being arranged on a target vehicle;
the interest area determining module is used for determining an interest area in the original image data according to a preset interest area determining rule;
the target detection module is used for carrying out target detection on the interest area to obtain a target object in the original image data;
the target tracking module is used for carrying out target tracking on the target object, acquiring a motion track of the target object on the original image data and converting the motion track to a bird's eye view;
and the distance measuring module is used for acquiring the actual distance between the target object and the target camera according to the motion track of the target object on the aerial view and a preset transformation ratio.
8. The ranging apparatus as claimed in claim 7, further comprising: the preset transformation ratio comprises a preset transverse transformation ratio and a preset longitudinal transformation ratio, the preset transverse transformation ratio is obtained based on the transverse pixel distance and the transverse real distance on the aerial view, the preset longitudinal transformation ratio is obtained based on the longitudinal pixel distance and the longitudinal true distance on the aerial view, the lateral pixel distance is the pixel distance of the first preset acquisition point and the third preset acquisition point in the aerial view in the X-axis direction, the transverse real distance is the actual distance between the first preset acquisition point and the third preset acquisition point in the X-axis direction, the longitudinal pixel distance is a pixel distance of a second preset acquisition point and a third preset acquisition point in the aerial view in the Y-axis direction, the longitudinal real distance is the actual distance between the second preset acquisition point and the third preset acquisition point in the Y-axis direction.
9. A vehicle comprising a ranging device according to claim 7 or 8.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the ranging method according to any of claims 1 to 6 are implemented when the processor executes the program.
11. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the ranging method according to any one of claims 1 to 6.
CN202011634520.XA 2020-12-31 2020-12-31 Ranging method, ranging device, computer equipment and storage medium Pending CN112733678A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011634520.XA CN112733678A (en) 2020-12-31 2020-12-31 Ranging method, ranging device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011634520.XA CN112733678A (en) 2020-12-31 2020-12-31 Ranging method, ranging device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112733678A true CN112733678A (en) 2021-04-30

Family

ID=75608709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011634520.XA Pending CN112733678A (en) 2020-12-31 2020-12-31 Ranging method, ranging device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112733678A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113643368A (en) * 2021-08-03 2021-11-12 嘉洋智慧安全生产科技发展(北京)有限公司 Method and device for determining real distance between objects and electronic equipment
CN116052121A (en) * 2023-01-28 2023-05-02 上海芯算极科技有限公司 Multi-sensing target detection fusion method and device based on distance estimation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609486A (en) * 2017-08-16 2018-01-19 中国地质大学(武汉) To anti-collision early warning method and system before a kind of vehicle
CN108957024A (en) * 2017-05-22 2018-12-07 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment of tachometric survey
CN111242118A (en) * 2018-11-29 2020-06-05 长沙智能驾驶研究院有限公司 Target detection method, target detection device, computer equipment and storage medium
CN111380503A (en) * 2020-05-29 2020-07-07 电子科技大学 Monocular camera ranging method adopting laser-assisted calibration
CN112132829A (en) * 2020-10-23 2020-12-25 北京百度网讯科技有限公司 Vehicle information detection method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108957024A (en) * 2017-05-22 2018-12-07 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment of tachometric survey
CN107609486A (en) * 2017-08-16 2018-01-19 中国地质大学(武汉) To anti-collision early warning method and system before a kind of vehicle
CN111242118A (en) * 2018-11-29 2020-06-05 长沙智能驾驶研究院有限公司 Target detection method, target detection device, computer equipment and storage medium
CN111380503A (en) * 2020-05-29 2020-07-07 电子科技大学 Monocular camera ranging method adopting laser-assisted calibration
CN112132829A (en) * 2020-10-23 2020-12-25 北京百度网讯科技有限公司 Vehicle information detection method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113643368A (en) * 2021-08-03 2021-11-12 嘉洋智慧安全生产科技发展(北京)有限公司 Method and device for determining real distance between objects and electronic equipment
CN116052121A (en) * 2023-01-28 2023-05-02 上海芯算极科技有限公司 Multi-sensing target detection fusion method and device based on distance estimation
CN116052121B (en) * 2023-01-28 2023-06-27 上海芯算极科技有限公司 Multi-sensing target detection fusion method and device based on distance estimation

Similar Documents

Publication Publication Date Title
US11320833B2 (en) Data processing method, apparatus and terminal
CN110163904B (en) Object labeling method, movement control method, device, equipment and storage medium
CN113156421A (en) Obstacle detection method based on information fusion of millimeter wave radar and camera
Erbs et al. Moving vehicle detection by optimal segmentation of the dynamic stixel world
CN114637023A (en) System and method for laser depth map sampling
US20210103299A1 (en) Obstacle avoidance method and device and movable platform
CN112825192B (en) Object identification system and method based on machine learning
WO2020029706A1 (en) Dummy lane line elimination method and apparatus
CN112683228A (en) Monocular camera ranging method and device
WO2021012254A1 (en) Target detection method, system, and mobile platform
CN111213153A (en) Target object motion state detection method, device and storage medium
CN115049700A (en) Target detection method and device
CN114495064A (en) Monocular depth estimation-based vehicle surrounding obstacle early warning method
Li et al. Road markings extraction based on threshold segmentation
CN112733678A (en) Ranging method, ranging device, computer equipment and storage medium
Xia et al. Vehicles overtaking detection using RGB-D data
CN113255444A (en) Training method of image recognition model, image recognition method and device
Rosero et al. Calibration and multi-sensor fusion for on-road obstacle detection
Fu et al. Camera-based semantic enhanced vehicle segmentation for planar lidar
CN114119729A (en) Obstacle identification method and device
Giosan et al. Superpixel-based obstacle segmentation from dense stereo urban traffic scenarios using intensity, depth and optical flow information
CN115147809B (en) Obstacle detection method, device, equipment and storage medium
Fries et al. Real-time unsupervised feature model generation for a vehicle following system
CN115327572A (en) Method for detecting obstacle in front of vehicle
CN114049542A (en) Fusion positioning method based on multiple sensors in dynamic scene

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