A vehicle length measurement method and device based on monocular vision
Through the vehicle length measurement method based on monocular vision, image acquisition and processing technology are used to obtain the key feature points and segmentation mask of the vehicle, which solves the problems of easy confusion and high cost in model classification, and realizes accurate vehicle length measurement and efficient vehicle flow survey.
Patent Information
- Application Number
- CN202111138127.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-09-27
AI Technical Summary
In the prior art, vehicle model classification is easy to be confused and costly, and lidar-assisted length measurement method is expensive and difficult to promote on a large scale.
Using a vehicle length measurement method based on monocular vision, the vehicle's key feature points and segmentation mask are obtained through image acquisition, processing and analysis, and the actual length of the vehicle is calculated using this information.
It realizes contactless precise length measurement, reduces costs, improves vehicle length measurement efficiency, and helps vehicle type flow survey and analysis.
Smart Images

Figure CN113869407B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision, and particularly relates to a vehicle length measurement method and device based on monocular vision. Background Art
[0002] With the development of the national economy, the number of motor vehicles in China has increased rapidly, and road congestion often occurs. Traffic flow survey (TFS) data is an important reference index for studying highway capacity. To improve the service level of highways and better renovate and maintain them, it is urgent to strengthen the prediction research on TFS data.
[0003] Vehicle type classification statistics is an important part of TFS data. Currently, there are direct classification methods and lidar-assisted length measurement classification methods for vehicle type classification. The direct classification method uses a deep learning model to directly classify the captured vehicle images. Although it is simple and direct, similar vehicle types are prone to confusion. The lidar-assisted length measurement classification method uses two single-line lidar sensors to measure speed and distance, and indirectly calculates the vehicle length to classify vehicle types based on the vehicle length. However, lidar is expensive, and the solution is not easy to promote on a large scale. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to overcome the deficiencies of the prior art and provide a vehicle length measurement method and device based on monocular vision to solve the problems of easy confusion of vehicle types and high construction costs in vehicle type classification in the prior art.
[0005] According to the first aspect of the embodiments of the present application, a vehicle length measurement method based on monocular vision is provided. The method includes:
[0006] Collect a target image of the vehicle to be measured;
[0007] Process and analyze the target image to obtain key feature points and a segmentation mask of the vehicle to be measured;
[0008] Calculate the actual length of the vehicle to be measured using the key feature points and the segmentation mask of the vehicle to be measured.
[0009] Further, the collecting of the target image of the vehicle to be measured includes:
[0010] Collect an image of the vehicle to be measured at a specified position on the ground using an image acquisition device to obtain the target image.
[0011] Further, before collecting the target image of the vehicle to be measured, it further includes:
[0012] Calibrate the image acquisition device to obtain the internal and external parameter information of the image acquisition device.
[0013] Further, calibrating the image acquisition device to obtain the internal and external parameter information of the image acquisition device includes:
[0014] Using the image acquisition device to acquire calibration images of a standard black and white checkerboard calibration board in different poses, and based on the obtained calibration images, using the Zhang Zhengyou calibration method to calibrate the internal parameter information of the image acquisition device;
[0015] Installing and mounting the image acquisition device in a specified manner so that the field of view of the image acquisition device is opposite to the specified ground, measuring the installation height of the image acquisition device, and the distance from the proximal boundary of the field of view to the projection point of the device on the ground plane, and calculating the external parameter information of the image acquisition device according to the installation height and the distance.
[0016] Further, processing and analyzing the target image includes:
[0017] Preprocessing the target image;
[0018] Using a deep learning-based target key point detector to detect the preprocessed target image to obtain the key feature points and segmentation mask of the vehicle to be measured;
[0019] Among them, the key feature points of the vehicle to be measured include: the corner points of the vehicle head, the first hub center point on the visible side of the vehicle to be measured, and the second hub center point on the visible side of the vehicle to be measured; the segmentation mask is the area within the vehicle contour.
[0020] Further, preprocessing the target image includes:
[0021] Performing a scaling process on the target image to obtain an intermediate image that meets the input size requirements of the deep learning-based target key point detector;
[0022] Performing mean subtraction and variance division on the intermediate image to obtain the preprocessed target image.
[0023] Further, using a deep learning-based target key point detector to detect the preprocessed target image includes:
[0024] Using a deep learning-based target key point detector to detect the key feature points of the vehicle to be measured in the preprocessed target image, each key feature point of the vehicle to be measured corresponding to a heat map, and selecting the coordinates corresponding to the maximum value in each heat map as the coordinates of the key feature points of the vehicle to be measured; and
[0025] Using a deep learning-based target key point detector to process the preprocessed target image to obtain the segmentation mask of the vehicle to be measured.
[0026] Further, calculating the actual length of the vehicle under test by using the key feature points and the segmentation mask of the vehicle under test includes:
[0027] According to the scaling ratio during the scaling process of the target image, restore the coordinates of the key feature points of the vehicle under test to obtain the coordinates of the center point of the first wheel hub, the coordinates of the center point of the second wheel hub, and the coordinates of the head corner point;
[0028] Use the coordinates of the center point of the first wheel hub, the coordinates of the center point of the second wheel hub, and the segmentation mask to calculate the coordinates of the two contact points between the wheels of the vehicle under test and the ground, so as to obtain the straight line between the two contact points;
[0029] Determine the coordinates of the projection point P1 of the head corner point on the straight line between the two contact points according to the coordinates of the head corner point;
[0030] Use the segmentation mask of the vehicle under test to calculate the coordinates of the minimum circumscribed rectangle of the vehicle under test, and determine the coordinates of the boundary intersection point P2 between the straight line between the two contact points and the minimum circumscribed rectangle of the vehicle under test according to the coordinates of the minimum circumscribed rectangle of the vehicle under test;
[0031] Input the internal parameter and external parameter information of the vehicle under test, the coordinates of P1, and the coordinates of P2 into a preset BP neural network model to obtain the actual length of the vehicle under test.
[0032] According to the second aspect of the embodiments of the present application, a vehicle length measurement device based on monocular vision is provided. The device includes:
[0033] An image acquisition module for acquiring a target image of the vehicle under test;
[0034] An image processing module for processing and analyzing the target image to obtain the key feature points and the segmentation mask of the vehicle under test;
[0035] A calculation module for calculating the actual length of the vehicle under test by using the key feature points and the segmentation mask of the vehicle under test.
[0036] The beneficial effects that can be achieved by the present invention adopting the above technical solutions include: by acquiring the target image of the vehicle under test, processing and analyzing the target image to obtain the key feature points and the segmentation mask of the vehicle under test, and calculating the actual length of the vehicle under test by using the key feature points and the segmentation mask of the vehicle under test, so as to realize non-contact and accurate measurement of the vehicle length of the vehicle under test, improve the vehicle length measurement efficiency, and is beneficial to the investigation and analysis of vehicle type flow. Description of the Drawings
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0038] Figure 1 is a flowchart of a vehicle length measurement method based on monocular vision shown according to an exemplary embodiment;
[0039] Figure 2 is an explanatory schematic diagram of the measurement of the vehicle to be measured shown according to an exemplary embodiment;
[0040] Figure 3 is an explanatory schematic diagram of the external parameter calibration shown according to an exemplary embodiment;
[0041] Figure 4 is a schematic diagram of the key feature points of the vehicle to be measured shown according to an exemplary embodiment;
[0042] Figure 5 is a schematic structural diagram of a vehicle length measurement device based on monocular vision shown according to an exemplary embodiment. Detailed implementation manners
[0043] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will describe the technical solutions of the present invention in detail. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other implementation manners obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope protected by the present invention.
[0044] Figure 1 is a flowchart of a vehicle length measurement method based on monocular vision shown according to an exemplary embodiment. As Figure 1 shown, this method can be but is not limited to being used in a terminal, and includes the following steps:
[0045] Step 101: Collect a target image of the vehicle to be measured;
[0046] Step 102: Process and analyze the target image to obtain the key feature points and the segmentation mask of the vehicle to be measured;
[0047] Step 103: Calculate the actual length of the vehicle to be measured by using the key feature points and the segmentation mask of the vehicle to be measured.
[0048] A vehicle length measurement method based on monocular vision provided by an embodiment of the present invention collects a target image of a vehicle to be measured, processes and analyzes the target image to obtain key feature points and a segmentation mask of the vehicle to be measured, and calculates the actual length of the vehicle to be measured by using the key feature points and the segmentation mask of the vehicle to be measured, thereby realizing non-contact and accurate measurement of the vehicle length of the vehicle to be measured, improving the vehicle length measurement efficiency, and being beneficial to the investigation and analysis of vehicle type flow.
[0049] Further, step 101 can be realized through but not limited to the following process:
[0050] Use an image acquisition device to collect an image of the vehicle to be measured at a specified position on the ground to obtain a target image.
[0051] It should be noted that the image acquisition device can be but not limited to different types of camera devices, etc. It can be understood that a vehicle length measurement method based on monocular vision provided by an embodiment of the present invention only needs to use an ordinary 2D camera to realize non-contact and accurate measurement of the vehicle length of the vehicle to be measured, reducing the cost.
[0052] It can be understood that generally, the target image of the vehicle to be measured collected by the image acquisition device is a color image, and the entire body of the vehicle to be measured needs to be within the field of view of the image acquisition device. For example, as Figure 2 shown.
[0053] Further, before collecting the target image of the vehicle to be measured, it also includes:
[0054] Calibrate the image acquisition device to obtain the internal parameter and external parameter information of the image acquisition device.
[0055] It should be noted that the internal parameter of the image acquisition device generally refers to the internal parameter matrix.
[0056] Specifically, calibrating the image acquisition device to obtain the internal parameter and external parameter information of the image acquisition device includes:
[0057] Use the image acquisition device to collect calibration images of a standard black and white checkerboard calibration board in different poses, and based on the obtained calibration images, use the Zhang Zhengyou calibration method to calibrate and obtain the internal parameter information of the image acquisition device;
[0058] Install and install the image acquisition device in a specified manner so that the field of view of the image acquisition device is opposite to the specified ground, measure the installation height of the image acquisition device, and the distance from the proximal boundary of the field of view to the projection point of the device on the ground plane, and calculate the external parameter information of the image acquisition device according to the installation height and the distance.
[0059] It should be noted that the method of "calculating the external parameter information of the image acquisition device according to the installation height and distance" involved in the embodiments of the present invention is well-known to those skilled in the art. Therefore, its specific implementation will not be described in detail.
[0060] For example, as Figure 3 shown, assuming that the image acquisition device is a camera, any model of camera is selected and installed at an appropriate height. A standard black and white checkerboard calibration board for calibration is printed, and a total of 20 calibration images of the standard black and white checkerboard calibration board at different poses under the camera are collected (those skilled in the art can set the number of collected calibration images according to expert experience or experimental data, etc.). Based on the obtained calibration images, the internal parameter matrix of the camera is calibrated using the Zhang Zhengyou calibration method; then, a reference object is placed in the middle of the camera's field of view, the installation height H of the camera and the distance D from the proximal boundary of the field of view to the projection point of the camera on the ground plane are measured, and the external parameter information of the camera is calculated according to the installation height H and the distance D from the projection point of the camera on the ground plane. This step only needs to be executed once after the camera is fixed.
[0061] Further, the processing and analysis of the target image in step 102 include:
[0062] Step 1021: Preprocess the target image;
[0063] Step 1022: Use a deep learning-based target key point detector to detect the preprocessed target image to obtain the key feature points and segmentation mask of the vehicle to be measured;
[0064] Among them, the key feature points of the vehicle to be measured include: the corner points of the vehicle head, the center point of the first wheel hub on the visible side of the vehicle to be measured, and the center point of the second wheel hub on the visible side of the vehicle to be measured; the segmentation mask is the area within the vehicle contour.
[0065] It should be noted that the deep learning-based target key point detector is pre-trained. In some embodiments, the input layer training samples of the deep learning-based target key point detector that has not been trained can be, but are not limited to, the target images of historical vehicles to be measured, and the output layer training samples of the deep learning-based target key point detector that has not been trained can be the key feature points and segmentation masks of historical vehicles to be measured for training to obtain a trained deep learning-based target key point detector.
[0066] Further, the preprocessing of the target image in step 1021 includes:
[0067] Step 211: Scale the target image to obtain an intermediate image that meets the input size of the deep learning-based target key point detector;
[0068] Step 212: Perform mean subtraction and variance division on the intermediate image to obtain the preprocessed target image.
[0069] It should be noted that the method of "performing mean subtraction and variance division on the intermediate image" involved in the embodiments of the present invention is well-known to those skilled in the art. Therefore, its specific implementation manner will not be described in detail. Generally, it refers to subtracting the image mean and dividing by the image variance for the intermediate image.
[0070] Further, step 1022 uses a deep learning-based target key point detector to detect the preprocessed target image, including:
[0071] Using the deep learning-based target key point detector to detect the key feature points of the vehicle under test in the preprocessed target image. Each key feature point of the vehicle under test corresponds to a heat map, and the coordinates corresponding to the maximum value in each heat map are selected as the coordinates of the key feature points of the vehicle under test; and
[0072] Using the deep learning-based target key point detector to process the preprocessed target image to obtain the segmentation mask of the vehicle under test.
[0073] It can be understood that the segmentation mask refers to the area within the vehicle contour. In some embodiments, the area belonging to the vehicle contour is represented by 1, and the area not belonging to the vehicle is represented by 0.
[0074] Further, step 103 calculates the actual length of the vehicle under test using the key feature points and the segmentation mask of the vehicle under test, including:
[0075] Step 1031: According to the scaling ratio during the scaling process of the target image, perform restoration processing on the coordinates of the key feature points of the vehicle under test to obtain the coordinates of the first wheel hub center point, the coordinates of the second wheel hub center point, and the coordinates of the vehicle head corner point;
[0076] For example, as Figure 4 shown, the first wheel hub center point k1, the second wheel hub center point k2, and the vehicle head corner point k3;
[0077] Step 1032: Use the coordinates of the first wheel hub center point, the coordinates of the second wheel hub center point, and the segmentation mask to calculate the coordinates of the two contact points between the wheels of the vehicle under test and the ground, so as to obtain the straight line between the two contact points;
[0078] Specifically, in some alternative embodiments, calculating the coordinates of the two contact points between the wheels of the vehicle under test and the ground includes:
[0079] The connecting line L between the center point of the first wheel hub and the center point of the second wheel hub divides the outer contour of the vehicle to be measured into upper and lower parts. Among the contour points in the lower half, find the two wave trough points with the largest distance from the straight line L, which are the contact points of the two wheels with the ground, and thus the coordinates of the two contact points of the wheels of the vehicle to be measured with the ground can be further obtained;
[0080] Step 1033: Determine the coordinates of the projection point P1 of the front - end corner point on the straight line between the two contact points according to the coordinates of the front - end corner point;
[0081] Specifically, in some alternative embodiments, the process of determining the coordinates of P1 includes:
[0082] Substitute the abscissa of the front - end corner point into the straight - line equation of the connection line between the contact points of the two wheels with the ground, and the coordinates of P1 can be calculated;
[0083] Step 1034: Calculate the coordinates of the minimum - enclosing rectangle of the vehicle to be measured (i.e., the upper - lower and left - right boundaries of the contour points) using the segmentation mask of the vehicle to be measured, and determine the coordinates of the boundary intersection point P2 of the straight line between the two contact points and the boundary of the minimum - enclosing rectangle of the vehicle to be measured according to the coordinates of the minimum - enclosing rectangle of the vehicle to be measured;
[0084] Specifically, in some alternative embodiments, the process of determining the coordinates of P2 includes:
[0085] Substitute the abscissa of the left boundary of the minimum - enclosing rectangle into the straight - line equation of the connection line between the contact points of the two wheels with the ground, and the coordinates of P2 can be calculated;
[0086] Step 1035: Input the internal - parameter and external - parameter information of the vehicle to be measured, the coordinates of P1, and the coordinates of P2 into a preset BP neural - network model to obtain the actual length of the vehicle to be measured.
[0087] It should be noted that the method of "calculating the coordinates of the minimum - enclosing rectangle of the vehicle to be measured using the segmentation mask of the vehicle to be measured" involved in the embodiments of the present invention is well - known to those skilled in the art. Therefore, its specific implementation method will not be described in detail.
[0088] In some embodiments, the process of obtaining the preset BP neural - network model may but is not limited to including: using the historical internal - parameter and external - parameter information, the coordinates of P1, and the coordinates of P2 as the training - sample of the input layer of the BP neural - network model, and using the historical actual length of the vehicle to be measured as the training - sample of the output layer of the BP neural - network model for training to obtain the preset BP neural - network model.
[0089] A vehicle length measurement method based on monocular vision provided by an embodiment of the present invention collects a target image of a vehicle to be measured, processes and analyzes the target image to obtain key feature points and a segmentation mask of the vehicle to be measured, and calculates the actual length of the vehicle to be measured by using the key feature points and the segmentation mask of the vehicle to be measured, thereby realizing non-contact and accurate measurement of the vehicle length of the vehicle to be measured, improving the vehicle length measurement efficiency, and being beneficial to the investigation and analysis of vehicle type flow.
[0090] An embodiment of the present invention also provides a vehicle length measurement device based on monocular vision, as Figure 5 shown, the device includes:
[0091] An image acquisition module for acquiring a target image of a vehicle to be measured;
[0092] An image processing module for processing and analyzing the target image to obtain key feature points and a segmentation mask of the vehicle to be measured;
[0093] A calculation module for calculating the actual length of the vehicle to be measured by using the key feature points and the segmentation mask of the vehicle to be measured.
[0094] In some optional embodiments, the device further includes: a display module for displaying the actual length of the vehicle to be measured calculated by the calculation module.
[0095] Wherein, the display module can be implemented by, but not limited to, a display screen, etc.
[0096] Further, the image acquisition module is specifically configured to:
[0097] Use an image acquisition device to acquire an image of the vehicle to be measured at a specified position on the ground to obtain a target image.
[0098] Further, the device further includes:
[0099] A calibration module for calibrating the image acquisition device to obtain the internal parameter and external parameter information of the image acquisition device.
[0100] Further, the calibration module is specifically configured to:
[0101] Use the image acquisition device to acquire calibration images of a standard black and white checkerboard calibration board in different poses, and based on the obtained calibration images, use the Zhang Zhengyou calibration method to calibrate the internal parameter information of the image acquisition device;
[0102] Install and mount the image acquisition device in a specified manner so that the field of view of the image acquisition device is opposite to the specified ground, measure the installation height of the image acquisition device, and the distance from the proximal boundary of the field of view to the projection point of the device on the ground plane, and calculate the external parameter information of the image acquisition device according to the installation height and the distance.
[0103] Further, the image processing module includes:
[0104] A preprocessing sub-module for preprocessing the target image;
[0105] A first acquisition sub-module for detecting the preprocessed target image by using a deep learning-based target key point detector to obtain the key feature points and the segmentation mask of the vehicle under test;
[0106] Among them, the key feature points of the vehicle under test include: the corner points of the vehicle head, the center point of the first wheel hub on the visible side of the vehicle under test, and the center point of the second wheel hub on the visible side of the vehicle under test; the segmentation mask is the area within the vehicle contour.
[0107] Further, the preprocessing sub-module is specifically used for:
[0108] Performing scaling processing on the target image to obtain an intermediate image that meets the input size of the deep learning-based target key point detector;
[0109] Performing mean subtraction and variance division processing on the intermediate image to obtain the preprocessed target image.
[0110] Further, the first acquisition sub-module is specifically used for:
[0111] Using the deep learning-based target key point detector to detect the key feature points of the vehicle under test in the preprocessed target image, each key feature point of the vehicle under test corresponds to a heat map, and selecting the coordinate corresponding to the maximum value in each heat map as the coordinate of the key feature point of the vehicle under test; and
[0112] Using the deep learning-based target key point detector to preprocess the target image to obtain the segmentation mask of the vehicle under test.
[0113] Further, the calculation module includes:
[0114] A restoration sub-module for restoring the coordinates of the key feature points of the vehicle under test according to the scaling ratio during the scaling processing of the target image to obtain the coordinates of the center point of the first wheel hub, the coordinates of the center point of the second wheel hub, and the coordinates of the vehicle head corner points;
[0115] A second acquisition sub-module for calculating the coordinates of the two contact points between the wheels of the vehicle under test and the ground by using the coordinates of the center point of the first wheel hub, the coordinates of the center point of the second wheel hub, and the segmentation mask, so as to obtain a straight line between the two contact points;
[0116] A first determination sub-module for determining the coordinates of the projection point P1 of the vehicle head corner point on the straight line between the two contact points according to the coordinates of the vehicle head corner point;
[0117] A second determination sub-module, configured to calculate the coordinates of the minimum circumscribed rectangle of the vehicle under test by using the segmentation mask of the vehicle under test, and determine the coordinates of the intersection point P2 between the straight line between the two contact points and the boundary of the minimum circumscribed rectangle of the vehicle under test according to the coordinates of the minimum circumscribed rectangle of the vehicle under test;
[0118] A third acquisition sub-module, configured to input the internal and external parameter information of the vehicle under test, the coordinates of P1, and the coordinates of P2 into a preset BP neural network model to obtain the actual length of the vehicle under test.
[0119] A vehicle length measurement method based on monocular vision provided by an embodiment of the present invention collects a target image of a vehicle under test through an image acquisition module, and an image processing module processes and analyzes the target image to obtain key feature points and a segmentation mask of the vehicle under test. A calculation module calculates the actual length of the vehicle under test by using the key feature points and the segmentation mask of the vehicle under test, thereby realizing non-contact and accurate measurement of the vehicle length of the vehicle under test, improving the vehicle length measurement efficiency, and being beneficial to the investigation and analysis of vehicle type flow.
[0120] It can be understood that the above-provided device embodiment corresponds to the above method embodiment, and the corresponding specific content can be referred to each other, and will not be elaborated here.
[0121] An embodiment of the present invention further provides an electronic device, including:
[0122] A memory, on which an executable program is stored;
[0123] A processor, configured to execute the executable program in the memory to implement the steps in the vehicle length measurement method based on monocular vision provided in the above embodiment.
[0124] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0125] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce a means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or a means for implementing the functions specified in multiple blocks.
[0126] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction method that implements the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or a means for implementing the functions specified in multiple blocks.
[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or a means for implementing the functions specified in multiple blocks.
[0128] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claimed rights.
Claims
1. A method for measuring the length of a vehicle based on monocular vision, characterized in that, The method includes: Collecting a target image of the vehicle to be measured; Detecting the preprocessed target image by using a target key point detector based on deep learning to obtain the key feature points and a segmentation mask of the vehicle to be measured; wherein, the key feature points of the vehicle to be measured include: the front corner point, the first wheel hub center point on the visible side of the vehicle to be measured, and the second wheel hub center point on the visible side of the vehicle to be measured; the segmentation mask is the area within the vehicle contour; The segmentation mask is the area within the vehicle contour; According to the scaling ratio when the target image is scaled, restoring the coordinates of the key feature points of the vehicle to be measured to obtain the coordinates of the first wheel hub center point, the coordinates of the second wheel hub center point, and the coordinates of the front corner point; Using the coordinates of the first wheel hub center point, the coordinates of the second wheel hub center point, and the segmentation mask to calculate the coordinates of two contact points between the wheels of the vehicle to be measured and the ground, so as to obtain a straight line between the two contact points; Determining the coordinates of the projection point P1 of the front corner point on the straight line between the two contact points according to the coordinates of the front corner point; Calculating the coordinates of the minimum circumscribed rectangle of the vehicle to be measured by using the segmentation mask of the vehicle to be measured, and determining the coordinates of the boundary intersection point P2 between the straight line between the two contact points and the minimum circumscribed rectangle of the vehicle to be measured according to the coordinates of the minimum circumscribed rectangle of the vehicle to be measured; Inputting the internal parameter and external parameter information of the vehicle to be measured, the coordinates of P1, and the coordinates of P2 into a preset BP neural network model to obtain the actual length of the vehicle to be measured.
2. The method according to claim 1, wherein The collecting the target image of the vehicle to be measured includes: Collecting an image of the vehicle to be measured at a specified position on the ground by using an image collecting device to obtain the target image.
3. The method according to claim 2, wherein Before collecting the target image of the vehicle to be measured, it further includes: Calibrating the image collecting device to obtain the internal parameter and external parameter information of the image collecting device.
4. The method according to claim 3, wherein The calibrating the image collecting device to obtain the internal parameter and external parameter information of the image collecting device includes: Using the image collecting device to collect calibration images of a standard black and white checkerboard calibration plate in different poses, and calibrating to obtain the internal parameter information of the image collecting device based on the obtained calibration images by using Zhang Zhengyou calibration method; Installing and mounting the image collecting device in a specified manner so that the field of view of the image collecting device faces the specified ground, measuring the installation height of the image collecting device, and the distance from the proximal boundary of the field of view to the projection point of the device on the ground plane, and calculating the external parameter information of the image collecting device according to the installation height and the distance.
5. The method according to claim 1, characterized in that The preprocessing the target image includes: Scaling the target image to obtain an intermediate image that meets the input size of the target key point detector based on deep learning; Performing mean subtraction and variance division processing on the intermediate image to obtain the preprocessed target image.
6. The method according to claim 5, wherein The detecting the preprocessed target image by using a target key point detector based on deep learning includes: Using the key feature points of the vehicle under test in the target image preprocessed by a deep learning-based target key point detector, each key feature point of the vehicle under test corresponds to a heat map, and the coordinates corresponding to the maximum value in each heat map are selected as the coordinates of the key feature point of the vehicle under test; and Using the target image preprocessed by a deep learning-based target key point detector to obtain a segmentation mask of the vehicle under test.
Citation Information
Patent Citations
Video-based vehicle size measurement method and device, terminal and storage medium
CN112489106A
Image-based positioning method and device, and position relationship judgment method and device
CN112541419A
Image acquisition equipment calibration method and device, electronic equipment and storage medium
CN113066135A