Pedestrian crossing boundary warning method, device and storage medium based on video surveillance

Through the video surveillance system to identify sign poles and calculate the distance and angle between pedestrians and the baseline, automatic line marking and cross-border warning for construction areas are realized, which solves the problems of low efficiency and unpredictability of manual line marking in the existing technology. Improved the accuracy and efficiency of the monitoring system.

CN115953872BActive Publication Date: 2024-10-18GUANGDONG YUESHI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211698370.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2024-10-18
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

The existing video surveillance system requires manual re-marking when the construction area changes. The operation efficiency is low, and it cannot accurately predict pedestrian crossings. It can only alarm when pedestrians have crossed the line.

Method used

Obtain video images of the monitored area through video surveillance, use the sign pole detection model to identify the sign pole position and warning color, determine the baseline and warning lines, calculate the vertical distance and angle between pedestrians and the baseline, and calculate the cross-border risk value. If the risk If the value exceeds the threshold, an alarm is triggered.

Benefits of technology

It achieves accurate prediction of pedestrian crossing in various application scenarios in advance, improves the accuracy of risk identification, avoids image noise interference, and improves computing speed and monitoring accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115953872B_ABST
    Figure CN115953872B_ABST
Patent Text Reader

Abstract

The present application provides a pedestrian crossing warning method, device and storage medium based on video surveillance, which belongs to the field of image processing technology. The method comprises: obtaining a surveillance video collected from a surveillance area; decoding a single-frame image from the surveillance video, determining the position information and warning color of each sign pole based on the pixel points corresponding to each sign pole in the single-frame image, determining a baseline based on the position information of each sign pole, extending the baseline based on the position information and warning color of each sign pole to obtain a warning line, and using the area between the warning line and the baseline as a warning area; if it is determined that a pedestrian has entered the warning area, calculating the risk value of the pedestrian crossing the baseline based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments; if it is determined that the risk value is greater than a pre-set risk threshold, triggering a crossing alarm; the present application can accurately predict pedestrian crossing in advance for a variety of application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a pedestrian crossing warning method, device and storage medium based on video surveillance. Background Art

[0002] In the related art, when using video images for cross-line monitoring, it is necessary to manually draw lines in specific areas of the video images, and an alarm is generated when a pedestrian crosses the line. In some application scenarios where the monitoring area changes frequently, such as monitoring the safe production of field operations, since the construction area changes frequently, the monitoring area needs to be manually re-drawn every time it changes, which is inefficient. In addition, the cross-line monitoring method used for different application scenarios is single, and only alarms are issued when pedestrians have crossed the line, and it is impossible to accurately predict pedestrian crossing in advance.

[0003] It can be seen that it is necessary to provide a solution that can accurately predict pedestrian crossing in advance for a variety of application scenarios. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a pedestrian crossing warning method, device and storage medium based on video surveillance, which can accurately predict pedestrian crossing in advance for various application scenarios.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a pedestrian crossing warning method based on video surveillance, the method comprising:

[0006] Acquire a surveillance video collected from a surveillance area; wherein a plurality of sign poles are arranged in the surveillance area to enclose a construction area;

[0007] Decoding the surveillance video to obtain a single-frame image, and using a sign pole detection model to perform image recognition on the single-frame image to obtain pixel points corresponding to each sign pole in the single-frame image; wherein the sign pole detection model is pre-trained based on an instance segmentation model;

[0008] Determine the position information and warning color of each sign post based on the pixel points corresponding to each sign post in the single frame image, determine a baseline based on the position information of each sign post, extend the baseline to obtain a warning line based on the position information and warning color of each sign post, and use the area between the warning line and the baseline as a warning area; wherein the warning color is used to represent the warning level of the sign post;

[0009] Perform pedestrian detection on the warning area in the surveillance video, and if it is determined that a pedestrian has entered the warning area, determine the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, and calculate the risk value of the pedestrian crossing the baseline based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments;

[0010] The risk value of the pedestrian crossing the baseline is compared with a preset risk threshold, and if it is determined that the risk value is greater than the preset risk threshold, a crossing alarm is triggered.

[0011] In some embodiments, determining the position information and warning color of each sign pole based on the pixel points corresponding to each sign pole in the single frame image, determining a baseline based on the position information of each sign pole, and extending the baseline to obtain a warning line based on the position information and warning color of each sign pole includes:

[0012] Determine the bottom corner points of the sign pole based on the pixel points corresponding to the sign pole in the single frame image, and connect the bottom corner points of each sign pole in sequence to form a reference line;

[0013] Determine the top corner point of the sign pole based on the pixel point corresponding to the sign pole in the single-frame image, determine the height of the sign pole based on the distance between the bottom corner point and the top corner point of the sign pole, determine the maximum observation distance of the sign pole based on the height of the sign pole, determine the effective action line of the sign pole with the bottom corner point as the origin and the maximum observation distance as the radius, obtain the effective action line of each sign pole, and then determine the tangent line of adjacent effective action lines to obtain multiple tangent lines, and connect the multiple tangent lines in sequence to form an extension line;

[0014] The warning color of the sign pole is determined based on the color information of the pixel points corresponding to the sign pole, the risk coefficient is determined based on the warning color of the sign pole, and then the vertical distance between the extension line and the baseline is determined, and the warning distance is determined based on the product of the risk coefficient and the vertical distance, and the extension line is shrunk to a distance from the baseline that is the warning distance to obtain a warning line; the warning line is located between the baseline and the extension line.

[0015] In some embodiments, determining the warning color of the sign pole based on the color information of the pixel points corresponding to the sign pole, and determining the risk factor based on the warning color of the sign pole include:

[0016] The DBScan algorithm is used to perform color clustering on the pixel points corresponding to each signpost to obtain multiple color clusters;

[0017] The color values ​​of the pixels in each color cluster are averaged to obtain the average color of each color cluster;

[0018] After eliminating the color clusters with average colors of white and black, the average color corresponding to the color cluster with the largest number of pixels among the remaining color clusters is used as the main color of the signpost;

[0019] Using the warning color with the highest similarity to the main color as the warning color of the signpost;

[0020] Determine a risk factor corresponding to the warning color of the sign pole; wherein the risk factor corresponding to the warning color increases with an increase in the warning level.

[0021] In some embodiments, the pedestrian detection is performed on the warning area in the surveillance video, and if it is determined that a pedestrian has entered the warning area, the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments are determined, and the risk value of the pedestrian crossing the baseline is calculated based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, including:

[0022] Sampling the surveillance video to obtain a surveillance image, determining a warning area in the surveillance image, and performing pedestrian detection in the warning area;

[0023] If it is determined that a pedestrian has entered the warning area, the surveillance video is continuously sampled at a set time interval to obtain multiple frames of sampled images, and the position of the pedestrian in the continuous multiple frames of sampled images is determined;

[0024] Determine the minimum bounding rectangle of the pedestrian in multiple frames of sampled images, take the center of the minimum bounding rectangle as the centroid of the pedestrian, and obtain the centroid of the pedestrian at multiple consecutive moments;

[0025] Determine the vertical distances between the centroid of the pedestrian and the reference line at multiple consecutive moments, respectively, and determine the angle between the pedestrian and the reference line at multiple consecutive moments based on the centroid of the pedestrian at multiple consecutive moments;

[0026] When it is determined that the vertical distance is less than the distance threshold, the risk value of the pedestrian at the current moment is calculated by the following formula:

[0027]

[0028] Wherein, n is the total number of sampled images, d(i) is the vertical distance between the centroid of the i-th sampled image and the baseline, d(i-1) is the vertical distance between the centroid of the i-th sampled image and the baseline, θ(i) is the angle between the tangent direction of the centroid of the i-th sampled image and the baseline, the value range of θ(i) is [0, 90°], and Risk(n) is the risk value of the pedestrian at the current moment.

[0029] In some embodiments, determining the angle between the pedestrian and the reference line at multiple consecutive moments based on the center of mass of the pedestrian at multiple consecutive moments includes:

[0030] Determine the coordinates of the centroid in the i-th frame sampled image and the coordinates of the centroid in the i-1-th frame sampled image, and calculate the direction angle of the centroid in the i-th frame sampled image based on the coordinates of the centroid in the i-th frame sampled image and the coordinates of the centroid in the i-1-th frame sampled image;

[0031] Randomly select two pixel points on the reference line, determine the coordinates of the two pixel points on the reference line, and determine the direction angle of the reference line based on the coordinates of the two pixel points;

[0032] Determine the angle between the pedestrian and the baseline at the sampling moment of the i-th frame sampled image by using the direction angle of the baseline and the direction angle of the centroid in the i-th frame sampled image;

[0033] The angle between the pedestrian and the baseline at the sampling moment of n frames of sampled images is used as the angle between the pedestrian and the baseline at multiple consecutive moments.

[0034] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program, when executed by the processor, implements the method described in the first aspect above.

[0035] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer-readable storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the method described in the first aspect above.

[0036] The pedestrian crossing warning method, device and storage medium based on video surveillance proposed in this application can adaptively adjust the baseline according to the changing application scenarios by identifying the positioning poles in a single-frame image and determining the baseline based on the position information of each sign pole; the baseline is extended to obtain the warning line based on the position information and warning color of each sign pole, so as to reasonably expand the baseline according to the level of warning, adapt to different construction scenarios, improve the accuracy of risk identification, and detect pedestrians in the warning area in the monitoring video to avoid image noise interference, improve the operation speed and monitoring accuracy; based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, the risk value of the pedestrian crossing the baseline is more comprehensively and accurately obtained. This application can accurately predict pedestrian crossing in advance for a variety of application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a flow chart of a pedestrian crossing warning method based on video surveillance provided in an embodiment of the present application;

[0038] Figure 2 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.

[0040] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0042] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0043] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0044] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0045] The embodiments of the present application provide a pedestrian crossing warning method, device and storage medium based on video surveillance, which are specifically explained through the following embodiments. First, the pedestrian crossing warning method based on video surveillance in the embodiments of the present application is described.

[0046] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0047] Figure 1 is an optional flow chart of a pedestrian crossing warning method based on video surveillance provided in an embodiment of the present application. Figure 1 The method comprises the following steps:

[0048] Step S100, obtaining a monitoring video collected from a monitoring area; wherein a plurality of sign poles are arranged in the monitoring area to enclose a construction area;

[0049] It should be noted that the same sign pole is used in the same monitoring area. In one embodiment, a camera is used to shoot a video of the monitoring area where the sign pole needs to be set to obtain a monitoring video. The monitoring video includes the sign pole. The monitoring area also includes the peripheral area of ​​the construction area, that is, the warning area described below.

[0050] Step S200, decoding the surveillance video to obtain a single-frame image, using a sign pole detection model to perform image recognition on the single-frame image, and obtaining pixel points corresponding to each sign pole in the single-frame image; wherein the sign pole detection model is pre-trained based on an instance segmentation model;

[0051] In some embodiments, the instance segmentation model may be a Mask R-CNN model, a PANet model, a HTC model, a Blend Mask model, a Center Mask model, etc. The sign pole detection model pre-trained based on the instance segmentation model can perform pixel-level image recognition on the sign poles in a single-frame image, thereby identifying the pixel points corresponding to each sign pole in the single-frame image; for example, the sign pole sample image that currently needs to be trained can be determined from the multiple collected sign pole sample images to obtain the current sign pole sample image, and then the current sign pole sample image is imported into the preset instance segmentation model for training to learn and identify the shape features of the sign poles in the sign pole sample image to obtain the sign pole detection model.

[0052] Step S300, determining the position information and warning color of each sign post based on the pixel points corresponding to each sign post in the single frame image, determining a baseline based on the position information of each sign post, extending the baseline to obtain a warning line based on the position information and warning color of each sign post, and using the area between the warning line and the baseline as a warning area; wherein the warning color is used to represent the warning level of the sign post;

[0053] In some embodiments, the position information includes the position of each pixel in the sign pole in the single frame image; the baseline is an outer line segment obtained by connecting the positions of each sign pole; the corresponding warning level is determined based on the warning color of each sign pole, and then the baseline is extended accordingly according to the warning level, so that the warning line can be adapted to the risk represented by the warning level, thereby improving the accuracy of risk identification.

[0054] Step S400, performing pedestrian detection on the warning area in the surveillance video, and if it is determined that a pedestrian has entered the warning area, determining the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, and calculating the risk value of the pedestrian crossing the baseline based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments;

[0055] In this step, after determining the warning area, the monitoring video is decoded continuously. Since pedestrian detection is performed only in the warning area in the monitoring video, the image processing area can be reduced to the warning area. By removing unnecessary image processing areas, image noise interference is avoided, and the operation speed and monitoring accuracy are improved. In some embodiments, the method for detecting pedestrians in the warning area in the monitoring video is a method based on machine learning, such as a method based on HOG features, which can identify the outer rectangular frame of pedestrians and track pedestrians, thereby determining the location information of the pedestrians at multiple consecutive moments through pedestrian detection and tracking, and then determining the vertical distance and angle between the pedestrians and the baseline at multiple consecutive moments; it should be noted that the smaller the vertical distance between the pedestrian and the baseline, the closer to the baseline, and the greater the risk of crossing the baseline; the larger the angle between the pedestrian and the baseline, the greater the possibility of walking towards the baseline, and the greater the risk of crossing the baseline; this step combines the two factors of the vertical distance and angle between the pedestrian and the baseline, so as to more comprehensively and accurately obtain the risk value of the pedestrian crossing the baseline.

[0056] Step S500, if it is determined that the risk value of the pedestrian crossing the baseline is greater than a set risk threshold, a crossing alarm is triggered;

[0057] In some embodiments, when monitoring the production safety of external field operations, after the construction personnel arrive at the construction site, they deploy the sign poles around the construction area as the endpoints of the baseline; set up a surveillance camera aimed at the construction area, and the image of the monitoring area collected by the surveillance camera covers the sign poles and the warning area; the surveillance camera is connected to an electronic device, and the surveillance video collected from the monitoring area is transmitted to the electronic device; the electronic device decodes the surveillance video to obtain a single-frame image, and determines the position information and warning color of the sign pole in the single-frame image; based on the position information and warning color of the sign pole in the single-frame image, the warning area is automatically generated. When a pedestrian enters the warning area, the pedestrian is detected and tracked in the monitoring screen to determine the risk value of the pedestrian crossing the baseline. If it is determined that the risk value of the pedestrian crossing the baseline is greater than the set risk threshold, an out-of-bounds alarm is triggered.

[0058] The present application identifies the positioning poles in a single-frame image, determines the baseline based on the position information of each sign pole, improves the original manual marking method into automatic marking, and extends the baseline to obtain a warning line based on the position information and warning color of each sign pole, so as to reasonably expand the baseline according to the level of warning, adapt to different construction scenarios, and improve the accuracy of risk identification. By performing pedestrian detection in the warning area in the monitoring video, image noise interference is avoided, and the calculation speed and monitoring accuracy are improved; based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, the risk value of the pedestrian crossing the baseline is obtained more comprehensively and accurately; it can be seen that the present application can accurately predict the crossing of pedestrians in advance for a variety of application scenarios.

[0059] In some embodiments, in step S300, determining the position information and warning color of each sign pole based on the pixel points corresponding to each sign pole in the single frame image, determining a baseline based on the position information of each sign pole, and extending the baseline to obtain a warning line based on the position information and warning color of each sign pole includes:

[0060] Step S310, determining the bottom corner points of the sign pole based on the pixel points corresponding to the sign pole in the single frame image, and connecting the bottom corner points of each sign pole in sequence to form a reference line;

[0061] In some embodiments, the bottom corner points of adjacent sign poles in the single-frame image are connected in sequence in a clockwise or counterclockwise direction to obtain a baseline in the single-frame image, and the area within the baseline is the construction area enclosed by the sign poles in the single-frame image.

[0062] Step S320, determining the top corner point of the sign pole based on the pixel point corresponding to the sign pole in the single-frame image, determining the height of the sign pole based on the distance between the bottom corner point and the top corner point of the sign pole, determining the maximum observation distance of the sign pole based on the height of the sign pole, determining the effective action line of the sign pole with the bottom corner point as the origin and the maximum observation distance as the radius, obtaining the effective action line of each sign pole, and then determining the tangent line of adjacent effective action lines to obtain multiple tangent lines, and sequentially connecting the multiple tangent lines to form an extension line;

[0063] It should be noted that the maximum observation distance represents the critical position at which pedestrians should be able to accurately identify the symbol elements in the sign pole; the maximum observation distance is the product of the height of the sign pole and the observation factor, and the observation factor is determined based on the vertical illuminance of the surface of the sign pole, the expected visual acuity of pedestrians, etc.; those skilled in the art can set it in advance, and in some embodiments, the value range of the observation factor is 2 to 50; the effective action line determined based on the maximum observation distance can reflect the action range of the sign pole on the pedestrian, and by connecting multiple tangent lines in sequence to form an extension line, it can reflect the maximum action range of all sign poles on the pedestrian, thereby preliminarily determining the image processing area. In some embodiments, the extension line is included in the monitoring area.

[0064] Step S330, determining the warning color of the sign pole based on the color information of the pixel points corresponding to the sign pole, determining the risk coefficient based on the warning color of the sign pole, and then determining the vertical distance between the extension line and the baseline, determining the warning distance based on the product of the risk coefficient and the vertical distance, shrinking the extension line to a distance from the baseline as the warning distance, to obtain a warning line; the warning line is located between the baseline and the extension line.

[0065] In some embodiments, there are different types of operations in the construction area, such as material stacking, road maintenance, and high-altitude operations. Different types of operations have different risks. For the purpose of risk prevention, pedestrians should not get too close to the construction area after seeing the sign pole, and a certain warning distance needs to be set. This step determines the risk coefficient based on the warning color of the sign pole, and then determines the warning distance based on the product of the risk coefficient and the vertical distance, and obtains the actual range of influence of all sign poles on pedestrians, so as to adapt to the risks corresponding to different sign poles in the actual application scenario and accurately determine the warning area for subsequent image processing.

[0066] In some embodiments, in step S330, determining the warning color of the sign pole based on the color information of the pixel points corresponding to the sign pole, and determining the risk factor based on the warning color of the sign pole include:

[0067] Step S331, using the DBScan algorithm to perform color clustering on the pixel points corresponding to each signpost to obtain multiple color clusters;

[0068] Step S332, averaging the color values ​​of the pixels in each color cluster to obtain the average color of each color cluster;

[0069] Step S333, after removing the color clusters whose average colors are white and black, the average color corresponding to the color cluster with the largest number of pixels among the remaining color clusters is used as the main color of the signpost;

[0070] Step S334, using the warning color with the highest similarity to the main color as the warning color of the signpost;

[0071] Step S335, determining the risk coefficient corresponding to the warning color of the sign pole; wherein the risk coefficient corresponding to the warning color increases with the increase of the warning level.

[0072] It should be noted that, in some embodiments, the warning colors include red, yellow and blue, each warning color corresponds to a risk factor, and the risk factors corresponding to the warning colors red, yellow and blue decrease in sequence, and the value range is between 0 and 1. Different warning colors have different warning levels, which respectively play the role of prohibition, warning, instruction, prompt, etc.; for example, red means that a certain behavior is not allowed or stopped, yellow means that people are alerted to possible dangers, and blue means that it must be followed, which is used to force or restrict people's behavior. This embodiment determines the corresponding risk factor based on the warning level of different colors, and the larger the risk factor, the higher the protection level.

[0073] In some embodiments, in step S400, the pedestrian detection is performed on the warning area in the surveillance video, and if it is determined that a pedestrian has entered the warning area, the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments are determined, and the risk value of the pedestrian crossing the baseline is calculated based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, including:

[0074] Step S410, sampling the surveillance video to obtain a surveillance image, determining a warning area in the surveillance image, and performing pedestrian detection in the warning area;

[0075] After determining the warning area, continue to sample the surveillance video. Since pedestrian detection is only performed on the warning area in the video stream, the object of image processing can be narrowed down to the warning area. By reducing the processing range, the calculation speed is increased and the monitoring efficiency is improved.

[0076] Step S420: If it is determined that a pedestrian has entered the warning area, the surveillance video is continuously sampled at a set time interval to obtain multiple frames of sampled images, and the position of the pedestrian in the multiple frames of continuous sampled images is determined;

[0077] Step S430, determining the minimum bounding rectangle of the pedestrian in the multiple frames of sampled images, taking the center of the minimum bounding rectangle as the centroid of the pedestrian, and obtaining the centroid of the pedestrian at multiple consecutive moments;

[0078] That is to say, if it is determined that a pedestrian has entered the warning area, the pedestrian is tracked based on the multi-frame sampling images obtained by continuous sampling, and the location of the pedestrian is simplified, and the center of mass of the pedestrian is used as the processing object to improve calculation efficiency.

[0079] Step S440, respectively determining the vertical distance between the centroid of the pedestrian and the baseline at multiple consecutive moments, and determining the angle between the pedestrian and the baseline at multiple consecutive moments based on the centroid of the pedestrian at multiple consecutive moments;

[0080] Step S450: When it is determined that the vertical distance is less than the distance threshold, the risk value of the pedestrian at the current moment is calculated by the following formula:

[0081]

[0082] Wherein, n is the total number of sampled images, d(i) is the vertical distance between the centroid of the i-th sampled image and the baseline, d(i-1) is the vertical distance between the centroid of the i-th sampled image and the baseline, θ(i) is the angle between the tangent direction of the centroid of the i-th sampled image and the baseline, the value range of θ(i) is [0, 90°], and Risk(n) is the risk value of the pedestrian at the current moment.

[0083] In some embodiments, the value range of d(i) is [0, d], in meters; d is a distance threshold, d≥30 meters. In one embodiment, d=30 meters, and a distance beyond 30 meters is considered to have no risk of crossing the warning line, and no risk value calculation is performed;

[0084] It should be noted that the closer the distance to the warning line and / or the larger the angle with the warning line, the more obvious the trend of crossing the warning line is, and the more likely it is to cross the warning line. When the distance is close to 0, it is at the edge of the warning line, and its movement trend is very likely to cross the warning line, and the accumulated risk value will increase; the larger the angle, the faster the risk value increases, and when the risk value reaches the risk threshold, a line crossing alarm is triggered, thereby warning pedestrians to move away as soon as possible; the farther away from the warning line, the more obvious the trend of moving away from the warning line is, and the more likely it is to leave the warning line, and the accumulated risk value decreases; the larger the angle, the faster the risk value decreases, and when the risk value is lower than the risk threshold, the line crossing alarm is lifted; when the vertical distance is greater than the distance threshold, it is far away from the warning line, and no matter how large the angle is, its movement trend is unlikely to cross the warning line and will not reach the risk threshold; this embodiment comprehensively considers the distance and angle at multiple times in the past to form a behavioral trend and accurately predict the movement trend of pedestrians,

[0085] In some embodiments, in step S440, determining the angle between the pedestrian and the reference line at multiple consecutive moments based on the centroid of the pedestrian at multiple consecutive moments includes:

[0086] Step S441, determining the coordinates of the centroid in the i-th frame sampled image and the coordinates of the centroid in the i-1-th frame sampled image, and calculating the direction angle of the centroid in the i-th frame sampled image based on the coordinates of the centroid in the i-th frame sampled image and the coordinates of the centroid in the i-1-th frame sampled image;

[0087] Step S442, randomly selecting two pixel points on the reference line, determining the coordinates of the two pixel points on the reference line, and determining the direction angle of the reference line based on the coordinates of the two pixel points;

[0088] Step S443, determining the angle between the pedestrian and the baseline at the sampling moment of the i-th frame sampled image by using the direction angle of the baseline and the direction angle of the centroid in the i-th frame sampled image;

[0089] Step S444: taking the angle between the pedestrian and the baseline at the sampling moment of n frames of sampled images as the angle between the pedestrian and the baseline at multiple consecutive moments.

[0090] In some embodiments, the calculation formula of the direction angle of the centroid in the i-th frame sample image is:

[0091]

[0092] Among them, (x i ,y i ) represents the coordinates of the centroid of the sampled image in the i-th frame, (x i-1 ,y i-1) represents the coordinates of the centroid of the i-1th frame sampling image, φ(i) represents the direction angle of the centroid of the i-th frame sampling image;

[0093] The calculation formula of the direction angle of the reference line is:

[0094]

[0095] Among them, (x1, y1) and (x2, y2) represent the coordinates of two pixel points on the reference line, and θ(0) represents the direction angle of the reference line.

[0096] In some embodiments, the calculation formula of the angle between the pedestrian and the baseline at the sampling moment of the i-th frame sampling image is:

[0097]

[0098] Wherein, θ(i) represents the angle between the pedestrian and the baseline at the sampling moment of the i-th frame sampling image.

[0099] It should be noted that the value ranges of φ(i) and θ(0) are both [-90°, 90°], and the value range of the calculated θ(i) is [0, 90°].

[0100] In addition, refer to Figure 2 An embodiment of the present invention further provides an electronic device 10, which includes: a memory 11, a processor 12, and a computer program stored in the memory 11 and executable on the processor 12.

[0101] The processor 12 and the memory 11 may be connected via a bus or other means.

[0102] The non-transient software program and instructions required to implement the pedestrian crossing warning method based on video surveillance in the above embodiment are stored in the memory 11. When executed by the processor 12, the pedestrian crossing warning method based on video surveillance in the above embodiment is executed.

[0103] In addition, an embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by a processor or controller, for example, by a processor in the above-mentioned electronic device embodiment, so that the above-mentioned processor can execute the pedestrian crossing warning method based on video surveillance in the above-mentioned embodiment.

[0104] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0105] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.

[0106] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0107] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0108] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. Through the description of the above implementation modes, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation mode. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, an optical disk), including a number of instructions to enable a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0109] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and inventive concept of the present invention within the scope disclosed by the present invention, which shall fall within the protection scope of the present invention.

Claims

1. A pedestrian crossing warning method based on video surveillance, characterized in that: The method comprises: Acquire a surveillance video collected from a surveillance area; wherein a plurality of sign poles are arranged in the surveillance area to enclose a construction area; Decoding the surveillance video to obtain a single-frame image, and using a sign pole detection model to perform image recognition on the single-frame image to obtain pixel points corresponding to each sign pole in the single-frame image; wherein the sign pole detection model is pre-trained based on an instance segmentation model; The position information and warning color of each sign pole are determined based on the pixel points corresponding to each sign pole in the single-frame image, a baseline is determined based on the position information of each sign pole, the baseline is extended based on the position information and the warning color of each sign pole to obtain a warning line, and the area between the warning line and the baseline is used as a warning area; wherein the warning color is used to characterize the warning level of the sign pole; the baseline is an outer line segment obtained by connecting the positions of each sign pole; the warning line determines the corresponding warning level based on the warning color of each sign pole, and then the baseline is extended accordingly according to the warning level to obtain the warning line; Perform pedestrian detection on the warning area in the surveillance video, and if it is determined that a pedestrian has entered the warning area, determine the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments, and calculate the risk value of the pedestrian crossing the baseline based on the vertical distance and angle between the pedestrian and the baseline at multiple consecutive moments; The risk value of the pedestrian crossing the baseline is compared with a preset risk threshold, and if it is determined that the risk value is greater than the preset risk threshold, a crossing alarm is triggered.

2. The method according to claim 1, characterized in that: The method of determining the position information and warning color of each sign pole based on the pixel points corresponding to each sign pole in the single frame image, determining a baseline based on the position information of each sign pole, and obtaining a warning line by extending the baseline based on the position information and warning color of each sign pole includes: Determine the bottom corner points of the sign pole based on the pixel points corresponding to the sign pole in the single frame image, and connect the bottom corner points of each sign pole in sequence to form a reference line; Determine the top corner point of the sign pole based on the pixel point corresponding to the sign pole in the single-frame image, determine the height of the sign pole based on the distance between the bottom corner point and the top corner point of the sign pole, determine the maximum observation distance of the sign pole based on the height of the sign pole, determine the effective action line of the sign pole with the bottom corner point as the origin and the maximum observation distance as the radius, obtain the effective action line of each sign pole, and then determine the tangent line of adjacent effective action lines to obtain multiple tangent lines, and connect the multiple tangent lines in sequence to form an extension line; the extension line can reflect the maximum action range of all sign poles on pedestrians; The warning color of the sign pole is determined based on the color information of the pixel points corresponding to the sign pole, the risk coefficient is determined based on the warning color of the sign pole, and then the vertical distance between the extension line and the baseline is determined, the warning distance is determined based on the product of the risk coefficient and the vertical distance, the extension line is shrunk to a distance from the baseline that is the warning distance, and a warning line is obtained; the warning line is located between the baseline and the extension line.

3. The method according to claim 2, characterized in that The step of determining the warning color of the sign pole based on the color information of the pixel points corresponding to the sign pole, and determining the risk factor based on the warning color of the sign pole includes: The DBScan algorithm is used to perform color clustering on the pixel points corresponding to each signpost to obtain multiple color clusters; The color values ​​of the pixels in each color cluster are averaged to obtain the average color of each color cluster; After eliminating the color clusters with average colors of white and black, the average color corresponding to the color cluster with the largest number of pixels among the remaining color clusters is used as the main color of the signpost; Using the warning color with the highest similarity to the main color as the warning color of the signpost; Determine a risk factor corresponding to the warning color of the sign pole; wherein the risk factor corresponding to the warning color increases with an increase in the warning level.

4. The method according to claim 3, characterized in that The pedestrian detection is performed on the warning area in the surveillance video, and if it is determined that a pedestrian has entered the warning area, a vertical distance and an angle between the pedestrian and the baseline at multiple consecutive moments are determined, and a risk value of the pedestrian crossing the baseline is calculated based on the vertical distance and the angle between the pedestrian and the baseline at multiple consecutive moments, including: Sampling the surveillance video to obtain a surveillance image, determining a warning area in the surveillance image, and performing pedestrian detection in the warning area; If it is determined that a pedestrian has entered the warning area, the surveillance video is continuously sampled at a set time interval to obtain multiple frames of sampled images, and the position of the pedestrian in the continuous multiple frames of sampled images is determined; Determine the minimum bounding rectangle of the pedestrian in multiple frames of sampled images, take the center of the minimum bounding rectangle as the centroid of the pedestrian, and obtain the centroid of the pedestrian at multiple consecutive moments; Determine the vertical distances between the centroid of the pedestrian and the reference line at multiple consecutive moments, respectively, and determine the angle between the pedestrian and the reference line at multiple consecutive moments based on the centroid of the pedestrian at multiple consecutive moments; When it is determined that the vertical distance is less than the distance threshold, the risk value of the pedestrian at the current moment is calculated by the following formula: ; Wherein, n is the total number of sampled images, d(i) is the vertical distance between the centroid of the i-th sampled image and the baseline, d(i-1) is the vertical distance between the centroid of the i-th sampled image and the baseline, θ(i) is the angle between the tangent direction of the centroid of the i-th sampled image and the baseline, the value range of θ(i) is [0, 90°], and Risk(n) is the risk value of the pedestrian at the current moment.

5. The method according to claim 4, characterized in that The determining the angle between the pedestrian and the reference line at multiple consecutive moments based on the center of mass of the pedestrian at multiple consecutive moments includes: Determine the coordinates of the centroid in the i-th frame sampled image and the coordinates of the centroid in the i-1-th frame sampled image, and calculate the direction angle of the centroid in the i-th frame sampled image based on the coordinates of the centroid in the i-th frame sampled image and the coordinates of the centroid in the i-1-th frame sampled image; Randomly select two pixel points on the reference line, determine the coordinates of the two pixel points on the reference line, and determine the direction angle of the reference line based on the coordinates of the two pixel points; Determine the angle between the pedestrian and the baseline at the sampling moment of the i-th frame sampled image by using the direction angle of the baseline and the direction angle of the centroid in the i-th frame sampled image; The angle between the pedestrian and the baseline at the sampling moment of n frames of sampled images is used as the angle between the pedestrian and the baseline at multiple consecutive moments.

6. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method described in any one of claims 1 to 5 are realized.

7. A computer-readable storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Visual monitor protection method

    CN104618688A

  • Border-crossing detection method based camera angle

    CN104978751A