Image data multi-target duplicate removal method, system and device
By performing target detection and cache comparison on the current image frame of the monitoring device, only the small images with the highest quality are retained, and the storage time of images in the occlusion area is extended. This solves the problem of deduplication of small images of multiple target objects and achieves real-time Deduplication and resource optimization.
Patent Information
- Application Number
- CN202410598002.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-08-30
AI Technical Summary
The existing technology cannot effectively deduplicate small images of multi-target objects in real-time image frames, resulting in a waste of hardware resources and excessive redundant information.
By performing target detection on the current image frames of multiple monitoring devices, extract the target small image with the highest quality score, and compare it with the target small image in the cache library. Only the best quality image is retained, and the cache library is regularly cleaned. Timeout images extend the storage time of small target images in the occlusion area and reduce redundant output.
It is possible to output only the best quality image for the same target object, reducing storage pressure, avoiding redundant output, improving image retrieval efficiency, and reducing the waste of hardware resources.
Smart Images

Figure CN118568291A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, system and device for multi-target deduplication of image data. Background Art
[0002] When multiple monitoring devices are used to collect images of the same scene, there will be repeated collection of images and the same target object will appear multiple times in different images. If the target object in all images is extracted or the small image of the target object is extracted from all images where the same target object appears, a large amount of redundant information will be generated, resulting in a waste of hardware resources. Currently, the deduplication of small images of the same target object only supports the full deduplication of historical image data, and it is not possible to achieve deduplication of small images of multiple target objects based on real-time image frames. Summary of the invention
[0003] The embodiments of the present application provide a method, system and device for multi-target deduplication of image data, which are used to compare the target small images extracted multiple times before and after, and only output the target small image with the best quality for the same target object, thereby realizing real-time deduplication of multiple target objects.
[0004] The present application provides a method for multi-target deduplication of image data, the method comprising:
[0005] Performing target detection on current image frames of multiple monitoring devices, and extracting small target images with the highest quality scores corresponding to each detected target in the current image frame;
[0006] For each small target image extracted this time, according to the shooting scene corresponding to the small target image, if the quality score of the small target image is higher than the quality score of the small target image matching the small target image in the cache library corresponding to the shooting scene, or the small target image is not currently stored in the cache library, the small target image is used as the target image to be stored, and the cache library is updated;
[0007] Each of the target small images currently stored in the cache is traversed according to a set period, and the target small images whose storage time exceeds a preset timeout time are removed from the corresponding cache and output to the target device.
[0008] By this method, target detection is performed on the current image frames of multiple monitoring devices, and the target small images with the highest quality scores corresponding to each detected target in the current image frame are extracted; for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, the target small image is used as the stored target small image to update the cache library; each stored target small image currently stored in each cache library is traversed according to a set period, and the stored target small image whose storage time exceeds a preset timeout time is removed from the corresponding cache library and output to the target device, and by comparing the best quality target small image extracted in real time with the historical target small image temporarily stored in the corresponding cache library, it is achieved that for the same target object, only the best quality target small image is output to the target device, so as to achieve real-time deduplication of multiple target objects and reduce the storage pressure of the target device.
[0009] In some embodiments, when the target small image is used as the stored target small image to update the corresponding cache library, the corresponding time when each stored target small image is stored in the corresponding cache library is recorded;
[0010] For each of the small images of the storage target, determine the position area of the image frame to which it belongs. If the position area belongs to a preset range outside the image screen occlusion area of the corresponding image frame, then the corresponding moment recorded corresponding to the small image of the storage target is modified to a moment obtained by extending the preset time length based on the corresponding moment.
[0011] Through this method, the storage time of the small image of the target being stored is recorded, and when the target object is located near the occluded area of the image screen, the storage time of the corresponding small image of the target being stored is delayed for a period of time. Therefore, when the target object briefly enters the occluded area and then appears again, it is avoided to output the small image of the target object multiple times, thereby reducing the redundant work of the system.
[0012] In some embodiments, the image screen occlusion area is determined by the following method:
[0013] After performing target detection on N consecutive image frames of each monitoring device closest to the current time, marking detection frames of multiple detected targets in each image frame;
[0014] For each of the image frames, the cumulative value M of the mark value of each pixel in the image frame is calculated, where:
[0015] M=M0+M1*n1+M2*n2;
[0016] M0 represents the initial value of the marking value of a pixel point; M1 represents the increased value corresponding to the marking value when the pixel point is covered by the first region; M2 represents the increased value corresponding to the marking value when the pixel point is covered by the second region; n1 represents the number of times the pixel point is covered by the first region; n2 represents the number of times the pixel point is covered by the second region; where M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; where the first region is: the region defined by each detection box in the image frame; the second region is: the enlarged region obtained by enlarging each first region according to a preset ratio;
[0017] Calculate the sum of the cumulative values of the marking values of the pixel points corresponding in position in the N image frames, screen out each pixel point whose sum of the cumulative values of the marking values is greater than a first preset value as a reference pixel point, and determine the area of the contiguous region formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than a second preset value, then determine the contiguous region as the occluded region of the image screen.
[0018] Through this method, it is realized to determine whether there is an occluded region caused by obstacles, blind spots, etc. in the corresponding shooting scene according to a series of consecutive image frames recently collected by the monitoring device.
[0019] In some embodiments, the performing object detection on the current image frames of multiple monitoring devices and extracting the target small images with the highest quality scores corresponding to the detected objects in the current image frames specifically includes:
[0020] Perform object detection on each image frame, and when the detected object is a preset object type, mark a detection box on the detected object;
[0021] According to the coordinates of the detection boxes and the image features, determine the same detected object in different image frames, and generate a target set of the detected object; the target set at least includes the image frame number of the detected object in the corresponding image frame, the coordinates of the detection box, and the alternative target small image including the detected object intercepted from the corresponding image frame according to the coordinates of the detection box;
[0022] Determine the quality scores corresponding to the alternative target small images in each target set, and extract the target small image with the highest quality score.
[0023] Through this method, it is realized to extract only the target small image with the best quality for the same target object in multiple image frames.
[0024] In some embodiments, for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, then the target small image is used as the target small image to be stored in the library, and the cache library is updated, specifically including:
[0025] For each small target image extracted this time:
[0026] Determine the shooting scene to which the target small image belongs according to the installation information of the monitoring device that collects the image frame corresponding to the target small image;
[0027] According to the correspondence between the shooting scene and the cache library, determining the cache library corresponding to the shooting scene;
[0028] Calculate the similarity between the target small image and each stored target small image currently stored in the cache library, take the stored target small image whose similarity value is greater than a preset value as the matching target small image, compare the quality score of the target small image and the matching target small image, and when the quality score of the target small image is higher, take the target small image as the stored target small image to replace the matching target small image in the cache library;
[0029] If all similarity values are less than or equal to the preset value, the target small image is taken as the storage target small image and added to the cache library.
[0030] Through this method, it is possible to determine whether to update the cache library according to the matching result between each target small image extracted each time and the target small image in the cache library, thereby achieving deduplication of multiple target objects.
[0031] In some embodiments, when at least one of the plurality of monitoring devices is a smart device with target detection capability, the method further includes:
[0032] Receiving target small images corresponding to a plurality of detected targets output for corresponding image frames and sent by the at least one smart device;
[0033] For each of the target small images, when it is determined that the detected target in the target small image is of the preset target type, it is determined whether the target small image matches the extracted target small images based on the coordinate information and image features of the target small image. If so, the target small image is deleted; if not, the target small image is used as the extracted target small image.
[0034] Through this method, it is possible to deduplicate small images of multiple target objects output by smart devices, and at the same time, the target detection results can be supplemented to avoid omission of target objects.
[0035] An image data multi-target deduplication system provided in an embodiment of the present application includes:
[0036] A detection module is used to perform target detection on current image frames of multiple monitoring devices, and extract a small target image with the highest quality score corresponding to each detected target in the current image frame;
[0037] a deduplication module, for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, then the target small image is used as the target small image to be stored in the library, and the cache library is updated;
[0038] The output module is used to traverse each of the target small images currently stored in the cache according to a set period, remove the target small images whose storage time exceeds the preset timeout time from the corresponding cache and output them to the target device.
[0039] Through this system, by comparing the best quality small target image extracted in real time with the historical small target image temporarily stored in the corresponding cache library, it is possible to output only the best quality small target image to the target device for the same target object, realize real-time deduplication of multiple target objects, reduce the storage pressure of the target device, and improve the retrieval efficiency of images.
[0040] In some embodiments, when the deduplication module uses the target small image as the stored target small image to update the corresponding cache library, the corresponding time when each stored target small image is stored in the corresponding cache library is recorded;
[0041] For each of the small images of the storage target, determine the position area of the image frame to which it belongs. If the position area belongs to a preset range outside the image screen occlusion area of the corresponding image frame, then the corresponding moment recorded corresponding to the small image of the storage target is modified to a moment obtained by extending the preset time length based on the corresponding moment.
[0042] Through this system, the storage time of the small image of the target is recorded, and when the target object is located near the occluded area of the image screen, the storage time of the corresponding small image of the target is delayed for a period of time. Therefore, when the target object briefly enters the occluded area and then appears again, it is avoided to output the small image of the target object multiple times, thereby reducing the redundant work of the system.
[0043] In some embodiments, the detection module is further configured to perform object detection on the N consecutive image frames closest to the current time for each monitoring device, and mark the detection frames of multiple detected objects in each image frame;
[0044] The system further includes a judgment module, configured to determine the occluded area of the image according to the object detection results of the N image frames output by the detection module. Specifically, the judgment module is configured to:
[0045] For each image frame, calculate the cumulative value M of the marked values of each pixel point in the image frame, where:
[0046] M = M0 + M1 * n1 + M2 * n2;
[0047] M0 represents the initial value of the marked value of the pixel point; M1 represents the increased value corresponding to the marked value when the pixel point is covered by the first area; M2 represents the increased value corresponding to the marked value when the pixel point is covered by the second area; n1 represents the number of times the pixel point is covered by the first area; n2 represents the number of times the pixel point is covered by the second area. Wherein, M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; wherein, the first area is: the area defined by each detection frame in the image frame; the second area is: the enlarged area obtained by enlarging each first area according to a preset ratio;
[0048] Calculate the sum of the cumulative values of the marked values of the pixel points corresponding in position in the N image frames, screen out the pixel points whose sum of the cumulative values of the marked values is greater than a first preset value as reference pixel points, and determine the area of the contiguous area formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than a second preset value, determine the contiguous area as the occluded area of the image.
[0049] Through this system, it is realized to determine whether there is an occluded area caused by obstacles, blind spots, etc. in the corresponding shooting scene according to a series of consecutive image frames recently collected by the monitoring device.
[0050] Another embodiment of the present application provides an image data multi-object duplicate removal device, which includes a memory and a processor. Wherein, the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.
[0051] Furthermore, according to an embodiment, for example, a computer program product for a computer is provided, which includes software code portions, and when the product is run on the computer, these software code portions are used to perform the steps of the method defined above. The computer program product may include a computer-readable medium having the software code portions stored thereon. Furthermore, the computer program product may be directly loaded into the internal memory of the computer and / or sent via a network through at least one of an upload process, a download process, and a push process.
[0052] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 A schematic diagram of the overall process of a multi-target deduplication method for image data provided by an embodiment of the present application;
[0055] Figure 2 A schematic diagram of a target object located near an occluded area provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of a first area and a second area provided in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of the structure of a multi-target deduplication system for image data provided in an embodiment of the present application;
[0058] Figure 5A A schematic diagram of a specific process of a multi-target deduplication method for image data provided in an embodiment of the present application;
[0059] Figure 5B A schematic diagram of a specific process of a multi-target deduplication method for image data (there are occluded areas in the shooting scene) provided in an embodiment of the present application;
[0060] Figure 6 A schematic diagram of a specific process for determining an occluded area of an image provided in an embodiment of the present application;
[0061] Figure 7A schematic diagram of a specific process of a multi-target deduplication method for image data (the monitoring device is a smart device) provided in an embodiment of the present application;
[0062] Figure 8 A schematic diagram of the structure of a multi-target deduplication device for image data provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] The embodiments of the present application provide a method, system and device for multi-target deduplication of image data, which are used to compare the target small images extracted multiple times before and after, and only output the target small image with the best quality for the same target object, thereby realizing real-time deduplication of multiple target objects.
[0065] Among them, the method and the device are based on the same application concept. Since the method and the device solve the problem in a similar principle, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0066] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0067] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to only those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.
[0068] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.
[0069] It should be noted that the technical solution provided in the embodiment of the present application performs target detection on current image frames of multiple monitoring devices, extracts the target small images with the highest quality scores corresponding to each detected target in the current image frame, and compares each target small image with the target small image in the corresponding cache library to remove duplicate target small images, and only retains the target small images with the highest quality scores corresponding to the detected targets, and regularly removes the target small images in the cache library that have been in the library for more than a preset timeout period, and outputs them to the target device for explanation as an example, but is not limited to this.
[0070] See also Figure 1 , an embodiment of the present application provides a multi-target deduplication method for image data, comprising:
[0071] Step S101, performing target detection on current image frames of multiple monitoring devices, and extracting small target images with the highest quality scores corresponding to each detected target in the current image frame;
[0072] The multiple monitoring devices may all be located in the same shooting scene, or all be located in different shooting scenes respectively, or some of the monitoring devices may be located in the same shooting scene, and some of the monitoring devices may be located in different shooting scenes respectively; the current image frame may be an image frame captured by each monitoring device, or may be multiple consecutive image frames captured by each monitoring device, and the embodiments of the present application do not impose any restrictions on this.
[0073] The quality score is, for example, a score determined according to the image clarity of the detected target in the corresponding image frame.
[0074] Target detection is performed on each image frame. When the detected target (or target object) is a target type pre-configured by the user (such as a person, a motor vehicle, an animal, etc.), a detection frame is used to display the detected target frame. According to the configured width of the detection frame, the detection frame with a width smaller than the configured width can be removed, that is, small target objects are removed.
[0075] For each detected target obtained in each image frame, target information including the detection frame coordinates and image features of the detected target is generated, and the target information is matched with other target information in terms of detection frame coordinates (for example, for two detection frame coordinates, the detection frame graphics are determined through the detection frame coordinates, and the intersection and union ratio of the two detection frame graphics is calculated. If the intersection and union ratio is greater than a preset value, the two detection frame coordinates match) and image feature matching (for example, for two image features, the similarity of the feature vectors corresponding to the two image features is calculated. If the similarity value is greater than a preset value, the two image features match), and target information belonging to the same detected target is determined (both the detection frame coordinates and the image features match).
[0076] Using the target information obtained from the same detected target, a target set is generated, which records the image frame number of the detected target in the corresponding image frame, the coordinates of the detection frame, and the candidate target small image intercepted from the corresponding image frame according to the coordinates of the detection frame and including the detected target. For example, the target set {image frame 1, upper left corner coordinates (a 11 , b 11 ), the lower right corner coordinate (a 12 , b 12 ), small image 1; image frame 2, upper left corner coordinate (a 21 , b 21 ), the lower right corner coordinate (a 22 , b 22 ), small image 2; image frame 4, upper left corner coordinate (a 41 , b 41 ), the lower right corner coordinate (a 42 , b 42 ), …}; determine the quality score corresponding to each candidate target small image in each target set, extract the target small image with the highest quality score, and obtain the target small images corresponding to the different detected targets extracted this time.
[0077] Step S102: for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, then the target small image is used as the target small image to be stored, and the cache library is updated;
[0078] In order to reduce the matching pressure of a large number of small target images and the cache library and reduce the amount of calculation, according to the different shooting scenes in which the monitoring equipment is located, a cache library corresponding to the shooting scene is pre-set for each shooting scene. Each cache library stores the small target images with the highest quality scores currently corresponding to different measured targets extracted from the historical image data of the shooting scene, and the storage time does not exceed the preset timeout time.
[0079] For each small target image extracted this time, first determine the corresponding shooting scene according to the installation information of the monitoring device that collects the image frame corresponding to the small target image, determine the corresponding cache library according to the corresponding relationship between the shooting scene and the cache library, and then perform image feature matching between the small target image and the small target image in the corresponding cache library (calculate the similarity of the image features of the two small target images, when the similarity value is greater than a preset value such as 0.95, the two small target images are small images of the same target object), determine whether the small target image corresponding to the corresponding detected target already exists in the cache library, if not, add the small target image to the cache library as a target image to be stored, and record the corresponding storage time; if so, compare the quality scores of the small target image and the matching target image in the cache library, when the quality score of the small target image is higher, use the small target image as a target image to be stored, replace the matching target image in the cache library, and modify the recorded corresponding storage time to the current time; when the quality score of the matching target image in the cache library is higher, remove the small target image.
[0080] Step S103, traversing each of the target small images currently stored in the cache according to a set period, removing the target small images whose storage time exceeds a preset timeout time from the corresponding cache and outputting them to the target device.
[0081] The storage time of each target small image is equal to the current time minus the storage time of the target small image; the target device is, for example, an image display device.
[0082] If the storage time of a certain target small image exceeds the preset timeout period, it means that the corresponding target object has not been detected for a long time, that is, the target object has disappeared from the shooting scene, or the quality score of the recently detected target small image is not ideal (for example, the target object is far away from the shooting scene), the corresponding cache library stores the best quality target small image of the target object that can be obtained within this timeout period, and the target small image can be output to the target device.
[0083] In this step, a timer can be preset and a fixed timing duration can be set for the timer. Whenever the timer ends, the storage time of each target small image currently stored in all cache libraries is traversed to calculate the storage duration. Of course, a timer can also be set for each cache library, and the timing durations set for each timer can be the same or different, and there is no restriction here.
[0084] The target device stores the received target small images. Later, based on the information of each target small image, it can quickly determine the monitoring device that captured the corresponding target object, the image frame where the target object appears, or the storage address of the image frame related to the target object, so as to facilitate the target device to retrieve image information.
[0085] In order to avoid outputting small images of target objects located near the blocked area of the image screen multiple times in a short period of time, in some embodiments, when the target small images are used as stored target small images to update the corresponding cache library, the corresponding time when each stored target small image is stored in the corresponding cache library is recorded;
[0086] For each of the small images of the storage target, determine the position area of the image frame to which it belongs. If the position area belongs to a preset range outside the image screen occlusion area of the corresponding image frame, then the corresponding moment recorded corresponding to the small image of the storage target is modified to a moment obtained by extending the preset time length (for example, 1 / 2 of the timeout length) based on the corresponding moment.
[0087] The blocked area refers to an area where the target object cannot be captured by the monitoring device, such as blockage caused by obstacles, blind spots, etc.
[0088] Each time the target small image extracted by target detection is used as the target small image to be stored in the cache library, it can be determined whether the position area of the corresponding target object in the corresponding image frame is close to the occlusion area of the image screen of the corresponding image frame. If so, the corresponding storage time of the target small image recorded can be modified to the moment obtained by extending the preset time according to the corresponding storage time, so as to avoid the situation where the target object disappears briefly and then reappears due to the existence of the occlusion area when the timeout period is set to be short, causing the target small image of the target object to frequently enter and exit the cache library, resulting in the target small image of the target object being reported to the target device multiple times in a short period of time, resulting in a waste of hardware resources of the target device. It is also possible not to pay attention to whether the target object is close to the occlusion area, by setting the timeout period to be relatively long, so that when the target object reappears through the occlusion area, the target small image of the target object is still stored in the cache library to avoid repeated reporting.
[0089] Determine whether the position area of the target object in the corresponding image frame is close to the occlusion area of the image screen of the corresponding image frame, specifically:
[0090] According to the detection box of the target object, centered on the center point of the detection box, expand the detection box according to a preset ratio. For example, expand the detection box 2 times the width of the detection box to the left and right along the abscissa, and expand the detection box 2 times the height of the detection box upward and downward along the ordinate to obtain an expanded detection box, and determine whether there is an overlap between the area where the expanded detection box is located and the occlusion area of the image frame of the corresponding image. If so, it is determined that the target object is close to the occlusion area. For example Figure 2 as shown; if not, it is determined that the target object is not close to the occlusion area.
[0091] To determine whether there is an occlusion area caused by obstacles, blind spots, etc. in the corresponding shooting scene, in some embodiments, the image frame occlusion area is determined by the following method:
[0092] After performing target detection on the N consecutive image frames closest to the current time for each monitoring device, mark the detection boxes of multiple detected targets in each image frame;
[0093] For each image frame, calculate the cumulative value M of the marked values of each pixel point in the image frame, where:
[0094] M = M0 + M1 * n1 + M2 * n2;
[0095] M0 represents the initial value of the marked value of the pixel point; M1 represents the increased value corresponding to the marked value when the pixel point is covered by the first area; M2 represents the increased value corresponding to the marked value when the pixel point is covered by the second area; n1 represents the number of times the pixel point is covered by the first area; n2 represents the number of times the pixel point is covered by the second area; where M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; where the first area is: the area defined by each detection box in the image frame; the second area is: the enlarged area obtained by enlarging each first area according to a preset ratio;
[0096] Calculate the sum of the cumulative values of the marked values of the pixel points corresponding in position in the N image frames, select each pixel point whose sum of the cumulative values of the marked values is greater than the first preset value as a reference pixel point, and determine the area of the contiguous area formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than the second preset value, determine the contiguous area as the occlusion area of the image frame.
[0097] For example Figure 3As shown, the area where the detection frame of each target object in the image frame is located is set as the first area, and the first area is enlarged proportionally, for example, by 2 times, with the center point of each first area as the center, and the enlarged area obtained is set as the second area, for example Figure 3 Assume that the initial value of the mark value of each pixel in the image frame is M0 (for example, 0). When a pixel is covered by a first area, its mark value increases by M1 (for example, -1). When it is covered by a second area, its mark value increases by M2 (for example, 1). If there are pixels r1, r2, r3, ... r in an image frame n , where pixel r1 is covered by 5 first regions, the cumulative value of the label value of r1 is M=M0+5M1=-5; pixel r2 is covered by 2 first regions (that is, the regions where the two target objects are located in the image frame overlap) and 3 second regions, the cumulative value of the label value of r2 is M=M0+2M1+3M2=1; pixel r3 is covered by 4 second regions, the cumulative value of the label value of r3 is M=M0+4M2=4…, the cumulative value of the label value of each pixel in the image frame is obtained, and then, each image frame is converted into The cumulative values of the marking values of the pixels at the same position in the image are added to obtain the cumulative sum of the marking values of each pixel, and the pixels whose cumulative sum of the marking values is greater than a preset value are screened out. According to the positions of these pixel points in the image, a number of contiguous areas formed by these pixel points are determined, and the cumulative values of the marking values of the pixels in the contiguous areas are all greater than the preset value, and there is no gap area; the area of each contiguous area (or the number of pixels in the contiguous area) is determined. If the area of a contiguous area is greater than a preset value (for example, 10), the contiguous area is an occluded area of the image.
[0098] In some embodiments, a blank image with the same width and height as each image frame and an initial value of the marking value of each pixel being 0 can be pre-generated; each first area and each second area obtained in each image frame is superimposed on the corresponding position of the blank image according to the corresponding position coordinates; for a pixel point, if it is superimposed once by the first area, its marking value is subtracted by 1, and if it is superimposed once by the second area, its marking value is increased by 1, and the cumulative value of the marking value of each pixel point in the blank image is obtained; pixel points whose cumulative value of marking value is greater than a first preset value are screened out, and pixel points with adjacent positions are connected to obtain several contiguous areas, and the number of pixels in each contiguous area is determined. If the number of pixels is greater than a second preset value, the contiguous area is determined as an occluded area.
[0099] In order to output only the small image with the best quality for the same target object in multiple image frames, in some embodiments, performing target detection on the current image frames of multiple monitoring devices and extracting the target small image with the highest quality score corresponding to each detected target in the current image frame specifically includes:
[0100] Performing target detection on each of the image frames, and when the detected target is a preset target type (such as a person, a motor vehicle, an animal, etc. configured by the user), marking a detection frame (such as a rectangular detection frame) on the detected target;
[0101] According to the coordinates and image features of each of the detection frames, the same detected target in different image frames is determined, and a target set of the detected target is generated; the target set at least includes the image frame number of the detected target in the corresponding image frame, the coordinates of the detection frame, and a small image of a candidate target including the detected target, which is intercepted from the corresponding image frame according to the coordinates of the detection frame;
[0102] The quality score corresponding to each candidate target small image in each target set is determined, and the target small image with the highest quality score is extracted.
[0103] In order to utilize the target small images stored in the cache library to achieve deduplication of small images of multiple target objects, in some embodiments, for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, then the target small image is used as the target small image to be stored in the library, and the cache library is updated, specifically including:
[0104] For each small target image extracted this time:
[0105] Determine the shooting scene to which the target small image belongs according to the installation information of the monitoring device that collects the image frame corresponding to the target small image;
[0106] According to the correspondence between the shooting scene and the cache library, determining the cache library corresponding to the shooting scene;
[0107] Calculate the similarity between the target small image and each stored target small image currently stored in the cache library, take the stored target small image with a similarity value greater than a preset value (for example, 0.95) as the matching target small image, compare the quality score of the target small image and the matching target small image, and when the quality score of the target small image is higher, take the target small image as the stored target small image to replace the matching target small image in the cache library;
[0108] If all similarity values are less than or equal to the preset value, the target small image is taken as the storage target small image and added to the cache library.
[0109] For example, if multiple monitoring devices are located in the same shooting scene, only one cache library needs to be set up. The cache library currently stores small target images of target objects A, B, C, D, and E, and the quality scores are 85, 90, 92, 90, and 95, respectively. Assume that the target detection extracts small target images of target objects A, B, and F, and the quality scores are 90, 88, and 92, respectively. Match the newly extracted target small images corresponding to the target objects A, B, and F with the target small images in the cache library. If A and B can be matched but F cannot be matched, then add the target small image of F to the cache library and record the corresponding storage time. Compare the quality scores of the target small images extracted this time of A and B with the matching target small images in the cache library respectively. For A, the quality score of the target small image extracted this time is higher, then use the target small image extracted this time to replace the matching target small image in the cache library, and modify the storage time to the current time. For B, the quality score of the target small image extracted this time is low and it is directly discarded.
[0110] In order to achieve deduplication of small images of multiple target objects output by the smart device and to supplement the target detection results to avoid omission of target objects, in some embodiments, when at least one of the multiple monitoring devices is a smart device with target detection capability, the method further includes:
[0111] Receiving target small images corresponding to a plurality of detected targets output for corresponding image frames and sent by the at least one smart device;
[0112] For each of the target small images, when it is determined that the detected target in the target small image is of the preset target type, it is determined whether the target small image matches the extracted target small images based on the coordinate information and image features of the target small image. If so, the target small image is deleted; if not, the target small image is used as the extracted target small image.
[0113] That is to say, when the monitoring device can perform target detection on the image frames collected by itself, it receives the small images of the target objects extracted from the uploaded image frames while receiving the image frames uploaded by the monitoring device; after extracting the small images of each target object from the image frames, the small images of each target object are matched with the small images output by the monitoring device for detection frame coordinates and image features to remove duplicate small images, and add the small images of the target objects that are not detected by the target detection to the target small images extracted this time. On the one hand, this can avoid missing the target objects, and on the other hand, it can also avoid outputting the small images of the same target object multiple times.
[0114] See also Figure 4 , an image data multi-target deduplication system provided by an embodiment of the present application includes:
[0115] The detection module 100 is used to perform target detection on the current image frames of multiple monitoring devices, and extract the target small image with the highest quality score corresponding to each detected target in the current image frame;
[0116] The deduplication module 200 is used for, for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, then the target small image is used as the target small image to be stored in the library, and the cache library is updated;
[0117] The output module 300 is used to traverse each of the target small images currently stored in the cache according to a set period, remove the target small images whose storage time exceeds a preset timeout time from the corresponding cache and output them to the target device.
[0118] In some embodiments, when the deduplication module 200 uses the target small image as the stored target small image to update the corresponding cache library, it records the corresponding time when each stored target small image is stored in the corresponding cache library;
[0119] For each of the small images of the storage target, determine the position area of the image frame to which it belongs. If the position area belongs to a preset range outside the image screen occlusion area of the corresponding image frame, then the corresponding moment recorded corresponding to the small image of the storage target is modified to a moment obtained by extending the preset time length based on the corresponding moment.
[0120] In some embodiments, the detection module 100 is further used to mark detection frames of multiple detected targets in each of the image frames after performing target detection on N consecutive image frames of each monitoring device closest to the current time;
[0121] The system further includes a judgment module 400, which is used to determine the occlusion area of the image according to the target detection results of the N image frames output by the detection module 100. The judgment module 400 is specifically used to:
[0122] For each of the image frames, the cumulative value M of the mark value of each pixel in the image frame is calculated, where:
[0123] M=M0+M1*n1+M2*n2;
[0124] M0 represents the initial value of the marking value of the pixel point; M1 represents the increased value corresponding to the marking value when the pixel point is covered by the first region; M2 represents the increased value corresponding to the marking value when the pixel point is covered by the second region; n1 represents the number of times the pixel point is covered by the first region; n2 represents the number of times the pixel point is covered by the second region; where M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; where the first region is: the region defined by each detection box in the image frame; the second region is: the enlarged region obtained by enlarging each first region according to a preset ratio;
[0125] Calculate the sum of the cumulative values of the marking values of the pixel points corresponding in position in the N image frames, screen out each pixel point whose sum of the cumulative values of the marking values is greater than the first preset value as a reference pixel point, and determine the area of the contiguous region formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than the second preset value, then determine the contiguous region as the occlusion region of the image screen.
[0126] Several specific method flow embodiments are given below.
[0127] Embodiment 1:
[0128] See Figure 5A , a multi-target deduplication method for image data provided by an embodiment of the present application, the specific steps include:
[0129] Step S501, obtain the current image frames of multiple monitoring devices for target detection, and when the detected target is a preset target type, mark a detection box on the detected target;
[0130] Step S502, determine the same detected target in different image frames according to the coordinates of each detection box and the image features, and use the image frame number of the detected target in the corresponding image frame, the coordinates of the detection box, and the alternative target small image intercepted from the corresponding image frame according to the detected coordinates and including the detected target to generate the target set of the detected target;
[0131] Step S503, determine the quality score corresponding to each alternative target small image in each target set, and extract the target small image with the highest quality score;
[0132] Step S504, for each extracted target small image, determine the shooting scene corresponding to the target small image according to the installation information of the monitoring device that collected the image frame corresponding to the target small image, and determine the cache library corresponding to the shooting scene according to the corresponding relationship between the shooting scene and the cache library;
[0133] Step S505, determining whether the target small image matches the target small image currently stored in the corresponding cache library, if so, proceeding to step S506; if not, proceeding to step S507;
[0134] Step S506, comparing whether the quality score of the target small image is higher than the quality score of the matching target small image in the corresponding cache library, if so, proceeding to step S508; if not, deleting the target small image;
[0135] Step S507: adding the target small image as a storage target small image to a corresponding cache library, and recording the storage time of the target small image in the corresponding cache library;
[0136] Step S508: Use the target small image as the storage target small image to replace the matching target small image in the corresponding cache library, and modify the corresponding storage time recorded to the current time;
[0137] Step S509, traverse each storage target small image currently stored in each cache library according to the set cycle, and determine whether the storage time of the storage target small image exceeds the preset timeout time; if so, proceed to step S510; if not, wait for the next traversal cycle;
[0138] Step S510: The target small images in each cache library that have been stored for longer than a preset timeout period are removed from the corresponding cache library and transmitted to the target device.
[0139] Embodiment 2:
[0140] See also Figure 5B The embodiment of the present application provides a method for deduplication of multiple targets in image data (there is an occluded area in the shooting scene), and the specific steps include:
[0141] This embodiment omits the description of steps S501 to S508 that are the same as those in the first embodiment, and only describes the contents that are different from the first embodiment.
[0142] Step S511, for each newly stored target small image in each cache, determine the location area of the target small image in the corresponding image frame according to the coordinates of the detection frame corresponding to the target small image;
[0143] Step S512, determining whether each target small image is located in the position area of the corresponding image frame and whether it is within a preset range outside the image screen occlusion area of the corresponding image frame, if so, proceeding to step S513; if not, proceeding to step S509;
[0144] Step S513, modify the recorded storage time corresponding to the target small image to the time obtained by extending the preset time according to the storage time, and then perform steps S509 and S510.
[0145] Embodiment three:
[0146] See also Figure 6 The above-mentioned image screen occlusion area is determined by the following method, and the specific steps include:
[0147] Step S601, obtaining N consecutive image frames of each monitoring device closest to the current time;
[0148] Step S602: Perform target detection on each image frame, and mark a detection frame on each target object in the image frame;
[0149] Step S603, taking the center point of each detection frame as the center, enlarging each detection frame according to a preset ratio, setting the area where each detection frame is located as the first area, and setting the enlarged area obtained after enlarging each detection frame as the second area;
[0150] Step S604, generating a blank image with the same width and height as each image frame and the initial value of the mark value of each pixel being 0;
[0151] Step S605, superimposing each first region and each second region in each image frame onto the blank image according to the corresponding coordinate positions, to obtain the cumulative value of the label value of each pixel point in the blank image after the superposition processing;
[0152] For example, when a pixel is overlapped (or covered) once by the first area, its label value decreases by 1, and when it is overlapped once by the second area, its label value increases by 1.
[0153] Step S606, filter out the pixels whose cumulative value of the mark value is greater than the first preset value, and then connect the pixels at adjacent positions to obtain a plurality of contiguous areas;
[0154] Step S607: determine the area of each connected region, and when there is a connected region whose area is greater than the second preset value, determine the connected region as the occlusion region of the image.
[0155] The above steps S604 and S605 can also be combined, that is, without generating a blank image, directly counting the cumulative value of the marking value of each pixel in each image frame, and then adding the cumulative value of the marking value of the pixel points corresponding to the position in each image frame to obtain the sum of the cumulative value of the marking value of each pixel point, and then proceeding to step S606.
[0156] Embodiment 4:
[0157] See also Figure 7 The embodiment of the present application provides a method for deduplication of multi-target image data, and the specific steps include:
[0158] In this embodiment, it is assumed that each monitoring device is a smart device;
[0159] Step S701, receiving current image frames uploaded by multiple monitoring devices and multiple small target images of target objects output for corresponding image frames;
[0160] Step S702, performing target detection on each image frame, extracting small target images with the highest quality scores corresponding to each target object in the image frame, and forming a target image set 1;
[0161] Step S703: for the target small images output by each monitoring device, discard the target small images whose target objects are not corresponding to the preset target type, and use the retained target small images to form a target image set 2;
[0162] It should be noted that there is no order between step S702 and step S703. Step S702 may be performed first and then step S703, or step S703 may be performed first and then step S702, or they may be performed simultaneously.
[0163] Step S704: for each small target image in the target image set 2, determine whether the small target image matches a small target image in the target image set 1. If so, proceed to step S705; if not, proceed to step S706;
[0164] In this step, the geometric figure of each detection frame (usually a rectangle) is determined by the detection frame coordinates corresponding to the two target small images, and the intersection and union ratio of the two geometric figures corresponding to the two detection frame coordinates is calculated. When the intersection and union ratio is greater than the preset value, it means that the two detection frame coordinates match. The similarity of the image features of the two target small images is calculated. When the similarity value is greater than the preset value, it means that the two image features match and are the image features of the target object.
[0165] Step S705, discarding the target small images in target image set 2 that match those in target image set 1;
[0166] Step S706: Add the target small image to the target small image extracted this time, and perform the above step S504 and subsequent steps.
[0167] The following is an introduction to the equipment or device provided in the embodiments of the present application, in which the explanations or examples of technical features that are the same or corresponding to those described in the above method will not be repeated later.
[0168] See also Figure 8 , an image data multi-target deduplication device provided by an embodiment of the present application includes:
[0169] The processor 800 is used to read the program in the memory 820 and execute the following process:
[0170] Performing target detection on current image frames of multiple monitoring devices, and extracting small target images with the highest quality scores corresponding to each detected target in the current image frame;
[0171] For each small target image extracted this time, according to the shooting scene corresponding to the small target image, if the quality score of the small target image is higher than the quality score of the small target image matching the small target image in the cache library corresponding to the shooting scene, or the small target image is not currently stored in the cache library, the small target image is used as the target image to be stored, and the cache library is updated;
[0172] Each of the target small images currently stored in the cache is traversed according to a set period, and the target small images whose storage time exceeds a preset timeout time are removed from the corresponding cache and output to the target device.
[0173] In some embodiments, when the target small image is used as the stored target small image to update the corresponding cache library, the corresponding time when each stored target small image is stored in the corresponding cache library is recorded;
[0174] For each of the small images of the storage target, determine the position area of the image frame to which it belongs. If the position area belongs to a preset range outside the image screen occlusion area of the corresponding image frame, then the corresponding moment recorded corresponding to the small image of the storage target is modified to a moment obtained by extending the preset time length based on the corresponding moment.
[0175] In some embodiments, the processor 800 is further configured to read a program in the memory 820 and execute the following steps to determine the image screen occlusion area:
[0176] After performing target detection on N consecutive image frames of each monitoring device closest to the current time, marking detection frames of multiple detected targets in each image frame;
[0177] For each of the image frames, the cumulative value M of the mark value of each pixel in the image frame is calculated, where:
[0178] M=M0+M1*n1+M2*n2;
[0179] M0 represents the initial value of the marking value of a pixel point; M1 represents the increased value corresponding to the marking value when the pixel point is covered by the first region; M2 represents the increased value corresponding to the marking value when the pixel point is covered by the second region; n1 represents the number of times the pixel point is covered by the first region; n2 represents the number of times the pixel point is covered by the second region; where M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; where the first region is: the region defined by each detection box in the image frame; the second region is: the enlarged region obtained by enlarging each first region according to a preset ratio;
[0180] Calculate the sum of the cumulative values of the marking values of the pixel points corresponding in position in the N image frames, screen out each pixel point whose sum of the cumulative values of the marking values is greater than a first preset value as a reference pixel point, and determine the area of the contiguous region formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than a second preset value, then determine the contiguous region as the occluded region of the image screen.
[0181] In some embodiments, the performing object detection on the current image frames of multiple monitoring devices and extracting the target small images with the highest quality scores corresponding to the detected objects in the current image frames specifically includes:
[0182] Perform object detection on each image frame, and when the detected object is a preset object type, mark a detection box on the detected object;
[0183] According to the coordinates of each detection box and the image features, determine the same detected object in different image frames, and generate a target set of the detected object; the target set at least includes the image frame number of the detected object in the corresponding image frame, the coordinates of the detection box, and the alternative target small image including the detected object intercepted from the corresponding image frame according to the coordinates of the detection box;
[0184] Determine the quality scores corresponding to the alternative target small images in each target set, and extract the target small image with the highest quality score.
[0185] In some embodiments, for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the cache library currently does not store the target small image, then use the target small image as the target small image to be stored in the library and update the cache library, specifically including:
[0186] For each target small image extracted this time:
[0187] Determine the shooting scene to which the target small image belongs according to the installation information of the monitoring device that collects the image frame corresponding to the target small image;
[0188] According to the correspondence between the shooting scene and the cache library, determining the cache library corresponding to the shooting scene;
[0189] Calculate the similarity between the target small image and each stored target small image currently stored in the cache library, take the stored target small image whose similarity value is greater than a preset value as the matching target small image, compare the quality score of the target small image and the matching target small image, and when the quality score of the target small image is higher, take the target small image as the stored target small image to replace the matching target small image in the cache library;
[0190] If all similarity values are less than or equal to the preset value, the target small image is taken as the storage target small image and added to the cache library.
[0191] In some embodiments, when at least one of the plurality of monitoring devices is a smart device with target detection capability, the processor 800 is further configured to read a program in the memory 820 and execute:
[0192] Receiving target small images corresponding to a plurality of detected targets output for corresponding image frames and sent by the at least one smart device;
[0193] For each of the target small images, when it is determined that the detected target in the target small image is of the preset target type, it is determined whether the target small image matches the extracted target small images based on the coordinate information and image features of the target small image. If so, the target small image is deleted; if not, the target small image is used as the extracted target small image.
[0194] In some embodiments, the image data multi-target deduplication device provided in the embodiments of the present application further includes a transceiver 810 for receiving data sent by a monitoring device and sending the data to a target device under the control of a processor 800 .
[0195] Among them, Figure 8 In the embodiment of the present invention, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 800 and memory represented by memory 820. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are not further described herein. The bus interface provides an interface. The transceiver 810 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices over a transmission medium.
[0196] In some embodiments, the image data multi-target deduplication device provided in the embodiments of the present application also includes a user interface 830, which can be an interface that can be externally or internally connected to required devices. The connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, etc.
[0197] The processor 800 is responsible for managing the bus architecture and general processing, and the memory 820 can store data used by the processor 800 when performing operations.
[0198] In some embodiments, the processor 800 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device).
[0199] The embodiment of the present application provides a computing device, which may be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. The computing device may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.
[0200] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiments of the present application.
[0201] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.
[0202] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device executes any of the methods described in the above embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0203] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.
[0204] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0205] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0206] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0207] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0209] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A multi-objective deduplication method for image data, characterized in that: The method includes: Performing object detection on the current image frames of multiple monitoring devices, and extracting the target small images with the highest quality scores corresponding to each detected object in the current image frames; For each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the matching target small image in the cache library corresponding to the shooting scene, or the cache library currently does not store the target small image, then use the target small image as the incoming target small image and update the cache library; Traverse each incoming target small image currently stored in each cache library at a set period, remove the incoming target small images whose incoming time exceeds the preset timeout duration from the corresponding cache library and output them to the target device.
2. The method according to claim 1, characterized in that When using the target small image as the incoming target small image to update the corresponding cache library, record the corresponding time when each incoming target small image is stored in the corresponding cache library; For each incoming target small image, determine the position area where it is located in the corresponding image frame. If the position area is within a preset range outside the image occlusion area of the corresponding image frame, modify the recorded corresponding time of the incoming target small image to the time obtained by extending the preset duration based on the corresponding time.
3. The method according to claim 2, characterized in that The image occlusion area is determined by the following method: After performing object detection on the N consecutive image frames closest to the current time of each monitoring device, mark the detection frames of multiple detected objects in each image frame; For each image frame, calculate the cumulative value M of the marked values of each pixel point in the image frame, where: M = M0 + M1 * n1 + M2 * n2; M0 represents the initial value of the marked value of the pixel point; M1 represents the increased value corresponding to the marked value when the pixel point is covered by the first area; M2 represents the increased value corresponding to the marked value when the pixel point is covered by the second area; n1 represents the number of times the pixel point is covered by the first area; n2 represents the number of times the pixel point is covered by the second area; where M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; where the first area is: the area defined by each detection frame in the image frame; the second area is: the enlarged area obtained by enlarging each first area according to a preset ratio; Calculate the sum of the cumulative values of the marked values of the pixel points with corresponding positions in the N image frames, screen out the pixel points whose sum of the cumulative values of the marked values is greater than the first preset value as reference pixel points, and determine the area of the contiguous area formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than the second preset value, then determine the contiguous area as the image occlusion area.
4. The method according to claim 1, characterized in that: The performing object detection on the current image frames of multiple monitoring devices and extracting the target small images with the highest quality scores corresponding to each detected object in the current image frames specifically includes: Performing object detection on each image frame. When the detected object is of a preset target type, mark a detection frame on the detected object. According to the coordinates and image features of each of the detection frames, the same detected target in different image frames is determined, and a target set of the detected target is generated; the target set at least includes the image frame number of the detected target in the corresponding image frame, the coordinates of the detection frame, and a small image of a candidate target including the detected target, which is intercepted from the corresponding image frame according to the coordinates of the detection frame; The quality score corresponding to each candidate target small image in each target set is determined, and the target small image with the highest quality score is extracted.
5. The method according to claim 1, characterized in that For each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, the target small image is used as the target small image to be stored in the library, and the cache library is updated, specifically including: For each small target image extracted this time: Determine the shooting scene to which the target small image belongs according to the installation information of the monitoring device that collects the image frame corresponding to the target small image; According to the correspondence between the shooting scene and the cache library, determining the cache library corresponding to the shooting scene; Calculate the similarity between the target small image and each stored target small image currently stored in the cache library, take the stored target small image whose similarity value is greater than a preset value as the matching target small image, compare the quality score of the target small image and the matching target small image, and when the quality score of the target small image is higher, take the target small image as the stored target small image to replace the matching target small image in the cache library; If all similarity values are less than or equal to the preset value, the target small image is taken as the storage target small image and added to the cache library.
6. The method according to claim 1, characterized in that When at least one of the plurality of monitoring devices is a smart device having target detection capability, the method further includes: Receiving target small images corresponding to a plurality of detected targets output for corresponding image frames and sent by the at least one smart device; For each of the target small images, when it is determined that the detected target in the target small image is of the preset target type, it is determined whether the target small image matches the extracted target small images based on the coordinate information and image features of the target small image. If so, the target small image is deleted; if not, the target small image is used as the extracted target small image.
7. An image data multi-target deduplication system, characterized in that: include: A detection module is used to perform target detection on current image frames of multiple monitoring devices, and extract a small target image with the highest quality score corresponding to each detected target in the current image frame; a deduplication module, for each target small image extracted this time, according to the shooting scene corresponding to the target small image, if the quality score of the target small image is higher than the quality score of the target small image matching in the cache library corresponding to the shooting scene, or the target small image is not currently stored in the cache library, then the target small image is used as the target small image to be stored in the library, and the cache library is updated; An output module, configured to traverse, according to a set period, each of the currently stored incoming target small images in each of the buffer libraries, remove the incoming target small images whose incoming time exceeds a preset timeout duration from the corresponding buffer libraries, and output them to a target device.
8. The system according to claim 7, characterized in that When the deduplication module uses the target small image to update the corresponding buffer library as an incoming target small image, it records the corresponding time when each of the incoming target small images is stored in the corresponding buffer library; For each of the incoming target small images, determine the position area of the incoming target small image in the image frame to which it belongs. If the position area is within a preset range outside the image occlusion area of the corresponding image frame, modify the recorded corresponding time corresponding to the incoming target small image to the time obtained by extending the preset duration based on the corresponding time.
9. The system according to claim 8, wherein The detection module is further configured to perform target detection on the N consecutive image frames closest to the current time of each of the monitoring devices, and mark the detection frames of multiple detected targets in each of the image frames; The system further includes a judgment module, configured to determine the image occlusion area according to the target detection results of the N image frames output by the detection module. Specifically, the judgment module is configured to: For each of the image frames, calculate the cumulative value M of the marked values of the pixel points in the image frame, where: M = M0 + M1 * n1 + M2 * n2; M0 represents the initial value of the marked value of the pixel point; M1 represents the increased value corresponding to the marked value when the pixel point is covered by the first area; M2 represents the increased value corresponding to the marked value when the pixel point is covered by the second area; n1 represents the number of times the pixel point is covered by the first area; n2 represents the number of times the pixel point is covered by the second area; where M0, M1, and M2 are set constants, and M1 < M2, n1 ≥ 0, n2 ≥ 0; wherein, the first area is: the area defined by each of the detection frames in the image frame; the second area is: the enlarged area obtained by enlarging each of the first areas according to a preset ratio; Calculate the sum of the cumulative values of the marked values of the pixel points with corresponding positions in the N image frames, screen out the pixel points whose sum of the cumulative values of the marked values is greater than a first preset value as reference pixel points, and determine the area of the contiguous area formed by the adjacent reference pixel points according to the positions of the reference pixel points in the image frame; if the area is greater than a second preset value, determine the contiguous area as the image occlusion area.
10. An image data multi-target deduplication device, characterized in that: Including: A memory, configured to store program instructions; A processor, configured to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 6 according to the obtained program.
Citation Information
Patent Citations
Image deduplication method, storage medium, network equipment and intelligent monitoring system
CN110781733A
Target detection result deduplication method and system, electronic equipment and storage medium
CN117541857A
Image capture deduplication method and device
CN117793399A
Target snapshot method, system and device
CN117793518A
Method and apparatus for video processing
US20210201038A1
