Parking detection method and system and computer storage medium

Through the sliding window and the moving quantity feature extraction model, combined with the feature comparison of the ROI area, the problems of difficulty in judging the parking stability of the close-range vehicle in the prior art are solved, and fast and accurate parking detection is achieved.

CN119027846APending Publication Date: 2024-11-26SHENZHEN MAXVISION TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310582046.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2024-11-26

Smart Images

  • Figure CN119027846A_ABST
    Figure CN119027846A_ABST
Patent Text Reader

Abstract

The invention provides a parking detection method and system, and the method comprises the steps: obtaining a parking video stream, carrying out the target detection of each frame of picture in the video stream, and obtaining a vehicle detection frame of each frame of picture; s2, grouping the detection results of every continuous N frames based on a sliding window, wherein N is a natural number; s3, target tracking is carried out according to the target detection result of the N frames of pictures of each group, and the movement condition of the vehicle detection frame of each frame of picture is obtained; s4, calculating the movement amount of the vehicle according to the target tracking result of the N frames of pictures of each group, judging whether the vehicle is stably parked or not according to the movement amount of the vehicle, judging that the vehicle is not stably parked if the movement amount of the vehicle is greater than a set threshold value, and otherwise, entering the step S5; and S5, extracting the ROI in each frame of each group, and judging whether the vehicle is stably parked or not according to whether the ROI deviates or not. By adopting the parking detection method provided by the invention, whether the vehicle is stably parked or not can be quickly judged, and parking detection under the shielding condition can be adapted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation, and in particular to a parking detection method, system and computer storage medium. Background Art

[0002] Judging whether a vehicle is completely stopped based on video images is an important function in the field of smart transportation. Currently, a commonly used parking detection solution is: vehicle target detection + post-processing logic judgment. That is, take multiple pictures of the vehicle and use the target detection model to detect whether the pictures are exactly the same. If they are the same, the vehicle is judged to be stopped, otherwise it is judged that the vehicle is not stable. This solution has two problems.

[0003] Question 1: As we all know, the current convolutional neural network is essentially a nonlinear function with a large number of parameters. The core function of the target detection model is to perform nonlinear mapping on the input pixel value matrix to obtain the corresponding output target frame and target category. Since there must be pixel-level differences in the continuous frames of the video as the input, even if the same vehicle is completely stationary, the target frame obtained by the detection model may still have changes in width, height and center position. The jitter amplitude of the target frame of a close-range vehicle may even be greater than the moving speed of a close-range slow-moving vehicle. Limited by the above characteristics of pure target detection, it becomes more difficult to judge whether a close-range slow-moving vehicle has stopped. Even if the solution can eventually accurately determine whether it is "completely stopped", it still needs to perform logical judgment and probability statistics based on more frames of images, which sacrifices real-time performance to a certain extent.

[0004] Question 2: In some scenarios, the target vehicle may be parked in a location with obstacles, causing the vehicle body to be partially blocked, which in turn causes a large change in the position scale of the target frame and reduces the accuracy of detection. Summary of the invention

[0005] The object of the present invention is to provide a parking detection method, system and computer storage medium which can quickly determine whether a vehicle is parked and can adapt to obstruction conditions.

[0006] In an embodiment of the present invention, a parking detection method is provided, which includes:

[0007] S1: Obtain the parking video stream and perform target detection on each frame in the video stream to obtain the vehicle detection frame of each frame;

[0008] S2: Group the detection results of each N consecutive frames based on the sliding window, where N is a natural number;

[0009] S3: Target tracking is performed based on the target detection results of each group of N frames to obtain the movement of the vehicle detection frame of each frame;

[0010] S4: Calculate the movement of the vehicle according to the target tracking results of each group of N frames and judge whether the vehicle is stable according to the movement of the vehicle. If the movement of the vehicle is greater than the set threshold, it is judged that the vehicle is not stable, otherwise, enter step S5;

[0011] S5: extracting the ROI region in each group of frames, and judging whether the vehicle is stopped stably according to whether the ROI region is offset.

[0012] In the embodiment of the present invention, in step S5, extracting the ROI area in each group of frames, and judging whether the vehicle is stopped stably according to whether the ROI area is offset, includes:

[0013] S51: based on the target tracking sequence of each group, obtaining the ROI region of each frame of each group;

[0014] S52: extracting features of the ROI region of each group of frames based on the trained motion feature extraction model to obtain a feature vector sequence;

[0015] S53: Compare the extracted feature vector sequence to determine whether there is a pixel-level offset. If there is a pixel-level offset, it is determined that the vehicle has not stopped steadily; otherwise, it is determined that the vehicle has stopped steadily.

[0016] In the embodiment of the present invention, in step S51, based on the target tracking sequence of each group, the ROI region of each frame of each group is obtained, including:

[0017] The coordinate assignment method of the ROI area of ​​each group of frames is as follows: the center point is selected as the center of the vehicle detection frame of the first frame, the width and height use the set fixed values, and if it exceeds the boundary of the detection frame, it is filled.

[0018] In the embodiment of the present invention, in step S52, the movement feature extraction model adopts a deep learning model.

[0019] In the embodiment of the present invention, in step S2, the detection results of each consecutive N frames are grouped based on the sliding window, including:

[0020] The 1st frame to the Nth frame is the first group, the 2nd frame to the (N+1)th frame is the second group, the 3rd frame to the (N+2)th frame is the third group, and so on.

[0021] In the embodiment of the present invention, in step S4, the movement amount of the vehicle is calculated according to the target tracking results of each group of N frames of pictures, including:

[0022] Get the coordinates of the vehicle detection frame of two adjacent frames;

[0023] Calculate the displacement of the vehicle detection frame between two adjacent frames, which is the movement of the vehicle.

[0024] In an embodiment of the present invention, a parking detection system is further provided, which uses the above parking detection method when detecting whether a vehicle is stopped stably.

[0025] In an embodiment of the present invention, a computer storage medium is further provided, wherein a computer program is stored in the computer storage medium, and when the computer program is executed, the above-mentioned parking detection method is implemented.

[0026] Compared with the prior art, the vehicle detection method and system of the present invention can accurately determine whether there is pixel-level movement by comparing the features of two frames of ROI images, thereby determining whether the vehicle is stopped more quickly and accurately; furthermore, the model-based feature comparison method is more stable than the simple image pixel difference method; in addition, if the vehicle is partially blocked, the ROI area cutout method is used to only extract the area within the visible part, which can greatly reduce the instability problem caused by the large changes in the position scale of the target frame caused by the occlusion of the vehicle body. Therefore, the vehicle detection method and system of the present invention can not only quickly judge the slow movement of close-range vehicles, but also improve the parking judgment under occlusion. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of the parking detection method provided by an embodiment of the present invention.

[0028] Figure 2 It is a training flow chart of the movement feature extraction model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and optimal pixel points of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0030] The implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0031] In an embodiment of the present invention, a parking detection method is provided, which includes steps S1 to S5, which are described below respectively.

[0032] S1: Obtain the parking video stream and perform target detection on each frame in the video stream to obtain the vehicle detection frame of each frame.

[0033] It should be noted that when performing parking detection, a camera is usually used to shoot the vehicle. Then, a set target detection model is used to perform target detection on each frame of the captured video stream, and the vehicle is detected and framed with a vehicle detection frame.

[0034] S2: Group the detection results of every N consecutive frames based on the sliding window, where N is a natural number.

[0035] Specifically, the detection results of each N consecutive frames are grouped based on the sliding window, including:

[0036] The 1st frame to the Nth frame are the first group, the 2nd frame to the (N+1)th frame are the second group, the 3rd frame to the (N+2)th frame are the third group, and so on. The length of each sliding window is set to N, and then it slides step by step to group all the image frames.

[0037] S3: Target tracking is performed based on the target detection results of each group of N frames of images to obtain the movement of the vehicle detection frame of each frame of the image.

[0038] It should be noted that after target detection is performed in step S1, target tracking can be performed on the group in step S2 to obtain the movement of the vehicle detection frame in each frame of the image.

[0039] S4: According to the target tracking results of each group of N frames, the movement of the vehicle is calculated and whether the vehicle is stopped is determined based on the movement of the vehicle. If the movement of the vehicle is greater than the set threshold, it is determined that the vehicle is not stopped, otherwise it goes to step S5.

[0040] It should be noted that in step S4, the movement amount of the vehicle is calculated according to the target tracking results of each group of N frames of pictures, including:

[0041] Get the coordinates of the vehicle detection frame of two adjacent frames;

[0042] Calculate the displacement of the vehicle detection frame between two adjacent frames, which is the movement of the vehicle.

[0043] S5: extracting the ROI (region of interest) area in each group of frames, and judging whether the vehicle is stopped stably according to whether there is an offset in the ROI area.

[0044] Specifically, in the embodiment of the present invention, in step S5, extracting the ROI area in each group of frames, and judging whether the vehicle is stopped stably according to whether the ROI area is offset includes:

[0045] S51: based on the target tracking sequence of each group, obtaining the ROI region of each frame of each group;

[0046] S52: extracting features of the ROI region of each group of frames based on the trained motion feature extraction model to obtain a feature vector sequence;

[0047] S53: Compare the extracted feature vector sequence to determine whether there is a pixel-level offset. If there is a pixel-level offset, it is determined that the vehicle has not stopped steadily; otherwise, it is determined that the vehicle has stopped steadily.

[0048] Specifically, in step S51, the method of extracting the ROI region of each group of frames is as follows:

[0049] The coordinate assignment method of the ROI area of ​​each frame is as follows: the center point is selected as the center of the vehicle detection frame of the first frame of each group, the width and height use the set fixed values, and if they exceed the boundary of the detection frame, they are filled. Using the above method, the ROI area of ​​each frame is cut out.

[0050] In step S52, the movement feature extraction model uses a preset deep learning model trained by a deep learning framework such as pytorch, TensorFlow, or caffe. After pre-training, it can be used to extract the feature vector of the ROI area. The training process is as follows: Figure 2 shown.

[0051] Furthermore, in an embodiment of the present invention, a parking detection system is provided, which uses the above-mentioned parking detection method when detecting whether a vehicle is stopped stably.

[0052] Furthermore, in an embodiment of the present invention, a computer storage medium is provided, in which a computer program is stored. When the computer program is executed, the above-mentioned parking detection method is implemented.

[0053] In summary, the vehicle detection method and system of the present invention can accurately determine whether there is pixel-level movement by performing feature comparison on two frames of ROI images, thereby determining whether the vehicle is stopped more quickly and accurately; furthermore, the model-based feature comparison method is more stable than the simple image pixel difference method; in addition, if the vehicle is partially blocked, the ROI area cutout method is used to only extract the area within the visible part, which can greatly reduce the instability problem caused by the large changes in the position scale of the target frame caused by the occlusion of the vehicle body. Therefore, the vehicle detection method and system of the present invention can not only quickly judge the slow movement of close-range vehicles, but also improve the parking judgment under occlusion.

[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A parking detection method, characterized in that: include: S1: Obtain the parking video stream and perform target detection on each frame in the video stream to obtain the vehicle detection frame of each frame; S2: Group the detection results of each N consecutive frames based on the sliding window, where N is a natural number; S3: Target tracking is performed based on the target detection results of each group of N frames to obtain the movement of the vehicle detection frame of each frame; S4: Calculate the movement of the vehicle according to the target tracking results of each group of N frames and judge whether the vehicle is stable according to the movement of the vehicle. If the movement of the vehicle is greater than the set threshold, it is judged that the vehicle is not stable, otherwise, enter step S5; S5: extracting the ROI region in each group of frames, and judging whether the vehicle is stopped stably according to whether the ROI region is offset.

2. The parking detection method according to claim 1, characterized in that: In step S5, the ROI region in each group of frames is extracted, and whether the vehicle is stopped is judged according to whether there is an offset in the ROI region, including: S51: based on the target tracking sequence of each group, obtaining the ROI region of each frame of each group; S52: extracting features of the ROI region of each group of frames based on the trained motion feature extraction model to obtain a feature vector sequence; S53: Compare the extracted feature vector sequence to determine whether there is a pixel-level offset. If there is a pixel-level offset, it is determined that the vehicle has not stopped steadily; otherwise, it is determined that the vehicle has stopped steadily.

3. The parking detection method according to claim 2, characterized in that: In step S51, based on the target tracking sequence of each group, the ROI region of each frame of each group is obtained, including: The coordinate assignment method of the ROI area of ​​each group of frames is as follows: the center point is selected as the center of the vehicle detection frame of the first frame, the width and height use the set fixed values, and if it exceeds the boundary of the detection frame, it is filled.

4. The parking detection method according to claim 2, characterized in that: In step S52, the movement amount feature extraction model adopts a deep learning model.

5. The parking detection method according to claim 1, characterized in that: In step S2, the detection results of each N consecutive frames are grouped based on the sliding window, including: The 1st frame to the Nth frame is the first group, the 2nd frame to the (N+1)th frame is the second group, the 3rd frame to the (N+2)th frame is the third group, and so on.

6. The parking detection method according to claim 1, characterized in that: In step S4, the movement amount of the vehicle is calculated according to the target tracking results of each group of N frames of images, including: Get the coordinates of the vehicle detection frame of two adjacent frames; Calculate the displacement of the vehicle detection frame between two adjacent frames, which is the movement of the vehicle.

7. A parking detection system, characterized in that: When detecting whether the vehicle is stopped, the parking detection method as described in any one of claims 1 to 6 is adopted.

8. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed, the parking detection method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Highway abnormal event real-time early warning method driven by roadside edge calculation

    CN120339912A

  • Highway vehicle parking detection method and device based on unmanned aerial vehicle cruise

    CN121505493A