Berth detection alarm method and system
By conducting multi-dimensional analysis and fusion decision-making on berth detection methods, the problem of false alarms caused by short-term berthing or environmental interference in existing berth detection methods has been solved, improving the accuracy of berth status identification and the reliability of alarms.
Patent Information
- Application Number
- CN202511242832.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-11-21
AI Technical Summary
Existing berth detection methods suffer from false alarms due to short stops or environmental interference, resulting in inaccurate berth status identification and low alarm reliability.
By acquiring continuous image frames of the target berth, the berth area is located using an image segmentation algorithm, image features are extracted, and the state is initially identified through a first judgment model. If the state is to be judged, multi-dimensional analysis is performed to generate anomaly analysis results, which are then input into a second judgment model for fusion decision-making to generate an alarm signal.
It effectively solves the problem of false alarms caused by short-term berthing or environmental interference, and improves the accuracy of berth status identification and the reliability of alarms.
Smart Images

Figure CN120998031A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a parking space detection and alarm method and system. Background Technology
[0002] With the continuous increase in the number of motor vehicles in cities, parking demand continues to rise. The management efficiency of parking spaces has become an important factor affecting traffic order and resource utilization. In order to facilitate management and improve efficiency, various parking space detection and alarm methods have emerged in recent years to identify the occupancy status of parking spaces and issue prompts when abnormalities occur.
[0003] However, existing technologies often simply divide parking space status into two types: vacant or occupied. When a vehicle only stops briefly, such as temporarily picking up or dropping off passengers or unloading goods, or when environmental factors such as changes in light and shadow or moving objects obstruct the image recognition and cause a suspected occupancy signal, it will be directly judged as occupied, thus triggering an incorrect alarm and causing misjudgment of vehicles being parked beyond the permitted time or illegally occupied. Summary of the Invention
[0004] This invention provides a berth detection and alarm method and system, thereby effectively solving the problems pointed out in the background art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A berth detection alarm method includes:
[0007] Acquire consecutive image frames of the target berth;
[0008] The berth areas in the continuous image frames are identified, and the image features of the berth areas are extracted;
[0009] Based on the image features, the current state of the target berth is identified by a first judgment model to obtain a first judgment result, which includes an idle state, a stable occupied state, and a state to be judged.
[0010] When the first judgment result is the state to be judged, multi-dimensional analysis is performed through parallel processing to obtain anomaly analysis results;
[0011] The anomaly analysis results are input into the second judgment model for fusion decision-making. The second judgment model compares the weighted comprehensive value of multidimensional analysis with a preset threshold to obtain a second judgment result. If the second judgment result meets the alarm conditions, an alarm signal is generated.
[0012] Further, the berth areas in the continuous image frames are identified, and the image features of the berth areas are extracted, including:
[0013] The berth area is located based on an image segmentation algorithm, and corresponding image blocks are extracted.
[0014] Spatial features of the image blocks are extracted, and these spatial features are fused with appearance information at multiple scales.
[0015] Motion features are extracted from the continuous image frames, and these motion features are fused with the spatial features of the current frame to obtain the image features.
[0016] Furthermore, the first judgment model identifies the current state of the target berth and obtains a first judgment result, including:
[0017] The similarity between the spatial features of the current frame and the pre-stored free reference spatial features is calculated.
[0018] Analyze the change parameters of the motion characteristics within a preset time window;
[0019] A state determination signal is generated based on the combination relationship between the similarity calculation results and the changing parameters;
[0020] The status determination signal is mapped to the berth status type, and the first determination result is output.
[0021] Further, the similarity calculation is performed between the spatial features of the current frame and the pre-stored free reference spatial features, including:
[0022] Extract the color distribution features, texture features, and edge contour features of the berth area;
[0023] Each feature is aligned and normalized with the features in the free reference space at the same scale to obtain a feature similarity measure of color distribution, texture pattern and contour structure;
[0024] The feature similarity metrics are fused to generate a similarity value that shows the current berth area is close to the vacancy status.
[0025] Furthermore, when the first judgment result is the state to be determined, multi-dimensional analysis is performed through parallel processing to obtain anomaly analysis results, including:
[0026] Vehicle target identification is performed on the parking area in the current image frame, the vehicle presence confidence is calculated, and the spatial domain analysis results are output.
[0027] Establish a time series model of the state to be determined, count the duration of the state, analyze the persistence characteristics in the time dimension, and output the time domain analysis results;
[0028] Extract the trajectory of the moving target in the continuous image frames, calculate the matching degree between the trajectory of the moving target and the preset parking behavior pattern, and output the behavior domain analysis results;
[0029] The spatial domain analysis results, temporal domain analysis results, and behavioral domain analysis results are normalized and combined to generate the anomaly analysis results.
[0030] Furthermore, vehicle target recognition is performed on the parking space area in the current image frame, the vehicle presence confidence is calculated, and spatial domain analysis results are output, including: bounding box detection and contour extraction of the vehicle target in the parking space area, calculation of the occupied area ratio and position offset of the vehicle target, and generation of spatial domain analysis results based on the occupied area ratio and position offset.
[0031] Further, the trajectory of the moving target in the continuous image frames is extracted, and the matching degree between the trajectory of the moving target and the preset parking behavior pattern is calculated, including:
[0032] Optical flow calculations are performed on the continuous image frames to obtain the motion vector field of the berth area;
[0033] Based on the motion vector field, the moving target is detected and tracked, and the motion trajectory of the moving target in the image coordinate system is reconstructed.
[0034] The trajectory features of the motion trajectory are extracted, and the similarity between the trajectory features and the pre-stored typical parking behavior trajectory features is calculated. The similarity calculation result is output as the matching degree with the preset parking behavior pattern.
[0035] Furthermore, the anomaly analysis results are input into the second judgment model for fusion decision-making, including:
[0036] Based on the analysis results of each dimension, the stability in the continuous image frames is dynamically weighted to obtain the weighting factor.
[0037] The spatial domain analysis results and the temporal domain analysis results are weighted and fused to generate the first fusion result;
[0038] Based on the first fusion result, the weighted composite value is obtained by correcting the result through behavioral domain analysis.
[0039] A berth detection and alarm system, the system comprising:
[0040] The image frame acquisition module acquires continuous image frames of the target berth;
[0041] The berth area identification module identifies the berth area in the continuous image frames and extracts the image features of the berth area;
[0042] The first result acquisition module identifies the current state of the target berth based on the image features using a first judgment model, and obtains a first judgment result, which includes an idle state, a stable occupied state, and a pending judgment state.
[0043] The abnormal result acquisition module performs multi-dimensional analysis through parallel processing when the first judgment result is the state to be judged, and obtains the abnormal analysis result.
[0044] The alarm signal generation module inputs the anomaly analysis results into the second judgment model for fusion decision-making. The second judgment model compares the weighted comprehensive value of multidimensional analysis with a preset threshold to obtain a second judgment result. If the second judgment result meets the alarm conditions, an alarm signal is generated.
[0045] Furthermore, the berth area identification module includes:
[0046] The area positioning unit locates the berth area based on an image segmentation algorithm and extracts the corresponding image block;
[0047] The feature extraction unit extracts the spatial features of the image block, and the spatial features are fused with appearance information at multiple scales;
[0048] The feature fusion unit extracts motion features from the continuous image frames and fuses the motion features with the spatial features of the current frame to obtain the image features.
[0049] The technical solution of this invention can achieve the following technical effects:
[0050] This effectively solves the problem of false alarms caused by short stops or environmental interference in existing berth detection methods, and improves the accuracy of berth status identification and the reliability of alarms. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a flowchart illustrating a berth detection and alarm method.
[0053] Figure 2 A flowchart illustrating the process of identifying and extracting image features from berth areas;
[0054] Figure 3A flowchart illustrating the process of obtaining the first judgment result;
[0055] Figure 4 A flowchart illustrating the similarity calculation process;
[0056] Figure 5 A flowchart illustrating the process of performing multi-dimensional analysis and obtaining anomaly analysis results;
[0057] Figure 6 A flowchart illustrating the process of extracting the trajectory of a moving target and calculating the matching degree between the trajectory of the moving target and a preset parking behavior pattern;
[0058] Figure 7 A flowchart illustrating the process of making decisions based on the results of anomaly analysis. Detailed Implementation
[0059] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0061] Example 1
[0062] like Figure 1 As shown, the present invention provides a berth detection alarm method, the method comprising:
[0063] S1: Acquire consecutive image frames of the target berth;
[0064] Specifically, surveillance cameras can be installed above or to the side of the target parking area in the parking lot. The cameras are preferably image acquisition devices with high-definition resolution and wide dynamic range to ensure that clear image data can be obtained even in complex environments such as changes in lighting and shadows. The cameras maintain a stable viewing angle through fixed mounting brackets so that the entire parking area is within the shooting range. In order to meet the needs of subsequent recognition and processing, the cameras continuously acquire image sequences at a set frame rate to obtain continuous image frames arranged in chronological order. In order to improve image quality, the acquired image frames can be preprocessed, including image denoising, brightness equalization, and distortion correction, to eliminate interference caused by environmental noise and imaging defects of the camera itself.
[0065] S2: Identify the berth area in consecutive image frames and extract the image features of the berth area;
[0066] Specifically, in the acquired continuous image frames, it is first necessary to determine the image region where the target berth is located. The berth region can be determined by pre-calibrating the boundary coordinates, and these boundary information can be directly used to crop each frame of the image during subsequent processing to obtain the corresponding berth region image. Alternatively, an image processing-based detection method can be used, such as identifying ground marking lines or regional geometric features, to dynamically locate the berth position. After the berth region is identified, it is necessary to further extract the image features of the region. Preferred image features include two types of information: static features can be pixel distribution, texture patterns, and edge contours, while dynamic features reflect the entry, stay, or departure process of the vehicle target through the differences between consecutive frames. By extracting these image features, the appearance information and the temporal change trend of the berth region can be reflected simultaneously, thereby providing more comprehensive data support for subsequent status judgment.
[0067] S3: Based on image features, the current state of the target berth is identified through the first judgment model to obtain the first judgment result, which includes the idle state, the stable occupied state, and the undetermined state.
[0068] Specifically, the first judgment model performs a comprehensive analysis based on the input image features. When the detection results show that the features of the berth area are consistent with the idle scene, it is judged as an idle state; when a vehicle target is detected in consecutive frames and the state remains stable, it is judged as a stable occupied state; if the detection results are uncertain and cannot be directly classified as idle or stable occupied, it is judged as a pending judgment state. In the preferred method, the model can combine the consistency of multiple frames of images for judgment to reduce false alarms caused by instantaneous interference, such as changes in lighting, pedestrians passing by, or vehicles temporarily stopping. Specifically, when a vehicle only briefly stays in the berth area and does not show typical occupancy characteristics, the model will output a pending judgment state so that it can enter the subsequent further analysis stage. Through this step, the recognition results can be guaranteed to maintain real-time performance while having high stability and fault tolerance.
[0069] S4: When the first judgment result is a state to be judged, multi-dimensional analysis is performed through parallel processing to obtain the anomaly analysis result;
[0070] Specifically, this step uses parallel processing to comprehensively analyze continuous image frames from different angles to identify potential anomalies. For example, at the spatial level, it can detect whether there are significant features related to vehicles within the parking area; at the temporal level, it can observe whether the parking status remains in a certain state; and at the behavioral level, it can compare the dynamic characteristics of the target object. Multi-dimensional parallel analysis avoids misjudgments caused by the instability of a single judgment result. The result of multi-dimensional analysis generates intermediate anomaly analysis data, which reflects the multi-angle feature information of the parking status. This intermediate result is not the final alarm conclusion but serves as an important input for subsequent fusion decisions. In this way, the speed of the first judgment model can be preserved while introducing more comprehensive analysis in the pending judgment state, reducing the risk of false alarms caused by short-term occlusion, light flicker, or temporary parking.
[0071] S5: Input the anomaly analysis results into the second judgment model for fusion decision-making. The second judgment model compares the weighted comprehensive value of the multidimensional analysis with the preset threshold to obtain the second judgment result. If the second judgment result meets the alarm conditions, an alarm signal is generated.
[0072] Specifically, after completing the multi-dimensional analysis and obtaining the anomaly analysis results, the results are input into the second judgment model for fusion decision-making. The design of the second judgment model differs from the rapid binarization identification method of the first judgment model. It emphasizes the integration of multi-source information and robust judgment. The second judgment model first summarizes the feature results from different analysis dimensions to form a weighted comprehensive value. This value can reflect the overall trend of the berth status from multiple perspectives such as space, time, and behavior. Subsequently, the weighted comprehensive value is compared with a preset threshold. If it exceeds the threshold, it means that the credibility of the anomaly has reached or exceeded the set standard, thereby determining that there is abnormal occupancy or illegal parking in the berth and generating an alarm signal. The generation of the weighted comprehensive value takes into account the stability and confidence of the analysis results of each dimension, so that the weights can be dynamically adjusted. The second judgment model will automatically reduce the weight of the dimension, thereby avoiding misjudgment due to distortion of a single dimension.
[0073] This invention effectively solves the problem of false alarms caused by short-term berth stops or environmental interference in existing berth detection methods, and improves the accuracy of berth status identification and the reliability of alarms.
[0074] As a preferred embodiment of the above, such as Figure 2 As shown, step S2 involves identifying the berth area in consecutive image frames and extracting the image features of the berth area, including:
[0075] S21: Locate the berth area based on the image segmentation algorithm and extract the corresponding image block;
[0076] S22: Extract spatial features of image blocks, and fuse spatial features with appearance information at multiple scales;
[0077] S23: Combine continuous image frames to extract motion features, and fuse the motion features with the spatial features of the current frame to obtain image features.
[0078] Specifically, a deep learning-based image segmentation algorithm is preferred for locating the berth area. For example, a convolutional neural network or a segmentation model based on an improved U-Net structure can be used. This segmentation model can accurately identify the berth's location boundary within the image frame and extract corresponding image blocks for subsequent feature analysis. Compared to traditional manual rule-based detection methods, deep segmentation algorithms are better able to adapt to changes in lighting and complex backgrounds, thus ensuring the accuracy of berth location. After obtaining the image blocks of the berth area, spatial features are extracted from these blocks. These spatial features include not only low-level color histograms and texture statistics but also multi-scale appearance information, such as edge contours at different scales, structural gradient distributions, and local keypoint features. Scale fusion processing can capture the appearance differences of parking spaces at both the overall and local levels, thereby improving the ability to distinguish different states in complex scenes. For example, at low resolution, the model can capture the overall occupancy contour of the parking space, while at high resolution, it can identify local features of the vehicle body such as headlights or tire tracks. This combination of multi-level information can significantly improve the accuracy of judgment. Motion feature extraction can be achieved based on optical flow, inter-frame difference, or deep convolutional temporal networks to obtain the dynamic trajectory information of vehicles or other objects in the parking space area. This motion feature is then jointly modeled with the spatial features of the current frame, for example, by using feature concatenation or attention weighting to achieve fusion. Through this process, not only the static appearance of the parking space can be reflected, but also the dynamic changes in occupancy can be shown.
[0079] As a preferred embodiment of the above, such as Figure 3 As shown, the first judgment model identifies the current state of the target berth and obtains the first judgment result, including:
[0080] A10: Calculate the similarity between the spatial features of the current frame and the pre-stored free reference spatial features;
[0081] A20: Analyze the changing parameters of motion characteristics within a preset time window;
[0082] A30: Generate a state determination signal based on the combination relationship between the similarity calculation results and the changing parameters;
[0083] A40: Map the status determination signal to the berth status type and output the first determination result.
[0084] Specifically, the idle reference spatial features refer to stable reference features extracted after multiple consecutive image frames are acquired and processed when the target berth is empty. These reference features reflect the typical appearance attributes of the berth when it is idle, such as the overall texture of the ground material, the regional brightness distribution, and the outline of the berth lines. Since lighting conditions and shooting angles may fluctuate in the actual environment, the idle reference spatial features are usually obtained through multi-frame fusion and statistical smoothing to ensure that they remain stable and consistent under different time periods and lighting conditions. The similarity calculation process can be understood as: comparing the spatial features extracted from the current frame with the above-mentioned idle reference spatial features and outputting a numerical result. This result reflects the degree of similarity between the two. When the similarity value is high, it indicates that the current berth area is closer to the idle state in appearance; when the similarity value is low, it indicates that there may be a vehicle parked or the state of the current berth area may have changed. This result serves as an important reference for subsequent comprehensive judgment based on time and motion features, laying the foundation for the generation of the first judgment result. The change parameters of motion features within a preset time window are analyzed. The time window can be flexibly adjusted according to actual application requirements. A dynamic setting is used to smooth out short-term fluctuations. Within this time period, motion features are extracted through optical flow fields or target detection sequences between consecutive frames. The changing parameters can include the direction of the motion vector, velocity amplitude, and trajectory continuity. By analyzing these parameters, it can be determined whether a vehicle is entering or leaving the parking space. The similarity calculation results are combined with the motion feature change parameters to generate a state determination signal. This combination can be achieved through weighted fusion, conditional logic judgment, or a comprehensive decision-making method based on a trained model. For example, when the similarity value drops significantly and the motion feature shows a trajectory... When a track enters the berth area, the determination signal tends to be "occupied"; when the similarity value remains at a high level and the motion characteristics do not change significantly within the window, the determination signal tends to be "idle"; when the two are inconsistent, an intermediate state signal is output as a result to be further confirmed; the state determination signal is mapped to the berth state type and output as the first judgment result. Preferably, the berth state type includes three categories: idle state, stable occupied state, and pending determination state. Among them, the setting of pending determination state can effectively avoid false alarms caused by temporary occupancy, changes in light and shadow, or temporary docking, and provide a basis for further analysis.
[0085] As a preferred embodiment of the above, such as Figure 4 As shown, step A10 involves calculating the similarity between the spatial features of the current frame and the pre-stored idle reference spatial features, including:
[0086] A11: Extract the color distribution features, texture features, and edge contour features of the berth area;
[0087] A12: Align and normalize each feature with the features in the free reference space at the same scale to obtain a feature similarity measure of color distribution, texture pattern and contour structure;
[0088] A13: Fuse feature similarity measures to generate a similarity value that shows the current berth area is close to the vacancy status.
[0089] Specifically, feature extraction is performed on the target berth area in the current frame, including color distribution features, texture features, and edge contour features. Color distribution features reflect the overall color distribution of the berth surface and berth lines under different lighting conditions; texture features depict subtle differences in the surface material, such as cement particles or oil stains; edge contour features highlight the structural form of the berth lines and the geometry of the berth boundaries, providing morphological contrast information. Subsequently, the extracted color distribution features, texture features, and edge contour features are matched with their corresponding free reference space features. To ensure matching accuracy, the matched features are first aligned to the same scale, that is, features from different resolutions and sampling conditions are converted to a unified scale space. Simultaneously, normalization processing is also required to eliminate distortions caused by changes in brightness and shooting angle. After alignment and normalization, the influence of color distribution, texture pattern, and contour structure on the current frame and the idle reference can be measured by considering the differences in color distribution or local noise. This measurement can more realistically reflect the closeness between the two in their respective dimensions. Finally, the similarity measurements of color distribution, texture pattern, and contour structure are fused to generate a single similarity value, which is used to represent the overall closeness between the current berth area and the idle state. In the preferred mode, this fusion process is not a simple weighted average, but rather improves robustness through multi-dimensional correlation analysis. For example, when the consistency of color and texture dimensions is high, the impact of sudden noise on edge contour features is weakened; conversely, when edge contour information is stable but texture information is greatly disturbed, the reference value of contour similarity is emphasized. The similarity value obtained in this way can more comprehensively reflect the consistency between the current berth and the idle reference state.
[0090] As a preferred embodiment of the above, such as Figure 5 As shown, in step S4, when the first judgment result is a state to be judged, multi-dimensional analysis is performed through parallel processing to obtain anomaly analysis results, including:
[0091] S41: Perform vehicle target recognition on the parking area in the current image frame, calculate the vehicle presence confidence, and output the spatial domain analysis results;
[0092] S42: Establish a time series model of the state to be determined, count the duration of the state, analyze the persistence characteristics in the time dimension, and output the time domain analysis results;
[0093] S43: Extract the trajectory of the moving target in consecutive image frames, calculate the matching degree between the trajectory of the moving target and the preset parking behavior pattern, and output the behavior domain analysis results;
[0094] S44: Normalize the spatial domain analysis results, temporal domain analysis results, and behavioral domain analysis results, and combine them to generate anomaly analysis results.
[0095] Specifically, vehicle target recognition is performed on the berth area of the current image frame. Vehicle target recognition can be achieved through a deep learning-based target detection network. After extracting regional features, classification is performed to determine whether a vehicle target exists, and the confidence level of vehicle presence is calculated. This confidence level quantitatively reflects the probability of whether a vehicle exists in the berth area, thus outputting spatial domain analysis results. A time series model for the state to be determined is established to characterize the persistence characteristics of the state within a continuous time window. Preferably, statistical analysis can be performed on the occurrence duration, frequency, and correlation with historical frames of the state to be determined. For example, if a berth is continuously determined to be in a state to be determined for several seconds, it may indicate that the state of the berth is stable, rather than transient noise or accidental misjudgment. The time domain analysis results output in this way can effectively reflect the persistence and stability of abnormal states. Furthermore, behavioral domain analysis is performed from the perspective of motion trajectory. Specifically, the continuous image frames are subjected to motion analysis. Target detection and tracking extracts the trajectories of moving targets within the parking area and calculates their matching degree with preset parking behavior patterns. This compares the similarity between the moving target's entry path, speed changes, parking position, and typical parking behavior trajectories, such as whether the target slowly enters along the parking space direction and gradually stops. The matching degree value obtained in this way reflects whether the moving target conforms to normal parking behavior, thus generating behavioral domain analysis results. The spatial domain analysis results, temporal domain analysis results, and behavioral domain analysis results are processed uniformly. The preferred method is to first normalize the three to eliminate the influence of differences in numerical ranges of different dimensions, and then combine them to generate the final anomaly analysis results. Weighted combination or rule-based judgment methods can be used to coordinate the use of results from the spatial, temporal, and behavioral dimensions. For example, when the vehicle confidence is high but the parking behavior trajectory does not match, the occupancy status can be avoided prematurely, and instead, a comprehensive judgment based on anomaly analysis can be made to determine a suspicious status.
[0096] As a preferred embodiment of the above, vehicle target recognition is performed on the parking area in the current image frame, the vehicle presence confidence is calculated, and the spatial domain analysis results are output, including: performing bounding box detection and contour extraction on the vehicle target in the parking area, calculating the occupied area ratio and position offset of the vehicle target, and generating spatial domain analysis results based on the occupied area ratio and position offset.
[0097] Specifically, the process begins by using a deep learning-based object detection algorithm to detect bounding boxes in the parking space area. This detection process automatically identifies rectangular regions that may belong to vehicles in consecutive image frames and outputs the coordinate parameters of the bounding boxes. To improve recognition accuracy, contour extraction can be performed on the pixel regions within the bounding boxes. By extracting the vehicle's outline, the vehicle target can be more accurately distinguished from the background area, thereby reducing misidentification caused by light and shadow, ground markings, or other non-vehicle objects. After completing the bounding box detection and contour extraction, the proportion of the area occupied by the vehicle target can be calculated. The proportion of the occupied area refers to the percentage of the vehicle's bounding box or contour region in the total area of the parking space. This proportion can intuitively reflect the degree of vehicle coverage of the parking space. For example, when the proportion of the occupied area is greater than a certain threshold, the parking space can be considered to be partially or completely occupied by a vehicle. In addition to calculating the vehicle's position, the system can also calculate the offset between the vehicle's center point and the geometric center of the parking space. This offset reflects the vehicle's parking position within the space, such as whether it is centered or tilted. In the preferred method, the occupied area ratio and the offset are analyzed together, and a comprehensive spatial domain analysis result can be generated through weighted summation. For example, if the occupied area ratio is large and the offset is small, it indicates that the vehicle is parked in the parking space in a standard manner, and the spatial domain analysis result tends to support a "stable occupancy" state. If the occupied area ratio is small or the offset is too large, it may indicate that the vehicle has only partially intruded into the parking space or has only passed through the parking area without effectively occupying it. In this case, the spatial domain analysis result will show a lower confidence level. Through this calculation method, a quantitative judgment can be made on whether the vehicle has actually occupied the parking space in the spatial dimension.
[0098] As a preferred embodiment of the above, such as Figure 6 As shown, the trajectory of a moving target is extracted from consecutive image frames, and the matching degree between the moving target trajectory and the preset parking behavior pattern is calculated, including:
[0099] B10: Perform optical flow calculations on consecutive image frames to obtain the motion vector field of the berth area;
[0100] B20: Detects and tracks moving targets based on motion vector fields, and reconstructs the motion trajectory of the moving targets in the image coordinate system;
[0101] B30: Extract the trajectory features of the motion trajectory, calculate the similarity between the trajectory features and the pre-stored typical parking behavior trajectory features, and output the similarity calculation result as the matching degree with the preset parking behavior pattern.
[0102] Specifically, optical flow calculations are performed on consecutive image frames to obtain the motion vector field of the berth area. Optical flow calculations can describe the displacement of pixels in a time series, thus reflecting the dynamic information of moving targets in the scene. In preferred methods, dense optical flow can be used to obtain the global motion distribution, while sparse optical flow can be used to reduce computational complexity and focus on key feature points, thereby improving processing efficiency while ensuring accuracy. After obtaining the motion vector field, moving targets are detected and tracked based on the vector field. First, clustering or connected component analysis methods can be used to identify sets of pixels with consistent motion direction and velocity in the vector field, which are then used as candidate moving targets. These candidate targets are tracked in a time series, which allows for continuous reconstruction of the motion trajectory of the moving target in the image coordinate system, reflecting the target's entry, docking, or departure process in the berth area. To enhance the robustness of the trajectory, Kalman filtering or particle filtering methods can be preferably combined to maintain trajectory continuity under illumination changes or short-term occlusion. After trajectory reconstruction is complete... After completion, trajectory features are extracted from the motion trajectory, including the starting point position, changes in motion direction, speed distribution, deceleration process during parking, and final parking position. These features can comprehensively describe the vehicle's motion behavior within the parking space area. Then, the extracted trajectory features are compared with pre-stored typical parking behavior trajectory features. Typical parking behavior trajectory features can be obtained by statistical modeling of historical data, such as the trajectory pattern of a vehicle decelerating along the edge of the parking space, gradually adjusting its direction, and stopping stably in the parking space. By calculating the similarity between the current motion trajectory and these typical patterns, the degree of closeness between the current behavior and standard parking behavior can be quantified. The similarity calculation can use a method based on dynamic time warping to handle situations where the vehicle's motion speed is inconsistent, or a cosine similarity method based on trajectory feature vectors can be used to achieve efficient calculation. Finally, the output similarity calculation result can be used as the matching degree with the preset parking behavior pattern.
[0103] As a preferred embodiment of the above, such as Figure 7 As shown, the anomaly analysis results are input into the second judgment model for fusion decision-making, including:
[0104] C10: Based on the analysis results of each dimension, the weights are dynamically assigned to the stability in consecutive image frames to obtain the weighting factor;
[0105] C20: Weighted fusion of spatial domain analysis results and temporal domain analysis results to generate the first fusion result;
[0106] C30: Based on the first fusion result, the weighted composite value is obtained by correcting the result through behavioral domain analysis.
[0107] Specifically, firstly, based on the stability of the analysis results of each dimension in consecutive image frames, weights are dynamically allocated to obtain weighting factors. Stability refers to the degree of fluctuation of each dimension's results within a certain time window. For example, whether the vehicle bounding box area remains continuously stable in the spatial domain, whether the change in state duration is smooth in the temporal domain, and whether the trajectory similarity in the behavior domain steadily increases or tends to converge. If a certain dimension's results exhibit high consistency and low fluctuation in the time series, the weight of that dimension can be increased accordingly; conversely, if a certain dimension has significant uncertainty or is severely affected by environmental interference, the allocated weight will be reduced accordingly. After obtaining the weighting factors, the spatial domain analysis results and the temporal domain analysis results are weighted and fused to generate the first fusion result. This process can take into account both spatial structural features and temporal persistence features. For example, if a vehicle target is detected in a certain parking area in the spatial domain and occupies a certain area... If the proportion of parking occupancy is relatively high, and the "occupancy" signal is continuously maintained above a certain threshold in the time domain, the first fusion result after weighted fusion will be more biased towards a stable occupancy state. In the preferred method, linear weighted summation or fuzzy logic method can be used to adapt to different feature scales. After the first fusion result is generated, it needs to be corrected by combining the behavioral domain analysis results to obtain the final weighted comprehensive value. Specifically, behavioral domain analysis can provide the matching degree between trajectory patterns and typical parking behaviors. This information is crucial for the final decision in many cases. For example, if the spatial and temporal domain fusion results determine "suspected occupancy", but the behavioral domain analysis shows that the trajectory does not match typical parking behaviors, the comprehensive value can be reduced through correction, thereby avoiding false alarms. Conversely, if the behavioral domain results are highly consistent with the parking pattern, the first fusion result can be positively enhanced to improve the final comprehensive value.
[0108] Example 2
[0109] Based on the same inventive concept as the berth detection and alarm method in the foregoing embodiments, the present invention also provides a berth detection and alarm system, the system comprising:
[0110] The image frame acquisition module acquires continuous image frames of the target berth;
[0111] The berth area recognition module identifies berth areas in consecutive image frames and extracts image features of the berth areas.
[0112] The first result acquisition module identifies the current state of the target berth based on image features and through a first judgment model to obtain a first judgment result, which includes an idle state, a stable occupied state, and a state to be judged.
[0113] The abnormal result acquisition module performs multi-dimensional analysis through parallel processing when the first judgment result is a pending state, and obtains the abnormal analysis result.
[0114] The alarm signal generation module inputs the anomaly analysis results into the second judgment model for fusion decision-making. The second judgment model compares the weighted comprehensive value of the multidimensional analysis with the preset threshold to obtain the second judgment result. If the second judgment result meets the alarm conditions, an alarm signal is generated.
[0115] The detection and alarm system described above in this invention can effectively realize the berth detection and alarm method, and the technical effects it can achieve are as described in the above embodiments, which will not be repeated here.
[0116] As a preferred embodiment of the above, the berth area identification module includes:
[0117] The area positioning unit locates the berth area based on an image segmentation algorithm and extracts the corresponding image block;
[0118] The feature extraction unit extracts spatial features from image blocks, and the spatial features are fused with appearance information at multiple scales.
[0119] The feature fusion unit extracts motion features from consecutive image frames and fuses the motion features with the spatial features of the current frame to obtain image features.
[0120] Similarly, the above-mentioned optimization schemes for the system can also achieve the optimization effects corresponding to the methods in Embodiment 1, which will not be repeated here.
[0121] Although this application has been described in conjunction with specific features and embodiments, it will be apparent that various modifications and combinations can be made therein without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of the application as defined herein, and are to be considered as covering any and all modifications, variations, combinations, or equivalents within the scope of this application.
[0122] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application intends to include such modifications and variations.
Claims
1. A berth detection and alarm method, characterized in that, include: Acquire consecutive image frames of the target berth; The berth areas in the continuous image frames are identified, and the image features of the berth areas are extracted; Based on the image features, the current state of the target berth is identified by a first judgment model to obtain a first judgment result, which includes an idle state, a stable occupied state, and a state to be judged. When the first judgment result is the state to be judged, multi-dimensional analysis is performed through parallel processing to obtain the anomaly analysis result; The anomaly analysis results are input into the second judgment model for fusion decision-making. The second judgment model compares the weighted comprehensive value of multidimensional analysis with a preset threshold to obtain a second judgment result. If the second judgment result meets the alarm conditions, an alarm signal is generated.
2. The berth detection and alarm method according to claim 1, characterized in that, Identifying berth areas in the continuous image frames and extracting image features of the berth areas includes: The berth area is located based on an image segmentation algorithm, and corresponding image blocks are extracted. Spatial features of the image blocks are extracted, and these spatial features are fused with appearance information at multiple scales. Motion features are extracted from the continuous image frames, and these motion features are fused with the spatial features of the current frame to obtain the image features.
3. The berth detection and alarm method according to claim 2, characterized in that, The first judgment model identifies the current state of the target berth and obtains a first judgment result, including: The similarity between the spatial features of the current frame and the pre-stored free reference spatial features is calculated. Analyze the change parameters of the motion characteristics within a preset time window; A state determination signal is generated based on the combination relationship between the similarity calculation results and the changing parameters; The status determination signal is mapped to the berth status type, and the first determination result is output.
4. The berth detection and alarm method according to claim 3, characterized in that, The similarity calculation between the spatial features of the current frame and the pre-stored free reference spatial features includes: Extract the color distribution features, texture features, and edge contour features of the berth area; Each feature is aligned and normalized with the features in the free reference space at the same scale to obtain a feature similarity measure of color distribution, texture pattern and contour structure; The feature similarity metrics are fused to generate a similarity value that shows the current berth area is close to the vacancy status.
5. The berth detection and alarm method according to claim 1, characterized in that, When the first judgment result is the state to be determined, multi-dimensional analysis is performed through parallel processing to obtain anomaly analysis results, including: Vehicle target identification is performed on the parking area in the current image frame, the vehicle presence confidence is calculated, and the spatial domain analysis results are output. Establish a time series model of the state to be determined, count the duration of the state, analyze the persistence characteristics in the time dimension, and output the time domain analysis results; Extract the trajectory of the moving target in the continuous image frames, calculate the matching degree between the trajectory of the moving target and the preset parking behavior pattern, and output the behavior domain analysis results; The spatial domain analysis results, temporal domain analysis results, and behavioral domain analysis results are normalized and combined to generate the anomaly analysis results.
6. The berth detection and alarm method according to claim 5, characterized in that, Vehicle target recognition is performed on the parking area in the current image frame, the vehicle presence confidence is calculated, and spatial domain analysis results are output. This includes: performing bounding box detection and contour extraction on the vehicle targets in the parking area, calculating the occupied area ratio and position offset of the vehicle targets, and generating spatial domain analysis results based on the occupied area ratio and position offset.
7. The berth detection and alarm method according to claim 5, characterized in that, Extracting the trajectory of the moving target from the consecutive image frames and calculating the matching degree between the moving target trajectory and the preset parking behavior pattern, including: Optical flow calculations are performed on the continuous image frames to obtain the motion vector field of the berth area; Based on the motion vector field, the moving target is detected and tracked, and the motion trajectory of the moving target in the image coordinate system is reconstructed. The trajectory features of the motion trajectory are extracted, and the similarity between the trajectory features and the pre-stored typical parking behavior trajectory features is calculated. The similarity calculation result is output as the matching degree with the preset parking behavior pattern.
8. The berth detection and alarm method according to claim 1, characterized in that, The anomaly analysis results are input into the second judgment model for fusion decision-making, including: Based on the analysis results of each dimension, the stability in the continuous image frames is dynamically weighted to obtain the weighting factor. The spatial domain analysis results and the temporal domain analysis results are weighted and fused to generate the first fusion result; Based on the first fusion result, the weighted composite value is obtained by correcting the result through behavioral domain analysis.
9. A berth detection and alarm system, characterized in that, The system includes: The image frame acquisition module acquires continuous image frames of the target berth; The berth area identification module identifies the berth area in the continuous image frames and extracts the image features of the berth area; The first result acquisition module identifies the current state of the target berth based on the image features using a first judgment model, and obtains a first judgment result, which includes an idle state, a stable occupied state, and a pending judgment state. The abnormal result acquisition module performs multi-dimensional analysis through parallel processing when the first judgment result is the state to be judged, and obtains the abnormal analysis result. The alarm signal generation module inputs the anomaly analysis results into the second judgment model for fusion decision-making. The second judgment model compares the weighted comprehensive value of multidimensional analysis with a preset threshold to obtain a second judgment result. If the second judgment result meets the alarm conditions, an alarm signal is generated.
10. The berth detection and alarm system according to claim 9, characterized in that, The berth area identification module includes: The area positioning unit locates the berth area based on an image segmentation algorithm and extracts the corresponding image block; The feature extraction unit extracts the spatial features of the image block, and the spatial features are fused with appearance information at multiple scales; The feature fusion unit extracts motion features from the continuous image frames and fuses the motion features with the spatial features of the current frame to obtain the image features.