WO2020155488A1 - 图片查重方法、装置、计算机设备和存储介质 - Google Patents

图片查重方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2020155488A1
WO2020155488A1 PCT/CN2019/089110 CN2019089110W WO2020155488A1 WO 2020155488 A1 WO2020155488 A1 WO 2020155488A1 CN 2019089110 W CN2019089110 W CN 2019089110W WO 2020155488 A1 WO2020155488 A1 WO 2020155488A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
same
value
data
designated values
Prior art date
Application number
PCT/CN2019/089110
Other languages
English (en)
French (fr)
Inventor
陈林
丁磊磊
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020155488A1 publication Critical patent/WO2020155488A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification

Definitions

  • This application relates to the field of image processing, in particular to a method, device, computer equipment and storage medium for checking duplicate images.
  • the prior art method for judging image duplication includes: calculating the similarity of a new basemap photo and each existing basemap photo in the face database one by one, and determining the new basemap when the similarity reaches a specified threshold.
  • the basemap photos are duplicated with the basemap photos stored in the face database. This repeated judgment method requires a lot of calculations, which is time-consuming and wastes computing resources.
  • the main purpose of this application is to provide a method, device, computer equipment, and storage medium for checking duplicate images, which aims to solve the problem of time-consuming calculation of duplicate checking and a large amount of computational elements when storing new images in the image database.
  • This application proposes a method for checking duplicate images, including steps:
  • first set of designated values corresponding to the first picture in the picture database to be imported, and a data table that records the second set of designated values corresponding to each second picture in the picture database; wherein the first set of designated values includes The first data volume value and the first MD5 value, and the second set of designated values include the second data volume value and the second MD5 value;
  • first binary data and the second binary data are not the same, import the first picture into the picture database; if the first binary data and the second binary data If they are the same, it is determined that there is a second picture that is the same as the first picture in the picture database, and the import of the first picture into the picture database is stopped.
  • This application also provides a device for checking duplicate images, including:
  • the first acquiring unit is configured to acquire the first set of designated values corresponding to the first picture in the picture database to be imported, and a data table that records the second set of designated values corresponding to each second picture in the picture database; wherein ,
  • the first set of designated values includes the first data volume value and the first MD5 value, and the second set of designated values includes the second data volume value and the second MD5 value;
  • the searching unit is configured to search the data table for a second set of designated values that are the same as the first set of designated values;
  • the second acquiring unit is configured to, if a second set of specified values that are the same as the first set of specified values are found, then obtain the first binary data of the first photo, and the same as the first set of specified values The second binary data of the second photo of the second set of designated values;
  • the comparing unit is used to compare whether the first binary data and the second binary data are the same;
  • the result processing unit is configured to import the first picture into the picture database if the first binary data and the second binary data are different; if the first binary data and the second binary data are not the same If the second binary data is the same, it is determined that there is a second picture that is the same as the first picture in the picture database, and the import of the first picture into the picture database is stopped.
  • the present application also provides a computer device, including a memory and a processor, the memory stores computer readable instructions, and the processor implements the steps of any one of the above methods when the computer readable instructions are executed.
  • the present application also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, and when the computer readable instructions are executed by a processor, the steps of any one of the above methods are implemented.
  • the method, device, computer equipment and storage medium for checking duplicate pictures of the present application are based on the first data value and the first MD5 value of the imported picture and the preset corresponding second pictures in the data table of each second picture in the picture database.
  • the data amount value is compared with the second MD5 value to reduce the number of possible duplicate pictures, and then the binary data is compared in the reduced picture to improve the speed of finding duplicate pictures and reduce the amount of calculation.
  • FIG. 1 is a schematic flowchart of a method for checking duplicate images of an embodiment of this application
  • FIG. 2 is a schematic block diagram of the structure of an image duplicate checking device according to an embodiment of the application
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a method for checking duplicate images, including the following steps:
  • the picture database is a database storing a large number of second pictures, such as a face picture database storing face pictures, a pig face picture database storing pig face pictures, and so on.
  • the above-mentioned specified values exist in groups, that is, each picture corresponds to a set of specified values.
  • the specified values include the data amount value and the MD5 value.
  • the above data amount value is the value that expresses the size of the picture data amount, and its unit is KB, M, G, etc.
  • the above MD5 value is based on MD5 (Message-Digest Algorithm 5 Information-Summary Algorithm 5) The value calculated for the picture.
  • the above-mentioned data table records the corresponding second data value and second MD5 value of each second picture in the picture database, which has a one-to-one mapping relationship with the second picture in the picture database.
  • step S2 it is to compare the first set of designated values with each second set of designated values in the data table one by one, and then find the second set of designated values that are the same as the first set of designated values .
  • steps S3 to S5 above if there is no second set of designated values that are the same as the first set of designated values in the picture database, it means that there is no second picture that is the same as the first picture in the picture database. At this time, you can Import the first picture into the picture database; if there is a second set of designated values that are the same as the first set of designated values, it means that there may be a second picture that is the same as the first picture in the picture database.
  • the second binary data of the second picture that is the same as the first picture is compared with the first binary data corresponding to the first picture. Because the data amount value and MD5 value have been compared and filtered, there is no need to compare all the data with the picture database.
  • the second binary data of the second picture is subjected to binary comparison, which requires less calculation.
  • the aforementioned binary data is the binary data in the form of a combination of 0 and 1 stored in the computer.
  • the step S2 of searching the data table for the second set of designated values that are the same as the first set of designated values includes:
  • the second data amount value that is the same as the first data amount value is not found, it is determined that there is no second set of designated values that are the same as the first set of designated values in the data table; To the second data amount value that is the same as the first data amount value, the second MD5 value corresponding to the same second data amount value of the first data amount value is searched for the first MD5 value. MD5 value with the same value;
  • the MD5 value that is the same as the first MD5 value is found in the second MD5 value corresponding to the same second data amount value of the first data amount value, then it is determined that there is an MD5 value in the data table.
  • the second set of specified values that are the same as the first set of specified values; if the second MD5 value corresponding to the same second data amount value of the first data amount value is not found to be the same as the first MD5 value If the MD5 value has the same value, it is determined that there is no second set of designated values that are the same as the first set of designated values in the data table.
  • first look up in the data table whether there is a second data value that is the same as the first data value. If it does not exist, it can be directly determined that there is no second data value in the data table. Specify the second set of specified values with the same value, which can reduce the number of comparisons and save computing resources; if there is a second set of specified values that are the same as the first set of specified values, the second MD5 values in the second set of specified values will be used separately Compared with the first MD5 value, because the comparison and filtering of the data amount value has been performed, the process of comparing the second MD5 value with the first MD5 value further reduces the number of comparisons, improves the search speed and reduces computing resources.
  • the MD5 value that is the same as the first MD5 value is found, it means that there is an MD5 value in the above data table.
  • the first data amount is the same as the second data amount. In other data tables, you can also find the second MD5 value that is the same as the first MD5 value in the data table, and then find the second data that is the same as the first data in the data filtered by the MD5 value Value.
  • the step of obtaining the first set of designated values corresponding to the first picture in the picture database to be imported, and recording the data table of the second set of designated values corresponding to each second picture in the picture database Before S1, including:
  • S1a Receive a drag instruction sent by a user, where the drag instruction is used to drag the first picture to the entry area of the picture database;
  • the monitoring method is to determine whether any picture is dragged to the entry area of the picture database.
  • the monitoring method is simple and the user experience is good.
  • the import action can also be performed by selecting the first picture, and then clicking the preset import button. When the import button is clicked, it triggers a search in the picture database for whether there is a picture with the first picture. The same command for the second picture. After triggering the command to find whether there is a second picture that is the same as the first picture in the picture database, the process of steps S1-S5 is entered.
  • the method includes:
  • the first picture imported in the emergency is marked.
  • the marked picture is found in the database and used as the first picture in step S1.
  • the process of the above steps S1-S5 is the process of removing repeated pictures.
  • the mark of the picture containing the mark is removed to prevent the next time the same emergency situation is encountered, and the process of removing duplicate pictures is performed again on the picture that has been processed but has the mark.
  • the step of obtaining the first set of designated values corresponding to the first picture in the picture database to be imported, and recording the data table of the second set of designated values corresponding to each second picture in the picture database Before S1, including:
  • the above-mentioned picture classification model is generally a neural network model completed through sample picture training, that is, a preset neural network is trained through picture samples of different categories to obtain input pictures and output picture types of nerves Network model.
  • the categories of pictures generally include face picture categories, architectural picture categories, multiple specified categories of livestock face pictures, other categories, etc.
  • the specific training process can be a training method commonly used in the prior art, which will not be repeated here.
  • the above-mentioned picture database includes multiple sub-databases distinguished according to picture categories, and each sub-database is provided with a corresponding sub-data table. After the first picture is classified, the corresponding sub-data can be retrieved according to its category.
  • the step S2 of searching the data table for the second set of designated values that is the same as the first set of designated values includes:
  • step S21 it is a multi-threaded process of processing different sub-data tables at the same time to increase the speed of searching for the second set of designated values that are the same as the first set of designated values.
  • the step of obtaining the first set of designated values corresponding to the first picture in the picture database to be imported, and recording the data table of the second set of designated values corresponding to each second picture in the picture database Before S1, including:
  • the above-mentioned picture database is a pig face picture database.
  • the photographs of the faces are directly combined to form a picture database, because each pig only needs to take one picture Pig face images, so there will be no recurring pig face images in the picture database, and the formed picture database does not require the process of removing duplicate pictures.
  • the above-mentioned image of the face of a pig is taken to determine the identity of the pig.
  • the face image of the sick and dead pig is compared with the face image in the picture database. If it is confirmed that it is the same pig, then Carry out the corresponding claims and so on.
  • the above method for comparing the face pictures of sick and dead pigs with the pig face images in the picture database can be recognized by a neural network model in the prior art through a preset picture recognition.
  • the above-mentioned insurance serial number refers to the unique serial number, which is used when insuring live pigs, such as forming an insurance number, or used to correspond to the order number when insuring the pigs, so that the corresponding insurance policy can be found based on the insurance serial number.
  • the image duplication check method of the present application is based on the first data volume value and the first MD5 value of the imported image and each second data volume value and the second MD5 value in the data table corresponding to each second picture in the picture database. Make comparisons to reduce the number of possible duplicate pictures, and then compare the binary data in the reduced pictures to increase the speed of finding duplicate pictures and reduce the amount of calculation.
  • this application also provides a method for checking duplicate images, including the following steps:
  • the first acquiring unit 10 is configured to acquire a first set of designated values corresponding to a first picture in a picture database to be imported, and a data table that records a second set of designated values corresponding to each second picture in the picture database; Wherein, the first set of designated values includes a first data amount value and a first MD5 value, and the second set of designated values includes a second data amount value and a second MD5 value;
  • the searching unit 20 is configured to search the data table for a second set of designated values that are the same as the first set of designated values;
  • the second acquiring unit 30 is configured to, if a second set of designated values that are the same as the first set of designated values are found, acquire the first binary data of the first photo, and the same as the first set of designated values The second set of second binary data of the second photo of the specified value;
  • the comparing unit 40 is used to compare whether the first binary data and the second binary data are the same;
  • the result processing unit 50 is configured to import the first picture into the picture database if the first binary data and the second binary data are not the same; if the first binary data If it is the same as the second binary data, it is determined that there is a second picture that is the same as the first picture in the picture database, and the import of the first picture into the picture database is stopped.
  • the above-mentioned picture database is a database storing a large number of second pictures, such as a face picture database storing human face pictures, a pig face picture database storing pig face pictures, and so on.
  • the above-mentioned specified values exist in groups, that is, each picture corresponds to a set of specified values.
  • the specified values include the data amount value and the MD5 value.
  • the above data amount value is the value that expresses the size of the picture data amount, and its unit is KB, M, G, etc.
  • the above MD5 value is based on MD5 (Message-Digest Algorithm 5 Information-Summary Algorithm 5) The value calculated for the picture.
  • the above-mentioned data table records the corresponding second data value and second MD5 value of each second picture in the picture database, which has a one-to-one mapping relationship with the second picture in the picture database.
  • the searching unit 20 is to compare the first set of designated values with the second set of designated values in the data table one by one, and then find the second set of designated values that are the same as the first set of designated values.
  • the second acquisition unit 30, the comparison unit 40 and the result processing unit 50 mentioned above if there is no second set of designated values that are the same as the first set of designated values in the picture database, it means that there is no picture database that is the same as the first picture.
  • the second picture at this time, the first picture can be imported into the picture database; if there is a second set of designated values that are the same as the first set of designated values, it means that the picture database may have the same first picture as the first picture.
  • Second picture compare the second binary data of the second picture that may be the same as the first picture with the first binary data corresponding to the first picture, because the data amount value and the MD5 value comparison filter have been filtered Therefore, there is no need to perform binary comparison with the second binary data of all the second pictures in the picture database, and the amount of calculation is less.
  • the aforementioned binary data is the binary data in the form of a combination of 0 and 1 stored in the computer.
  • the above-mentioned searching unit 20 includes:
  • a first search module configured to search for a second data amount value that is the same as the first data amount value in the data table
  • the second search module is configured to, if the second data amount value that is the same as the first data amount value is not found, determine that there is no second group that is the same as the first set of designated values in the data table Specify a numerical value; if the second data amount value that is the same as the first data amount value is found, search for the second MD5 value corresponding to the same second data amount value of the first data amount value MD5 values with the same first MD5 value;
  • a determining module configured to determine the data table if the MD5 value that is the same as the first MD5 value is found in the second MD5 value corresponding to the same second data amount value of the first data amount value There is a second set of designated values that are the same as the first set of designated values; if the second MD5 value corresponding to the same second data amount value of the first data amount value is not found If the MD5 value is the same as the first MD5 value, it is determined that there is no second set of designated values that are the same as the first set of designated values in the data table.
  • the second set of specified values can reduce the number of comparisons and save computing resources; if there is a second set of specified values that are the same as the first set of specified values, the second MD5 value of these second set of specified values will be compared with the first The MD5 value is compared, because the comparison and filtering of the data amount value has been performed, and the process of comparing the second MD5 value with the first MD5 value further reduces the number of comparisons, improves the search speed and reduces computing resources.
  • the MD5 value that is the same as the first MD5 value is found, it means that there is an MD5 value in the above data table.
  • the first data amount is the same as the second data amount. In other data tables, you can also find the second MD5 value that is the same as the first MD5 value in the data table, and then find the second data that is the same as the first data in the data filtered by the MD5 value Value.
  • the above device for checking duplicate pictures further includes:
  • a receiving unit configured to receive a drag instruction sent by a user, where the drag instruction is used to drag the first picture to the entry area of the picture database;
  • the trigger unit is configured to respond to the drag instruction to trigger a command to find whether there is a second picture identical to the first picture in the picture database.
  • the monitoring method is to determine whether a picture is dragged to the entry area of the picture database.
  • the monitoring method is simple and the user experience is good.
  • the import action can also be performed by selecting the first picture, and then clicking the preset import button. When the import button is clicked, it triggers a search in the picture database for whether there is a picture with the first picture. The same command for the second picture. After triggering a command to find whether there is a second picture that is the same as the first picture in the picture database, start the first acquisition unit 10, the search unit 20, the second acquisition unit 30, the comparison unit 40, and the result processing unit 50 modules for work.
  • the above device for checking duplicate pictures further includes:
  • the execution unit is configured to, if a command for the confirmation button to be selected is received within a specified time, execute a command to find in the picture database whether there is a second picture that is the same as the first picture; If the command to select the cancel button is received within the specified time, stop executing the command to find in the image database whether there is a second picture that is the same as the first picture; if it is not received within the specified time.
  • the first picture imported in the emergency is marked.
  • the marked picture is found in the database and used as the first picture in step S1.
  • the process of the above steps S1-S5 is the process of removing repeated pictures.
  • the mark of the picture containing the mark is removed to prevent the next time the same emergency situation is encountered, and the process of removing duplicate pictures is performed again on the picture that has been processed but has the mark.
  • the above device for checking duplicate pictures further includes:
  • a classification unit configured to import the first picture into a preset picture classification model for classification, and determine the first category of the first picture
  • the calling search unit is configured to call the first data table corresponding to the first category in the data table according to the first category, so as to find the same value as the first set of specified values in the first data table
  • the second group specifies numerical values.
  • the above-mentioned image classification model is generally a neural network model completed through sample image training, that is, a preset neural network is trained through image samples of different categories to obtain input images and output image types. model.
  • the categories of pictures generally include face picture categories, architectural picture categories, multiple specified categories of livestock face pictures, other categories, etc.
  • the specific training process can be a training method commonly used in the prior art, which will not be repeated here.
  • the above-mentioned picture database includes multiple sub-databases distinguished according to picture categories, and each sub-database is provided with a corresponding sub-data table. After the first picture is classified, the corresponding sub-data can be retrieved according to its category.
  • the searching unit 20 includes:
  • the classification searching module is configured to classify multiple first pictures, and simultaneously search for a second set of specified values that are the same as the first set of specified values in data tables of different categories.
  • it is a multi-threaded process of processing different sub-data tables at the same time, which improves the speed of searching for the second set of designated values that are the same as the first set of designated values.
  • the above device for checking duplicate pictures further includes:
  • the photographing unit is used to sequentially photograph the face images of multiple pigs to be insured for livestock insurance with a high-definition camera; among them, for each face image of a pig, an insurance serial number is established correspondingly, and the corresponding data volume value and MD5 value are calculated , Recorded in the data table;
  • the storage unit is used to store the photographed face images of each pig and the data table in a designated database to form the picture database.
  • the above-mentioned picture database is a pig face picture database.
  • the photographs of the faces are directly combined to form a picture database, because each pig only needs to take one picture Pig face images, so there will be no recurring pig face images in the picture database, and the formed picture database does not require the process of removing duplicate pictures.
  • the above-mentioned image of the face of a pig is taken to determine the identity of the pig.
  • the face image of the sick and dead pig is compared with the face image in the picture database. If it is confirmed that the pig is the same Carry out the corresponding claims and so on.
  • the above method for comparing the face pictures of sick and dead pigs with the pig face images in the picture database can be recognized by a neural network model in the prior art through a preset picture recognition.
  • the above-mentioned insurance serial number refers to the unique serial number, which is used when insuring live pigs, such as forming an insurance number, or used to correspond to the order number when insuring the pigs, so that the corresponding insurance policy can be found based on the insurance serial number.
  • the image duplication check device of the present application is based on the first data volume value and the first MD5 value of the imported image and each second data volume value and the second MD5 value in the data table corresponding to each second picture in the picture database. Make comparisons to reduce the number of possible duplicate pictures, and then compare the binary data in the reduced pictures to increase the speed of finding duplicate pictures and reduce the amount of calculation.
  • an embodiment of the present application also provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in FIG. 3.
  • the computer equipment includes a processor, a memory, a network interface and a database connected by a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the memory provides an environment for the operation of the operating system and computer readable instructions in the non-volatile storage medium.
  • the database of the computer equipment is used to store data such as pictures.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • An embodiment of the present application also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, and the computer readable instructions are executed by a processor to implement the image duplication check method in any of the foregoing embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请揭示了一种基于图像处理的图片查重方法、装置、计算机设备和存储介质,其中方法根据导入图片的第一数据量值和第一MD5值与预设的对应图片数据库中各第二图片的数据表中的各第二数据量值和第二MD5值进行比较,以缩小可能重复的图片数量,在缩小后的图片中通过二进制数据进行比较,提高查找重复图片的速度,减小计算量。

Description

图片查重方法、装置、计算机设备和存储介质
本申请要求于2019年1月31日提交中国专利局、申请号为201910101273.8,申请名称为“图片查重方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及到图像处理领域,特别是涉及到一种图片查重方法、装置、计算机设备和存储介质。
背景技术
人脸数据库中存储有大量的底图照片,而且还会持续不断地向人脸数据库中导入新的底图照片。在导入新的底图照片的时候,需要与人脸数据库中已有的底图照片进行查重处理,以防止人脸数据库中存在相同的底图照片。现有技术的图片重复判断方法包括:将新的底图照片与人脸数据库中的各已有的底图照片进行逐一的像似度计算,当相似度达到指定阈值的时候,判定该新的底图照片与人脸数据库中存储有的底图照片存在重复,这种重复判断方法需要进行大量的计算,计算比较耗时,同时浪费计算资源。
技术问题
本申请的主要目的为提供一种图片查重方法、装置、计算机设备和存储介质,旨在解决向图片数据库中存储新的图片时,查重图片计算耗时和消耗大量计算元的问题。
技术解决方案
本申请提出一种图片查重方法,包括步骤:
获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
比较所述第一二进制数据和第二二进制数据是否相同;
如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
本申请还提供一种图片查重装置,包括:
第一获取单元,用于获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
查找单元,用于在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
第二获取单元,用于如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
比较单元,用于比较所述第一二进制数据和第二二进制数据是否相同;
结果处理单元,用于如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述任一项所述方法的步骤。
本申请还提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述任一项所述的方法的步骤。
有益效果
本申请的图片查重方法、装置、计算机设备和存储介质,根据导入图片的第一数据量值和第一MD5值与预设的对应图片数据库中各第二图片的数据表中的各第二数据量值和第二MD5值进行比较,以缩小可能重复的图片数量,然后在缩小后的图片中通过二进制数据进行比较,提高查找重复图片的速度,减小计算量。
附图说明
图1 为本申请一实施例的图片查重方法的流程示意图;
图2 为本申请一实施例的图片查重装置的结构示意框图;
图3 为本申请一实施例的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的最佳实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请实施例提供一种图片查重方法,包括以下步骤:
 S1、获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
S2、在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
S3、如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
S4、比较所述第一二进制数据和第二二进制数据是否相同;
S5、如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
如上述步骤S1所述,上述图片数据库即为存储有大量第二图片的数据库,比如存储人脸图片的人脸图片数据库、存储猪脸图片的猪脸图片数据库等。上述的指定数值是分组存在的,即每一张图片对应一组指定数值,在本申请中,指定数值包括数据量值和MD5值。上述数据量值即为表述图片数据量大小的值,其单位为KB、M、G等,上述MD5值即为根据MD5(Message-Digest Algorithm 5  信息-摘要算法5)针对图片计算出的值。每一张图片的格式固定后,其对应的数据量值和MD5值也是固定不变的。上述数据表中记录有图片数据库中每一幅第二图片的对应的第二数据量值和第二MD5值,其与图片数据库中的第二图片呈一对一的映射关系。
如上述步骤S2所述,即为将所述第一组指定数值逐一的与数据表中的各第二组指定数值进行比较,进而查找与所述第一组指定数值相同的第二组指定数值。
如上述步骤S3至S5所述,如果图片数据库中不存在与第一组指定数值相同的第二组指定数值,则说明图片数据库中不存在与第一图片相同的第二图片,此时,可以将第一图片导入到图片数据库中;如果存在与所述第一组指定数值相同的第二组指定数值,则说明图片数据库中可能存在与第一图片相同的第二图片,此时将可能与第一图片相同的第二图片的第二二进制数据与第一图片对应的第一二进制数据进行比较,因为已经经过了数据量值和MD5值比较过滤,所以无需与图片数据库全部的第二图片的第二二进制数据进行二进制比较,其计算量更少。上述二进制数据即为图片存储在计算机中的以0和1组合形式存在的二进制数据。
在一个实施例中,上述在所述数据表中查找与所述第一组指定数值相同的第二组指定数值的步骤S2,包括:
S21、在所述数据表中查找与所述第一数据量值的相同的第二数据量值;
S22、若未查找到与所述第一数据量值相同的第二数据量值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值;若查找到与所述第一数据量值的相同的第二数据量值,则在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值;
S23、如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找到与所述第一MD5值相同的MD5值,则判定所述数据表中存在与所述第一组指定数值的相同的第二组指定数值;如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中未查找到与所述第一MD5值相同的MD5值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值。
如上述步骤S21至S23所述,先在数据表中查找是否存在与所述第一数据量值的相同的第二数据量值,如果不存在则可以直接判定数据表中不存在与第一组指定数值相同的第二组指定数值,可以减少比较次数,节约计算资源;如果存在与第一组指定数值相同的第二组指定数值,则将这些第二组指定数值中的第二MD5值分别与第一MD5值进行比较,因为已经进行过数据量数值的比较过滤,所说进行第二MD5值与第一MD5值进行比较的过程中进一步地减少比较次数,提高查找速度和减少计算资源。如果查找到与所述与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值,则说明上述数据表中存在与第一数据量值的相同的第二数据量值。在其它数据表中,也可以先在数据表中查找与第一MD5值相同的第二MD5值,然后再在经过MD5值过滤后的数据中查找与第一数据量值相同的第第二数据量值。
在一个实施例中,上述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤S1之前,包括:
S1a、接收用户发送的拖动指令,所述拖动指令用于将第一图片拖动至图片数据库的入口区域;
S1b、响应于所述拖动指令,触发在所述图片数据库中查找是否存在与第一图片相同的第二图片的命令。
如上述步骤S1a和S1b所述,实时监控是否有第一图片将要导入图片数据库中,而监控的方式是判断是否有图片被拖动至图片数据库的入口区域,监控方法简单,用户体验好。在其它实施例中,还可以通过选择第一图片,然后点击预设的导入按钮进行导入动作,当获取到导入按钮被点击时,触发在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令。触发在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令之后,即进入上述步骤S1-S5的过程。
在一个实施例中,上述响应于所述拖动指令,触发在所述图片数据库中查找是否存在于第一图片相同的第二图片的命令的步骤S1b之后,包括:
S1c、生成确认按钮和取消按钮;
S1d、若在指定时间内接收到所述确认按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内接收到所述取消按钮被选择的命令,则停止执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内即未接收到确认按钮被选择的命令,也未接收到取消按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令。
如上述步骤S1c和S1d所述,即为生成一个供用户选择的是否需要去除重复照片的选项。在实际应用中,无论计算速度有多快,只要有去除重复照片的步骤,即会消耗系统的计算资源,以及等待计算完成才会将第一图片导入到图片数据库中。在一些紧急情况下,用户需要将第一图片快速导入图片数据库而进行使用,则不考虑去除重复图片的问题,而会直接导入第一图片到图片数据库中,此时选择上述的取消按钮,则会跳过上述步骤S1-S5的过程,节省时间等。当用户度过紧急情况后,用户可以启动图片数据库内部图片去除重复图片的流程。在一个具体实施例中,对在紧急情况下导入的第一图片进行标记,当紧急情况处理完成后,在数据库查找出带有标记的图片,将其作为步骤S1中的第一图片,然后进行上述步骤S1-S5的过程进行去处重复图片的过程。当去除重复图片的过程结束之后,将含有标记的图片的标记去除,以防止下一次遇到同样的紧急情况后,再一次对已经处理过的、但是具有标记的图片进行去除重复图片的处理。
在一个实施例中,上述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤S1之前,包括:
S1A、将所述第一图片导入预设的图片归类模型中进行归类,确定所述第一图片的第一类别;
S1B、根据所述第一类别,调用所述数据表中对应所述第一类别的第一数据表,以便于在第一数据表中查找与所述第一组指定数值相同的第二组指定数值。
如上述步骤S1A和S1B,上述图片归类模型一般为通过样本图片训练完成的神经网络模型,即通过不同的类别的图片样本对预设的神经网络进行训练,得到输入图片,输出图片类型的神经网络模型。图片的类别一般包括人脸图片类别、建筑图片类别、多种指定的牲畜脸部图片的类别、其它类别等等,具体训练过程可以选择现有技术中常用的训练方法,在此不在赘述。在上述图片数据库中包括多个根据图片类别区分的子库,每一个子库对应的设置有一个对应的子数据表,当第一图片被分类后,既可以根据其类别调取对应的子数据表(即上述的第一数据表),然后在后期的去除重复图片的过程中,只需要与对应的子数据表中的第二组指定数值进行比较即可,大大地减少比较的数据量,提高去除重复图片的效率。
进一步地,当所述第一图片为多张时,上述在所述数据表中查找与所述第一组指定数值相同的第二组指定数值的步骤S2包括:
S21、将多张所述第一图片分类后,同时在不同的类别的数据表中对查找与所述第一组指定数值相同的第二组指定数值。
如上述步骤S21所述,即为多线程地同时处理不同子数据表的查重过程,提高查找与所述第一组指定数值相同的第二组指定数值的速度。
在一个实施例中,上述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤S1之前,包括:
S101、利用高清摄像头依次拍摄多头待投保牲畜险的生猪脸部图像;其中,每拍摄一张生猪脸部图像,对应的建立一个投保序号,以及计算出对应的数据量值和MD5值,记录到所述数据表中;
S102、将拍摄的各生猪脸部图像,以及所述数据表存储到指定的数据库中,形成所述图片数据库。
本实施例中,上述的图片数据库是猪脸图片数据库,在给待投保的生猪脸部进行拍照后,直接将拍摄的脸部照片和在一起形成图片数据库,因为每头生猪只需要拍摄一张猪脸图像,所以不会存在重复出现的生猪脸部图像在图片数据库中,形成的图片数据库无需进行去除重复图片的过程。上述拍摄生猪脸部图像是为了确定生猪的身份,当投保生猪发生病死等情况后,通过拍摄病死猪的脸部图片与图片数据库中的猪脸图像进行比对,如果确认是同一头猪,则进行相应的理赔等。上述病死猪的脸部图片与图片数据库中的猪脸图像进行比对的方法可以通过现有技术中的通过预设的图片识别的神经网络模型进行识别。上述投保序号是指唯一存在的序号,在生猪投保时使用,如形成投保编号,或者用于对应生猪投保时的单号,便于根据投保序号查找到对应的保单等。
本申请的图片查重方法,根据导入图片的第一数据量值和第一MD5值与预设的对应图片数据库中各第二图片的数据表中的各第二数据量值和第二MD5值进行比较,以缩小可能重复的图片数量,然后在缩小后的图片中通过二进制数据进行比较,提高查找重复图片的速度,减小计算量。
参照图2,本申请还提供一种图片查重方法,包括以下步骤:
 第一获取单元10,用于获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
查找单元20,用于在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
第二获取单元30,用于如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
比较单元40,用于比较所述第一二进制数据和第二二进制数据是否相同;
结果处理单元50,用于如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
如上述第一获取单元10,上述图片数据库即为存储有大量第二图片的数据库,比如存储人脸图片的人脸图片数据库、存储猪脸图片的猪脸图片数据库等。上述的指定数值是分组存在的,即每一张图片对应一组指定数值,在本申请中,指定数值包括数据量值和MD5值。上述数据量值即为表述图片数据量大小的值,其单位为KB、M、G等,上述MD5值即为根据MD5(Message-Digest Algorithm 5  信息-摘要算法5)针对图片计算出的值。每一张图片的格式固定后,其对应的数据量值和MD5值也是固定不变的。上述数据表中记录有图片数据库中每一幅第二图片的对应的第二数据量值和第二MD5值,其与图片数据库中的第二图片呈一对一的映射关系。
如上述查找单元20,即为将所述第一组指定数值逐一的与数据表中的各第二组指定数值进行比较,进而查找与所述第一组指定数值相同的第二组指定数值。
如上述第二获取单元30、比较单元40和结果处理单元50,如果图片数据库中不存在与第一组指定数值相同的第二组指定数值,则说明图片数据库中不存在与第一图片相同的第二图片,此时,可以将第一图片导入到图片数据库中;如果存在与所述第一组指定数值相同的第二组指定数值,则说明图片数据库中可能存在与第一图片相同的第二图片,此时将可能与第一图片相同的第二图片的第二二进制数据与第一图片对应的第一二进制数据进行比较,因为已经经过了数据量值和MD5值比较过滤,所以无需与图片数据库全部的第二图片的第二二进制数据进行二进制比较,其计算量更少。上述二进制数据即为图片存储在计算机中的以0和1组合形式存在的二进制数据。
在一个实施例中,上述查找单元20,包括:
第一查找模块,用于在所述数据表中查找与所述第一数据量值的相同的第二数据量值;
第二查找模块,用于若未查找到与所述第一数据量值相同的第二数据量值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值;若查找到与所述第一数据量值的相同的第二数据量值,则在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值;
判定模块,用于如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找到与所述第一MD5值相同的MD5值,则判定所述数据表中存在与所述第一组指定数值的相同的第二组指定数值;如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中未查找到与所述第一MD5值相同的MD5值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值。
在本实施例中,先在数据表中查找是否存在与所述第一数据量值的相同的第二数据量值,如果不存在则可以直接判定数据表中不存在与第一组指定数值相同的第二组指定数值,可以减少比较次数,节约计算资源;如果存在与第一组指定数值相同的第二组指定数值,则将这些第二组指定数值中的第二MD5值分别与第一MD5值进行比较,因为已经进行过数据量数值的比较过滤,所说进行第二MD5值与第一MD5值进行比较的过程中进一步地减少比较次数,提高查找速度和减少计算资源。如果查找到与所述与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值,则说明上述数据表中存在与第一数据量值的相同的第二数据量值。在其它数据表中,也可以先在数据表中查找与第一MD5值相同的第二MD5值,然后再在经过MD5值过滤后的数据中查找与第一数据量值相同的第第二数据量值。
在一个实施例中,上述图片查重装置,还包括:
接收单元,用于接收用户发送的拖动指令,所述拖动指令用于将第一图片拖动至图片数据库的入口区域;
触发单元,用于响应于所述拖动指令,触发在所述图片数据库中查找是否存在与第一图片相同的第二图片的命令。
在本实施例中,实时监控是否有第一图片将要导入图片数据库中,而监控的方式是判断是否有图片被拖动至图片数据库的入口区域,监控方法简单,用户体验好。在其它实施例中,还可以通过选择第一图片,然后点击预设的导入按钮进行导入动作,当获取到导入按钮被点击时,触发在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令。触发在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令之后,启动上述第一获取单元10、查找单元20、第二获取单元30、比较单元40和结果处理单元50等模块进行工作。
在一个实施例中,上述图片查重装置,还包括:
生成单元,用于生成确认按钮和取消按钮;
执行单元,用于若在指定时间内接收到所述确认按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内接收到所述取消按钮被选择的命令,则停止执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内即未接收到确认按钮被选择的命令,也未接收到取消按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令。
在本实施例中,即为生成一个供用户选择的是否需要去除重复照片的选项。在实际应用中,无论计算速度有多快,只要有去除重复照片的步骤,即会消耗系统的计算资源,以及等待计算完成才会将第一图片导入到图片数据库中。在一些紧急情况下,用户需要将第一图片快速导入图片数据库而进行使用,则不考虑去除重复图片的问题,而会直接导入第一图片到图片数据库中,此时选择上述的取消按钮,则会跳过上述步骤S1-S5的过程,节省时间等。当用户度过紧急情况后,用户可以启动图片数据库内部图片去除重复图片的流程。在一个具体实施例中,对在紧急情况下导入的第一图片进行标记,当紧急情况处理完成后,在数据库查找出带有标记的图片,将其作为步骤S1中的第一图片,然后进行上述步骤S1-S5的过程进行去处重复图片的过程。当去除重复图片的过程结束之后,将含有标记的图片的标记去除,以防止下一次遇到同样的紧急情况后,再一次对已经处理过的、但是具有标记的图片进行去除重复图片的处理。
在一个实施例中,上述图片查重装置,还包括:
分类单元,用于将所述第一图片导入预设的图片归类模型中进行归类,确定所述第一图片的第一类别;
调用查找单元,用于根据所述第一类别,调用所述数据表中对应所述第一类别的第一数据表,以便于在第一数据表中查找与所述第一组指定数值相同的第二组指定数值。
在本实施例中,上述图片归类模型一般为通过样本图片训练完成的神经网络模型,即通过不同的类别的图片样本对预设的神经网络进行训练,得到输入图片,输出图片类型的神经网络模型。图片的类别一般包括人脸图片类别、建筑图片类别、多种指定的牲畜脸部图片的类别、其它类别等等,具体训练过程可以选择现有技术中常用的训练方法,在此不在赘述。在上述图片数据库中包括多个根据图片类别区分的子库,每一个子库对应的设置有一个对应的子数据表,当第一图片被分类后,既可以根据其类别调取对应的子数据表(即上述的第一数据表),然后在后期的去除重复图片的过程中,只需要与对应的子数据表中的第二组指定数值进行比较即可,大大地减少比较的数据量,提高去除重复图片的效率。
进一步地,当所述第一图片为多张时,上述查找单元20,包括:
分类查找模块,用于将多张所述第一图片分类后,同时在不同的类别的数据表中对查找与所述第一组指定数值相同的第二组指定数值。
在本实施例中,即为多线程地同时处理不同子数据表的查重过程,提高查找与所述第一组指定数值相同的第二组指定数值的速度。
在一个实施例中,上述图片查重装置,还包括:
拍摄单元,用于利用高清摄像头依次拍摄多头待投保牲畜险的生猪脸部图像;其中,每拍摄一张生猪脸部图像,对应的建立一个投保序号,以及计算出对应的数据量值和MD5值,记录到所述数据表中;
存储单元,用于将拍摄的各生猪脸部图像,以及所述数据表存储到指定的数据库中,形成所述图片数据库。
本实施例中,上述的图片数据库是猪脸图片数据库,在给待投保的生猪脸部进行拍照后,直接将拍摄的脸部照片和在一起形成图片数据库,因为每头生猪只需要拍摄一张猪脸图像,所以不会存在重复出现的生猪脸部图像在图片数据库中,形成的图片数据库无需进行去除重复图片的过程。上述拍摄生猪脸部图像是为了确定生猪的身份,当投保生猪发生病死等情况后,通过拍摄病死猪的脸部图片与图片数据库中的猪脸图像进行比对,如果确认是同一头猪,则进行相应的理赔等。上述病死猪的脸部图片与图片数据库中的猪脸图像进行比对的方法可以通过现有技术中的通过预设的图片识别的神经网络模型进行识别。上述投保序号是指唯一存在的序号,在生猪投保时使用,如形成投保编号,或者用于对应生猪投保时的单号,便于根据投保序号查找到对应的保单等。
本申请的图片查重装置,根据导入图片的第一数据量值和第一MD5值与预设的对应图片数据库中各第二图片的数据表中的各第二数据量值和第二MD5值进行比较,以缩小可能重复的图片数量,然后在缩小后的图片中通过二进制数据进行比较,提高查找重复图片的速度,减小计算量。
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储图片等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现上述任一实施例中的图片查重方法。
本申请实施例还提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,计算机可读指令被处理器执行时实现上述任一实施例中的图片查重方法。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种图片查重方法,其特征在于,包括步骤:
    获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
    在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
    如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
    比较所述第一二进制数据和第二二进制数据是否相同;
    如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
  2. 根据权利要求1所述的图片查重方法,其特征在于,所述在所述数据表中查找与所述第一组指定数值相同的第二组指定数值的步骤,包括:
    在所述数据表中查找与所述第一数据量值的相同的第二数据量值;
    若未查找到与所述第一数据量值相同的第二数据量值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值;若查找到与所述第一数据量值的相同的第二数据量值,则在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值;
    如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找到与所述第一MD5值相同的MD5值,则判定所述数据表中存在与所述第一组指定数值的相同的第二组指定数值;如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中未查找到与所述第一MD5值相同的MD5值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值。
  3. 根据权利要求1所述的图片查重方法,其特征在于,所述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤之前,包括:
    接收用户发送的拖动指令,所述拖动指令用于将第一图片拖动至图片数据库的入口区域;
    响应于所述拖动指令,触发在所述图片数据库中查找是否存在于第一图片相同的第二图片的命令。
  4. 根据权利要求3所述的图片查重方法,其特征在于,所述响应于所述拖动指令,触发在所述图片数据库中查找是否存在于第一图片相同的第二图片的命令的步骤之后,包括:
    生成确认按钮和取消按钮;
    若在指定时间内接收到所述确认按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内接收到所述取消按钮被选择的命令,则停止执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内即未接收到确认按钮被选择的命令,也未接收到取消按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令。
  5. 根据权利要求1所述的图片查重方法,其特征在于,所述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤之前,包括:
    将所述第一图片导入预设的图片归类模型中进行归类,确定所述第一图片的第一类别;
    根据所述第一类别,调用所述数据表中对应所述第一类别的第一数据表,以便于在第一数据表中查找与所述第一组指定数值相同的第二组指定数值。
  6. 根据权利要求5所述的图片查重方法,其特征在于,当所述第一图片为多张时,所述在所述数据表中查找与所述第一组指定数值相同的第二组指定数值的步骤,包括:
    将多张所述第一图片分类后,同时在不同的类别的数据表中对查找与所述第一组指定数值相同的第二组指定数值。
  7. 根据权利要求1所述的图片查重方法,其特征在于,所述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤之前,包括:
    利用高清摄像头依次拍摄多头待投保牲畜险的生猪脸部图像;其中,每拍摄一张生猪脸部图像,对应的建立一个投保序号,以及计算出对应的数据量值和MD5值,记录到所述数据表中;
    将拍摄的各生猪脸部图像,以及所述数据表存储到指定的数据库中,形成所述图片数据库。
  8. 一种图片查重装置,其特征在于,包括:
    第一获取单元,用于获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
    查找单元,用于在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
    第二获取单元,用于如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
    比较单元,用于比较所述第一二进制数据和第二二进制数据是否相同;
    结果处理单元,用于如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
  9. 根据权利要求8所述的图片查重装置,其特征在于,所述查找单元,包括:
    第一查找模块,用于在所述数据表中查找与所述第一数据量值的相同的第二数据量值;
    第二查找模块,用于若未查找到与所述第一数据量值相同的第二数据量值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值;若查找到与所述第一数据量值的相同的第二数据量值,则在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值;
    判定模块,用于如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找到与所述第一MD5值相同的MD5值,则判定所述数据表中存在与所述第一组指定数值的相同的第二组指定数值;如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中未查找到与所述第一MD5值相同的MD5值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值。
  10. 根据权利要求8所述的图片查重装置,其特征在于,还包括:
    接收单元,用于接收用户发送的拖动指令,所述拖动指令用于将第一图片拖动至图片数据库的入口区域;
    触发单元,用于响应于所述拖动指令,触发在所述图片数据库中查找是否存在与第一图片相同的第二图片的命令。
  11. 根据权利要求10所述的图片查重装置,其特征在于,还包括:
    生成单元,用于生成确认按钮和取消按钮;
    执行单元,用于若在指定时间内接收到所述确认按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内接收到所述取消按钮被选择的命令,则停止执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令;若在所述指定时间内即未接收到确认按钮被选择的命令,也未接收到取消按钮被选择的命令,则执行在所述图片数据库中查找是否存在与所述第一图片相同的第二图片的命令。
  12. 根据权利要求8所述的图片查重装置,其特征在于,还包括:
    分类单元,用于将所述第一图片导入预设的图片归类模型中进行归类,确定所述第一图片的第一类别;
    调用查找单元,用于根据所述第一类别,调用所述数据表中对应所述第一类别的第一数据表,以便于在第一数据表中查找与所述第一组指定数值相同的第二组指定数值。
  13. 根据权利要求12所述的图片查重装置,其特征在于,所述查找单元,包括:
    分类查找模块,用于将多张所述第一图片分类后,同时在不同的类别的数据表中对查找与所述第一组指定数值相同的第二组指定数值。
  14. 根据权利要求8所述的图片查重装置,其特征在于,还包括:
    拍摄单元,用于利用高清摄像头依次拍摄多头待投保牲畜险的生猪脸部图像;其中,每拍摄一张生猪脸部图像,对应的建立一个投保序号,以及计算出对应的数据量值和MD5值,记录到所述数据表中;
    存储单元,用于将拍摄的各生猪脸部图像,以及所述数据表存储到指定的数据库中,形成所述图片数据库。
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现一种图片查重方法,所述方法的步骤包括:
    获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
    在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
    如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
    比较所述第一二进制数据和第二二进制数据是否相同;
    如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述在所述数据表中查找与所述第一组指定数值相同的第二组指定数值的步骤,包括:
    在所述数据表中查找与所述第一数据量值的相同的第二数据量值;
    若未查找到与所述第一数据量值相同的第二数据量值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值;若查找到与所述第一数据量值的相同的第二数据量值,则在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值;
    如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找到与所述第一MD5值相同的MD5值,则判定所述数据表中存在与所述第一组指定数值的相同的第二组指定数值;如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中未查找到与所述第一MD5值相同的MD5值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值。
  17. 根据权利要求15所述的计算机设备,其特征在于,所述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤之前,包括:
    接收用户发送的拖动指令,所述拖动指令用于将第一图片拖动至图片数据库的入口区域;
    响应于所述拖动指令,触发在所述图片数据库中查找是否存在于第一图片相同的第二图片的命令。
  18. 一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现一种图片查重方法,所述方法的步骤包括:
    获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表;其中,第一组指定数值包括第一数据量值和第一MD5值,第二组指定数值包括第二数据量值和第二MD5值;
    在所述数据表中查找与所述第一组指定数值相同的第二组指定数值;
    如果查找到与所述第一组指定数值相同的第二组指定数值,则获取第一照片的第一二进制数据,以及与所述第一组指定数值相同的第二组指定数值的第二照片的第二二进制数据;
    比较所述第一二进制数据和第二二进制数据是否相同;
    如果所述第一二进制数据和第二二进制数据不相同,则将所述第一图片导入到所述图片数据库中;如果所述第一二进制数据和第二二进制数据相同,则判定在所述图片数据库中存在与所述第一图片相同过的第二图片,停止将所述第一图片导入所述图片数据库中。
  19. 根据权利要求18所述的计算机非易失性可读存储介质,其特征在于,所述在所述数据表中查找与所述第一组指定数值相同的第二组指定数值的步骤,包括:
    在所述数据表中查找与所述第一数据量值的相同的第二数据量值;
    若未查找到与所述第一数据量值相同的第二数据量值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值;若查找到与所述第一数据量值的相同的第二数据量值,则在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找与所述第一MD5值相同的MD5值;
    如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中查找到与所述第一MD5值相同的MD5值,则判定所述数据表中存在与所述第一组指定数值的相同的第二组指定数值;如果在与所述第一数据量值的相同的第二数据量值对应的第二MD5值中未查找到与所述第一MD5值相同的MD5值,则判定在所述数据表中不存在与所述第一组指定数值相同的第二组指定数值。
  20. 根据权利要求18所述的计算机非易失性可读存储介质,其特征在于,所述获取待导入图片数据库中的第一图片对应的第一组指定数值,以及记录所述图片数据库中每一幅第二图片对应的第二组指定数值的数据表的步骤之前,包括:
    接收用户发送的拖动指令,所述拖动指令用于将第一图片拖动至图片数据库的入口区域;
    响应于所述拖动指令,触发在所述图片数据库中查找是否存在于第一图片相同的第二图片的命令。
PCT/CN2019/089110 2019-01-31 2019-05-29 图片查重方法、装置、计算机设备和存储介质 WO2020155488A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910101273.8 2019-01-31
CN201910101273.8A CN109918518A (zh) 2019-01-31 2019-01-31 图片查重方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2020155488A1 true WO2020155488A1 (zh) 2020-08-06

Family

ID=66961289

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/089110 WO2020155488A1 (zh) 2019-01-31 2019-05-29 图片查重方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN109918518A (zh)
WO (1) WO2020155488A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750451A (zh) * 2019-09-23 2020-02-04 惠州市德赛西威汽车电子股份有限公司 一种车载多媒体ui素材自动识别检测系统及方法
CN113296715A (zh) * 2021-06-29 2021-08-24 中国平安人寿保险股份有限公司 图片资源处理方法、装置和计算机设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831127A (zh) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 重复数据处理方法、装置及系统
CN103020086A (zh) * 2011-09-26 2013-04-03 北大方正集团有限公司 一种图片查重的方法及装置
US8464097B1 (en) * 2005-01-31 2013-06-11 Symantec Operating Corporation Method and apparatus for efficiently creating backup files with less redundancy
CN104112284A (zh) * 2013-04-22 2014-10-22 阿里巴巴集团控股有限公司 一种图片的相似度检测方法和设备
CN107169057A (zh) * 2017-04-27 2017-09-15 腾讯科技(深圳)有限公司 一种重复图片的检测方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8930307B2 (en) * 2011-09-30 2015-01-06 Pure Storage, Inc. Method for removing duplicate data from a storage array
CN104200499A (zh) * 2014-09-24 2014-12-10 深圳市英威诺科技有限公司 一种资讯图片智能去重的技术方法
US10169358B2 (en) * 2015-10-08 2019-01-01 International Business Machines Corporation Data deduplication using a small hash table

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8464097B1 (en) * 2005-01-31 2013-06-11 Symantec Operating Corporation Method and apparatus for efficiently creating backup files with less redundancy
CN102831127A (zh) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 重复数据处理方法、装置及系统
CN103020086A (zh) * 2011-09-26 2013-04-03 北大方正集团有限公司 一种图片查重的方法及装置
CN104112284A (zh) * 2013-04-22 2014-10-22 阿里巴巴集团控股有限公司 一种图片的相似度检测方法和设备
CN107169057A (zh) * 2017-04-27 2017-09-15 腾讯科技(深圳)有限公司 一种重复图片的检测方法和装置

Also Published As

Publication number Publication date
CN109918518A (zh) 2019-06-21

Similar Documents

Publication Publication Date Title
WO2020134991A1 (zh) 纸质表单的自动录入方法、装置、计算机设备和存储介质
WO2020037937A1 (zh) 人脸识别的方法、装置、终端及计算机可读存储介质
US8560625B1 (en) Facilitating photo sharing
WO2018166116A1 (zh) 车损识别方法、电子装置及计算机可读存储介质
WO2019033715A1 (zh) 人脸图像数据采集方法、装置、终端设备及存储介质
CN111340123A (zh) 一种基于深度卷积神经网络的图像分数标签预测方法
JP6396897B2 (ja) 出席者によるイベントの検索
CN110866491A (zh) 目标检索方法、装置、计算机可读存储介质和计算机设备
WO2020155488A1 (zh) 图片查重方法、装置、计算机设备和存储介质
CN112348089A (zh) 工作状态识别方法、服务器、存储介质及装置
CN110378189A (zh) 一种监控布置方法、装置、终端及存储介质
CN106713859A (zh) 一种图片视觉监控搜索系统及其搜索方法
WO2020019457A1 (zh) 用户指令匹配方法、装置、计算机设备及存储介质
WO2021081741A1 (zh) 一种基于多关系社交网络的图像分类方法及系统
CN113408630A (zh) 一种变电站指示灯状态识别方法
EP3944628A1 (en) Camera analyzing images on basis of artificial intelligence, and operating method therefor
CN112818960A (zh) 基于人脸识别的等待时长处理方法、装置、设备及介质
WO2024001309A1 (zh) 一种红外热像分析报告的生成及模板制作方法及装置
CN112001300A (zh) 基于按位置交叉熵的楼宇监控方法、装置和电子设备
TWI547816B (zh) 照片分群系統及方法
WO2018149400A1 (zh) 一种页面发布方法、可读存储介质、终端设备及装置
CN113986823A (zh) 一种通信机房的图片归档方法、装置、介质及设备
CN112906798A (zh) 图像匹配方法、装置及计算机存储介质
CN110990614A (zh) 基于引擎大数据的图片自学习方法、装置、设备及介质
CN113806208A (zh) 测试取证方法及装置、设备、存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19913754

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19913754

Country of ref document: EP

Kind code of ref document: A1