Object delivery behavior detection method, device, electronic device and storage medium
By identifying and filtering the key points of the human body in the images in the video file, the hand-raising movement between two people is detected, which solves the problem of missed detection of object-delivering behavior due to the angle of the collection direction or the shape of the railing in the existing technology, and realizes An accurate and cost-effective method for detecting delivery behavior.
Patent Information
- Application Number
- CN202410743022.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-07
AI Technical Summary
When detecting object-delivery behavior in the existing technology, there is a problem of missed detection due to the deflection angle of the acquisition direction of the image acquisition device or the non-linear railing, and traditional methods require changing the location of the device or increasing detection costs.
By identifying the key points of the human body in the images in the video file, we can screen out pairs of people with an odd number of intersections between the line between the two people and the line under the railing, and detect their hand-raising movements to determine the object-delivering behavior to avoid missed detections. , and there is no need to change the location of the image acquisition device or increase costs.
It achieves accurate detection of object delivery behavior, avoids missed detections, does not increase detection costs, and is suitable for various railing shapes and collection directions.
Smart Images

Figure CN118314632B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for detecting object delivery behavior. Background Art
[0002] For some management areas, it is necessary to conduct security checks on people entering the management area to detect whether they are carrying prohibited items into the management area, so as to ensure the safety of people in the management area and the order of the area. Traditional detection methods mainly rely on visual observation and manual inspection by inspectors. There may be situations where inspectors fail to observe people in the management area passing items to people outside the management area, causing safety hazards.
[0003] At present, there is a method of setting up a camera or other image acquisition device above the railing in the management area to collect images at the railing, and dividing the people in the image into two sides of the railing according to the relative position between the center point of the person in the image and the railing, and then matching the people on both sides of the railing to determine whether the arm-raising angle formed by the matched person is within the preset angle range to determine whether the matched person has delivered an object. However, this method requires that the image collected by the image acquisition device be evenly divided by the railing. If there is an angle in the acquisition direction of the image acquisition device, this method may result in the situation where the people on both sides of the railing are divided into the same side of the railing, resulting in missed detection of the delivery behavior.
[0004] Therefore, a method that can accurately detect delivery behavior is needed. Summary of the invention
[0005] The present application provides a method, device, electronic device and storage medium for detecting object delivery behavior, which are used to accurately detect object delivery behavior.
[0006] In order to achieve the above technical objectives, this application adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for detecting object delivery behavior, the method comprising:
[0008] Recognize a frame of target image in the video file to obtain key points of the human body in the target image;
[0009] Based on the key points of the human body in the target image, a pair of people in the target image is screened out, wherein the number of intersections between the connecting line between the target points corresponding to the two people included in the pair of people and the non-vertices along the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line between the key points of the feet of the two feet of the key points of the human body of the person;
[0010] If both persons in the pair of persons raise their hands, the pair of persons is determined to be a target pair of persons;
[0011] Determine whether there is an object delivery behavior based on the target person pair in multiple frames of images continuous with the target image.
[0012] The technical solution provided by the present application brings at least the following beneficial effects: based on the key points of the human body, the number of intersections between the connecting line between the target points corresponding to the two persons and the non-vertices along the lower edge of the railing is determined. If the number of intersections is an odd number, it can be determined that the two persons must be on different sides of the railing, so that the two persons included in the screened person pair must be on different sides of the railing. The subsequent process will detect whether both persons in the person pair have raised their hands, which can more accurately detect the object delivery behavior and effectively avoid the occurrence of missed detection. The object delivery behavior detection method provided by the present application can use existing image acquisition equipment, without changing the installation position of the image acquisition device or adding a new image acquisition device, and will not increase the detection cost of the object delivery behavior.
[0013] In a possible implementation, the method also includes: determining the object handing distance between the hand key point among the human body key points of the first person in the person pair and the hand key point among the human body key points of the second person; if the object handing distance is less than or equal to the first reference distance, the hand-raising angle formed by the human body key points of the first person is within the preset angle range, and the hand-raising angle formed by the human body key points of the second person is within the preset angle range, it is determined that both persons in the person pair have a hand-raising action; wherein the first reference distance is the product of the target pixel distance and the preset coefficient, the target pixel distance is the average pixel distance between the first pixel distance and the second pixel distance, the first pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the first person, and the second pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the second person.
[0014] In one possible implementation, determining the object delivery distance between a hand key point among the body key points of the first person in the personnel pair and a hand key point among the body key points of the second person includes: determining the object delivery distance between a hand key point among the body key points of the first person in the personnel pair that is located in an object delivery area corresponding to a railing and a hand key point among the body key points of the second person that is located in the object delivery area; or determining the object delivery distance between a hand key point among the body key points of the first person in the personnel pair whose distance from an upper line of the railing is less than a second reference distance and a hand key point among the body key points of the second person whose distance from an upper line of the railing is less than the second reference distance.
[0015] In a possible implementation, a frame of target image in a video file is recognized to obtain human key points in the target image, including: recognizing a frame of target image in a video file, and outputting human key points in a human detection frame in the target image whose detection frame confidence is greater than a first preset confidence, one human key point corresponds to one key point confidence, and one human detection frame corresponds to one detection frame confidence; determining a handover distance between a hand key point in the human key points of a first person in a person pair and a hand key point in the human key points of a second person, including: determining a handover distance between a hand key point in the human key points of the first person in the person pair and a key point confidence greater than a second preset confidence, and a hand key point in the human key points of the second person and a key point confidence greater than the second preset confidence.
[0016] In a possible implementation, the multiple frames of images continuous with the target image are multiple frames of images within a first preset time length adjacent to the target image and before the target image; the method further includes: in a congestion detection mode, when there is a target person pair in the target image, recording the target image as a first state; in a non-congestion detection mode, when there is a target person pair in the target image, recording the target person pair as a second state; determining whether there is a delivery behavior according to the target person pairs in the multiple frames of images continuous with the target image, including: when the target image and each frame of images within a first preset time length adjacent to the target image and before the target image correspond to the congestion detection mode, and the target image and each frame of images within a first preset time length adjacent to the target image and before the target image are all in the first state, determining the existence of the delivery behavior; when the target image and each frame of images within a first preset time length adjacent to the target image and before the target image correspond to the non-congestion detection mode, and there is a first target person pair in the target image and each frame of images within the first preset time length adjacent to the target image and before the target image, and the first target person pair are all in the second state, determining the existence of the delivery behavior.
[0017] In a possible implementation, the method further includes: in a case where the target image corresponds to a congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to a first preset number, and there is no target person pair in the target image, switching the congestion detection mode to a non-congestion detection mode; in a case where the target image corresponds to a non-congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the first preset number, and there is no target person pair in the target image, switching the non-congestion detection mode to the congestion detection mode; or , in the case where the target image corresponds to the congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to the second preset number, and there is no target person pair in the target image, switch the congestion detection mode to the non-congestion detection mode; in the case where the target image corresponds to the non-congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the second preset number, and there is no target person pair in the target image, switch the non-congestion detection mode to the congestion detection mode.
[0018] In a possible implementation, the method further includes: in a congestion detection mode, when there is no target person pair in the target image, recording the target image as a third state; in a non-congestion detection mode, when there is no target person pair in the target image, recording the target person pair as a fourth state; in a congestion detection mode, if the first image, the second image, and each frame of image between the first image and the second image are all in the first state, saving multiple frames of first recorded images and coordinate information of each target person pair in each frame of the first recorded image, the multiple frames of first recorded images include the first image, the second image, and all images between the first image and the second image; the previous frame of the first image corresponds to the congestion detection mode and the previous frame of the first image is in the third state, or the previous frame of the first image corresponds to the non-congestion detection mode; the next frame of the second image corresponds to the non-congestion detection mode, or the second image The next frame image corresponds to the congestion detection mode and the next frame image of the second image is in the third state; in the non-congestion detection mode, if there is a second target person pair in the third image, the fourth image, and each frame image between the third image and the fourth image, and the second target person pairs are all in the second state, multiple frames of second recorded images and coordinate information of the second target person pairs in each frame of the second recorded images are saved, and the multiple frames of second recorded images include the third image, the fourth image, and all images between the third image and the fourth image; the previous frame image of the third image corresponds to the non-congestion detection mode and the target person pair in the previous frame image of the third image is in the second state, or the previous frame image of the third image corresponds to the congestion detection mode; the next frame image of the fourth image corresponds to the congestion detection mode, or the next frame image of the fourth image corresponds to the non-congestion detection mode and the second target person pair in the next frame image of the fourth image is in the fourth state.
[0019] In one possible implementation, when it is determined that there is an object delivery behavior, the method also includes: based on the coordinate information of the target person pair in the first recorded image, or based on the coordinate information of the second target person pair in the second recorded image, obtaining one or more of the object delivery direction, item category, and item size; if the preset conditions are met, outputting a first prompt message; the preset conditions are that the object delivery direction is from the first area to the second area, or the item category matches the preset item category, or the item size is greater than the preset size; the first prompt message is used to indicate that a high-risk object delivery behavior has occurred; the first area is a non-management area, and the second area is a management area; if the preset conditions are not met, outputting a second prompt message, and the second prompt message is used to indicate that a low-risk object delivery behavior has occurred.
[0020] In a possible implementation, the method also includes: in the presence of an object delivery behavior, if the duration between the moment corresponding to the target image and the moment when the third prompt message was last issued is greater than a third preset duration, issuing a third prompt message, the third prompt message including the target image, and the third prompt message is used to indicate the presence of an object delivery behavior.
[0021] In a possible implementation, the method further includes: when the object delivery distance is less than or equal to the first reference distance, determining the side of the human body where the key points of the hand constituting the object delivery distance are located as the object delivery side; for the object delivery side of the first person, if the key point of the elbow on the object delivery side is the vertex, the line segment formed by the key point of the elbow on the object delivery side and the key point of the hand on the object delivery side is the edge, and the line segment formed by the key point of the elbow on the object delivery side and the key point of the shoulder on the object delivery side is the edge, the formed hand-raising angle is less than or equal to the first preset angle, or, if the key point of the shoulder on the object delivery side is the vertex, the line segment formed by the key point of the shoulder on the object delivery side and the key point of the elbow on the object delivery side is the edge, and the line segment formed by the key point of the shoulder on the object delivery side and the key point of the hip on the object delivery side is the edge, the formed hand-raising angle is greater than the second preset angle. An angle is set to determine that the hand-raising angle formed by the key points of the first person's body is within the preset angle range; for the delivery side of the second person, if the key point of the elbow on the delivery side is the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side is the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side is the edge, the hand-raising angle formed is less than or equal to the first preset angle, or, if the key point of the shoulder on the delivery side is the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side is the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is the edge, the hand-raising angle formed is greater than the second preset angle, and it is determined that the hand-raising angle formed by the key points of the second person's body is within the preset angle range.
[0022] In the second aspect, the present application provides a device for detecting object delivery behavior, including a processing module; the processing module is used to: identify a frame of target image in a video file to obtain human body key points in the target image; based on the human body key points in the target image, screen out person pairs in the target image, the number of intersections between the connecting line corresponding to the target points of the two persons included in the person pair and the non-vertices along the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line of the foot key points of the two feet in the human body key points of the persons; if both persons in the person pair have a hand-raising action, determine that the person pair is a target person pair; determine whether there is an object delivery behavior based on the target person pair in multiple frames of images continuous with the target image.
[0023] In a possible implementation, the processing module is also used to: determine the object handing distance between the hand key point among the human body key points of the first person in the person pair and the hand key point among the human body key points of the second person; if the object handing distance is less than or equal to the first reference distance, the hand-raising angle formed by the human body key points of the first person is within the preset angle range, and the hand-raising angle formed by the human body key points of the second person is within the preset angle range, it is determined that both persons in the person pair have a hand-raising action; wherein the first reference distance is the product of the target pixel distance and the preset coefficient, the target pixel distance is the average pixel distance between the first pixel distance and the second pixel distance, the first pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the first person, and the second pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the second person.
[0024] In one possible implementation, the processing module is specifically used to: determine the handover distance between a hand key point among the body key points of the first person in the personnel pair, which is located in the handover area corresponding to the railing, and a hand key point among the body key points of the second person, which is located in the handover area; or, determine the handover distance between a hand key point among the body key points of the first person in the personnel pair, whose distance from the upper edge of the railing is less than a second reference distance, and a hand key point among the body key points of the second person, whose distance from the upper edge of the railing is less than the second reference distance.
[0025] In one possible implementation, the processing module is specifically used to identify a frame of target image in a video file, and output the human key points in the human detection frame in the target image whose detection frame confidence is greater than a first preset confidence, one human key point corresponds to one key point confidence, and one human detection frame corresponds to one detection frame confidence; the processing module is specifically used to determine the handover distance between the hand key points among the human key points of the first person in the person pair whose key point confidence is greater than a second preset confidence and the hand key points among the human key points of the second person whose key point confidence is greater than the second preset confidence.
[0026] In a possible implementation, the multiple frames of images continuous with the target image are multiple frames of images adjacent to the target image and within a first preset time length before the target image; the processing module is also used to: in a congestion detection mode, when there is a target person pair in the target image, record the target image as a first state; in a non-congestion detection mode, when there is a target person pair in the target image, record the target person pair as a second state; the processing module is specifically used to: determine the existence of object delivery behavior when the target image and each frame of images adjacent to the target image and within a first preset time length before the target image correspond to the congestion detection mode, and the target image and each frame of images adjacent to the target image and within a first preset time length before the target image are all in the first state; determine the existence of object delivery behavior when the target image and each frame of images adjacent to the target image and within a first preset time length before the target image correspond to the non-congestion detection mode, and there is a first target person pair in the target image and each frame of images adjacent to the target image and before the target image, and the first target person pair are all in the second state.
[0027] In a possible implementation, the processing module is further used for: in a case where the target image corresponds to a congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to a first preset number, and there is no target person pair in the target image, switching the congestion detection mode to a non-congestion detection mode; in a case where the target image corresponds to a non-congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the first preset number, and there is no target person pair in the target image, switching the non-congestion detection mode to the congestion detection mode; or Alternatively, in the case where the target image corresponds to the congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to the second preset number, and there is no target person pair in the target image, the congestion detection mode is switched to the non-congestion detection mode; in the case where the target image corresponds to the non-congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the second preset number, and there is no target person pair in the target image, the non-congestion detection mode is switched to the congestion detection mode.
[0028] In a possible implementation, the processing module is also used for: in a congestion detection mode, when there is no target person pair in the target image, recording the target image as the third state; in a non-congestion detection mode, when there is no target person pair in the target image, recording the target person pair as the fourth state; in a congestion detection mode, if the first image, the second image, and each frame of image between the first image and the second image are all in the first state, saving multiple frames of first recorded images and coordinate information of each target person pair in each frame of the first recorded image, the multiple frames of first recorded images include the first image, the second image, and all images between the first image and the second image; the previous frame of the first image corresponds to the congestion detection mode and the previous frame of the first image is the third state, or the previous frame of the first image corresponds to the non-congestion detection mode; the next frame of the second image corresponds to the non-congestion detection mode, or the second image The next frame image corresponds to the congestion detection mode and the next frame image of the second image is in the third state; in the non-congestion detection mode, if there is a second target person pair in the third image, the fourth image, and each frame image between the third image and the fourth image, and the second target person pairs are all in the second state, multiple frames of second recorded images and coordinate information of the second target person pairs in each frame of the second recorded images are saved, and the multiple frames of second recorded images include the third image, the fourth image, and all images between the third image and the fourth image; the previous frame image of the third image corresponds to the non-congestion detection mode and the target person pair in the previous frame image of the third image is in the second state, or the previous frame image of the third image corresponds to the congestion detection mode; the next frame image of the fourth image corresponds to the congestion detection mode, or the next frame image of the fourth image corresponds to the non-congestion detection mode and the second target person pair in the next frame image of the fourth image is in the fourth state.
[0029] In one possible implementation, when it is determined that there is an object delivery behavior, the processing module is also used to obtain one or more of the object delivery direction, item category, and item size based on the coordinate information of the target person pair in the first recorded image, or based on the coordinate information of the second target person pair in the second recorded image; the object delivery behavior detection device also includes an interaction module, the interaction module is used to: if a preset condition is met, output a first prompt message; the preset condition is that the object delivery direction is from the first area to the second area, or the item category matches the preset item category, or the item size is greater than the preset size; the first prompt message is used to indicate that a high-risk object delivery behavior has occurred; the first area is a non-management area, and the second area is a management area; if the preset condition is not met, output a second prompt message, and the second prompt message is used to indicate that a low-risk object delivery behavior has occurred.
[0030] In one possible implementation, the interaction module is also used to, in the presence of an object delivery behavior, issue a third prompt message if the duration between the moment corresponding to the target image and the moment when the third prompt message was last issued is greater than a third preset duration, and the third prompt message includes the target image, and the third prompt message is used to indicate the presence of an object delivery behavior.
[0031] In a possible implementation, the processing module is further used to: when the object delivery distance is less than or equal to the first reference distance, determine the side of the human body where the hand key points constituting the object delivery distance are located as the object delivery side; for the object delivery side of the first person, if the object delivery side elbow key point is taken as the vertex, the line segment formed by the object delivery side elbow key point and the object delivery side hand key point is taken as the edge, and the line segment formed by the object delivery side elbow key point and the object delivery side shoulder key point is taken as the edge, the formed hand-raising angle is less than or equal to the first preset angle, or, if the object delivery side shoulder key point is taken as the vertex, the line segment formed by the object delivery side shoulder key point and the object delivery side elbow key point is taken as the edge, and the line segment formed by the object delivery side shoulder key point and the object delivery side hip key point is taken as the edge, the formed hand-raising angle is greater than the second preset angle. The preset angle determines that the hand-raising angle formed by the key points of the first person's body is within the preset angle range; for the delivery side of the second person, if the key point of the elbow on the delivery side is the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side is the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side is the edge, the hand-raising angle formed is less than or equal to the first preset angle, or, if the key point of the shoulder on the delivery side is the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side is the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is the edge, the hand-raising angle formed is greater than the second preset angle, determining that the hand-raising angle formed by the key points of the second person's body is within the preset angle range.
[0032] In a third aspect, the present application provides a system for detecting object delivery behavior, including: an image acquisition device, an electronic device and a prompt device; the image acquisition device is used to obtain a video file; the electronic device is used to execute any one of the object delivery behavior detection methods provided in the first aspect above; the prompt device is used to receive and display a first prompt message, a second prompt message and a third prompt message sent by the electronic device, the first prompt message is used to indicate the occurrence of a high-risk object delivery behavior, the second prompt message is used to indicate the occurrence of a low-risk object delivery behavior, and the third prompt message is used to indicate the presence of an object delivery behavior.
[0033] In a fourth aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any one of the object delivery behavior detection methods provided in the first aspect.
[0034] In a fifth aspect, the present application provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement any one of the methods for detecting object delivery behavior provided in the first aspect above.
[0035] In a sixth aspect, the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement any one of the methods for detecting object delivery behavior provided in the first aspect.
[0036] For the specific description of the second to sixth aspects and their various implementations in the present application, reference may be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to sixth aspects and their various implementations, reference may be made to the beneficial effects analysis in the first aspect and its various implementations, which will not be repeated here.
[0037] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a delivery scenario provided in an embodiment of the present application;
[0039] Figure 2 A schematic diagram of another object delivery scenario provided in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of another object delivery scenario provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of another object delivery scenario provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of the structure of a delivery behavior detection system provided in an embodiment of the present application;
[0043] Figure 6 A schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application;
[0044] Figure 7 A flowchart of a method for detecting object delivery behavior provided in an embodiment of the present application;
[0045] Figure 8 A schematic diagram of human body key point recognition provided in an embodiment of the present application;
[0046] Fig. 9 A schematic diagram of a network structure of a human key point detection model provided in an embodiment of the present application;
[0047] Fig.10A schematic diagram of the detection results of a human key point detection model provided in an embodiment of the present application;
[0048] Fig.11 Schematic diagram of an application scenario of a method for detecting object delivery behavior provided in an embodiment of the present application Figure 1 ;
[0049] Fig.12 Schematic diagram of an application scenario of a method for detecting object delivery behavior provided in an embodiment of the present application Figure 2 ;
[0050] Fig.13 Schematic diagram of an application scenario of a method for detecting object delivery behavior provided in an embodiment of the present application Figure 3 ;
[0051] Fig.14 Schematic diagram of an application scenario of a method for detecting object delivery behavior provided in an embodiment of the present application Figure 4 ;
[0052] Fig.15 Schematic diagram of an application scenario of a method for detecting object delivery behavior provided in an embodiment of the present application Figure 5 ;
[0053] Fig.16 Schematic diagram of an application scenario of a method for detecting object delivery behavior provided in an embodiment of the present application Figure 6 ;
[0054] Fig.17 A logic diagram of a method for detecting object delivery behavior provided in an embodiment of the present application;
[0055] Fig.18 A logic diagram of reporting an object delivery behavior event of an object delivery behavior detection method provided in an embodiment of the present application;
[0056] Fig.19 A schematic diagram of the structure of a device for detecting object delivery behavior provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise specified, "multiple" means two or more.
[0059] For some management areas, it is necessary to conduct security checks on people entering the management area to detect whether they are carrying prohibited items into the management area, so as to ensure the safety of people in the management area and the order of the area. Traditional detection methods mainly rely on visual observation and manual inspection by inspectors. There may be situations where inspectors fail to observe people in the management area passing items to people outside the management area, causing safety hazards.
[0060] At present, the related technology CN116665132A provides a method for detecting people who have handed over objects in the image by combining the image collected by the image acquisition device set up above the railing in the management area. The method generally includes the following steps:
[0061] 1. Load the video stream and use the YOLOV5 model to detect the human body in the image of the video stream;
[0062] 2. Determine whether the detected human body detection frame exceeds the upper and lower sides of the railing or whether the center point of the human body detection frame is too far from the railing. If the human body detection frame exceeds the upper and lower sides of the railing and is close to the railing, the human body detection frame is retained. Based on the coordinates of the center point of the human body detection frame and the relative position of the railing, the retained human body detection frame is divided into a detection frame on the left side of the railing and a detection frame on the right side of the railing;
[0063] 3. Match the human body detection frames on the left and right sides. The matching rule is that the two human body detection frames are located on both sides of the railing and are at the same horizontal position. The two successfully matched human body detection frames are merged into one detection frame.
[0064] 4. Use the pre-trained HigherHRNet network with a classification head to detect the key points of the two people in the merged frame and output the classification score r of the handover. If r ≥ 0.9, it is judged that the handover behavior exists; if r ≤ 0.6, it is judged that the handover does not exist. If r is in the interval of (0.6, 0.9), further judge whether the two people meet the following four conditions: ① The wrist distance of the contacting hand is ≤ 1.5 × the maximum distance between the shoulder key point of the contacting hand's corresponding arm and the wrist key point of the contacting hand's corresponding arm ; ② The coordinates of the wrist key point of the contact hand corresponding to the arm are higher than the coordinates of the shoulder key point of the contact hand corresponding to the arm, or the distance between the wrist key point of the contact hand corresponding to the arm and the shoulder key point of the contact hand corresponding to the arm is less than the distance between the elbow key point of the contact hand corresponding to the arm and the shoulder key point of the contact hand corresponding to the arm; ③ The distance between the shoulder key point of the contact hand corresponding to the arm is ≥1.2* ; ④ The angle formed by the shoulder key point, elbow key point and wrist key point of the contacting hand is ≥120°; When the above four conditions are met, it is determined that the two people have passed the object through the fence, otherwise there is no passing of the object through the fence;
[0065] 5. Check the merged detection frame. If there is object passing through the fence in two consecutive frames and the time from the last alarm is greater than 2s, store the current image frame and report it as an [object passing through the fence] alarm.
[0066] The above scheme is based on the relative position of the human body detection frame and the railing to screen and divide it into left and right human body detection frames. The screening process retains a large number of irrelevant human body detection frames, which will increase the amount of calculation for subsequent personnel matching. The left and right sides are divided based on the relative position of the center point of the human body detection frame and the railing. It is only applicable to the scene where the acquisition direction of the image acquisition device is parallel to the railing. If there is an angle between the acquisition direction and the railing, or the railing is not set in a straight line, or the two people who perform the object delivery behavior are not in the same horizontal position, this method may result in the people on both sides of the railing being divided into the same side of the railing, resulting in missed detection of the object delivery behavior, and may also increase the detection cost of the object delivery behavior.
[0067] For example Figure 1 The figure shows a frame of video captured by a camera in a certain scenario. There is a certain deviation angle between the camera shooting direction and the railing direction. Person 1 is located on the left side of the railing, and the center point of the human body detection frame of person 1 is located on the left side of the railing. Person 1 is classified as the left side of the railing. Person 2 is located on the right side of the railing, and the center point of the human body detection frame of person 2 is located on the left side of the railing. Person 2 is also classified as the left side of the railing. Person 1 and person 2 will not be matched together in subsequent matching, resulting in missed detection of the object delivery behavior.
[0068] For example Figure 2The figure shows a frame of video captured by a camera in a certain scenario. The camera shooting direction is parallel to the gate entry and exit direction, that is, the camera shooting direction is perpendicular to the railing direction. The people on both sides of the railing distinguished by the above method are even more inaccurate. If the above method is still needed, an image acquisition device with a collection direction parallel to the railing direction needs to be set up above the railing, or the position of the image acquisition device needs to be changed. Figure 3 In the scenario shown, the railings are distributed in broken line segments. The above method cannot distinguish the people on both sides of the railings. It is necessary to add image acquisition devices to different positions and perform segmented analysis on the railings to detect the behavior of handing over objects through the railings. Figure 2 and Figure 3 Using the above object delivery behavior detection method in the scenario shown will increase the cost of object delivery behavior detection and cannot be widely used in management areas such as subway stations, high-speed railway stations, and airports that require security checks.
[0069] For example Figure 4 In the scenario shown, the two persons who perform the object handing behavior are located on both sides of the railing but are not face to face, that is, the two persons are not at the same horizontal position. When the above method is used to detect the object handing behavior, the two persons will not be matched together, resulting in missed detection of the object handing behavior, which may pose a safety hazard.
[0070] Therefore, a method that can more accurately detect the delivery behavior is needed.
[0071] In this regard, the embodiment of the present application provides a method for detecting object delivery behavior, by identifying the key points of the human body in the image in the video file, and based on the key points of the human body, determining the number of intersections between the connecting line between the target points corresponding to each of the two persons and the non-vertices along the lower edge of the railing. If the number of intersections is an odd number, it can be determined that the two persons must be on different sides of the railing, so that the two persons included in the screened person pair must be on different sides of the railing. The subsequent process will then detect whether both persons in the person pair have raised their hands, which can more accurately detect the object delivery behavior and effectively avoid the occurrence of missed detection. The object delivery behavior detection method provided by the present application can use existing image acquisition equipment, without changing the installation position of the image acquisition device or adding a new image acquisition device, and will not increase the detection cost of the object delivery behavior.
[0072] Please refer to Figure 5 , which shows a schematic diagram of the structure of the object delivery behavior detection system applicable to the object delivery behavior detection method provided in this application. Figure 5 As shown, the object delivery behavior detection system 1 may include: an image acquisition device 10 , an electronic device 20 and a prompt device 30 .
[0073] The electronic device 20 establishes communication connections with the image acquisition device 10 and the prompt device 30 respectively. It should be understood that the connection method can be a wireless connection, such as a Bluetooth connection, a wireless fidelity (Wi-Fi) connection, etc.; or, the connection method can also be a wired connection, such as an optical fiber connection, etc., which is not limited. Exemplarily, the image acquisition device 10, the electronic device 20 or the prompt device 30 can be connected to the Internet through a router, thereby realizing the communication connection between the electronic device 20 and the image acquisition device 10 and the prompt device 30.
[0074] In some embodiments, the image acquisition device 10 is used to output a video file to the electronic device 20. For example, image acquisition devices are set up in the management area, and these image acquisition devices can capture the railings at the border of the management area. When it is necessary to detect whether there is a handover behavior at the railings of the management area, the image acquisition device 10 can send the captured video file to the electronic device 20, and then the electronic device 20 detects the image in the video file to determine whether there is a handover behavior.
[0075] In some embodiments, the electronic device 20 is used to identify images in a video file, obtain recognition results of human body key points in the image, and then screen out pairs of people in the target image based on the human body key points in the target image, wherein the number of intersections between the connecting line corresponding to the target points of the two people included in the pair of people and the non-vertices along the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line of the foot key points of the two feet in the human body key points of the people; if both people in the pair of people have a hand-raising action, the pair of people is determined to be a target pair of people; and based on the target pair of people in multiple frames of images continuous with the target image, it is determined whether there is an object handover behavior.
[0076] In some embodiments, the electronic device 20 may include a processor. The processor is used to identify key points of the human body in the image of the video file, and determine whether there is a handover behavior based on the recognition results of the key points of the human body. Among them, the processor can be a central processing unit (CPU), a graphics processing unit (GPU), a general-purpose processor network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD) or any combination thereof. The processor can also be other devices with processing functions, such as circuits, devices or software modules, and the embodiments of the present application do not impose any restrictions on this.
[0077] Optionally, the electronic device may further include a memory for storing images in a video file from the image acquisition device 10, and then the processor may search the image in the video file from the memory to identify key points of a human body in the image in the video file.
[0078] In some embodiments, the prompt device 30 is used to receive and display the first prompt information, the second prompt information, and the third prompt information sent by the electronic device 20, the first prompt information is used to indicate the occurrence of high-risk object delivery behavior, the second prompt information is used to indicate the occurrence of low-risk object delivery behavior, and the third prompt information is used to indicate the existence of object delivery behavior. Exemplarily, the prompt device 30 can be a voice prompt device used by the detection personnel in the management area, and the prompt device 30 presents the first prompt information to the detection personnel by playing the first prompt information. Alternatively, the prompt device 30 can also be a display device, and the prompt device 30 presents the first prompt information to the user by displaying the first prompt information on the display screen.
[0079] In some embodiments, the image acquisition device 10 and the electronic device 20 may be as follows: Figure 5 As shown, they are two independent devices, or the image acquisition device 10 and the electronic device 20 can be integrated into the same device.
[0080] In some embodiments, the electronic device 20 and the prompting device 30 may be as follows: Figure 5 As shown, they are two independent devices, or the electronic device 20 and the prompting device 30 can be integrated into the same device.
[0081] In some embodiments, the object delivery behavior detection system 1 may include one or more image acquisition devices 10 .
[0082] In some embodiments, the image acquisition device 10 can be any device that can transmit video files to the electronic device 20, such as a video camera, a still camera, a dome camera, etc. The embodiment of the present application does not limit the specific form of the image acquisition device 10.
[0083] In some embodiments, the electronic device 20 may be a single server or a server cluster, or the electronic device 20 may be a terminal device, such as a personal computer (PC), a notebook computer, a mobile device, a tablet computer, a laptop computer, etc. The embodiments of the present application do not limit the specific form of the electronic device 20.
[0084] The hardware structure of the electronic device 20 includes: Figure 6 The computing device shown in FIG. Figure 6 Taking the computing device shown as an example, the hardware structure of the electronic device 20 is introduced.
[0085] like Figure 6 As shown, the computing device may include a processor 201, a memory 202, a communication interface 203, and a bus 204. The processor 201, the memory 202, and the communication interface 203 may be connected via a bus 204.
[0086] The processor 201 is the control center of the computing device, and can be a processor or a general term for multiple processing elements. For example, the processor 201 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0087] As an embodiment, the processor 201 may include one or more CPUs, such as Figure 6 CPU 0 and CPU 1 are shown in .
[0088] The memory 202 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0089] In a possible implementation, the memory 202 may exist independently of the processor 201, and the memory 202 may be connected to the processor 201 via a bus 204 to store instructions or program codes. When the processor 201 calls and executes the instructions or program codes stored in the memory 202, the model deployment method provided in the embodiment of the present application can be implemented.
[0090] In another possible implementation, the memory 202 may also be integrated with the processor 201 .
[0091] The communication interface 203 is used for the computing device to connect to other devices through a communication network, which may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 203 may include a receiving unit for receiving data and a sending unit for sending data.
[0092] The bus 204 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0093] It should be pointed out that Figure 6 The structure shown in the figure does not constitute a limitation on the computing device, except Figure 6 In addition to the components shown, the computing device may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0094] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0095] The object delivery behavior detection method provided in the embodiment of the present application can be executed by the electronic device 20 in the object delivery behavior detection system 1.
[0096] like Figure 7 As shown, the embodiment of the present application provides a method for detecting object delivery behavior, which includes the following steps:
[0097] S101, identifying a frame of a target image in a video file to obtain key points of a human body in the target image.
[0098] The target image is a frame of image of the electronic device currently performing object delivery behavior detection.
[0099] In some embodiments, the video file is a video stream captured in real time by an image acquisition device and transmitted to an electronic device. In this way, the electronic device can detect the object delivery behavior in real time, and after reporting the real-time object delivery behavior, the detection personnel can stop the object delivery behavior in time to ensure the safety of the management area.
[0100] Optionally, the video file may also be a video stream of a previous time period collected by the image acquisition device. In this way, the electronic device detects the object delivery behavior, and the detection personnel can also trace the object delivery event.
[0101] In some embodiments, the electronic device inputs the target image into the target model to obtain the recognition result of the key points of the human body in the target image, and the target model is used to recognize the key points of the human body.
[0102] Preferably, the target model may be a YOLO-Pose human key point recognition model.
[0103] The following is an example of the training process of the YOLO-Pose human key point recognition model:
[0104] Before detecting human key points, you can use the public COCO person keypoints dataset to train the YOLO-Pose human key point recognition model. The COCO person keypoints dataset includes a large number of annotated sample images, such as Figure 8 As shown in Table 1, 17 key points are annotated on the human body in each sample image. For example, the left shoulder of the human body corresponds to key point 5, the left elbow of the human body corresponds to key point 7, the left hand of the human body corresponds to key point 9, the right shoulder of the human body corresponds to key point 6, the right elbow of the human body corresponds to key point 8, and the right hand of the human body corresponds to key point 10.
[0105] Table 1 Human body key point annotation table
[0106]
[0107] Among them, for each human body, 57 elements are predicted, including: the position of each of the 17 key points of the human body and confidence A total of 51 elements, and the coordinates of the center point of the predicted box where the human body is located (the smallest rectangle covering the human body) and ,Width ,high and confidence There are 6 elements in total, so all the elements that need to be predicted can be expressed as a prediction vector, that is:
[0108] ;
[0109] in, In training, it represents the horizontal coordinate of the nth key point. In training, it represents the ordinate of the nth key point. Indicates the visible flag of the nth keypoint during training. If , indicating that this key point is not marked. In this case , , which means that the key point is marked but not visible (occluded). , which means that this key point is marked and visible at the same time. In the reasoning stage, the confidence is retained Key points greater than 0, that is, the marked key points are retained, and the unmarked key points are discarded. Since 17 key points are output for each human key point detection during the model training process, it is necessary to filter out the key points outside the field of view, otherwise there will be suspended key points, causing the human skeleton to deform. The COCO person keypoints human key point dataset is divided into a training dataset and a test dataset in a ratio of 9:1. Finally, before model training, the COCO person keypoints human key point dataset is enhanced according to resolution and light factors, and the image contrast is enhanced using histogram equalization. The image resolution is appropriately adjusted according to the resolution requirements during actual detection.
[0110] In practical applications, you can use Fig. 9The network structure of the YOLO-Pose human key point detection model shown in the figure uses the CSP-darknet53 backbone feature extraction network as the backbone. The CSP-darknet53 backbone feature extraction network can extract rich information features from the input image. The CSP-darknet53 backbone feature extraction network solves the gradient information duplication problem of network optimization in other large convolutional neural network frameworks, and integrates the gradient changes from beginning to end into the feature map. Therefore, the number of parameters and floating-point operations per second (FLOPS) of the YOLO-Pose human key point detection model is reduced, which not only ensures the inference speed and accuracy, but also reduces the model size. The Neck network part of the YOLO-Pose human key point detection model adopts the PANet structure. The Neck network is mainly used to generate feature pyramids. The feature pyramid will enhance the model's detection of objects of different scales, so that the model can recognize the same object of different sizes and scales. The PANet structure adds a bottom-up enhancement based on the FPN algorithm, so that the top feature map can also enjoy the rich location information brought by the bottom layer, thereby improving the detection effect of large objects. The PANet structure is used to fuse features of various scales from the trunk, followed by the Head structure for final detection, outputting four detection heads of different scales, as well as the predicted boxes and key points in each detection head.
[0111] The YOLO-Pose human key point detection model uses complete-intersection over union (CIOU) as the regression positioning loss function of the prediction box (bounding box, bbox), where the intersection over union (IOU) means that for any prediction box A and B, their intersection and union are calculated respectively, and the ratio of the two is calculated. The expression of IOU is The regression positioning loss of the YOLO-Pose human key point detection model takes into account three geometric parameters: overlapping area, center point distance, and aspect ratio. CIOU adds a penalty term (loss) for the scale of the predicted box on the basis of distance-intersection over union (DIOU), so that the predicted box will be more consistent with the real box. The expression of CIOU is as follows:
[0112] ;
[0113] in is the weight function, ,and It is used to measure the similarity of aspect ratio and is defined as , then the complete prediction box regression positioning loss function is defined as: .
[0114] Target keypoint similarity (OKS) is a commonly used metric for evaluating keypoints. By defining the regressed keypoints directly as fixed centers, the concept of IOU loss can be extended from bbox to keypoints. In the presence of keypoints, OKS is treated as IOU, so the OKS loss is essentially scale-invariant and tilted for specific keypoints. In other words, keypoints on a person's head, such as ears, nose, and eyes, will receive more error penalties at the pixel level than keypoints on the body, such as shoulders, knees, and hips. Unlike the standard IOU loss, the gradient of IOU loss disappears when there is no overlap, while the OKS loss does not experience gradient vanishing. Therefore, the OKS loss is more similar to the DIOU loss.
[0115] Corresponding to each bbox, the entire posture information is stored. Therefore, OKS is calculated for each key point separately, and then added together to obtain the final OKS loss or key point IOU loss:
[0116] ;
[0117] in, is the Euclidean distance between the predicted nth key point and its true value, is the penalty weight factor of the key point itself, s is the scale of the target, It is a visible mark for each key point, which is mentioned in the above content. .
[0118] Corresponding to each key point, a confidence parameter is learned, which shows whether there is a key point in the human body. The loss function is:
[0119] ;
[0120] in, is the confidence of the predicted nth key point.
[0121] Finally, the overall loss of the human key point prediction model is expressed as:
[0122] ;
[0123] in, It is a hyperparameter in the model and is used to balance the losses between different scales.
[0124] In summary, the training process of the YOLO-Pose human key point detection model can be summarized as follows: Initialize the weights and parameters of the improved YOLO-Pose human key point detection model, including the convolutional layer parameter value, learning rate, number of iterations (epoch), and the number of data samples captured in one training (batch_size). Divide the COCO personkeypoints human key point data set into a training set and a test set and place them in an agreed directory, and run the program for training. Before training, the program will select 1 / 10 of the data from the training set as the validation set. Each iteration will be verified by the validation set, and difficult samples with poor performance will be recorded. After reaching the number of iterations, output the various indicators of the YOLO-Pose human key point detection model, including mean average precision (mAP), single category average precision (AP), precision and recall. When the number of iterations is reached, the training ends, and the parameters and weights of the YOLO-Pose human key point detection model are saved.
[0125] The YOLO-Pose human key point detection model is a universal human key point model trained end-to-end. This model uses a variety of existing open source data sets for training. It has strong generalization capabilities in different scenarios, excellent performance and low implementation costs. Compared with the HigherHRNet network with added classification heads in related technologies, it does not require a large amount of simulation or sample data to support training. It detects human key points faster and has better performance. Using the YOLO-Pose human key point detection model to identify human key points in a frame of an image can be as follows: Fig.10 As shown in the figure, when a frame of image is input into the YOLO-Pose human key point detection model, the output image will be marked with the recognized human detection frame and the human key points in the human detection frame, without the need to use two models to separately identify the human detection frame and the human key points.
[0126] In addition to the YOLO-Pose human key point detection model, the present application may also use other human key point detection models for human key point recognition, and use other human detection frame models for human detection frame recognition, and the present application does not impose any specific restrictions on this.
[0127] In some embodiments, when the electronic device obtains the human key points in the target image, it will screen the human key points. Specifically, it can be implemented as follows: a frame of target image in a video file is identified, and the human key points in the human detection frame in the target image whose detection frame confidence is greater than a first preset confidence are output. One human key point corresponds to one key point confidence, and one human detection frame corresponds to one detection frame confidence.
[0128] For example, if the detection personnel sets the first preset confidence level to 0.5, when the electronic device outputs a human detection frame, it will only output a human detection frame with a detection frame confidence level greater than 0.5, such as Fig.11 As shown, Fig.11 The confidence of the human detection frame in the image is greater than 0.5. The confidence of the person x who is far away from the image acquisition device in the image is 0.4 in the process of human key point recognition, which is less than 0.5. In the final output of the human key point detection image ( Fig.11 ) does not include the human detection frame and human key points of person x.
[0129] In this way, by setting the first preset confidence, when the detection frame confidence is less than or equal to the first preset confidence, it can be determined that the human body detection frame has a low confidence level as a real human body, or the recognition result is unreliable, and the human body detection frame with low detection frame confidence is deleted, which can effectively reduce the amount of calculation during subsequent personnel pairing and save the detection time of the handover behavior.
[0130] In some embodiments, the electronic device may perform human key point recognition on each frame of the video file, or may perform human key point recognition once every preset number of frames. For example, assuming that the preset number of frames is 4, the electronic device performs human key point recognition on the first received frame, does not perform human key point recognition on the second, third, fourth, and fifth received frames, and performs human key point recognition on the fifth received frame.
[0131] In this way, the number of image frames used by electronic devices to identify key points of the human body can be effectively reduced, the speed of detecting delivery behavior can be accelerated, and the detection time of delivery behavior can be saved.
[0132] S102: based on the key points of the human body in the target image, filter out the person pairs in the target image.
[0133] Among them, the number of intersections between the connecting line between the target points corresponding to the two persons in the personnel pair and the non-vertices along the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line between the foot key points of the two feet of the person's body key points.
[0134] It should be understood that the foot key points are key points that characterize the position of a person's feet, and the foot key points may be a collection of multiple key points. For example, the foot key points include ankle key points, sole key points, toe key points, and the like.
[0135] When determining the target point corresponding to a person, it can be the midpoint of the line connecting any key point among the key points of the footsteps corresponding to one foot of the person and any key point among the key points of the footsteps corresponding to the other foot of the person. For example, the foot key points are a set of 3 key points. The key points of the left foot of a person include key points A1, B1 and C1, and the key points of the right foot include key points A2, B2 and C2. Then the lines connecting the key points of the footsteps of the two feet of the person have the following combinations: A1-A2, A1-B2, A1-C2, B1-A2, B1-B2, B1-C2, C1-A2, C1-B2, C1-C2.
[0136] Alternatively, when a target point corresponds to a person, it can be the midpoint of the line connecting the target key point in the footstep key points corresponding to one foot of the person and the target key point in the footstep key points corresponding to the other foot of the person. For example, the foot key points are a collection of ankle key points, sole key points, and toe key points. The detection personnel pre-set the target key point to be the ankle key point, then the line connecting the footstep key points of the two feet of the person is the line connecting the ankle key point on the left side of the person and the ankle key point on the right side of the person.
[0137] For example, Fig.12 As shown, Person 1 and Person 2 are Fig.12 For two persons in the figure, if the line connecting the target point corresponding to person 1 and the target point corresponding to person 2 has an intersection with a non-vertex point along the lower edge of the railing, it can be determined that person 1 and person 2 form a person pair.
[0138] Another example, such as Fig.13 As shown, personnel 3 and personnel 4 are Fig.13 There are two persons in the figure. If the line between the target point corresponding to person 3 and the target point corresponding to person 4 has three intersections with the non-vertex points along the lower edge of the railing, it can be determined that person 3 and person 4 form a person pair.
[0139] In some embodiments, before performing the object delivery behavior detection, the electronic device receives the marking operation of the detection personnel on the lower edge of the railing in the image of the video file, and then determines the position of the lower edge of the railing in each frame of the video file.
[0140] In some embodiments, the electronic device also receives the marking operation of the inspection personnel on the object delivery area in a frame image of the video file, and determines the position of the object delivery area in each frame image in the video file; and / or, the electronic device receives the marking operation of the inspection personnel on the upper edge line of the railing in a frame image of the video file, and then determines the position of the upper edge line of the railing in each frame image in the video file; and / or, the electronic device receives the marking operation of the inspection personnel on the lower edge line of the railing in a frame image of the video file, and then determines the position of the lower edge line of the railing in each frame image in the video file.
[0141] For example, for a frame of image captured by a camera installed at a point, such as Fig.14 As shown, the inspector marks the object delivery area, the upper edge of the railing and the lower edge of the railing. Since the installation position of the camera will not change, the electronic device can directly overlay the marked object delivery area, the upper edge of the railing and the lower edge of the railing on each frame of image after the frame of image, and obtain the position of the object delivery area, the upper edge of the railing and the lower edge of the railing on each frame of image.
[0142] In this way, the inspectors mark the object delivery area, the upper edge of the railing and the lower edge of the railing by themselves, and the electronic equipment can perform object delivery behavior detection based on the content marked by the inspectors to meet the inspection requirements of the inspectors.
[0143] Optionally, the inspector may also mark the object delivery area, the upper edge of the railing, or the lower edge of the railing in the image once every preset number of frames of images.
[0144] S103: If both persons in the person pair raise their hands, the person pair is determined to be a target person pair.
[0145] In some embodiments, the electronic device determines whether the persons in the personnel pair have a hand-raising action, which can be specifically implemented as follows: the electronic device determines the object-handing distance between the hand key point among the human body key points of the first person in the personnel pair and the hand key point among the human body key points of the second person; if the object-handing distance is less than or equal to the first reference distance, the hand-raising angle formed by the human body key points of the first person is within a preset angle range, and the hand-raising angle formed by the human body key points of the second person is within the preset angle range, it is determined that both persons in the personnel pair have a hand-raising action; wherein the first reference distance is the product of the target pixel distance and the preset coefficient, the target pixel distance is the average pixel distance between the first pixel distance and the second pixel distance, the first pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the first person, and the second pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the second person.
[0146] It should be understood that the hand key points are key points that characterize the position of a person's hand, and the hand key points can be a collection of multiple key points. For example, the hand key points include wrist key points, palm key points, finger key points, etc.
[0147] The object handing distance may be the distance between any one of the first person's hand key points and any one of the second person's hand key points, or the distance between a target key point in the first person's hand key points and a target key point in the second person's hand key points. For example, the hand key points are a set of three key points, the first person's left hand key points include key point A1, key point A2, and key point A3, the right hand key points include key point B1, key point B2, and key point B3, the second person's left hand key points include key point C1, key point C2, and key point C3, the right hand key points include key point D1, key point D2, and key point D3, then the electronic device determines the object handing distance between the first person's hand key points and the second person's hand key points in the following situations: A1-C1, A1-C2, A1-C 3. A2-C1, A2-C2, A2-C3, A3-C1, A3-C2, A3-C3, A1-D1, A1-D2, A1-D3, A2-D1, A2-D2, A2-D3, A3-D1, A3-D2, A3-D3, B1-C1, B1 -C2, B1-C3, B2-C1, B2-C2, B2-C3, B3-C1, B3-C2, B3-C3, B1-D1, B1-D2, B1-D3, B2-D1, B2-D2, B2-D3, B3-D1, B3-D2, B3-D3. For another example, the hand key point is a collection of the wrist key point, the palm key point and the finger key point, and the target key point is the wrist key point. The electronic device determines that the object delivery distance between the hand key point of the first person and the hand key point of the second person is the distance between the wrist key point of the first person and the wrist key point of the second person.
[0148] In specific implementation, the preset coefficient can be set to 0.5. The specific value of the preset coefficient can be adaptively set by the tester according to the actual test requirements, and this application does not make any specific restrictions.
[0149] It should be understood that when calculating the pixel distance between the shoulder key point and the hip key point, what is calculated is the pixel distance between the shoulder key point and the hip key point on the same side of the same person.
[0150] In one example, the pixel distance between the shoulder key point and the hip key point on one side of the selected person is used as the pixel distance between the shoulder key point and the hip key point of the person. For example, the detection person pre-sets the pixel distance between the left shoulder key point and the hip key point of the person, and the electronic device determines that the pixel distance between the left shoulder key point and the left hip key point of the first person is , the pixel distance between the left shoulder key point and the left hip key point of the second person is , then the first reference distance is , the second pixel distance is , the target pixel distance is , since the preset coefficient is 0.5, the first reference distance is .
[0151] As another example, the pixel distance between the shoulder key point and the hip key point of a person may be the average of the pixel distances between the shoulder key points and the hip key points on both sides of the person. For example, the pixel distance between the left shoulder key point and the left hip key point of the first person is , the pixel distance between the key point of the right shoulder and the key point of the right hip of the first person is , then the first pixel distance is The pixel distance between the left shoulder key point and the left hip key point of the second person is , the pixel distance between the second person’s right shoulder key point and right hip key point is , then the second pixel is eliminated The target pixel distance is , since the preset coefficient is 0.5, the first reference distance is .
[0152] In the related art, the maximum distance between the shoulder key point and the wrist key point is used as the reference distance. When a person is moving, the arm is often bent, and the maximum distance between the shoulder key point and the wrist key point is difficult to measure accurately, which will lead to inaccurate detection results of subsequent object delivery behavior. In this application, the distance between the shoulder key point and the hip key point is used as the reference distance. Since the shoulder and hip of the human body are not easy to bend, the pixel distance between the shoulder key point and the hip key point is relatively easy to calculate for everyone, and the calculation result is relatively accurate. Therefore, the pixel distance between the key point of the person and the hip key point is used as the target pixel distance, and the first reference distance is determined in combination with the preset coefficient. When the object delivery distance between the hand key points of the two persons in the person pair is less than the first reference distance, it means that the distance between the hands of the two persons is close. If the two persons raise their hands at the same time, the two persons may pass objects, and the detection result of the object delivery behavior is more accurate.
[0153] In some embodiments, the electronic device determines the object delivery distance between a hand key point among the body key points of the first person in the personnel pair and a hand key point among the body key points of the second person. This can be specifically implemented as follows: the electronic device determines the object delivery distance between a hand key point among the body key points of the first person in the personnel pair that is located in the object delivery area corresponding to the railing and a hand key point among the body key points of the second person that is located in the object delivery area; or, the electronic device determines the object delivery distance between a hand key point among the body key points of the first person in the personnel pair whose distance from the upper edge of the railing is less than a second reference distance and a hand key point among the body key points of the second person whose distance from the upper edge of the railing is less than the second reference distance.
[0154] Among them, the method for determining the second reference distance is similar to the method for determining the first reference distance. For example, the detection personnel sets a preset coefficient corresponding to the second reference distance to 0.3, then the second reference distance can be the product of 0.3 and the target pixel distance, which will not be repeated here.
[0155] For example, based on the above example, the left hand key point of the first person is outside the object delivery area, and the left hand key point of the second person is outside the object delivery area. Then the electronic device determines the object delivery distance between the hand key point of the first person and the hand key point of the second person in the following situations: B1-D1, B1-D2, B1-D3, B2-D1, B2-D2, B2-D3, B3-D1, B3-D2, B3-D3.
[0156] Another example, based on the above example, the distance between the left hand key point and the right hand key point B1 of the first person and the upper edge of the railing are both greater than the second reference distance, and the distance between the left hand key point and the right hand key point D1 and D2 of the second person and the upper edge of the railing are both greater than the second reference distance. Then the electronic device determines the handover distance between the first person's hand key point and the second person's hand key point in the following situations: B2-D3, B3-D3.
[0157] In this way, by screening the key points of the hand through the handover area or the distance from the upper edge of the railing, the calculation amount of the electronic device can be effectively reduced, saving the detection time of the handover behavior.
[0158] In some embodiments, the electronic device determines the object delivery distance between the hand key points among the body key points of the first person in the person pair and the hand key points among the body key points of the second person. This can be specifically implemented as follows: the electronic device determines the object delivery distance between the hand key points among the body key points of the first person in the person pair whose key point confidence is greater than the second preset confidence and the hand key points among the body key points of the second person whose key point confidence is greater than the second preset confidence.
[0159] Exemplarily, based on the above example, if the confidences of the key points A1, A2, and B3 of the first person's hand are all less than the second preset confidence, and the confidences of the key points C2, C3, D1, and D2 of the second person's hand are all less than the second preset confidence, then the electronic device determines the handover distance between the first person's hand key points and the second person's hand key points in the following situations: A3-C1, A3-D3, B1-C1, B2-C1, B1-D3, and B2-D3.
[0160] In this way, by screening the key points of the hand based on the key point confidence, the hand key points with low credibility can be effectively screened out, the calculation amount of the electronic device can be reduced, and the detection time of the handover behavior can be saved.
[0161] In some embodiments, when the object delivery distance is less than or equal to the first reference distance, the electronic device determines that the side of the human body where the key points of the hand constituting the object delivery distance are located is the object delivery side; for the object delivery side of the first person, if the key point of the elbow on the object delivery side is the vertex, the line segment formed by the key point of the elbow on the object delivery side and the key point of the hand on the object delivery side is the edge, and the line segment formed by the key point of the elbow on the object delivery side and the key point of the shoulder on the object delivery side is the edge, and the formed hand-raising angle is less than or equal to the first preset angle, or if the key point of the shoulder on the object delivery side is the vertex, the line segment formed by the key point of the shoulder on the object delivery side and the key point of the elbow on the object delivery side is the edge, and the line segment formed by the key point of the shoulder on the object delivery side and the key point of the hip on the object delivery side is the edge, and the formed hand-raising angle is greater than the second preset angle, the electronic device The electronic device determines that the hand-raising angle formed by the key points of the human body of the first person is within the preset angle range; for the delivery side of the second person, if the key point of the elbow on the delivery side is the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side is the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side is the edge, the hand-raising angle formed is less than or equal to the first preset angle, or if the key point of the shoulder on the delivery side is the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side is the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is the edge, the hand-raising angle formed is greater than the second preset angle, and the electronic device determines that the hand-raising angle formed by the key points of the human body of the second person is within the preset angle range.
[0162] In specific implementation, the first preset angle may be set to 120° and the second preset angle may be set to 45°.
[0163] For example, Fig.12For example, the object delivery side of person 1 is the left side of person 1, and the object delivery side of person 2 is the right side of person 2. If the electronic device calculates that the line segment formed by the left elbow key point of person 1 is the vertex, the line segment formed by the left elbow key point and the left hand key point is the edge, and the line segment formed by the left elbow key point and the left shoulder key point is the edge, and the formed hand-raising angle is 100°, which is less than 120°, then the electronic device determines that person 1 has a hand-raising action. If the electronic device calculates that the line segment formed by the right shoulder key point of person 2 is the vertex, the line segment formed by the right shoulder key point and the right elbow key point is the edge, and the line segment formed by the right shoulder key point and the right hip key point is the edge, and the formed hand-raising angle is 60°, which is greater than 45°, then the electronic device determines that person 2 has a hand-raising action, and then the electronic device can determine the person pair consisting of person 1 and person 2 as the target person pair.
[0164] Compared with the related art, whether a person has raised his hand is judged only based on whether the hand-raising angle formed by the key point of the elbow on the delivery side as the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side as the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side as the edge, is less than or equal to the first preset angle. In the present application, whether a person has raised his hand can also be judged based on whether the hand-raising angle formed by the key point of the shoulder on the delivery side as the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side as the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is greater than the second preset angle. There are more ways to judge the hand-raising posture of a person, which can avoid missing the hand-raising posture of a person.
[0165] S104: Determine whether there is an object delivery behavior based on the target person pair in multiple frames of images continuous with the target image.
[0166] In some embodiments, when the target image and the multiple frames of images continuous with the target image meet the first preset condition or the second preset condition, it is determined that there is a handover behavior. The first preset condition includes: the target image and the multiple frames of images continuous with the target image are in the congestion detection mode, and the target image and the multiple frames of images continuous with the target image have a target person pair; the second preset condition includes: the target image and the multiple frames of images continuous with the target image are in the non-congestion detection mode, and the target image and the multiple frames of images continuous with the target image have the same target person pair.
[0167] In some embodiments, in the congestion detection mode, when the electronic device has a target person pair in the target image, the target image is recorded as a first state; in the non-congestion detection mode, when the electronic device has a target person pair in the target image, the target person pair is recorded as a second state. In the congestion detection mode, when the electronic device does not have a target person pair in the target image, the target image is recorded as a third state; in the non-congestion detection mode, when the electronic device does not have a target person pair in the target image, the target person pair is recorded as a fourth state. The first state is used to characterize the presence of an object delivery behavior in the target image, the second state is used to characterize the occurrence of an object delivery behavior between the two persons included in the target person pair, the third state is used to characterize the absence of an object delivery behavior in the target image, and the fourth state is used to characterize the absence of an object delivery behavior between the two persons included in the target person pair.
[0168] In particular, in the non-congestion detection mode, the electronic device will continue to detect each target person pair in the target image, and can specifically continuously detect the target person pairs through a multi-target continuous detection (DeepSORT) algorithm.
[0169] Specifically, the electronic device updates different states by recording an array.
[0170] In the congestion detection mode, the state recorded in the array is the state of each frame of the image, which can be implemented as follows:
[0171] When the target person pair is detected in the image, the array is updated to A2==A1[1:]+[Y], where A2 is the updated array and A1 is the array before the update. "A2==A1[1:]+[Y]" means deleting the earliest state in A1 and adding the latest Y (Y at this time represents the first state) to obtain A2. If the target person pair is not detected in the image, the image state is updated to A2=A1[1:]+[N], that is, deleting the earliest state in the array before the update and adding the latest N (N at this time represents the third state) to obtain the updated array. In this way, by checking the array, it is possible to know whether there is a target person pair in the most recent frames of the image, and then determine whether there is a handover behavior.
[0172] In the non-congestion detection mode, each target person pair corresponds to an array. The state recorded in the array is the state of the target person pair corresponding to this array in each frame of the image. Specifically, it can be implemented as follows:
[0173] When the target person pair including person A and person B is detected from the image for the first time, the array corresponding to the target person pair is updated to = [1:]+[Y], is the array corresponding to the updated target personnel pair, is the array corresponding to the target person pair before updating, = [1:]+[Y]" means Delete the earliest state in , add the latest Y (in this case Y represents the second state), and get ; If the target person pair including person A and person B does not exist in the image, update the array corresponding to this target person pair to = [1:]+[N], that is, deleting the earliest state in the array corresponding to the target person pair, adding the latest N (N represents the fourth state at this time), and obtaining the updated array corresponding to the target person pair. In this way, by checking the array corresponding to the target person pair, the states of the two persons in the target person pair in the most recent frames of images can be known, and then determining whether there is a handover behavior.
[0174] Specifically, the inspector sets the array length to 5, which means that the array contains the status of the latest 5 frames of images.
[0175] For example, in the congestion detection mode, if the array record is {N; N; Y; Y; N}, it can be known that the target person pair does not exist in the latest detected frame image; in the non-congestion detection mode, if the array record corresponding to the target person pair AB is {Y; Y; Y; N; N}, it can be known that the target person pair AB does not exist in the latest two detected frames of images, and the target person pair AB exists in the first three frames of images.
[0176] In this way, when there are too many people in the management area, if the target person pairs are continuously detected, it may cause the wrong target person pairs to be identified, and the detection success rate of the object delivery behavior will be reduced. By dividing the mode into congestion detection mode and non-congestion detection mode, in the congestion detection mode, only attention is paid to whether there are target person pairs in the image, and in the non-congestion detection mode, attention is paid to the status of each target person pair in each frame of the image. This can effectively improve the recall rate of detecting the object delivery behavior in scenarios with a large number of people and congested management areas, avoid the failure of continuous detection of target person pairs during congestion, and improve the detection success rate of the object delivery behavior.
[0177] In some embodiments, if the X states of the latest record in the array corresponding to a target person pair are all N, it is considered that the target person pair has finished handing over the object, and the array corresponding to the target person pair will no longer be updated in the subsequent image detection process, and X is a positive integer. For example, assuming that the array length is 5 and X is 5, if the array corresponding to the target person pair AB is updated from {Y; N; N; N; N} to {N; N; N; N; N}, then in the subsequent process, the array corresponding to the target person pair AB will no longer be updated.
[0178] In this way, by setting the array corresponding to the target person pair to no longer update when the latest X states recorded in the array corresponding to the target person pair are all N, it is possible to avoid endlessly updating the states of the target person pair and record effective images of the target person pair's object-handling behavior.
[0179] In some embodiments, the multiple frames of images continuous with the target image are the multiple frames of images adjacent to the target image and within a first preset time length before the target image; the electronic device determines whether there is an object delivery behavior based on the target person pairs in the multiple frames of images continuous with the target image, which can be specifically implemented as follows: when the target image and each frame of images within the first preset time length adjacent to the target image and before the target image correspond to the congestion detection mode, and the target image and each frame of images within the first preset time length adjacent to the target image and before the target image are all in the first state, the electronic device determines that there is an object delivery behavior; when the target image and each frame of images within the first preset time length adjacent to the target image and before the target image correspond to the non-congestion detection mode, and there is a first target person pair in the target image and each frame of images within the first preset time length adjacent to the target image and before the target image, and the first target person pairs are all in the second state, the electronic device determines that there is an object delivery behavior.
[0180] Exemplarily, the first preset time length is the time length required to detect 4 frames of images, then the electronic device may only record the latest 5 frames of images, that is, the array length is 5. If in congestion detection mode, all the numbers in the array are Y, that is, the first preset condition is met, or in non-congestion detection mode, all the numbers in the array corresponding to AB of the target person are Y, that is, the second preset condition is met, then it can be determined that a handover has occurred.
[0181] In this way, the existence of the target person pair in a single-frame image may be a coincidence. The present application limits the array length by setting a first preset time length, and then the electronic device can determine whether the object delivery behavior occurs based on the image state or the state of the target person pair represented by the array, based on the duration of the first state of the image or the second state of the target person pair, and the detection result is more accurate.
[0182] In some embodiments, when the target image corresponds to a congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to the first preset number, and there is no target person pair in the target image, the electronic device switches the congestion detection mode to the non-congestion detection mode; when the target image corresponds to a non-congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the first preset number, and there is no target person pair in the target image, the electronic device switches the non-congestion detection mode to the congestion detection mode.
[0183] Specifically, the second preset duration can be set to 5 seconds, and the first preset number can be set to 15.
[0184] Exemplarily, if the congestion detection mode is currently being executed, the number of human detection frames in the target image currently being detected is 10, and the number of human detection frames in each image detected by the electronic device within 5 seconds before the target image is less than 15, and no target person pair is detected in the target image, the electronic device switches the congestion detection mode to the non-congestion detection mode, and the next frame of the target image corresponds to the non-congestion detection mode. If the non-congestion detection mode is currently being executed, the number of human detection frames in the target image currently being detected is 16, and the number of human detection frames in each image detected by the electronic device within 5 seconds before the target image is greater than 15, and no target person pair is detected in the target image, the electronic device switches the non-congestion detection mode to the congestion detection mode, and the next frame of the target image corresponds to the congestion detection mode.
[0185] In this way, by switching between the congestion detection mode and the non-congestion detection mode, it can better adapt to the scenarios with more or fewer people in the management area, and the mode will only be switched when the target person is not detected in the target image, which can avoid the situation where the target person is missed during the switching process.
[0186] In some embodiments, when the object delivery behavior detection is just started, a congestion detection mode may be executed to avoid missing the target person pair when executing a non-congestion detection mode under a congested state.
[0187] In other embodiments, when the target image corresponds to a congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to the second preset number, and there is no target person pair in the target image, the electronic device switches the congestion detection mode to the non-congestion detection mode; when the target image corresponds to a non-congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the second preset number, and there is no target person pair in the target image, the electronic device switches the non-congestion detection mode to the congestion detection mode.
[0188] When the human body detection frame detected by the electronic device has an overlapping portion with the object delivery area, the person corresponding to the human body detection frame overlaps with the object delivery area.
[0189] Specifically, the second preset time length can be set to 5 seconds, and the second preset number can be set to 10.
[0190] Exemplarily, if the congestion detection mode is currently executed, the number of human detection frames that overlap with the delivery area in the target image currently detected is 10, and the number of human detection frames that overlap with the delivery area in each image detected by the electronic device within 5 seconds before the target image is less than 10, and the target person pair is not detected in the target image, the electronic device switches the congestion detection mode to the non-congestion detection mode, and the next frame of the target image corresponds to the non-congestion detection mode. If the non-congestion detection mode is currently executed, the number of human detection frames that overlap with the delivery area in the target image currently detected is 12, and the number of human detection frames that overlap with the delivery area in each image detected by the electronic device within 5 seconds before the target image is greater than 10, and the target person pair is not detected in the target image, the electronic device switches the non-congestion detection mode to the congestion detection mode, and the next frame of the target image corresponds to the congestion detection mode.
[0191] Only when there is an overlapping part between the human body detection frame and the object delivery area, the person has the possibility of delivering objects. Therefore, by setting a second preset number to determine whether there is congestion in the object delivery area, the switching between the congestion detection mode and the non-congestion detection mode can be more accurately controlled to adapt to the scene with more or fewer people in the object delivery area.
[0192] In some embodiments, in the congestion detection mode, if the first image, the second image, and each frame of image between the first image and the second image are in the first state, multiple frames of first recorded images and coordinate information of each target person pair in each frame of the first recorded image are saved, and the multiple frames of first recorded images include the first image, the second image, and all images between the first image and the second image; the previous frame of the first image corresponds to the congestion detection mode and the previous frame of the first image is in the third state, or the previous frame of the first image corresponds to the non-congestion detection mode; the next frame of the second image corresponds to the non-congestion detection mode, or the next frame of the second image corresponds to the congestion detection mode and the next frame of the second image is in the third state; in the non-congestion detection mode, if the third image The coordinate information of the second target person pair is stored in the image, the fourth image, and each frame between the third image and the fourth image, and the second target person pair is in the second state. The coordinate information of the second target person pair in multiple frames of second recorded images and each frame of the second recorded image is stored. The multiple frames of second recorded images include the third image, the fourth image, and all images between the third image and the fourth image. The previous frame of the third image corresponds to the non-congestion detection mode and the target person pair in the previous frame of the third image is in the second state, or the previous frame of the third image corresponds to the congestion detection mode. The next frame of the fourth image corresponds to the congestion detection mode, or the next frame of the fourth image corresponds to the non-congestion detection mode and the second target person pair in the next frame of the fourth image is in the fourth state. The coordinate information of the target person pair can be understood as the coordinate information of the merged detection frame of the target person pair. The merged detection frame of the target person pair is the area where the circumscribed rectangle of the human body detection frame corresponding to each of the two persons included in the target person pair is located.
[0193] Exemplarily, in the congestion detection mode, image 1 corresponds to the third state, image 2, the next frame of image 1, corresponds to the first state, image x corresponds to the first state, each frame of image between image 2 and image x corresponds to the first state, and the next frame of image x corresponds to the third state, or the next frame of image x is switched to the non-congestion detection mode, then the electronic device records all images from image 2 to image x, saves it as a video file of the object delivery behavior, and records the coordinate information of the merged detection box of the target person in each frame of the image. In the non-congestion detection mode, the target person pair AB in image 1 corresponds to the fourth state, the target person pair AB in image 2, the next frame of image 1, corresponds to the second state, and the target person pair AB in image x corresponds to the second state. The target person pair AB exists in each frame between image 2 and image x, and the target person pair AB corresponds to the second state. The target person pair AB in the next frame of image x corresponds to the fourth state, or the next frame of image x is switched to the congestion detection mode, then the electronic device records all images from image 2 to image x, saves it as a video file of the object delivery behavior between the target person and AB, and records the coordinate information of the merged detection box of the target person pair AB in each frame.
[0194] In this way, by saving the first recorded image or the second recorded image, and the coordinate information of the target person pair therein, it is convenient for the detection personnel to view the recorded image and trace the target person pair.
[0195] In some embodiments, when it is determined that there is a delivery behavior, the electronic device also obtains one or more of the delivery direction, item category, and item size based on the coordinate information of the target person pair in the first recorded image, or based on the coordinate information of the second target person pair in the second recorded image; if the preset condition is met, the electronic device outputs a first prompt message; if the preset condition is not met, the electronic device outputs a second prompt message, and the second prompt message is used to indicate that a low-risk delivery behavior has occurred. Among them, the preset conditions are that the delivery direction is from the first area to the second area, or the item category matches the preset item category, or the item size is greater than the preset size; the first prompt message is used to indicate that a high-risk delivery behavior has occurred; the first area is a non-management area, and the second area is a management area.
[0196] Specifically, the first prompt information may include the first recorded image or the second recorded image, coordinate information of the target person, object delivery direction, object category, object size and other information.
[0197] For example, Fig.15As shown in the figure, person A and person B form a target person pair, person A is outside the management area, person B is within the management area, the item is in the hand of person A in the upper image, and the item is in the hand of person B in the lower image, then it can be determined that the object delivery direction of the target person pair is from the non-management area to the management area, then the electronic device sends a first prompt information, and the first prompt information displayed in the prompt device can be as follows Fig.16 As shown, the first prompt information display interface displays "High-risk object delivery behavior! From non-management area to management area!". After checking the first prompt information, the detection personnel can stop the object delivery behavior of the target person pair as soon as possible. For another example, person A and person B form a target person pair. From the corresponding recorded image of the target person pair, it is detected that the category of the object passed between person A and person B is a controlled knife, and the electronic device issues a first prompt information. For another example, the preset size is 30cm×30cm×30cm, person A and person B form a target person pair, and from the corresponding recorded image of the target person pair, it is detected that the size of the object passed between person A and person B is 60cm×90cm×50cm, which exceeds the preset size, and the electronic device issues a first prompt information. For another example, the person in the management area of the target person pair hands an object that does not match the preset item category and the size does not exceed the preset size to the person outside the management area, then the electronic device determines that a low-risk object delivery behavior has occurred and issues a second prompt information.
[0198] In this way, by pre-setting conditions, the object delivery behavior is divided into high-risk object delivery behavior and low-risk object delivery behavior, so that the inspection personnel can focus on high-risk object delivery behavior and ensure the safety within the management area.
[0199] In some embodiments, the electronic device can detect the area where the combined detection frame of the target person pair is located to obtain one or more of the object delivery direction, object category, and object size. The object delivered by the two persons in the target person pair is usually between the two persons, so only the combined detection frame detection area of the two persons is detected, which can detect the object and reduce the detection area of the electronic device, thereby reducing the processing workload of the electronic device.
[0200] In some embodiments, the detection personnel pre-train the object detection model, and the electronic device inputs the image into the object detection model to obtain the object category, object size, and object delivery direction of the two persons handing over objects to the target person in the image.
[0201] In some embodiments, when there is an object delivery behavior, if the time between the time corresponding to the target image and the time when the third prompt information was last issued is greater than the third preset time, a third prompt information is issued, and the third prompt information includes the target image, and the third prompt information is used to indicate that there is an object delivery behavior. The target image included in the third prompt information can be an image without marking the target person pair, or an image with marking the target person pair.
[0202] Exemplarily, the detection user pre-sets the third preset time length as the detection time length of 4 frames of images, and the electronic device determines whether to output the third prompt information every 5 frames. If the first 4 frames of images are all in the first state, this frame of image is also in the first state, and the third prompt information has not been reported before, the electronic device will send the third prompt information containing this frame of image to the prompt device, and then the detection user views the image, and can quickly respond to the object delivery behavior to maintain the safety of the management area. Based on the above example, if all the arrays in the congestion detection mode are Y, or all the corresponding arrays of a target person in the non-congestion detection mode are Y, it is determined whether the time interval between the last sending of the third prompt information is greater than the third preset time length.
[0203] In this way, the third prompt information sent by the electronic device contains the target image, so that the detection personnel can intuitively and clearly understand the object delivery behavior occurring in the target image. By setting the third preset time length, it can be considered that the pair of persons who have delivered the object indicated by the third prompt information last sent out when the time length is less than the third preset time length is the same pair of persons who have delivered the object detected this time, and there is no need to send the third prompt information frequently.
[0204] In some embodiments, the above-mentioned object delivery behavior detection process can be pushed to the client used by the user after detection by the electronic device, so that the user can be informed of the object delivery behavior occurring in the management area. The above-mentioned high-risk object delivery behavior judgment process can be reported to the client used by the user after detection by the electronic device, or the client used by the user can judge whether the object delivery behavior is a high-risk object delivery behavior or a low-risk object delivery behavior based on the object delivery behavior alarm image reported by the electronic device.
[0205] In some embodiments, the detection personnel sets the above-mentioned parameters related to the object delivery behavior detection process (such as a preset coefficient, a first preset time, a second preset time, a third preset time, a first preset angle, a second preset angle, etc.), as well as the object delivery area, the upper edge of the railing, and the lower edge of the railing on the terminal device used by the detection personnel. The terminal device packages these contents into object delivery behavior detection rules and sends them to the electronic device or sends them to the electronic device separately, so that the electronic device can perform object delivery behavior detection based on the contents set by the detection personnel.
[0206] Optionally, the inspector directly sets the above parameters as well as the object delivery area, the upper edge of the railing, and the lower edge of the railing through an interactive device of the electronic device.
[0207] Optionally, the above parameters related to the object delivery behavior detection process are default, and the detection personnel will not reset these parameters. The object delivery area, the upper edge of the railing, and the lower edge of the railing can also be recognized by the electronic device through image recognition, and the object delivery area, the upper edge of the railing, and the lower edge of the railing are identified from the image.
[0208] Figure 7 The technical solution shown brings at least the following beneficial effects: by identifying the key points of the human body in the image in the video file, based on the key points of the human body, the number of intersections between the connecting line between the target points corresponding to the two persons and the non-vertices along the lower edge of the railing is determined. If the number of intersections is an odd number, it can be determined that the two persons must be on different sides of the railing, so that the two persons included in the screened person pair must be on different sides of the railing. The subsequent process will detect whether both persons in the person pair have raised their hands, which can more accurately detect the object delivery behavior and effectively avoid the occurrence of missed detection. The object delivery behavior detection method provided by the present application can use existing image acquisition equipment, without changing the installation position of the image acquisition device or adding an image acquisition device, and will not increase the detection cost of the object delivery behavior.
[0209] against Figure 1-Figure 4 As shown, there is an angle between the collection direction and the railing, or the railing is not arranged in a straight line, or the two persons who perform the object delivery behavior are not in the same horizontal position, etc., the present application can effectively detect the persons on both sides of the railing, and then match the target persons, and there will be no missed detection in the subsequent detection of the object delivery behavior.
[0210] The following describes the object delivery behavior detection process provided by this application from the perspective of the overall process:
[0211] like Fig.17 As shown, the electronic device reads the video stream and the object delivery behavior detection rules, which include relevant parameters for object delivery behavior detection, as well as the object delivery area, the upper edge line of the railing and the lower edge line of the railing.
[0212] The image is input into the human key point detection model to obtain the human key points of the people in the image.
[0213] Perform a preliminary screening on individual persons to select hand key points and human detection frames whose hand key points are within the object delivery area and whose single confidence of hand key points and human detection frame confidence are both greater than the threshold.
[0214] Pair the persons who have passed the initial target screening, and determine the two persons whose midpoints of their feet are located on both sides of the lower edge of the railing, whose hand distance is less than the adaptive threshold (the first pixel distance), and whose hand-raising angle meets the preset angle threshold (the corresponding shoulder hand-raising angle is greater than the threshold, that is, the line segment formed by the shoulder key point on the delivery side and the elbow key point on the delivery side is the edge, and the line segment formed by the shoulder key point on the delivery side and the hip key point on the delivery side is the edge, and the hand-raising angle formed is greater than the second preset angle; or, the corresponding elbow hand-raising angle is less than the threshold, that is, the line segment formed by the elbow key point on the delivery side and the hand key point on the delivery side is the edge, and the line segment formed by the elbow key point on the delivery side and the shoulder key point on the delivery side is the edge, and the hand-raising angle formed is less than or equal to the first preset angle). The hand of the target person pair that is closest to the hand-delivering hand is regarded as the delivery hand.
[0215] The electronic device determines whether the scene represented by the image is congested, and if not, performs a non-congestion detection mode; if congested, performs a congestion detection mode.
[0216] In the non-congestion detection mode, the status of each target person pair is continuously detected. If the target person pair AB meets the object delivery condition, the status of the target person pair AB is updated to: T2_AB=T1_AB[1:]+[Y]. If the target person pair AB does not meet the object delivery condition, the status of the target person pair AB is updated to: T2_AB=T1_AB[1:]+[N].
[0217] If all the state arrays are Y and it is the first alarm or the interval from the last alarm of the target person is greater than the threshold, the electronic device will retain the frame image as the [object passing through the fence] alarm picture; if these conditions are not met, the electronic device will read the next frame image.
[0218] In the congestion detection mode, detect whether there is a target person pair in the object delivery area of the image.
[0219] If the target person pair exists in the object delivery area of the image, the image state is updated to: T2 = A1 [1:] + [Y]; if the target person pair does not exist in the object delivery area of the image, the image state is updated to: T2 = A1 [1:] + [N].
[0220] If all the state arrays are Y and it is the first alarm or the interval from the last alarm in this area is greater than the threshold, the electronic device will retain the frame image as the [passing objects through the fence] alarm picture; if these conditions are not met, the electronic device will read the next frame image.
[0221] If there is an alarm image within the alarm interval and the status update is changed to [N] for the first time, obtain the full video recording of the object delivery behavior and the coordinate information of the merged frame of the person detection frame in each frame of the alarmed object delivery behavior.
[0222] The object detection model is used to detect the area where the merged detection frame of the target person pair alarmed in the video file is located to obtain the object type, size and movement direction.
[0223] Determine whether the type, size and moving direction of the detected object meet the judgment rules for high-risk object delivery behavior. If so, a high-risk alarm [object delivery through a fence] is issued. If not, a low-risk alarm [object delivery through a fence] is issued.
[0224] The following describes the reporting process of the object delivery behavior detection event in this application from the perspective of the overall process:
[0225] like Fig.18 As shown, firstly, the real-time video stream is analyzed to determine whether the object delivery behavior alarm condition is met. If so, the object delivery behavior alarm image is reported and the video recording of the alarm event is pulled. If not, the next frame of image is read.
[0226] Continuously detect the status of the object delivery alarm event. After the alarm event ends, detect the type, size and moving direction of the object in the combined detection frame of the target person to determine whether it meets the judgment rules for high-risk object delivery behavior. If it meets the rules, it is a high-risk object delivery behavior, and notify the detection personnel to deal with it immediately. If it does not meet the rules, it is a low-risk object delivery behavior, and the detection personnel will verify it at their leisure time before handling it.
[0227] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easy to realize that the technical goals in this field are combined with the units and algorithm steps of each example described in the embodiments disclosed in this article, and the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical goals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0228] like Fig.19 As shown, the present application embodiment further provides a device for detecting object delivery behavior, which is used to execute the object delivery behavior detection method shown in the above method embodiment. The object delivery behavior detection device 400 includes: a processing module 401 and an interaction module 402.
[0229] Among them, the processing module 401 is used to: identify a frame of target image in the video file to obtain the human body key points in the target image; based on the human body key points in the target image, screen out the person pairs in the target image, the number of intersections between the connecting line between the target points corresponding to the two persons included in the person pair and the non-vertices along the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line between the foot key points of the two feet in the human body key points of the persons; if both persons in the person pair have a hand-raising action, determine that the person pair is a target person pair; based on the target person pair in multiple frames of images continuous with the target image, determine whether there is an object delivery behavior.
[0230] In a possible implementation, the processing module 401 is also used to: determine the object handing distance between the hand key point among the human body key points of the first person in the person pair and the hand key point among the human body key points of the second person; if the object handing distance is less than or equal to the first reference distance, the hand-raising angle formed by the human body key points of the first person is within the preset angle range, and the hand-raising angle formed by the human body key points of the second person is within the preset angle range, it is determined that both persons in the person pair have a hand-raising action; wherein the first reference distance is the product of the target pixel distance and the preset coefficient, the target pixel distance is the average pixel distance between the first pixel distance and the second pixel distance, the first pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the first person, and the second pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the second person.
[0231] In another possible implementation, the processing module 401 is specifically used to: determine the handover distance between a hand key point among the body key points of the first person in the personnel pair that is located in the handover area corresponding to the railing and a hand key point among the body key points of the second person that is located in the handover area; or, determine the handover distance between a hand key point among the body key points of the first person in the personnel pair whose distance from the upper edge of the railing is less than a second reference distance and a hand key point among the body key points of the second person whose distance from the upper edge of the railing is less than the second reference distance.
[0232] In another possible implementation, the processing module 401 is specifically used to identify a frame of target image in a video file, and output the human key points in the human detection frame in the target image whose detection frame confidence is greater than a first preset confidence, one human key point corresponds to one key point confidence, and one human detection frame corresponds to one detection frame confidence; the processing module 401 is specifically used to determine the handover distance between the hand key points among the human key points of the first person in the person pair whose key point confidence is greater than a second preset confidence, and the hand key points among the human key points of the second person whose key point confidence is greater than the second preset confidence.
[0233] In another possible implementation, the multiple frames of images continuous with the target image are multiple frames of images within a first preset time length adjacent to the target image and before the target image; the processing module 401 is also used for: in a congestion detection mode, when there is a target person pair in the target image, recording the target image as a first state; in a non-congestion detection mode, when there is a target person pair in the target image, recording the target person pair as a second state; the processing module 401 is specifically used for: when the target image and each frame of images within a first preset time length adjacent to the target image and before the target image correspond to the congestion detection mode, and the target image and each frame of images within a first preset time length adjacent to the target image and before the target image are all in the first state, determining that there is a delivery behavior; when the target image and each frame of images within a first preset time length adjacent to the target image and before the target image correspond to the non-congestion detection mode, and there is a first target person pair in the target image and each frame of images within the first preset time length adjacent to the target image and before the target image, and the first target person pair are all in the second state, determining that there is a delivery behavior.
[0234] In another possible implementation, the processing module 401 is further used for: in the case where the target image corresponds to the congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to the first preset number, and there is no target person pair in the target image, switching the congestion detection mode to the non-congestion detection mode; in the case where the target image corresponds to the non-congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the first preset number, and there is no target person pair in the target image, switching the non-congestion detection mode to the congestion detection mode; Alternatively, in the case where the target image corresponds to the congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to the second preset number, and there is no target person pair in the target image, the congestion detection mode is switched to the non-congestion detection mode; in the case where the target image corresponds to the non-congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the second preset number, and there is no target person pair in the target image, the non-congestion detection mode is switched to the congestion detection mode.
[0235] In another possible implementation, the processing module 401 is also used for: in a congestion detection mode, when there is no target person pair in the target image, recording the target image as the third state; in a non-congestion detection mode, when there is no target person pair in the target image, recording the target person pair as the fourth state; in a congestion detection mode, if the first image, the second image and each frame of image between the first image and the second image are all in the first state, saving multiple frames of first recorded images and coordinate information of each target person pair in each frame of the first recorded image, the multiple frames of first recorded images include the first image, the second image and all images between the first image and the second image; the previous frame of the first image corresponds to the congestion detection mode and the previous frame of the first image is the third state, or the previous frame of the first image corresponds to the non-congestion detection mode; the next frame of the second image corresponds to the non-congestion detection mode, or the second image The next frame image of the second image corresponds to the congestion detection mode and the next frame image of the second image is in the third state; in the non-congestion detection mode, if there is a second target person pair in the third image, the fourth image, and each frame image between the third image and the fourth image, and the second target person pairs are all in the second state, save multiple frames of second recorded images and coordinate information of the second target person pairs in each frame of the second recorded image, and the multiple frames of second recorded images include the third image, the fourth image, and all images between the third image and the fourth image; the previous frame image of the third image corresponds to the non-congestion detection mode and the target person pair in the previous frame image of the third image is in the second state, or the previous frame image of the third image corresponds to the congestion detection mode; the next frame image of the fourth image corresponds to the congestion detection mode, or the next frame image of the fourth image corresponds to the non-congestion detection mode and the second target person pair in the next frame image of the fourth image is in the fourth state.
[0236] In another possible implementation, when it is determined that there is an object delivery behavior, the processing module 401 is also used to obtain one or more of the object delivery direction, item category, and item size based on the coordinate information of the target person pair in the first recorded image, or based on the coordinate information of the second target person pair in the second recorded image; the object delivery behavior detection device also includes an interaction module 402, and the interaction module 402 is used to: if a preset condition is met, output a first prompt message; the preset condition is that the object delivery direction is from the first area to the second area, or the item category matches the preset item category, or the item size is greater than the preset size; the first prompt message is used to indicate that a high-risk object delivery behavior has occurred; the first area is a non-management area, and the second area is a management area; if the preset condition is not met, output a second prompt message, and the second prompt message is used to indicate that a low-risk object delivery behavior has occurred.
[0237] In another possible implementation, the interaction module 402 is also used to, in the case of the existence of object delivery, issue a third prompt message if the duration between the moment corresponding to the target image and the moment when the third prompt message was last issued is greater than a third preset duration, and the third prompt message includes the target image, and the third prompt message is used to indicate the existence of object delivery.
[0238] In another possible implementation, the processing module 401 is further used to: when the object delivery distance is less than or equal to the first reference distance, determine the side of the human body where the hand key points constituting the object delivery distance are located as the object delivery side; for the object delivery side of the first person, if the object delivery side elbow key point is taken as the vertex, the line segment formed by the object delivery side elbow key point and the object delivery side hand key point is taken as the edge, and the line segment formed by the object delivery side elbow key point and the object delivery side shoulder key point is taken as the edge, the hand raising angle formed is less than or equal to the first preset angle, or, if the object delivery side shoulder key point is taken as the vertex, the line segment formed by the object delivery side shoulder key point and the object delivery side elbow key point is taken as the edge, and the line segment formed by the object delivery side shoulder key point and the object delivery side hip key point is taken as the edge, the hand raising angle formed is greater than the first preset angle. Second preset angle, determine that the hand-raising angle formed by the key points of the first person's body is within the preset angle range; for the delivery side of the second person, if the key point of the elbow on the delivery side is the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side is the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side is the edge, the hand-raising angle formed is less than or equal to the first preset angle, or, if the key point of the shoulder on the delivery side is the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side is the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is the edge, the hand-raising angle formed is greater than the second preset angle, determine that the hand-raising angle formed by the key points of the second person's body is within the preset angle range.
[0239] It should be noted that Fig.19 The division of modules in the example is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or software function modules.
[0240] Another embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the object delivery behavior detection method shown in the above embodiment.
[0241] In actual implementation, the processing module 401 and the interaction module 402 can be implemented by the processor of the electronic device calling the computer program code in the memory. The specific execution process can refer to the description of the above object delivery behavior detection method part, which will not be repeated here.
[0242] Another embodiment of the present application further provides a computer-readable storage medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the steps of the object delivery behavior detection method shown in the above embodiment are implemented.
[0243] In another embodiment of the present application, a computer program product is provided. The computer program product includes computer instructions. When the computer instructions are executed by a processor, the steps of the object delivery behavior detection method shown in the above embodiment are implemented.
[0244] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer execution instruction is loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by the computer or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with the medium. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), etc.
[0245] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.
Claims
1. A method for detecting object delivery behavior, It is characterized in that include: Recognize a frame of target image in the video file to obtain key points of the human body in the target image; Based on the key points of the human body in the target image, a pair of people in the target image is screened out, wherein the number of intersections between the connecting line between the target points corresponding to the two people included in the pair of people and the non-vertices along the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line between the key points of the feet of the two feet of the key points of the human body of the person; If both persons in the pair of persons raise their hands, the pair of persons is determined to be a target pair of persons; Determine whether there is an object delivery behavior based on the target person pair in multiple frames of images continuous with the target image.
2. The method according to claim 1, It is characterized in that The method further comprises: Determine a handover distance between a hand key point among the key points of the body of a first person in the person pair and a hand key point among the key points of the body of a second person; If the object handing distance is less than or equal to the first reference distance, the hand-raising angle formed by the key points of the first person's body is within the preset angle range, and the hand-raising angle formed by the key points of the second person's body is within the preset angle range, it is determined that both persons in the pair of persons have raised their hands; Among them, the first reference distance is the product of the target pixel distance and a preset coefficient, the target pixel distance is the average pixel distance between the first pixel distance and the second pixel distance, the first pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the first person, and the second pixel distance is the pixel distance between the shoulder key point and the hip key point among the human body key points of the second person.
3. The method according to claim 2, It is characterized in that The determining of the handover distance between the hand key point of the first person in the human body key points and the hand key point of the second person in the human body key points in the person pair includes: Determine the object delivery distance between the key points of the hand of the first person in the object delivery area corresponding to the railing and the key points of the hand of the second person in the object delivery area; or, Determine the object handing distance between the key points of the hand of the first person among the key points of the body of the first person and the upper edge line of the railing less than the second reference distance, and the key points of the hand of the second person among the key points of the body of the second person and the upper edge line of the railing less than the second reference distance.
4. The method according to any one of claims 1 to 3, It is characterized in that The multiple frames of images continuous with the target image are multiple frames of images adjacent to the target image and within a first preset time length before the target image; the method further includes: In the congestion detection mode, when a target person pair exists in the target image, recording the target image as a first state; In the non-congestion detection mode, when a target person pair exists in the target image, recording the target person pair as a second state; The determining whether there is an object delivery behavior based on the target person pair in multiple frames of images continuous with the target image includes: When the target image and each frame image within a first preset time period adjacent to the target image and before the target image correspond to the congestion detection mode, and the target image and each frame image within a first preset time period adjacent to the target image and before the target image are in the first state, it is determined that there is a handover behavior; When the target image and each frame image within a first preset time length adjacent to the target image and before the target image correspond to the non-congestion detection mode, and a first target person pair exists in the target image and each frame image within a first preset time length adjacent to the target image and before the target image, and the first target person pair is in the second state, it is determined that there is object delivery behavior.
5. The method according to claim 4, It is characterized in that The method further comprises: In the case where the target image corresponds to the congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to a first preset number, and there is no target person pair in the target image, the congestion detection mode is switched to the non-congestion detection mode; In the case where the target image corresponds to the non-congestion detection mode, if the number of people in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the first preset number, and there is no target person pair in the target image, the non-congestion detection mode is switched to the congestion detection mode; or, In the case where the target image corresponds to the congestion detection mode, if the number of persons overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is less than or equal to a second preset number, and there is no target person pair in the target image, the congestion detection mode is switched to the non-congestion detection mode; In the case where the target image corresponds to the non-congestion detection mode, if the number of people overlapping with the object delivery area in the target image and each frame image within a second preset time length adjacent to the target image and before the target image is greater than the second preset number, and there is no target person pair in the target image, the non-congestion detection mode is switched to the congestion detection mode.
6. The method according to claim 4, It is characterized in that The method further comprises: In the congestion detection mode, when there is no target person pair in the target image, recording the target image as a third state; In the non-congestion detection mode, when the target person pair does not exist in the target image, recording the target person pair as a fourth state; In the congestion detection mode, if the first image, the second image, and each frame of image between the first image and the second image are all in the first state, multiple frames of first recorded images and coordinate information of each target person pair in each frame of the first recorded image are saved, and the multiple frames of first recorded images include the first image, the second image, and all images between the first image and the second image; the previous frame of the first image corresponds to the congestion detection mode and the previous frame of the first image is in the third state, or the previous frame of the first image corresponds to the non-congestion detection mode; the next frame of the second image corresponds to the non-congestion detection mode, or the next frame of the second image corresponds to the congestion detection mode and the next frame of the second image is in the third state; In the non-congestion detection mode, if there is a second target person pair in the third image, the fourth image, and each frame of the image between the third image and the fourth image, and the second target person pair is in the second state, save multiple frames of second recorded images and coordinate information of the second target person pair in each frame of the second recorded image, and the multiple frames of second recorded images include the third image, the fourth image, and all images between the third image and the fourth image; the previous frame of the third image corresponds to the non-congestion detection mode and the target person pair in the previous frame of the third image is in the second state, or the previous frame of the third image corresponds to the congestion detection mode; the next frame of the fourth image corresponds to the congestion detection mode, or the next frame of the fourth image corresponds to the non-congestion detection mode and the second target person pair in the next frame of the fourth image is in the fourth state.
7. The method according to claim 2, It is characterized in that The method further comprises: When the object-delivery distance is less than or equal to the first reference distance, determining the side of the human body where the key points of the hand constituting the object-delivery distance are located as the object-delivery side; For the delivery side of the first person, if the key point of the elbow on the delivery side is the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side is the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side is the edge, the hand-raising angle formed is less than or equal to the first preset angle, or if the key point of the shoulder on the delivery side is the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side is the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is the edge, the hand-raising angle formed is greater than the second preset angle, it is determined that the hand-raising angle formed by the key points of the human body of the first person is within the preset angle range; For the delivery side of the second person, if the key point of the elbow on the delivery side is the vertex, the line segment formed by the key point of the elbow on the delivery side and the key point of the hand on the delivery side is the edge, and the line segment formed by the key point of the elbow on the delivery side and the key point of the shoulder on the delivery side is the edge, the hand-raising angle formed is less than or equal to the first preset angle, or if the key point of the shoulder on the delivery side is the vertex, the line segment formed by the key point of the shoulder on the delivery side and the key point of the elbow on the delivery side is the edge, and the line segment formed by the key point of the shoulder on the delivery side and the key point of the hip on the delivery side is the edge, the hand-raising angle formed is greater than the second preset angle, it is determined that the hand-raising angle formed by the key points of the body of the second person is within the preset angle range.
8. A device for detecting object delivery behavior, It is characterized in that The invention comprises a processing module; the processing module is used for: Recognize a frame of target image in the video file to obtain key points of the human body in the target image; Based on the key points of the human body in the target image, a pair of people in the target image is screened out, wherein the number of intersections between the connecting line between the target points corresponding to the two people in the pair of people and the non-vertices of the lower edge of the railing is an odd number, and the target point is the midpoint of the connecting line between the key points of the feet of the two feet of the human body key points of the person; If both persons in the pair of persons raise their hands, the pair of persons is determined to be a target pair of persons; Determine whether there is an object delivery behavior based on the target person pair in multiple frames of images continuous with the target image.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, It is characterized in that The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, It is characterized in that When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
