Vehicle axle number determination method, device, electronic device and storage medium
By using the adaptive wheel axle number calculation window in vehicle axle number detection, combined with the wheel axle detection results in the video frame, the problem of low vehicle axle number detection accuracy in the existing technology is solved, and a vehicle that simplifies installation and improves detection efficiency is realized. How to determine the number of axes.
Patent Information
- Application Number
- CN202110138962.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-01
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-02-01
AI Technical Summary
Existing vehicle axle number detection methods have low accuracy, complex equipment installation and difficult maintenance, making it difficult to ensure the accuracy of vehicle axle number identification.
Through the wheel axle detection results in the target video and the adaptive wheel axle number calculation window, the appearance of the vehicle's wheel axles in the camera area is determined, and the number of vehicle axles is accurately calculated based on temporal continuity and spatial position fixity.
There is no need for complicated hardware installation, which simplifies the vehicle axle number detection process, improves the accuracy and efficiency of detection, and can determine the vehicle axle number conveniently and efficiently.
Smart Images

Figure CN112836631B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of vehicle technology, and in particular, relates to a method, device, electronic device and storage medium for determining the number of vehicle axles. Background Art
[0002] The number of axles of a vehicle is the total number of axles configured under the vehicle chassis. Currently, the number of axles of a vehicle traveling on a road is usually detected to determine whether the vehicle meets the driving regulations. However, the accuracy of the existing method for determining the number of axles of a vehicle is low. Summary of the invention
[0003] In view of this, embodiments of the present application provide a method, device, electronic device and storage medium for determining the number of vehicle axles to solve the problem of how to accurately determine the number of vehicle axles in the prior art.
[0004] A first aspect of an embodiment of the present application provides a method for determining the number of vehicle axles, comprising:
[0005] Determine the wheel axle detection result of each video frame in the target video, wherein the target video is a video corresponding to the time period from when the vehicle enters the camera area to when it leaves the camera area; the wheel axle detection result includes information of the wheel axle image; the wheel axle image is an image corresponding to a single wheel axle of the vehicle;
[0006] Determine an adaptive wheel axle quantity calculation window of the target video according to information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent: an image detection area estimated to be located at the target position and capable of containing a single wheel axle image;
[0007] Determine, according to the axle detection result of each video frame and the adaptive axle quantity calculation window, whether the axle image appears in each video frame in the adaptive axle quantity calculation window;
[0008] The number of axles of the vehicle is determined according to the occurrence of the axle image in each consecutive video frame in the adaptive axle number calculation window.
[0009] A second aspect of an embodiment of the present application provides a vehicle axle number determination device, comprising:
[0010] The wheel axle detection result determination unit is used to determine the wheel axle detection result of each video frame in the target video, wherein the target video is a video corresponding to the time period from when the vehicle enters the camera area to when it leaves the camera area; the wheel axle detection result includes information of the wheel axle image; the wheel axle image is an image corresponding to a single wheel axle of the vehicle;
[0011] An adaptive wheel axle quantity calculation window determination unit is used to determine the adaptive wheel axle quantity calculation window of the target video according to the information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent: an image detection area estimated to be located at the target position and capable of containing a single wheel axle image;
[0012] a wheel axle image appearance determination unit, configured to determine the appearance of the wheel axle image in each of the video frames in the adaptive wheel axle number calculation window according to the wheel axle detection result of each of the video frames and the adaptive wheel axle number calculation window;
[0013] The vehicle axle number determination unit is used to determine the situation in which the axle image appears in the adaptive axle number calculation window of each frame of the video frame according to the axle detection result of each frame of the video frame and the adaptive axle number calculation window.
[0014] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the steps of the method for determining the number of vehicle axles.
[0015] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the electronic device implements the steps of the vehicle axle number determination method.
[0016] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the method for determining the number of vehicle axles described in the first aspect above.
[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: in the embodiments of the present application, since the target video is a video corresponding to the time period from when the vehicle enters the camera area to when it leaves the camera area, the wheel axle detection result includes the information of the wheel axle image, and therefore the wheel axle detection result of each frame in the target video can be determined to completely and continuously represent the image information corresponding to each wheel axle during the duration of the vehicle passing through the camera area (i.e., the information of each wheel axle image); thereafter, an adaptive wheel axle quantity calculation window is determined based on the information of each wheel axle image contained in all the wheel axle detection results, and since the adaptive wheel axle quantity calculation window represents an estimated image detection area that can contain a single wheel axle image at the target position, that is, the adaptive wheel axle quantity calculation window is a fixed image where the wheel axle image may appear. Detection area, therefore, the adaptive wheel axle quantity calculation window can correspond to a fixed actual spatial area (hereinafter referred to as the designated spatial area) in the camera area where the vehicle wheel axle may pass, so that according to the wheel axle detection results of each frame of the video frame and the adaptive quantity calculation window, the situation in which the wheel axle image appears in the adaptive wheel axle quantity calculation window in each frame of the video frame determined can reflect the wheel axle passing situation of the vehicle in the designated spatial area of the actual camera area (that is, the actual physical space) at each time point, so that finally according to the situation of the wheel axle image appearing in the adaptive wheel axle quantity calculation window in each consecutive frame of the video frame, it can reflect the number of wheel axles passed by the vehicle in the actual designated spatial area based on the continuity of time and the fixity of the spatial position, thereby accurately obtaining the vehicle axle number of the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 It is a schematic diagram of an application scenario of a method for determining the number of vehicle axles provided in an embodiment of the present application;
[0020] Figure 2 It is a schematic diagram of the implementation flow of a method for determining the number of vehicle axles provided in an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an axle identification frame provided in an embodiment of the present application;
[0022] Figure 4 is an example diagram of an adaptive wheel axle quantity calculation window and a wheel axle detection window provided in an embodiment of the present application;
[0023] Figure 5is a state transition diagram of a vehicle axle number determination process provided by an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of the number of wheel axles arranged in the wheel axle detection window provided in an embodiment of the present application;
[0025] Figure 7 It is a state transition diagram of a process of determining the arrangement structure of an axle group provided in an embodiment of the present application;
[0026] Figure 8 is another state transition diagram of a process for determining the arrangement structure of an axle group provided in an embodiment of the present application;
[0027] Fig. 9 is a schematic diagram of a vehicle axle number determination device provided in an embodiment of the present application;
[0028] Fig.10 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0030] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0031] The number of vehicle axles is an important detection content in vehicle identification. In specific applications, the number of axles of a vehicle traveling on the road is usually determined by detecting the number of axles of the vehicle, and then determining whether the vehicle meets the driving regulations (for example, determining whether the vehicle is overloaded, that is, whether the current load of the vehicle exceeds the total mass limit of the vehicle of the axle number type). Therefore, how to detect the number of vehicle axles efficiently and accurately has become a problem that technicians in this field need to solve urgently.
[0032] At present, the detection of vehicle axle number mainly adopts traditional piezoelectric sensing recognition, laser recognition or pattern recognition method based on vehicle side panoramic image. However, traditional piezoelectric sensing recognition requires multiple groups of pressure sensors such as contact piezoelectric switch sensors or piezoelectric film sensors to be installed at designated positions, which is complicated to install and has high implementation cost. In addition, the pressure sensor is easily damaged after repeated rolling by the vehicle, and it is difficult to repair and replace. In addition, during use, the pressure sensor may be inaccurately detected due to the light weight of the vehicle or the shaking of the vehicle, which leads to low accuracy of the determined vehicle axle number. The laser recognition method has the problem of difficulty in debugging and difficulty in ensuring the accuracy of vehicle axle number recognition. For the wheel axle pattern recognition method of the vehicle side panoramic image, it is necessary to require the camera equipment to be installed at a long distance, and even to use a wide-angle lens to obtain the panoramic image. However, long-distance photography may lead to insufficient fill light and unclear images (if additional fill light equipment is required, the wiring is long and the installation is inconvenient), and the panoramic image taken by the wide-angle lens may have certain image distortion, which leads to inaccurate vehicle axle number determined based on the vehicle side panoramic image. It can be seen that the existing vehicle axle number detection methods all have the defects of complex equipment installation and low accuracy.
[0033] In order to solve the technical problem, the present application provides a method, device, electronic device and storage medium for determining the number of vehicle axles. In the method for determining the number of vehicle axles, since the target video is a video corresponding to the time period from the vehicle entering the camera area to leaving the camera area, the wheel axle detection result includes the information of the wheel axle image. Therefore, the wheel axle detection result of each frame of the target video can be determined. It can completely and continuously represent the image information corresponding to each wheel axle during the duration of the vehicle passing through the camera area (that is, the information of each wheel axle image); then, according to the information of each wheel axle image contained in all the wheel axle detection results, an adaptive wheel axle number calculation window is determined. Since the adaptive wheel axle number calculation window represents the estimated image detection area that can contain a single wheel axle image at the target position, that is, the adaptive wheel axle number calculation window The window is a fixed image detection area where the wheel axle image may appear. Therefore, the adaptive wheel axle quantity calculation window can correspond to a fixed designated spatial area in the camera area where the vehicle wheel axle may pass, so that the wheel axle image of each video frame determined in the adaptive wheel axle quantity calculation window according to the wheel axle detection results of each video frame and the adaptive quantity calculation window can reflect the wheel axle passing situation of the designated spatial area of the actual camera area (i.e., the actual physical space) at each time point, so that finally, according to the wheel axle image of each continuous video frame appearing in the adaptive wheel axle quantity calculation window, the number of wheel axles passed by the vehicle in the actual designated spatial area can be reflected based on the continuity of time and the fixity of spatial position, thereby accurately obtaining the vehicle axle number of the vehicle. Compared with the existing vehicle axle number detection method, the vehicle axle number determination method does not require complicated hardware installation, nor does it require the acquisition of a panoramic image of the vehicle. It only needs to be based on a target video that can contain the image of the vehicle's wheel axle (that is, it has low requirements on the shooting field of view, only requires simple camera equipment, and only shoots the local area containing the vehicle's wheel axle at close range to obtain the target video, without the need for long-distance shooting). Based on the continuity of time and the relative fixity of the spatial position, the vehicle axle number of the vehicle can be determined conveniently, efficiently and accurately.
[0034] Figure 1 A schematic diagram of an application scenario of a method for determining the number of vehicle axles provided by an embodiment of the present application is shown. In this application scenario, a camera device is set up on a pole beside the road at a close distance to shoot the side of a passing vehicle. The camera area of the camera device is a part of the vehicle. The video captured by the camera device only needs to include a partial image of the vehicle, without the need to set up a camera device at a long distance or a wide-angle lens to obtain a panoramic image of the vehicle.
[0035] Embodiment 1:
[0036] Figure 2A schematic diagram of a process flow of a method for determining the number of vehicle axles provided in an embodiment of the present application is shown. The execution subject of the method for determining the number of vehicle axles is an electronic device. In one embodiment, the electronic device is capable of obtaining Figure 1 The computing device for the video data captured by the camera device shown in the figure includes but is not limited to a smart phone, a tablet computer, a wearable device, a computer, a server, etc.; in another embodiment, the electronic device can also directly Figure 1 The camera equipment shown. Figure 2 The method for determining the number of vehicle axles shown is detailed as follows:
[0037] In S201, the wheel axle detection result of each video frame in the target video is determined, wherein the target video is a video corresponding to the time period from the vehicle entering the camera area to leaving the camera area; the wheel axle detection result includes information of the wheel axle image; and the wheel axle image is an image corresponding to a single wheel axle of the vehicle.
[0038] In the embodiment of the present application, the target video is a video from a vehicle entering a Figure 1 The target video includes each video frame captured by the camera device during the time period from the vehicle entering the camera area to leaving the camera area. The target video includes each video frame captured by the camera device during the time period from the vehicle entering the camera area to leaving the camera area. In another embodiment, the target video includes video frames collected from the camera device at a preset sampling frequency during the time period from the vehicle entering the camera area to leaving the camera area; the preset sampling frequency is less than the shooting frame rate of the camera device. For example, if the shooting frame rate of the camera device is 30 frames / second, the sampling frequency can be 15 frames / second, thereby reducing the number of video frames to be processed and improving the efficiency of the method for determining the number of vehicle axles while ensuring accurate tracking of the image information of the vehicle passing through the camera area. Optionally, the target video can be obtained by acquiring the video data currently captured by the camera device in real time; or, from a storage unit storing the video data captured in advance by the camera device, a video corresponding to the time period from the vehicle entering the camera area to leaving the camera area captured in the past is obtained as the target video.
[0039] After acquiring the target video, the wheel axle detection result of each video frame in the target video can be determined. The wheel axle detection result includes the information of the wheel axle image, and the wheel axle image is the image corresponding to a single wheel axle of the vehicle. That is, by performing wheel axle detection on each video frame, it can be determined whether each video frame has the wheel axle image corresponding to the vehicle wheel axle, and the wheel axle detection result can be obtained. The wheel axle detection result can reflect the information that the wheel axle of the vehicle passes through the camera area at the moment corresponding to the video frame. Specifically, when there is an axle image in the video frame, the information of the wheel axle image may include: indication information indicating that there is an axle image in the video frame, the number of axle images, the position and size information of the image area where each axle image is located, etc. Specifically, the position and size information of the image area where the axle image is located can be: the pixel length and width information of the minimum circumscribed quadrilateral frame (i.e., the axle identification frame) of the identified wheel axle image, and the pixel coordinates of the four vertices of the axle identification frame. Among them, the minimum circumscribed quadrilateral frame of the wheel axle image can be specifically the minimum circumscribed rectangular frame of the wheel axle image. Specifically, when the wheel axle image does not exist in the video frame, the information of the wheel axle image includes: indication information indicating that the wheel axle image does not exist in the video frame.
[0040] Optionally, the above step S201 includes:
[0041] Acquire each video frame obtained by shooting the side of the vehicle in a time period from a first moment to a second moment, and determine the wheel axle detection result of the video frame; wherein the first moment is the moment when the vehicle is detected to enter the camera area, and the second moment is the moment when the vehicle is detected to leave the camera area;
[0042] The wheel axle detection results of each video frame determined in the time period from the first moment to the second moment are determined as: the wheel axle detection results of each video frame in the target video.
[0043] In one embodiment, a camera device continuously shoots beside a road. When the camera device detects that a vehicle image begins to appear in the captured image, it determines that the current moment is the moment when the vehicle is detected to enter the camera area, and records the moment as the first moment. Then, the camera device continues to shoot the side of the vehicle. The electronic device of the embodiment of the present application obtains each video frame captured by the camera device in real time, and performs axle detection on each video frame to obtain the axle detection result of each video frame. Afterwards, when the camera device detects that the vehicle image disappears from the captured image, it determines that the vehicle is detected to leave the camera area, and records the moment as the second moment. At this time, the acquisition of video frames and / or axle detection can be stopped. In another embodiment, the camera device is in standby mode when no vehicle passes by. When a sensor (such as a photoelectric sensor or a pressure sensor) located at one end of the camera area detects that a vehicle enters, this moment is recorded as a first moment, and the camera device is woken up to continue shooting the side of the vehicle. The electronic device of the embodiment of the present application obtains each frame of video shot by the camera device in real time, and performs axle detection on each frame of the video to obtain the axle detection result of each frame of the video. Thereafter, when the sensor located at the other end of the camera area detects that the vehicle leaves, this moment is recorded as a second moment, indicating that the camera device enters a sleep mode.
[0044] Afterwards, the wheel axle detection results of each video frame determined in the time period from the first moment to the second moment are determined as the detection results of each video frame in the target video to be currently acquired.
[0045] In the embodiment of the present application, since it is possible to obtain in real time each video frame obtained by shooting the side of the vehicle in the time period from the first moment the vehicle enters the camera area to the second moment the vehicle leaves the camera area, and determine the wheel axle detection result of each video frame, it is possible to obtain the wheel axle detection result of each video frame in the target video in real time, efficiently and completely.
[0046] Optionally, the above step S201 includes:
[0047] According to the video frames of each frame in the target video and the pre-trained deep learning model, the wheel axle detection result of each frame in the target video is determined.
[0048] In an embodiment of the present application, axle detection is performed on each video frame of the target video by a pre-trained deep learning model, so as to accurately determine the axle detection result of each video frame in the target video. Specifically, the pre-trained deep learning model is an unsupervised deep learning model trained in advance. Optionally, for each video frame in the target video, the video frame can be cropped according to a preset image area to obtain a to-be-processed image corresponding to the video frame; then, the to-be-processed image is input into the pre-trained deep learning model for processing, and the axle detection result corresponding to the video frame can be obtained. Specifically, the axle detection result may include: indication information indicating that there is an axle image in the video frame, the number of identified axle images, the size and position information of the axle identification box corresponding to each axle image; or, indication information indicating that there is no axle image in the video frame.
[0049] Optionally, before determining the wheel axle detection result of each video frame in the target video according to each video frame in the target video and the pre-trained deep learning model, the method further includes:
[0050] A1: Obtain a preset number of sample videos, wherein the sample videos include side image information of a vehicle;
[0051] A2: respectively intercepting a preset image area of each video frame in the sample video to obtain each sample image;
[0052] A3: Marking the information of the wheel axle image in the sample image as a sample label, and obtaining each sample image carrying the sample label;
[0053] A4: Convert each sample image carrying the sample label into an input vector, input the vector into the deep learning model to be trained, and obtain the pre-trained deep learning model.
[0054] In an embodiment of the present application, before determining the wheel axle detection result of each video frame in the target video through a pre-trained deep learning model, the deep learning model is trained through steps A1 to A4 to obtain a pre-trained deep learning model.
[0055] In A1, a preset number of sample videos are collected in advance by a camera device, and the sample videos include side image information of the vehicle. Specifically, the sample videos include video frames with axle images and video frames without axle images. The larger the preset number, the more accurately the trained deep learning model can process the images corresponding to the video frames, and obtain more accurate axle detection results.
[0056] In A2, for each video frame in each sample video, the video frame is intercepted according to a preset image area with a fixed image position and size to obtain each sample image.
[0057] In A3, the information of the wheel axle image in each sample image is marked respectively, for example, the indication information indicating that the wheel axle image exists in the sample image, the number of wheel axle images, the size and position information of the wheel axle identification box corresponding to the wheel axle image, etc., or the indication information indicating that the wheel axle image does not exist in the sample image, and the information of these marked wheel axle images is used as sample labels to obtain sample images carrying the sample labels.
[0058] In A4, each sample image carrying a sample label is converted into a vector form to obtain each input vector, and these input vectors are input into the deep learning model to be trained for training, and finally a pre-trained deep learning model is obtained. Specifically, the deep learning model can be an unsupervised learning model using an automatic encoding method. Correspondingly, the training steps of the deep learning model to be trained may include:
[0059] A41: Convert the sample image into a corresponding input vector, and input the input vector into the deep learning model to be trained.
[0060] A42: Encode the input vector through the autoencoder of the deep learning model to be trained to convert the input vector into a corresponding feature code.
[0061] A43: Decode the feature code through the decoder of the deep learning model to be trained to obtain an output vector. The output vector is in a data format that can be recognized by the unsupervised deep learning model, so that the unsupervised deep learning model can learn the features to be extracted and obtain the expression form of the sample image carrying the sample label.
[0062] A44: Calculate the error between the output vector and the input vector, and determine whether the error meets a preset condition. The preset condition may be: the error is less than a preset error threshold, and the error threshold may be a percentage value, such as 5%. The smaller the error threshold, the more stable the deep learning model obtained by the final training, and the higher the recognition accuracy.
[0063] A45: When the error does not meet the preset conditions, the model parameters of the deep learning model to be trained are adjusted to obtain an updated deep learning model to be trained, and the process returns to execute step A41 and subsequent steps.
[0064] A46: When the error meets the preset conditions, it is determined that the deep learning model to be trained is trained, and the deep learning model at this time is used as the final pre-trained deep learning model.
[0065] In the embodiment of the present application, since a preset number of sample videos can be used in advance to obtain sample pictures carrying sample labels through image capture and information marking, the deep learning model to be trained can be trained, and finally a pre-trained deep learning model capable of accurately performing wheel axle detection is obtained, thereby improving the accuracy of the wheel axle detection results, and further improving the accuracy of the method for determining the number of vehicle axles.
[0066] In S202, an adaptive wheel axle quantity calculation window of the target video is determined according to information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent an image detection area estimated to be located at the target position and capable of containing a single wheel axle image.
[0067] In the embodiment of the present application, according to the axle detection results of each video frame, the information of all axle images contained in each video frame can be obtained, that is, the information of each axle image appearing in the target video can be obtained, specifically, the size and position information of each axle image can be included. According to the size and position information of each axle image, the adaptive axle quantity calculation window corresponding to the target video can be determined, and the adaptive axle quantity calculation window is the target position of the video frame estimated according to the size and position information of each axle image, and its size can include the image detection area of a single axle image. By reasonably setting the adaptive axle quantity calculation window, it can be ensured that at most one qualified axle image appears in the adaptive axle quantity calculation window. For the target video, the intersection of the adaptive axle quantity calculation window and each video frame is a fixed image area, and the fixed image area corresponds to a fixed actual physical space area (referred to as the designated space area) in the camera area.
[0068] Optionally, the information of the axle image includes the size and vertex coordinates of the axle identification frame, the axle identification frame is the minimum circumscribed quadrilateral frame of the axle image, and correspondingly, determining the adaptive axle quantity calculation window of the target video according to the information of each axle image includes:
[0069] B1: determining a target size according to the size and / or vertex coordinates of each axle identification frame;
[0070] B2: Determine the target position according to the preset horizontal position information and the vertex coordinates of the wheel axle identification frame;
[0071] B3: Using the target size as the size of the adaptive wheel-axle quantity calculation window, and using the target position as the position of the adaptive wheel-axle quantity calculation window, to obtain the adaptive wheel-axle quantity calculation window of the target video.
[0072] In the embodiment of the present application, the image area of the video frame is the image area obtained after the camera device captures the camera area. In the video frame, the information of the wheel axle image is specifically represented by the information of the wheel axle identification frame, and the wheel axle identification frame is the smallest circumscribed quadrilateral frame of the identified wheel axle image. Specifically, the information of the wheel axle identification frame may include the number of wheel axle identification frames appearing in the image area of the video frame, and the size and vertex coordinates of each wheel axle identification frame. Specifically, the size of each wheel axle identification frame may include the size of the wheel axle identification frame in the image area of the video frame. Figure 3 The length information in the horizontal axis direction shown in FIG. 1 (the length information can be in pixels, referred to as pixel length), and Figure 3 The width information in the ordinate direction shown in FIG. 1 (the width information may be in pixels, referred to as pixel width). Specifically, the vertex coordinates of each wheel axle identification frame may include: Figure 3 The coordinate information of the four vertices, namely the first vertex, the second vertex, the third vertex and the fourth vertex, is shown.
[0073] In step B1, the target size is a size that can contain a single wheel axle image. In one embodiment, the target size can be determined by the size of each wheel axle identification frame. Specifically, according to the size of all wheel axle identification frames identified in the target video, the maximum value of the length information of all wheel axle identification frames is determined, which is called the maximum length and is recorded as L. max ; and, determining the maximum value of the width information of all wheel axle identification frames, called the maximum width, denoted by W max ; Then, with the maximum length L max As the length in the horizontal direction, the maximum width W max As the width in the ordinate direction, the size is L max ×W max In another embodiment, according to the vertex coordinates of all wheel axle identification frames identified in the target video, the minimum value in the ordinate direction is determined, which is called the minimum ordinate and is recorded as Y top ; Determine the maximum value in the ordinate direction, called the maximum ordinate, denoted by Y bot ; Determine the minimum value in the horizontal coordinate direction, called the minimum horizontal coordinate, denoted by X min ; Determine the maximum value in the horizontal coordinate direction, called the maximum horizontal coordinate, recorded as X max ; Then, the maximum horizontal coordinate X max With the minimum horizontal coordinate X min The difference L d As the length, the maximum ordinate Y top With the minimum ordinate Y bot The difference W d As the width, we get the size L d ×W dThe target size. Usually, the target size is determined directly based on the size of all the wheel axle identification frames in the target video, which requires a relatively small amount of data to be compared and has a higher determination efficiency; while the target size is determined based on the vertex coordinates of all the wheel axle identification frames in the target video, which requires a relatively large amount of data to be compared and has a lower determination efficiency. However, compared with the method of directly determining the length and width information based on the wheel axle identification frame to obtain the target size, determining the target size through vertex coordinates can accommodate the situation where the sides of the wheel axle rectangular frame may not be parallel to the coordinate axis (i.e., there are height or left and right deviations when the vehicle's wheel axle passes through the camera area), ensuring that the determined target size can contain a single wheel axle image as completely as possible. Therefore, the method of determining the target size through vertex coordinates has higher stability and accuracy. Furthermore, considering that when the vehicle's wheel axle passes through the camera area, there is usually a height deviation in the vertical direction due to the uneven road surface. This deviation usually leads to the maximum width W in the longitudinal coordinate direction determined above. max Some axle images cannot be completely contained in the ordinate direction, and for the maximum length L max There is no effect, that is, L max Therefore, in one embodiment, the maximum length L determined by the size of each wheel axle identification frame can be used to comprehensively consider efficiency and accuracy. max As the length, the maximum ordinate Y among the vertex coordinates of the above-mentioned identification box passing through each wheel axle is used. top With the minimum ordinate Y bot The difference W d As the width, we get the size L max ×W d The target size.
[0074] In step B2, when the vehicle is traveling in the camera area, it can pass through any position in the horizontal direction of the camera area, and the position in the vertical direction is usually determined by the height of the vehicle axle, that is, the position in the vertical direction is relatively fixed. Therefore, correspondingly, in the target video frame, Figure 3 At each horizontal coordinate position in the horizontal coordinate direction shown, there may be a wheel axle image at a certain time point, while in the vertical coordinate direction, there is only a wheel axle image within a certain vertical coordinate position range. The target position is the position of the adaptive wheel axle quantity calculation window to be determined, and the adaptive wheel axle quantity calculation window needs to be able to contain a single wheel axle image. Therefore, in the horizontal direction, that is, in the horizontal coordinate direction, a horizontal position can be randomly preset, that is, preset horizontal position information, and in the vertical direction, that is, in the vertical coordinate direction, the vertical coordinate position is determined according to the vertical coordinate range of the wheel axle identification frame, so that a target position where a single wheel axle image can appear can be obtained. Optionally, the horizontal coordinate of the image center point of the video frame is used as the preset horizontal position information X.o , with the maximum ordinate Y top With the minimum ordinate Y bot The average value of the vertical center point of the wheel axle image is taken as the vertical position information Y o , the target position (X) with the preset horizontal position information as the horizontal coordinate and the vertical position information as the vertical coordinate can be obtained. o ,Y o ).
[0075] In step B3, the target size determined in step B1 is used as the size of the adaptive wheel axle number calculation window, and the target position determined in step B2 is used as the position of the adaptive wheel axle number calculation window, so that the adaptive wheel axle number calculation window located at the fixed image position of the target video and capable of containing a single wheel axle image can be obtained. For example, the schematic diagram of the adaptive wheel axle number calculation window is as follows: Figure 4 shown.
[0076] In the embodiment of the present application, since the target size and target position can be accurately determined as the size and position of the adaptive wheel axle number calculation window based on the size and vertex coordinates of the wheel axle identification frame, it is possible to ensure that the determined adaptive wheel axle number calculation window is an image detection area located at a fixed position that can contain a single wheel axle image, thereby improving the accuracy of the vehicle axle number determined based on the adaptive wheel axle number calculation window.
[0077] In S203, the situation where the axle image appears in the adaptive axle quantity calculation window of each video frame is determined according to the axle detection result of each video frame and the adaptive axle quantity calculation window.
[0078] After determining an adaptive wheel axle quantity calculation window that is fixed in position and can contain a single wheel axle image, for each video frame, the presence of the wheel axle image in the adaptive wheel axle quantity calculation window is determined based on the wheel axle detection result of the video frame and the adaptive wheel axle quantity calculation window. Specifically, when the wheel axle detection result of the video frame is indication information indicating that the wheel axle image does not exist in the video frame, it is directly determined that the wheel axle image does not appear in the adaptive wheel axle quantity calculation window. When the wheel axle detection result of the video frame is indication information indicating that the wheel axle image exists in the video frame, it is further determined based on the information of the existing wheel axle image whether the wheel axle image in the video frame falls within the adaptive wheel axle quantity calculation window. If so, it is determined that the wheel axle image appears in the adaptive wheel axle quantity calculation window for the video frame. If not, it is determined that the wheel axle image does not appear in the adaptive wheel axle quantity calculation window for the video frame. Specifically, the axle image in the video frame falls within the adaptive axle quantity calculation window, which means that the overlapping area of the axle image and the adaptive axle quantity calculation window is greater than a preset area, which is usually greater than 1 / 2 of the area of the axle image itself and less than or equal to the area of the axle image itself.
[0079] Since the adaptive wheel axle quantity calculation window is an image detection area with a fixed position in the target video frame that can contain a single wheel axle image, the adaptive wheel axle quantity calculation window corresponds to an actual physical space area with a fixed position in the camera area and a size that can contain the actual vehicle axle (referred to as the designated space area for short). Therefore, the situation in which the wheel axle image appears in the adaptive wheel axle quantity calculation window in each determined video frame actually reflects whether there is a vehicle axle passing through the designated space area at the moment corresponding to each video frame.
[0080] In S204, the number of axles of the vehicle is determined according to the occurrence of the axle image in each of the consecutive video frames in the adaptive axle number calculation window.
[0081] Since the appearance of axle images in the adaptive axle number calculation window in each video frame can reflect whether there are vehicle axles passing through the designated spatial area at each moment, the number of axles that pass through the designated spatial area in sequence during the duration of the vehicle passing through the camera area can be counted according to the appearance of axle images in the adaptive axle number calculation window in each consecutive video frame, thereby obtaining the number of axles of the vehicle. Exemplarily, in the video frame close to the starting moment of the target video, no axle image appears in the adaptive axle number calculation window, indicating that the axle of the vehicle has not passed through the designated spatial area; when the first video frame in which the axle image appears in the adaptive axle number calculation window is detected, it indicates that the axle of the vehicle begins to enter the designated spatial area at the moment corresponding to the first video frame, and the axle count is increased by 1 at this time; after the first video frame, until the second video frame in which the axle image does not appear is detected, it indicates that the first axle of the vehicle has left the designated spatial area at the moment corresponding to the second video frame; in the After the second video frame, if the axle appearance is detected in the third video frame in which the axle image appears, it means that the second axle of the vehicle begins to enter the designated space area at the moment corresponding to the third video frame, and the axle count is increased by 1 at this time; after the third video frame, if the axle appearance is detected in the fourth video frame in which no axle image appears, it means that the second axle of the vehicle has driven out of the designated space area at the moment corresponding to the fourth video frame...and so on, until all video frames of the target video in which the axle image appears in the adaptive axle number calculation window are analyzed, the obtained axle count value is the vehicle axle number of the vehicle.
[0082] Optionally, in the embodiment of the present application, an axle count mark is used to indicate that the axle image appears in the video frame in the adaptive axle quantity calculation window, and the above step S203 includes:
[0083] Determine the wheel axle count identifier of each frame of the video frame according to the wheel axle detection result of each frame of the video frame and the adaptive wheel axle quantity calculation window; the wheel axle count identifier includes a first count identifier and a second count identifier, the first count identifier indicates that the video frame has a single wheel axle image that meets the conditions in the adaptive wheel axle quantity calculation window, and the second count identifier indicates that the video frame does not have a single wheel axle image that meets the conditions in the adaptive wheel axle quantity calculation window;
[0084] Correspondingly, the above step S204 includes:
[0085] The number of axles of the vehicle is determined according to changes in the axle count identifiers between consecutive video frames.
[0086] In the embodiment of the present application, the axle count mark is specifically used to indicate the situation where the axle image appears in the adaptive axle quantity window of the video frame. The axle count mark includes a first count mark and a second count mark, the first count mark indicates that there is a single axle image that meets the conditions in the adaptive axle quantity calculation window of the video frame, and the second count mark indicates that there is no single axle image that meets the conditions in the adaptive axle quantity calculation window of the video frame. That is, for each video frame, if there is a single axle image that meets the conditions in the adaptive axle quantity calculation window of the video frame, the axle count mark of the video frame is determined to be the first count mark; if there is no single axle image that meets the conditions in the adaptive axle quantity calculation window of the video frame, the axle count mark of the video frame is determined to be the second count mark. The condition may be: the overlapping area of the single axle image and the adaptive axle quantity calculation window is greater than the preset area.
[0087] Afterwards, in step S204, the axle count is performed according to the change of the corresponding axle count identifiers between consecutive video frames, so as to determine the number of axles of the vehicle. Specifically, the axle count identifiers of consecutive video frames are read in sequence, and each time the axle count identifier changes from the second count identifier to the first count identifier, the axle count of the vehicle is increased by 1 until the axle count identifiers of all video frames are read, and the final axle count is determined as the number of axles of the vehicle; wherein the initial value of the axle count of the vehicle is 0. Exemplarily, let the first count identifier be N1, the second count identifier be N0, and the starting state of the vehicle axle count be K0 (indicating that 0 axle images pass through the adaptive axle number calculation window at the beginning), then it can be calculated as follows: Figure 5 The state transition diagram shown in the figure takes the axle counts of consecutive video frames as input in chronological order. When the state transition condition is met, the next state is entered. If not, the original state is maintained. When the axle counts of all video frames are used as inputs and calculated, the number of axles corresponding to the final state is the number of axles of the current vehicle. Specifically, Figure 5In the example, starting from the starting state, at the beginning, the axle of the vehicle has not entered the designated space area, and there is no axle image in the adaptive axle number calculation window. The axle count mark of the video frame at this stage is the second count mark N0, the state transition condition is not met, and the state of the vehicle axle count remains in the starting state K0. When the axle of the vehicle enters the designated space area, the axle image corresponding to the first axle that meets the conditions begins to appear in the adaptive axle number calculation window. At this time, the axle count mark of the corresponding video frame is the first count mark N1, and the state transition condition is met. The state of the vehicle axle count changes from the starting state K0 to the state K1, and the vehicle axle count corresponding to this state is 1. After the state of the vehicle axle count is converted to the state K1, the axle image corresponding to the first axle of the vehicle overlaps the adaptive axle number calculation window for a period of time, and the overlap area is greater than the preset area. The axle count mark of the video frame at this stage remains at the first count mark N1, and the state transition condition is not met. The state of the vehicle axle count remains in the state K1. Until the overlapping area between the axle image corresponding to the first axle of the vehicle and the adaptive axle number calculation window is less than or equal to the preset area, the axle count mark of the corresponding video frame is the second count mark N0, the state transition condition is met, and the state of the vehicle axle count is changed from state K1 to state K1'. The vehicle axle count corresponding to this state is still 1, but it represents the state corresponding to the first axle gradually leaving the designated space area. For a period of time after the state of the vehicle axle count is changed to state K1', the first axle gradually leaves, and the second axle has not yet entered or only a small part of it has entered the designated space area. The axle count mark of the video frame at this stage remains at the second count mark N0, the state transition condition is not met, and the state of the vehicle axle count remains at K1'. Until the overlapping area between the axle image corresponding to the second axle of the vehicle and the adaptive axle quantity calculation window is larger than the preset area, the axle count mark of the corresponding video frame is the first count mark N1, and the state transition condition is met, and the state of the vehicle axle count is changed from state K1' to state K2, and the vehicle axle count corresponding to this state is 2; afterwards, similarly, when the axle count mark of the subsequent video frame continues to be the first count mark N1, the state transition condition is not met, and the state of the vehicle axle count remains at K2; and when the axle count mark of the video frame is detected to be the second count mark N0, the state of the vehicle axle count is changed to K2'... and the conversion of other states is similar. When the axle count mark of the last video frame is input, the corresponding state mark at this time is determined as the final state, and the final state may be as follows Figure 5 According to any of the states K2 to K6 shown, the corresponding number of vehicle axles can be determined according to the final state. Specifically, the corresponding relationship between various final states and the number of vehicle axles is shown in Table 1 below.
[0088] Table 1:
[0089]
[0090]
[0091] In an embodiment of the present application, an axle count identifier is used to indicate the presence of an axle image in a video frame in an adaptive axle quantity calculation window, and the number of axles of the vehicle can be conveniently and accurately determined based on changes in the axle count state between consecutive video frames.
[0092] Optionally, the information of the axle image includes information of an axle identification frame, and the axle identification frame is a minimum circumscribed quadrilateral frame of the axle image. Correspondingly, determining the axle count identifier of each frame of the video frame according to the axle detection result of each frame of the video frame and the adaptive axle quantity calculation window includes:
[0093] For each video frame, if the video frame has an axle identification frame that overlaps with the adaptive axle quantity calculation window, and the ratio of the overlapping area of the axle identification frame and the adaptive axle quantity calculation window to the area of the axle identification frame is greater than a preset ratio, then the axle counting identifier of the video frame is determined to be a first counting identifier; otherwise, the axle counting identifier of the video frame is determined to be a second counting identifier.
[0094] In the embodiment of the present application, the information of the axle image is specifically represented by the axle identification frame, that is, the minimum circumscribed quadrilateral frame of the identified axle image. For each video frame in the target video, if the video frame has an axle identification frame that overlaps with the adaptive axle quantity calculation window, and the ratio of the overlapping area of the axle identification frame and the adaptive axle quantity calculation window to the area of the axle identification frame is greater than a preset threshold, it is determined that the video frame has a qualified axle image in the adaptive axle quantity calculation window, and the axle count mark of the video frame is recorded as the first count mark. On the contrary, if the video frame does not have an axle identification frame that overlaps with the adaptive axle quantity calculation window, or the ratio of the overlapping area of the axle identification frame and the adaptive axle quantity calculation window to the area of the axle identification frame is less than or equal to the preset threshold, it is determined that the video frame does not have a qualified axle image in the adaptive axle quantity calculation window, and the axle count mark of the video frame is recorded as the second count mark. Wherein, the preset threshold is greater than or equal to 1 / 2 and less than 1.
[0095] In the embodiment of the present application, since it is possible to accurately determine whether there is a qualified axle image in the video frame within the adaptive axle quantity calculation window through the overlap of the axle identification frame of the video frame and the adaptive axle quantity calculation window, it is possible to accurately determine the axle count identifier of each video frame, so as to accurately determine the number of vehicle axles based on the axle count identifier.
[0096] Optionally, after the above step S204, the method further includes:
[0097] Determining the number of wheel axle arrangements of each video frame according to the wheel axle detection result of each video frame and a preset wheel axle detection window; wherein the wheel axle detection window is a preset image detection area that can contain at least three adjacently arranged wheel axle images in the video frame; the number of wheel axle arrangements is used to represent the number of wheel axle images that appear in the preset wheel axle detection window in the video frame;
[0098] The vehicle type and / or the total mass limit of the vehicle are determined according to the number of vehicle axles of the vehicle and the change in the number of wheel axle arrangements between consecutive video frames.
[0099] In the embodiment of the present application, the wheel axle detection window is a preset image detection area that can contain at least three adjacently arranged wheel axle images in a video frame, for example Figure 4 As shown in the axle detection window. In one embodiment, the preset axle detection window can be drawn by: obtaining the coordinate position where the user clicks or slides on the screen of the video frame with the help of a touch device. In another embodiment, the preset axle detection window can be set according to the adaptive axle quantity calculation window. Specifically, the length of the adaptive axle quantity window can be multiplied by a preset multiple (for example, 3 to 5 times) to obtain the length of the axle detection window, and the width of the adaptive axle quantity calculation window can be used as the width of the axle detection window, and the center position of the adaptive axle quantity calculation window can be used as the center position of the axle detection window, so as to obtain the preset axle detection window.
[0100] According to the wheel axle detection results of each video frame and the above-mentioned preset wheel axle detection window, the number of wheel axle images falling within the preset wheel axle detection window in each video frame can be determined respectively. This number is called the wheel axle arrangement number, which can reflect the actual arrangement of the vehicle axles.
[0101] After determining the number of wheel axle arrangements of each video frame, according to the number of vehicle axles of the vehicle determined in step S204 and the change in the number of wheel axle arrangements between each video frame arranged in chronological order, the actual arrangement of the vehicle wheel axles is accurately determined, and the vehicle type and / or total mass limit of the vehicle are determined according to the number of vehicle axles and the actual arrangement of the vehicle wheel axles. Specifically, according to the requirements of my country's highway freight motor vehicles, the axle group type and arrangement of the axles of general freight vehicles are fixed and meet the relevant requirements of the state for vehicles, wherein the axle group type can include a single axle (i.e., the axle group has only one independent axle), a double axle group (i.e., the axle group includes two adjacent axles) and a three-axle group (i.e., the axle group includes three adjacent axles). In the embodiment of the present application, according to the number of wheel axle arrangements of each video frame, the axle group type and arrangement of the vehicle are determined, and then combined with the number of axles of the vehicle, the complete wheel axle group arrangement structure of the vehicle can be obtained, and the vehicle type and / or total mass limit of the vehicle can be determined. For example, if the number of axles of the vehicle is 3, and the wheel-axle group arrangement structure is 1+2 (indicating that the vehicle has a single axle at the front end and a double axle group at the rear end), the preset vehicle standard regulations can be queried according to the wheel-axle group arrangement structure, such as the "Overall Dimensions, Axle Loads and Mass Limits for Automobiles, Trailers and Automobile Trains" (GB1589-2016), to determine that the vehicle type of the vehicle is a truck, and the corresponding total mass limit is 25 tons. Among them, the total mass limit is the maximum limit of the vehicle mass after the vehicle is loaded. Optionally, after determining the total mass limit of the vehicle according to the number of axles and the wheel-axle group arrangement structure of the vehicle, the current actual load of the vehicle is obtained through a sensor. If the actual load is greater than the total mass limit, the vehicle is determined to be overloaded and an alarm message is issued.
[0102] In the embodiment of the present application, since the number of axle arrangements in each video frame can be accurately determined through a preset axle detection window, and the actual axle group arrangement structure of the vehicle can be accurately determined based on the number of vehicle axles and the number of axle arrangements, the vehicle type and / or total mass limit corresponding to the vehicle can be accurately queried, thereby providing richer vehicle detection information.
[0103] Optionally, determining the vehicle type and / or the total mass limit of the vehicle according to the number of axles of the vehicle and the change in the number of axle arrangements between consecutive video frames includes:
[0104] Counting the maximum value of the number of wheel axle arrangements in all video frames of the target video, and determining a corresponding vehicle identification sub-process according to the maximum value;
[0105] The vehicle type and / or the total mass limit of the vehicle are determined according to the number of axles of the vehicle and the change in the number of axle arrangements between the video frames identified by the vehicle identification sub-process.
[0106] In the embodiment of the present application, for a video frame obtained by photographing a vehicle passing through the camera area, it is assumed that a preset axle detection window can only simultaneously contain at most three axle images that meet the conditions (wherein, meeting the conditions means that the area of the axle image falling within the axle detection window is greater than the preset area). For each video frame, the corresponding number of axle arrangements may include the following four types:
[0107] (1) There is no axle image that meets the conditions in the preset axle detection window of the video frame, that is, the number of axle arrangements is 0, and the video frame is marked as W0;
[0108] (2) The video frame contains a wheel axle image that meets the conditions within the preset wheel axle detection window, that is, the number of wheel axle arrangements is 1, and the video frame is marked as W1;
[0109] (3) There are two wheel axle images that meet the conditions in the preset wheel axle detection window of the video frame, that is, the number of wheel axle arrangements is 2, and the video frame is marked as W2;
[0110] (4) There are three wheel axle images that meet the conditions within the preset wheel axle detection window in the video frame, that is, the number of wheel axle arrangements is 3, and the video frame is marked as W3.
[0111] The schematic diagrams corresponding to the above four situations are as follows Figure 6 shown.
[0112] In the embodiment of the present application, since the target video is a video recording the process of the vehicle from entering the camera area to leaving the camera area, the maximum value of the number of wheel axle arrangements in all video frames of the target video is at least 1, that is, there is at least a video frame marked as W1; the maximum value of the number of wheel axle arrangements can also be 2 or 3. According to the maximum value of the number of wheel axle arrangements, the number of wheel axles of the maximum adjacent arrangement of the vehicle can be basically determined, thereby determining the corresponding vehicle identification sub-process. Corresponding to the maximum value of the number of wheel axle arrangements that may appear in the target video, the vehicle identification sub-process includes: vehicle identification sub-process 1 corresponding to the maximum value 1, vehicle identification sub-process 2 corresponding to the maximum value 2, and vehicle identification sub-process 3 corresponding to the maximum value 3.
[0113] After determining the corresponding vehicle identification sub-process according to the maximum value of the number of wheel axle arrangements of the target video, the actual wheel axle group arrangement of the vehicle can be determined according to the number of vehicle axles of the vehicle determined in step S204 and the vehicle identification sub-process, thereby determining the vehicle type and / or total mass limit of the vehicle. Specifically, if the maximum value of the number of wheel axle arrangements is 1, it means that each wheel axle of the vehicle is a single wheel axle arranged separately, that is, the axle group type only has a single axle group, and there is no double axle group or triple axle group. All vehicle types that only contain single axles and their total mass limits can be listed to obtain the following Table 2; the corresponding vehicle identification sub-process 1 when the maximum value is 1 may include: according to the number of vehicle axles, query Table 2 to obtain the corresponding vehicle type and / or total mass limit.
[0114] Table 2:
[0115]
[0116] Specifically, if the maximum number of axle arrangements is 2, it means that the vehicle has a dual-axle group. At this time, all possible state transition processes of the axle image of the vehicle with two adjacent axles passing through the axle detection window can be listed, such as Figure 7 As shown. Figure 7 In the figure, each circle is the axle count state mark of the vehicle, where S0 is the starting state mark, and in other state marks, the first letter S represents the state, the second number represents the accumulated axle count, and the third letter is used to distinguish different axle arrangements under the same axle count; specifically, when the maximum number of axle arrangements is 2, it means that for each video frame in the target video, there are the three video frame markings of W0, W1, and W2 mentioned above. According to the time arrangement order, the video frame marks of each video frame in the target video are used as input marks in turn. Figure 7 The state identifier in the state identifier is converted into a state according to the conversion condition of the input tag. When the video frame tags of each video frame in the target video have been input as input tags, the final state identifier is obtained; the correspondence between the final state identifier and the number of vehicle axles, vehicle type, and total mass limit is shown in Table 3.
[0117] Table 3:
[0118]
[0119] in, Figure 7The state that exists but does not exist in Table 3 is marked as an unreasonable state that cannot be the final state mark. In the embodiment of the present application, when the maximum number of wheel axle arrangements of the target video is 2, the corresponding vehicle identification sub-process 2 is: take S0 as the initial state, and take the video frame mark (W0, W1 or W2) of each frame of the target video arranged in time sequence as the input mark, according to Figure 7 The final status identification is obtained, and Table 3 is queried to obtain the vehicle type and total mass limit of the vehicle.
[0120] Specifically, if the maximum number of axle arrangements is 3, it means that the vehicle has a three-axle group. At this time, all possible state transition processes of the axle image of the vehicle with three adjacently arranged axles passing through the axle detection window can be listed, such as Figure 8 As shown. Figure 8 In the figure, each circle is the axle count state mark of the vehicle, where S0 is the starting state mark, and in other state marks, the first letter S represents the state, the second number represents the accumulated axle count, and the third letter is used to distinguish different axle arrangements under the same axle count; specifically, the maximum value of the axle arrangement number is 3, indicating that for each video frame in the target video, there are the above-mentioned four video frame marking situations of W0, W1, W2, and W3. In chronological order, the video frame marks of each video frame in the target video are used as input marks in turn, according to Figure 8 The state identification in the state identification and the conversion condition of the input tag are used for state conversion. When the video frame tags of each video frame in the target video have been input as input tags, the final state identification is obtained; the correspondence between the final state identification and the number of vehicle axles, vehicle type, and total mass limit is shown in Table 4:
[0121] Table 4:
[0122]
[0123] in, Figure 8 The state that exists but does not exist in Table 4 is marked as an unreasonable state that cannot be the final state mark. In the embodiment of the present application, when the maximum number of wheel axle arrangements of the target video is 3, the corresponding vehicle identification sub-process 3 is: take S0 as the initial state, and take the video frame mark (W0, W1, W2 or W3) of each frame of the target video arranged in time sequence as the input mark, according to Figure 8 The final status identification is obtained, and Table 3 is queried to obtain the vehicle type and total mass limit of the vehicle.
[0124] In an embodiment of the present application, since the corresponding vehicle identification sub-process can be determined based on the maximum number of axle arrangements in the target video to distinguish the vehicle type and total mass limit determination process of different types of vehicles, the determination of the vehicle type and / or total mass limit can be achieved more efficiently and accurately.
[0125] In the embodiment of the present application, since the target video is a video corresponding to the time period from when the vehicle enters the camera area to when it leaves the camera area, the wheel axle detection result includes the information of the wheel axle image, so the wheel axle detection result of each frame of the target video determined can completely and continuously represent the image information corresponding to each wheel axle during the duration of the vehicle passing through the camera area (that is, the information of each wheel axle image); then, based on the information of each wheel axle image included in all the wheel axle detection results, an adaptive wheel axle quantity calculation window is determined, since the adaptive wheel axle quantity calculation window represents an image detection area estimated to be located at the target position and capable of containing a single wheel axle image, that is, the adaptive wheel axle quantity calculation window is a fixed image detection area where the wheel axle image may appear, the adaptive wheel axle quantity calculation window is determined. The axle quantity calculation window should correspond to a fixed actual spatial area (hereinafter referred to as the designated spatial area) in the camera area where the vehicle axle may pass, so that the axle image of each video frame determined in the adaptive axle quantity calculation window according to the axle detection results of each video frame and the adaptive number calculation window can reflect the axle passing situation of the vehicle in the designated spatial area of the actual camera area (i.e., the actual physical space) at each time point, so that finally, according to the axle image of each consecutive video frame appearing in the adaptive axle quantity calculation window, the number of axles passed by the vehicle in the actual designated spatial area can be reflected based on the continuity of time and the fixity of spatial position, thereby accurately obtaining the vehicle axle number of the vehicle.
[0126] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0127] Embodiment 2:
[0128] Fig. 9 A schematic diagram of the structure of a vehicle axle number determination device provided in an embodiment of the present application is shown. For ease of description, only the parts related to the embodiment of the present application are shown:
[0129] The vehicle axle number determination device comprises: an axle detection result determination unit 91, an adaptive axle number calculation window determination unit 92, an axle image appearance determination unit 93, and a vehicle axle number determination unit 94. Among them:
[0130] The wheel axle detection result determination unit 91 is used to determine the wheel axle detection result of each frame in the target video, wherein the target video is a video corresponding to the time period from the vehicle entering the camera area to leaving the camera area; the wheel axle detection result includes information of the wheel axle image; the wheel axle image is an image corresponding to a single wheel axle of the vehicle.
[0131] The adaptive wheel axle quantity calculation window determination unit 92 is used to determine the adaptive wheel axle quantity calculation window of the target video according to the information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent: an image detection area estimated to be located at the target position and capable of containing a single wheel axle image.
[0132] The wheel axle image occurrence determination unit 93 is used to determine the occurrence of the wheel axle image in each of the video frames in the adaptive wheel axle quantity calculation window according to the wheel axle detection results of each of the video frames and the adaptive wheel axle quantity calculation window.
[0133] The vehicle axle number determination unit 94 is used to determine whether the axle image appears in the adaptive axle number calculation window for each frame of the video frame according to the axle detection result of each frame of the video frame and the adaptive axle number calculation window.
[0134] Optionally, the axle detection result determination unit 91 includes a first determination module and a second determination module:
[0135] A first determination module is used to obtain each video frame obtained by shooting the side of the vehicle in a time period from a first moment to a second moment, and determine the wheel axle detection result of the video frame; wherein the first moment is the moment when the vehicle is detected to enter the camera area, and the second moment is the moment when the vehicle is detected to leave the camera area;
[0136] The second determination module is used to determine the wheel axle detection results of each video frame determined in the time period from the first moment to the second moment as: the wheel axle detection results of each video frame in the target video.
[0137] Optionally, the wheel axle detection result determination unit 91 is specifically used to determine the wheel axle detection result of each video frame in the target video according to the video frames in the target video and a pre-trained deep learning model.
[0138] Optionally, the information of the axle image includes the size and vertex coordinates of the axle identification frame, and the axle identification frame is the minimum circumscribed quadrilateral frame of the axle image. Correspondingly, the adaptive axle quantity calculation window determination unit 92 includes: a target size determination module, a target position determination module and an adaptive axle quantity calculation window determination module:
[0139] A target size determination module, used to determine the target size according to the size and / or vertex coordinates of each of the wheel axle identification frames;
[0140] A target position determination module, used to determine the target position according to preset horizontal position information and the vertex coordinates of the wheel axle identification frame;
[0141] The adaptive wheel axle quantity calculation window determination module is used to use the target size as the size of the adaptive wheel axle quantity calculation window and the target position as the position of the adaptive wheel axle quantity calculation window to obtain the adaptive wheel axle quantity calculation window of the target video.
[0142] Optionally, an axle count mark is used to indicate the situation in which the axle image appears in the video frame in the adaptive axle quantity calculation window. Correspondingly, the axle image occurrence situation determination unit 93 is specifically used to determine the axle count mark of each video frame according to the axle detection result of each video frame and the adaptive axle quantity calculation window; the axle count mark includes a first count mark and a second count mark, the first count mark indicates that the video frame has a single axle image that meets the conditions in the adaptive axle quantity calculation window, and the second count mark indicates that the video frame does not have a single axle image that meets the conditions in the adaptive axle quantity calculation window;
[0143] Correspondingly, the vehicle axle number determination unit 94 is specifically configured to determine the vehicle axle number of the vehicle according to changes in the axle count identifiers between consecutive video frames.
[0144] Optionally, the information of the axle image includes information of an axle identification frame, and the axle identification frame is the minimum circumscribed quadrilateral frame of the axle image. Correspondingly, in the axle image occurrence determination unit 93, the axle count identifier of each video frame is determined according to the axle detection results of the video frames of each frame and the adaptive axle quantity calculation window, including: for each video frame, if the video frame has an axle identification frame that overlaps with the adaptive axle quantity calculation window, and the ratio of the overlapping area of the axle identification frame and the adaptive axle quantity calculation window to the area of the axle identification frame is greater than a preset ratio, then the axle count identifier of the video frame is determined to be a first count identifier; otherwise, the axle count identifier of the video frame is determined to be a second count identifier.
[0145] Optionally, the vehicle axle number determination device further includes:
[0146] A detection unit, used to determine the number of wheel axle arrangements in each frame of the video frame according to the wheel axle detection results of each frame of the video frame and a preset wheel axle detection window; wherein the wheel axle detection window is a preset image detection area that can contain at least 3 adjacently arranged wheel axle images in the video frame; the number of wheel axle arrangements is used to represent the number of wheel axle images that appear in the preset wheel axle detection window in the video frame; and determine the vehicle type and / or total mass limit of the vehicle according to the number of vehicle axles of the vehicle and the change in the number of wheel axle arrangements between consecutive frames of the video frames.
[0147] Optionally, in the detection unit, determining the vehicle type and / or the total mass limit of the vehicle according to the number of vehicle axles of the vehicle and the change in the number of wheel axle arrangements between consecutive video frames includes:
[0148] Counting the maximum value of the number of wheel axle arrangements in all video frames of the target video, and determining a corresponding vehicle identification sub-process according to the maximum value;
[0149] The vehicle type and / or the total mass limit of the vehicle are determined according to the number of axles of the vehicle and the change in the number of axle arrangements between the video frames identified by the vehicle identification sub-process.
[0150] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0151] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0152] Embodiment three:
[0153] Fig.10is a schematic diagram of an electronic device provided by an embodiment of the present application. Fig.10 As shown, the electronic device 10 of this embodiment includes: a processor 100, a memory 101, and a computer program 102 stored in the memory 101 and executable on the processor 100, such as a vehicle axle number determination program. When the processor 100 executes the computer program 102, the steps in the above-mentioned vehicle axle number determination method embodiments are implemented, such as Figure 2 Alternatively, when the processor 100 executes the computer program 102, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Fig. 9 The functions of the units 91 to 94 are shown.
[0154] Exemplarily, the computer program 102 may be divided into one or more modules / units, which are stored in the memory 101 and executed by the processor 100 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 102 in the electronic device 10. For example, the computer program 102 may be divided into an axle detection result determination unit, an adaptive axle number calculation window determination unit, an axle image appearance determination unit, and a vehicle axle number determination unit, and the specific functions of each unit are as follows:
[0155] The wheel axle detection result determination unit is used to determine the wheel axle detection result of each frame in the target video, wherein the target video is a video corresponding to the time period from the vehicle entering the camera area to leaving the camera area; the wheel axle detection result includes information of the wheel axle image; the wheel axle image is an image corresponding to a single wheel axle of the vehicle.
[0156] The adaptive wheel axle quantity calculation window determination unit is used to determine the adaptive wheel axle quantity calculation window of the target video according to the information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent: an image detection area estimated to be located at the target position and capable of containing a single wheel axle image.
[0157] The wheel axle image occurrence determination unit is used to determine the occurrence of the wheel axle image in each frame of the video frame in the adaptive wheel axle quantity calculation window according to the wheel axle detection results of each frame of the video frame and the adaptive wheel axle quantity calculation window.
[0158] The vehicle axle number determination unit is used to determine the situation in which the axle image appears in the adaptive axle number calculation window of each frame of the video frame according to the axle detection result of each frame of the video frame and the adaptive axle number calculation window.
[0159] The electronic device 10 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 100 and a memory 101. Those skilled in the art will appreciate that Fig.10 It is only an example of the electronic device 10 and does not constitute a limitation of the electronic device 10. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0160] The processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0161] The memory 101 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10. The memory 101 may also be an external storage device of the electronic device 10, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 10. Further, the memory 101 may also include both an internal storage unit of the electronic device 10 and an external storage device. The memory 101 is used to store the computer program and other programs and data required by the electronic device. The memory 101 may also be used to temporarily store data that has been output or is to be output.
[0162] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0165] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0166] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for determining the number of vehicle axles, characterized in that: include: Determine the wheel axle detection result of each video frame in the target video, wherein the target video is a video corresponding to the time period from when the vehicle enters the camera area to when it leaves the camera area; the wheel axle detection result includes information of the wheel axle image; The wheel axle image is an image corresponding to a single wheel axle of the vehicle; Determine an adaptive wheel axle quantity calculation window of the target video according to information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent: an image detection area estimated to be located at the target position and capable of containing a single wheel axle image; Determine, according to the axle detection result of each video frame and the adaptive axle quantity calculation window, whether the axle image appears in each video frame in the adaptive axle quantity calculation window; Determining the number of axles of the vehicle according to the occurrence of the axle image in the adaptive axle number calculation window in each of the consecutive video frames; Indicating that the axle count mark indicates that the video frame has the axle image in the adaptive axle quantity calculation window, and correspondingly, determining that the axle image appears in each video frame in the adaptive axle quantity calculation window according to the axle detection result of each video frame and the adaptive axle quantity calculation window, includes: Determine the wheel axle count identifier of each frame of the video frame according to the wheel axle detection result of each frame of the video frame and the adaptive wheel axle quantity calculation window; the wheel axle count identifier includes a first count identifier and a second count identifier, the first count identifier indicates that the video frame has a single wheel axle image that meets the conditions in the adaptive wheel axle quantity calculation window, and the second count identifier indicates that the video frame does not have a single wheel axle image that meets the conditions in the adaptive wheel axle quantity calculation window; Correspondingly, determining the number of axles of the vehicle according to the occurrence of the axle image in each of the consecutive video frames in the adaptive axle number calculation window includes: The number of axles of the vehicle is determined according to changes in the axle count identifier between consecutive video frames.
2. The method for determining the number of vehicle axles according to claim 1, characterized in that: The step of determining the wheel axle detection result of each video frame in the target video includes: Acquire each video frame obtained by shooting the side of the vehicle in a time period from a first moment to a second moment, and determine the wheel axle detection result of the video frame; wherein the first moment is the moment when the vehicle is detected to enter the camera area, and the second moment is the moment when the vehicle is detected to leave the camera area; The wheel axle detection results of each video frame determined in the time period from the first moment to the second moment are determined as: the wheel axle detection results of each video frame in the target video.
3. The method for determining the number of vehicle axles according to claim 1, characterized in that: The step of determining the wheel axle detection result of each video frame in the target video includes: According to the video frames of each frame in the target video and the pre-trained deep learning model, the wheel axle detection result of each frame in the target video is determined.
4. The method for determining the number of vehicle axles according to claim 1, characterized in that: The information of the wheel axle image includes the size and vertex coordinates of the wheel axle identification frame, and the wheel axle identification frame is the minimum circumscribed quadrilateral frame of the wheel axle image. Correspondingly, determining the adaptive wheel axle quantity calculation window of the target video according to the information of each wheel axle image includes: Determining a target size according to the size and / or vertex coordinates of each of the wheel axle identification frames; Determine the target position according to the preset horizontal position information and the vertex coordinates of the wheel axle identification frame; The target size is used as the size of the adaptive wheel-axle quantity calculation window, and the target position is used as the position of the adaptive wheel-axle quantity calculation window to obtain the adaptive wheel-axle quantity calculation window of the target video.
5. The method for determining the number of vehicle axles according to claim 1, characterized in that: The information of the wheel axle image includes information of the wheel axle identification frame, and the wheel axle identification frame is a minimum circumscribed quadrilateral frame of the wheel axle image. Correspondingly, determining the wheel axle count identifier of each frame of the video frame according to the wheel axle detection result of each frame of the video frame and the adaptive wheel axle quantity calculation window respectively includes: For each video frame, if the video frame has an axle identification frame that overlaps with the adaptive axle quantity calculation window, and the ratio of the overlapping area of the axle identification frame and the adaptive axle quantity calculation window to the area of the axle identification frame is greater than a preset ratio, then the axle counting identifier of the video frame is determined to be a first counting identifier; otherwise, the axle counting identifier of the video frame is determined to be a second counting identifier.
6. The method for determining the number of vehicle axles according to any one of claims 1 to 5, characterized in that: After determining the number of vehicle axles of the vehicle, the method further includes: Determining the number of wheel axle arrangements of each video frame according to the wheel axle detection result of each video frame and a preset wheel axle detection window; wherein the wheel axle detection window is a preset image detection area that can contain at least three adjacently arranged wheel axle images in the video frame; the number of wheel axle arrangements is used to represent the number of wheel axle images that appear in the preset wheel axle detection window in the video frame; The vehicle type and / or the total mass limit of the vehicle are determined according to the number of vehicle axles of the vehicle and the change in the number of wheel axle arrangements between consecutive video frames.
7. The method for determining the number of vehicle axles according to claim 6, characterized in that: Determining the vehicle type and / or the total mass limit of the vehicle according to the number of axles of the vehicle and the change in the number of axle arrangements between consecutive video frames includes: Counting the maximum value of the number of wheel axle arrangements in all video frames of the target video, and determining a corresponding vehicle identification sub-process according to the maximum value; The vehicle type and / or the total mass limit of the vehicle are determined according to the number of axles of the vehicle and the change in the number of axle arrangements between the video frames identified by the vehicle identification sub-process.
8. A device for determining the number of vehicle axles, characterized in that: include: The wheel axle detection result determination unit is used to determine the wheel axle detection result of each video frame in the target video, wherein the target video is a video corresponding to the time period from when the vehicle enters the camera area to when it leaves the camera area; the wheel axle detection result includes information of the wheel axle image; the wheel axle image is an image corresponding to a single wheel axle of the vehicle; An adaptive wheel axle quantity calculation window determination unit is used to determine the adaptive wheel axle quantity calculation window of the target video according to the information of each wheel axle image; the adaptive wheel axle quantity calculation window is used to represent: an image detection area estimated to be located at the target position and capable of containing a single wheel axle image; a wheel axle image appearance determination unit, configured to determine the appearance of the wheel axle image in each of the video frames in the adaptive wheel axle number calculation window according to the wheel axle detection result of each of the video frames and the adaptive wheel axle number calculation window; a vehicle axle number determination unit, configured to determine, based on the axle detection results of each video frame and the adaptive axle number calculation window, whether the axle image appears in each video frame in the adaptive axle number calculation window; The wheel axle image occurrence determination unit is specifically used to: determine the wheel axle count identifier of each frame of the video frame according to the wheel axle detection result of each frame of the video frame and the adaptive wheel axle quantity calculation window; the wheel axle count identifier includes a first count identifier and a second count identifier, the first count identifier indicates that the video frame has a single wheel axle image that meets the conditions in the adaptive wheel axle quantity calculation window, and the second count identifier indicates that the video frame does not have a single wheel axle image that meets the conditions in the adaptive wheel axle quantity calculation window; Correspondingly, the vehicle axle number determination unit is specifically used to determine the vehicle axle number of the vehicle according to the change of the axle count identifier between consecutive video frames.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the electronic device implements the steps of the method according to any one of claims 1 to 7.
