Event capture method and related device, camera device and storage medium
By switching workflows and optimizing computing resource allocation in low-end cameras, the problem of insufficient computing resources of low-end cameras is solved, the accuracy of event capture is improved, and mistakes caused by high and low-end cameras are avoided.
Patent Information
- Application Number
- CN202211387615.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-11-07
AI Technical Summary
Low-end cameras lack computing resources during event capture, resulting in the inability to meet the needs. When relying on high-end cameras, there are problems of discontinuous or interrupted pulling, which affects the accuracy of event capture.
By implementing image extraction, object detection and workflow switching mechanisms in low-end cameras, we identify the basic properties of the moving target and cache the captured images, pausing event analysis; perform event analysis when there is no moving target, and use local cache and server resources to optimize computing resource allocation.
Without adding additional devices, the accuracy of event capture is improved, mistakes caused by high and low-end cameras are avoided, and the performance of the camera device is fully utilized.
Smart Images

Figure CN115883955B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an event capture method and related devices, a camera device and a storage medium. Background Art
[0002] With the promotion and application of camera devices in many fields such as automatic patrol and road traffic, improvements in many aspects such as increased image resolution and increased intelligent functions have led to a significant increase in the computing resources required for the operation of camera devices. As a result, low-end cameras with limited computing resources are unable to meet the needs of event capture.
[0003] In order to meet the event capture needs of low-end cameras, the existing technology usually adds high-end cameras with more abundant computing resources. One high-end camera is used in conjunction with multiple low-end cameras, and the computing resources of the high-end camera are used to perform intelligent analysis of the video stream, thereby relying on the high-end camera to meet the event capture needs of multiple low-end cameras. However, this method not only requires additional devices, thereby increasing costs, but also there is a certain possibility that the stream pulling between the high-end camera and the low-end camera will be discontinuous or interrupted, thereby affecting the accuracy of event capture. Furthermore, since it relies on high-end cameras to achieve event capture, it affects the low-end camera's own control of external devices. In view of this, how to fully utilize the performance of the camera device and improve the accuracy of event capture without adding additional devices and without affecting the camera device's own control of external devices has become a problem that needs to be solved urgently. Summary of the Invention
[0004] The main technical problem solved by this application is to provide an event capture method and related devices, camera devices and storage media, which can fully utilize the performance of the camera device and improve the accuracy of event capture without adding additional devices and without affecting the camera device's own control of external devices.
[0005] In order to solve the above problems, the first aspect of the present application provides an event capture method, including: a camera device sequentially extracts a frame of image to be processed from a real-time acquired video stream; detects whether there is a moving target in the image to be processed; if so, switches to a first workflow, identifies the basic attributes of the moving target in the image to be processed, and obtains a captured image of the moving target based on the image to be processed and the basic attributes, and saves the captured image to the local cache of the camera device; if not, switches to a second workflow, performs event analysis based on the captured images and basic attributes belonging to the same moving target in the local cache, determines whether the event involving the corresponding moving target is an abnormal event, and in the case where the moving target involves an abnormal event, at least sends the captured image of the moving target and the involved event to the server; wherein, in the first workflow, event analysis is in a paused state, and in the second workflow, event analysis is in progress.
[0006] In order to solve the above problems, the second aspect of the present application provides an event capture device, including: an image extraction module, a target detection module, a first working module and a second working module. The image extraction module is used for the camera device to sequentially extract a frame of a to-be-processed image from a real-time acquired video stream; the target detection module is used to detect whether there is a moving target in the to-be-processed image; the first working module is used to, when detecting the presence of a moving target in the to-be-processed image, switch to a first workflow, identify the basic attributes of the moving target in the to-be-processed image, and obtain a captured image of the moving target based on the to-be-processed image and the basic attributes, and save the captured image to a local cache of the camera device; the second working module is used to, when detecting the absence of a moving target in the to-be-processed image, switch to a second workflow, perform event analysis based on the captured images and basic attributes of the same moving target in the local cache, determine whether the event involving the corresponding moving target is an abnormal event, and if the moving target involves an abnormal event, send at least the captured image of the moving target and the involved event to a server; wherein, in the first workflow, event analysis is in a paused state, and in the second workflow, event analysis is in progress.
[0007] In order to solve the above problems, the third aspect of this application provides a camera device, including a camera, a local cache, a communication circuit and a processor. The camera is used to collect video streams in real time, the local cache is used to cache captured images, and the communication circuit is used to send captured images of moving targets and related events to a server. The camera, local cache and communication circuit are respectively coupled to the processor, and the processor is used to execute program instructions to implement the event capture method in the above first aspect.
[0008] In order to solve the above problems, the fourth aspect of the present application provides a computer-readable storage medium storing program instructions that can be executed by a processor, and the program instructions are used for the event capture method in the above first aspect.
[0009] In the above scheme, the camera device sequentially extracts a frame of image to be processed from the real-time acquired video stream, and detects whether there is a moving target in the image to be processed. If there is a moving target, it switches to the first workflow, identifies the basic attributes of the moving target in the image to be processed, and obtains a captured image of the moving target based on the image to be processed and the basic attributes, and saves the captured image to the local cache of the camera device. On the contrary, if there is no moving target, it switches to the second workflow, performs event analysis based on the captured images and basic attributes of the same moving target in the local cache, determines whether the event involving the corresponding moving target is an abnormal event, and in the case where the moving target involves an abnormal event, at least sends the captured image of the moving target and the involved event to the server, and in the first workflow, the event analysis is in a paused state, and in the second workflow, the event analysis is in an ongoing state. On the one hand, the event capture process relies on the camera device itself, so there is no need to add additional devices and the camera device itself will not be affected by the addition of additional devices. On the other hand, the camera device switches the workflow. When a moving target is detected, the camera device focuses on identifying basic attributes and caching captured images, and suspends event analysis. When no moving target is detected, the camera device focuses on event analysis. Therefore, during the event capture process, computing resources can be allocated between different workflows in real time according to actual conditions, and the performance of the camera device can be fully utilized, so that low-end cameras with limited computing resources can meet the event capture needs. On the other hand, since there is no need to introduce additional devices, event capture errors caused by problems such as pulling streams between high-end and low-end cameras can be avoided as much as possible, which helps to improve the accuracy of event capture. Therefore, the performance of the camera device can be fully utilized to improve the accuracy of event capture without adding additional devices and without affecting the camera device itself from controlling external devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a flow chart of an embodiment of the event capture method of the present application;
[0011] Figure 2 This is a flow chart of another embodiment of the event capture method of the present application;
[0012] Figure 3 This is a schematic diagram of the framework of an embodiment of the event capture device of the present application;
[0013] Figure 4 This is a schematic diagram of the framework of an embodiment of the imaging device of the present application;
[0014] Figure 5 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0015] The following describes the embodiments of the present application in detail with reference to the accompanying drawings.
[0016] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0017] The terms "system" and "network" are often used interchangeably in this document. The term "and / or" is simply a description of an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " generally indicates that the related objects are in an "or" relationship. Furthermore, "multiple" in this document means two or more than two.
[0018] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the event capture method of the present application. Specifically, it may include the following steps:
[0019] Step S11: the camera device sequentially extracts a frame of image to be processed from the real-time acquired video stream.
[0020] In the embodiment of the present disclosure, the camera device can capture a video stream in real time, and sequentially extract a frame of an image to be processed from the video stream captured in real time. Specifically, the camera device can be a low-end camera on the market that does not have abundant computing resources, so that the event capture needs of the low-end camera can be met through the event capture method steps in the embodiment of the present disclosure. Of course, the camera device is not limited to a low-end camera that does not have abundant computing resources, and the camera device can also be a high-end camera that has relatively abundant computing resources, which is not limited here. In addition, in the embodiment of the present disclosure, after extracting a frame of image to be processed, the subsequent steps in the embodiment of the present disclosure can be executed to perform event capture based on the currently extracted image to be processed. After the subsequent steps are completed based on the currently extracted image to be processed, a new image to be processed can be re-extracted, and this cycle can be repeated to continuously perform event capture based on the video stream captured in real time.
[0021] In one implementation scenario, in order to improve the accuracy of event capture, especially in application scenarios such as highways where there are high-speed moving targets, each video frame can be extracted sequentially from the real-time acquired video stream, and each video frame can be used as a to-be-processed image, so as to sequentially perform the following steps in the embodiment of the present disclosure on each to-be-processed image. The specific process is not described here. The above method, by sequentially extracting each video frame from the real-time acquired video stream as a to-be-processed image, can capture events based on each frame in the video stream, which helps to improve the accuracy of event capture, especially in application scenarios where there are high-speed moving targets, and can avoid missed detection as much as possible.
[0022] In another implementation scenario, when the requirements for the accuracy of event capture are relatively loose, or in application scenarios where there are few high-speed moving targets such as internal roads in science and technology parks, video frames can be extracted from the real-time acquired video stream in sequence at intervals of a preset duration (e.g., 1 second, 2 seconds, etc.) or a preset number of frames (e.g., 5 frames, 6 frames, etc.), and the extracted video frames are used as images to be processed, so as to perform the following steps in the embodiment of the present disclosure on each image to be processed in turn. The specific process is not described here for the time being. The above method, which extracts images to be processed from the real-time acquired video stream in sequence at intervals of a preset duration or a preset number of frames, helps to occupy as few computing resources as possible when the requirements for the accuracy of event capture are relatively loose, further improves the applicability to low-end cameras, and improves the efficiency of event capture.
[0023] Step S12: Detect whether there is a moving target in the image to be processed. If yes, go to step S13; otherwise, go to step S14.
[0024] In the embodiment of the present disclosure, when a moving target is detected in the image to be processed, the following step S13 can be executed, that is, the first workflow can be switched to identify basic attributes and cache the captured image. Conversely, when no moving target is detected in the image to be processed, the following step S14 can be executed, that is, the second workflow can be switched to perform event analysis. The specific process will not be described here. In addition, the moving target to be detected can be set according to the actual application scenario. For example, in a road traffic scenario, vehicles and pedestrians can be set as targets that need to be motion detected, while leaves, tower cranes, etc. may not be set as targets that need to be motion detected. Other application scenarios can be deduced by analogy, and examples will not be given one by one here.
[0025] In one implementation scenario, where detection requires minimal performance and a short detection time, image motion detection can be performed on the image to be processed to detect whether a moving target exists in the image to be processed. For example, image detection methods such as a single Gaussian method, a frame difference method, a mixed Gaussian method, and a time averaging method can be used to detect the image to be processed to determine whether a moving target exists in the image to be processed. For the specific process, please refer to the technical details of the various image motion detection methods mentioned above and will not be elaborated here.
[0026] In another implementation scenario, when the detection requires less performance and is less time-consuming, target detection can also be performed on the image to be processed to detect whether there is a moving target in the image to be processed. For example, a sliding window can be used to extract candidate areas in the image to be processed, and features can be extracted from each candidate area, such as SIFT (Scale-Invariant Feature Transform) features, HOG (Histogram of Oriented Gradient) features, etc. Based on this, the image features extracted from each candidate area can be further classified to determine whether there is a moving target in each candidate area. For example, the image features can be measured for similarity with the preset features of various pre-set moving targets. If the similarity of a candidate area to a certain moving target is the largest and is greater than a preset threshold, it can be considered that there is a moving target in the candidate area.
[0027] It should be noted that the above-mentioned image motion detection and target detection are only a few possible implementation methods for detecting moving targets. The appropriate detection method can be selected based on factors such as the computing resources of the camera device and the detection accuracy requirements of the moving target, and is not limited to the above-mentioned two implementation methods.
[0028] Step S13: Switch to the first workflow, identify the basic attributes of the moving target in the image to be processed, obtain a captured image of the moving target based on the image to be processed and the basic attributes, and save the captured image to the local cache of the camera device.
[0029] In an embodiment of the present disclosure, if the camera device detects a moving target in the image to be processed, the camera device can switch to the first workflow and perform basic attribute recognition and cache captured images. It should be noted that in the first workflow, event analysis is in a paused state, so that the computing resources occupied by event analysis can be scheduled for use by the first workflow. In addition, the basic attributes represent attribute information of the basic situation of the moving target, for example, may include but are not limited to: target category, target position, etc., which are not limited here.
[0030] In an implementation scenario, the specific content of the basic attributes can be set according to the application scenario. Still taking the traffic scenario as an example, the basic attributes can include at least one of the target category (such as pedestrians, vehicles, etc.) of the moving target and the target position. It should be noted that the target position can be represented by a rectangular frame surrounding the moving target, or the target position can also be represented by the center of the above-mentioned rectangular frame, or the target position can also be other positions, such as the center of any one side of the above-mentioned rectangular frame, a vertex on the above-mentioned rectangular frame, etc., which are not limited here. In other application scenarios, it can be deduced by analogy, and examples are no longer given one by one here.
[0031] In one implementation scenario, the target position of the moving target in the image to be processed can be identified with reference to the aforementioned related description. On this basis, edge detection can be performed on the image data at the target position to extract the target edge of the moving target, so that the target category of the moving target can be determined based on the target edge. Still taking the traffic scene as an example, since the edges of pedestrians and vehicles are clearly different, it is possible to distinguish whether the moving target is a pedestrian or a vehicle based on the extracted target edge. For example, the reference edge of the pedestrian and the reference edge of the vehicle can be prepared in advance, and the target edge can be aligned with the reference edge of the pedestrian and the reference edge of the vehicle respectively to obtain the matching degree between the target edge and the two, so that the category corresponding to the highest matching degree can be selected as the target category of the moving target. Other application scenarios can be deduced in this way, and examples will not be given one by one here. The above example is only one possible implementation method for identifying basic attributes, and does not limit the specific implementation method adopted for identifying basic attributes.
[0032] In one implementation scenario, after switching to the first workflow, the confidence of the basic attributes can also be identified. It should be noted that the confidence of the basic attributes represents the degree of trustworthiness of the basic attributes. For example, please refer to the aforementioned description of the target category, and the matching degree can be used as the confidence of the target category in the basic attributes. After obtaining the basic attributes of the moving target, in response to the confidence of the basic attributes meeting the third condition, the image to be processed can be directly used as a captured image of the moving target, and in response to the confidence of the basic attributes not meeting the third condition, it can be confirmed that the current shooting parameters during the shooting do not match the current shooting environment, so that the target camera parameters matching the current shooting environment can be obtained based on the analysis of the image to be processed, and then shooting can be performed based on the target camera parameters to obtain a captured image of the moving target. In the above method, after switching to the first workflow, the confidence of the basic attributes is also identified. Based on this, in response to the confidence of the basic attributes satisfying the third condition, the image to be processed is directly used as the captured image of the moving target. In response to the confidence of the basic attributes not satisfying the third condition, it is confirmed that the current camera parameters of the shooting device do not match the current shooting environment, and based on the analysis of the image to be processed, the target camera parameters matching the current shooting environment are obtained, and shooting is performed based on the target camera parameters to obtain the captured image of the moving target, which helps to ensure that the captured image can meet the needs of subsequent event analysis as much as possible, and can be beneficial to improving the accuracy of event capture.
[0033] In a specific implementation scenario, the third condition can be specifically set to include: the confidence level is higher than a preset threshold. The preset threshold can be set according to actual circumstances. For example, when the accuracy of event capture is required to be high, the preset threshold can be set to a larger value, such as 0.9 or 0.95. Alternatively, when the accuracy of event capture is required to be relatively loose, the preset threshold can be set to a smaller value, such as 0.80 or 0.85. The above are not limited here.
[0034] In a specific implementation scenario, when it is confirmed that the current camera parameters of the camera device do not match the current shooting environment, the grayscale value of each pixel in the area where the moving target is located in the image to be processed can be detected to determine the current brightness of the area, and the target brightness value required for subsequent shooting of the camera device can be determined based on the current brightness of the area, so that the target camera parameters of the camera device can be determined according to the target brightness value. Specifically, the target camera parameters may include but are not limited to: aperture size, shutter time, gain, etc. For the specific process, please refer to the technical details on automatic exposure adjustment in this field, which will not be repeated here. It should be noted that the camera device can also be connected to an external device, such as a flash, and the camera device can control the external device. For example, it can be determined whether to turn on the flash according to actual needs to provide fill light in scenes with poor lighting conditions such as night and cloudy days.
[0035] In one implementation scenario, unlike obtaining a captured image of the moving target directly based on the image to be processed and the basic attributes after identifying the basic attributes of the moving target in the image to be processed, in order to further improve the accuracy of event capture and minimize computing resource consumption, after switching to the first workflow and before identifying the basic attributes of the moving target in the image to be processed, a check can be performed to determine whether the moving target has appeared continuously for a preset number of frames. For ease of description, the preset number of frames can be denoted as P. The preset number of frames P can be set according to actual circumstances, such as any natural number such as 5, 6, or 7, and is not limited here. In other words, it is necessary to determine whether the moving target was also detected in the P-1 frames of the image to be processed extracted previously. Based on this, if the moving target has appeared continuously for the preset number of frames, the step of identifying the basic attributes of the moving target in the image to be processed can be executed. In other words, the first workflow can be continued at this point. Conversely, if the moving target has not appeared continuously for the preset number of frames, the step of sequentially extracting a frame of the image to be processed from the real-time video stream by the imaging device and subsequent steps can be re-executed. In other words, the first workflow can be paused at this point. The above method further detects whether the moving target has appeared for a preset number of frames continuously after switching to the first workflow and before identifying the basic attributes, and executes the step of identifying the basic attributes when the preset number of frames has appeared, otherwise it restarts the extraction of new images to be processed. On the one hand, it can ensure the accuracy of moving target detection, and on the other hand, since the captured images taken when the moving target first enters the line of sight area are usually of little use value for event capture, even if the captured images at this time are not cached, the impact on the accuracy of event capture is minimal.
[0036] In one implementation scenario, the camera device may be provided with a local cache. For example, the camera device may be provided with hardware support for storage expansion, such as an SD card slot, allowing an SD memory card to be inserted into the camera device as a local cache, thereby minimizing the cost impact on the camera device.
[0037] Step S14: Switch to the second workflow, perform event analysis based on the captured images and basic attributes of the same moving target in the local cache, determine whether the event involving the corresponding moving target is an abnormal event, and in the case where the moving target is involved in an abnormal event, at least send the captured image of the moving target and the involved event to the server.
[0038] In the disclosed embodiment, if the imaging device does not detect a moving target in the image to be processed, the imaging device may switch to the second workflow and perform event analysis. It should be noted that in the second workflow, event analysis is ongoing. Furthermore, the aforementioned identification of basic attributes and caching of captured images may be paused, thereby enabling the computing resources occupied by the identification of basic attributes and caching of captured images to be dispatched to the second workflow.
[0039] In one implementation scenario, as mentioned above, the image features of the image data of the location of the moving target can be extracted, such as the aforementioned SIFT features, HOG features, etc. On this basis, the image features corresponding to the moving target in the captured images corresponding to each moment can be measured for similarity. If the similarity between the image features corresponding to the two moving targets is greater than a preset threshold, it can be considered that the two frames of captured images belong to the same moving target, otherwise it can be considered that the two frames of captured images do not belong to the same moving target. It should be noted that the specific value of the preset threshold can be set according to the actual application needs. For example, in the case of high requirements for the accuracy of event capture, the preset threshold can be set to a larger value, such as 0.9, 0.95, etc., which is not limited here; or, in the case of relatively loose requirements for the accuracy of event capture, the preset threshold can be set to a smaller value, such as 0.8, 0.85, etc., which is not limited here.
[0040] In one implementation scenario, after switching to the second workflow, each captured image of the corresponding moving target can be identified based on the basic attributes of the same moving target, and additional attributes related to the basic attributes of the corresponding moving target in each captured image can be obtained. Therefore, based on the captured images, basic attributes and additional attributes belonging to the same moving target, it can be determined whether the event involving the corresponding moving target is an abnormal event. It should be noted that the additional attribute representation is used to supplement the attribute information of the moving target on the basis of the basic attributes. Still taking the traffic scene as an example, when the target category of the moving target is a vehicle, the additional attributes related to the basic attributes may include but are not limited to: the lighting status of the vehicle signal light (such as the straight light is red, the left turn light is red, etc.), the position of the stop line, the position of the lane line, etc., which are not limited here; or, when the target category of the moving target is a person, the additional attributes related to the basic attributes may include but are not limited to: the lighting status of the pedestrian signal light (such as the red light is on, the green light is on, etc.), the sidewalk area, the position of the crosswalk line, etc., which are not limited here. Other scenarios can be deduced by analogy, and no examples are given here one by one. The above method identifies each captured image of the corresponding moving target based on the basic attributes of the same moving target, obtains additional attributes related to the basic attributes of the corresponding moving target in each captured image, and determines whether the event involving the corresponding moving target is an abnormal event based on the captured images, basic attributes and additional attributes belonging to the same moving target. It can combine the basic attributes, additional attributes and captured images to jointly determine whether the event involved is an abnormal event, which can improve the accuracy of event analysis.
[0041] In a specific implementation scenario, the specific process of additional attribute identification can refer to the aforementioned basic attribute identification method, and no further examples are given here.
[0042] In a specific implementation scenario, still taking the traffic scene as an example, the target category of the moving target is vehicle, and there are three captured images belonging to the moving target in the local cache, and the basic attributes identified in the first captured image belonging to the moving target show that the front of the moving target has passed the stop line, and the additional attributes identified in the first captured image belonging to the moving target show that the vehicle signal light is on and the straight-ahead light is red; further, the basic attributes identified in the second captured image belonging to the moving target show that the rear of the moving target has passed the stop line, and the additional attributes identified in the second captured image belonging to the moving target show that the vehicle signal and other conditions are still that the straight-ahead light is red; further, the basic attributes identified in the third captured image belonging to the moving target show that the body of the moving target has left the intersection, and the additional attributes identified in the third captured image belonging to the moving target show that the vehicle signal and other conditions are still that the straight-ahead light is red; therefore, it can be determined that the event involving the moving target is "running a red light" and the event involved is an abnormal event. Other scenarios can be deduced in the same way, and I will not give examples one by one here.
[0043] In one implementation scenario, unlike after switching to the second workflow, directly performing event analysis based on the captured images and basic attributes of the same moving target in the local cache to determine whether the event involving the corresponding moving target is an abnormal event, in order to further improve the accuracy of event capture and minimize the consumption of computing resources, after switching to the second workflow and before event analysis, it is also possible to detect whether the captured images of any of the same moving targets in the local cache meet the first condition. On this basis, in response to the existence of a moving target that meets the first condition, each moving target that meets the first condition can be subjected to event analysis based on the captured images and basic attributes of the same moving target in the local cache to determine whether the event involving the corresponding moving target is an abnormal event. That is, for a moving target that meets the first condition, an event analysis can be performed based on its captured images and basic attributes to determine whether the event involving it is an abnormal event, while for a moving target that does not meet the first condition, event analysis can be temporarily suspended. In the above method, after switching to the second workflow and before performing event analysis, it is first detected whether the captured images belonging to any identical moving target in the local cache meet the first condition, and in response to the existence of a moving target meeting the first condition, for each moving target meeting the first condition, event analysis is performed based on the captured images and basic attributes belonging to the identical moving target in the local cache, to determine whether the event involving the corresponding moving target is an abnormal event. Therefore, after switching to the second workflow, the moving targets that meet the event analysis conditions can be selectively screened based on the captured images belonging to the identical moving target, and event analysis can be performed on them. This helps to reduce the frequency of event analysis as much as possible, thereby reducing the consumption of computing resources. Secondly, it can ensure as much as possible that when performing event analysis on the moving target, the captured images belonging to it are fully prepared, thereby helping to improve the accuracy of event capture.
[0044] In a specific implementation scenario, after detecting whether the captured images belonging to any of the same moving targets in the local cache meet the first condition, the camera device can also re-execute the steps of sequentially extracting a frame of images to be processed from the real-time acquired video stream and the subsequent steps in response to any moving targets in the local cache not meeting the first condition. That is to say, if there is no moving target that meets the first condition, it can be considered that each moving target does not yet meet the preparation conditions for event analysis, so the second workflow can be paused and the sequential extraction of images to be processed from the real-time acquired video stream can be restarted. In the above method, in response to any moving target in the local cache not meeting the first condition, the camera device can re-execute the steps of sequentially extracting a frame of images to be processed from the real-time acquired video stream and the subsequent steps, so that when there is no moving target that meets the first condition, the second workflow can be timely paused and the images to be processed can be re-prepared, which helps to reduce the consumption of computing resources and improve the accuracy of event capture.
[0045] In a specific implementation scenario, the first condition can be set to include: after the last frame of the captured image belonging to the same moving target, when the images to be processed have been extracted continuously for a preset number of times, no new captured images belonging to the corresponding moving target are added to the local cache. For the sake of convenience of description, the preset number can be recorded as Q. That is to say, assuming that a number of captured images belonging to a certain moving target are stored in the local cache, and the last captured image is cached during the event capture process when the image to be processed is extracted for the i-th time, then during the event capture process when the image to be processed is extracted for the i+Q+1th time, if it is detected that there are no new captured images of the moving target from the event capture process when the image to be processed is extracted for the i+1th time, the event capture process when the image to be processed is extracted for the i+2th time, ... until the event capture process when the image to be processed is extracted for the i+Qth time, then it can be considered that the moving target meets the first condition at this time, and event analysis can be performed on the moving target. For example, the preset number Q can be set to any natural number such as 1, 2, 3, 4, 5, etc., which is not limited here. In the above method, the first condition is set to include: after the last frame of captured image belonging to the same moving target, when the images to be processed have been extracted continuously for a preset number of times, no new captured images belonging to the corresponding moving target are added to the local cache, thereby ensuring that when event analysis is performed on the moving target, the captured images belonging to it are fully prepared, thereby improving the accuracy of event capture.
[0046] In one implementation scenario, since event analysis typically consumes a significant amount of computing resources, and peak-time snapshots often contain a greater number of images, and given relatively relaxed real-time requirements for event analysis, in order to maximize load balancing of the imaging device, after switching to the second workflow and before performing event analysis, it is also possible to detect whether the current moment satisfies a second condition, and the second condition can be set to include any of the following: the current moment is during an off-peak period, or the current moment is at night. On this basis, in response to the current moment satisfying the second condition, a step is performed to perform event analysis based on the snapshot images and basic attributes of the same moving target in the local cache, to determine whether the event involving the corresponding moving target is an abnormal event. Of course, in response to the current moment not satisfying the second condition, the step of sequentially extracting a frame of image to be processed from the real-time captured video stream and subsequent steps can be re-executed. That is, the second workflow can be paused at this time, and the extraction of the image to be processed can be restarted to concentrate the snapshot images in the local cache during off-peak periods or at night for event analysis. It should be noted that the specific time periods of off-peak periods and nights can be customized. For example, the off-peak period can be set from 9 pm on the same day to 7 am on the next day; or, the night period can be set from 8 pm on the same day to 3 am on the next day, which is not limited here. In the above method, after switching to the second workflow and before event analysis, it is also possible to detect whether the current moment meets the second condition, and the second condition includes any one of the following: the current moment is in the off-peak period, the current moment is at night, based on this, in response to the current moment meeting the second condition, the step of performing event analysis based on the captured images and basic attributes belonging to the same moving target in the local cache, and determining whether the event involving the corresponding moving target is an abnormal event, and in response to the current moment not meeting the second condition, the step of sequentially extracting a frame of image to be processed from the real-time acquired video stream by the camera device and subsequent steps are re-executed, so that the main focus can be on identifying basic attributes and caching captured images during peak periods, and the remaining performance can be focused on event analysis during off-peak periods or at night, and the problem of image loss caused by too many captured images during peak periods due to insufficient caching capacity or inability to cache can be alleviated as much as possible.
[0047] In one implementation scenario, during actual application, it may happen that the camera device cannot determine the event involved in the moving target when performing event analysis. In this case, the captured image and basic attributes of the corresponding moving target can also be sent to the server, so that the server can perform event analysis based on the captured image and basic attributes of the corresponding moving target to determine whether the event involved in the corresponding moving target is an abnormal event. In the above method, when the camera device performs event analysis locally and cannot determine the event involved in the moving target, the captured image and basic attributes of the corresponding moving target are sent to the server, which can rely on the powerful computing power of the server to perform event analysis. Under the premise of improving the accuracy of event analysis, since the captured image has been obtained based on the basic attributes, compared with the complete transmission of the video stream or captured frame without discrimination, the amount of data sent to the server can be reduced as much as possible, which helps to reduce the bandwidth occupied by data transmission.
[0048] In one implementation scenario, if it is determined that a moving target is involved in an abnormal event, a captured image of the moving target and the event involved may be sent to a server; alternatively, a captured image of the moving target, basic attributes, and the event involved may be sent to a server; alternatively, a captured image of the moving target, basic attributes, additional attributes, and the event involved may be sent to a server, without limitation. In addition, if the moving target is not involved in an abnormal event, the cached data of the moving target in the local cache (e.g., captured image, basic attributes, etc.) may be cleared.
[0049] It should be noted that, in the embodiment of the present disclosure, in the first workflow, event analysis is in a paused state, and in the second workflow, event analysis is in an ongoing state. Furthermore, in the first workflow, identifying basic attributes and caching captured images may be in an ongoing state, and in the second workflow, identifying basic attributes and caching captured images may be in a paused state. In addition, the aforementioned various implementation methods in the embodiment of the present disclosure may be implemented separately or simultaneously. For example, after switching to the second workflow and before performing event analysis, the aforementioned related implementation methods of "detecting whether the first condition is met" and the aforementioned implementation methods of "detecting whether the second condition is met" may be implemented one by one according to application needs, or may be implemented simultaneously, and are not limited here.
[0050] In the above scheme, the camera device sequentially extracts a frame of image to be processed from the real-time acquired video stream, and detects whether there is a moving target in the image to be processed. If there is a moving target, it switches to the first workflow, identifies the basic attributes of the moving target in the image to be processed, and obtains a captured image of the moving target based on the image to be processed and the basic attributes, and saves the captured image to the local cache of the camera device. On the contrary, if there is no moving target, it switches to the second workflow, performs event analysis based on the captured images and basic attributes of the same moving target in the local cache, determines whether the event involving the corresponding moving target is an abnormal event, and in the case where the moving target involves an abnormal event, at least sends the captured image of the moving target and the involved event to the server, and in the first workflow, the event analysis is in a paused state, and in the second workflow, the event analysis is in an ongoing state. On the one hand, the event capture process relies on the camera device itself, so there is no need to add additional devices and the camera device itself will not be affected by the addition of additional devices. On the other hand, the camera device switches the workflow. When a moving target is detected, the camera device focuses on identifying basic attributes and caching captured images, and suspends event analysis. When no moving target is detected, the camera device focuses on event analysis. Therefore, during the event capture process, computing resources can be allocated between different workflows in real time according to actual conditions, and the performance of the camera device can be fully utilized, so that low-end cameras with limited computing resources can meet the event capture needs. On the other hand, since there is no need to introduce additional devices, event capture errors caused by problems such as pulling streams between high-end and low-end cameras can be avoided as much as possible, which helps to improve the accuracy of event capture. Therefore, the performance of the camera device can be fully utilized to improve the accuracy of event capture without adding additional devices and without affecting the camera device itself from controlling external devices.
[0051] See also Figure 2 , Figure 2 This is a flow chart of another embodiment of the event capture method of the present application. Specifically, it may include the following steps:
[0052] Step S201: real-time acquisition of video streams, and sequential extraction of a frame of image to be processed therefrom.
[0053] For details, please refer to step S11 in the aforementioned disclosed embodiment, which will not be described again here.
[0054] Step S202: Intelligent pre-check.
[0055] For details, please refer to the relevant description of the aforementioned disclosed embodiment regarding detecting whether there is a moving target in the image to be processed, which will not be repeated here.
[0056] Step S203: Check whether a moving target is detected. If yes, go to step S204; otherwise, go to step S208.
[0057] For details, please refer to step S12 in the aforementioned disclosed embodiment, which will not be repeated here.
[0058] Step S204: Determine whether event analysis is enabled. If so, execute step S205; otherwise, execute step S206.
[0059] Specifically, if a moving target is detected during pre-detection, its basic attributes need to be identified and the captured image cached. In this case, event analysis needs to be disabled to free up computing resources. Therefore, in this case, the first step is to determine whether event analysis is enabled.
[0060] Step S205: Close event analysis.
[0061] For details, please refer to the relevant description in the aforementioned disclosed embodiments, which will not be repeated here.
[0062] Step S206: Identify basic attributes and cache the captured image.
[0063] For details, please refer to the relevant description in the aforementioned disclosed embodiments, which will not be repeated here.
[0064] Step S207: Re-execute step S201 and subsequent steps.
[0065] Specifically, after the current image to be processed is processed, a frame of image to be processed may be sequentially extracted from the video stream, and the new image to be processed may be processed.
[0066] Step S208: Determine whether there is a snapshot cache. If so, execute step S209; otherwise, execute step S210.
[0067] Specifically, if no moving target is pre-detected, event analysis can be performed later. Prior to this, to ensure that the data foundation for event analysis is available, a check can be made to see if there are captured images in the local cache. Alternatively, a further check can be made to see if any captured images of the same moving target in the local cache satisfy the first condition. For details, please refer to the relevant description in the aforementioned disclosed embodiments, which will not be repeated here.
[0068] Step S209: Start event analysis.
[0069] Specifically, if there is a snapshot buffer, event analysis can be started to determine whether the event involving the moving target is an abnormal event. For details, please refer to the aforementioned disclosed embodiments, which will not be repeated here.
[0070] Step S210: re-execute step S201 and subsequent steps.
[0071] Specifically, if there is no snapshot cache, it means that there is no data basis for event analysis, so the event analysis can be skipped and a new image to be processed can be extracted again.
[0072] The above scheme, on the one hand, relies on the camera device itself during the event capture process, so there is no need to add additional devices and the camera device itself will not be affected by the addition of additional devices to control external devices. On the other hand, the camera device switches the workflow. When a moving target is detected, the camera device focuses on identifying basic attributes and caching captured images, and suspends event analysis. When no moving target is detected, the camera device focuses on event analysis. Therefore, during the event capture process, computing resources can be allocated between different workflows according to actual conditions, and the performance of the camera device can be fully utilized, so that low-end cameras with limited computing resources can meet the event capture needs. On the other hand, since there is no need to introduce additional devices, event capture errors caused by problems such as pulling streams between high-end and low-end cameras can be avoided as much as possible, which helps to improve the accuracy of event capture. Therefore, the performance of the camera device can be fully utilized to improve the accuracy of event capture without adding additional devices and without affecting the camera device itself from controlling external devices.
[0073] See also Figure 3 , Figure 3 It is a schematic diagram of the framework of an embodiment of the event capture device 30 of the present application. The event capture device 30 includes: an image extraction module 31, a target detection module 32, a first working module 33, and a second working module 34. The image extraction module 31 is used for the camera device to sequentially extract a frame of a to-be-processed image from a real-time acquired video stream; the target detection module 32 is used to detect whether there is a moving target in the to-be-processed image; the first working module 33 is used to, if a moving target is detected in the to-be-processed image, switch to a first workflow, identify basic attributes of the moving target in the to-be-processed image, obtain a captured image of the moving target based on the to-be-processed image and the basic attributes, and save the captured image to a local cache of the camera device; the second working module 34 is used to, if a moving target is detected in the to-be-processed image, switch to a second workflow, perform event analysis based on captured images and basic attributes of the same moving target in the local cache, determine whether an event involving the moving target is an abnormal event, and, if the moving target involves an abnormal event, send at least the captured image of the moving target and the related event to a server; wherein, in the first workflow, event analysis is in a paused state, and in the second workflow, event analysis is in an ongoing state.
[0074] The above scheme, on the one hand, relies on the camera device itself during the event capture process, so there is no need to add additional devices and the camera device itself will not be affected by the addition of additional devices to control external devices. On the other hand, the camera device switches the workflow. When a moving target is detected, the camera device focuses on identifying basic attributes and caching captured images, and suspends event analysis. When no moving target is detected, the camera device focuses on event analysis. Therefore, during the event capture process, computing resources can be allocated between different workflows according to actual conditions, and the performance of the camera device can be fully utilized, so that low-end cameras with limited computing resources can meet the event capture needs. On the other hand, since there is no need to introduce additional devices, event capture errors caused by problems such as pulling streams between high-end and low-end cameras can be avoided as much as possible, which helps to improve the accuracy of event capture. Therefore, the performance of the camera device can be fully utilized to improve the accuracy of event capture without adding additional devices and without affecting the camera device itself from controlling external devices.
[0075] In some disclosed embodiments, the event capture device 30 also includes a first detection module for detecting whether the captured images belonging to any identical moving target in the local cache satisfy a first condition; the second working module 34 is used to respond to the existence of a moving target satisfying the first condition, and for each moving target satisfying the first condition, perform event analysis based on the captured images and basic attributes belonging to the same moving target in the local cache, and determine whether the event involving the corresponding moving target is an abnormal event.
[0076] In some disclosed embodiments, the event capture device 30 also includes a first loop module for re-executing the step of sequentially extracting a frame of image to be processed from the real-time captured video stream by the camera device and subsequent steps in response to any moving target in the local cache not satisfying the first condition.
[0077] In some disclosed embodiments, the first condition includes: after the last frame of captured image belonging to the same moving target, when a preset number of images to be processed have been continuously extracted, no new captured image belonging to the corresponding moving target is added to the local cache.
[0078] In some disclosed embodiments, the second working module 34 includes an attribute recognition submodule, which is used to identify each captured image of the corresponding moving target based on the basic attributes of the same moving target, and obtain additional attributes related to the basic attributes of the corresponding moving target in each captured image; the second working module 34 includes an event determination submodule, which is used to determine whether the event involving the corresponding moving target is an abnormal event based on the captured images, basic attributes and additional attributes belonging to the same moving target.
[0079] In some disclosed embodiments, in a traffic scenario, the basic attributes include at least one of a target category and a target position of a moving target; wherein, when the target category is a vehicle, the additional attributes related to the basic attributes include at least one of the vehicle signal light status, the stop line position, and the lane line position; and when the target category is a person, the additional attributes related to the basic attributes include at least one of the pedestrian signal light status, the sidewalk area, and the crosswalk line position.
[0080] In some disclosed embodiments, the event capture device 30 also includes a data sending module, which is used to send the captured image and basic attributes of the corresponding moving target to the server when the event analysis cannot determine the event involving the moving target; wherein the server is used to perform event analysis based on the captured image and basic attributes of the corresponding moving target to determine whether the event involving the corresponding moving target is an abnormal event.
[0081] In some disclosed embodiments, the event capture device 30 further includes a second detection module for detecting whether a second condition is satisfied at the current moment; wherein the second condition includes any one of the following: the current moment is during an off-peak period, the current moment is at night; and the second working module 34 is configured to, in response to the current moment satisfying the second condition, perform an event analysis based on captured images and basic attributes of the same moving target in the local cache to determine whether the event involving the corresponding moving target is an abnormal event. The event capture device 30 further includes a second loop module for, in response to the current moment not satisfying the second condition, re-execute the step of sequentially extracting a frame of image to be processed from the real-time captured video stream by the camera device and subsequent steps.
[0082] In some disclosed embodiments, the event capture device 30 also includes a third detection module for detecting whether the moving target has appeared continuously for a preset number of frames; the first working module 33 is used to execute the step of identifying the basic attributes of the moving target in the image to be processed in response to the moving target having appeared continuously for a preset number of frames; the event capture device 30 also includes a third loop module for re-executing the step of sequentially extracting a frame of the image to be processed from the real-time captured video stream by the camera device and subsequent steps in response to the moving target not appearing continuously for the preset number of frames.
[0083] In some disclosed embodiments, after switching to the first workflow, the confidence of the basic attributes is also identified. The first working module 33 includes a first response submodule for directly using the image to be processed as a captured image of the moving target in response to the confidence of the basic attributes satisfying the third condition; the first working module 33 includes a second response submodule for confirming that the current camera parameters of the camera device do not match the current shooting environment in response to the confidence of the basic attributes not satisfying the third condition, and obtaining target camera parameters that match the current shooting environment based on the analysis of the image to be processed, and shooting based on the target camera parameters to obtain a captured image of the moving target.
[0084] See also Figure 4 , Figure 4 4 is a schematic diagram of a framework of an embodiment of an imaging device 40. The imaging device 40 includes a camera 41, a local buffer 42, a communication circuit 43, and a processor 44. The camera 41 is configured to capture a video stream in real time, the local buffer 42 is configured to cache captured images, and the communication circuit 43 is configured to transmit captured images of moving targets and related events to a server. The camera 41, the local buffer 42, and the communication circuit 43 are each coupled to the processor 44, which is configured to execute program instructions to implement the steps of any of the aforementioned event capture method embodiments.
[0085] Specifically, the processor 44 is used to control itself as well as the camera 41, the local cache 42, and the communication circuit 43 to implement the steps in any of the above-mentioned event capture method embodiments. The processor 44 can also be referred to as a CPU (Central Processing Unit). The processor 44 may be an integrated circuit chip with signal processing capabilities. The processor 44 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 44 can be implemented by an integrated circuit chip.
[0086] The above scheme, on the one hand, relies on the camera device itself during the event capture process, so there is no need to add additional devices and the camera device itself will not be affected by the addition of additional devices to control external devices. On the other hand, the camera device switches the workflow. When a moving target is detected, the camera device focuses on identifying basic attributes and caching captured images, and suspends event analysis. When no moving target is detected, the camera device focuses on event analysis. Therefore, during the event capture process, computing resources can be allocated between different workflows according to actual conditions, and the performance of the camera device can be fully utilized, so that low-end cameras with limited computing resources can meet the event capture needs. On the other hand, since there is no need to introduce additional devices, event capture errors caused by problems such as pulling streams between high-end and low-end cameras can be avoided as much as possible, which helps to improve the accuracy of event capture. Therefore, the performance of the camera device can be fully utilized to improve the accuracy of event capture without adding additional devices and without affecting the camera device itself from controlling external devices.
[0087] See also Figure 5 , Figure 5 This is a schematic diagram of a framework of an embodiment of a computer-readable storage medium 50 of the present application. The computer-readable storage medium 50 stores program instructions 51 that can be executed by a processor, and the program instructions 51 are used to implement the steps of any of the above-mentioned event capture method embodiments.
[0088] The above scheme, on the one hand, relies on the camera device itself during the event capture process, so there is no need to add additional devices and the camera device itself will not be affected by the addition of additional devices to control external devices. On the other hand, the camera device switches the workflow. When a moving target is detected, the camera device focuses on identifying basic attributes and caching captured images, and suspends event analysis. When no moving target is detected, the camera device focuses on event analysis. Therefore, during the event capture process, computing resources can be allocated between different workflows according to actual conditions, and the performance of the camera device can be fully utilized, so that low-end cameras with limited computing resources can meet the event capture needs. On the other hand, since there is no need to introduce additional devices, event capture errors caused by problems such as pulling streams between high-end and low-end cameras can be avoided as much as possible, which helps to improve the accuracy of event capture. Therefore, the performance of the camera device can be fully utilized to improve the accuracy of event capture without adding additional devices and without affecting the camera device itself from controlling external devices.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0090] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0091] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0092] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0093] If the technical solution of this application involves personal information, the product that applies the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing personal information. If the technical solution of this application involves sensitive personal information, the product that applies the technical solution of this application has obtained the individual's separate consent before processing sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, a clear and prominent sign is set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that they agree to the collection of their personal information; or on the personal information processing device, when the personal information processing rules are notified by obvious signs / information, the individual's authorization is obtained through pop-up information or by asking the individual to upload their personal information; among which, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. An event capture method, characterized in that: Applied to camera devices, including: Sequentially extract a frame of image to be processed from the real-time acquired video stream; Detecting whether there is a moving target in the image to be processed; If yes, switch to the first workflow, identify the basic attributes of the moving target in the image to be processed, obtain a captured image of the moving target based on the image to be processed and the basic attributes, and save the captured image to the local cache of the camera device; If not, switch to the second workflow, perform event analysis based on the captured images of the same moving target in the local cache and the basic attributes, determine whether the event involving the moving target is an abnormal event, and if the moving target is involved in the abnormal event, at least send the captured image of the moving target and the involved event to the server; In the first workflow, the event analysis is in a paused state, and in the second workflow, the event analysis is in an ongoing state.
2. The method according to claim 1, characterized in that After switching to the second workflow and before performing event analysis based on the captured images of the same moving target in the local cache and the basic attributes to determine whether the event corresponding to the moving target is an abnormal event, the method further includes: Detecting whether any captured image of the same moving target in the local cache satisfies a first condition; The performing event analysis based on the captured images belonging to the same moving target in the local cache and the basic attributes to determine whether the event corresponding to the moving target is an abnormal event includes: In response to the existence of the moving target that meets the first condition, the step of performing event analysis based on the captured images belonging to the same moving target in the local cache and the basic attributes is performed on each moving target that meets the first condition to determine whether the event involving the moving target is an abnormal event.
3. The method according to claim 2, characterized in that The method further comprises: In response to any of the moving targets in the local cache not satisfying the first condition, the step of sequentially extracting a frame of image to be processed from the real-time acquired video stream by the camera device and subsequent steps are re-executed.
4. The method according to claim 2 or 3, characterized in that The first condition includes: after the last frame of the captured image belonging to the same moving target, when a preset number of images to be processed have been continuously extracted, no captured image belonging to the corresponding moving target is added to the local cache.
5. The method according to claim 1, wherein The performing event analysis based on the captured images belonging to the same moving target in the local cache and the basic attributes to determine whether the event corresponding to the moving target is an abnormal event includes: Based on the basic attributes of the same moving object, each captured image corresponding to the moving object is identified to obtain additional attributes related to the basic attributes corresponding to the moving object in each captured image; Based on the captured images, basic attributes and additional attributes belonging to the same moving target, it is determined whether the event involving the moving target is an abnormal event.
6. The method according to claim 5, characterized in that In a traffic scenario, the basic attribute includes at least one of a target category and a target position of the moving target; Among them, when the target category is a vehicle, the additional attributes related to the basic attributes include at least one of the vehicle signal light status, the stop line position, and the lane line position; when the target category is a person, the additional attributes related to the basic attributes include at least one of the pedestrian signal light status, the sidewalk area, and the crosswalk line position.
7. The method according to claim 1, characterized in that In the case that the event analysis fails to determine the event involved in the moving target, the method further includes: The captured image and the basic attributes corresponding to the moving target are sent to the server; wherein the server is used to perform the event analysis based on the captured image and the basic attributes corresponding to the moving target to determine whether the event involving the moving target is the abnormal event.
8. The method according to claim 1, characterized in that After switching to the second workflow and before performing event analysis based on the captured images of the same moving target in the local cache and the basic attributes to determine whether the event corresponding to the moving target is an abnormal event, the method further includes: Detecting whether the current time satisfies a second condition; wherein the second condition includes at least one of the following: the current time is during an off-peak period, the current time is at night; The performing event analysis based on the captured images belonging to the same moving target in the local cache and the basic attributes to determine whether the event corresponding to the moving target is an abnormal event includes: In response to the second condition being satisfied at the current moment, performing the step of performing event analysis based on the captured images of the same moving target in the local cache and the basic attributes to determine whether the event involving the moving target is an abnormal event; The method further comprises: In response to the second condition not being satisfied at the current moment, the step of sequentially extracting a frame of image to be processed from the video stream acquired in real time by the camera device and subsequent steps are re-executed.
9. The method according to claim 1, characterized in that After switching to the first workflow and before identifying basic attributes of the moving target in the image to be processed, the method further includes: Detecting whether the moving target has appeared for a preset number of consecutive frames; The identifying basic attributes of the moving target in the image to be processed includes: In response to the moving object having appeared continuously for the preset number of frames, performing the step of identifying basic attributes of the moving object in the image to be processed; The method further comprises: In response to the fact that the moving object has not appeared continuously for the preset number of frames, the step of sequentially extracting a frame of image to be processed from the real-time acquired video stream by the camera device and subsequent steps are re-executed.
10. The method according to claim 1, characterized in that After switching to the first workflow, the confidence level of the basic attribute is further identified, and the captured image of the moving target is obtained based on the image to be processed and the basic attribute, including at least one of the following: In response to the confidence level of the basic attribute satisfying a third condition, directly using the image to be processed as a captured image of the moving target; In response to the confidence of the basic attributes not satisfying the third condition, it is confirmed that the current camera parameters of the camera device do not match the current shooting environment, and based on the analysis of the image to be processed, target camera parameters matching the current shooting environment are obtained, and shooting is performed based on the target camera parameters to obtain a captured image of the moving target.
11. An event capture device, characterized in that: Applied to camera devices, including: The image extraction module is used to sequentially extract a frame of image to be processed from the real-time acquired video stream; A target detection module is used to detect whether there is a moving target in the image to be processed; a first working module configured to, upon detecting a moving target in the image to be processed, switch to a first working flow, identify basic attributes of the moving target in the image to be processed, obtain a captured image of the moving target based on the image to be processed and the basic attributes, and save the captured image to a local cache of the imaging device; a second working module configured to, when detecting that the moving target does not exist in the image to be processed, switch to a second workflow, perform event analysis based on the captured images of the same moving target in the local cache and the basic attributes, determine whether the event involving the moving target is an abnormal event, and, if the moving target involves the abnormal event, send at least the captured image of the moving target and the involved event to a server; In the first workflow, the event analysis is in a paused state, and in the second workflow, the event analysis is in an ongoing state.
12. An imaging device, characterized in that: The method comprises a camera, a local cache, a communication circuit and a processor, wherein the camera is used to collect video streams in real time, the local cache is used to cache captured images, and the communication circuit is used to send captured images of moving targets and related events to a server. The camera, the local cache and the communication circuit are respectively coupled to the processor, and the processor is used to execute program instructions to implement the event capture method described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the event capture method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Multi-scene video monitoring method and device thereof
CN111988563A
Cluster processing architecture and method for intelligent analysis of large-scale monitoring nodes
CN113259451A