Target object behavior detection method, device, electronic device and storage medium
By expanding the analysis area and combining it with continuous frame image analysis, the problems of false detection and false alarm in traditional regional intrusion detection are solved, and accurate monitoring of the target object's behavior is achieved.
Patent Information
- Application Number
- CN202410842693.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-06-26
AI Technical Summary
Traditional regional intrusion detection technologies are prone to false detections and false alarms when detecting the behavior of target objects within the target area, especially due to the three-dimensional features of the target object leading to incorrect determination of the center point location.
By defining an analysis region that includes an extension of the reference region, it is ensured that the center point of the target object remains within the analysis region when performing a specified action. By combining continuous frame images to analyze the continuous dwell time and behavioral attributes of the target object, false detections and false alarms are avoided.
It effectively avoids false detection of target object location and false alarm of behavior, and improves the accuracy and reliability of detection, especially for precise monitoring of target object behavior in specified scenarios.
Smart Images

Figure CN118411503B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision, and in particular to a method, device, electronic device and storage medium for detecting target object behavior. Background Art
[0002] In some specified scenarios, it is necessary to keep an eye on the dynamics of the target object in the target area. At present, regional intrusion detection technology is often used to detect the target area. However, traditional regional intrusion detection technology may have false detections in the process of detecting the target area. For example, the target object performs a specified behavior in the target area, but the regional intrusion detection technology detects that the target object is outside the target area. Summary of the invention
[0003] In view of this, the present application provides a target object behavior detection method, device, electronic device and storage medium.
[0004] The technical solutions provided by this application are as follows:
[0005] According to a first aspect of an embodiment of the present application, a target object behavior detection method is provided, the method comprising:
[0006] Determine an analysis area; wherein the analysis area includes a reference area and an extended area obtained by extending the reference area, and for any analysis area, when a reference object performs a specified behavior in the analysis area, the center point of the reference object is within the analysis area;
[0007] When the analysis area is determined, behavior detection is performed on the target object based on the analysis area.
[0008] According to a second aspect of an embodiment of the present application, a target object behavior detection device is provided, the device comprising:
[0009] a determining unit configured to determine an analysis area; wherein the analysis area includes a reference area and an extended area obtained by extending the reference area, and for any analysis area, when a reference object performs a specified behavior in the analysis area, a center point of the reference object is within the analysis area;
[0010] The detection unit is configured to perform behavior detection on the target object based on the analysis area when the analysis area is determined.
[0011] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.
[0012] According to a fourth aspect of an embodiment of the present application, a non-temporary computer-readable storage medium is provided, wherein a computer program is stored in the non-temporary computer-readable storage medium, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0013] The target object behavior detection method of the embodiment of the present application first determines an analysis area, where the analysis area includes a reference area and an extended area obtained by expanding the reference area, to ensure that when the reference object performs a specified behavior within the analysis area, the center point of the reference object is within the analysis area, and further behavior detection is performed on the target object based on the determined analysis area, thereby avoiding the problem of misdetection of the target object's position during the behavior detection process. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A flow chart of a target object behavior detection method provided in an embodiment of the present application;
[0015] Figure 2 A schematic diagram of a specified scenario provided for an embodiment of the present application;
[0016] Figure 3 A schematic diagram of the distribution of the first type of area and the second type of area provided in the embodiment of the present application;
[0017] Figure 4 A flow chart of target object behavior detection in a specified scenario provided in an embodiment of the present application;
[0018] Figure 5 A structural diagram of a target object behavior detection device provided in an embodiment of the present application;
[0019] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0021] In some designated scenarios, it is necessary to keep an eye on the dynamics of the target object in the target area. For example, it is necessary to keep an eye on the dynamics of the target person, including the time when the target person leaves or enters the bed or toilet, and the length of time they stay in a designated location such as a corridor, to prevent any unexpected situations.
[0022] To detect the behavior of the target object in the target area, it is first necessary to determine whether the target object is within the target area. In related technologies, the method for detecting whether the target object is in the target area is to detect whether the center point of the target object is within the range of the target area.
[0023] However, since the target object is three-dimensional, and the monitoring screen image for the specified scene captured by the camera equipment is a two-dimensional image, the target area obtained according to the monitoring screen image is also a two-dimensional image, which often results in the target object being within the target area, but due to the body characteristics of the target object, the center point of the target object is outside the target area. In this case, the detection method in the relevant technology will detect that the target object is outside the target area, causing the problem of false detection.
[0024] Combine the following Figure 2 Describe the false detection situations that occur in the specified scenario:
[0025] Please refer to Figure 2 , Figure 2 A schematic diagram of a specified scenario provided for an embodiment of the present application.
[0026] like Figure 2 As shown, the target area is set as the bed 201 of the target person, and the area surrounded by dots is the target area. When detecting whether the target person is located in the target area (i.e., bed 201) according to the solution in the related art, since the center point of the target person is at a certain height, when the center point is above the target area, it will cause the target person to be detected as being outside the target area, resulting in a false detection. Based on this, the embodiment of the present application proposes a method for detecting target object behavior to avoid the problem of false detection of the target object's position during behavior detection.
[0027] Combine the following Figure 1 The technical solutions in the embodiments of the present application are further described in detail.
[0028] It should be noted that the serial numbers of the steps in the embodiments of the present application do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0029] In addition, the target object behavior detection method proposed in the embodiment of the present application can be executed on a camera device with image processing capabilities, and sent to a management platform after determining the behavioral attributes of the target object; the camera device can also send the collected multiple frames of images to the management platform, and the management platform can execute the above-mentioned target object behavior detection method to perform behavior detection on the target object. The present application does not impose any restrictions on this.
[0030] See also Figure 1 , is a flow chart of a target object behavior detection method provided in an embodiment of the present application, such as Figure 1 As shown, the target object behavior detection method may include the following steps:
[0031] Step S100, determining the analysis area.
[0032] The analysis area includes a reference area and an extended area obtained by extending the reference area. For any analysis area, when a reference object performs a specified behavior in the analysis area, the center point of the reference object is within the analysis area.
[0033] In an embodiment of the present application, the analysis area can be manually drawn in the surveillance screen image of the specified scene, or it can be obtained by expanding the reference area after the electronic device detects the reference area in the surveillance screen image of the specified scene. The present application does not impose any restrictions on this.
[0034] Exemplarily, the method for determining the analysis area in the embodiment of the present application may include:
[0035] Detect the surveillance image of the specified scene to obtain a reference area;
[0036] The reference area is expanded based on the body features of the preset reference object to obtain an analysis area corresponding to the reference area.
[0037] In an embodiment of the present application, a region expansion strategy can be configured for the surveillance screen image of a specified scene. The region expansion strategy includes the physical characteristics of the reference object (such as height, body width, etc.) and the size of the expansion range. The analysis area obtained after expansion based on the region expansion strategy can ensure that the center point of the target object is within the analysis area during the process of the target object performing the specified behavior in the analysis area.
[0038] Exemplarily, when the target object performs a specified behavior outside the analysis area, the center point of the target object is outside the analysis area.
[0039] It should be noted that in the process of configuring the area expansion strategy for the surveillance screen image of the specified scene, for the specified area expansion strategy, detection and area expansion can be performed based on the surveillance screen image, and an object whose body characteristics are consistent with the body characteristics of the reference object can be tested by performing the specified behavior in the analysis area to determine whether the center point of the object is always within the analysis area; if the center point of the object is not always within the analysis area during the process of performing the specified behavior in the analysis area, the area expansion strategy can be updated, such as updating the body characteristics of the reference object or the size of the expansion range, until the obtained expansion strategy meets the requirements.
[0040] In the embodiment of the present application, when the analysis area is a bed area, if the bed area is a bed corresponding to a single-layer bed, the above-mentioned specified behaviors may include sitting, lying, lying, standing, etc.; if the bed area is a bed corresponding to a double-layer bed, the above-mentioned specified behaviors may include sitting, lying, lying, etc. When the analysis area is a toilet area, the above-mentioned specified behaviors may include standing, squatting, etc., and the present application does not limit this.
[0041] In the embodiment of the present application, the reference area may include multiple different types of areas, and the expansion strategies of different types of areas may be different. For example, the expansion strategy of the area may be determined based on the location of the area in the specified scene, the size of the area, and the type of the specified action performed by the target object in the area.
[0042] Exemplarily, the reference area may be an area surrounded by multiple vertices. The method for expanding the reference area in the embodiment of the present application may include:
[0043] The height value of at least one vertex included in the reference area is increased to expand the area covered by the reference area.
[0044] For example, Figure 2 By increasing the heights of two of the four vertices adjacent to the wall in the reference area, i.e., the target person's bed 201, by a specified value, the range of the reference area can be expanded. If the target person is currently sitting on the bed 201, its center point will also be included in the expanded reference area, i.e., the analysis area. In this case, when the target person performs the action of "sitting" in the analysis area, its center point is within the analysis area, thereby avoiding misdetection of the target person's position.
[0045] Step S110: When the analysis area is determined, behavior detection is performed on the target object based on the analysis area.
[0046] In the embodiment of the present application, when the analysis area is determined, it is possible to avoid the situation where the position of the target object is detected by mistake. Further, the behavior of the target object is detected based on the determined analysis area. The process of the behavior detection of the target object will be described in detail below and will not be repeated here.
[0047] It can be seen that in Figure 1 In the method flow shown, an analysis area is first determined, and the analysis area includes a reference area and an extended area obtained by expanding the reference area, to ensure that when a reference object performs a specified behavior within the analysis area, the center point of the reference object is within the analysis area, and further behavior detection is performed on the target object based on the determined analysis area, thereby avoiding the problem of misdetection of the target object's position during the behavior detection process.
[0048] In related technologies, in addition to manual patrols, regional intrusion detection technology can also be used to detect behaviors such as target objects entering or leaving the target area. Since the current regional intrusion detection technology can only detect whether there are entry or exit events in the target area, and cannot further confirm whether it is the target object or the non-target object that triggers the entry or exit event, when the non-target object is in the target area, false alarms in behavior detection are prone to occur.
[0049] Combine the following Figure 2 Describe the false alarms that occur in the specified scenario:
[0050] Please refer to Figure 2 , Figure 2 A schematic diagram of a specified scenario provided for an embodiment of the present application.
[0051] like Figure 2 As shown, the target area is set as the bed 201 of the target person. In the process of detecting the target person entering or leaving the bed according to the regional intrusion detection technology in the relevant technology, if other personnel, such as the on-duty personnel, pass by the target person's bed 201, the detection of entering or leaving the bed will be triggered, and the entering or leaving bed event will be reported, causing a false alarm. Based on this, the embodiment of the present application proposes a method for detecting the behavior of the target object based on the analysis area to avoid false alarms in the process of detecting the behavior of the target object.
[0052] In the embodiment of the present application, the analysis area may include a first type area, where the first type area refers to an area associated with a single target object.
[0053] The method for detecting the behavior of a target object based on an analysis area provided in an embodiment of the present application may include:
[0054] For any target object in the current frame image obtained, when it is determined that the target object is not a new target object, if the target object is determined to be in any first type of area based on its position in the current frame image, then the continuous stay time of the target object in the first type of area is determined based on the current frame image and the obtained historical frame images.
[0055] In an embodiment of the present application, the behavior attributes of the target object included in the image can be determined based on the continuous multiple-frame images captured by the camera device, and the behavior of the target object can be recorded on the management platform for relevant personnel to view.
[0056] In an embodiment of the present application, a method for determining that a target object in a current frame image is a non-newly added target may include: configuring a target ID for the target object contained in the current frame image according to the acquired current frame image and a previous frame image of the current frame.
[0057] The target ID can be used to identify different target objects, and the same target object in the current frame image and the previous frame image of the current frame is configured with the same target ID.
[0058] In an embodiment of the present application, the current frame image may be an image directly obtained from the camera device after the camera device captures the current frame, and the previous frame image of the current frame may be obtained from a designated storage medium, which may be a storage medium contained in the camera device or a storage medium corresponding to the management platform. The present application does not impose any restrictions on this.
[0059] It is easy to understand that the previous frame image is actually the previous current frame image. When the previous frame image is used as the current frame image, the image can be saved in a designated storage medium. Similarly, the current frame image obtained at this time can also be stored in a designated storage medium as the previous frame image of the next current frame image, so that the current frame image obtained at this time can be obtained from the designated storage medium as the previous frame image of the next current frame image.
[0060] In an embodiment of the present application, a method for configuring a target ID for a target object contained in a current frame image according to an acquired current frame image and a previous frame image of the current frame may include:
[0061] If the target object included in the current frame image also exists in the previous frame image of the current frame, the target ID of the corresponding target object in the previous frame image of the current frame is used as the target ID of the target object in the current frame image;
[0062] If the target object included in the current frame image does not exist in the previous frame image of the current frame, a target ID is randomly configured for the target object, and the target ID is different from the target IDs of other target objects in the current frame image.
[0063] In an embodiment of the present application, if it is determined that the target object in the current frame image is not a new target, the position of the target object in the current frame image can be detected. If the target object is in any first type of area in the current frame, the continuous stay time of the target object in the first type of area can be further determined based on the current frame image and the obtained historical frame images.
[0064] In an embodiment of the present application, a first type of area may be an area associated with a single target object, such as a bed corresponding to a target object, a seat corresponding to a target object, etc. For example, taking the target object as a target person as an example, the first type of area may be the bed of any target person. It is easy to understand that the target person will stay in his or her bed for a long time every day. In the same specified scene, the number of first type areas may be one or more, and the present application does not limit this.
[0065] In the embodiment of the present application, each current frame image also records the time when the frame image is captured, and the time interval between the two frames of image capture can be determined by the difference between the times when the two frames of image are captured. If the target object in the continuous multiple frames of image including the current frame stays in a first type of area, the time length of the target object's continuous stay in the first type of area can be determined based on the time when the frame in which the target object first appears in the first type of area is captured and the time when the current frame is captured.
[0066] In the embodiment of the present application, the historical frame information of the target object can be obtained from the specified storage medium, and the historical frame information records the position of the target object in the historical frame images obtained within a specified time period before the current frame image is obtained. In other words, the historical position of the target object can be obtained from the specified storage medium.
[0067] In an embodiment of the present application, if the target object's continuous stay time in the first type area reaches a first preset time, the first type area is determined to be a first target area matching the target object, and the behavior attribute of the target object is determined to be entering the first target area.
[0068] In an embodiment of the present application, if it is determined based on the time when the current frame image is captured and the time when the historical frame image is captured that the continuous stay time of the target object in any first type of area reaches a first preset time, it indicates that the target object has stayed in the first type of area for a long time, which indicates that the first type of area is likely to be an area associated with the target object (such as the bed or seat of the target object). At this time, it can be determined that the first type of area is the first target area matching the target object, and the behavior attribute of the target object is determined to be entering the first target area.
[0069] In the embodiment of the present application, the continuous stay time of the target object in the first type of area reaches the first preset time length, which means: if the target object continues to stay in the first type of area from the moment when the frame corresponding to the last time the target object moved from outside the first type of area to inside the first type of area is captured to the moment corresponding to the current frame, and the stay time reaches the first preset time length for the first time, it is determined that the continuous stay time of the target object in the first type of area reaches the first preset time length.
[0070] For example, assuming that the first preset duration is 30 seconds and the first type of area is a bed, the timing starts from the frame corresponding to the range included by the bed when the target object moves from outside the bed. If the timing duration corresponding to the moment when the current frame image is captured has reached 30 seconds, and the timing duration corresponding to the moment when the previous frame image of the current frame image is captured has not reached 30 seconds, then it is determined that the target object's continuous stay time in the bed has reached the first preset duration (30 seconds). At this time, the target object can be matched with the bed, and the bed can be used as the first target area matching the target object, and the target object's behavior attribute at this time is determined to be entering the bed.
[0071] It should be noted that if the timing duration corresponding to the moment of capturing the current frame image reaches 30 seconds, and the timing duration corresponding to the moment of capturing the previous frame image of the current frame image also reaches 30 seconds, it means that in the previous frame of the current frame or earlier, the continuous stay time of the target object in the first type of area (bed) has reached the first preset time length (30 seconds). In other words, the target object has already completed the match with the bed before the moment corresponding to the current frame and determined that the behavior attribute of the target object is entering the bed. In this case, there is no need to match the target object with the bed again, nor is there any need to report the behavior attribute of the target object as entering the bed.
[0072] In addition, taking into account the possibility that some first-type areas in some scenes may be obscured, the above-mentioned continuous stay in the first-type area for more than the first preset time period when the first-type area is obscured can also be replaced by detecting that the target object disappears from the first-type area for more than the first preset time period, in which case the first-type area is directly used as the first target area for matching the target object.
[0073] It can be seen that in the case of determining that the target object in the current frame image obtained is not a new target object, if it is determined based on the current frame image and the obtained historical frame images that the continuous stay time of the target object in any first type of area reaches the first preset time, then the first type of area is determined to be the first target area matching the target object, and the behavior attribute of the target object is determined to be entering the first target area; through the above method, only the target object whose stay time in the first type of area reaches the first preset time will be determined to have entered the first type of area, and for the object whose stay time in the first type of area does not reach the first preset time, even if it passes through the first type of area, it will not be identified as entering the area, thereby avoiding the problem of false alarm when detecting the target object entering the target area.
[0074] In the embodiment of the present application, not only the behavior attribute of the target object entering the first target area can be detected, but also other behavior attributes can be detected.
[0075] In some embodiments, the solution proposed in the embodiments of the present application may also include:
[0076] If, based on the position of the target object in the current frame image, it is determined that the target object is not within the first target area that matches the target object, and based on the previous frame image of the current frame image, it is determined that the position of the target object in the previous frame image is within the first target area that matches the target object, then the behavior attribute of the target object is determined to be leaving the first target area.
[0077] Exemplarily, after the target object is matched with the first target area, if the target object moves from inside the first target area to outside the first target area for the first time, the behavior attribute of the target object is determined to be leaving the first target area.
[0078] It should be noted that after determining that the behavior attribute of the target object is leaving the first target area, the matching relationship between the target object and the first target area will be deleted. In other words, the next time the target object enters the first target area (in fact, at this time the area has no matching relationship with the target object and is a first type of area), it will be determined again whether the target object matches the first type of area based on the continuous stay time of the target object in the first type of area.
[0079] In some embodiments, after determining that the behavior attribute of the target object is entering the first target area, the solution proposed in the embodiment of the present application may further include:
[0080] If it is detected that the continuous stay time of the target object in the first target area reaches a third preset time, it is determined that the behavior attribute of the target object is staying in the first target area for an extended period of time.
[0081] Exemplarily, after determining that the behavior attribute of the target object is entering the first target area, the continuous stay time of the target object in the first target area can be continuously detected. If the continuous stay time of the target object in the first target area reaches a third preset time, it indicates that the target object has stayed in the first target area for too long, and it is determined that the behavior attribute of the target object is overstaying in the first target area.
[0082] For example, the situation where the target object stays in the first target area for too long may be: for example, the normal sleep time is 8 hours, and the target object has stayed in the corresponding first target area (the target object's bed) for 10 hours, then it is determined that the target object has stayed in the first target area for too long, and the behavior attribute of the target object is determined to be overtime stay in the first target area.
[0083] Exemplarily, the analysis area may also include a second type of area, which refers to an area associated with multiple target objects. In the embodiment of the present application, in addition to the first type of area where the target object may stay for a long time, the area in the current scene may also include a second type of area where the target object may stay for a short time. The second type of area may refer to an area associated with multiple target objects.
[0084] For example, public areas such as toilets and corridors can be identified as second-type areas. It is easy to understand that there is no matching relationship between the second reference area and the target object, and the behavior detection of the target object in the second-type area also includes detection of entry, exit and overtime stay.
[0085] In some embodiments, the solution proposed in the embodiments of the present application may further include:
[0086] If the target object is determined to be in any second type of area based on the position of the target object in the current frame image, the position of the target object in the previous frame image is determined based on the previous frame image of the current frame image;
[0087] If the position of the target object in the previous frame image is outside the second type area, then the behavior attribute of the target object is determined to be entering the second type area.
[0088] If, based on the position of the target object in the current frame image, it is determined that the target object is not within any second type of area, and based on the previous frame image of the current frame image, it is determined that the position of the target object in the previous frame image is within any second type of area, then the behavior attribute of the target object is determined to be leaving the second type of area.
[0089] Exemplarily, since there is no matching relationship between the second type area and the target object, it can be determined whether the target object enters or leaves the second type area according to the position of the target object in the current frame and the position of the previous frame of the current frame.
[0090] It is easy to understand that if the target object is within the second type of area in the current frame and outside the second type of area in the previous frame image, the behavior attribute of the target object is determined to be entering the second type of area; if the target object is outside the second type of area in the current frame and within the second type of area in the previous frame image, the behavior attribute of the target object is determined to be leaving the second type of area.
[0091] In some embodiments, the solution proposed in the embodiments of the present application may further include:
[0092] If it is determined that the target object is in any second type of area based on the position of the target object in the current frame image, and the position of the target object in the previous frame image is within the second type of area, then the continuous stay time of the target object in the second type of area is determined based on the current frame image and the obtained historical frame images;
[0093] If the continuous stay time of the target object in the second type area reaches a second preset time, it is determined that the behavior attribute of the target object is overstaying in the second type area.
[0094] Exemplarily, if the position of the target object in the current frame and the position in the previous frame are both within the second type of area, the continuous stay time of the target object in the second type of area can be determined based on the current frame image and the obtained historical frame images. If the continuous stay time of the target object in the second type of area reaches a second preset time, it indicates that the target object has stayed in the second type of area for too long. In this case, the behavior attribute of the target object is determined to be overtime stay in the second type of area.
[0095] It is easy to understand that if the target object stays in the second type of area such as a toilet or a corridor for too long, it may indicate an unexpected situation.
[0096] In the embodiment of the present application, before determining the behavior attributes of the target object, the area in the image captured by the camera device must first be pre-divided. The pre-division can be completed in advance in the camera device or the management platform.
[0097] In some embodiments, the first type of region is a region obtained by expanding the edge of the preset first reference region outward according to the body shape characteristics of the target object; the first type of region refers to a region associated with a single target object;
[0098] The second type region is a region obtained by expanding the edge of the preset second reference region outward according to the body features of the target object; the second type region refers to a region associated with multiple target objects.
[0099] Specifically, at least one first reference area can be divided in the image captured by the camera device, and the target object needs to stay in the first reference area for a long time. For example, the first reference area can be the beds of all target persons in the specified area. Each first reference area (i.e., each bed) can include an area identifier corresponding to the reference area.
[0100] In the embodiment of the present application, a public area where the target object may stay for a short time, namely, a second reference area, may also be pre-divided.
[0101] For example, areas such as toilets and corridors may be determined as second reference areas, and there is no matching relationship between the second reference area and the target object.
[0102] Below through Figure 3 The division of the first type area and the second type area is described.
[0103] Please refer to Figure 3 , Figure 3 A schematic diagram of the distribution of the first type of areas and the second type of areas provided in an embodiment of the present application.
[0104] like Figure 3 As shown in the figure, in this scenario, the area surrounded by the dots in the figure is the first type area and the second type area obtained by expanding outward according to the body characteristics of the reference object. When drawing the area, it is not directly divided along the edge, but needs to be expanded outward according to the body characteristics of the preset reference object (such as height, body width and other parameters). Each first type area (that is, each bed) has an area mark corresponding to the first type area (A1 to A4 in the figure); at the same time, Figure 3 D1 and D2 are exemplary second type areas (such as toilet areas) and corresponding signs, which are also expanded and adjusted according to the body characteristics of the preset reference object.
[0105] In some embodiments, after determining the behavior attributes of the target object, the solution proposed in the embodiment of the present application may further include:
[0106] The behavior attributes of the target object, the position information of the target object in the current frame image, and the acquisition time of the current frame image are saved simultaneously.
[0107] In an embodiment of the present application, the behavior attributes of the target object, the location information of the target object in the current frame image, and the acquisition time of the current frame image are simultaneously saved in a designated storage medium, so that relevant personnel can query and record the behavior of the target object.
[0108] In an embodiment of the present application, for a first type of area associated with a single target object, such as beds, seats, and the like, only after the target object stays in the first type of area for a sufficiently long time will it be matched with the first type of area, and the behavior attribute will be determined to be entering the first type of area. At the same time, only when the target object that matches the first type of area leaves the first type of area that matches it will the behavior attribute be determined to be leaving the first type of area. Other objects that pass through the first type of area but do not stay there for a sufficiently long time can be considered as non-target objects that are not related to the first type of area. When a non-target object passes through the first type of area, it will not be reported as entering or leaving the first type of area.
[0109] Furthermore, the solution proposed in the present application can detect behavioral attributes such as leaving the first type of area, staying in the first type of area for a long time, etc., and a second type of area can be set up as an area where the target object may stay for a short time. The target object can also enter, leave and stay in the second type of area for a long time, and abnormal situations can be reported in a timely manner.
[0110] Combine the following Figure 4 The target object behavior detection method proposed in this application is described through a specific embodiment.
[0111] Please refer to Figure 4 , Figure 4 A flowchart of target object behavior detection in a specified scenario provided in an embodiment of the present application.
[0112] In this embodiment, relevant information of the target object can be stored in a designated storage medium, such as maintaining three map data structures: in mapA, the area information where the target object is located when it first appears is cached in the form of <target ID, area information>, and is cleared after the behavior attribute of the target object is determined to be an entering bed event; in mapB, the area information where the target object is located in historical frames within a specified time is cached in the form of <target ID, List<target information>>; in mapC, the previous frame information of the target object is cached in the form of <target ID, previous (frame) information>.
[0113] like Figure 4 As shown, the first type of area includes the bed area, and the second type of area includes the toilet area.
[0114] When the current frame image is received, the target object can be determined from the current frame image first, and then whether the target object exists in the previous frame image can be further determined. If so, it is determined that the target object is not a new target object, and the subsequent process continues. If not, it indicates that the target object is a new target object (that is, the current frame is the frame where the target object appears for the first time), and the information of the current area where the target object is located can be recorded.
[0115] When it is determined that the target object is not a newly added target object, the region where the target object is located in the current frame is compared with the region where the target object is located in the previous frame.
[0116] In this embodiment, if the area information of the same target object in the previous frame and the current frame is different, it can be divided into the following four cases:
[0117] Case 1: The target object in the previous frame is in a certain bed area, and the target object in the current frame is in another area.
[0118] At this time, it is necessary to determine whether the target object matches the bed area. If so, the behavior attribute of the target object is determined to be leaving the bed area.
[0119] Case 2: The target object in the previous frame is in other areas, and the target object in the current frame is in the toilet area.
[0120] At this time, it is determined that the behavior attribute of the target object is entering the toilet area.
[0121] Case 3: The target object in the previous frame is in the toilet area, and the target object in the current frame is in other areas.
[0122] At this time, the behavior attribute of the target object is determined to be leaving the toilet area.
[0123] Case 4: The target object in the previous frame is in other areas, and the target object in the current frame is in a certain bed area.
[0124] At this time, it is necessary to record whether the target object has stayed in the bed continuously for a first preset time period starting from the current frame. If so, it is determined that the behavior attribute of the target object is entering the bed area.
[0125] In this embodiment, if the area information of the same target object in the previous frame and the current frame is the same, it can be divided into the following two cases:
[0126] Case 1: The target object in the previous frame and the current frame is in the same bed area.
[0127] At this time, it can be determined whether the target object has stayed in the bed area continuously for a third preset time period. If so, it is determined that the behavior attribute of the target object is staying in the bed area for an extended period of time.
[0128] Case 2: The target object in both the previous frame and the current frame is in the toilet area.
[0129] At this time, it can be determined whether the target object has stayed in the toilet area continuously for a second preset time period. If so, the behavior attribute of the target object is determined to be staying in the toilet area for an extended period of time.
[0130] The method provided by the present application is described above. The device provided by the present application is described below:
[0131] Please refer to Figure 5 , Figure 5 : is a structural diagram of the target object behavior detection device proposed in the embodiment of the present application. Figure 5 As shown, the device may include a determination unit 510 and a detection unit 520. Specifically, the target object behavior detection device may include:
[0132] The determination unit 510 is configured to determine an analysis area; wherein the analysis area includes a reference area and an extended area obtained by extending the reference area, and for any analysis area, when a reference object performs a specified behavior in the analysis area, the center point of the reference object is within the analysis area;
[0133] The detection unit 520 is configured to perform behavior detection on the target object based on the analysis area when the analysis area is determined.
[0134] In some embodiments, the determining unit 510 is configured to:
[0135] Detect the surveillance image of the specified scene to obtain a reference area;
[0136] The reference area is expanded based on the body features of a preset reference object to obtain an analysis area corresponding to the reference area.
[0137] In some embodiments, the reference area is an area surrounded by a plurality of vertices, and the determining unit 510 is further configured to:
[0138] The height value of at least one vertex included in the reference area is increased to expand the area covered by the reference area.
[0139] In some embodiments, the analysis area includes a first type area, and the first type area refers to an area associated with a single target object; the detection unit 520 is further configured to:
[0140] For any target object in the current frame image obtained, when it is determined that the target object is not a newly added target object, if it is determined that the target object is in any first type of area based on the position of the target object in the current frame image, the continuous stay time of the target object in the first type of area is determined based on the current frame image and the obtained historical frame images;
[0141] If the target object's continuous stay time in the first type area reaches a first preset time, the first type area is determined to be a first target area matching the target object, and the behavior attribute of the target object is determined to be entering the first target area.
[0142] In some embodiments, the analysis area further includes a second type area, and the second type area refers to an area associated with multiple target objects; the detection unit 520 is further configured to:
[0143] If the target object is determined to be in any second type of area based on the position of the target object in the current frame image, the position of the target object in the previous frame image is determined based on the previous frame image of the current frame image;
[0144] If the position of the target object in the previous frame image is outside the second type area, then the behavior attribute of the target object is determined to be entering the second type area.
[0145] In some embodiments, the detection unit 520 is further configured to:
[0146] If the position of the target object in the previous frame image is within the second type of area, then determine the continuous stay time of the target object in the second type of area according to the current frame image and the obtained historical frame images;
[0147] If the continuous stay time of the target object in the second type area reaches a second preset time, it is determined that the behavior attribute of the target object is overstaying in the second type area.
[0148] In some embodiments, the detection unit 520 is further configured to:
[0149] If, based on the position of the target object in the current frame image, it is determined that the target object is not within the first target area that matches the target object, and based on the previous frame image of the current frame image, it is determined that the position of the target object in the previous frame image is within the first target area that matches the target object, then the behavior attribute of the target object is determined to be leaving the first target area.
[0150] In some embodiments, the detection unit 520 is further configured to:
[0151] If, based on the position of the target object in the current frame image, it is determined that the target object is not within any second type of area, and based on the previous frame image of the current frame image, it is determined that the position of the target object in the previous frame image is within any second type of area, then the behavior attribute of the target object is determined to be leaving the second type of area.
[0152] In some embodiments, after determining that the behavior attribute of the target object is entering the first target area, the detection unit 520 is further configured to:
[0153] If it is detected that the continuous stay time of the target object in the first target area reaches a third preset time, it is determined that the behavior attribute of the target object is staying in the first target area for an extended period of time.
[0154] See also Figure 6 , is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 601, a communication interface 602, a memory 603 and a communication bus 604. The processor 601, the communication interface 602 and the memory 603 communicate with each other via the communication bus 604. Among them, the memory 603 stores a computer program; the processor 601 can execute the target object behavior detection method described above by executing the program stored in the memory 603.
[0155] The memory 603 mentioned herein may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the memory 603 may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0156] The present application also provides a non-transitory machine-readable storage medium storing a computer program, such as Figure 6 The computer program may be provided by the memory 603 in the Figure 6 The processor 601 in the electronic device shown executes to implement the target object behavior detection method described above.
[0157] The present application also provides a computer program stored in a non-transitory machine-readable storage medium, such as Figure 6 The memory 603 in the memory, and when the processor executes the computer program, it prompts the processor 601 to execute the target object behavior detection method described above.
Claims
1. A target object behavior detection method, characterized in that: The method includes: Determine an analysis area; wherein the analysis area includes a reference area and an extended area obtained by extending the reference area, and for any analysis area, when a reference object performs a specified behavior in the analysis area, the center point of the reference object is within the analysis area; the extension strategy of the reference area is determined according to the position of the reference area in the specified scene, the size of the reference area, and the type of the specified action performed by the target object in the reference area; When the analysis area is determined, a behavior detection is performed on the target object based on the analysis area; when the target object performs a specified behavior within the analysis area, the center point of the target object is within the analysis area; Wherein, determining the analysis area includes: The monitoring screen image of the designated scene is detected to obtain a reference area; the reference area is expanded based on the body features of a preset reference object to obtain an analysis area corresponding to the reference area.
2. The method according to claim 1, characterized in that: The reference area is an area surrounded by a plurality of vertices, and the expanding the reference area includes: The height value of at least one vertex included in the reference area is increased to expand the area covered by the reference area.
3. The method according to claim 1, characterized in that The analysis area includes a first type of area, where the first type of area refers to an area associated with a single target object; and the behavior detection of the target object based on the analysis area includes: For any target object in the current frame image obtained, when it is determined that the target object is not a newly added target object, if it is determined that the target object is in any first-type area based on the position of the target object in the current frame image, then the continuous stay time of the target object in the first-type area is determined based on the current frame image and the obtained historical frame images; If the target object's continuous stay time in the first type area reaches a first preset time, the first type area is determined to be a first target area matching the target object, and the behavior attribute of the target object is determined to be entering the first target area.
4. The method according to claim 1, characterized in that The analysis area further includes a second type area, where the second type area refers to an area associated with multiple target objects; and the behavior detection of the target object based on the analysis area includes: If it is determined that the target object is in any of the second type areas according to the position of the target object in the current frame image, then the position of the target object in the previous frame image is determined according to the previous frame image of the current frame image; If the position of the target object in the previous frame image is outside the second type of area, then the behavior attribute of the target object is determined to be entering the second type of area.
5. The method according to claim 4, characterized in that The method further comprises: If the position of the target object in the previous frame image is within the second type of area, determining the continuous stay time of the target object in the second type of area according to the current frame image and the obtained historical frame images; If the continuous stay time of the target object in the second type area reaches a second preset time, it is determined that the behavior attribute of the target object is overstaying in the second type area.
6. The method according to claim 3, characterized in that The method further comprises: If, based on the position of the target object in the current frame image, it is determined that the target object is not within the first target area that matches the target object, and based on the previous frame image of the current frame image, it is determined that the position of the target object in the previous frame image is within the first target area that matches the target object, then the behavior attribute of the target object is determined to be leaving the first target area.
7. A target object behavior detection device, characterized in that: The device includes: A determination unit is configured to determine an analysis area; wherein the analysis area includes a reference area and an extended area obtained by extending the reference area, and for any analysis area, when a reference object performs a specified behavior in the analysis area, the center point of the reference object is within the analysis area; the extension strategy of the reference area is determined according to the position of the reference area in the specified scene, the size of the reference area, and the type of the specified action performed by the target object in the reference area; the determination of the analysis area includes: detecting a surveillance screen image of the specified scene to obtain a reference area; and expanding the reference area based on the body features of a preset reference object to obtain an analysis area corresponding to the reference area; The detection unit is configured to perform behavior detection on the target object based on the analysis area when the analysis area is determined; when the target object performs a specified behavior in the analysis area, the center point of the target object is within the analysis area.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
