Pedestrian following recognition method and device, computer equipment and storage medium
By using image acquisition equipment and pedestrian detection algorithms, the vectors and angles between pedestrians are calculated. Combined with motion trajectory analysis, the problem of pedestrian tailgating is solved, and the safety and efficiency of gate passage are improved.
Patent Information
- Application Number
- CN202511038125.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies are insufficient to effectively identify and prevent pedestrian tailgating, leading to safety hazards and traffic disorder.
Video footage around the turnstile is captured using image acquisition equipment. Pedestrian detection algorithms are used to determine pedestrian detection boxes, calculate the vectors and angles between pedestrians, determine whether there is a trailing graph for pedestrians, and confirm trailing behavior by combining motion trajectory analysis.
It enables rapid and accurate identification of pedestrian tailgating behavior, improving the safety and efficiency of gate passage.
Smart Images

Figure CN120976260A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a pedestrian following identification method and device, computer equipment and storage medium. BACKGROUND
[0002] With the continuous improvement of smart city and security needs, the safety and passing efficiency of gate entrances as key control nodes of public places are increasingly valued.
[0003] Pedestrian tailing (or "following behavior") refers to the behavior of unauthorized personnel following authorized personnel through the gate to evade identity verification or payment. This behavior not only causes safety hazards (such as illegal entry, ticket evasion, etc.), but also affects the normal passing order. The visual detection technology based on images has become a research hotspot to solve this problem due to its non-contact, high efficiency and scalability. SUMMARY
[0004] Therefore, it is necessary to provide a pedestrian following identification method, device, computer equipment, computer readable storage medium and computer program product to quickly identify the behavior of pedestrians evading identity verification or payment and tailing others through the gate.
[0005] In a first aspect, the present application provides a pedestrian following identification method, comprising:
[0006] determining a first vector according to a first detection box and a second detection box in a first image; wherein the first detection box is a detection box corresponding to a first pedestrian, the second detection box is a detection box corresponding to a second pedestrian, and the first pedestrian is a pedestrian about to pass through the gate;
[0007] determining a first included angle between the first vector and a second vector; wherein the direction of the second vector is the direction of entering the gate;
[0008] determining a prediction result of whether the second pedestrian has the possibility of following the first pedestrian through the gate according to the first vector and the first included angle;
[0009] In the case that the prediction result is that the second pedestrian has the possibility of following the first pedestrian through the gate, determining a target result of whether the second pedestrian has the intention of following the first pedestrian through the gate according to the motion trajectory of the second pedestrian.
[0010] In a second aspect, the present application provides a pedestrian following identification device, comprising:
[0011] a vector calculation module configured to determine a first vector according to a first detection box and a second detection box in a first image; wherein the first detection box is a detection box corresponding to a first pedestrian, the second detection box is a detection box corresponding to a second pedestrian, and the first pedestrian is a pedestrian about to pass through the gate;
[0012] an included angle calculation module, configured to determine a first included angle between the first vector and a second vector according to the first vector and the second vector, wherein a direction of the second vector is a direction of entering the gate;
[0013] a result prediction module, configured to determine a prediction result of whether the second pedestrian has a possibility of following the first pedestrian to pass through the gate according to the first vector and the first included angle;
[0014] a result determination module, configured to determine a target result of whether the second pedestrian has an intention of following the first pedestrian to pass through the gate according to a motion trajectory of the second pedestrian in a case that the prediction result is that the second pedestrian has the possibility of following the first pedestrian to pass through the gate.
[0015] In a third aspect, the present application provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps in the above method when executing the computer program.
[0016] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps in the above method when executed by a processor.
[0017] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program implements the steps in the above method when executed by a processor.
[0018] The above pedestrian following identification method, device, computer device, computer readable storage medium and computer program product, the computer device can determine whether a pedestrian follows a person who is about to pass through a gate through images collected by an image collection device. First, a first pedestrian who is about to enter the gate and a second pedestrian who is closest to the first pedestrian are determined, a first vector is determined according to center points of pedestrian detection boxes corresponding to the first pedestrian and the second pedestrian, and a length of the first vector can represent a distance between the two pedestrians. If the length of the first vector is less than a length threshold, it indicates that the second pedestrian is close to the first pedestrian. If an included angle between the first vector and a second vector is less than an included angle threshold, it indicates that a forward direction of the second pedestrian is likely to be the same as a forward direction of the first pedestrian. Therefore, if the length of the first vector is less than the length threshold and the first included angle is less than the included angle threshold, the server determines that the second pedestrian has a possibility of following the first pedestrian to enter the gate. Then, the server further determines whether a motion trajectory of the second pedestrian is a direction of entering the gate according to multiple images including the second pedestrian, and if so, the server determines that the second pedestrian has an intention of following the first pedestrian to enter the gate. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1An application environment diagram of a pedestrian following recognition method provided by an embodiment of the present application;
[0020] Figure 2 A flowchart of a pedestrian following recognition method provided by an embodiment of the present application;
[0021] Figure 3 A schematic diagram of pedestrian following analysis provided by an embodiment of the present application;
[0022] Figure 4 A structural block diagram of a pedestrian following recognition device provided by an embodiment of the present application;
[0023] Figure 5 An internal structure diagram of a computer device provided by an embodiment of the present application;
[0024] Figure 6 An internal structure diagram of another computer device provided by an embodiment of the present application;
[0025] Figure 7 An internal structure diagram of a computer readable storage medium provided by an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0027] The pedestrian following recognition method provided by the embodiments of the present application can be applied in an application environment as shown in the following figure. Figure 1 In the application environment, the terminal 102 communicates with the server 104 through a communication network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. In the present application, the terminal 102 is an image acquisition device, which is installed at a subway station, an office building or other places where a gate is set. The image acquisition device can shoot a video near the gate and send the video to the server 104 through the communication network. The server 104 is used to identify whether an unauthorized person follows an authorized person to pass through the gate to evade identity verification or payment of fees. In the video shot by the image acquisition device, each frame of image includes the gate and the surrounding area of the gate. The server 104 can detect pedestrians in the video shot by the image acquisition device, and determine whether the following pedestrian has the intention to follow the preceding pedestrian to pass through the gate according to the positional relationship between the preceding pedestrian and the following pedestrian who are about to pass through the gate. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0028] As shown in Figure 2 The embodiment of the present application provides a pedestrian following recognition method. The method is applied to a terminal 102 or a server 104 in Figure 1 It can be understood that the computer device can include at least one of the terminal and the server. The method includes the following steps.
[0029] S201, the server acquires a first image, performs pedestrian detection on the first image, and obtains a detection box corresponding to each pedestrian.
[0030] The image acquisition device sends the collected video to the server through a communication network. The server performs pedestrian detection on each frame of image in the video to determine whether there is a pedestrian in the image. It should be understood that after the server detects a pedestrian, the server identifies each pedestrian with a rectangular box and assigns an identity (ID) to each pedestrian, so as to quickly locate the same pedestrian in different images. Wherein, the algorithm for performing pedestrian detection on the pedestrian in the image can be a pedestrian detection algorithm based on Histogram of Oriented Gradients (HOG) features, a pedestrian detection algorithm based on Haar wavelet features, Faster Region-based Convolutional Neural Network (Faster R-CNN) or You Only Look Once (YOLO) algorithm, which is not limited in the present application.
[0031] S202, the server determines a first vector according to a first detection box corresponding to a first pedestrian and a second detection box corresponding to a second pedestrian in the first image.
[0032] After the server detects that the first image includes a plurality of pedestrians, the server further detects a preset region of interest (ROI). The ROI region includes a gate entrance region. If there are two or more pedestrians in the ROI region of the first image, for example, there are a first pedestrian and a second pedestrian in the ROI region. The first pedestrian is a pedestrian who is close to the gate entrance, that is, a pedestrian who is about to pass through the gate.
[0033] After determining the first pedestrian and the second pedestrian in the ROI region, the server determines the coordinates of the center point P1 of the first detection box corresponding to the first pedestrian and the coordinates of the center point P2 of the second detection box corresponding to the second pedestrian. For the convenience of description, the center point of the first detection box is referred to as the first center point, and the center point of the second detection box is referred to as the second center point. Then, the server determines a first vector according to the first center point P1 and the second center point P2. The direction of the first vector is from the second center point P2 to the first center point P1, that is, if the coordinates of the first center point P1 are (x1, y1) and the coordinates of the second center point P2 are (x2, y2), the first vector v1 = (x1-x2, y1-y2).
[0034] It should be noted that the coordinates of the first center point and the second center point are image coordinates, as shown in FIG. 1. Figure 3 As shown in FIG. 1, the image coordinate system is established with the upper left corner of the image as the coordinate origin O and one side of the image as the x-axis and the other side as the y-axis.
[0035] S203, determining a first included angle between the first vector and the second vector; wherein the direction of the second vector is the direction of entering the gate.
[0036] The second vector is the direction of entering the gate. Since the image acquisition device is located at a fixed position, the position of the gate in any image captured by the image acquisition device is unchanged, so the direction of entering the gate in the image captured by the image acquisition device is unchanged, and thus the direction of the second vector is unchanged. After the image acquisition device captures the video, the second vector can be determined. As shown in FIG. 1, the second vector v2 = (x0, y0). Figure 3
[0037] After determining the first vector, the server calculates a first included angle θ between the first vector and the second vector; wherein the first included angle θ satisfies the following formula 1 between the first vector and the second vector:
[0038]
[0039] S204, the server determines a prediction result of whether the second pedestrian has the possibility of following the first pedestrian through the gate according to the first vector and the first included angle. If the prediction result is that the second pedestrian has the possibility of following the first pedestrian through the gate, S205 is performed, and if the prediction result is that the second pedestrian does not have the possibility of following the first pedestrian through the gate, the processing of the first image is stopped.
[0040] After determining the first included angle, the server can predict whether a second pedestrian might follow the first pedestrian through the turnstile based on the first vector and the first included angle. The server determines the magnitude of the first vector, i.e., the length of the first vector, based on the coordinates of the start and end points of the first vector, and then determines whether a second pedestrian might follow the first pedestrian through the turnstile based on the length of the first vector and the size of the first included angle.
[0041] Specifically, if the length of the first vector is less than a first length threshold and the first included angle is less than a first included angle threshold, the server determines that the prediction result indicates that the second pedestrian may follow the first pedestrian through the turnstile. The first included angle threshold is less than 90 degrees; for example, it can be set to 30 degrees, 45 degrees, or 50 degrees, etc., and this application does not impose any specific limitation on it.
[0042] If the length of the first vector is less than the first length threshold, it means that the distance between the second pedestrian and the first pedestrian is relatively close. Since the first pedestrian's direction of travel is through the turnstile, if the first included angle is less than the first included angle threshold, it means that the second pedestrian's direction of travel may be the same as the first pedestrian's. Therefore, based on the above two judgment conditions, it can be determined that the second pedestrian may follow the first pedestrian through the turnstile. Then the server continues to execute S205 to perform the next step of processing to determine whether the second pedestrian intends to follow the first pedestrian through the turnstile.
[0043] If the length of the first vector is greater than or equal to the first length threshold, or the first included angle is greater than or equal to the first included angle threshold, it means that the second pedestrian is not likely to follow the first pedestrian through the gate. The server will not execute subsequent steps, but will process the next frame of the image.
[0044] Based on the above two judgment conditions, it is determined that the distance between the second pedestrian and the first pedestrian is relatively close according to the length of the first vector being less than the first length threshold. Then, based on the first angle between the first vector and the second vector, it is further judged whether the direction of movement of the second pedestrian is likely to be the same as that of the first pedestrian. In this way, it is possible to quickly and accurately identify the people who may follow the first pedestrian through the turnstile.
[0045] For example, see Figure 3 If the direction of entering the turnstile is as follows Figure 3 As shown in the second vector v2, the positions of P1 and P2 are as follows: Figure 3 As shown in the figure, if the first included angle is less than 90 degrees, and if the first included angle is less than the first included angle threshold, then it is determined that the second pedestrian may follow the first pedestrian through the turnstile.
[0046] If the center point of the detection box corresponding to a pedestrian is located at Figure 3 The P0 position in the middle is determined by Figure 3It can be known that the angle between the vector formed by P0 and P1 and the second vector v2 is greater than 90 degrees, and it is determined that the pedestrian currently has no possibility to follow the first pedestrian through the gate.
[0047] In a case where the prediction result is that the second pedestrian has the possibility to follow the first pedestrian through the gate, the server determines a target result of whether the second pedestrian has the intention to follow the first pedestrian through the gate according to the movement trajectory of the second pedestrian.
[0048] After determining that the prediction result is that the second pedestrian has the possibility to follow the first pedestrian through the gate according to the length of the first vector and the first angle, the server further determines a target result of whether the second pedestrian has the intention to follow the first pedestrian through the gate according to the movement trajectory of the second pedestrian. If the movement trajectory of the second pedestrian is in the direction of entering the gate, the target result is that the second pedestrian has the intention to follow the first pedestrian through the gate, and if the movement trajectory of the second pedestrian is not in the direction of entering the gate, the target result is that the second pedestrian has no intention to follow the first pedestrian through the gate.
[0049] In the present application, if the first image is an image captured by the image acquisition device at t1, the image acquisition device can obtain a second image including the second pedestrian captured before t1, and the server determines a third vector based on a third center point of a third detection box corresponding to the second pedestrian in the second image and a second center point of a second detection box corresponding to the second pedestrian in the first image. The direction of the third vector points from the third center point to the second center point. For example, the coordinates of the third center point are P2(x3, y3), and the third vector v3=(x2-x3, y2-y3).
[0050] After obtaining the third vector, the dot product operation is performed on the third vector and the second vector to obtain the result a of the dot product operation, i.e., a=v3·v2. If the result of the dot product operation is greater than or equal to 0, it is determined that the target result is that the second pedestrian has the intention to follow the first pedestrian through the gate; and if the result of the dot product operation is less than 0, it is determined that the target result is that the second pedestrian has no intention to follow the first pedestrian through the gate.
[0051] It should be understood that since the image acquisition device generally captures more than 20 images per second, in order to make the position of the second pedestrian in the first image different from the position of the second pedestrian in the second image, n frames are required between the first image and the second image; wherein n can be an integer greater than or equal to 10 and less than or equal to 50.
[0052] In some embodiments, after determining that the second pedestrian is likely to follow the first pedestrian through the gate according to the first image, the server can obtain m third images; the m third images are included in the video taken before the first image, and the second pedestrian is included in each of the m third images, where m is a positive integer greater than 1; the interval between any two adjacent images in the m third images is n frames. Then the server determines m fourth vectors according to the center points of the detection boxes corresponding to the second pedestrian in the m third images and the second center point of the detection box corresponding to the second pedestrian in the first image; each fourth vector is determined by the center point of the detection box corresponding to the second pedestrian in any one of the m images and the second center point; and the terminal point of each fourth vector is the second center point.
[0053] After obtaining the m fourth vectors, the m fourth vectors are respectively subjected to dot product operation with the second vector to obtain m dot product results; in the case that more than a preset proportion of the m dot product results are greater than or equal to 0, it is determined that the target result is that the second pedestrian has the intention to follow the first pedestrian through the gate; or in the case that less than a preset proportion of the m dot product results are greater than or equal to 0, it is determined that the target result is that the second pedestrian does not have the intention to follow the first pedestrian through the gate.
[0054] In some embodiments, after determining that the second pedestrian is likely to follow the first pedestrian through the gate according to the first image, the server can obtain k third images; the k third images are included in the video taken before the first image, and the second pedestrian is included in each of the k third images, where k is a positive integer greater than 1; the interval between any two adjacent images in the k images is n frames. Then the server determines k-1 fifth vectors according to the center points of the detection boxes corresponding to the second pedestrian in any two adjacent third images in the k third images.
[0055] After obtaining the k fifth vectors, the k fifth vectors are respectively subjected to dot product operation with the second vector to obtain k calculation results; in the case that more than a preset proportion of the k calculation results are greater than or equal to 0, it is determined that the target result is that the second pedestrian has the intention to follow the first pedestrian through the gate; or in the case that less than a preset proportion of the k calculation results are greater than or equal to 0, it is determined that the target result is that the second pedestrian does not have the intention to follow the first pedestrian through the gate.
[0056] In the present application, the server determines whether the second pedestrian has the possibility of following the first pedestrian through the gate by a two-stage determination method. In the first stage, the server performs pedestrian detection on the image captured by the image acquisition device, and if there are no two or more pedestrians in the ROI region, the next frame of image is detected; if the ROI region includes two or more pedestrians, the second stage of determination is entered.
[0057] In the second stage, in the case where there are two or more pedestrians in the ROI region, the first pedestrian about to enter the gate and the second pedestrian closest to the first pedestrian are first determined, the center points of the pedestrian detection boxes corresponding to the first pedestrian and the second pedestrian are determined to obtain a first vector, the length of the first vector can represent the distance between the two pedestrians, if the length of the first vector is less than a length threshold, it indicates that the distance between the second pedestrian and the first pedestrian is close, if the included angle between the first vector and a second vector is less than an included angle threshold, it indicates that the advancing direction of the second pedestrian is likely to be the same as that of the first pedestrian, therefore, if the length of the first vector is less than the length threshold and the first included angle is less than the included angle threshold, the server determines that the second pedestrian has the possibility of following the first pedestrian into the gate. Then the server further determines whether the action trajectory of the second pedestrian is in the direction of entering the gate according to multiple images including the second pedestrian, if yes, the server determines that the second pedestrian has the intention of following the first pedestrian into the gate.
[0058] It should be understood that, although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0059] Based on the same inventive concept, the present application also provides a pedestrian following recognition device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more pedestrian following recognition device embodiments provided below can refer to the limitations of the pedestrian following recognition method in the above text, which will not be described here.
[0060] As shown in FIG. 4, Figure 4 The present application provides a pedestrian following recognition device 400, which includes:
[0061] The vector calculation module 402 is configured to determine a first vector according to the first detection frame and the second detection frame in the first image; the first detection frame is a detection frame corresponding to the first pedestrian, and the second detection frame is a detection frame corresponding to the second pedestrian; the first pedestrian is a pedestrian who is about to pass through the gate;
[0062] The included angle calculation module 404 is configured to determine a first included angle between the first vector and a second vector according to the first vector and the second vector; the direction of the second vector is a direction of entering the gate;
[0063] The result prediction module 406 is configured to determine a prediction result of whether the second pedestrian has a possibility of following the first pedestrian to pass through the gate according to the first vector and the first included angle.
[0064] The result determination module 408 is configured to determine a target result of whether the second pedestrian has an intention of following the first pedestrian to pass through the gate according to the motion trajectory of the second pedestrian in a case where the prediction result is that the second pedestrian has the possibility of following the first pedestrian to pass through the gate.
[0065] In some embodiments, in the aspect of determining the prediction result of whether the second pedestrian has the possibility of following the first pedestrian to pass through the gate according to the first vector and the first included angle, the result prediction module 406 is specifically configured to:
[0066] In a case where the modulus of the first vector is less than a first length threshold and the first included angle is less than a first included angle threshold, it is determined that the prediction result is that the second pedestrian has the possibility of following the first pedestrian to pass through the gate.
[0067] In some embodiments, in the aspect of determining the first vector according to the first detection frame and the second detection frame in the first image, the vector calculation module 402 is specifically configured to:
[0068] perform pedestrian detection on the first image to obtain a plurality of detection frames corresponding to a plurality of pedestrians respectively;
[0069] determine a first pedestrian and a second pedestrian included in a region of interest (ROI) in the first image;
[0070] determine a first center point of the first detection frame corresponding to the first pedestrian and a second center point of the second detection frame corresponding to the second pedestrian;
[0071] determine the first vector according to the first center point and the second center point; the direction of the first vector is from the second center point to the first center point.
[0072] In some embodiments, in the aspect of determining the target result of whether the second pedestrian has the intention of following the first pedestrian to pass through the gate according to the motion trajectory of the second pedestrian, the result determination module 408 is specifically configured to:
[0073] obtain a second image, the second image being an image taken before the first image, the second image including a second pedestrian;
[0074] determine a third vector according to the second center point and a third center point of a third detection box corresponding to the second pedestrian in the second image;
[0075] perform dot product operation on the second vector and the third vector to obtain a calculation result;
[0076] In a case where the calculation result is greater than or equal to 0, determine that the target result is that the second pedestrian has the intention to follow the first pedestrian to pass through the gate; or in a case where the calculation result is less than 0, determine that the target result is that the second pedestrian does not have the intention to follow the first pedestrian to pass through the gate.
[0077] In some embodiments, in terms of determining the target result of whether the second pedestrian has the intention to follow the first pedestrian to pass through the gate according to the motion trajectory of the second pedestrian, the result determination module 408 is specifically configured to:
[0078] obtain m third images; the m third images are images taken before the first image, and the m third images each include the second pedestrian; wherein m is a positive integer greater than 1;
[0079] determine m fourth vectors according to center points of detection boxes corresponding to the second pedestrian in the m third images and the second center point; wherein the center point of the detection box corresponding to the second pedestrian in any one of the third images and the second center point determine a fourth vector;
[0080] perform dot product operation on the m fourth vectors and the second vector respectively to obtain m dot product results;
[0081] In a case where there is a dot product result greater than or equal to 0 in the m dot product results, which is greater than a preset proportion, determine that the target result is that the second pedestrian has the intention to follow the first pedestrian to pass through the gate; or in a case where there is a dot product greater than or equal to 0 in the m dot products, which is less than a preset proportion, determine that the target result is that the second pedestrian does not have the intention to follow the first pedestrian to pass through the gate.
[0082] The various modules in the pedestrian following recognition apparatus described above can be all or partially implemented by software, hardware, and combinations thereof. The various modules described above can be in the form of hardware embedded in or independent of the processor in the computer device, or in the form of software stored in the memory in the computer device, so as to be called and executed by the processor to perform the operations corresponding to the various modules.
[0083] In some embodiments, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface (I / O for short), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is used to store related data of the pedestrian following identification method. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement the steps in the above-mentioned pedestrian following identification method.
[0084] In some embodiments, a computer device, which can be a terminal, is provided, and an internal structure diagram thereof can be as shown in the figure. Figure 6 As shown in the figure. The computer device includes a processor, a memory, an input / output interface (I / O for short), a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be realized through WIFI, mobile cellular network, NFC (near field communication), or other technologies. The computer program is executed by the processor to implement the steps in the above-mentioned pedestrian following identification method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; the input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, trackball, or touchpad arranged on the shell of the computer device, or can be an external keyboard, touchpad, or mouse, etc.
[0085] Those skilled in the art can understand that, Figure 5 or Figure 6The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0086] In some embodiments, a computer device is provided, which includes a memory and a processor. The memory stores a computer program. The processor implements the steps in the above method embodiments when executing the computer program.
[0087] In some embodiments, as Figure 7 shown, an internal structure diagram of a computer readable storage medium is provided. The computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0088] In some embodiments, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant national and regional laws, regulations and standards.
[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0091] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0092] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A pedestrian following recognition method, characterized in that, include: A first vector is determined based on a first detection box and a second detection box in the first image; wherein the first detection box is the detection box corresponding to the first pedestrian, the second detection box is the detection box corresponding to the second pedestrian, and the first pedestrian is the pedestrian who is about to pass through the gate; The first angle between the first vector and the second vector is determined based on the first vector and the second vector; wherein the direction of the second vector is the direction of entering the gate. Based on the first vector and the first included angle, determine the possible prediction result that the second pedestrian may follow the first pedestrian through the gate; If the prediction result indicates that the second pedestrian may follow the first pedestrian through the turnstile, the target result is determined based on the movement trajectory of the second pedestrian to determine whether the second pedestrian intends to follow the first pedestrian through the turnstile.
2. The method according to claim 1, characterized in that, The step of determining whether the second pedestrian has a possible prediction result of following the first pedestrian through the turnstile based on the first vector and the first included angle includes: If the magnitude of the first vector is less than the first length threshold and the first included angle is less than the first included angle threshold, the prediction result is determined to be that the second pedestrian may follow the first pedestrian through the gate.
3. The method according to claim 1 or 2, characterized in that, Determining the first vector based on the first detection box and the second detection box in the first image includes: Pedestrian detection is performed on the first image to obtain detection boxes corresponding to each pedestrian. Determine the first pedestrian and the second pedestrian included in the region of interest (ROI) of the first image; Determine the first center point of the first detection box corresponding to the first pedestrian and the second center point of the second detection box corresponding to the second pedestrian; A first vector is determined based on the first center point and the second center point; wherein the direction of the first vector is from the second center point to the first center point.
4. The method according to claim 3, characterized in that, The objective result of determining whether the second pedestrian intends to follow the first pedestrian through the turnstile based on the second pedestrian's movement trajectory includes: Acquire a second image, which is an image taken before the first image, and the second image includes the second pedestrian; The third vector is determined based on the second center point and the third center point of the third detection box corresponding to the second pedestrian in the second image; The calculation result is obtained by performing a dot product operation on the second vector and the third vector; If the calculation result is greater than or equal to 0, the target result is determined to be that the second pedestrian has the intention to follow the first pedestrian through the turnstile; or, if the calculation result is less than 0, the target result is determined to be that the second pedestrian does not have the intention to follow the first pedestrian through the turnstile.
5. The method according to claim 3, characterized in that, The objective result of determining whether the second pedestrian intends to follow the first pedestrian through the turnstile based on the second pedestrian's movement trajectory includes: Obtain m third images; the m third images are images taken before the first image, and each of the m third images includes the second pedestrian; where m is an integer greater than 1; Based on the center point of the detection box corresponding to the second pedestrian in the m third images and the second center point, m fourth vectors are determined; wherein, the center point of the detection box corresponding to the second pedestrian in any third image and the second center point determine a fourth vector; Perform dot product operations between the m fourth vectors and the second vector respectively to obtain m dot product results; If, among the m dot product results, there is a dot product result greater than or equal to 0 that is greater than a preset proportion, the target result is determined to be that the second pedestrian intends to follow the first pedestrian through the turnstile; or, if, among the m dot product results, there is a dot product result less than a preset proportion that is greater than or equal to 0, the target result is determined to be that the second pedestrian does not intend to follow the first pedestrian through the turnstile.
6. The method according to claim 5, characterized in that, The m third images are images from a video captured by an image acquisition device. The first image is a frame captured at time t1. The m images are multiple images captured at preset frame intervals from a video captured before time t1.
7. A pedestrian following recognition device, characterized in that, include: The vector calculation module is used to determine a first vector based on a first detection box and a second detection box in the first image; wherein the first detection box is the detection box corresponding to a first pedestrian, the second detection box is the detection box corresponding to a second pedestrian, and the first pedestrian is a pedestrian about to pass through the gate; An angle calculation module is used to determine the first angle between the first vector and the second vector; wherein the direction of the second vector is the direction of entering the gate. The result prediction module is used to determine, based on the first vector and the first included angle, whether there is a possible prediction result that the second pedestrian has followed the first pedestrian through the gate; The result determination module is used to determine, based on the movement trajectory of the second pedestrian, whether the second pedestrian intends to follow the first pedestrian through the turnstile when the prediction result indicates that the second pedestrian may follow the first pedestrian through the turnstile.
8. The apparatus according to claim 7, characterized in that, In determining whether the second pedestrian has a possible prediction result of following the first pedestrian through the turnstile based on the first vector and the first included angle, the result prediction module is specifically used for: If the magnitude of the first vector is less than the first length threshold and the first included angle is less than the first included angle threshold, the prediction result is determined to be that the second pedestrian may follow the first pedestrian through the gate.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent monitoring identification method and system of station for preventing fare evasion
CN113159009A
Card rubbing behavior identification method and device, equipment and storage medium
CN117351563A
Robot path following control method and device
CN119356325A
Unlocking method and device of intelligent door lock, computer equipment and storage medium
CN119649500A
Anti-trailing gate system based on image recognition
CN119832665A