Polymerization optimization method, electronic device and computer-readable storage medium

By removing the wrong images and searching and supplementing the missed images in the image collection technology, the problem of low accuracy of image collection is solved, and the accuracy and efficiency of collection is improved.

CN114972781BActive Publication Date: 2025-02-07ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210412760.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-02-07
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

Under the influence of factors such as identification errors, the accuracy of the existing image collection technology needs to be improved.

Method used

By acquiring multiple target files, clustering the clustered images in advance, and determining whether there are missed images and missed images in each target file. The wrong image is transferred to the candidate set, and the missed image is found and added to the target file in the candidate set.

Benefits of technology

The missed images in the target file are removed, the search range of missed images is narrowed, the search efficiency is improved, and the integrity of images in the target file is ensured, thereby improving the accuracy of gathering files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114972781B_ABST
    Figure CN114972781B_ABST
Patent Text Reader

Abstract

The present application discloses a clustering optimization method, an electronic device, and a computer-readable storage medium, the clustering optimization method comprising: obtaining multiple target archives, wherein multiple images to be clustered are clustered in advance to obtain multiple target archives; determining whether each target archive has a wrongly shot image and a missed image; in response to the presence of a wrongly shot image in the target archive, transferring the wrongly shot image from the target archive to a candidate set; in response to the presence of a missed image in the target archive, searching for the missed image in the candidate set, and adding the found missed image to the target archive. The clustering optimization method provided by the present application can improve the accuracy of clustering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a poly file optimization method, an electronic device and a computer-readable storage medium. Background Art

[0002] Image clustering technology can organize the image data collected by the capture device and cluster them into one file for each target object, thus realizing structured information storage and comparative analysis, and plays an invaluable role in many fields. However, due to factors such as recognition errors, the accuracy of image clustering needs to be further improved. Summary of the invention

[0003] The present application provides a clustering optimization method, an electronic device and a computer-readable storage medium, which can improve the accuracy of clustering.

[0004] A first aspect of an embodiment of the present application provides a clustering optimization method, the method comprising: acquiring a plurality of target archives, wherein a plurality of images to be clustered are clustered in advance to obtain a plurality of the target archives; determining respectively whether each of the target archives has mis-shot images and missed images; in response to the presence of the mis-shot images in the target archives, transferring the mis-shot images from the target archives to a candidate set; in response to the presence of the missed images in the target archives, searching for the missed images in the candidate set, and adding the missed images found to the target archives.

[0005] A second aspect of an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a communication circuit, wherein the processor is coupled to the memory and the communication circuit, respectively, and program data is stored in the memory. The processor implements the steps in the above method by executing the program data in the memory.

[0006] A third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the above method.

[0007] The beneficial effect is: the method of the present application transfers the mis-shot images existing in the target file to the candidate set, which can, on the one hand, remove the mis-shot images existing in the target file, and on the other hand, search for the missed images in the target file from the candidate set, thereby narrowing the search range of the missed images and improving the search efficiency. After adding the found missed images to the target file, the integrity of the images in the target file can be guaranteed, thereby improving the accuracy of the aggregation. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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. Among them:

[0009] Figure 1 It is a flow chart of an implementation method of the clustering optimization method of the present application;

[0010] Figure 2 It is the topological structure diagram of the equipment in this application;

[0011] Figure 3 yes Figure 1 A partial flow chart of step S140;

[0012] Figure 4 yes Figure 3 Schematic diagram of the process of step S142;

[0013] Figure 5 yes Figure 4 Schematic diagram of the process of step S1422;

[0014] Figure 6 yes Figure 1 Another partial flow chart of step S140;

[0015] Figure 7 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0016] Figure 8 It is a structural schematic diagram of another embodiment of the electronic device of the present application;

[0017] Fig. 9 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0018] 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 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.

[0019] See also Figure 1 , Figure 1 : is a flow chart of an implementation method of the present application of the polyarch optimization, the method comprising:

[0020] S110: Acquire a plurality of target files, wherein a plurality of images to be clustered are clustered in advance to obtain a plurality of target files.

[0021] Specifically, clustering processing is performed on a plurality of images to be clustered in advance to obtain a plurality of target files.

[0022] The multiple images to be clustered are all images captured by the capture device of the same type of target object, for example, all images are captured of people, or all images are captured of vehicles, or all images are captured of animals, etc.

[0023] In an application scenario, some of the image data in the target file have been processed into the form of data streams, but some are still image data. For subsequent recognition and calculation, the image data in each target file needs to be preprocessed. The preprocessing process includes: first, the size of the image in the target file is normalized to make the size of all images consistent, and then considering the images collected by different capture devices, due to factors such as brightness and contrast, there will be problems with image pixels being too large. In order to make the image more effective for subsequent recognition and weaken the influence of factors such as capture equipment, lighting, and color, the image needs to be standardized.

[0024] The present application does not limit the specific process of normalizing the image. For example, the following formula may be used to normalize the image:

[0025] Wherein, x′ is the pixel value of the pixel after standardization, x is the pixel value of the pixel before standardization, μ is the average pixel value of the pixel before standardization, and σ is the standard deviation of the pixel value of the pixel before standardization.

[0026] The standardized data is more in line with the normal distribution, and the differences between data dimensions will be reduced to a very small range, which can effectively avoid the oscillation that occurs during the gradient descent process and can effectively carry out subsequent processing.

[0027] It should be noted that the above preprocessing process is not a necessary process, and in other implementations, the preprocessing process may not be performed.

[0028] S120: Determine whether each target file contains mis-shot images and missed images.

[0029] Specifically, the existence of mis-shot images in the target file means that the target file does not include images of the same target object, and except for the image of one of the target objects, the images of the remaining target objects are all mis-shot images; the existence of missed images in the target file means that the captured image of the corresponding target object is missing in the target file.

[0030] S130: In response to the presence of a mis-shot image in the target archive, transferring the mis-shot image from the target archive to the candidate set.

[0031] Specifically, after determining that there are mis-shot images in the target file, the found mis-shot images are transferred to the candidate set. On the one hand, the mis-shot images in the target file can be removed to ensure the accuracy of the images in the target file. On the other hand, the setting of the candidate set can narrow the scope of subsequent searches for missed images.

[0032] S140: In response to the existence of missed images in the target archive, searching for missed images in the candidate set, and adding the found missed images to the target archive.

[0033] Specifically, since multiple target files are obtained by clustering multiple images to be clustered, among the multiple target files, if one target file has a mis-shot image, there must be another target file with a missed image, and the missed image in the target file must exist in the candidate set. Therefore, searching for the missed image in the target file from the candidate set can narrow the search scope and improve the search efficiency. After the found missed image is added to the target file, the integrity of the image in the target file can be guaranteed.

[0034] From the above content, it can be seen that the present embodiment adds the mis-shot images existing in the target file to the candidate set. On the one hand, it can remove the mis-shot images existing in the target file, and on the other hand, it can search for the missed images existing in the target file from the candidate set, thereby narrowing the search range of the missed images and improving the search efficiency. After adding the found missed images to the target file, the integrity of the images in the target file can be guaranteed, thereby improving the accuracy of the aggregation.

[0035] In this embodiment, step S120 includes: inputting each target file into a pre-trained classification model to determine whether each target file has a mis-shot image or a missed image.

[0036] The classification model is supervised and trained in advance using labeled data, so that the trained classification model can determine whether the received target file contains mis-shot images and missed images.

[0037] Among them, the classification model can be a support vector machine, a decision tree, a sequence model RNN or LSTM, etc. This application does not limit the structure of the classification model.

[0038] After determining whether the target file has mis-shot images or missed images, further searching for mis-shot images or missed images in the target file is performed. The process is described below.

[0039] In this embodiment, there are three schemes for searching the target archive for the existing mis-shot images:

[0040] The first scheme includes: (a1) in response to the existence of a mis-shot image in the target file, based on the capture time of the target image in the target file, determining the duration taken by the target object corresponding to the target file to pass through a neighboring device pair each time, wherein the neighboring device pair includes two capture devices that are adjacent in position and connected by a road; (b1) in response to the existence of an outlier in the determined duration, determining the target image corresponding to the outlier in the target file and captured by the neighboring device corresponding to the outlier as a mis-shot image, and transferring the mis-shot image from the target file to the candidate set.

[0041] First, the concept of neighboring device pairs is introduced:

[0042] Among all the capture devices in the target area (the multiple images to be clustered mentioned above are all images captured by the capture devices in the target area), if there are two capture devices located adjacent to each other and connected by a road, it is determined that the two capture devices constitute a neighboring device pair.

[0043] Among them, whether two capture devices constitute a neighboring device pair can be judged in combination with the map. Specifically, each capture device in the target area is marked on the map, and then it is determined whether there is a road connection between the two neighboring capture devices. If so, it is determined that the two capture devices are a neighboring device pair.

[0044] Alternatively, the judgment may be made based on the continuity characteristics of a large amount of historical data. Specifically, based on a large amount of historical captured images, if two capture devices capture the same target object in sequence, the two capture devices constitute a neighboring device pair.

[0045] After determining the adjacent device pairs in the target area, the following can be constructed: Figure 2 The device topology diagram is shown in Figure 1. Figure 2 In the figure, a circle represents a capture device, and two capture devices connected by a line segment constitute a neighboring device pair.

[0046] Among them, after determining the neighboring device pairs in the target area, the duration of the target object passing through the neighboring device pairs can be further determined. That is, assuming that there is a neighboring device pair including capture device A and capture device B, the duration corresponding to the neighboring device pair is the duration taken by the target object to reach the position of capture device B from the position of capture device A.

[0047] Among them, the time it takes for different target objects to pass through the neighboring device pair can be counted based on a large amount of historical data, and then the average time can be determined, and finally the average time can be determined as the time it takes for the target object to pass through the neighboring device pair. Alternatively, the time it takes for the target object to pass through the neighboring device pair can be determined based on the distance between the two capture devices in the neighboring device pair (specifically, the distance can be determined based on the longitude and latitude of the two capture devices) and the average movement speed of the target object (which can be obtained based on statistics).

[0048] The above introduces the neighboring device pairs. The following continues to introduce the first solution mentioned above:

[0049] After determining that there are mis-shot images in the target file, the duration taken by the target object corresponding to the target file to pass through the neighboring device pair each time is counted according to the capture time of the image in the target file, wherein the duration taken by the target object to pass through the neighboring device pair each time should be within a given range, and no abnormal situation should occur. Therefore, it is determined whether there are abnormal values ​​in the statistical duration. If there are abnormal values, the target image corresponding to the abnormal value captured by the neighboring device pair corresponding to the abnormal value is determined as a mis-shot image, and the mis-shot image is transferred from the target file to the candidate set.

[0050] It is worth noting that, assuming that the target object passes through the same neighboring device pair twice, and the time taken for the first time to pass through the neighboring device pair is L1, and the time taken for the second time to pass through the neighboring device pair is L2, but when performing outlier detection, only L1 is determined as an outlier, then only the image captured by the neighboring device pair when the target object passes for the first time will be determined as an erroneous image.

[0051] Among them, it is possible to determine whether there are abnormal values ​​in the statistically obtained duration by using methods such as box plots or 3σ criteria. The detection process is not described in detail here.

[0052] For ease of understanding, the following example introduces the process of counting the time taken by the target object corresponding to the target file to pass through the neighboring device pair each time according to the capture time of the image in the target file:

[0053] Assume that the neighboring device pair includes a capture device A and a capture device B. When the target object passes through the neighboring device pair, the capture device A captures it and obtains images A and B. The capture device B also captures it and obtains images C and D. Among them, the average value of the capture time of images A and B, and the average value of the capture time of images C and D can be calculated. The difference between these two average values ​​is the time taken by the target object to pass through the neighboring device pair this time. Alternatively, the capture time of any one of images A and B and the capture time of any one of images C and D can be determined. The difference is the time taken by the target object to pass through the neighboring device pair this time.

[0054] The first method for finding mis-shot images is introduced above. The second and third methods are introduced below:

[0055] The second solution: if there is a target image in the target file that is discontinuous with other target images in time or space, it is determined that the target image is a mis-shot image.

[0056] For example, the capture devices corresponding to all target images in the target file are counted, and among all the captured devices, if there is a capture device that is far away from other capture devices, then the image captured by the capture device that is far away in the target file is determined as a wrong image. Alternatively, the capture times corresponding to all target images in the target file are counted, and among all the captured times obtained, if there is a capture time that is far away from other capture times, then the image corresponding to the capture time that is far away in the target file is determined as a wrong image.

[0057] The step of determining whether there is a target image in the target file that is discontinuous with other target images in time or space may include:

[0058] (a2) Based on the capture time or the location of the capture device, clustering processing is performed on the target images in the target image file to obtain a clustering result.

[0059] Specifically, target images with similar capture times or similar capture device locations are grouped into one category.

[0060] (b2) In response to the clustering result including more than two image clusters, a preset number of image clusters with the largest number of target images in the clustering result are determined as target image clusters.

[0061] Specifically, after clustering, if there are more than two image clusters, the image clusters with the largest number of target images are determined as target image clusters. The image clusters in the clustering results can be sorted from large to small according to the number of images included, and then the image clusters with the largest number of images are determined as target image clusters.

[0062] The preset number can be determined according to the number of image clusters in the clustering result. For example, when the clustering result includes two image clusters, the preset number is one. When the clustering result includes three image clusters, the preset number can be one or two.

[0063] (c2) determining the target image included in the image clusters other than the target image cluster in the clustering result as mis-shot images, and transferring the mis-shot images from the target file to the candidate set.

[0064] Specifically, after the target image cluster is determined, target images included in other image clusters except the target image cluster in the clustering results are all determined as mis-shot images and added to the candidate set.

[0065] The third solution: Considering that the image features of the mis-shot image in the target file must be significantly different from those of other images, the third solution includes:

[0066] (a3) In response to the presence of mis-shot images in the target file, clustering is performed on the target images in the target image file based on image features to obtain a clustering result.

[0067] For each target image in the target file, the pixel values ​​of its pixels can be used to form a feature vector corresponding to the target image, and the feature vector is the image feature of the target image. Then, the feature vectors corresponding to all target images in the target file are clustered.

[0068] Among them, any clustering algorithm such as k-means can be used for clustering processing, and there is no limitation here.

[0069] (b3) In response to the clustering result including more than two image clusters, a preset number of image clusters with the largest number of target images in the clustering result are determined as target image clusters.

[0070] (c3) determining the target image included in the image cluster outside the target image cluster in the clustering result as a mis-shot image, and transferring the mis-shot image from the target file to the candidate set.

[0071] Among them, steps (b3) and (c3) are the same as steps (b2) and (c2) in the second solution, and will not be repeated here.

[0072] Among them, one or a combination of the above three solutions can be used to search for the wrongly shot images in the target file.

[0073] The following describes how to find the missed images in the target archive in the candidate set:

[0074] In this embodiment, combined with Figure 3 , step S140 includes:

[0075] S141: In response to the existence of missed images in the target file, searching for adjacent image pairs in the target file, the adjacent image pairs including a first target image and a second target image with adjacent capture times, and when any target object reaches the position of a second capture device corresponding to the second target image from the position of a first capture device corresponding to the first target image, it must pass through the position of a third capture device.

[0076] Specifically, the trajectory of the target object should be continuous. If the target object passes through capture device A (i.e., the first capture device) and capture device B (i.e., the second capture device), it must pass through capture device C (i.e., the third capture device). However, in the target file, after all target images are sorted from front to back according to the capture time, the two images with adjacent capture times are respectively captured by capture device A and capture device B, and there is no image captured by capture device C between the two images. It is determined that the target file has lost the image captured by capture device C.

[0077] Among them, when searching for adjacent image pairs in the target file, all capture devices in the target area (the multiple images to be clustered mentioned above are all images captured by the capture devices in the target area) can be marked on the map in advance, and then the target images in the target file are sorted in order from front to back according to the capture time. Then, combined with the map, it is determined whether there is a necessary capture device between the capture devices corresponding to two target images with adjacent capture times. If so, it is determined that the two target images constitute an adjacent image pair.

[0078] It is understandable that the adjacent image pairs in the target file may be one pair, two pairs or more pairs. When the adjacent image pairs do not exist in the target file, it can be determined that the target file does not have any missed images.

[0079] S142: Determine the image captured by the third capturing device corresponding to each adjacent image pair in the candidate set as a missed image.

[0080] From the above analysis, it can be seen that when there are adjacent image pairs in the target file, the target file has lost the image captured by the third capture device corresponding to the adjacent image pair. Therefore, the image captured by the third capture device corresponding to each adjacent image pair in the candidate set can be determined as a missed image.

[0081] Among them, considering that the images captured by the third capture device corresponding to the adjacent image pairs in the candidate set may correspond to different target objects, the accuracy of finding the missed images corresponding to the target file is improved. Figure 4 , step S142 specifically includes:

[0082] S1421: Obtain a first capture time corresponding to the first target image and a second capture time corresponding to the second target image in each adjacent image pair.

[0083] S1422: Determine the images captured by the third capturing device corresponding to each adjacent image pair in the candidate set between the first capturing time and the second capturing time corresponding to each adjacent image pair as missed images.

[0084] Through the above analysis, it can be known that for each pair of adjacent images, the time when the corresponding third capture device captures the target object corresponding to the target file must be between the first capture time and the second capture time corresponding to the adjacent image pair, and it is impossible to appear in other time periods. Therefore, the images captured by the third capture device between the first capture time and the second capture time in the candidate set are determined as missed images. This can avoid determining the images captured by the third capture device of other target objects as missed images of the target file, thereby improving the accuracy of completing the target file.

[0085] Considering that the images captured by the third capture device between the corresponding first capture time and the second capture time may also correspond to different target objects, in order to further improve the accuracy of finding the missed images corresponding to the target file, refer to Figure 5 , step S1422 specifically includes:

[0086] S14221: Obtain the first duration and the second duration corresponding to each pair of adjacent images.

[0087] Among them, the first time length is the time length taken by the target object to reach the position of the corresponding third capture device from the position of the first capture device corresponding to the adjacent image pair, and the second time length is the time length taken by the target object to reach the position of the corresponding third capture device from the position of the second capture device corresponding to the adjacent image pair.

[0088] Specifically, combined with the concept of the above-mentioned neighboring device pair, it can be known that for each neighboring image pair, the corresponding first capture device and third capture device constitute a neighboring device pair (defined as the first neighboring device pair), and the second capture device and the third capture device constitute a neighboring device pair (defined as the second neighboring device pair).

[0089] The first duration is the duration taken by the target object to pass through the first pair of neighboring devices; the second duration is the duration taken by the target object to pass through the second pair of neighboring devices.

[0090] S14222: Determine the third capturing time corresponding to each pair of adjacent images based on the first capturing time and the first duration corresponding to each pair of adjacent images.

[0091] S14223: Based on the second capture time and the second duration corresponding to each pair of adjacent images, determine the fourth capture time corresponding to each pair of adjacent images.

[0092] The third capture time and the fourth capture time corresponding to the adjacent image pair are located between the first capture time and the second capture time corresponding to the adjacent image pair.

[0093] Among them, for each pair of adjacent images, the third capture time when the target object is at the position of the first capture device is inferred based on the time when the target object is at the position of the first capture device and the first duration, and the fourth capture time when the target object is at the third capture device can be inferred based on the time when the target object is at the position of the second capture device and the second duration.

[0094] Therefore, based on the third capture time and the fourth capture time, the time range in which the target object was captured by the third capture device can be determined. Therefore, the image captured by the third capture device that is missing from the target file must be between the third capture time and the fourth capture time. Subsequently, when searching for missing images in the candidate set, the search range can be further narrowed and the search efficiency can be improved.

[0095] S14224: Determine the images captured by the third capturing device corresponding to each adjacent image pair in the candidate set between the third capturing time and the fourth capturing time corresponding to each adjacent image pair as missed images.

[0096] After the above steps, for each pair of adjacent images, there is a corresponding third capture time and fourth capture time. Therefore, when searching for missed images in the candidate set, you can directly search for the image captured by the third capture device corresponding to the adjacent image pair between the corresponding third capture time and fourth capture time.

[0097] The above describes the process of searching for missed images in the candidate set. However, it should be noted that the process of searching for missed images in the candidate set is not limited to this. In other implementations, images that meet the requirements of similarity with the target file can also be searched in the candidate set, and these images are used as missed images of the target image.

[0098] In this embodiment, in order to ensure the accuracy of completing the target file, refer to Figure 6 Step S140 is a step of adding the found missed images to the target file, including:

[0099] S143: Determine the similarity between each of the missed images found and the target file.

[0100] First, the feature vector of the target file is determined. The process may be: the image feature of each image in the target file is represented by a feature vector of fixed length (a feature vector is formed by the pixel values ​​of the pixels in the image), and then the average vector of the feature vector is determined, and the average vector is used as the feature vector of the target file, or the feature vector of any image in the target file is used as the feature vector of the target file. The present application does not limit the process of determining the feature vector of the target file.

[0101] Then, the image features of each missed image found are also represented by a fixed-length feature vector, and then the similarity between the feature vector of each missed image and the feature vector of the target file is determined respectively, so as to obtain the similarity between each missed image and the target file.

[0102] S144: adding the missed images whose corresponding similarities exceed the similarity threshold to the target file.

[0103] Specifically, only when the similarity between the missed image and the target file exceeds the similarity threshold will it be added to the target file; otherwise, it is determined that it is not the same target object as the target file.

[0104] It should be noted that, in other implementations, after the missed images corresponding to the target file are found, similarity calculation may not be performed, and the found missed images may be directly added to the target file.

[0105] See also Figure 7 , Figure 7 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 200 includes a processor 210, a memory 220 and a communication circuit 230. The processor 210 is coupled to the memory 220 and the communication circuit 230 respectively. The memory 220 stores program data. The processor 210 implements the steps in any of the above-mentioned implementation methods by executing the program data in the memory 220. The detailed steps can be found in the above-mentioned implementations and will not be repeated here.

[0106] The electronic device 200 may be any device with image processing capability, such as a computer or a mobile phone, and is not limited here.

[0107] See also Figure 8 , Figure 8 The electronic device 300 includes an acquisition module 310 , a determination module 320 , a candidate module 330 and a completion module 340 .

[0108] The acquisition module 310 is used to acquire a plurality of target files, wherein a plurality of images to be clustered are clustered in advance to obtain a plurality of target files.

[0109] The determination module 320 is connected to the acquisition module 310 and is used to determine whether each target file has a wrongly shot image or a missed image.

[0110] The candidate module 330 is connected to the determination module 320 and is used to transfer the erroneous image from the target file to the candidate set in response to the presence of the erroneous image in the target file.

[0111] The completion module 340 is connected to the candidate module 330 and is used to search for the missed images in the candidate set in response to the presence of missed images in the target archive, and add the found missed images to the target archive.

[0112] The electronic device 300 may be any device with image processing capability such as a computer or a mobile phone, and is not limited here. The electronic device 300 executes the method steps in any of the above embodiments when working. The detailed method steps can be found in the above embodiments and will not be repeated here.

[0113] See also Fig. 9 , Fig. 9 The computer-readable storage medium 400 stores a computer program 410, which can be executed by a processor to implement the steps in any of the above methods.

[0114] Among them, the computer-readable storage medium 400 can specifically be a device that can store the computer program 410, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it can also be a server that stores the computer program 410. The server can send the stored computer program 410 to other devices for execution, or it can also run the stored computer program 410 by itself.

[0115] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for optimizing the aggregation of files, characterized in that: The method comprises: Acquire a plurality of target files, wherein a plurality of images to be clustered are clustered in advance to obtain the plurality of target files; Determine respectively whether each of the target files has a wrongly shot image and a missed image, wherein the wrongly shot image refers to an image in the target file that is not an image of the target object corresponding to the target file; the missed image in the target file refers to a captured image of the corresponding target object missing from the target file; In response to the presence of the mis-shot image in the target archive, transferring the mis-shot image from the target archive to a candidate set; In response to the presence of the missed image in the target archive, the missed image is searched for in the candidate set, and the found missed image is added to the target archive.

2. The method according to claim 1, characterized in that In response to the existence of the missed image in the target archive, the step of searching for the missed image in the candidate set and adding the found missed image to the target archive comprises: In response to the existence of the missed image in the target file, searching for an adjacent image pair in the target file, the adjacent image pair comprising a first target image and a second target image whose capture times are adjacent, and when any target object reaches the position of a second capture device corresponding to the second target image from the position of a first capture device corresponding to the first target image, it must pass through the position of a third capture device; The image captured by the third capturing device corresponding to each of the adjacent image pairs in the candidate set is determined as the missed image.

3. The method according to claim 2, characterized in that The step of determining the image captured by the third capturing device corresponding to each of the adjacent image pairs in the candidate set as the missed image comprises: Acquire a first capture time corresponding to the first target image and a second capture time corresponding to the second target image in each of the adjacent image pairs; The images captured by the third capturing device corresponding to each of the adjacent image pairs in the candidate set between the first capturing time and the second capturing time corresponding to each of the adjacent image pairs are determined as the missed images.

4. The method according to claim 3, characterized in that The step of determining the images captured by the third capturing device corresponding to each of the adjacent image pairs in the candidate set between the first capturing time and the second capturing time corresponding to each of the adjacent image pairs as the missed images comprises: Acquire a first duration and a second duration corresponding to each of the adjacent image pairs, wherein the first duration is the duration taken by the target object to reach the corresponding position of the third capture device from the position of the first capture device corresponding to the adjacent image pair, and the second duration is the duration taken by the target object to reach the corresponding position of the third capture device from the position of the second capture device corresponding to the adjacent image pair; Determine, based on the first capture time and the first duration corresponding to each of the adjacent image pairs, a third capture time corresponding to each of the adjacent image pairs; Based on the second capture time and the second duration corresponding to each of the adjacent image pairs, determine the fourth capture time corresponding to each of the adjacent image pairs, wherein the third capture time and the fourth capture time corresponding to the adjacent image pairs are between the first capture time and the second capture time corresponding to the adjacent image pairs; The images captured by the third capturing device corresponding to each of the adjacent image pairs in the candidate set between the third capturing time and the fourth capturing time corresponding to each of the adjacent image pairs are determined as the missed images.

5. The method according to claim 4, characterized in that The method further comprises: A neighboring device pair in the target area is searched, and a duration of time when the target object passes through the neighboring device pair is determined, wherein the neighboring device pair includes two capture devices that are adjacent in position and connected by a road.

6. The method according to claim 1, characterized in that In response to the presence of the mis-shot image in the target archive, the step of transferring the mis-shot image from the target archive to the candidate set comprises: In response to the presence of the mis-shot image in the target file, based on the capture time of the target image in the target file, determining the duration taken by the target object corresponding to the target file to pass through a neighboring device pair each time, wherein the neighboring device pair includes two capture devices that are adjacent in position and connected by a road; In response to the existence of an abnormal value in the determined time length, the target image corresponding to the abnormal value captured by the neighboring device corresponding to the abnormal value in the target file is determined as the mis-shot image, and the mis-shot image is transferred from the target file to the candidate set.

7. The method according to claim 1, characterized in that In response to the presence of the mis-shot image in the target archive, the step of transferring the mis-shot image from the target archive to the candidate set comprises: In response to the presence of the mis-shot image in the target file, clustering the target images in the target file based on image features, capture time, or location of a capture device to obtain a clustering result; In response to the clustering result including more than two image clusters, determining a preset number of image clusters having the largest number of target images in the clustering result as target image clusters; The target image included in the image cluster outside the target image cluster in the clustering result is determined as the mis-shot image, and the mis-shot image is transferred from the target file to the candidate set.

8. The method according to claim 1, characterized in that: The step of adding the found missed images to the target file comprises: Determining the similarity between each of the missed images found and the target file respectively; The missed images corresponding to the similarities exceeding the similarity threshold are added to the target file.

9. The method according to claim 1, characterized in that: The step of respectively determining whether each of the target files has a wrongly shot image or a missed image comprises: Each of the target files is input into a pre-trained classification model to determine whether each of the target files contains the mis-shot image and the missed image.

10. An electronic device, characterized in that: The electronic device includes a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit respectively, the memory stores program data, and the processor implements the steps in the method as described in any one of claims 1 to 9 by executing the program data in the memory.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Snapshot machine image pushing test method and device

    CN110765846A

  • Image file gathering method, image file gathering device and computer readable storage medium

    CN113987243A