A method and device for deduplication of image target area
Through object detection and feature extraction network models, unique identifiers are generated, corresponding relationships are established, and duplicate duplicate data in computer vision object detection algorithm is solved, and the problem of duplicate data in statistical data is improved and the accuracy of data is improved.
Patent Information
- Application Number
- CN202111615007.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-12-27
AI Technical Summary
Existing computer vision object detection algorithms often have a large amount of duplicate data when statistical data, which affects the accuracy of statistical data.
Through the target detection network model and feature extraction network model, a unique identifier is generated, corresponding relationship is established, and the target area is filtered and deduplicated, to avoid misjudgment and omissions, and to improve the accuracy of statistical data.
It effectively avoids misjudging the target area detected under different time and geographical ranges as different regions, ensuring the accuracy of deduplication processing, and improving the accuracy of statistical data.
Smart Images

Figure CN114299316B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for deduplication of a target image area. Background Art
[0002] Computer vision target detection algorithms can be used to analyze video and image data and detect specific targets, such as human bodies, vehicles, workpieces, etc. They are used in many fields. For example, computer vision target detection algorithms are used in the field of industrial visual inspection to detect whether workers in the factory area are wearing safety helmets and whether the inspection personnel have entered prohibited areas.
[0003] Among them, due to business needs, it is often necessary to collect statistics on the data detected by the above algorithm to obtain statistical data. However, there may be a large amount of duplicate data in the statistical data, which affects the accuracy of the statistical data.
[0004] Therefore, there is an urgent need for a method to deduplicate data. Summary of the invention
[0005] This application provides the following technical solutions:
[0006] On one hand, the present application provides a method for deduplication of an image target area, comprising:
[0007] Acquire at least one image to be processed, input the image to be processed into a target detection network model, obtain a target area obtained by the target detection network model, and generate a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed;
[0008] Inputting the target area and the first identifier into a feature extraction network model, obtaining the features of the target object obtained by the feature extraction network model, generating a second identifier that uniquely represents the features of the target object, and establishing a first corresponding relationship between the first identifier and the second identifier;
[0009] Based on the first corresponding relationship, at least one target first identifier is selected from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same;
[0010] Deduplication processing is performed on the target area represented by each of the target first identifiers.
[0011] Optionally, the deduplication processing of the target area represented by each of the first target identifiers includes:
[0012] One is selected from the target areas represented by the first target identifiers to be retained.
[0013] Optionally, the filtering out at least one target first identifier from each of the first identifiers based on the first corresponding relationship includes:
[0014] Comparing the features included in the feature database with the features of the target object to obtain a comparison result, and establishing a second corresponding relationship between the comparison result and the second identifier;
[0015] If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determining the second identifier corresponding to the comparison result as the second identifier to be used;
[0016] Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier;
[0017] The deduplication processing of the target area represented by each of the first target identifiers includes:
[0018] discarding the target area represented by the target first identifier;
[0019] Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
[0020] Optionally, the method further includes:
[0021] If the comparison result is that there is no feature matching the feature of the target object among the features included in the feature database, based on the second corresponding relationship, determining that the second identifier corresponding to the comparison result is the identifier to be stored, and storing the feature of the target object represented by the identifier to be stored in the feature database;
[0022] Based on the first corresponding relationship, the target area represented by the first identifier corresponding to the identifier to be stored is stored in the statistical database.
[0023] Optionally, after comparing the features contained in the feature database with the features of the target object and obtaining the comparison result, the method further includes:
[0024] If the comparison result is that there is a feature in the feature database that matches the feature of the target object, the feature of the target object is fused with the feature in the feature database that matches the feature of the target object to obtain the target feature;
[0025] The target feature replaces the feature in the feature database that matches the feature of the target object.
[0026] Optionally, the method further includes:
[0027] Get the statistical duration;
[0028] When the retention time of the feature in the feature database reaches the statistical time length, the feature in the feature database is deleted.
[0029] On the other hand, the present application provides a device for deduplicating an image target area, comprising:
[0030] A target detection module is used to obtain at least one image to be processed, input the image to be processed into a target detection network model, obtain a target area obtained by the target detection network model, and generate a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed;
[0031] A feature extraction module, used for inputting the target area and the first identifier into a feature extraction network model, obtaining the features of the target object obtained by the feature extraction network model, generating a second identifier that uniquely represents the features of the target object, and establishing a first corresponding relationship between the first identifier and the second identifier;
[0032] Statistical deduplication module, used for:
[0033] Based on the first corresponding relationship, at least one target first identifier is selected from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same;
[0034] Deduplication processing is performed on the target area represented by each of the target first identifiers.
[0035] Optionally, the statistical deduplication module is specifically used to:
[0036] One is selected from the target areas represented by the first target identifiers to be retained.
[0037] Optionally, the statistical deduplication module is specifically used to:
[0038] Comparing the features included in the feature database with the features of the target object to obtain a comparison result, and establishing a second corresponding relationship between the comparison result and the second identifier;
[0039] If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determining the second identifier corresponding to the comparison result as the second identifier to be used;
[0040] Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier;
[0041] discarding the target area represented by the target first identifier;
[0042] Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
[0043] A third aspect of the present application provides an electronic device, characterized in that it includes:
[0044] Memory and processor;
[0045] The memory is used to store at least one set of instruction sets;
[0046] The processor is used to call and execute the instruction set in the memory, and execute the image target area deduplication method as described in any one of claims 1 to 6 by executing the instruction set.
[0047] Compared with the prior art, the beneficial effects of this application are:
[0048] In the present application, a target detection network model is used to obtain a target area, and a first identifier that uniquely represents the target area is generated. A feature extraction network model is used to extract features of a target object in the target area, and a second identifier that uniquely represents the features of the target object is generated. A first correspondence between the first identifier and the second identifier is established. Based on the first correspondence, at least one target first identifier is screened out from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same. The target areas represented by each of the target first identifiers are deduplicated, so that each target area having features of the same target object is selected and deduplicated. This can avoid misjudging target areas detected at different times and / or in different geographical ranges as different target areas, thereby avoiding omissions when deduplicating target areas and improving the accuracy of statistical data. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] 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 paying any creative labor.
[0050] Figure 1 is a flow chart of a method for deduplication of an image target area provided in Example 1 of the present application;
[0051] Figure 2 is a flow chart of a method for deduplication of an image target area provided in Example 2 of the present application;
[0052] Figure 3 is a flow chart of a method for deduplication of an image target area provided in Example 3 of the present application;
[0053] Figure 4 is a flow chart of a method for deduplication of an image target area provided in Example 4 of the present application;
[0054] Figure 5 It is a structural schematic diagram of a device for deduplication of an image target area provided by the present application;
[0055] Figure 6 It is a schematic diagram of the structure of an electronic device provided by the present application. DETAILED DESCRIPTION
[0056] 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.
[0057] In order to solve the above problems, the present application provides a method for deduplication of an image target area. The following is an introduction to the method for deduplication of an image target area provided by the present application.
[0058] Reference Figure 1 , is a flow chart of a method for deduplication of an image target area provided in Example 1 of the present application, such as Figure 1 As shown, the method may include but is not limited to the following steps:
[0059] Step S11, obtaining at least one image to be processed, inputting the image to be processed into a target detection network model, obtaining a target area obtained by the target detection network model, and generating a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed.
[0060] In this embodiment, the at least one image to be processed may include but is not limited to: at least one image to be processed acquired by the same image acquisition device at different times.
[0061] Of course, the at least one image to be processed may also include but is not limited to: multiple images to be processed acquired by the same image acquisition device at different times, and multiple images to be processed acquired by multiple image acquisition devices at different times.
[0062] When multiple images to be processed are obtained, the multiple images to be processed can be respectively input into multiple target detection network models to obtain target regions obtained by each target detection network model. It should be noted that the detection algorithms applied by the multiple target detection network models may be different from each other, but the prediction targets of the multiple target detection network models are the same. For example, when two images to be processed are obtained, namely, image 1 to be processed and image 2 to be processed, image 1 to be processed is input into target detection network model 1 to obtain target region 1 obtained by target detection network model 1, and target region 1 includes target object m on image 1 to be processed, and image 2 to be processed is input into target detection network model 2 to obtain target region 2 obtained by target detection network model 2, and target region 2 includes target object m on image 2 to be processed.
[0063] In this embodiment, the target detection network model can be understood as a convolutional neural network model that can predict the area containing the target object in the image. During operation, the target object to be detected is already determined and cannot be changed. If the target object to be detected needs to be changed, the convolutional neural network model can be retrained to replace the current target detection network model.
[0064] Step S12: input the target area and the first identifier into a feature extraction network model, obtain the features of the target object obtained by the feature extraction network model, generate a second identifier that uniquely represents the features of the target object, and establish a first corresponding relationship between the first identifier and the second identifier.
[0065] It should be noted that if the features of the target object in different target areas obtained by the feature extraction network model are the same, then the second identifier that uniquely characterizes the features of the target object is the same. For example, if target area a is input into the feature extraction network model to obtain feature 1 of target object 1 obtained by the feature extraction network model, and target area b is input into the feature extraction network model to obtain feature 1 of target object 1 obtained by the feature extraction network model, then for feature 1 of target object 1 obtained twice, the second identifiers generated twice are the same, both a1.
[0066] Step S13: based on the first corresponding relationship, select at least one target first identifier from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same.
[0067] Based on the first corresponding relationship, the second identifier corresponding to each first identifier can be determined. When the second identifier corresponding to each second identifier is determined, the target first identifier can be filtered out from each first identifier, and the second identifiers corresponding to each target first identifier are the same.
[0068] It can be understood that the second identifiers corresponding to the respective first target identifiers are the same, which means that the target areas represented by the respective first target identifiers have the same characteristics of the target object.
[0069] Step S14: performing deduplication processing on the target areas represented by the first target identifiers.
[0070] The target regions represented by the first target identifiers are deduplicated to ensure that target regions with the same target object features do not have duplication.
[0071] In this embodiment, in the case where the target areas represented by the first identifiers of the targets have the same characteristics of the target object, deduplication processing is performed on the target areas represented by the first identifiers of the targets, which can avoid misjudging the target areas detected at different times and / or different geographical ranges as different target areas, thereby avoiding omissions when deduplicating the target areas. For example, an image 1 to be processed acquired by an image acquisition device 1 and an image 2 to be processed acquired by an image acquisition device 2 are obtained, the image 1 to be processed is input into a target detection network model to obtain a target area 1 obtained by the target detection network model, and a first identifier c1 uniquely representing the target area 1 is generated, the image 2 to be processed is input into the target detection network model to obtain a target area 2 obtained by the target detection network model, and a first identifier c2 uniquely representing the target area 2 is generated, the target area 1 and the first identifier c1 are input into a feature extraction network model to obtain a feature 1 of the target object 1 obtained by the feature extraction network model, a second identifier d1 uniquely representing the feature 1 of the target object 1 is generated, and a relationship between the first identifier c1 and the second identifier d2 is established. The first corresponding relationship between the first identifier c1 and the second identifier d1 is established, and the target area 2 and the first identifier c2 are input into the feature extraction network model to obtain the feature 1 of the target object 1 obtained by the feature extraction network model, and the second identifier d1 that uniquely represents the feature 1 of the target object 1 is generated, and the first corresponding relationship between the first identifier c2 and the second identifier d1 is established. Based on the first corresponding relationship between the first identifier c1 and the second identifier d1, and the first corresponding relationship between the first identifier c2 and the second identifier d1, it is determined that the second identifiers corresponding to the first identifier c1 and the first identifier c2 are the same, and it can be determined that the first identifier c1 and the first identifier c2 are both the target first identifiers, and the target area 1 represented by the first identifier c1 and the target area 2 represented by the first identifier c2 are deduplicated. If the feature 1 of the target object 1 is not obtained, after processing the to-be-processed images collected by different image acquisition devices, it will be considered that the target area 1 represented by the first identifier c1 and the target area 2 represented by the first identifier c2 are different target areas, resulting in misjudgment, and then the target area 1 represented by the first identifier c1 and the target area 2 represented by the first identifier c2 will not be deduplicated.
[0072] As another optional embodiment of the present application, refer to Figure 2 , is a flow chart of a method for deduplicating an image target area provided in Example 2 of the present application. This embodiment is mainly a refinement of the method for deduplicating an image target area described in Example 1 above, such as Figure 2 As shown, the method may include but is not limited to the following steps:
[0073] Step S21, obtaining at least one image to be processed, inputting the image to be processed into a target detection network model, obtaining a target area obtained by the target detection network model, and generating a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed.
[0074] Step S22: input the target area and the first identifier into a feature extraction network model, obtain the features of the target object obtained by the feature extraction network model, generate a second identifier that uniquely represents the features of the target object, and establish a first corresponding relationship between the first identifier and the second identifier.
[0075] Step S23: based on the first corresponding relationship, filter out at least one target first identifier from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same.
[0076] The detailed process of steps S21-S23 can refer to the relevant introduction of steps S11-S13 in Example 1, which will not be repeated here.
[0077] Step S24: Select one from the target areas represented by the first target identifiers to be retained.
[0078] In this embodiment, selecting one from the target areas represented by the first target identifiers to be retained may include but is not limited to:
[0079] Any one is selected from the target areas represented by the first target identifiers to be retained.
[0080] Of course, selecting one from the target areas represented by the first target identifiers to be retained may also include but is not limited to:
[0081] S241, obtaining time information and / or geographic location information input by the user;
[0082] S242: Select a target area that matches the time information and / or geographic location information from the target areas represented by the first target identifiers and keep it.
[0083] Step S24 is a specific implementation of step S14 in Example 1.
[0084] In this embodiment, when the target areas represented by each of the target first identifiers have the characteristics of the same target object, one target area is selected from the target areas represented by each of the target first identifiers to be retained. This can avoid misjudging the target areas detected at different times and / or different geographical ranges as different target areas, thereby avoiding omissions when deduplicating the target areas.
[0085] As another optional embodiment of the present application, refer to Figure 3 , is a flow chart of a method for deduplicating an image target area provided in Example 3 of the present application. This embodiment is mainly a refinement of the method for deduplicating an image target area described in Example 1 above, such as Figure 3 As shown, the method may include but is not limited to the following steps:
[0086] Step S31, obtaining at least one image to be processed, inputting the image to be processed into a target detection network model, obtaining a target area obtained by the target detection network model, and generating a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed.
[0087] Step S32: input the target area and the first identifier into a feature extraction network model, obtain the features of the target object obtained by the feature extraction network model, generate a second identifier that uniquely represents the features of the target object, and establish a first corresponding relationship between the first identifier and the second identifier.
[0088] The detailed process of steps S31-S32 can refer to the relevant introduction of steps S11-S12 in Example 1, which will not be repeated here.
[0089] Step S33: compare the features included in the feature database with the features of the target object to obtain a comparison result, and establish a second corresponding relationship between the comparison result and the second identifier.
[0090] Comparing the features contained in the feature database with the features of the target object to obtain a comparison result may include but is not limited to:
[0091] Using a distance calculation formula, calculate the distance between the feature of the target object and each feature included in the feature database;
[0092] If there is a distance less than a preset threshold value among the distances, it is determined that there is a feature matching the feature of the target object among the features included in the feature database;
[0093] If there is no distance less than a preset threshold value among the distances, it is determined that there is no feature matching the feature of the target object among the features included in the feature database.
[0094] The distance calculation formula may include but is not limited to: a Euclidean distance calculation formula or a Hamming distance calculation formula.
[0095] In this embodiment, a statistical database is provided corresponding to the feature database, and the statistical database is used to store the target area corresponding to the features contained in the feature database. For example, an image 1 to be processed is obtained, the image 1 to be processed is input into the target detection network model, the target area 1 obtained by the target detection network model is obtained, and a first identifier c1 uniquely representing the target area 1 is generated, the target area 1 and the first identifier c1 are input into the feature extraction network model, the feature 1 of the target object 1 obtained by the feature extraction network model is obtained, and a second identifier d1 uniquely representing the feature 1 of the target object 1 is generated, and if the feature database does not contain the feature 1 of the target object 1, the feature 1 of the target object 1 is stored in the feature database, and the target area 1 is stored in the statistical database.
[0096] Step S34: If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determine the second identifier corresponding to the comparison result as the second identifier to be used.
[0097] Based on the second corresponding relationship, it can be determined that the second identifier corresponding to the comparison result is the second identifier to be used, and the feature of the target object represented by the second identifier to be used exists in the feature database.
[0098] Step S35: Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier.
[0099] Steps S32-S35 are a specific implementation of step S13 in Example 1.
[0100] Step S36: discard the target area represented by the first target identifier.
[0101] Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
[0102] Step S36 is a specific implementation of step S14 in Example 1.
[0103] In this embodiment, if the comparison result is that there are features in the feature database that match the features of the target object, it means that the target area corresponding to the features of the target object has been stored in the statistical database, and based on the second correspondence, the second identifier representing the feature already in the feature database (that is, the second identifier to be used) can be determined. On this basis, based on the first correspondence, the first identifier corresponding to the second identifier representing the feature already in the feature database (that is, the target first identifier) is determined, and the target area represented by the first identifier is discarded and not written into the statistical database, thereby ensuring that no duplicate data appears in the statistical database.
[0104] As another optional embodiment of the present application, refer to Figure 4 , which is a flow chart of a method for deduplicating an image target area provided in Example 4 of the present application. This embodiment is mainly an extended solution of the method for deduplicating an image target area described in Example 3 above. Figure 4 As shown, the method may include but is not limited to the following steps:
[0105] Step S41, obtaining at least one image to be processed, inputting the image to be processed into a target detection network model, obtaining a target area obtained by the target detection network model, and generating a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed.
[0106] Step S42: input the target area and the first identifier into a feature extraction network model, obtain the features of the target object obtained by the feature extraction network model, generate a second identifier that uniquely represents the features of the target object, and establish a first corresponding relationship between the first identifier and the second identifier.
[0107] Step S43: compare the features included in the feature database with the features of the target object to obtain a comparison result, and establish a second corresponding relationship between the comparison result and the second identifier.
[0108] Step S44: If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determine the second identifier corresponding to the comparison result as the second identifier to be used.
[0109] In this embodiment, if the comparison result is that there are features in the feature database that match the features of the target object, the features of the target object can also be fused with the features in the feature database that match the features of the target object to obtain the target features; and the features in the feature database that match the features of the target object can be replaced with the target features.
[0110] The features of the target object are fused with the features in the feature database that match the features of the target object to obtain target features, which may include but are not limited to:
[0111] The features of the target object and the features in the feature database that match the features of the target object are fused using the following mean calculation formula:
[0112] x new =(x old +x) / 2;
[0113] Where x represents the characteristics of the target object, x old represents the features in the feature database that match the features of the target object, x new Represents the target feature.
[0114] Step S45: Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier.
[0115] Step S46: discard the target area represented by the first target identifier.
[0116] Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
[0117] Step S47: If the comparison result is that there is no feature matching the feature of the target object in the features contained in the feature database, based on the second corresponding relationship, determine that the second identifier corresponding to the comparison result is the identifier to be stored, and store the feature of the target object represented by the identifier to be stored in the feature database.
[0118] In this embodiment, the feature database can also be managed. Specifically, the statistical duration can be obtained; when the retention time of the feature in the feature database reaches the statistical duration, the feature in the feature database is deleted. For example, if the statistical duration is 1 day, the feature data within 1 day is required to participate in the deduplication process, and all the features in the feature database will be deleted at 0:00 am every day; if the statistical duration is 1 week, the feature data within 1 week is required to participate in the deduplication process, and all the features in the feature database will be deleted every week.
[0119] Step S48: Based on the first corresponding relationship, the target area represented by the first identifier corresponding to the identifier to be stored is stored in the statistical database.
[0120] In this embodiment, if the comparison result is that there is no feature matching the feature of the target object among the features contained in the feature database, based on the second correspondence, the second identifier corresponding to the comparison result is determined as the identifier to be stored, and the features of the target object represented by the identifier to be stored are stored in the feature database, and based on the first correspondence, the target area represented by the first identifier corresponding to the identifier to be stored is stored in the statistical database, thereby updating the feature database and the statistical database.
[0121] Next, the image target area deduplication device provided by the present application is introduced. The image target area deduplication device introduced below and the image target area deduplication method introduced above can be referenced to each other.
[0122] See also Figure 5 The device for removing duplicate images of target areas includes: a target detection module 100, a feature extraction module 200 and a statistical deduplication module 300.
[0123] The target detection module 100 is used to obtain at least one image to be processed, input the image to be processed into the target detection network model, obtain the target area obtained by the target detection network model, and generate a first identifier that uniquely represents the target area, and the target area includes the target object on the image to be processed.
[0124] In this embodiment, the target detection module 100 may include multiple target detection network models, and use the multiple target detection network models to process multiple images to be processed. The multiple target detection network models can be represented as target detection network model 1, target detection network model 2, ..., target detection network model n.
[0125] A feature extraction module 200 is used to input the target area and the first identifier into a feature extraction network model, obtain the features of the target object obtained by the feature extraction network model, generate a second identifier that uniquely represents the features of the target object, and establish a first corresponding relationship between the first identifier and the second identifier;
[0126] The statistical deduplication module 300 is used for:
[0127] Based on the first corresponding relationship, at least one target first identifier is selected from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same;
[0128] Deduplication processing is performed on the target area represented by each of the target first identifiers.
[0129] In this embodiment, the statistical deduplication module 300 can be specifically used for:
[0130] One is selected from the target areas represented by the first target identifiers to be retained.
[0131] In this embodiment, the statistical deduplication module 300 can be specifically used for:
[0132] Comparing the features included in the feature database with the features of the target object to obtain a comparison result, and establishing a second corresponding relationship between the comparison result and the second identifier;
[0133] If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determining the second identifier corresponding to the comparison result as the second identifier to be used;
[0134] Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier;
[0135] discarding the target area represented by the target first identifier;
[0136] Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
[0137] In this embodiment, the above device may further include: a storage module, which is used to:
[0138] If the comparison result is that there is no feature matching the feature of the target object among the features included in the feature database, based on the second corresponding relationship, determining that the second identifier corresponding to the comparison result is the identifier to be stored, and storing the feature of the target object represented by the identifier to be stored in the feature database;
[0139] Based on the first corresponding relationship, the target area represented by the first identifier corresponding to the identifier to be stored is stored in the statistical database.
[0140] In this embodiment, the above device may further include:
[0141] Update modules for:
[0142] If the comparison result is that there is a feature in the feature database that matches the feature of the target object, the feature of the target object is fused with the feature in the feature database that matches the feature of the target object to obtain the target feature;
[0143] The target feature replaces the feature in the feature database that matches the feature of the target object.
[0144] In this embodiment, the above device may further include:
[0145] Management module for:
[0146] Get the statistical duration;
[0147] When the retention time of the feature in the feature database reaches the statistical time length, the feature in the feature database is deleted.
[0148] Corresponding to the above-mentioned embodiment of a method for deduplication of an image target area provided by the present application, the present application also provides an embodiment of an electronic device applying the method for deduplication of an image target area.
[0149] like Figure 6 The figure is a schematic diagram of the structure of an electronic device embodiment 1 provided by the present application, and the electronic device may include the following structure:
[0150] The memory 10 and the processor 20 .
[0151] A memory 10, used to store at least one set of instruction sets;
[0152] The processor 20 is used to call and execute the instruction set in the memory 10, and execute the image target area deduplication method introduced in any one of the above method embodiments 1-4 by executing the instruction set.
[0153] It should be noted that each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0154] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0155] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0156] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network model device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0157] The above is a detailed introduction to a method and device for deduplication of a target image area provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for deduplication of an image target area, characterized in that: include: Acquire at least one image to be processed, input the image to be processed into a target detection network model, obtain a target area obtained by the target detection network model, and generate a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed; Inputting the target area and the first identifier into a feature extraction network model, obtaining the features of the target object obtained by the feature extraction network model, generating a second identifier that uniquely represents the features of the target object, and establishing a first corresponding relationship between the first identifier and the second identifier; Based on the first corresponding relationship, at least one target first identifier is selected from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same; Deduplication processing is performed on the target area represented by each of the target first identifiers; The step of selecting at least one target first identifier from each of the first identifiers based on the first corresponding relationship includes: Comparing the features included in the feature database with the features of the target object to obtain a comparison result, and establishing a second corresponding relationship between the comparison result and the second identifier; If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determining the second identifier corresponding to the comparison result as the second identifier to be used; Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier; The deduplication processing of the target area represented by each of the first target identifiers includes: discarding the target area represented by the target first identifier; Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
2. The method according to claim 1, characterized in that: The deduplication processing of the target area represented by each of the first target identifiers includes: One is selected from the target areas represented by the first target identifiers to be retained.
3. The method according to claim 1, characterized in that: The method further comprises: If the comparison result is that there is no feature matching the feature of the target object among the features included in the feature database, based on the second corresponding relationship, determining that the second identifier corresponding to the comparison result is the identifier to be stored, and storing the feature of the target object represented by the identifier to be stored in the feature database; Based on the first corresponding relationship, the target area represented by the first identifier corresponding to the identifier to be stored is stored in the statistical database.
4. The method according to claim 3, characterized in that: After comparing the features contained in the feature database with the features of the target object and obtaining the comparison result, the method further includes: If the comparison result is that there is a feature in the feature database that matches the feature of the target object, the feature of the target object is fused with the feature in the feature database that matches the feature of the target object to obtain the target feature; The target feature replaces the feature in the feature database that matches the feature of the target object.
5. The method according to claim 3, characterized in that: The method further comprises: Get the statistical duration; When the retention time of the feature in the feature database reaches the statistical time length, the feature in the feature database is deleted.
6. A device for removing duplication of an image target area, characterized in that: include: A target detection module is used to obtain at least one image to be processed, input the image to be processed into a target detection network model, obtain a target area obtained by the target detection network model, and generate a first identifier that uniquely represents the target area, wherein the target area includes a target object on the image to be processed; A feature extraction module, used for inputting the target area and the first identifier into a feature extraction network model, obtaining the features of the target object obtained by the feature extraction network model, generating a second identifier that uniquely represents the features of the target object, and establishing a first corresponding relationship between the first identifier and the second identifier; Statistical deduplication module, used for: Based on the first corresponding relationship, at least one target first identifier is selected from each of the first identifiers, and the second identifiers corresponding to each of the target first identifiers are the same; Deduplication processing is performed on the target area represented by each of the target first identifiers; The statistical deduplication module is specifically used for: Comparing the features included in the feature database with the features of the target object to obtain a comparison result, and establishing a second corresponding relationship between the comparison result and the second identifier; If the comparison result is that there is a feature in the feature database that matches the feature of the target object, based on the second corresponding relationship, determining the second identifier corresponding to the comparison result as the second identifier to be used; Based on the first corresponding relationship, determine that the first identifier corresponding to the second identifier to be used is the target first identifier; discarding the target area represented by the target first identifier; Among them, the target area corresponding to the features matched with the features of the target object among the features contained in the feature database has been stored in the statistical database.
7. The device according to claim 6, characterized in that The statistical deduplication module is specifically used for: One is selected from the target areas represented by the first target identifiers to be retained.
8. An electronic device, characterized in that: include: Memory and processor; The memory is used to store at least one set of instruction sets; The processor is used to call and execute the instruction set in the memory, and execute the image target area deduplication method as described in any one of claims 1 to 5 by executing the instruction set.