Behavior monitoring method, behavior monitoring device and storage medium
Computer vision and image recognition technology is used to identify and group target objects in public place monitoring areas, and calculate confidence to determine behavior. This solves the problem of insufficient accuracy and reliability of behavior monitoring in complex environments in the existing technology and achieves high accuracy. behavior monitoring with low false positive rate.
Patent Information
- Application Number
- CN202310771808.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2024-09-20
AI Technical Summary
Existing technologies are not very accurate and reliable in monitoring behavior in public places in complex environments. In particular, the monitoring of smoking behavior has a high misjudgment rate.
Obtain images of the monitored area through computer vision and image recognition technology, identify target objects and calculate the distance between them, group and calculate confidence, determine behavior based on confidence and preset confidence thresholds, and reduce misjudgments.
It improves the accuracy and reliability of behavior monitoring, is suitable for complex environments, and significantly reduces the misjudgment rate.
Smart Images

Figure CN118675094A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a behavior monitoring method, a behavior monitoring device and a computer-readable storage medium. Background Art
[0002] In daily life, uncivilized behavior often occurs in some areas. With the development of science and technology, intelligent and automated monitoring of people's behavior in some areas is carried out to assist relevant personnel in supervising bad behavior.
[0003] At present, the accuracy and reliability of monitoring technology for some behaviors in public places, such as smoking, are not very high in complex environments and need to be further improved. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the first aspect of the present invention proposes a behavior monitoring method, which can accurately monitor the behavior of the monitored object, significantly reduce the misjudgment rate, improve the accuracy and reliability of behavior monitoring, and is applicable to various complex environments with high adaptability and accuracy.
[0005] A second aspect of the present invention provides a behavior monitoring device.
[0006] A third aspect of the present invention provides a computer-readable storage medium.
[0007] In order to solve the above problems, the behavior monitoring method of the first aspect of the embodiment of the present invention includes: acquiring an image of a monitoring area; identifying the image to identify a target object; obtaining the distance between each of the identified target objects; grouping according to the distance and calculating the confidence of each grouping; determining the behavior of the monitored object based on the relationship between the confidence and a preset confidence threshold.
[0008] According to the behavior monitoring method of the embodiment of the present invention, the image is identified through computer vision and image recognition technology, and the target objects related to the behavior in the image are determined. By calculating the distance between each target object, effective grouping can be performed, and the confidence of each group is calculated. The confidence reflects the possibility that the group conforms to the behavior of the monitored object. The behavior of the monitored object is determined according to the relationship between the confidence and the preset confidence threshold. That is, based on the data comparison between the confidence and the preset confidence threshold, it can be judged whether the behavior of the monitored object occurs or not, thereby improving the accuracy and reliability of behavior monitoring and reducing the misjudgment rate.
[0009] In some embodiments, before grouping according to the distance, the behavior monitoring method also includes: calculating an initial confidence of each of the targets; determining suspected targets whose initial confidence is less than the first confidence; and removing the suspected targets from all the targets present in the monitoring area.
[0010] In some embodiments, the confidence of each of the groups is calculated, including: obtaining the relative position information and relative distance information of the target object in the target group; calculating the comprehensive confidence of the fit between the distance and the position based on the relative position information and the relative distance information; if the comprehensive confidence reaches a second confidence, judging whether the change of the target object in the target group satisfies the monitoring object confidence behavior; if it satisfies the monitoring object behavior, increasing the comprehensive confidence of the target group, and using the increased comprehensive confidence as the final confidence of the target group.
[0011] In some embodiments, calculating the confidence of each of the groups also includes: if the comprehensive confidence is less than the second confidence, obtaining a target replacement target that is closest to the target object in the target group, and replacing the target objects in the target group with the target replacement targets in sequence according to the initial confidence, wherein a comprehensive confidence calculation is performed for each replacement of a target object in the target group; if the comprehensive confidence of the target group is still less than the second confidence, removing the target group.
[0012] In some embodiments, the target object includes a smoke area, a cigarette butt area, and a smoking posture area, and the distance between each of the identified target objects is obtained; grouping according to the distance includes: obtaining a first distance between each of the smoke areas and each of the cigarette butt areas, and obtaining a second distance between each of the smoke areas and each of the smoking posture areas; grouping the smoke areas, the cigarette butt areas, and the smoking posture areas according to the first distance and the second distance, wherein each of the groups includes one each of the smoke area, the cigarette butt area, and the smoking posture area.
[0013] In some embodiments, a comprehensive confidence of the degree of fit between distance and position is calculated based on the relative position information and the relative distance information, including: obtaining the triangular area where the smoke area, the cigarette butt area and the smoking posture area in the target group are located based on the relative position information and the relative distance information; obtaining the inscribed circle of the triangular area; and obtaining the comprehensive confidence based on the radius or diameter of the inscribed circle, wherein the larger the radius or diameter of the inscribed circle, the higher the comprehensive confidence.
[0014] In some embodiments, the behavior of the monitored object is determined based on the relationship between the confidence and a preset confidence threshold, including: if the confidence is greater than the preset confidence threshold, determining that the group whose confidence is greater than the preset confidence threshold corresponds to a location in the monitoring area where smoking behavior exists.
[0015] In some embodiments, determining whether the change of the target object in the target group satisfies the confidence behavior of the monitored object includes: determining whether the change of the smoke area, the cigarette butt area and the smoking posture area in the target group satisfies any of the following: within a preset time, the smoke area in the target group continues to exist; identifying the face sub-area contained in the smoking posture area in the target group, and obtaining the relative distance value between the cigarette butt area and the face sub-area, and within the preset time, the change in the relative distance value is greater than the distance change threshold; within the preset time, there is an area overlap between the cigarette butt area and the face sub-area; within the preset time, the smoke area moves next to the cigarette butt area.
[0016] In order to solve the above problems, the behavior monitoring device of the second embodiment of the present invention includes: at least one processor; a memory communicatively connected to the at least one processor; the memory stores a computer program executable by the at least one processor, and the at least one processor implements the behavior monitoring method described in the above embodiment when executing the computer program.
[0017] According to the behavior monitoring device of the embodiment of the present invention, the processor is communicatively connected to the memory. The processor implements the behavior monitoring method described in the above embodiment by executing the computer program in the memory. The image is identified by computer vision and image recognition technology, and the target objects related to the behavior in the image are determined. By calculating the distance between each target object, effective grouping can be performed, and the confidence of each grouping can be calculated. The behavior of the monitored object is determined based on the relationship between the confidence and the preset confidence threshold. That is, based on the data comparison between the confidence and the preset confidence threshold, it can be determined whether the behavior of the monitored object occurs, thereby improving the accuracy and reliability of behavior monitoring and reducing the misjudgment rate.
[0018] In order to solve the above problems, a computer-readable storage medium of an embodiment of the third aspect of the present invention stores a computer program thereon, and is characterized in that when the computer program is executed by a processor, the behavior monitoring method described in the above embodiment is implemented.
[0019] The behavior monitoring method, behavior monitoring device, camera and storage medium provided in the embodiments of the present invention recognize the image collected by the acquisition module to identify all the target objects in the image and calculate the distance between them. The image processing module groups each target object according to the distance, and calculates the confidence of each group. The confidence reflects the possibility that the group conforms to the behavior of the monitored object. The behavior of the monitored object is determined according to the relationship between the confidence and the preset confidence threshold. That is, based on the data comparison between the confidence and the preset confidence threshold, it can be judged whether the behavior of the monitored object occurs, thereby improving the accuracy and reliability of behavior monitoring and reducing the misjudgment rate.
[0020] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0022] Figure 1 is a schematic diagram of a behavior monitoring system according to an embodiment of the present invention;
[0023] Figure 2 is a flow chart of a behavior monitoring method according to an embodiment of the present invention;
[0024] Figure 3 is an overall flow chart of a behavior monitoring method according to an embodiment of the present invention applied to smoking behavior monitoring;
[0025] Figure 4 is a block diagram of a behavior monitoring device according to an embodiment of the present invention.
[0026] Reference numerals:
[0027] Behavior monitoring system 100;
[0028] Electronic device 1; Server 2;
[0029] Behavior monitoring device 110;
[0030] Processor 111; memory 112. DETAILED DESCRIPTION
[0031] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.
[0032] The behavior monitoring method provided by the present invention can be applied to Figure 1In the application environment shown. The behavior monitoring method is applied to a behavior monitoring system 100. The behavior monitoring system 100 includes an electronic device 1 and a server 2, wherein the electronic device 1 and the server 2 communicate through a network. The target objects in the monitoring image are identified by image recognition technology, and the distance between them is calculated. Each target object is effectively grouped according to the distance, and the relationship between the confidence and the preset confidence threshold is used to determine whether the behavior of the monitored object exists, thereby improving the accuracy and reliability of behavior monitoring. Among them, the electronic device 1 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, etc., and the server 2 can be implemented with an independent server 2 or a server cluster composed of multiple servers 2.
[0033] Reference below Figure 2-Figure 3 A behavior monitoring method according to an embodiment of the present invention is described.
[0034] Figure 2 is a flow chart of a behavior monitoring method according to an embodiment of the present invention. Figure 2 As shown, a behavior monitoring method is provided. The embodiment of the present invention uses the method applied to an electronic device as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including an electronic device and a server, and is implemented through the interaction between the electronic device and the server. In the embodiment of the present invention, the method at least includes the following steps S1-S5.
[0035] S1, obtain the image of the monitoring area.
[0036] In an embodiment of the present invention, a camera can be used to obtain images of a monitoring area. The camera can be connected to a monitoring device, such as a computer, an NVR (Network Video Recorder), a DVR (Digital Video Recorder), etc., or connected to a cloud server for storage and processing.
[0037] Specifically, the camera is installed at an appropriate location in the monitoring area to ensure that it can capture images of the entire or part of the monitoring area. When the camera is started, it will capture images of the monitoring area in real time or periodically and transmit them to the monitoring device, or store them on a local or remote server for subsequent analysis and processing.
[0038] S2, recognize the image to identify the target object.
[0039] In some embodiments, computer vision and image recognition techniques may be used to process and analyze images to identify objects therein. By applying image processing algorithms and pattern recognition techniques, objects relevant to behavior monitoring may be automatically identified.
[0040] Specifically, first, the acquired monitoring image is preprocessed to improve the effect of subsequent processing and analysis. The preprocessing step may include image denoising, contrast enhancement, brightness adjustment and color balance, etc. By using an object detection algorithm, such as a target detection algorithm based on deep learning (such as Faster R-CNN, YOLO, etc.), the image is scanned and analyzed to determine the target objects present therein. These targets may include smoke areas, cigarette butt areas, and smoking posture areas. For each detected target, a feature extraction algorithm or a feature extraction network in deep learning (such as CNN) is used to extract its representative feature vector. The extracted feature vector is input into the target classifier, and the target is classified and identified through the trained classification model. The classifier can be a traditional machine learning algorithm (such as a support vector machine, a random forest) or a convolutional neural network (CNN) in deep learning, etc. For correctly classified targets, the position and outline of the target in the image can be accurately located by techniques such as bounding boxes or pixel-level segmentation.
[0041] Through the above steps, computer vision and image recognition technology are used to process and analyze images, and the targets in the images can be accurately identified. The recognition results of these targets will be used as input for subsequent steps for distance calculation, grouping and confidence calculation, thereby realizing the monitoring and judgment of behavior.
[0042] In the embodiments of the present invention, the behavior monitoring method can be applied to multiple application scenarios, such as monitoring illegal behavior in a specific area or monitoring uncivilized behavior in a public place. Specifically, for example, it can include but is not limited to monitoring smoking behavior, monitoring theft behavior, monitoring fighting behavior, etc.
[0043] Taking smoking behavior monitoring as an example, the target objects may include smoke areas, cigarette butt areas, and smoking posture areas. By recognizing the image, all smoke areas, cigarette butt areas, and smoking posture areas in the image can be predicted. Among them, different image processing methods can be used to recognize the image, such as deep learning models and image segmentation. These methods can be used to identify specific areas such as smoke areas, cigarette butt areas, and smoking posture areas.
[0044] In some embodiments, for the recognition of cigarette butt areas, the YOLO v5 model can be used to detect cigarette butts in images. The YOLO v5 model is a single-stage target detection algorithm based on deep learning. It can learn the appearance of cigarette butts by training a large number of data sets, thereby realizing the recognition of cigarette butt areas in images. Specifically, the model divides the input image into multiple grids and generates a prediction box for each grid to detect whether there are cigarette butts in it. During training, a series of image data sets marked with cigarette butt areas are provided as training sets, and the network parameters are optimized through repeated iterations so that it can accurately identify cigarette butt areas. When in use, the model can input an image of the monitored area and output a detection result containing the location information of the cigarette butt area.
[0045] In some embodiments, for the identification of smoke areas, the two-frame image difference method in image segmentation, i.e., the adjacent two-frame image difference method, can be used to detect smoke areas. The basic principle is to perform a difference operation on two adjacent frames of images to obtain the difference value of the image. If the difference value exceeds the set threshold, it means that there is an object moving at the pixel point, i.e., smoke movement. This method will not detect non-moving objects, but only detects moving objects, so that the interference of objects suspected of being smoke can be eliminated.
[0046] In some embodiments, for the identification of the smoking posture area, a detection method for detecting the positional relationship between the face, cigarette butts, and hands can be used. Through deep learning training, the distance and positional relationship between the face, cigarette butts, and hands during smoking can be determined, thereby determining whether it is a smoking action.
[0047] Through the comprehensive application of these methods, it is possible to predict and identify all smoke areas, cigarette butt areas and smoking posture areas in the image, and realize automatic detection and monitoring of smoking behavior.
[0048] S3, obtaining the distance between each identified target object.
[0049] In some embodiments, through the object recognition and positioning in the previous step, the position information of each object in the image can be obtained, such as the coordinates of the rectangular bounding box or the pixel-level segmentation result of the object. If the image is a two-dimensional plane image, it is necessary to convert the pixel scale to the actual scale in order to calculate the distance between the objects in the real world. This requires knowing the scale calibration in the image or calibrating through external reference information.
[0050] Specifically, according to the location information and scale conversion of the target objects, a variety of methods can be used to calculate the distance between the target objects, such as Euclidean distance, Manhattan distance or other geometric distance measurement methods. The specific distance calculation method selected depends on the needs and scenarios of the actual application. Through the distance calculation method, the distance values between the target objects can be obtained. These distance values can be expressed in pixel units or length units in the real world (such as centimeters or meters), depending on the accuracy of the scale conversion and the needs of the application.
[0051] In some embodiments, if the image is a video rather than a single two-dimensional picture, similar methods as described above can be applied to obtain the distance between the objects.
[0052] Specifically, first, a series of continuous image frames can be obtained from a video. The video can be acquired in real time or pre-recorded. For each video frame, computer vision and image recognition techniques can be applied to identify the target object. This may involve methods such as target detection, target tracking, or target segmentation to locate and extract the position information of the target object in each video frame. In a video, the position of the target object may change between consecutive frames. Through the target tracking algorithm, the target object can be tracked between different frames to obtain the continuity of the target object in the time dimension. Similar to the case of processing a single image, the position information of the target object in each video frame can be used to calculate the distance between the targets. This can be achieved by analyzing the motion trajectory of the target object in a time series or by comparing and measuring the position information of multiple frames.
[0053] In some embodiments, for smoking behavior monitoring, a first distance between each smoke area and each cigarette butt area can be obtained, and a second distance between each smoke area and each smoking posture area can be obtained.
[0054] The first distance between the smoke area and the cigarette butt area and the second distance between the smoke area and the smoking posture area are obtained in order to more accurately determine whether smoking behavior has occurred. After the smoke area, the cigarette butt area, and the smoking posture area are identified, if the distances between these areas are close, it is likely that smoking behavior has occurred. Therefore, by calculating the distances between these areas, the accuracy of smoking behavior recognition can be further improved.
[0055] In some embodiments, basic geometric calculation methods can be used to calculate the distance. For example, the coordinate information of the smoke area, cigarette butt area and smoking posture area in the image can be used to calculate the Euclidean distance or Manhattan distance or other distance measurement methods to obtain the distance between them.
[0056] S4, grouping according to distance and calculating the confidence of each group.
[0057] Specifically, based on the distance information between the targets, they can be grouped. The specific grouping strategy can be designed according to the actual needs and the characteristics of the monitored object behavior. In each group, the confidence can be calculated to evaluate the possibility of whether the group meets the target behavior. The confidence can be calculated based on multiple factors, such as distance, the number of targets in the group, the relative position between the targets, etc. The specific confidence calculation method can be designed and adjusted according to the actual needs and application scenarios.
[0058] In some embodiments, for smoking behavior monitoring, the smoke area, cigarette butt area and smoking posture area can be grouped according to the first distance between each smoke area and each cigarette butt area and the second distance between each smoke area and each smoking posture area, and each group includes one smoke area, one cigarette butt area and one smoking posture area.
[0059] Specifically, by comparing the first distance between each smoke area and each cigarette butt area, the shortest distance between them is found, and this distance is used to determine which smoke areas and cigarette butt areas belong to the same smoking behavior. Similarly, by comparing the second distance between each smoke area and each smoking posture area, the shortest distance between them is found, and this distance is used to determine which smoke areas and smoking posture areas belong to the same smoking behavior. In this way, each smoking behavior will be assigned to a group, and each group contains a smoke area, a cigarette butt area, and a smoking posture area.
[0060] In some embodiments, the confidence level may refer to the probability or reliability of a group in the smoking monitoring behavior containing smoke, cigarette butts, and smoking posture areas. When calculating the confidence level, multiple factors may be combined for evaluation, such as the recognition accuracy of smoke and cigarette butts, the recognition accuracy of smoking postures, the accuracy of distance measurement, etc. Specifically, the higher the confidence level, the greater the possibility that the group is recognized as a valid smoking behavior.
[0061] S5, determining the behavior of the monitored object according to the relationship between the confidence level and a preset confidence threshold.
[0062] The preset confidence threshold is set according to the actual application scenario and requirements. Generally, the higher the threshold, the more accurate the monitoring result is required, but some real behaviors of the monitored objects may be missed; the lower the threshold, the more behaviors of the monitored objects can be monitored, but there may be a certain false positive rate. Therefore, it needs to be set according to the specific situation in actual application.
[0063] Specifically, by comparing the confidence of each group with the preset confidence threshold, it can be determined whether the behavior of the monitored object occurs. The specific judgment method can be determined according to actual needs. For example, if the confidence is greater than the preset confidence threshold, it can be determined that the target behavior corresponding to the group occurs. If the confidence is less than or equal to the preset confidence threshold, it can be determined that the target behavior corresponding to the group does not occur. Based on the above judgment, the behavior monitoring results of the monitored object can be obtained. These results can be used for subsequent processing such as recording, alarming, and statistical analysis.
[0064] According to the behavior monitoring method of the embodiment of the present invention, the image is identified through computer vision and image recognition technology, and the target objects related to the behavior in the image are determined. By calculating the distance between each target object, effective grouping can be performed, and the confidence of each group is calculated. The confidence reflects the possibility that the group conforms to the behavior of the monitored object. The behavior of the monitored object is determined according to the relationship between the confidence and the preset confidence threshold. That is, based on the data comparison between the confidence and the preset confidence threshold, it can be judged whether the behavior of the monitored object occurs or not, thereby improving the accuracy and reliability of behavior monitoring and reducing the misjudgment rate.
[0065] In some embodiments, during the image recognition stage, for each identified target object, its initial confidence can be calculated based on some features, attributes or pre-set rules. This initial confidence can represent the degree or credibility of the target object being correctly identified. By comparing the initial confidence with the set first confidence threshold, it can be determined which targets have a lower initial confidence and are less than the first confidence, i.e., suspected targets. These suspected targets may be identified incorrectly, have ambiguity or noise, or have large differences from the expected targets. Remove the suspected targets from all targets present in the monitoring area. The purpose of this is to reduce possible interference factors and improve the accuracy of subsequent grouping and confidence calculations.
[0066] In some embodiments, before grouping, it is necessary to obtain the relative position and relative distance information between each target in the target grouping. This can be achieved by calculating the geometric relationship or distance measurement between the targets. For example, the Euclidean distance between the targets or other distance measurement methods can be used to represent the distance between them. By comprehensively considering the relative position and relative distance information between the targets, the confidence of each grouping can be calculated. This can be achieved by adopting a suitable algorithm or evaluation criterion. For example, the confidence can be calculated based on factors such as the distance difference between the targets, the position offset or the matching degree of geometric features.
[0067] If the comprehensive confidence reaches the second confidence, it is determined whether the changes in the target objects in the target group meet the confidence behavior of the monitored object. If the changes in the target objects in the target group meet the confidence behavior of the monitored object. This means that the relative position and relative distance between the targets are consistent with the expected behavior pattern, which may indicate a specific action or relationship between the targets. The comprehensive confidence of the target group can be increased, which can be achieved by weighting or accumulation. The specific method depends on the design requirements. The increased comprehensive confidence can be used as the final confidence of the target group for further behavior analysis or decision-making.
[0068] In some embodiments, in the application of smoking behavior monitoring, before the smoke area, cigarette butt area and smoking posture area are grouped according to the first distance and the second distance, the initial confidence of each smoke area, each cigarette butt area and each smoking posture area needs to be calculated for subsequent processing. These confidences can be calculated based on some features and rules, such as the size and color of the smoke area, the shape and texture of the cigarette butt area, the position and posture of the smoking posture area, etc.
[0069] Further, it is necessary to determine the suspected smoke area, the suspected cigarette butt area and the suspected smoking posture area whose initial confidence is less than the first confidence. In an embodiment, the first confidence can be set to 0.7.
[0070] Specifically, when the initial confidence is less than 0.7, it means that the initial confidence of these areas is low. Areas with initial confidence less than this value can be regarded as suspicious areas. These suspicious areas may not have real smoking behavior. Therefore, the suspicious smoke areas can be removed from all smoke areas in the monitoring area, the suspicious cigarette butt areas can be removed from all cigarette butt areas in the monitoring area, and the suspicious smoking posture areas can be removed from all smoking posture areas in the monitoring area. In this way, those unreliable areas can be excluded for subsequent processing.
[0071] Therefore, after removing the doubtful areas in the smoke area, cigarette butt area and smoking posture area, the remaining smoke area, cigarette butt area and smoking posture area can be grouped according to the first distance and the second distance, and the confidence is calculated for each group.
[0072] The confidence of each group is calculated, including: in the target group, the relative position information between the smoke area, the cigarette butt area and the smoking posture area can be used to obtain their relative position relationship in the monitoring area, such as whether they are on the same straight line, on the same plane, etc. At the same time, the relative distance information between the smoke area and the cigarette butt area and the smoking posture area can be used to obtain the distance relationship between them.
[0073] Furthermore, based on the relative position information and relative distance information, the comprehensive confidence of the distance and position fit of the smoke area, cigarette butt area and smoking posture area in the target group can be calculated. The higher the comprehensive confidence, the more the position and distance relationship of each element in the target group conforms to the characteristics of smoking behavior.
[0074] Specifically, to calculate the comprehensive confidence of the fit of the distance and position of the smoke area, cigarette butt area and smoking posture area in the target group, it is first necessary to obtain the triangular area where the smoke area, cigarette butt area and smoking posture area in the target group are located based on the relative position information and relative distance information. The shape and size of the triangular area reflect the relationship and position distribution between these areas. After determining the shape and size of the triangular area, the inscribed circle of this triangular area can be calculated. The comprehensive confidence is obtained according to the radius or diameter of the inscribed circle, wherein the larger the radius or diameter of the inscribed circle, the higher the comprehensive confidence. It means that the more concentrated the spatial distribution of the smoke area, cigarette butt area and smoking posture area in the target group is, the higher the fit between them is, which indicates that the possibility of smoking behavior is greater.
[0075] Further, if the comprehensive confidence of the target group reaches a preset second confidence, it is determined whether the changes in the smoke area, cigarette butt area, and smoking posture area in the target group meet the smoking confidence behavior. In an embodiment, the second confidence can be set to 0.8.
[0076] Among them, to determine whether the changes in the smoke area, cigarette butt area, and smoking posture area in the target group meet the smoking confidence behavior, it is first necessary to determine whether the changes in the smoke area, cigarette butt area, and smoking posture area meet any of the following conditions:
[0077] First, if the smoke area in the target group continues to exist within the preset time, it can be determined that there is smoking confidence behavior.
[0078] Second, identify the face sub-area contained in the smoking posture area in the target group, and obtain the relative distance value between the cigarette butt area and the face sub-area. If the change in the relative distance value is greater than the distance change threshold within a preset time, it can be determined that there is smoking confidence behavior.
[0079] Third, if there is an area overlap between the cigarette butt area and the face sub-area within the preset time, it can be judged that there is smoking confidence behavior.
[0080] Fourth, within the preset time, the smoke area moves next to the cigarette butt area: it can be judged that there is smoking confidence behavior.
[0081] If any of the above smoking confidence behaviors is met, the comprehensive confidence of the target group can be increased, and the increased comprehensive confidence can be used as the final confidence of the target group, which can further confirm the existence of smoking behavior in the target group, thereby improving the accuracy of judging smoking behavior.
[0082] In some embodiments, calculating the confidence of each group further includes: if the comprehensive confidence is less than the second confidence, obtaining a target replacement target that is closest to the target in the target group, which can be achieved by calculating the distance between the targets and finding the target with the minimum distance. The targets in the target group are replaced with the target replacement targets in sequence according to the initial confidence, wherein the comprehensive confidence calculation is performed for each replacement of a target in the target group. This means that the confidence of the target group can be re-evaluated with the new configuration after the target is replaced with the target, so as to more accurately determine whether the confidence behavior of the monitored object is met.
[0083] If after replacement and recalculation of the comprehensive confidence, the comprehensive confidence of the target group is still less than the second confidence, then it can be considered that the target group cannot meet the confidence behavior of the monitored object. In this case, the target group will be removed and will not be considered as a valid behavior.
[0084] Specifically, in the application of smoking behavior monitoring, if the comprehensive confidence is less than the second confidence, the target replacement smoke area closest to the smoke area in the target group is obtained, the target replacement cigarette butt area closest to the cigarette butt area in the target group is obtained, and the target replacement smoking posture area closest to the smoking posture area in the target group is obtained. The smoke area, cigarette butt area, and smoking posture area in the target group are replaced with the target replacement smoke area, target replacement cigarette butt area, and target replacement smoking posture area in turn according to the initial confidence, wherein the comprehensive confidence calculation is performed for each replacement area in the target group.
[0085] Therefore, by finding the targets closest to the smoke area, cigarette butt area and smoking posture area in the target grouping, and replacing them with the target replacement smoke area, target replacement cigarette butt area and target replacement smoking posture area in turn, the comprehensive confidence of the target grouping can be improved.
[0086] Furthermore, if after replacing the target group, its comprehensive confidence is still less than the second confidence, it means that the confidence of the target group is not enough to support further analysis and processing of the area it contains, and the possibility of smoking behavior in this area is low. Therefore, it is necessary to remove the target group, which can improve the efficiency of subsequent processing and avoid wasting time and resources on less reliable target groups.
[0087] In some embodiments, the behavior monitoring method further includes: sending the location information of the monitoring area where the behavior of the monitored object is determined to exist and the behavior information of the monitored object to the monitoring platform and the warning status for prompting and warning. The purpose of this step is to convey the results of the behavior monitoring to relevant personnel or systems so that they can take appropriate actions in a timely manner.
[0088] Among them, location information can indicate the specific area or device where the behavior occurs, while behavior information describes the specific behavior performed by the monitored object. This information can be transmitted to the monitoring platform or warning state through the network or other communication methods. Specifically, once the monitoring platform or warning state receives this information, they can take corresponding measures. For example, the monitoring platform can display alarm information or generate a report so that the operator can understand the behavioral event that occurred. The warning state can trigger an audible alarm, flashing light source or other warning means to attract attention and alert relevant personnel.
[0089] In addition, information can be sent to mobile devices or smartphone applications so that users can monitor and receive alert information at any time. Information can also be integrated with other systems to automatically trigger appropriate safety measures or emergency responses. By sending location information and monitored object behavior information to the monitoring platform and warning status, behavioral monitoring methods can achieve timely alerts and prompts so that appropriate measures can be taken quickly. This helps improve safety and monitoring effectiveness, and enables relevant personnel to respond quickly to protect property and ensure public safety.
[0090] Specifically, in the application of smoking behavior monitoring, the target group that meets the smoking confidence behavior is finally confirmed, and the location information of the monitoring area where smoking behavior is determined to exist and the smoking behavior information are sent to the monitoring platform and the warning status for prompts and warnings. Specifically, the prompts and warnings can be in the form of text prompts, voice prompts, alarm signal prompts, and manual dissuasion by supervisors, etc.
[0091] Figure 3 FIG. 1 is a general flow chart of a behavior monitoring method according to an embodiment of the present invention applied to smoking behavior monitoring. Figure 3 As shown, the behavior monitoring method at least includes the following steps S10-S25.
[0092] S10, turn on the surveillance camera and scan the surveillance area.
[0093] S11, uses the detection algorithms of smoke, cigarette butts and smoking posture to perform fuzzy calculation on the area.
[0094] S12, all areas suspected of having cigarette butts, smoke, and smoking postures in the area are marked with different highlight frames.
[0095] S13, classify the three types of highlight boxes, and calculate and count the confidence of each box.
[0096] S14, determine whether the confidence of each box is greater than 0.7. If it is greater than 0.7, proceed to step S15. If it is not greater than 0.7, eliminate it directly.
[0097] S15, group the remaining frames according to the distance positions, and each group includes one frame of each of the three types.
[0098] S16, analyzing the positional relationship of the three boxes in each group, and comprehensively scoring the confidence of each group.
[0099] S17, determine whether the comprehensive confidence of each group is not less than 0.8, if not less than 0.8, proceed to step S18, if less than 0.8, proceed to step S19.
[0100] S18, for the group whose comprehensive confidence reached 0.8, a 10-second sustained focus test was performed, during which smoking confidence behavior analysis and confidence increase were performed.
[0101] S19, for groups with a comprehensive confidence less than 0.8, the system replaces the three boxes with boxes of nearby groups in turn.
[0102] S20, determine whether the number of replacements is greater than 3 times, if so, eliminate it directly, if not, return to step S17.
[0103] S21, determine whether the confidence is greater than the preset confidence threshold 0.9, if it is greater than 0.9, enter step S20, if not greater than 0.9, directly eliminate and end.
[0104] S22, performing final confirmation on the group with a confidence level greater than 0.9, and obtaining its location information and face information under monitoring.
[0105] S23, calling the loudspeaker to broadcast suspected smoking behavior in the area of corresponding location information and issuing a warning to discourage smoking.
[0106] S24, after checking the location information and facial information, the supervisor dissuades the smoker.
[0107] S25, end.
[0108] In general, through image recognition technology, the smoke area, cigarette butt area and smoking posture area in the monitoring area can be predicted, and they can be grouped according to the distance between them. The confidence level is used to determine whether smoking behavior exists. If the confidence level of a group is higher than the preset confidence threshold, it is determined that the group has smoking behavior, and the location information and smoking behavior information of the monitoring area where it is located are sent to the monitoring platform and warning status for prompts and warnings. This enables accurate monitoring and management of smoking behavior, reduces the misjudgment rate, and is applicable to various complex environments with high adaptability and accuracy.
[0109] The second embodiment of the present invention further provides a behavior monitoring device.
[0110] Figure 4 is a block diagram of a behavior monitoring device according to an embodiment of the present invention. Figure 4 As shown, the behavior monitoring device 110 according to the embodiment of the present invention includes at least one processor 11 and a memory 12 .
[0111] The memory 12 is communicatively connected to at least one processor 11, and the memory 11 stores a computer program that can be executed by at least one processor 12. When at least one processor 11 executes the computer program, the behavior monitoring method of the above embodiment can be implemented.
[0112] In some embodiments, the behavior monitoring device 110 may include a camera. A camera is a commonly used device for collecting images or videos of a monitored area. It can capture behaviors occurring in the monitored area and provide image or video data for behavior monitoring. By using computer vision and image processing technology, the images or videos captured by the camera are analyzed and identified to detect and monitor specific behaviors or events. The camera can capture the location, movement, and other relevant information of the target object, thereby enabling monitoring and analysis of the behavior.
[0113] In some embodiments, the selection and placement of cameras is very important for the accuracy and reliability of behavior monitoring. The position and angle of the camera should be able to cover the monitoring area to the greatest extent and avoid blind spots and overlapping areas. The performance parameters of the camera, such as pixels, sensitivity, frame rate, and field of view, will also affect the image quality and the effect of behavior monitoring.
[0114] According to the behavior monitoring device 110 of the embodiment of the present invention, the processor 11 is communicatively connected with the memory 12. The processor 11 implements the behavior monitoring method described in the above embodiment by executing the computer program in the memory 12. The image is recognized by computer vision and image recognition technology, and the target objects related to the behavior in the image are determined. By calculating the distance between each target object, effective grouping can be performed, and the confidence of each grouping can be calculated. The behavior of the monitored object is determined according to the relationship between the confidence and the preset confidence threshold. That is, based on the data comparison between the confidence and the preset confidence threshold, it can be determined whether the behavior of the monitored object occurs, thereby improving the accuracy and reliability of behavior monitoring and reducing the misjudgment rate.
[0115] The third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by the processor 11, the behavior monitoring method of the above embodiment can be implemented, thereby improving the accuracy and reliability of behavior monitoring and reducing the misjudgment rate.
[0116] In an embodiment, the computer readable storage medium may include at least one of a non-volatile and a volatile memory. The non-volatile memory may include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, or an optical memory. The volatile memory may include a random access memory (RAM) or an external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).
[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0118] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A behavior monitoring method, characterized in that: include: Acquire images of the monitored area; Recognize the image to identify the target object; Obtaining the distance between each of the identified targets; Grouping according to the distance, and calculating the confidence of each grouping; The behavior of the monitored object is determined according to the relationship between the confidence and a preset confidence threshold.
2. The behavior monitoring method according to claim 1, characterized in that: Before grouping according to the distance, the behavior monitoring method further includes: Calculating an initial confidence level for each target object; Determining a suspected target object whose initial confidence level is less than a first confidence level; The suspected target object is removed from all the targets existing in the monitoring area.
3. The behavior monitoring method according to claim 2, characterized in that: Calculating the confidence of each of the groups, including: Obtaining relative position information and relative distance information of the targets in the target group; Calculating a comprehensive confidence level of the fit between the distance and the position based on the relative position information and the relative distance information; If the comprehensive confidence reaches the second confidence, determining whether the change of the target object in the target group satisfies the monitoring object confidence behavior; If the monitoring object confidence behavior is satisfied, the comprehensive confidence of the target group is increased, and the increased comprehensive confidence is used as the final confidence of the target group.
4. The behavior monitoring method according to claim 3, characterized in that: Calculating the confidence of each of the groups further includes: If the comprehensive confidence is less than the second confidence, obtaining a target closest to the target in the target group to replace the target; The target objects in the target group are replaced with the target replacement target objects in sequence according to the initial confidence, wherein a comprehensive confidence calculation is performed for each replacement of a target object in the target group; If the comprehensive confidence of the target group is still less than the second confidence, the target group is removed.
5. The behavior monitoring method according to claim 3, characterized in that: The target objects include a smoke area, a cigarette butt area and a smoking posture area, and the distance between each of the identified target objects is obtained; The groups are grouped according to the distance, including: Obtaining a first distance between each of the smoke areas and each of the cigarette butt areas, and obtaining a second distance between each of the smoke areas and each of the smoking posture areas; The smoke area, the cigarette butt area, and the smoking posture area are grouped according to the first distance and the second distance, wherein each of the groups includes one smoke area, one cigarette butt area, and one smoking posture area.
6. The behavior monitoring method according to claim 5, characterized in that: Calculating the comprehensive confidence of the fit between the distance and the position according to the relative position information and the relative distance information, including: Obtaining the triangular area where the smoke area, the cigarette butt area and the smoking posture area in the target group are located according to the relative position information and the relative distance information; Obtaining an inscribed circle of the triangular area; The comprehensive confidence is obtained according to the radius or diameter of the inscribed circle, wherein the larger the radius or diameter of the inscribed circle is, the higher the comprehensive confidence is.
7. The behavior monitoring method according to claim 6, characterized in that: Determining the behavior of the monitored object according to the relationship between the confidence and a preset confidence threshold includes: If the confidence is greater than the preset confidence threshold, it is determined that there is smoking behavior at the location in the monitoring area corresponding to the group whose confidence is greater than the preset confidence threshold.
8. The behavior monitoring method according to claim 5, characterized in that: Determining whether the change of the target object in the target group satisfies the monitoring object confidence behavior includes: Determine whether the changes of the smoke area, the cigarette butt area, and the smoking posture area in the target group satisfy any of the following: The smoke area in the target group continues to exist within a preset time; Identify the face sub-region included in the smoking posture region in the target group, obtain the relative distance value between the cigarette butt region and the face sub-region, and within the preset time, the change amount of the relative distance value is greater than the distance change threshold; Within the preset time, there is an area overlap between the cigarette butt area and the human face sub-area; During the preset time, the smoke area moves beside the cigarette butt area.
9. A behavior monitoring device, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and when the at least one processor executes the computer program, the behavior monitoring method described in any one of claims 1-8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the behavior monitoring method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Smoking behavior detection method and device, terminal and readable storage medium
CN110705383A
Interaction device identification method, terminal device and readable storage medium
CN111176445A
Driver behavior monitoring method and device, electronic equipment and storage medium
CN115035502A
Action recognition method and apparatus, driving action analysis method and apparatus, and storage medium
US20210012127A1
