Event detection method and electronic device
By automatically drawing image detection areas through a deep learning network and combining it with an image quality evaluation network, the problem of low efficiency in detecting fast-running behavior of people in rail transit scenarios is solved, and efficient and accurate event detection is achieved.
Patent Information
- Application Number
- CN202310377600.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-04-10
AI Technical Summary
In existing rail transit scenarios, the detection efficiency of people running quickly in the same direction in locations such as subway stations is low. This is mainly due to the edge distortion of the scene images captured by the camera, which leads to inaccurate detection of pedestrian movement speed. The existing method of drawing the detection area is manual drawing, which is inefficient.
A deep learning network is used to detect landmarks in images, determine the location information of the landmarks, automatically draw the image detection area, and adjust the detection area based on the pedestrian pixel height and position. An image quality evaluation network is used to confirm fast-moving events, and detection accuracy is improved through multi-frame image tracking and speed detection.
It realizes fully automatic detection of multiple pedestrians running fast in rail transit scenarios, improves the efficiency and accuracy of event detection, avoids the inefficiency of manually drawing detection areas, and ensures accurate identification of fast-moving events.
Smart Images

Figure CN116844100B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image technology, and in particular to an event detection method and electronic device. Background Art
[0002] In rail transit scenarios, it's necessary to detect people running in the same direction quickly in locations such as subway station corridors, halls, and platforms. Because the edges of scene images captured by subway cameras are significantly distorted, this significantly affects the detection of pedestrian speed. Therefore, it's necessary to draw detection areas within the detection images to improve detection accuracy. However, the existing method of drawing detection areas manually results in low efficiency in running event detection. Summary of the Invention
[0003] Embodiments of the present application provide an event detection method and an electronic device to improve event detection efficiency.
[0004] An event detection method provided in an embodiment of the present application includes:
[0005] Determine at least one frame of captured image acquired for the monitored target scene, and based on the at least one frame of captured image, use a deep learning network to perform landmark detection on the image to determine image position information of at least one marker; and determine an image detection area for the event using the image position information of the at least one marker;
[0006] Event detection is performed on pedestrians within the image detection area.
[0007] By this method, at least one frame of captured image acquired for the monitored target scene is determined, and based on the at least one frame of captured image, a deep learning network is used to perform marker detection on the image to determine the image position information of at least one marker; the image position information of the at least one marker is used to determine the image detection area of the event, and event detection is performed on pedestrians within the image detection area, thereby realizing the automatic determination of the image detection area of the event by using the image position of at least one marker, avoiding manual drawing of the detection area, and thereby improving the efficiency of event detection.
[0008] In some embodiments, after determining the image detection area of the event, the method further includes:
[0009] Adjusting the image detection area using the pixel height and position of the pedestrian on the collected image;
[0010] The performing event detection on pedestrians within the image detection area includes:
[0011] Event detection is performed on pedestrians within the adjusted image detection area.
[0012] In some embodiments, adjusting the image detection area using the pixel height and position of the pedestrian in the captured image includes:
[0013] The image detection area is adjusted using the following formula:
[0014] h=wn+b;
[0015] Among them, n represents the vertical coordinate of any pixel point on the rectangular frame of the image detection area, h represents the height value of the pixel point, w and b represent the weight value and bias value determined by using the pixel height and position of multiple pedestrians on the captured image, respectively.
[0016] Therefore, the embodiment of the present application can further improve the accuracy of event detection by statistically analyzing the heights and positions of pedestrians in the detection area, and redrawing the detection area according to the ratio h=wn+b based on the distribution pattern of pedestrian heights at different positions in the image.
[0017] In some embodiments, determining an image detection area of an event using the image position information of the at least one marker includes:
[0018] According to the image position information of at least one marker, starting from the coordinate point of the lower right corner of the area of the rightmost marker in the captured image, the coordinate positions of the areas of each marker are connected counterclockwise to form a closed detection area, wherein the lower two vertices in the area of each marker are selected for connection. When the areas of multiple markers overlap, the vertices with smaller horizontal coordinates and larger vertical coordinates in the overlapping area are selected for connection.
[0019] In some embodiments, the performing event detection on pedestrians within the image detection area includes:
[0020] When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of a target area within the image detection area is captured, wherein the image of the target area includes an image of a running pedestrian;
[0021] Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0022] When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
[0023] Therefore, when the embodiment of the present application detects that the movement speed of multiple people exceeds a preset movement speed threshold, it preliminarily determines that there is a fast-moving event. It uses the obvious blurred dragging traces caused by the rapid movement of multiple pedestrians as a feature, and further completes the detection and confirmation of the fast-moving event of multiple pedestrians based on the image quality evaluation network, which can further improve the accuracy of fast-moving event detection.
[0024] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0025] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0026] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0027] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0028] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0029] In some embodiments, intercepting the target area image within the image detection area includes:
[0030] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0031] Another event detection method provided in an embodiment of the present application includes:
[0032] When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of a target area within the image detection area is captured, wherein the image of the target area includes an image of a pedestrian;
[0033] Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0034] When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
[0035] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0036] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0037] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0038] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0039] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0040] Another embodiment of the present application provides an electronic device, including a memory and a processor:
[0041] memory for storing computer programs;
[0042] A processor is configured to read the computer program in the memory and execute any one of the above methods.
[0043] Another embodiment of the present application provides another electronic device, including:
[0044] The first unit is configured to determine at least one frame of captured image acquired for a target scene to be monitored, and based on the at least one frame of captured image, perform landmark detection on the image using a deep learning network to determine image position information of at least one landmark; and determine an image detection area for an event using the image position information of the at least one landmark;
[0045] The second unit is used to perform event detection on pedestrians within the image detection area.
[0046] Another embodiment of the present application provides a computing device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.
[0047] Furthermore, according to an embodiment, a computer program product for a computer is provided, for example, comprising software code portions for executing the steps of the method defined above when the product is executed on the computer. The computer program product may include a computer-readable medium having the software code portions stored thereon. Furthermore, the computer program product may be directly loaded into the internal memory of the computer and / or transmitted via a network through at least one of an upload process, a download process, and a push process.
[0048] Another embodiment of the present application provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute any one of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0050] Figure 1 A flow chart of an event detection method provided in an embodiment of the present application;
[0051] Figure 2 A schematic flow chart of a method for determining an image detection area provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of an image detection area provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of another image detection area provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of pedestrian height statistics provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the adjusted image detection area provided in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of a specific process of an event detection method provided in an embodiment of the present application;
[0057] Figure 8 A schematic diagram of locating the head frame of a running pedestrian provided in an embodiment of the present application;
[0058] Figure 9A schematic diagram of a target area image captured based on the position of a pedestrian's head frame provided in an embodiment of the present application;
[0059] Figure 10 A schematic diagram of image quality scoring of a target area image provided in an embodiment of the present application;
[0060] Figure 11 A schematic diagram of an alarm picture provided in an embodiment of the present application;
[0061] Figure 12 A flowchart of another event detection method provided in an embodiment of the present application;
[0062] Figure 13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0063] Figure 14 A schematic structural diagram of another electronic device provided in an embodiment of the present application;
[0064] Figure 15 A schematic structural diagram of a third electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In the embodiments of this application, the term "and / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0066] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0067] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0068] The embodiments of the present application provide an event detection method and an electronic device to improve the efficiency and accuracy of event detection.
[0069] Among them, the method and the device are based on the same application concept. Since the principles of solving problems by the method and the device are similar, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0070] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0071] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one," "an," or "some" examples or embodiments at several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide further embodiments. Furthermore, terms such as "comprises" and "comprising" should be understood as not limiting the described embodiments to consisting only of those features already mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.
[0072] The following describes in detail the various embodiments of the present application in conjunction with the accompanying drawings. It should be noted that the order in which the embodiments of the present application are presented only represents the order of the embodiments, and does not represent the advantages or disadvantages of the technical solutions provided by the embodiments.
[0073] The existing method of drawing image detection areas is manual drawing, which is inefficient. Therefore, there is an urgent need for a method of automatically drawing image detection areas. Therefore, the method provided in the embodiment of the present application can realize fully automatic multi-pedestrian fast-running detection in rail transit. The positions of landmarks such as skirting boards, anti-slip strips, gates, escalators, and stairwells are detected based on a deep learning network, and then the image detection area is automatically drawn. Then, by further tracking the position and movement direction of pedestrians in multiple frames of images, the movement speed of the pedestrians is calculated and compared with the speed threshold. At the same time, due to reasons such as camera exposure time and camera shake, there will be obvious blurred dragging marks when multiple pedestrians run fast. Based on this motion blur phenomenon, an image quality evaluation network is introduced to capture motion blur features to further ensure whether a fast-running event occurs, thereby forming a complete set of faster and more accurate detection methods for running events.
[0074] See also Figure 1 , an event detection method provided by an embodiment of the present application includes:
[0075] S101. Determine at least one frame of captured image acquired for a target scene to be monitored, and based on the at least one frame of captured image, use a deep learning network (e.g., a target segmentation network UNet) to perform landmark detection on the image to determine image position information of at least one landmark; and determine an image detection area for an event using the image position information of the at least one landmark;
[0076] The target scene is, for example, a train station, a subway station, or other crowded scene that needs to be monitored.
[0077] The at least one frame of captured image obtained for the monitored target scene may be, for example, a monitoring video captured for the target scene, and the monitoring video is frame-processed to obtain one or more frames of image.
[0078] The markers include skirting boards, anti-slip strips, gates, escalators, stairwells, etc. in the passage.
[0079] The image position information of the marker, such as the coordinate position of the circumscribed rectangular frame of the marker, etc.
[0080] The embodiment of the present application utilizes the image position of at least one marker to automatically determine the image detection area of the event, avoiding manual drawing of the detection area, thereby improving the efficiency of running event detection.
[0081] S102: Perform event detection on pedestrians within the image detection area.
[0082] The event detection described in the embodiment of the present application can be, for example, the detection of fast-moving events (such as pedestrian running events), or the detection of other types of events (not limited by the embodiment of the present application).
[0083] In some embodiments, to further improve the accuracy of detection, after determining the image detection area of the event, the method further includes:
[0084] Adjusting the image detection area using the pixel height and position of the pedestrian on the collected image;
[0085] The performing event detection on pedestrians within the image detection area includes:
[0086] Event detection is performed on pedestrians within the adjusted image detection area.
[0087] In some embodiments, adjusting the image detection area using the pixel height and position of the pedestrian in the captured image includes:
[0088] The image detection area is adjusted using the following formula:
[0089] h=wn+b;
[0090] Among them, n represents the vertical coordinate of any pixel point on the rectangular frame of the image detection area, h represents the height value of the pixel point, w and b represent the weight value and bias value determined by using the pixel height and position of multiple pedestrians on the captured image, respectively.
[0091] The image detection area described in the embodiment of the present application is drawn according to the markings on the ground, which may easily lead to the situation where the target head is located outside the detection area. At the same time, due to the principle of camera perspective imaging, the target far away from the lens is smaller, and the target position nearby is larger. Therefore, the embodiment of the present application counts the heights of target pedestrians in the station hall and passage area, and according to the distribution law of the heights of target pedestrians at different positions in the picture, the image detection area is redrawn according to the ratio h=wn+b.
[0092] That is to say, the embodiment of the present application can further improve the accuracy of running event detection by statistically analyzing the heights and positions of pedestrians in the detection area, and redrawing the detection area according to the ratio h=wn+b based on the distribution pattern of pedestrian heights at different positions in the image.
[0093] In some embodiments, determining an image detection area of an event using the image position information of the at least one marker includes:
[0094] According to the image position information of at least one marker, starting from the coordinate point of the lower right corner of the area of the rightmost marker in the captured image, the coordinate positions of the areas of each marker are connected counterclockwise to form a closed detection area, wherein the lower two vertices in the area of each marker are selected for connection. When the areas of multiple markers overlap, the vertices with smaller horizontal coordinates and larger vertical coordinates in the overlapping area are selected for connection.
[0095] The following is an example of the method for automatically generating an image detection area in an embodiment of the present application, with reference to the accompanying drawings.
[0096] See also Figure 2 , a method for automatically generating an image detection area provided in an embodiment of the present application includes:
[0097] S201. Labeling and training of data sets.
[0098] Acquire images of target scenes such as passages, station halls, and platforms;
[0099] Special signs (i.e., landmarks) in rail transit corridors, station halls, and platforms, such as skirting boards, anti-slip strips, gates, escalators, and stairwells, are used as training data. The location and labels of landmark areas in the image are recorded through the annotation platform.
[0100] The target segmentation network UNet is used as the network model for iterative training (i.e., repeated training multiple times), and the trained model weights are saved. The model weights are saved as a trained file after network training, called a weight file (i.e., a pre-trained deep learning network). This file can be used to detect the location of landmarks such as anti-slip strips and gates in new images in real time.
[0101] S202: Marker detection and automatic generation of image detection areas.
[0102] Get the video frames captured in the real target scene;
[0103] Load the deep learning network trained in step S201 (referred to as the network model, i.e. the weight file above), use the network model to detect the positions of the baseboards, anti-slip strips, gates, escalators, stairways and other landmarks in the video frame, and obtain the circumscribed rectangular area position of each landmark, and obtain the coordinates of the four vertices of the circumscribed rectangle of each landmark, for example, Region i [(x1,y1),(x2,y2),(x3,y3),(x4,y4)], where (x1,y1),(x2,y2),(x3,y3),(x4,y4) are the image coordinates of the four vertices of the circumscribed rectangle of marker i.
[0104] Starting from the vertex coordinates of the lower right corner of the region of the rightmost landmark in the image, for example, from Region i (x4, y4), counterclockwise draw the area connecting each marker to form a closed image detection area. In the process of connecting the areas of each marker, select the following two coordinate points in the area of each marker to connect. When multiple areas overlap, select the horizontal coordinate x of the overlapping area. i Smaller, vertical coordinate y i The larger points are connected to complete the drawing of the image detection area. The image detection area obtained is as follows: Figure 3 The station hall area shown, Figure 4 Channel area shown.
[0105] S203: Fine-tune the image detection area.
[0106] Due to the complex environment of target scenes such as subway stations and train stations, and the large number of target pedestrians, in the process of target detection and tracking of pedestrians, mutual occlusion between pedestrians often occurs, resulting in target ID jumps and target tracking failure. Therefore, the embodiment of the present application proposes to use the heads of pedestrians with less mutual occlusion as tracking features. However, the image detection area determined in the above step S202 is drawn according to the ground markings, and it is easy for the head of a person to be located outside the image detection area, resulting in missed detection of pedestrians. In addition, according to the principle of camera perspective imaging, targets far away from the lens are smaller, and targets close to the lens are larger, such as Figure 5 As shown, pedestrians in the distance are smaller, while pedestrians in the near distance are larger.
[0107] Therefore, in order to be more accurate, in the embodiment of the present application, the image detection area is fine-tuned based on the statistical results of the pixel height of pedestrians in the image detection area, specifically including:
[0108] Count the pixel heights of each pedestrian in the image detection area;
[0109] Based on the statistical data of the pixel height of each pedestrian in the image detection area, a regional linear model h=wn+b is established; that is, based on the statistical data of the pixel height of each pedestrian in the image detection area, the values of the parameters w and b are determined, where n is the vertical coordinate of any pixel point on the black rectangular box in the image (that is, the rectangular box of the image detection area), and h is the elevated height value of the pixel point.
[0110] According to the distribution of pedestrian heights at different positions in the image, the image detection area is redrawn (for example, the area height is adjusted) according to the ratio h=wn+b, where w and b are equivalent to the preset weights and biases (preset values, which are determined according to the pixel height and position of the pedestrians in the image). From this formula, it can be seen that the height of the rectangular box in the distant part of the image detection area is adjusted less, while the height of the rectangular box in the near part is adjusted more. Finally, for example, for Figure 4 The image detection area shown in the figure is as follows: Figure 6 shown.
[0111] In summary, the embodiments of the present application use a deep learning network to automatically extract areas of landmarks such as skirting boards, anti-slip strips, gates, escalators, and stairwells in scenes such as subway stations, and automatically draw image detection areas based on this. This allows for automatic drawing of image detection areas for events involving multiple pedestrians running quickly in scenes such as subway stations, replacing the existing method of manually drawing image detection areas and improving event detection efficiency.
[0112] The following further introduces the detection of multiple pedestrians running fast events based on the image quality assessment network, using the obvious blurred dragging traces caused by multiple pedestrians running fast as features.
[0113] In some embodiments, performing event detection on pedestrians within the image detection area includes:
[0114] When the speed of multiple people detected within the image detection area exceeds a preset speed threshold, a rapid motion event is preliminarily determined to have occurred, and an image of the target area within the image detection area is captured, wherein the target area image includes an image of a running pedestrian. Because the pedestrian area image is blurred due to rapid movement, the target area image can also be referred to as a blurred area image. The speed threshold can be set according to user needs or as a default value.
[0115] Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0116] When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists. The image quality score threshold can be set according to user needs or can be a default value.
[0117] Therefore, when the embodiment of the present application detects that the movement speed of multiple people exceeds a preset movement speed threshold, it preliminarily determines that there is a fast-moving event. It uses the obvious blurred dragging traces caused by multiple pedestrians running fast as a feature, and further completes the detection and confirmation of the fast-moving event of multiple pedestrians based on the image quality evaluation network, which can further improve the accuracy of running event detection.
[0118] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0119] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm; for example, use a Kalman filter and Hungarian algorithm to achieve real-time tracking of people;
[0120] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0121] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0122] When the number of people moving in the same direction exceeds a preset number threshold, and the speed of each person moving in the same direction is greater than a preset speed threshold, a rapid movement event is preliminarily determined to have occurred. The number threshold can be set according to actual needs or can be pre-set.
[0123] The preliminary determination of the presence of a fast-moving event described in the embodiment of the present application can be seen as utilizing the speed of the pedestrian to preliminarily determine whether there is a running event.
[0124] In some embodiments, intercepting the target area image within the image detection area includes:
[0125] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0126] For example, in the middle area of the image, there are four pedestrians located at the upper left, lower left, upper right, and lower right respectively. These four pedestrians move in the same direction, and their moving speeds exceed the preset moving speed threshold. It is preliminarily determined that there is a fast-moving event. In order to ensure the accuracy of event detection, the images of these four people are further captured, that is, the target area image is captured. The capture method can be: determine the vertex coordinates of the upper left corner of the circumscribed rectangular box of the upper left pedestrian's head, and the vertex coordinates of the lower right corner of the circumscribed rectangular box of the lower right pedestrian's head. Based on the coordinates of these two points, a rectangular area is determined, and the image within the rectangular area is captured as the target area image.
[0127] In some embodiments, after finally determining that there is a fast-moving event, an alarm message may be issued, which may carry intercepted image information, etc., so that staff can check relevant information in time and take corresponding measures to avoid danger.
[0128] The following describes how to perform event detection after determining the image detection area in an embodiment of the present application in conjunction with the accompanying drawings.
[0129] The method for detecting running events provided in the embodiment of the present application is, for example, a fully automatic method for detecting multiple pedestrian fast-moving events in rail transit. The method automatically generates image detection areas based on a target segmentation network, determines pedestrian trajectories based on a target detection and tracking network, and detects multiple pedestrian fast-moving events through post-processing logic. The specific flow chart is as follows: Figure 7 As shown, the following steps are included:
[0130] S701, obtain video:
[0131] Decode the camera video stream, run the frame rate according to the preset algorithm, and extract the image frame, that is, determine each frame image.
[0132] S702, head detection:
[0133] Automatic drawing of image detection areas: Based on the semantic segmentation network, pedestrian height statistics, and automatic image detection area drawing method proposed above, image detection areas are drawn in collected images of scenes such as station halls, platforms, and passages in rail transit.
[0134] Head feature extraction: For each frame of the image, the Yolov5s algorithm (target detection algorithm) after transfer learning is used to detect the heads of pedestrians within the image detection area. The coordinates [x, y, w, h] of the detected pedestrian head frame and the confidence level are output. Among them, x, y, w, and h represent the horizontal and vertical coordinates, width, and height of the vertex in the upper left corner of the head rectangular frame, respectively.
[0135] S703, Head Tracking:
[0136] Head feature extraction: Detect the heads of pedestrians within the image detection area on each frame of the image. For each pedestrian's circumscribed rectangular frame within the image detection area, establish initial tracks and use the Kalman filter to predict the position of the head frame of the same pedestrian in the next frame of the image.
[0137] Matching and tracking of the same head: For each pedestrian in the image detection area on the current frame image, the position of the pedestrian's head frame is matched with the coordinate position of the head frame predicted by the target detection model (that is, the position of the head frame of the same pedestrian on the next frame image predicted by the Kalman filter in the previous step), and the cost matrix is calculated. The cost matrix is used as the input of the Hungarian matching algorithm, and finally the linear matching result is obtained. That is, this step realizes the tracking of pedestrians through the preset target tracking algorithm.
[0138] Update the position of the tracked head: For each pedestrian in the image detection area, determine and record the latest head position of the pedestrian (equivalent to the position of the pedestrian), thereby achieving multi-pedestrian tracking.
[0139] S704. Calculate the pedestrian's speed and direction:
[0140] Cache the tracking results of historical frames: cache the head tracking results of each pedestrian in the image detection area in the previous step, wherein the head tracking results include the coordinate position of the rectangular box of the same pedestrian's head in multiple consecutive frames of images.
[0141] Match the position coordinates of each head in the historical frame: that is, determine the coordinate position of the rectangular frame of the head of the same person in multiple consecutive frames of images.
[0142] Based on the position of the head, the actual movement speed and direction of the pedestrian are calculated: Based on the movement history trajectory of each pedestrian (different pedestrians are distinguished by ID) obtained by the target tracking algorithm, and the corresponding tracking time, based on the coordinate position of the rectangular frame of the head, the actual movement speed and direction of each pedestrian in the image detection area are calculated. The pedestrian's movement speed can be calculated by dividing the pedestrian's historical movement trajectory by the tracking time, and the pedestrian's movement direction can be determined by calculating the angle between the historical movement trajectory and the horizontal axis.
[0143] S705. Preliminary judgment of the running event:
[0144] For example, it is possible to first determine whether the number of pedestrians in the image detection area on multiple consecutive frames of captured images is greater than a preset threshold. If so, it is further determined whether the speeds of these pedestrians are all greater than a preset threshold. Otherwise, it is possible to continue monitoring whether the number of pedestrians in the image detection area on the captured images is greater than the preset threshold.
[0145] When the number of pedestrians in the image detection area on multiple consecutive frames of captured images is greater than a preset threshold, and the speed of these pedestrians is also greater than the preset threshold, it is preliminarily judged that a fast-moving event (i.e., a running event) has occurred; if the speeds of these pedestrians are not all greater than the preset threshold, or the number of people whose speeds are greater than the preset threshold does not exceed the preset threshold, the speed of pedestrians in the image detection area on the captured images can continue to be monitored.
[0146] In addition to the above methods, there are many ways to implement the preliminary judgment of running events. For example, in some embodiments, it is also possible to first determine whether the current time from the alarm time of the last fast-moving event exceeds the preset alarm interval. If so, it is further determined whether the number of people moving in the same direction exceeds the preset threshold of the number of people moving in the same direction. If so, it is further determined whether the moving speed of the people moving in the same direction exceeds the preset speed threshold. If the moving speed of the people moving in the same direction exceeds the preset speed threshold, it is preliminarily determined that there is a fast-moving event.
[0147] When it is preliminarily determined that there is a running event, the target area image in the image is cropped (i.e., a blurred image of multiple people running is obtained) based on the positions of the head frames of pedestrians moving in the same direction (of course, the embodiment of the present application is not limited to moving in the same direction).
[0148] S706: Output event detection results:
[0149] The cropped target area image is input into the preset MANIQA image quality assessment network, which performs characteristic analysis on the target area image (i.e., analyzes its blurriness) through the image quality assessment network, outputs an image quality assessment score, and then determines whether the score is less than the preset image quality score threshold (the blurrier the image, the worse the image quality, the lower the score, and vice versa). If so, it is determined that the target area image is caused by motion, thereby completing further confirmation of the fast-moving event (i.e., running event) (i.e., first judging by speed, and then further confirming by blur characteristics), completing the detection of the fast-moving event. If the score is higher than the preset image quality score threshold, the blurriness of the latest captured target area image can continue to be monitored, and no alarm is temporarily issued.
[0150] The capture of motion blur features (i.e., acquisition of the target area image) includes, for example:
[0151] a. Obtain a blurred image of multiple people running:
[0152] like Figure 8 As shown, within the image detection area of the current frame, after detecting that multiple people are running at speeds exceeding a preset running speed threshold, a running event is preliminarily determined to exist, and the image information of the current frame and the position information of the head frames of each person in the image detection area of the current frame are recorded;
[0153] Among the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the upper left corner and the lower right corner are selected to form a rectangular area. The image in the rectangular area is intercepted as the target area image, thereby realizing the interception of the target area image of the original captured image. Figure 8 The captured image is shown in the figure, and the captured target area image is shown in the figure. Figure 9 shown.
[0154] b. Evaluate the motion model (i.e., the target area image) using the image quality evaluation network.
[0155] See also Figure 10 The acquired target area image is input into the preset MANIQA image quality evaluation network, which analyzes the characteristics of the target area image, evaluates the quality of the image, and finally outputs the quality score. By setting the quality score threshold, the fast running event is finally detected and confirmed. When the running event is finally confirmed, the input and output can also be Figure 11 The alarm picture shown includes the number of running pedestrians and their running directions marked on the original captured image.
[0156] Visible, see Figure 12, a method for detecting a fast-moving event provided by an embodiment of the present application includes:
[0157] S121. When it is detected within the image detection area that the movement speed of multiple people exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event has occurred, and capturing an image of a target area within the image detection area, wherein the image of the target area includes an image of a pedestrian;
[0158] S122. Scoring the image quality of the target area image using a preset image quality evaluation network to obtain a quality score of the target area image;
[0159] S123: When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
[0160] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0161] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0162] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0163] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0164] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0165] In some embodiments, intercepting the target area image within the image detection area includes:
[0166] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0167] In summary, the event detection method provided in the embodiments of the present application has the following reliable characteristics:
[0168] This detection solution is based on a multi-target tracking algorithm, post-processing logic, and an image quality assessment network. It can detect fast-running events within a given timeframe, meeting the real-time requirement of reliability.
[0169] This detection solution can detect the same running event in different running environments (i.e., running event detection can be achieved under different computer configurations), which meets the reproducibility feature of the reliability characteristic.
[0170] This detection solution allows users to set hyperparameters (e.g., movement speed threshold, image quality evaluation threshold, etc.) to determine the degree of detection of running events. The degree of importance attached to event detection results and the degree to which they are adopted can be adjusted by the user, which conforms to the controllability characteristic of trustworthiness.
[0171] In addition to having the above three reliable characteristics, the fully automatic event detection method provided in the embodiment of the present application can greatly improve the detection efficiency and accuracy of running events.
[0172] Based on the same inventive concept, the following introduces the equipment or device provided in the embodiments of the present application, in which the explanations or examples of the technical features that are the same or corresponding to those described in the above method will not be repeated later.
[0173] See also Figure 13 Another embodiment of the present application provides an electronic device, including:
[0174] The processor 500 is configured to read the program in the memory 520 and execute the following process:
[0175] Determine at least one frame of captured image acquired for the monitored target scene, and based on the at least one frame of captured image, use a deep learning network to perform landmark detection on the image to determine image position information of at least one marker; and determine an image detection area for the event using the image position information of the at least one marker;
[0176] Event detection is performed on pedestrians within the image detection area.
[0177] In some embodiments, after determining the image detection area of the event, the processor 500 is further configured to read a program in the memory 520 and execute the following process:
[0178] Adjusting the image detection area using the pixel height and position of the pedestrian on the collected image;
[0179] The performing event detection on pedestrians within the image detection area includes:
[0180] Event detection is performed on pedestrians within the adjusted image detection area.
[0181] In some embodiments, adjusting the image detection area using the pixel height and position of the pedestrian in the captured image includes:
[0182] The image detection area is adjusted using the following formula:
[0183] h=wn+b;
[0184] Among them, n represents the vertical coordinate of any pixel point on the rectangular frame of the image detection area, h represents the height value of the pixel point, w and b represent the weight value and bias value determined by using the pixel height and position of multiple pedestrians on the captured image, respectively.
[0185] In some embodiments, determining an image detection area of an event using the image position information of the at least one marker includes:
[0186] According to the image position information of at least one marker, starting from the coordinate point of the lower right corner of the area of the rightmost marker in the captured image, the coordinate positions of the areas of each marker are connected counterclockwise to form a closed detection area, wherein the lower two vertices in the area of each marker are selected for connection. When the areas of multiple markers overlap, the vertices with smaller horizontal coordinates and larger vertical coordinates in the overlapping area are selected for connection.
[0187] In some embodiments, the performing event detection on pedestrians within the image detection area includes:
[0188] When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of a target area within the image detection area is captured, wherein the image of the target area includes an image of a running pedestrian;
[0189] Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0190] When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
[0191] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0192] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0193] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0194] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0195] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0196] In some embodiments, intercepting the target area image within the image detection area includes:
[0197] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0198] When the electronic device is used alone as a fast-moving event detection device, the detection processor 500 is configured to read the program in the memory 520 and execute the following process:
[0199] When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of a target area within the image detection area is captured, wherein the image of the target area includes an image of a pedestrian;
[0200] Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0201] When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
[0202] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0203] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0204] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0205] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0206] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0207] In some embodiments, intercepting the target area image within the image detection area includes:
[0208] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0209] In some embodiments, the electronic device further includes a transceiver 510 , configured to receive and send data under the control of the processor 500 .
[0210] Among them, Figure 13 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 500 and memory represented by memory 520. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are all well known in the art and, therefore, will not be described further herein. The bus interface provides an interface. The transceiver 510 may be a plurality of components, i.e., a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, such as a wireless channel, a wired channel, an optical cable, and the like. The processor 500 is responsible for managing the bus architecture and general processing, and the memory 520 may store data used by the processor 500 when performing operations.
[0211] The processor 500 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or a complex programmable logic device (CPLD). The processor may also adopt a multi-core architecture.
[0212] If the electronic device serves as a terminal-side device, it may also include a user interface connected to the bus. The user interface may be an interface capable of connecting to required external or internal devices. The connected devices include but are not limited to a keypad, display, speaker, microphone, joystick, etc.
[0213] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.
[0214] See also Figure 14 Another embodiment of the present application provides another electronic device, including:
[0215] The first unit 11 is configured to determine at least one frame of captured image acquired for a target scene to be monitored, and based on the at least one frame of captured image, perform landmark detection on the image using a deep learning network to determine image position information of at least one landmark; and determine an image detection area for an event using the image position information of the at least one landmark;
[0216] The second unit 12 is configured to perform event detection on pedestrians within the image detection area.
[0217] Determine at least one frame of captured image acquired for the monitored target scene, and based on the at least one frame of captured image, use a deep learning network to perform landmark detection on the image to determine image position information of at least one marker; and determine an image detection area for the event using the image position information of the at least one marker;
[0218] Event detection is performed on pedestrians within the image detection area.
[0219] In some embodiments, after determining the image detection area of the event, the first unit 11 is further configured to:
[0220] Adjusting the image detection area using the pixel height and position of the pedestrian on the collected image;
[0221] The performing event detection on pedestrians within the image detection area includes:
[0222] Event detection is performed on pedestrians within the adjusted image detection area.
[0223] In some embodiments, adjusting the image detection area using the pixel height and position of the pedestrian in the captured image includes:
[0224] The image detection area is adjusted using the following formula:
[0225] h=wn+b;
[0226] Among them, n represents the vertical coordinate of any pixel point on the rectangular frame of the image detection area, h represents the height value of the pixel point, w and b represent the weight value and bias value determined by using the pixel height and position of multiple pedestrians on the captured image, respectively.
[0227] In some embodiments, determining an image detection area of an event using the image position information of the at least one marker includes:
[0228] According to the image position information of at least one marker, starting from the coordinate point of the lower right corner of the area of the rightmost marker in the captured image, the coordinate positions of the areas of each marker are connected counterclockwise to form a closed detection area, wherein the lower two vertices in the area of each marker are selected for connection. When the areas of multiple markers overlap, the vertices with smaller horizontal coordinates and larger vertical coordinates in the overlapping area are selected for connection.
[0229] In some embodiments, the performing event detection on pedestrians within the image detection area includes:
[0230] When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of a target area within the image detection area is captured, wherein the image of the target area includes an image of a running pedestrian;
[0231] Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0232] When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
[0233] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0234] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0235] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0236] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0237] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0238] In some embodiments, intercepting the target area image within the image detection area includes:
[0239] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0240] See also Figure 15 Another embodiment of the present application provides another electronic device, including:
[0241] The preliminary detection unit 21 is configured to, when detecting that the movement speed of multiple people exceeds a preset movement speed threshold within the image detection area, preliminarily determine that a fast-moving event exists, and intercept an image of a target area within the image detection area, wherein the image of the target area includes an image of a pedestrian;
[0242] The quality scoring unit 22 is configured to score the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image;
[0243] The final determination unit 23 is configured to finally determine that a fast motion event exists when the quality score of the target area image is less than a preset image quality score threshold.
[0244] In some embodiments, when the movement speed of multiple people detected in the image detection area exceeds a preset movement speed threshold, preliminarily determining that a rapid movement event exists includes:
[0245] Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm;
[0246] For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images;
[0247] Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images;
[0248] When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
[0249] In some embodiments, intercepting the target area image within the image detection area includes:
[0250] Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
[0251] It should be noted that the division of units in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0252] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0253] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.
[0254] An embodiment of the present application provides a processor-readable storage medium, which stores a computer program. The computer program is used to enable the processor to execute any of the methods provided in the above-mentioned embodiments of the present application.
[0255] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSDs)), etc.
[0256] The present application embodiment also provides a computer program product or computer program, which includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs any of the methods described in the above embodiments. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0257] It should be understood that:
[0258] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.
[0259] Embodiments suitable for being implemented as software code or a portion thereof and run using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.
[0260] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (Central Processing Unit), MOS (Metal Oxide Semiconductor), CMOS (Complementary MOS), BiMOS (Bipolar MOS), BiCMOS (Bipolar CMOS), ECL (Emitter Coupled Logic) and / or TTL (Transistor-Transistor Logic).
[0261] Embodiments may be implemented as separate devices, apparatuses, units, components or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, where one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a particular process as described.
[0262] The apparatus may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.
[0263] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.
[0264] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.
[0265] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) that contain computer-usable program code.
[0266] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0267] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0268] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0269] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. An event detection method, characterized in that: The method comprises: Determine at least one frame of captured image acquired for the monitored target scene, and based on the at least one frame of captured image, use a deep learning network to perform landmark detection on the image to determine image position information of at least one marker; and determine an image detection area for the event using the image position information of the at least one marker; The image detection area is adjusted using the following formula: h=wn+b; Wherein, n represents the ordinate of any pixel point on the rectangular frame of the image detection area, h represents the height value of the pixel point, and w and b represent the weight value and bias value determined by using the pixel heights and positions of multiple pedestrians on the collected image, respectively; Event detection is performed on pedestrians within the adjusted image detection area.
2. The method according to claim 1, characterized in that The determining of the image detection area of the event by using the image position information of the at least one marker includes: According to the image position information of at least one marker, starting from the coordinate point of the lower right corner of the area of the rightmost marker in the captured image, the coordinate positions of the areas of each marker are connected counterclockwise to form a closed detection area, wherein the lower two vertices in the area of each marker are selected for connection. When the areas of multiple markers overlap, the vertices with smaller horizontal coordinates and larger vertical coordinates in the overlapping area are selected for connection.
3. The method according to claim 1, characterized in that The performing event detection on pedestrians within the image detection area includes: When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of a target area within the image detection area is captured, wherein the image of the target area includes an image of a pedestrian; Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image; When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
4. The method according to claim 3, characterized in that When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a preliminary determination of a rapid movement event is made, including: Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm; For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images; Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images; When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
5. The method according to claim 3, characterized in that The intercepting the target area image within the image detection area includes: Among the coordinates of the four vertices of the head frames of all pedestrians in the image detection area, the coordinates of the vertices at the upper left corner and the lower right corner are selected to form a rectangular area, and the image within the rectangular area is intercepted as the target area image.
6. An event detection method, characterized in that: The method comprises: When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a rapid movement event is preliminarily determined to exist, and an image of the target area within the image detection area is captured, wherein the image of the target area includes an image of a pedestrian; the image detection area is based on at least one frame of captured image acquired from the monitored target scene, and a deep learning network is used to perform landmark detection on the image to determine the image position information of at least one landmark; the image position information of the at least one landmark is used to determine; the image detection area is adjusted using the following formula: h=wn+b; Wherein, n represents the ordinate of any pixel point on the rectangular frame of the image detection area, h represents the height value of the pixel point, and w and b represent the weight value and bias value determined by using the pixel heights and positions of multiple pedestrians on the collected image, respectively; Scoring the image quality of the target area image through a preset image quality evaluation network to obtain a quality score of the target area image; When the quality score of the target area image is less than a preset image quality score threshold, it is finally determined that a fast motion event exists.
7. The method according to claim 6, characterized in that When the movement speed of multiple people is detected to exceed a preset movement speed threshold within the image detection area, a preliminary determination of a rapid movement event is made, including: Determine the position of pedestrians within the image detection area on multiple consecutive frames of captured images using a preset target detection and tracking algorithm; For each pedestrian in the image detection area on the continuous multi-frame collected images, determine the pedestrian's moving speed and direction according to the pedestrian's position on the continuous multi-frame collected images; Determining the number of people moving in the same direction based on the moving speed and direction of each pedestrian in the image detection area on the continuous multi-frame captured images; When the number of people moving in the same direction exceeds a preset number threshold, and the moving speed of each pedestrian moving in the same direction is greater than a preset moving speed threshold, it is preliminarily determined that a rapid movement event occurs.
8. An electronic device, characterized in that: Including memory, processor: memory for storing computer programs; A processor, configured to read the computer program in the memory and execute the method according to any one of claims 1 to 5.