Methods, devices, storage media, and electronic devices for recording target behavior
By acquiring and verifying the preset point information of the camera, and combining image similarity and background similarity analysis, the problem of the accuracy of target behavior recording by the camera in the management department's monitoring system was solved, achieving higher recording accuracy and reliability of the evidence chain.
Patent Information
- Application Number
- CN202111633620.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In existing technologies, the recording accuracy of target behavior by cameras in management departments' event monitoring systems is poor, and false alarms are easily caused by human error.
By acquiring the actual preset point information of the target shooting device at the target time, ensuring that it is consistent with the preset point information, analyzing the behavior included in the target multimedia information, caching the target image, and combining image similarity and background similarity judgment, errors caused by human operation are eliminated, and accurate recording is achieved.
It improves the accuracy of recording target behavior, ensures the reliability and integrity of the evidence chain, and avoids false alarms caused by human manipulation of the camera.
Smart Images

Figure CN114359828B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of monitoring technology, and more specifically, to a method, apparatus, storage medium, and electronic device for recording target behavior. Background Technology
[0002] Currently, cameras are widely used in various security monitoring fields, such as road traffic, production safety, and power systems. They play a vital role in production, daily life, and safety management, preventing safety accidents and providing great convenience for safety management. The following example illustrates the application of cameras in a management department's event monitoring system. In recent years, conflicts have frequently arisen during the handling of events by management departments, or disputes arise between parties regarding the existence of violations. In such cases, evidence becomes particularly important. Because management departments need to observe a violation for a certain period before it can be determined as a violation (e.g., for illegally parked vehicles), and because real-time requirements are not particularly high, a single camera is typically used to analyze multiple preset points. Similarly, due to the needs of management personnel handling events, multiple captures and fusions of violations are required. However, in related technologies, human manipulation of the camera may result in images not being taken from the preset points, leading to inaccurate recordings of target behavior and a high risk of false alarms. Therefore, providing a method for accurately recording target behavior has become an urgent problem to solve.
[0003] There is currently no effective solution to the problem of poor accuracy in recording target behavior in related technologies. Summary of the Invention
[0004] The present invention provides a method, apparatus, storage medium, and electronic device for recording target behavior, so as to at least solve the problem of poor accuracy in target behavior recording methods in related technologies.
[0005] According to an embodiment of the present invention, a method for recording target behavior is provided, comprising: acquiring actual preset point information of a target shooting device at a target time; when it is determined that the actual preset point information is consistent with preset preset point information, analyzing the behavior included in the target multimedia information captured by the target shooting device to determine an analysis result, wherein the preset preset point information is preset point information that the target shooting device needs to reach at the target time in advance; and when it is determined based on the analysis result that the target multimedia information includes target behavior, caching a target image included in the target multimedia information, wherein the target image records the target behavior.
[0006] In an exemplary embodiment, after caching the target image included in the target multimedia information, the method further includes: acquiring a first image captured by the target imaging device at a first moment, wherein the first moment is a moment before the target moment, and the preset point information of the target imaging device at the first moment is the preset preset point information; if it is determined that the similarity between the target image and the first image exceeds a similarity threshold, continuing to cache the target image; if it is determined that the similarity between the target image and the first image does not exceed the similarity threshold, deleting the target image and the first image.
[0007] In an exemplary embodiment, the method further includes: comparing the background similarity between a target background image included in the target image and a first background image included in the first image; and determining the similarity between the target image and the first image based on the background similarity.
[0008] In an exemplary embodiment, comparing the background similarity between a target background image included in the target image and a first background image included in the first image includes: determining a target histogram of the target image and a first histogram of the first image; calculating the distance between the target histogram and the first histogram to obtain a distance calculation result; and determining the background similarity based on the distance calculation result.
[0009] In an exemplary embodiment, determining the similarity between the target image and the first image based on the background similarity includes: determining behavioral information of the target image and the target behavior recorded in the first image, wherein the behavioral information includes behavioral type information and behavioral location information; comparing the behavioral similarity between the behavioral information recorded in the target image and the behavioral information recorded in the first image; and determining the similarity between the target image and the first image based on the background similarity and the behavioral similarity.
[0010] In an exemplary embodiment, when it is determined that the similarity between the target image and the first image exceeds a similarity threshold, the method further includes: determining the number of cached images continuously captured by the target imaging device within a target time period, wherein the target time period includes the target time and the first time, and the preset point information of the target imaging device within the target time period is always the preset preset point information; when it is determined that the number reaches a number threshold, stitching the cached images captured by the target imaging device within the target time period to obtain a stitched image; and reporting the stitched image.
[0011] In one exemplary embodiment, after obtaining the analysis result, the method further includes: discarding the target multimedia information if it is determined based on the analysis result that the target behavior does not exist in the target multimedia information.
[0012] According to another embodiment of the present invention, a recording device for target behavior is also provided, comprising: a first acquisition module, configured to acquire actual preset point information of a target shooting device at a target time; an analysis module, configured to analyze the behavior included in the target multimedia information captured by the target shooting device to determine an analysis result when it is determined that the actual preset point information is consistent with preset preset point information, wherein the preset preset point information is preset point information that the target shooting device needs to reach at the target time; and a first caching module, configured to cache a target image included in the target multimedia information when it is determined based on the analysis result that the target multimedia information includes target behavior, wherein the target image records the target behavior.
[0013] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0014] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0015] This invention obtains the actual preset point information of the target imaging device at the target time, and determines that the actual preset point information matches the preset preset point information that the target imaging device needs to reach at the target time. Then, it analyzes the behavior included in the target multimedia information captured by the target imaging device. When it is determined that the target multimedia information includes target behavior, the target image containing the target behavior is cached and recorded. This avoids the problems in related technologies where the captured multimedia information is inconsistent with the preset preset point due to possible human manipulation of the target imaging device, and the resulting inaccurate recording of target behavior. Therefore, it solves the problem of poor accuracy in target behavior recording methods in related technologies, achieving the effect of improving the accuracy of target behavior recording. Attached Figure Description
[0016] Figure 1 This is a block diagram of the mobile terminal hardware structure of the target behavior recording method according to an embodiment of the present invention;
[0017] Figure 2This is a flowchart of a method for recording target behavior according to an embodiment of the present invention;
[0018] Figure 3 This is a flowchart of a method for recording target behavior according to a specific embodiment of the present invention;
[0019] Figure 4 This is an example histogram diagram according to a specific embodiment of the present invention;
[0020] Figure 5 This is an example diagram of the detection frame intersection-union ratio according to a specific embodiment of the present invention;
[0021] Figure 6 This is an example diagram of image stitching according to a specific embodiment of the present invention;
[0022] Figure 7 This is a structural block diagram of a recording device for target behavior according to an embodiment of the present invention. Detailed Implementation
[0023] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0025] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a block diagram of the mobile terminal hardware structure of the target behavior recording method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the target behavior recording method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0028] This embodiment provides a method for recording target behavior. Figure 2 This is a flowchart of a method for recording target behavior according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0029] Step S202: Obtain the actual preset point information of the target shooting device at the target time;
[0030] Step S204: If it is determined that the actual preset point information is consistent with the preset preset point information, analyze the behavior included in the target multimedia information captured by the target shooting device to determine the analysis result, wherein the preset preset point information is the preset point information that the target shooting device needs to reach at the target time in advance.
[0031] Step S206: If, based on the analysis results, it is determined that the target multimedia information includes a target behavior, the target image included in the target multimedia information is cached, wherein the target image records the target behavior.
[0032] Through the above steps, by acquiring the actual preset point information of the target imaging device at the target time, and confirming that the actual preset point information is consistent with the preset preset point information that the target imaging device needs to reach at the target time, the behavior included in the target multimedia information captured by the target imaging device is analyzed. When it is determined that the target multimedia information includes target behavior, the target image containing the target behavior is cached and recorded. This avoids the problems in related technologies where the captured multimedia information is inconsistent with the preset preset point position due to possible human operation of the target imaging device, and the inaccuracy of the recorded target behavior. Therefore, it solves the problem of poor accuracy in target behavior recording methods in related technologies, and achieves the effect of improving the accuracy of target behavior recording.
[0033] The entity executing the above steps can be a monitoring system, such as an event monitoring system for management departments, a multimedia information processing device, a PTZ control device, a processor with human-computer interaction capabilities configured on a storage device, or a processing device or unit with similar processing capabilities, but is not limited to these. The following explanation uses a monitoring system performing the above operations as an example (this is merely an illustrative example; in actual operation, other devices or modules can also perform the above operations):
[0034] In the above embodiments, the monitoring system acquires the actual preset point information of the target shooting device (such as a camera, PTZ camera, or bullet camera) at the target time, and then compares the actual preset point information with the preset preset point information. Taking the need for the PTZ camera to capture images and collect evidence from multiple preset points in the rotation training of the monitoring system for handling events by the management department as an example, in practical applications, the PTZ camera periodically rotates to each preset point to capture images according to preset rules. It is also necessary to acquire the data that the PTZ camera captures images of a certain preset point (such as preset point A) multiple times (such as 2 times, 3 times, 4 times, or more) within a certain period of time to obtain the target information. Evidence of behavior, such as illegal parking, overflowing trash cans, or haphazardly piled materials; when the actual preset point information matches the pre-set preset point information, analyze the behavior included in the target multimedia information captured by the target shooting device to determine the analysis results. In practical applications, when it is necessary to obtain multiple snapshots of a preset preset point (such as preset point A) by a PTZ camera within a certain period of time, the target shooting device may rotate to another position due to human error or other reasons during this period. That is, the image captured by the target shooting device may not necessarily be the preset preset point (such as preset point A). The multimedia information captured by the target camera may not accurately reflect the target behavior. Therefore, it is necessary to obtain the actual preset point information at the target time and determine whether the actual preset point information is consistent with the preset preset point information. Only when the actual preset point information is consistent with the preset preset point information can the target behavior analyzed from the target multimedia information captured by the target camera be used as evidence. If the analysis results determine that the target multimedia information includes the target behavior, the target image included in the target multimedia information is cached. This target image records the target behavior. In practical applications, the target multimedia information may include video and / or target image, and the target image may be a frame included in the video, such as a vehicle illegally parking. In practical applications, in order to improve the accuracy of the recorded target behavior, it may be necessary to capture evidence at a certain preset point multiple times within a period of time. Only when it is determined that the actual preset point information is consistent with the preset threshold point information each time can the target behavior analyzed from each acquired target multimedia information be used as evidence for the management personnel to handle the event, and the target image is saved to record the target behavior. This avoids the problems existing in related technologies, such as the inconsistency between the captured multimedia information and the preset points caused by the possible human operation of the target shooting device, and the inaccuracy of the recorded target behavior. Therefore, it solves the problem of poor accuracy in the target behavior recording method in related technologies, and achieves the effect of improving the accuracy of target behavior recording.
[0035] In an optional embodiment, after caching the target image included in the target multimedia information, the method further includes: acquiring a first image captured by the target imaging device at a first moment, wherein the first moment is a moment before the target moment, and the preset point information of the target imaging device at the first moment is the preset preset point information; if it is determined that the similarity between the target image and the first image exceeds a similarity threshold, continuing to cache the target image; if it is determined that the similarity between the target image and the first image does not exceed the similarity threshold, deleting the target image and the first image. In this embodiment, after caching the target image corresponding to the target time, a first image of the first time, which has been pre-cached, is obtained. The target imaging device has the same preset point information corresponding to the first time and the target time. The first time can be a time when the time difference from the target time is less than a time difference threshold, for example, the time interval between the first time and the target time is 5 minutes, 10 minutes, or other time thresholds. The target image is then compared with the first image to determine their similarity. If the similarity between the target image and the first image is greater than or equal to a similarity threshold (such as 95%, 90%, or other values), the target image continues to be cached. Conversely, if the similarity is less than the similarity threshold, both the target image and the first image can be deleted, because events such as human manipulation of the target imaging device, such as manual rotation, may occur. In practical applications, similar methods to those in this embodiment can be used to compare the target image at the current moment with the target image at the previous moment multiple times (e.g., 3 times, 4 times, or other times). For example, the target image cached for the third time can be compared with the target image cached for the second time, and the target image cached for the fourth time can be compared with the target image cached for the third time, and so on. It should be noted that the second, third, and fourth times mentioned above all refer to the moment when the actual preset point is captured with the same preset point information. After comparing the target images multiple times (i.e., multiple different times) and determining that the similarity between the images all reaches the above similarity threshold, it is then determined that the target behavior recorded in the multiple target images is accurate, which improves the accuracy of the target behavior recording, that is, improves the reliability of the evidence chain.
[0036] In an optional embodiment, the method further includes: comparing the background similarity between the target background image included in the target image and the first background image included in the first image; and determining the similarity between the target image and the first image based on the background similarity. In this embodiment, the similarity between the target image and the first image is determined by comparing the similarity between the target background image in the target image and the background image in the first image. In practical applications, when it is necessary to acquire multiple (e.g., 4 times, or other times) snapshots of a preset point (e.g., preset point A) by a PTZ camera within a certain period of time, multiple (e.g., 4 times, or other numbers) target images need to be cached. At this time, it is necessary to compare the similarity of the 4 target images. Similarly, the background images included in the 4 target images can be compared pairwise. For example, the similarity between each pair of background images can be calculated. Through this embodiment, the situation where the preset point is moved away and then moved back to its original position during the analysis process can be eliminated, so as to further improve the accuracy of recording target behavior and further improve the reliability of the evidence chain.
[0037] In an optional embodiment, comparing the background similarity between a target background image included in the target image and a first background image included in the first image includes: determining the target histogram of the target image and the first histogram of the first image; calculating the distance between the target histogram and the first histogram to obtain a distance calculation result; and determining the background similarity based on the distance calculation result. In this embodiment, when comparing the similarity between the target background image and the first background image, the target histogram of the target image and the first histogram of the first image can be determined first, and then the distance between the target histogram and the first histogram can be calculated to determine the similarity between the target background image and the first background image. For example, in practical applications, the correlation calculation formula or other correlation calculation formulas can be used to calculate the distance between two histograms. Similarly, in some applications where multiple consecutive snapshots of the same preset point are needed to obtain multiple target images, the histograms of multiple target images can be determined first, and then the similarity between each pair of histograms can be calculated. Through this embodiment, the purpose of determining the similarity between the target background image and the first background image using the histogram distance calculation method is achieved.
[0038] In an optional embodiment, determining the similarity between the target image and the first image based on the background similarity includes: determining behavioral information of the target behavior recorded in the target image and the first image respectively, wherein the behavioral information includes behavioral type information and behavioral location information; comparing the behavioral similarity between the behavioral information recorded in the target image and the behavioral information recorded in the first image; and determining the similarity between the target image and the first image based on the background similarity and the behavioral similarity. In this embodiment, the behavioral information of the target behavior recorded in the target image and the first image can also be determined, and then the behavioral similarity between the behavioral information contained in the two images can be compared. The behavioral information may include behavioral type information, such as illegal parking of motor vehicles, illegal parking of non-motor vehicles, exposed garbage, and haphazardly piled materials. The behavioral information may also include behavioral location information, such as the location where the target behavior occurs in the target image and the first image. Then, the background similarity and behavioral similarity are combined to further determine the similarity between the target image and the first image. Through this embodiment, the accuracy of recording target behavior and the reliability of the evidence chain can be further improved.
[0039] In an optional embodiment, if it is determined that the similarity between the target image and the first image exceeds a similarity threshold, the method further includes: determining the number of cached images continuously captured by the target imaging device within a target time period, wherein the target time period includes the target time and the first time, and the preset point information of the target imaging device within the target time period is always the preset preset point information; if it is determined that the number reaches a number threshold, stitching together the cached images captured by the target imaging device within the target time period to obtain a stitched image; and reporting the stitched image. In this embodiment, when the similarity between the target image and the first image exceeds a similarity threshold (e.g., 95%, 90%, or other values), the number of cached images is determined. The cached images are obtained by analyzing multimedia information captured by the target camera at different times (including the target time and the first time) within a target time period (e.g., 10 minutes, 30 minutes, or other time periods), and are cached only when the actual preset point information at each time point is identical to the preset preset point information. When the number of images reaches a threshold (e.g., 3, 4, or other numbers), the cached images are stitched together to form an evidence chain image, which is then reported. For example, in practical applications, after the aforementioned analysis, comparison, and stitching, the management department's event monitoring system can report the evidence chain image (i.e., the stitched image) to relevant departments, other systems, or other devices, and can also store the evidence chain image (i.e., the stitched image). This embodiment achieves the purpose of stitching images recording target behavior, effectively solving the problems of low accuracy in recording target behavior and incomplete evidence chains in related technologies.
[0040] In an optional embodiment, after obtaining the analysis result, the method further includes: discarding the target multimedia information if it is determined from the analysis result that the target behavior does not exist in the target multimedia information. In this embodiment, when the target multimedia information captured by the target shooting device does not contain the target behavior, the target multimedia information can be discarded to save storage resources.
[0041] Obviously, the embodiments described above are only some embodiments of the present invention, and not all embodiments. The present invention will now be specifically described with reference to embodiments, taking the PTZ camera rotation training in the intelligent detection of an event monitoring system for management departments as an example.
[0042] Figure 3 This is a flowchart of a method for recording target behavior according to a specific embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0043] S302, the PTZ camera (corresponding to the aforementioned target shooting device) cycles to a certain point and caches the current preset point information (corresponding to the aforementioned preset point information);
[0044] S304, at the same time, the management rules of the management department configured with preset points are used to send the bit stream into the algorithm for intelligent analysis of the corresponding management department processing event monitoring system (corresponding to the target multimedia information captured by the aforementioned target shooting device);
[0045] S306, obtain the captured image and result (corresponding to the aforementioned analysis result, target image), and obtain the preset point information of the current PTZ camera (corresponding to the aforementioned actual preset point information) again through the result of intelligent algorithm analysis;
[0046] S308, determine whether the preset points before and after the analysis are consistent, that is, corresponding to the aforementioned comparison of actual preset point information and preset preset point information;
[0047] S310, if the judgment result of step 308 above is negative, discard the current analysis result and the previous analysis result of the preset point. That is, if they are inconsistent, it means that the PTZ camera rotates during the analysis process, which will cause misidentification. Then discard the current analysis result of the preset point and the cached result of the preset point before it, and continue to perform round-robin detection.
[0048] S312, if the judgment result of step 308 above is yes, further judge whether the multiple consecutive analysis of the same preset point is completed. That is, if the preset points before and after are consistent, then judge whether the multiple consecutive analysis of the same preset point is completed. That is, when analyzing the same preset point, the preset points before and after each analysis are consistent. Taking the identification of illegal parking of motor vehicles as an example, it is necessary to form the corresponding evidence chain through the results of four consecutive captures.
[0049] S314, if the judgment result of step 312 is negative, cache the preset point analysis result and return to step S302 to continue the polling; that is, if the preset points before and after are inconsistent, cache the current preset point analysis result and continue the polling detection.
[0050] S316, if the judgment result of step 312 above is yes, analyze the consistency of the captured background of multiple results; for example, if multiple consecutive captures have been completed at the same preset point, calculate the background similarity (corresponding to the aforementioned background similarity) by performing pairwise histogram calculations on the multiple results. The histogram distance calculation uses the correlation calculation formula as follows: in When the distance between the histograms of multiple captured images is close to 0, it indicates that the backgrounds are likely similar. This process can rule out the possibility that the preset points were moved and then moved back to their original positions during the analysis, thus initially ruling out the possibility of inconsistent scenes. Figure 4 This is an example histogram diagram according to a specific embodiment of the present invention. Figure 4 The following are examples of histograms for different scenarios;
[0051] S318, Determine if the background is consistent;
[0052] S320, if the judgment result of step 318 is yes, and if the distance of the histogram in step S316 is close to 0, analyze the consistency of the target (corresponding to the behavioral information of the aforementioned target behavior) of multiple results. For example, judge whether the type (corresponding to the aforementioned behavioral type information) of the target analysis results is the same. In the event detection handled by the management department, the target types include illegal parking of motor vehicles, illegal parking of non-motor vehicles, exposed garbage, overflowing garbage cans, and random dumping of materials. If the target types are consistent, the target detection frame intersection and comparison calculation can be further performed to determine whether the target is in the same position (corresponding to the aforementioned behavioral position information). If the type and position of the consecutive captures at the same preset point are consistent, it indicates that the current detection is a normal result. Otherwise, discard the current detection result and the previous detection results at the preset point, and continue to perform round-robin detection.
[0053] The intersection-union ratio of the above detection frames can be calculated using the formula. Calculate, where A∩B is the intersection of the two detection regions, and A∪B is the union of all regions of the two detection regions. Figure 5 This is an example diagram of the intersection-union ratio (IOU) of detection boxes according to a specific embodiment of the present invention. The larger the IOU, the more overlapping parts the two detection boxes have. If the judgment result of step 318 is negative, return to step S310 and discard the current analysis result and the analysis result before the preset point.
[0054] It should be noted that in practical applications, even after the above steps S302-S318 and the determination that the background is consistent, the possibility of similar backgrounds still cannot be ruled out. In order to improve the completeness and credibility of the evidence chain, it is also necessary to analyze the consistency of the target of multiple results.
[0055] S322, Determine if the target is consistent;
[0056] S324, if the judgment result of step 322 above is yes, that is, when the target is consistent, the images of multiple consecutive moments at the same preset point are stitched together to form an evidence chain image, and the result is reported, stored and displayed. At the same time, the detection continues. Taking the detection of illegal parking of non-motorized vehicles by the management department as an example, Figure 6This is an example of image stitching according to a specific embodiment of the present invention; it should be noted that if the judgment result of step 322 is negative, the process returns to step S310, and the current analysis result and the analysis result before the preset point are discarded.
[0057] In related technologies, a single PTZ camera is used to analyze multiple preset points through a rotational training method. Since the evidence chain required by management departments is the result of multiple snapshots of a continuous period of violation, the PTZ camera may be manually moved to a preset point to check information during the rotational training and analysis process due to human error. This situation can occur: while the PTZ camera is being analyzed at a preset point, it may be manually moved to another point. In this case, the analysis results will generate many false alarms, and the identified snapshots may not be from the preset points. Since the preset points are captured multiple times, the backgrounds in the stitched results will be different, making it impossible to collect evidence of illegal parking.
[0058] In the above embodiment, when the PTZ camera is training at a preset point, the current preset point information is first cached, and the bitstream is sent to the algorithm for detection. At the end of the detection, the current preset point information is retrieved. If the preset points are inconsistent, there is a possibility that the PTZ camera has been manipulated. The current detection and the cached data from previous detections at that preset point are discarded. If they are consistent and the preset point is consistent in multiple consecutive detections, further background consistency and target consistency checks are performed. If the background and target are consistent multiple times, image stitching is performed to form an evidence chain, and the results are stored and displayed. That is, in the process of capturing multiple images of the same preset point to form an evidence chain, erroneous images or results caused by human operation are excluded, ensuring that multiple consecutively captured images are consistent and guaranteeing the completion of the evidence chain.
[0059] Through the embodiments of this invention, by comparing preset points before and after analysis, the problem of misidentification caused by inconsistencies in the PTZ camera positions before and after analysis is eliminated; by comparing the histogram similarity of images captured multiple times at the same preset point, the consistency of the captured background is determined, thus solving the problem of misidentification caused by PTZ camera movement during background analysis; by calculating the intersection-union ratio of violation types and violation detection boxes in images captured multiple times at the same preset point and the analysis results, it is finally confirmed that the images are captured at multiple times at the same preset point, thereby improving the accuracy of evidence chain detection; the evidence chain detection method provided by the embodiments of this invention can effectively solve the problem of incomplete or erroneous evidence captured at multiple times.
[0060] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0061] This embodiment also provides a device for recording target behavior. Figure 7 This is a structural block diagram of a recording device for target behavior according to an embodiment of the present invention, such as... Figure 7 As shown, the device includes:
[0062] The first acquisition module 702 is used to acquire the actual preset point information of the target shooting device at the target time;
[0063] Analysis module 704 is used to analyze the behavior included in the target multimedia information captured by the target shooting device when it is determined that the actual preset point information is consistent with the preset preset point information, so as to determine the analysis result. The preset preset point information is the preset point information that the target shooting device needs to reach at the target time in advance.
[0064] The first caching module 706 is used to cache a target image included in the target multimedia information when it is determined from the analysis results that the target multimedia information includes a target behavior, wherein the target image records the target behavior.
[0065] In an optional embodiment, the above apparatus further includes: a second acquisition module, configured to acquire a first image captured by the target imaging device at a first moment after caching the target image included in the target multimedia information, wherein the first moment is a moment before the target moment, and the preset point information of the target imaging device at the first moment is the preset preset point information; a second caching module, configured to continue caching the target image if it is determined that the similarity between the target image and the first image exceeds a similarity threshold; and a deletion module, configured to delete the target image and the first image if it is determined that the similarity between the target image and the first image does not exceed a similarity threshold.
[0066] In an optional embodiment, the above apparatus further includes: a comparison module, configured to compare the background similarity between a target background image included in the target image and a first background image included in the first image; and a first determination module, configured to determine the similarity between the target image and the first image based on the background similarity.
[0067] In an optional embodiment, the comparison module includes: a first determining unit, configured to determine the target histogram of the target image and the first histogram of the first image; a calculation unit, configured to calculate the distance between the target histogram and the first histogram to obtain a distance calculation result; and a second determining unit, configured to determine the background similarity based on the distance calculation result.
[0068] In an optional embodiment, the first determining module includes: a third determining unit, configured to determine the behavior information of the target image and the target behavior recorded in the first image respectively, wherein the behavior information includes behavior type information and behavior location information; a comparison unit, configured to compare the behavior similarity between the behavior information recorded in the target image and the behavior information recorded in the first image; and a fourth determining unit, configured to determine the similarity between the target image and the first image based on the background similarity and the behavior similarity.
[0069] In an optional embodiment, the above apparatus further includes: a second determining module, configured to determine the number of cached images continuously captured by the target imaging device within a target time period when the similarity between the target image and the first image exceeds a similarity threshold, wherein the target time period includes the target time and the first time, and the preset point information of the target imaging device within the target time period is always the preset preset point information; a stitching module, configured to stitch the cached images captured by the target imaging device within the target time period to obtain a stitched image when the number reaches a number threshold; and a reporting module, configured to report the stitched image.
[0070] In an optional embodiment, the above apparatus further includes: a discarding module, configured to discard the target multimedia information after obtaining the analysis result and if it is determined based on the analysis result that the target behavior does not exist in the target multimedia information.
[0071] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0072] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0073] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0074] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0075] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0076] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0077] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0078] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for recording target behavior, characterized in that, include: Obtain the actual preset point information of the target imaging device at the target time; If the actual preset point information is consistent with the preset preset point information, the behavior included in the target multimedia information captured by the target shooting device is analyzed to determine the analysis result. The preset preset point information is the preset point information that the target shooting device needs to reach at the target time. If, based on the analysis results, it is determined that the target multimedia information includes a target behavior, the target image included in the target multimedia information is cached, wherein the target image records the target behavior; After caching the target image included in the target multimedia information, the method further includes: acquiring a first image captured by the target shooting device at a first moment, wherein the first moment is a moment before the target moment, and the preset point information of the target shooting device at the first moment is the preset preset point information; if it is determined that the similarity between the target image and the first image exceeds a similarity threshold, continuing to cache the target image; if it is determined that the similarity between the target image and the first image does not exceed the similarity threshold, deleting the target image and the first image.
2. The method according to claim 1, characterized in that, The method further includes: Compare the background similarity between the target background image included in the target image and the first background image included in the first image; The similarity between the target image and the first image is determined based on the background similarity.
3. The method according to claim 2, characterized in that, Comparing the background similarity between the target background image included in the target image and the first background image included in the first image includes: Determine the target histogram of the target image, and the first histogram of the first image; Calculate the distance between the target histogram and the first histogram to obtain the distance calculation result; The background similarity is determined based on the distance calculation results.
4. The method according to claim 2, characterized in that, Determining the similarity between the target image and the first image based on the background similarity includes: Determine the behavioral information of the target image and the target behaviors recorded in the first image, wherein the behavioral information includes behavioral type information and behavioral location information; Compare the behavioral similarity between the behavioral information recorded in the target image and the behavioral information recorded in the first image; The similarity between the target image and the first image is determined based on the background similarity and the behavior similarity.
5. The method according to claim 1, characterized in that, If it is determined that the similarity between the target image and the first image exceeds a similarity threshold, the method further includes: Determine the number of images continuously captured by the target imaging device within a target time period, wherein the target time period includes the target time and the first time, and the preset point information of the target imaging device within the target time period is always the preset preset point information; If the quantity reaches the quantity threshold, the images captured by the target shooting device within the target time period that have been cached are stitched together to obtain a stitched image. The stitched image is reported.
6. The method according to claim 1, characterized in that, After obtaining the analysis results, the method further includes: If the analysis results determine that the target multimedia information does not contain the target behavior, the target multimedia information is discarded.
7. A device for recording target behavior, characterized in that, include: The first acquisition module is used to acquire the actual preset point information of the target shooting device at the target time; The analysis module is used to analyze the behavior included in the target multimedia information captured by the target shooting device when it is determined that the actual preset point information is consistent with the preset preset point information, so as to determine the analysis result. The preset preset point information is the preset point information that the target shooting device needs to reach at the target time in advance. A first caching module is configured to cache a target image included in the target multimedia information when it is determined, based on the analysis results, that the target multimedia information includes a target behavior, wherein the target image records the target behavior; The device is further configured to: after caching the target image included in the target multimedia information, acquire a first image captured by the target shooting device at a first moment, wherein the first moment is a moment before the target moment, and the preset point information of the target shooting device at the first moment is the preset preset point information; continue caching the target image if it is determined that the similarity between the target image and the first image exceeds a similarity threshold; and delete the target image and the first image if it is determined that the similarity between the target image and the first image does not exceed a similarity threshold.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 6.
9. 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 computer program, it implements the steps of the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Smoking behavior detection method and device, terminal and readable storage medium
CN110705383A
Camera shooting method, camera shooting device, electronic equipment and storage medium
CN112511740A