A method, device, computer equipment and storage medium for detecting avoidance behavior
By obtaining and processing the multi -frame images of users, the target optical flow vector is calculated and stacked to obtain the movement trajectory, which solves the problem that the detection of evasion in the existing technology requires a lot of labeling data and the accuracy of the model. Behavior testing.
Patent Information
- Application Number
- CN202210812653.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-07-12
AI Technical Summary
When the prior art detects whether the user has intentional evasion behavior, it requires a large amount of labeled data and the judgment accuracy is greatly affected by the accuracy of the model.
By obtaining the continuous multi -frame images collected by the user, determine the target optical flow vector corresponding to the target image per frame, and superimposed these light flow vectors to obtain the user's target behavior corresponding to the motion trajectory, and then determine whether there is a dodge behavior.
The rapid and accurate testing of avoiding behavior is achieved, the judgment process is more simple and convenient, and it can effectively reduce the risk of surface trials in the online business surface review scene.
Smart Images

Figure CN115063729B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment and storage medium for detecting evasive behavior. Background Art
[0002] With the continuous increase in online business, the use of intelligent customer service has become more and more common. Currently, many online business operations require face-to-face interviews by intelligent customer service, such as financial business interviews. When conducting face-to-face interviews with users, some online businesses require users to hold their mobile phones and walk around to observe whether there are third parties or other suspicious objects in the surrounding environment. For users who want to violate the rules, they will deliberately raise their mobile phones when walking around to avoid non-compliant people or objects appearing in the mobile phone camera, that is, there is deliberate avoidance behavior. It can be said that accurately detecting users' deliberate avoidance behavior is of great significance to reducing the risk of face-to-face interviews.
[0003] In the prior art, when detecting whether a user has intentional evasive behavior during an interview, a classifier is usually used to classify the user's behavior to determine whether the user has intentional evasive behavior. However, this method requires a large amount of labeled data when training the classifier, and the judgment accuracy is greatly affected by the model accuracy. Summary of the invention
[0004] In view of this, the present application provides a method, apparatus, computer device and storage medium for detecting avoidance behavior, which makes the judgment process of avoidance behavior simpler and more convenient, and the judgment result can be obtained quickly and accurately.
[0005] According to one aspect of the present application, a method for detecting avoidance behavior is provided, comprising:
[0006] Acquire the collected continuous multi-frame images, and determine the target optical flow vector corresponding to each frame of the target image, wherein the target image is an image other than the first frame of the continuous multi-frame images;
[0007] Superimposing the target optical flow vectors corresponding to each frame of the target image to obtain a motion trajectory of the target behavior;
[0008] Based on the motion trajectory, it is determined whether there is an evasive behavior in the target behavior.
[0009] According to another aspect of the present application, a device for detecting avoidance behavior is provided, comprising:
[0010] An image acquisition module is used to acquire the collected continuous multi-frame images and determine the target optical flow vector corresponding to each frame of the target image, wherein the target image is an image other than the first frame of the continuous multi-frame images;
[0011] A trajectory determination module, used for superimposing the target optical flow vector corresponding to each frame of the target image to obtain a motion trajectory of the target behavior;
[0012] The behavior judgment module is used to judge whether there is an evasive behavior in the target behavior based on the motion trajectory.
[0013] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned avoidance behavior detection method is implemented.
[0014] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned avoidance behavior detection method when executing the program.
[0015] By means of the above technical scheme, the present application provides a method, device, computer equipment and storage medium for detecting avoidance behavior. First, multiple frames of continuous images collected by the user through the client can be obtained. Then, the target optical flow vector corresponding to each target image in the multiple frames of continuous images is determined respectively. Here, the target image can be other images except the first frame image in the continuous multiple frames of images. After respectively determining the target optical flow vector corresponding to each frame of the target image, these target optical flow vectors can be superimposed to finally obtain the motion trajectory corresponding to the user's target behavior. After determining the motion trajectory corresponding to the target behavior, it can be further determined based on the motion trajectory whether there is deliberate avoidance behavior in the target behavior. The embodiment of the present application obtains the motion trajectory of the user's target behavior through the continuous multiple frames of images collected by the user, and then determines whether the user has avoidance behavior based on the motion trajectory. The judgment process is simpler and more convenient, and the judgment result can be obtained quickly and accurately.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A schematic diagram of a process flow of a method for detecting avoidance behavior provided in an embodiment of the present application is shown;
[0019] Figure 2A schematic diagram showing a flow chart of another avoidance behavior detection method provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of an optical flow vector of a target image provided by an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram of a target behavior motion trajectory provided by an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram showing another target behavior motion trajectory provided by an embodiment of the present application is shown;
[0023] Figure 6 A schematic diagram of a main angle determination process provided by an embodiment of the present application is shown;
[0024] Figure 7 A schematic diagram of a filtered optical flow vector provided in an embodiment of the present application is shown;
[0025] Figure 8 A schematic structural diagram of an avoidance behavior detection device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0027] In this embodiment, a method for detecting avoidance behavior is provided, such as Figure 1 As shown, the method includes:
[0028] Step 101, acquiring the collected continuous multi-frame images, and determining the target optical flow vector corresponding to each frame of the target image, wherein the target image is an image other than the first frame of the continuous multi-frame images;
[0029] The avoidance behavior detection method provided in the embodiment of the present application can be applied to the scenario of online business face-to-face review, and can effectively detect whether there is avoidance behavior in the user's behavior based on the images collected by the user through the client. When the user is conducting a face-to-face review, he can use the client to collect multiple frames of continuous images. When collecting images, the camera of the client can be used to collect. First, multiple frames of continuous images collected by the user through the client can be obtained. Then, the target optical flow vector corresponding to each target image in the multiple frames of continuous images is determined respectively. Here, the target image can be other images in the continuous multi-frame images except the first frame image. For example, there are 10 frames of images in the continuous multi-frame images, then there are 9 frames of target images, that is, other images except the first frame image. Optical flow is the "instantaneous speed" of the pixel movement of a moving object in space on the observation imaging plane, and the target optical flow vector can be a vector used to indicate target motion information.
[0030] Step 102, superimposing the target optical flow vector corresponding to each frame of the target image to obtain a motion trajectory of the target behavior;
[0031] In this embodiment, after determining the target optical flow vector corresponding to each frame of the target image, these target optical flow vectors can be superimposed to finally obtain the motion trajectory corresponding to the user's target behavior. Since the target optical flow vector is a vector, that is, a quantity with both size and direction, the target optical flow vector can be superimposed. Here, the target behavior can be the behavior of the user using the client to conduct an interview. For example, if the client is a mobile phone, then the target behavior can be the behavior of the user holding the mobile phone around for an interview, and the motion trajectory can be the motion trajectory of the mobile phone when the user holds the mobile phone around.
[0032] Step 103: Based on the motion trajectory, determine whether there is any avoidance behavior in the target behavior.
[0033] In this embodiment, after determining the motion trajectory corresponding to the target behavior, it is possible to further determine whether there is deliberate avoidance behavior in the target behavior based on the motion trajectory. For example, in an online business review scenario, a user can hold a mobile phone around for a review. Under normal circumstances, when the user holds the mobile phone around, the corresponding motion trajectory is smooth. Therefore, if there is a part of the motion trajectory with a large change in the trajectory, it can be said that there is deliberate avoidance behavior in the user's target behavior. Otherwise, it can be said that there is no deliberate avoidance behavior in the user's target behavior.
[0034] By applying the technical solution of this embodiment, first, multiple frames of continuous images collected by the user through the client can be obtained. Then, the target optical flow vector corresponding to each target image in the multiple frames of continuous images is determined respectively. Here, the target image can be other images except the first frame image in the continuous multiple frames of images. After respectively determining the target optical flow vector corresponding to each frame of the target image, these target optical flow vectors can be superimposed to finally obtain the motion trajectory corresponding to the user's target behavior. After determining the motion trajectory corresponding to the target behavior, it can be further judged whether there is deliberate avoidance behavior in the target behavior based on the motion trajectory. The embodiment of the present application obtains the motion trajectory of the user's target behavior through the continuous multiple frames of images collected by the user, and then judges whether the user has avoidance behavior based on the motion trajectory. The judgment process is simpler and more convenient, and the judgment result can be obtained quickly and accurately.
[0035] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another avoidance behavior detection method is provided, such as Figure 2 As shown, the method includes:
[0036] Step 201, acquiring the collected continuous multi-frame images, and based on the previous frame image corresponding to any of the target images, determining the target corner point corresponding to the previous frame image and the first corner point position corresponding to each of the target corner points; determining the second corner point position of each of the target corner points on any of the target images; determining the optical flow vector corresponding to any of the target images based on the first corner point position and the second corner point position, wherein the target image is an image other than the first frame image in the continuous multi-frame images;
[0037] In this embodiment, first, a continuous multi-frame image collected by the user through the client can be obtained. The optical flow vector of the next frame image can be determined by any two consecutive frames of images. Here, the next frame image in any two consecutive frames of images can be called the target image. Therefore, for the continuous multi-frame images, the target image can be an image other than the first frame image. Then, the previous frame image corresponding to any one of the target images in the continuous multi-frame images can be used to determine each target corner point from the previous frame image, as well as the first corner point position corresponding to each target corner point. Here, the target corner point can be an extreme point, that is, a point with particularly prominent attributes in a certain aspect. The attributes of the target corner point can be defined by the user. The target corner point can be the intersection of two lines, or it can be a point located on two adjacent objects with different main directions. After that, the second corner point position corresponding to the same target corner point in the target image corresponding to the previous frame image can be determined. After determining the first corner point position and the second corner point position of each target corner point on two consecutive frames of images, the first corner point position and the second corner point position can be connected to form the optical flow vector corresponding to the target corner point. Each frame of the target image may include multiple optical flow vectors. Repeating the above operation can obtain the optical flow vector corresponding to each frame of the target image.
[0038] In addition, before determining the optical flow vector corresponding to the target image based on two consecutive image frames, the two consecutive image frames can be grayed out, and the image can be denoised using a Gaussian filter with a preset kernel size. Using the denoised image to determine the optical flow vector can improve the accuracy of the optical flow vector determination. When determining the target corner points, you can use the goodFeaturesToTrack function in OpenCV to calculate the positions of the corner points with more obvious features in the previous frame of the image. When calculating, you can pre-set the neighborhood size and the minimum Euclidean distance between the target corner points. For example, the neighborhood size can be set to 7, and the minimum Euclidean distance between the target corner points can be 7. Afterwards, the Lucas-Kanade optical flow algorithm can be used to calculate the position of the target corner points in the previous frame of the image in the target image (that is, the next frame of the image). As Figure 3 As shown, the first corner point position corresponding to the target corner point in the previous frame image points to the second corner point position corresponding to the target corner point in the next frame image, which is the optical flow vector. The dot position in each short line can be the second corner point position of the target corner point, and the other end can be the first corner point position.
[0039] Step 202, respectively determining the starting corner point average value and the ending corner point average value of each optical flow vector in each frame of the target image; obtaining the target optical flow vector corresponding to each frame of the target image according to the starting corner point average value and the ending corner point average value;
[0040] In this embodiment, each frame of the target image may include multiple optical flow vectors, each optical flow vector may include a starting corner point and an ending corner point, and an optical flow vector may be formed by connecting the starting corner point and the ending corner point. Then, the starting corner point average value and the ending corner point average value of each optical flow vector in each frame of the target image may be determined respectively, and the target optical flow vector corresponding to each frame of the target image may be determined through the starting corner point average value and the ending corner point average value, so that each frame of the target image may correspond to a target optical flow vector.
[0041] Step 203, superimposing the target optical flow vector corresponding to each frame of the target image to obtain a motion trajectory of the target behavior;
[0042] In this embodiment, after determining the target optical flow vector corresponding to each frame of the target image, these target optical flow vectors can be superimposed to finally obtain the motion trajectory corresponding to the user's target behavior. Since the target optical flow vector is a vector, the target optical flow vector can be superimposed. Here, the motion trajectory can be the motion trajectory of the mobile phone when the user holds the mobile phone around for a week, such as Figure 4 as well as Figure 5 As shown in the figure, the thick black line is the motion trajectory corresponding to the target behavior.
[0043] Step 204, performing straight line fitting on the motion trajectory based on the trajectory points corresponding to the motion trajectory to obtain a target fitting straight line corresponding to the motion trajectory;
[0044] In this embodiment, the motion trajectory of the target behavior may include multiple trajectory points that constitute the motion trajectory. Then, based on these trajectory points, a target fitting straight line corresponding to the motion trajectory may be fitted. Specifically, the RANSAC algorithm may be used for straight line fitting. Figure 4 as well as Figure 5 As shown, the middle straight line among the three straight lines is the target fitting straight line.
[0045] Step 205, determining the tolerance straight lines on both sides of the target fitting straight line according to a preset tolerance threshold;
[0046] In this embodiment, a tolerance threshold may be preset, and then the tolerance lines on both sides of the target fitting line may be determined based on the target fitting line and the preset tolerance threshold. For example, the preset tolerance threshold may be 10, and then a tolerance line may be determined at both sides of the target fitting line at a distance of 5 from the target fitting line. These two tolerance lines may be called the tolerance lines on both sides. Figure 4 as well as Figure 5 As shown, the thin straight lines on the upper and lower sides of the three thin straight lines are the bilateral tolerance lines.
[0047] Step 206: Based on the motion trajectory and the bilateral tolerance line, determine whether the avoidance behavior exists in the target behavior.
[0048] In this embodiment, after determining the bilateral tolerance line corresponding to the target fitting line, it is possible to further determine whether there is intentional avoidance behavior in the target behavior based on the bilateral tolerance line. In the result judgment link, the embodiment of the present application gets rid of the classifier mode that has a large demand for data, and instead adopts a straight line fitting judgment method, which is simple to calculate and fast to run. For face-to-face audit scenarios that require real-time operation, it is very suitable for online deployment.
[0049] Optionally, in an embodiment of the present application, step 206 includes: based on the bilateral tolerance straight line, identifying inner points and outer points from the trajectory points corresponding to the motion trajectory, and calculating the ratio of the number of outer points to the number of trajectory points, the inner points are the trajectory points located within the bilateral tolerance straight line, and the outer points are the trajectory points located outside the bilateral tolerance straight line; when the ratio is greater than a preset ratio threshold, it is determined that the avoidance behavior exists in the target behavior; when the ratio is less than or equal to the preset ratio threshold, it is determined that the avoidance behavior does not exist in the target behavior.
[0050] In this embodiment, the bilateral tolerance straight line can divide the trajectory points corresponding to the motion trajectory into two parts, one part is located outside the bilateral tolerance straight line, and the other part is located inside the bilateral tolerance straight line, wherein the trajectory points located outside the bilateral tolerance straight line can be called external points, and the trajectory points located inside the bilateral tolerance straight line can be called internal points. The trajectory points located on the bilateral tolerance straight line can either be ignored or counted as internal points or external points. First, the internal points and external points can be identified from the trajectory points corresponding to the motion trajectory, and then the ratio between the number of external points and the total number of trajectory points can be calculated. If the calculated ratio is greater than the preset ratio threshold, it means that the number of external points is large, and there are sudden and large changes in the user's motion trajectory, that is, there is an avoidance behavior in the user's target behavior, and the corresponding motion trajectory can be as follows. Figure 4 As shown by the thick black line in the figure; if the calculated ratio is less than or equal to the preset ratio threshold, then there is no sudden and large change in the user's motion trajectory, indicating that there is no avoidance behavior in the user's target behavior, and the corresponding motion trajectory can be as follows Figure 5 Shown in black thick line.
[0051] Optionally, after step 201, the method further includes: calculating a target angle corresponding to each optical flow vector in any of the target images, where the target angle is an angle between the optical flow vector and a preset direction; classifying the optical flow vectors in any of the target images according to the target angle, determining a main angle, and filtering the optical flow vectors in any of the target images based on the main angle.
[0052] In this embodiment, during the online business review, when the user uses the client to move around, most of the objects in the camera move forward or backward in the same direction, but in actual situations, Figure 3 As shown, the optical flow vectors in the target image have various directions, which are very confusing. The main reasons may be that the surround speed is too fast, the video frame rate is too low, the video quality is too low, etc. In this case, the target corner point positions in the two frames of images are prone to mismatching. These erroneous optical flow vectors will directly affect the final result judgment, so it is very important and necessary to filter out these erroneous vectors. Therefore, before using the optical flow vectors in each frame of the target image to determine the target optical flow vector, the optical flow vectors in each frame of the target image can also be filtered and denoised. First, the target angle corresponding to each optical flow vector in each frame of the target image can be determined separately. Here, the target angle can be the angle between each optical flow vector and the preset direction. For example, the preset direction can be the right direction. The target angle corresponding to each optical flow vector can be determined by the angle between the direction of the optical flow vector and the preset direction. Then, the different optical flow vectors in each frame of the target image can be divided according to the target angle and divided into different categories. For example, 360 degrees can be divided into a preset number of angle intervals, and the angle interval with the largest number of optical flow vectors is taken as the main angle. After determining the main angle, all optical flow vectors outside the main angle can be filtered out, or all optical flow vectors outside the main angle and the adjacent angle interval can be filtered out, and finally the target optical flow vector can be determined based on the filtered optical flow vector. The embodiment of the present application filters the optical flow vectors in each frame of the target image by the main angle, which can effectively remove erroneous optical flow vectors. It is an extremely simple but very effective noise removal method for a large amount of noise caused by complex environments.
[0053] Specifically, for each optical flow vector, a target angle can be calculated from the dot to the other end. The unit is degree (°). The entire angle range is 0-360°. It can be stipulated that the direction pointing to the right is 0°, and the angle increases in the counterclockwise direction. With 10° as an angle interval, there are 36 angle intervals in total. The directions of all optical flow vectors in each frame of the target image are histogram-statisticed, such as Figure 6 As shown, Figure 3 The direction histogram statistics of the optical flow vector in the figure shows that the angle with the highest column value is the main angle. Figure 6In the example, 350°-360° is 350°-360°. After finding the main angle, you can only keep the optical flow vectors in the angle interval corresponding to the main angle, or keep all the optical flow vectors in the main angle and two adjacent angle intervals and remove other optical flow vectors. When keeping all the optical flow vectors in the main angle and two adjacent angle intervals, if the main angle is 0°-10°, keep 0°-20° and 350°-360°; if the main angle is 350°-360°, keep 0°-10° and 340°-360°. Figure 3 Filtering the optical flow vector shown in Figure 7 The filtered optical flow vector is shown.
[0054] Optionally, step 203 includes: determining a starting point of the motion trajectory, and sequentially superimposing the target optical flow vectors corresponding to the target images according to the sequence of the target images to obtain the motion trajectory of the target behavior.
[0055] In this embodiment, a starting point of the motion trajectory is first determined, and then the target optical flow vector corresponding to the first frame target image can be superimposed starting from the starting point. Specifically, the starting point of the target optical flow vector can be coincident with the starting point. After that, the starting point of the target optical flow vector corresponding to the second frame target image can be coincident with the end point of the target optical flow vector corresponding to the first frame target image, and so on and so forth can be superimposed to obtain the motion trajectory of the target behavior.
[0056] Optionally, after “determining that the avoidance behavior exists in the target behavior”, the method further includes: outputting avoidance behavior warning information and marking the continuous multiple frames of images.
[0057] In this embodiment, if it is determined that there is avoidance behavior in the user's target behavior, then avoidance behavior warning information can be output accordingly. Here, the avoidance behavior warning information can be voice output, text output, etc., which is not limited here. Through the avoidance behavior warning information, the staff can be reminded in time to strengthen the face-to-face review of the user to avoid the risk of face-to-face review. In addition, the continuous multi-frame images collected by the user can also be marked. By marking the continuous multi-frame images, the staff is reminded that the images collected by the user are images with avoidance behavior.
[0058] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a detection device for avoiding behavior, such as Figure 8 As shown, the device comprises:
[0059] An image acquisition module is used to acquire the collected continuous multi-frame images and determine the target optical flow vector corresponding to each frame of the target image, wherein the target image is an image other than the first frame of the continuous multi-frame images;
[0060] A trajectory determination module, used for superimposing the target optical flow vector corresponding to each frame of the target image to obtain a motion trajectory of the target behavior;
[0061] The behavior judgment module is used to judge whether there is an evasive behavior in the target behavior based on the motion trajectory.
[0062] Optionally, the behavior judgment module includes:
[0063] A straight line fitting unit, used for performing straight line fitting on the motion trajectory based on the trajectory points corresponding to the motion trajectory, to obtain a target fitting straight line corresponding to the motion trajectory;
[0064] A straight line determination unit, used to determine the bilateral tolerance straight lines of the target fitting straight line according to a preset tolerance threshold;
[0065] A behavior judgment unit is used to judge whether the avoidance behavior exists in the target behavior based on the motion trajectory and the bilateral tolerance line.
[0066] Optionally, the behavior judgment unit is used to: based on the bilateral tolerance straight line, identify inner points and outer points from the trajectory points corresponding to the motion trajectory, and calculate the ratio of the number of outer points to the number of trajectory points, the inner points are the trajectory points located within the bilateral tolerance straight line, and the outer points are the trajectory points located outside the bilateral tolerance straight line; when the ratio is greater than a preset ratio threshold, it is determined that the avoidance behavior exists in the target behavior; when the ratio is less than or equal to the preset ratio threshold, it is determined that the avoidance behavior does not exist in the target behavior.
[0067] Optionally, the image acquisition module includes:
[0068] An average value determination unit, used to respectively determine the average value of the starting corner points and the average value of the ending corner points of each optical flow vector in the target image of each frame;
[0069] The vector determination unit is used to obtain the target optical flow vector corresponding to each frame of the target image according to the average value of the starting corner points and the average value of the ending corner points.
[0070] Optionally, the device further comprises:
[0071] A first position determination module is used to determine the target corner point corresponding to the previous frame image and the first corner point position corresponding to each target corner point based on the previous frame image corresponding to any of the target images before respectively determining the starting corner point average value and the ending corner point average value of each optical flow vector in each frame of the target image;
[0072] A second position determination module, used to determine a second corner point position of each target corner point on any of the target images;
[0073] An optical flow vector determination module is used to determine the optical flow vector corresponding to any of the target images based on the first corner point position and the second corner point position.
[0074] Optionally, the device further comprises:
[0075] a target angle determination module, configured to calculate a target angle corresponding to each optical flow vector in any of the target images after determining the optical flow vector corresponding to any of the target images, wherein the target angle is an angle between the optical flow vector and a preset direction;
[0076] A filtering module is used to classify the optical flow vectors in any of the target images according to the target angle, determine a main angle, and filter the optical flow vectors in any of the target images based on the main angle.
[0077] Optionally, the trajectory determination module is used to: determine the starting point of the motion trajectory, and sequentially superimpose the target optical flow vectors corresponding to the target images in accordance with the sequence of the target images to obtain the motion trajectory of the target behavior.
[0078] It should be noted that for other corresponding descriptions of the functional units involved in the avoidance behavior detection device provided in the embodiment of the present application, reference can be made to Figures 1 to 7 The corresponding description in the method will not be repeated here.
[0079] Based on the above Figures 1 to 7 The method shown in the embodiment of the present application is accordingly provided with a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figures 1 to 7 The avoidance behavior detection method shown.
[0080] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0081] Based on the above Figures 1 to 7 The method shown, and Figure 8In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figures 1 to 7 The avoidance behavior detection method shown.
[0082] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0083] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0084] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. First, multiple frames of continuous images collected by the user through the client can be obtained. Then, the target optical flow vector corresponding to each target image in the multiple frames of continuous images is determined respectively. Here, the target image can be other images except the first frame image in the continuous multiple frames of images. After respectively determining the target optical flow vector corresponding to each frame of the target image, these target optical flow vectors can be superimposed to finally obtain the motion trajectory corresponding to the user's target behavior. After determining the motion trajectory corresponding to the target behavior, it can be further determined based on the motion trajectory whether there is deliberate avoidance behavior in the target behavior. The embodiment of the present application obtains the motion trajectory of the user's target behavior through the continuous multiple frames of images collected by the user, and then determines whether the user has avoidance behavior based on the motion trajectory. The judgment process is simpler and more convenient, and the judgment result can be obtained quickly and accurately.
[0086] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0087] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A method for detecting evasive behavior, characterized in that: include: Acquire the collected continuous multi-frame images, and determine the target optical flow vector corresponding to each frame of the target image, wherein the target image is an image other than the first frame of the continuous multi-frame images; Superimposing the target optical flow vectors corresponding to each frame of the target image to obtain a motion trajectory of the target behavior; Based on the trajectory points corresponding to the motion trajectory, a straight line fitting is performed on the motion trajectory to obtain a target fitting line corresponding to the motion trajectory; Determining the tolerance straight lines on both sides of the target fitting straight line according to a preset tolerance threshold; Based on the bilateral tolerance straight line, identifying inner points and outer points from the trajectory points corresponding to the motion trajectory, and calculating the ratio of the number of outer points to the number of trajectory points, the inner points being the trajectory points located within the bilateral tolerance straight line, and the outer points being the trajectory points located outside the bilateral tolerance straight line; When the ratio is greater than a preset ratio threshold, determining that the avoidance behavior exists in the target behavior; When the ratio is less than or equal to the preset ratio threshold, it is determined that the avoidance behavior does not exist in the target behavior.
2. The method according to claim 1, characterized in that The step of determining the target optical flow vector corresponding to each frame of the target image includes: Determine the average value of the starting corner points and the average value of the ending corner points of each optical flow vector in each frame of the target image respectively; The target optical flow vector corresponding to each frame of the target image is obtained according to the average value of the starting corner points and the average value of the ending corner points.
3. The method according to claim 2, characterized in that Before respectively determining the average value of the starting corner points and the average value of the ending corner points of each optical flow vector in each frame of the target image, the method further includes: Based on a previous frame image corresponding to any of the target images, determining a target corner point corresponding to the previous frame image and a first corner point position corresponding to each of the target corner points; Determine a second corner point position of each target corner point on any of the target images; The optical flow vector corresponding to any one of the target images is determined according to the first corner point position and the second corner point position.
4. The method according to claim 3, characterized in that After determining the optical flow vector corresponding to any of the target images, the method further includes: Calculate a target angle corresponding to each of the optical flow vectors in any of the target images, where the target angle is an angle between the optical flow vector and a preset direction; The optical flow vectors in any of the target images are classified according to the target angle, a main angle is determined, and the optical flow vectors in any of the target images are filtered based on the main angle.
5. The method according to claim 1, characterized in that The step of superimposing the target optical flow vectors corresponding to each frame of the target image to obtain a motion trajectory of the target behavior includes: The starting point of the motion trajectory is determined, and the target optical flow vectors corresponding to the target images are sequentially superimposed according to the sequence of the target images to obtain the motion trajectory of the target behavior.
6. A device for detecting avoidance behavior, characterized in that: include: An image acquisition module is used to acquire the collected continuous multi-frame images and determine the target optical flow vector corresponding to each frame of the target image, wherein the target image is an image other than the first frame of the continuous multi-frame images; A trajectory determination module, used for superimposing the target optical flow vector corresponding to each frame of the target image to obtain a motion trajectory of the target behavior; A straight line fitting unit, used for performing straight line fitting on the motion trajectory based on the trajectory points corresponding to the motion trajectory, to obtain a target fitting straight line corresponding to the motion trajectory; A straight line determination unit, used to determine the bilateral tolerance straight lines of the target fitting straight line according to a preset tolerance threshold; a behavior judgment unit, configured to identify inner points and outer points from the trajectory points corresponding to the motion trajectory based on the bilateral tolerance straight line, and calculate a ratio of the number of outer points to the number of trajectory points, wherein the inner points are the trajectory points located within the bilateral tolerance straight line, and the outer points are the trajectory points located outside the bilateral tolerance straight line; when the ratio is greater than a preset ratio threshold, it is determined that the avoidance behavior exists in the target behavior; When the ratio is less than or equal to the preset ratio threshold, it is determined that the avoidance behavior does not exist in the target behavior.
7. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Dynamic tracking system and method for behaviors of object in video based on behavior moving line model
CN110956647A
Pedestrian abnormal behavior detection method, image processing device and storage device
CN113408352A