A monitoring image storage method and system
Through the target tracking algorithm and optical flow direction clustering technology, moving image blocks in the monitoring image are divided and stored, which solves the problem of large storage occupancy of monitoring images and realizes a more efficient storage solution.
Patent Information
- Application Number
- CN202510163843.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-02-14
AI Technical Summary
When the existing monitoring image storage method detects a moving object, it ignores the motion information of the moving object, resulting in the storage of the monitoring image occupying more storage resources.
Multiple monitoring images of the moving target are obtained through the target tracking algorithm, the moving target is divided into multiple moving image blocks, and the relative optical flow direction of the moving image blocks in each monitoring image relative to the starting monitoring image is calculated. The moving image blocks are clustered according to the relative optical flow direction, cluster clusters are obtained and clustered and the cluster center and the moving image block distribution map are stored.
It reduces the storage space of monitoring images, saves storage resources, and achieves higher compression rates and lower storage requirements by clustering and storing moving image blocks with the greatest clarity.
Smart Images

Figure CN119622019B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a monitoring image storage method and system. Background Art
[0002] Security monitoring is mainly used to monitor the movement of moving targets in a specific area. It is often necessary to store monitoring images in order to provide strong video evidence when problems arise later. However, since monitoring equipment is collecting monitoring images all the time, if all monitoring images are stored, a large amount of storage resources will be consumed, which brings great challenges to the storage of monitoring images.
[0003] At present, a patent application document with publication number CN103826109A discloses a video surveillance image data processing method and system, wherein the method includes: performing motion detection on the acquired current frame image data, and when it is detected that there is no moving object in the current frame image, reducing the resolution of the current frame image data and storing it in video format; otherwise, while reducing the resolution of the current frame image data and storing it as a video, counting the number of frames of original resolution images with moving objects saved in the form of pictures within one second before the current frame image data is acquired, and if the frame value does not exceed a preset threshold, saving the current frame image data in the form of a picture with the original resolution; or, starting from the current frame image data, saving all frame image data acquired within a subsequent preset time with the original resolution.
[0004] The above method determines the resolution of the current frame image data based on whether there is a moving object in the current frame image data, and reduces the storage pressure of the video data by adjusting the resolution of the current frame image data. However, when a moving object is detected in the current frame image, in the process of saving all frame image data acquired within a subsequent preset time at the original resolution, the influence of the motion information of the moving object on the monitoring image storage process is ignored, resulting in the storage of the monitoring image occupying more storage resources. Summary of the invention
[0005] In order to solve the technical problem that the storage of surveillance images occupies a large amount of storage resources, the present application provides a surveillance image storage method and system, which can reduce the storage space of surveillance images and save storage resources.
[0006] In a first aspect of the present application, a monitoring image storage method is provided, the storage method comprising: in response to monitoring a moving target, acquiring multiple monitoring images of the moving target according to a target tracking algorithm; dividing the moving target into multiple moving image blocks, the movement of each pixel in the moving image block is the same; for any moving image block, calculating the relative optical flow direction of the moving image block in each monitoring image relative to the starting monitoring image, clustering the moving image blocks in each monitoring image according to the relative optical flow direction, acquiring multiple clustering clusters, and taking the moving image block with the highest clarity in the clustering cluster as the clustering center; acquiring a distribution map of the moving image blocks of each monitoring image, the moving image block distribution map comprising a moving image block position distribution map and a moving image block cluster distribution map; storing all clustering centers of each moving image block and the moving image block distribution map of each monitoring image to complete the storage of the multiple monitoring images.
[0007] According to the target tracking algorithm, multiple monitoring images of the moving target are determined, and the position information of the moving target in each monitoring image can be obtained; the moving target is divided into multiple moving image blocks, and the movement of each pixel in a moving image block is the same; for any moving image block, the relative optical flow direction of the moving image block in each monitoring image relative to the starting monitoring image is calculated, and the relative optical flow direction can reflect the change in the viewing angle of the moving image block relative to the starting monitoring image, and the moving image blocks in all monitoring images are clustered according to the relative optical flow direction to obtain multiple cluster clusters, and the moving image blocks in the same cluster cluster are at the same viewing angle, and their image information is consistent, and the moving image block with the largest clarity in a cluster cluster is used as the cluster center; further, all cluster centers of each moving image block and the moving image block distribution map of each monitoring image are stored to complete the storage of the multiple monitoring images; the moving image block distribution map only contains the position information and cluster information of the moving image block, and does not contain complex image textures. Compared with directly compressing and storing the monitoring image, compressing and storing the moving image block distribution map can obtain a higher compression rate, reduce the storage space occupied, reduce the storage space of the monitoring image, and save storage resources.
[0008] Preferably, obtaining multiple monitoring images of a moving target based on a target tracking algorithm includes: obtaining a difference map between a real-time monitoring image and a background image, wherein the difference map is a binary map; performing a connected domain analysis on the difference map to obtain the area of a foreground region, and in response to the area of the foreground region being greater than an area threshold, using the real-time monitoring image as a starting monitoring image, wherein the foreground region corresponds to the moving target; using a target tracking algorithm to obtain position information of the moving target in each monitoring image after the starting monitoring image, until the moving target cannot be detected, using the starting monitoring image and monitoring images captured after the starting monitoring image as multiple monitoring images of the moving target.
[0009] For any moving target, multiple monitoring images of the moving target are accurately collected from the time the moving target enters the monitoring area to the time it leaves the monitoring area, and the target tracking algorithm can be used to accurately determine the position information of the moving target in each monitoring image.
[0010] Preferably, dividing the moving target into a plurality of moving image blocks comprises: obtaining the optical flow difference of each pixel point in the moving target, and pixels Optical flow difference for:
[0011] , To monitor the number of images, To monitor images Pixels in the moving target and pixels The angle between the directions of the optical flow, and To monitor images Pixels in the moving target and pixels The optical flow size is defined; a first clustering distance is defined, and each pixel point of the moving target is clustered by distance to obtain a plurality of moving image blocks, wherein the first clustering distance is positively correlated with the optical flow difference.
[0012] Since the motion conditions of different parts of the moving target are different, the different parts of the moving target have different viewing angles relative to the acquisition device of the monitoring image. and pixels The optical flow difference is calculated based on the differences in the optical flow direction and size in all monitoring images, and clustering is performed based on the optical flow difference to divide the moving targets into multiple moving image blocks to ensure that the movement of each pixel in a moving image block is the same.
[0013] Preferably, the pixel points in the moving target and pixels The first cluster distance for:
[0014] , Pixel and pixels The optical flow difference of Pixel and pixels The Euclidean distance of .
[0015] Preferably, distance clustering is performed on each pixel point of the moving target to obtain multiple moving image blocks, including: setting an initial clustering number, using distance clustering to obtain initial blocks with the initial clustering number; calculating the optical flow difference between any pixel points in the initial block, and taking the maximum optical flow difference as the clustering evaluation of the initial block; in response to the clustering evaluation of any initial block being greater than an evaluation threshold, performing distance clustering with a clustering number of 2 on the pixel points in the initial block, and stopping when the clustering evaluations of all initial blocks are no greater than the evaluation threshold, and taking the obtained initial blocks as moving image blocks.
[0016] The initial blocks that do not meet the clustering evaluation are clustered again with a clustering number of 2 until the clustering evaluation of all initial blocks is no greater than the evaluation threshold, ensuring that the maximum value of the optical flow difference in each motion image block is no greater than the evaluation threshold, that is, ensuring that the motion of each pixel in a motion image block is the same.
[0017] Preferably, the monitoring image Medium motion image block Relative optical flow direction relative to the starting surveillance image satisfy: , To monitor images Medium motion image block The direction of optical flow.
[0018] The moving image block in the starting monitoring image The visual angle is marked as 0, and the motion image block is calculated based on this The relative optical flow direction of the monitoring image Medium motion image block Precise quantification of viewing angle.
[0019] Preferably, the motion image blocks in each monitoring image are clustered according to the relative optical flow direction to obtain multiple cluster clusters, including: defining the absolute value of the difference in the relative optical flow direction as a second cluster distance, and using Kmeans clustering to cluster the motion image blocks in each monitoring image to obtain multiple cluster clusters.
[0020] The motion image blocks in each monitoring image are clustered according to the relative optical flow direction to obtain multiple clustering clusters, and the motion image blocks with the same relative optical flow direction are clustered into one category. One relative optical flow direction corresponds to one viewing angle, that is, the motion image blocks with the same viewing angle are clustered into one category.
[0021] Preferably, the method for calculating the definition includes: calculating the gradient value of each pixel in the motion image block, and taking the average value of the gradient value as the definition.
[0022] Preferably, the motion image block corresponds to a block ID, the cluster cluster corresponds to a cluster ID, and the acquisition of the motion image block distribution map of each monitoring image includes: setting the pixel value of a pixel point in any motion image block in the monitoring image to the corresponding block ID, and setting the pixel value of a pixel point outside the motion image block to 0, to obtain a motion image block position distribution map; setting the pixel value of a pixel point in any motion image block in the monitoring image to the cluster ID of the cluster cluster to which it belongs, and setting the pixel value of a pixel point outside the motion image block to 0, to obtain a motion image block cluster class distribution map.
[0023] In a second aspect of the present application, a monitoring image storage system is also provided, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a monitoring image storage method according to the first aspect of the present application is implemented.
[0024] The technical solution of this application has the following beneficial technical effects:
[0025] According to the target tracking algorithm, multiple monitoring images of the moving target are determined, and the position information of the moving target in each monitoring image can be obtained; the moving target is divided into multiple moving image blocks, and the movement of each pixel in a moving image block is the same; for any moving image block, the relative optical flow direction of the moving image block in each monitoring image relative to the starting monitoring image is calculated, and the relative optical flow direction can reflect the change in the viewing angle of the moving image block relative to the starting monitoring image. The moving image blocks in all monitoring images are clustered according to the relative optical flow direction to obtain multiple clustering clusters. The moving image blocks in the same clustering cluster are at the same viewing angle, and their image information Keep consistent, and take the motion image block with the highest definition in a cluster as the cluster center; further, store all cluster centers of each motion image block and the motion image block distribution map of each monitoring image to complete the storage of the multiple monitoring images; the motion image block distribution map only contains the position information and cluster information of the motion image block, and does not contain complex image textures. Compared with directly compressing and storing the monitoring image, compressing and storing the motion image block distribution map can obtain a higher compression rate and reduce the storage space occupied; and a motion image block with the highest definition is stored in a cluster, which reduces the storage space of the monitoring image and saves storage resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0027] Figure 1is a flow chart of a monitoring image storage method according to an embodiment of the present application;
[0028] Figure 2 It is a structural block diagram of a monitoring image storage system according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0030] It should be understood that when the terms "first", "second", etc. are used in the claims, specification and drawings of the present application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.
[0031] According to a first aspect of the present application, the present application provides a monitoring image storage method. Figure 1 FIG. 1 is a flow chart of a monitoring image storage method according to an embodiment of the present application. Figure 1 As shown, the monitoring image storage method includes steps S101 to S105, which are described in detail below.
[0032] S101, in response to detecting a moving target, acquiring multiple monitoring images of the moving target according to a target tracking algorithm.
[0033] In one embodiment, obtaining multiple monitoring images of a moving target based on a target tracking algorithm includes: obtaining a difference map between a real-time monitoring image and a background image, wherein the difference map is a binary map; performing a connected domain analysis on the difference map to obtain the area of a foreground region, and in response to the area of the foreground region being greater than an area threshold, using the real-time monitoring image as a starting monitoring image, wherein the foreground region corresponds to the moving target; using a target tracking algorithm to obtain position information of the moving target in each monitoring image after the starting monitoring image, until the moving target cannot be detected, using the starting monitoring image and monitoring images collected after the starting monitoring image as multiple monitoring images of the moving target.
[0034] Wherein, the background image is a monitoring image when there is no moving object, and the difference image satisfies the relationship: , To monitor images in real time Medium pixel The pixel value of is the pixel in the background image The pixel value of is the pixel threshold, is the pixel point in the difference map The pixel value of .
[0035] The area threshold is 5 and the pixel threshold is 2.
[0036] The target tracking algorithm may adopt an existing target tracking algorithm such as DeepSort, SeqTrack or a target tracking algorithm based on the optical flow method, and this application does not impose any restrictions. The target tracking algorithm can be used to determine the position information of the moving target in the monitoring image. The position information may be a mask image (the pixel value of the pixel point in the moving target area is 1, and the pixel value of the pixel point outside the moving target area is 0), or it may be a bounding box of the moving target.
[0037] In this way, for any moving target, multiple monitoring images of the moving target are collected from the time the moving target enters the monitoring area to the time it leaves the monitoring area, and the target tracking algorithm can be used to determine the position information of the moving target in each monitoring image.
[0038] S102, dividing the moving target into a plurality of moving image blocks, wherein the movement conditions of the pixels in the moving image blocks are the same.
[0039] In one embodiment, the moving target may be a pedestrian or a vehicle. Since the movement conditions of different parts of the moving target may be different, there will be differences in the viewing angles of different parts of the moving target relative to the acquisition device of the monitoring image. For example, the viewing angle of the moving target in the initial monitoring image is defined as a standard viewing angle, and the moving target is a pedestrian. If in the next monitoring image, the optical flow direction of the pedestrian's arm is 20 degrees, and the optical flow direction of the pedestrian's head is 10 degrees, then different areas (arms and head) of the same moving target in the next monitoring image are at different viewing angles; therefore, it is necessary to first divide the moving target to obtain multiple moving image blocks, and the movement conditions of each pixel in a moving image block are the same to ensure that the viewing angle within a moving image block in each monitoring image is exactly the same.
[0040] Specifically, dividing the moving target into a plurality of moving image blocks includes: obtaining the optical flow difference of each pixel point in the moving target, and pixels Optical flow difference for:
[0041] , To monitor the number of images, To monitor images Pixels in the moving target and pixels The angle between the directions of the optical flow, and To monitor images Pixels in the moving target and pixels The optical flow size is defined; a first clustering distance is defined, and each pixel point of the moving target is clustered by distance to obtain a plurality of moving image blocks, wherein the first clustering distance is positively correlated with the optical flow difference.
[0042] The distance clustering adopts a distance-based clustering algorithm such as Kmeans or Kmeans++; the pixel points in the moving target and pixels The first cluster distance for: , Pixel and pixels The optical flow difference of Pixel and pixels The Euclidean distance of .
[0043] Understandably, for the pixels in the moving target and pixels For , the angle of the optical flow direction tends to 0, and the absolute value of the difference in the optical flow size tends to 0, indicating that the pixel and pixels The more the movement of Able to reflect surveillance images Pixels in the moving target and pixels The smaller the value, the smaller the pixel and pixels The smaller the difference in motion, the larger the value, and the pixel and pixels The greater the difference in motion, the greater the difference in motion; if the pixels in the moving target in all surveillance images and pixels The maximum value of the motion difference is equal to 0. At this time, the pixel and pixels Optical flow difference Equal to 0, indicating a pixel and pixels The movement of the pixel always remains the same. and pixels Divided into the same motion image block.
[0044] It can be understood that the target tracking algorithm can be used to determine the position information of each pixel point in monitoring image 1 in monitoring image 2, and realize the one-to-one correspondence between each pixel point in monitoring image 1 and monitoring image 2. The position in each monitoring image, thereby achieving optical flow difference Calculation.
[0045] The direction and magnitude of the optical flow can reflect the movement direction and speed of the pixel points. The acquisition of the direction and magnitude of the optical flow is a well-known technique for those skilled in the art and will not be described in detail here.
[0046] In one embodiment, distance clustering is performed on each pixel point of a moving target to obtain a plurality of moving image blocks, including: setting an initial clustering number, and obtaining initial blocks having the initial clustering number by using distance clustering; calculating the optical flow difference between any pixel points in the initial block, and taking the maximum optical flow difference as the clustering evaluation of the initial block; in response to the clustering evaluation of any initial block being greater than an evaluation threshold, performing distance clustering with a clustering number of 2 on the pixel points in the initial block, and stopping when the clustering evaluations of all initial blocks are no greater than the evaluation threshold, and taking the obtained initial blocks as moving image blocks.
[0047] The initial number of clusters is not less than 2. In this embodiment, the initial number of clusters is set to 2.
[0048] In this way, the moving target is divided into multiple moving image blocks, and the movement conditions of each pixel in each moving image block are the same. The movement conditions include the optical flow direction and the optical flow size. The optical flow direction is used to reflect the movement direction, which can change the viewing angle of the moving image block in the monitoring image; the optical flow size is used to reflect the movement speed, which can change the position of the moving image block in the monitoring image; that is to say, the position and viewing angle of each pixel in the moving image block in each monitoring image are the same. When storing subsequently, for a moving image block, only the moving image blocks under different viewing angles need to be stored, and the moving image blocks under the same viewing angle only need to be stored once, thereby reducing redundant information in the monitoring image storage process.
[0049] S103, for any motion image block, calculate the relative optical flow direction of the motion image block in each monitoring image relative to the starting monitoring image, cluster the motion image blocks in each monitoring image according to the relative optical flow direction, obtain multiple clusters, and take the motion image block with the highest clarity in the cluster as the cluster center.
[0050] In one embodiment, monitoring images Medium motion image block The relative optical flow direction relative to the starting surveillance image can reflect the surveillance image Medium motion image block The moving image block in the starting monitoring image (monitoring image 1) The viewing angle is marked as 0. If the moving image block in the monitoring image 2 The direction of optical flow is Degree, monitoring image 3 in the moving image block The direction of optical flow is degree, then the moving image block in monitoring image 2 The relative optical flow direction relative to the starting monitoring image is , monitoring image 3 in the moving image block The relative optical flow direction relative to the starting monitoring image is ; Monitoring image 2 in the moving image block The perspective is , monitoring image 3 in the moving image block The perspective is .
[0051] Specifically, monitoring images Medium motion image block Relative optical flow direction relative to the starting surveillance image satisfy: , To monitor images Medium motion image block It can be understood that since the motion of a moving image block is the same, the monitoring image Medium motion image block The optical flow direction of the monitoring image Motion picture blocks The optical flow direction of any pixel in .
[0052] Clustering the motion image blocks in each monitoring image according to the relative optical flow direction to obtain multiple clustering clusters, clustering the motion image blocks with the same relative optical flow direction into one category, one relative optical flow direction corresponds to one viewing angle, that is, clustering the motion image blocks with the same viewing angle into one category. Specifically, clustering the motion image blocks in each monitoring image according to the relative optical flow direction to obtain multiple clustering clusters includes: defining the absolute value of the difference in the relative optical flow direction as a second clustering distance, clustering the motion image blocks in each monitoring image using Kmeans clustering, and obtaining multiple clustering clusters.
[0053] Among them, a cluster contains at least one motion image block, and the viewing angles of these motion image blocks are the same. In order to reduce redundant information in the storage process of monitoring images, only one motion image block in a cluster needs to be stored. Therefore, the motion image block with the highest definition is stored, and the motion image block with the highest definition in a cluster is used as the cluster center of the cluster.
[0054] The method for calculating the definition is: calculating the gradient value of each pixel in the motion image block, and taking the average value of the gradient value as the definition.
[0055] In this way, multiple perspectives of a motion image block in multiple surveillance images (one cluster corresponds to one perspective) and the cluster center under each perspective are obtained.
[0056] S104, obtaining a motion image block distribution map of each monitoring image, wherein the motion image block distribution map includes a motion image block position distribution map and a motion image block cluster distribution map.
[0057] In one embodiment, the motion image block corresponds to a block ID, the cluster cluster corresponds to a cluster ID, and obtaining the motion image block distribution map of each monitoring image includes: setting the pixel value of a pixel point in any motion image block in the monitoring image to the corresponding block ID, and setting the pixel values of all pixel points outside the motion image block to 0, to obtain a motion image block position distribution map; setting the pixel value of a pixel point in any motion image block in the monitoring image to the cluster ID of the cluster cluster to which it belongs, and setting the pixel values of all pixel points outside the motion image block to 0, to obtain a motion image block cluster class distribution map.
[0058] Among them, the position information of any moving image block in the monitoring image can be obtained by using the target tracking algorithm.
[0059] In this way, a motion image block distribution map of any surveillance image is obtained. The motion image block distribution map only contains the location information and cluster information of the motion image blocks, and does not contain complex image textures. Compared with directly compressing and storing the surveillance image, compressing and storing the motion image block distribution map can obtain a higher compression rate and reduce the storage space occupied.
[0060] S105, storing all cluster centers of each motion image block and a motion image block distribution diagram of each monitoring image, and completing the storage of the plurality of monitoring images.
[0061] In one embodiment, a motion image block corresponds to at least one cluster center, and a cluster center may be an image feature of the motion image block under a certain viewing angle. All cluster centers of each motion image block and the motion image block distribution map of each monitoring image are stored to complete the storage of multiple monitoring maps. Before storing all cluster centers of each motion image block and the motion image block distribution map of each monitoring image, Huffman coding may be used to encode and compress all cluster centers of each motion image block and the motion image block distribution map of each monitoring image, and then the coding and compression results are stored.
[0062] Understandably, during the decompression process, the surveillance image is obtained The distribution diagram of motion image blocks. For example, according to the motion image block The location information and cluster information of the cluster information are pasted on the corresponding location information to form a monitoring image. The complete image of the moving target in the video is obtained. Since the background image is a monitoring image when there is no moving object, the complete image of the moving target and the background image are spliced together to realize the decompression of the monitoring image and obtain a clear and complete monitoring image.
[0063] The technical principles and implementation details of a surveillance image storage method of the present application are introduced above through specific embodiments. According to the target tracking algorithm, multiple surveillance images of the moving target are determined, and the position information of the moving target in each surveillance image can be obtained; the moving target is divided into multiple motion image blocks, and the motion conditions of each pixel in a motion image block are the same; for any motion image block, the relative optical flow direction of the motion image block in each surveillance image relative to the starting surveillance image is calculated, and the relative optical flow direction can reflect the change in the viewing angle of the motion image block relative to the starting surveillance image, and the motion image blocks in all surveillance images are clustered according to the relative optical flow direction to obtain multiple clustering clusters. The motion image blocks in the same clustering cluster are at the same viewing angle, and their image information Keep consistent, and take the motion image block with the highest definition in a cluster as the cluster center; further, store all cluster centers of each motion image block and the motion image block distribution map of each monitoring image to complete the storage of the multiple monitoring images; the motion image block distribution map only contains the position information and cluster information of the motion image block, and does not contain complex image textures. Compared with directly compressing and storing the monitoring image, compressing and storing the motion image block distribution map can obtain a higher compression rate and reduce the storage space occupied; and a motion image block with the highest definition is stored in a cluster, which reduces the storage space of the monitoring image and saves storage resources.
[0064] According to the second aspect of the present application, the present application also provides a monitoring image storage system. Figure 2is a structural block diagram of a monitoring image storage system according to an embodiment of the present application. Figure 2 As shown, the system 50 includes a processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a monitoring image storage method according to the first aspect of the present application is implemented. The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, whose settings and functions are known in the art, so they are not described here.
[0065] In the present application, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in this application may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0066] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0067] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A monitoring image storage method, characterized in that: The storage method comprises: In response to detecting a moving target, acquiring multiple monitoring images of the moving target according to a target tracking algorithm; Divide the moving target into multiple moving image blocks, including: obtaining the optical flow difference of each pixel in the moving target, and pixels Optical flow difference for: , To monitor the number of images, To monitor images Pixels in the moving target and pixels The angle between the directions of the optical flow, and To monitor images Pixels in the moving target and pixels The optical flow size is defined; a first clustering distance is defined, and each pixel point of the moving target is clustered by distance to obtain a plurality of moving image blocks, wherein the first clustering distance is positively correlated with the optical flow difference; the movement of each pixel point in the moving image block is the same; For any motion image block, calculate the relative optical flow direction of the motion image block in each monitoring image relative to the starting monitoring image, cluster the motion image blocks in each monitoring image according to the relative optical flow direction, obtain multiple clusters, and take the motion image block with the largest clarity in the cluster as the cluster center; Monitoring images Medium motion image block Relative optical flow direction relative to the starting surveillance image satisfy: , To monitor images Medium motion image block The direction of optical flow; Acquire a motion image block distribution map of each monitoring image, wherein the motion image block distribution map includes a motion image block position distribution map and a motion image block cluster distribution map; All cluster centers of each motion image block and the motion image block distribution diagram of each monitoring image are stored to complete the storage of the plurality of monitoring images.
2. A monitoring image storage method according to claim 1, characterized in that: Acquiring multiple monitoring images of moving targets based on target tracking algorithms includes: Obtaining a difference image between the real-time monitoring image and the background image, wherein the difference image is a binary image; Performing a connected domain analysis on the difference map to obtain an area of a foreground region, and in response to the area of the foreground region being greater than an area threshold, using the real-time monitoring image as a starting monitoring image, wherein the foreground region corresponds to a moving target; The target tracking algorithm is used to obtain the position information of the moving target in each monitoring image after the starting monitoring image until the moving target cannot be detected, and the starting monitoring image and the monitoring images collected after the starting monitoring image are used as multiple monitoring images of the moving target.
3. A monitoring image storage method according to claim 1, characterized in that: Pixels in moving objects and pixels The first cluster distance for: , Pixel and pixels The optical flow difference of Pixel and pixels The Euclidean distance of .
4. A monitoring image storage method according to claim 1, characterized in that: Distance clustering is performed on each pixel of the moving target to obtain multiple moving image blocks, including: Set the initial number of clusters, use distance clustering to obtain initial blocks with the same number of initial clusters; calculate the optical flow difference between any pixels in the initial block, and use the maximum value of the optical flow difference as the clustering evaluation of the initial block; In response to the clustering evaluation of any initial block being greater than the evaluation threshold, distance clustering with a clustering number of 2 is performed on the pixels in the initial block until the clustering evaluations of all initial blocks are no greater than the evaluation threshold, and the obtained initial block is used as a motion image block.
5. A monitoring image storage method according to claim 1, characterized in that: Clustering the motion image blocks in each monitoring image according to the relative optical flow direction to obtain multiple clustering clusters, including: defining the absolute value of the difference in the relative optical flow direction as a second clustering distance, and clustering the motion image blocks in each monitoring image using Kmeans clustering to obtain multiple clustering clusters.
6. A monitoring image storage method according to claim 1, characterized in that: The method for calculating the definition includes: calculating the gradient value of each pixel point in the motion image block, and taking the average value of the gradient value as the definition.
7. A monitoring image storage method according to claim 1, characterized in that: The motion image block corresponds to a block ID, the cluster cluster corresponds to a cluster ID, and obtaining a motion image block distribution map of each monitoring image includes: The pixel values of pixels in any moving image block in the monitoring image are set to the corresponding block ID, and the pixel values of pixels outside the moving image block are set to 0, so as to obtain a moving image block position distribution map; The pixel values of pixels in any moving image block in the monitoring image are set as the cluster ID of the cluster to which it belongs, and the pixel values of pixels outside the moving image block are set as 0, so as to obtain a moving image block cluster distribution map.
8. A monitoring image storage system, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a monitoring image storage method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video monitoring image data processing method and system
CN103826109A
Moving body detection device, moving body detection method, and computer-readable recording medium
AU2023235922A1
Obstacle detection method and system based on vehicle-mounted fisheye lens under motion background
CN111563474A