Image duplication checking method, database, device, readable storage medium and system

The image duplication check method implemented by Python uses DCT operation and hash value comparison to solve the problems of low resolution and confusing naming in image data processing, and improves the accuracy and efficiency of repeated image recognition.

CN116595212BActive Publication Date: 2025-08-22XIAMEN VITU SOFTWARE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310530921.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2025-08-22
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

In the prior art, the image data has low resolution and unclear categories, which leads to difficulty in cleaning data, and the customer hides information, resulting in confusion in the naming of pictures, making it difficult to manually identify duplicate pictures, reducing labeling efficiency and sample diversity.

Method used

Using Python-based image mutation checking method, the image is scaled to 32*32 pixels through the resize function, DCT operation is performed, the feature matrix of RGB or grayscale images is extracted, the hash value is calculated and the dictionary comparison is used to realize automatic filtering of repeated images.

Benefits of technology

It improves the accuracy and efficiency of image plagiarism checking, can effectively identify duplicate images, and improves the accuracy and efficiency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116595212B_ABST
    Figure CN116595212B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, database, device, readable storage medium and system for checking duplicate images. The method is a Python-based method for checking duplicate images, comprising the following steps: 1) obtaining a plurality of color images to be checked for duplicates and existing color images; 2) scaling the color images using a resize function; obtaining a 32*32 pixel RGB three-channel image through the scaling; 3) performing DCT operations on the images according to the RGB three-channel images respectively and combining them to obtain a 32*32 three-dimensional matrix of the image, etc. The present invention uses a sampling method obtained through innovative experiments by the inventor to find matrices with more information in each channel through induction, thereby obtaining a more authentic hash value, which has a better effect on checking for duplicate images and a higher efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of general defect-class algorithms, and in particular to a Python-based image duplication detection method. Background Art

[0002] In actual general defect algorithm projects, the provided image data often have problems such as low resolution, unclear categories, and partial duplication, which causes considerable difficulties in the early pre-processing work such as data cleaning.

[0003] In addition, in order to hide image information, customers will uniformly set the names of images of different batches and categories to serial numbers from 0 to N, which may lead to the following situations:

[0004] (1) Some identical images in the same batch of data are named with different serial numbers.

[0005] (2) Some identical images in different batches of data are named with different serial numbers and stored in different folders.

[0006] Furthermore, when the sample size of images is large, it is difficult to manually filter out the duplicate parts. Directly labeling duplicate images without intervention will indirectly reduce sample diversity and thus reduce labeling efficiency.

[0007] In order to solve the above problems, this case provides a Python-based image duplication detection technology.

[0008] The above information disclosed in this section is only for understanding the background of the inventive concept of the present disclosure and therefore the above information may contain information that does not constitute prior art. Summary of the Invention

[0009] The purpose of this invention is to provide a Python-based image duplication checking method to improve efficiency, increase accuracy, and better filter duplicate images.

[0010] To achieve the above objectives, the present invention provides a solution: a Python-based image duplication detection method, comprising the following steps:

[0011] 1) Obtain multiple color images to be checked for duplicates and existing color images;

[0012] 2) Using the resize function to scale the color image; the scaling obtains a 32*32 pixel RGB three-channel image;

[0013] 3) performing DCT operations on the image according to the RGB three-channel images respectively and combining them to obtain a 32*32 three-dimensional matrix of the image;

[0014] 4) In the 32*32 three-dimensional matrix of the image, the R channel takes the upper left 8*8, middle 8*8 and lower right 8*8 areas, the G channel takes the middle 8*8 and lower left 8*8 areas, and the B channel takes the middle 8*8 and upper right 8*8 areas, and the image feature matrix in 8*8 format is obtained by calculating the arithmetic mean of the above R channel, G channel and B channel areas;

[0015] 5) converting the image feature matrix into a 64-bit list and calculating the average value; comparing the 64-bit list with the average value, assigning 0 if the value is less than the average value and 1 if the value is greater than the average value to obtain an image mean binary sequence; looping through the image mean binary sequence, converting it into decimal with a step size of three numbers to obtain an image mean decimal sequence;

[0016] 6) Fill the tens place of the digits less than 10 in the decimal sequence of the image mean with zeros to obtain the hash values ​​of the color image to be checked for duplicates and the existing color image;

[0017] 7) Assume that dictionary A contains the key of the color picture to be checked for duplicates and the value of the color picture to be checked for duplicates, and assume that dictionary B contains the key of the existing color picture and the value of the existing color picture; the color picture value to be checked for duplicates and the existing color picture value contain the hash value of the color picture to be checked for duplicates and the existing color picture and the original path of the color picture to be checked for duplicates and the existing color picture; the color picture key to be checked for duplicates and the existing color picture key are sequence-marked respectively; compare dictionary A with dictionary B, assume that the sample of the color picture value to be checked for duplicates is Ax, and assume that the sample of the existing color picture value is B(0-n); if Ax is less than B0, the color picture to be checked for duplicates and the existing color picture are not repeated; if Ax is greater than Bn, the color picture to be checked for duplicates and the existing color picture are not repeated; if Ax is within the interval of B(0-n), compare it with the middle value of B, narrow the range by binary search, and judge whether they are completely equal. If they are completely equal, output the value of the color picture to be checked for duplicates and the value of the existing color picture, otherwise the color picture to be checked for duplicates and the existing color picture are not repeated.

[0018] The solution of the present invention also includes a Python-based image duplication detection method, comprising the steps of:

[0019] 1) Obtain multiple grayscale images to be checked for duplicates and existing images;

[0020] 2) Using the resize function to scale the grayscale image; the scaling obtains a 32*32 pixel grayscale image;

[0021] 3) performing DCT operation on the grayscale image and combining the grayscale image to obtain the 32*32 image matrix;

[0022] 4) In the middle 8*8 area of ​​the image matrix, an image feature matrix in an 8*8 format is obtained by taking the arithmetic mean of the 8*8 area;

[0023] 5) converting the image feature matrix into a 64-bit list and calculating the average value; comparing the 64-bit list with the average value, assigning 0 if the value is less than the average value and 1 if the value is greater than the average value to obtain an image mean binary sequence; looping through the image mean binary sequence, converting it into decimal with a step size of three numbers to obtain an image mean decimal sequence;

[0024] 6) Fill the tens place of the digits less than 10 in the decimal sequence of the image mean with zeros to obtain the hash values ​​of the image to be checked for duplicates and the existing grayscale image;

[0025] 7) Assume that dictionary A contains the grayscale image key to be checked for duplicates and the grayscale image value to be checked for duplicates, and assume that dictionary B contains the existing grayscale image key and the existing grayscale image value; the grayscale image value to be checked for duplicates and the existing grayscale image value contain the hash value of the grayscale image to be checked for duplicates and the existing grayscale image and the original path of the grayscale image to be checked for duplicates and the existing grayscale image; the grayscale image key to be checked for duplicates and the existing grayscale image key are sequence-labeled respectively; compare dictionary A with dictionary B, assume that the grayscale image value sample to be checked for duplicates is Ax, and assume that the existing grayscale image value sample is B(0-n); if Ax is less than B0, the grayscale image to be checked for duplicates and the existing grayscale image are not repeated; if Ax is greater than Bn, the grayscale image to be checked for duplicates and the existing grayscale image are not repeated; if Ax is within the interval of B(0-n), compare it with the middle value of B, narrow the range by binary search, and determine whether they are completely equal. If they are completely equal, output the grayscale image value to be checked for duplicates and the existing grayscale image value; otherwise, the grayscale image to be checked for duplicates and the existing grayscale image are not repeated.

[0026] The solution of the present invention also includes a database of a Python-based image duplication checking method, including a storage space, and the storage space stores the above-mentioned Python-based image duplication checking method and information in a distributed manner.

[0027] The solution of the present invention also includes an image duplication checking device, including a memory and a processor; the memory is used to store a computer program; the processor is used to implement the above-mentioned Python-based image duplication checking method when executing the computer program.

[0028] The solution of the present invention also includes a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the above-mentioned Python-based image duplication checking method is implemented.

[0029] The solution of the present invention also includes a picture duplication checking system, which includes the picture duplication checking device as described above, an Internet interface and peripherals, wherein the peripherals include a display, a keyboard and a mouse.

[0030] The image duplication checking device is connected to the Internet interface and the peripheral device in sequence;

[0031] The display is used to display the above-mentioned Python-based image duplication checking method;

[0032] The keyboard and mouse are used to control and modify the above-mentioned Python-based image duplication detection method;

[0033] The Internet interface is used to connect the above-mentioned Python-based image duplication checking method to the Internet.

[0034] After adopting the above solution, the gain effect of the present invention is:

[0035] 1. This invention provides an image processing method for general defect-related algorithms. This method uses DCT to obtain low-frequency information and transform the image from the pixel domain to the frequency domain. Generally, images contain a lot of redundancy and correlation. After conversion to the frequency domain, only a small number of frequency components have coefficients that are non-zero, while the majority of coefficients are zero (or close to zero). The coefficient matrix after DCT transform has increasing frequencies from the upper left corner to the lower right corner, so the image's energy is primarily retained in the low-frequency coefficients in the upper left corner. This method preserves more information and achieves greater authenticity.

[0036] 2. The sampling method derived from the inventor's innovative experiments finds the matrix with more information for each channel through induction, thereby obtaining a more authentic hash value, which is more effective and efficient in checking the completeness and accuracy of duplicate images. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a diagram illustrating the steps of the image duplication checking method of the present invention;

[0038] Figure 2 This is a schematic diagram of the interface of a Python-based image duplication checking system of the present invention;

[0039] Figure 3 This is a schematic diagram of the step data of Example 1 of the present invention Figure 1 ;

[0040] Figure 4 This is a schematic diagram of the step data of Example 1 of the present invention Figure 2 ;

[0041] Figure 5 This is a schematic diagram of the step data of Example 1 of the present invention Figure 3 ;

[0042] Figure 6 This is a schematic diagram of the step data of Example 1 of the present invention Figure 4 ;

[0043] Figure 7 This is a schematic diagram of the step data of Example 1 of the present invention Figure 5 ;

[0044] Figure 8 This is a schematic diagram of the step data of Example 1 of the present invention Figure 6 ;

[0045] Figure 9 This is a schematic diagram of the step data of Example 1 of the present invention Figure 7 ;

[0046] Figure 10 This is a schematic diagram of the step data of Example 1 of the present invention Figure 8 ;

[0047] Figure 11 This is a schematic diagram of the step data of Example 1 of the present invention Figure 9 ;

[0048] Figure 12 This is a schematic diagram of the step data of Example 1 of the present invention Figure 10 ;

[0049] Figure 13 This is a schematic diagram of the step data of Example 1 of the present invention Figure 10 one;

[0050] Figure 14 This is a schematic diagram of the step data of Example 1 of the present invention Figure 10 two. DETAILED DESCRIPTION

[0051] In the following description, for purposes of explanation, numerous specific details are set forth to provide a comprehensive understanding of the various exemplary embodiments. However, it is apparent that the various exemplary embodiments may be practiced without these specific details or with one or more equivalent arrangements. Furthermore, the various exemplary embodiments may be different, but not necessarily exclusive. For example, specific configurations and features of an exemplary embodiment may be used or practiced in another exemplary embodiment without departing from the inventive concept.

[0052] Those skilled in the art will be aware that Python was designed by Guido van Rossum of the Netherlands Institute for Mathematical and Computer Science Research in the early 1990s as a replacement for a language called ABC. Python provides efficient high-level data structures and simple, effective object-oriented programming. Its syntax, dynamic typing, and interpreted nature make it a popular programming language for scripting and rapid application development on most platforms. With continuous updates and the addition of new features, Python has gradually become used for both independent and large-scale project development.

[0053] Those skilled in the art should know that OpenCV is a cross-platform computer vision and machine learning software library released under the Apache 2.0 license (open source), which can run on Linux, Windows, Android and Mac OS operating systems.

[0054] Those skilled in the art will recognize that the DCT (Discrete Cosine Transform) is a transform related to the Fourier Transform. It is similar to the Discrete Fourier Transform (DFT), but uses only real numbers. The DCT is equivalent to a Discrete Fourier Transform (DFT) that is roughly twice as long. This DFT is performed on a real even function (because the Fourier transform of a real even function is still a real even function), and some variations require shifting the input or output by half a unit (there are eight standard types of DCT, four of which are common).

[0055] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0056] The present invention provides a Python-based image duplication detection method. Figure 1 As shown, a Python-based image duplication checking system includes the following steps:

[0057] 1) Obtain multiple images to be checked for duplicates and existing images;

[0058] 2) Using the resize function of the Opencv library to scale the image; the scaling obtains a 32*32 pixel, RGB three-channel image or a grayscale image;

[0059] 3) The image is subjected to DCT operation on the RGB three channels or the grayscale single channel respectively, and then combined to obtain a 32*32 three-dimensional matrix or a 32*32 matrix of the image; the DCT formula is as follows:

[0060]

[0061] When u=0

[0062]

[0063] otherwise

[0064]

[0065] 4) In the 32*32 three-dimensional matrix of the color image, the R channel takes the upper left 8*8, middle 8*8 and lower right 8*8 areas, the G channel takes the middle 8*8 and lower left 8*8 areas, and the B channel takes the middle 8*8 and upper right 8*8 areas. The color image feature matrix in 8*8 format is obtained by calculating the arithmetic mean of the R channel, G channel and B channel areas. The grayscale image feature matrix in 8*8 format is obtained by taking the arithmetic mean of the middle 8*8 area in the 32*32 matrix of the grayscale image;

[0066] 5) Converting the image feature matrix into a 64-bit list and calculating the average value; comparing the 64-bit list with the average value, assigning 0 if the value is less than the average value and 1 if the value is greater than the average value to obtain the image mean binary sequence;

[0067] 6) Circulate the image mean binary sequence, convert it into decimal with a step size of three numbers to obtain the image mean decimal sequence; fill the tens place of the digits less than 10 in the image mean decimal sequence with zeros to obtain the image hash value;

[0068] 7) Assume that dictionary A contains the key of the picture to be checked for duplicates and the value of the picture to be checked for duplicates, and assume that dictionary B contains the key of the existing picture and the value of the existing picture; the value of the picture to be checked for duplicates and the existing picture value contain the hash value of the picture to be checked for duplicates and the existing picture and the original path of the picture to be checked for duplicates and the existing picture, and the key of the picture to be checked for duplicates and the existing picture are marked respectively; compare dictionary A with dictionary B, assume that the sample of the picture value to be checked for duplicates is Ax, and assume that the sample of the existing picture value is B(0-n); if Ax is less than B0, the picture to be checked for duplicates and the existing picture are not repeated; if Ax is greater than Bn, the picture to be checked for duplicates and the existing picture are not repeated; if Ax is within the interval of B(0-n), compare it with the middle value of B, narrow the range by binary search, and judge whether they are completely equal. If they are completely equal, output the key of the picture to be checked for duplicates and the existing picture key, otherwise the picture to be checked for duplicates and the existing picture are not repeated.

[0069] Specifically, according to the inventor's experiments, step 4) satisfies a rule in terms of trend, and the RGB three-channel information is mostly concentrated in the low-frequency area on the upper left side. According to this rule, the following are obtained: the upper left 8*8 area of ​​the R channel, the lower right 8*8 area of ​​the R channel, the lower left 8*8 area of ​​the G channel, the upper right 8*8 area of ​​the B channel, and the middle 8*8 area of ​​RGB (the grayscale value is taken once in the middle), and an 8*8 matrix is ​​obtained by calculating their arithmetic mean.

[0070] It also includes a database of a Python-based image duplication checking method, including a storage space, and the storage space distributes the above-mentioned Python-based image duplication checking method and information.

[0071] It also includes an image duplication checking device, including a memory and a processor; the memory is used to store a computer program; the processor is used to implement the above-mentioned Python-based image duplication checking method when executing the computer program.

[0072] It also includes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the Python-based image duplication checking method as described above is implemented.

[0073] Also included is a Python-based image duplication checking system, comprising the above-mentioned image duplication checking device, an Internet interface, and peripherals, wherein the peripherals include a display, a keyboard, and a mouse, and the image duplication checking device is connected to the Internet interface and the peripherals in sequence; the display is used to display the Python-based image duplication checking method; the keyboard and mouse are used to control and modify the Python-based image duplication checking method;

[0074] Example 1

[0075] Run one of the above-mentioned Python-based image duplication checking systems;

[0076] refer to Figure 2 , this embodiment uses two batches of 10,000 data samples each, all of which are randomly selected and named in different formats "APPLE(1-10440) / BANANA(1-10016)". Drag the two target folders to the corresponding positions in the figure, and the text box below will display the original addresses of the two folders. (Note: To check for duplicate images in a certain folder, check "Whether to match single folder", and then click File Compare to display the paths of duplicate images in the same folder; the loop is to compare and check all the images in the two folders for duplicates) Click File Compare to start running, the tool will print the name of the duplicate data in the text box below, and finally display the number of duplicates and the time consumed. In this demonstration, a total of 8936 duplicate images were found, with an average time consumption of: 8.3480ms.

[0077] Directly use the resize function of the Opencv library to perform a scaling operation on the image.

[0078] img=cv2.resize(img,(32,32),interpolation=cv2.INTER_CUBIC)

[0079] interpolation: This parameter specifies the interpolation method. After scaling, the pixels are recalculated. This parameter specifies how the pixels are recalculated. INTER_CUBIC: Bicubic interpolation within a 4x4 pixel neighborhood. This is only used for scaling; no formulas are involved.

[0080] By scaling down the image, we get a (32, 32, 3) image, where 32 represents the pixels and 3 represents the RGB channels. Since the DCT matrix is ​​a two-dimensional matrix, directly applying the calculation to a three-dimensional image can easily result in errors. Therefore, we perform a separate DCT on each of the three RGB dimensions, combining the results into a single three-dimensional matrix and saving it as a color image. For grayscale images, only one DCT is required. The DCT formula is shown above.

[0081] like Figure 3 The image pixel values ​​of 32*32 pixels RGB three channels are shown (partially omitted)

[0082] like Figure 4 The 32*32 three-dimensional matrix (partially omitted) is formed after three DCTs.

[0083] like Figure 5-8 The new pixel table shown is sampled, where 2, 11, 19, and 26 are shown.

[0084] The figure above shows that the trend meets a rule. The RGB three-channel information is mostly concentrated in the low-frequency area on the upper left. According to this rule, the following are obtained: the upper left 8*8 area of ​​the R channel, the lower right 8*8 area of ​​the R channel, the lower left 8*8 area of ​​the G channel, the upper right 8*8 area of ​​the B channel, and the middle 8*8 area of ​​RGB (the grayscale value is taken once in the middle).

[0085] like Figure 9 As shown, an 8*8 matrix is ​​obtained by calculating the arithmetic mean.

[0086] like Figure 10 The table is converted to 64 bits.

[0087] like Figure 11 The average value is obtained as shown.

[0088] like Figure 12 As shown, these 64 bits are compared with the average value, and if it is less than 0, it is given as 0, and if it is greater than 1 (binarization).

[0089] like Figure 13-14 The sequence is looped with a step of 3 numbers, and the binary system is converted to decimal. The tens digits of the middle digits less than 10 are padded with zeros to obtain the hash value of a single image.

[0090] Through the above steps, two dictionaries are established. Let dictionary A contain the key of the image to be checked for duplicates and the value of the image to be checked for duplicates, and let dictionary B contain the key of the existing image and the value of the existing image. The key of the image to be checked for duplicates and the key of the existing image are marked respectively. Compare dictionary A with dictionary B, let the sample of the value of the image to be checked for duplicates be Ax, and let the sample of the value of the existing image be B(0-n)

[0091] The "values" of dictionary A and dictionary B include the different hash values ​​and original paths of all images in the file, and the "keys" include sequence tags; repeated "keys" will mark two different original paths of images in the corresponding "values", such as Figure 2 As described above, they are printed out at the same time (for self-checking of duplicate images in a single folder). The "keys" of the dictionaries are arranged according to their numerical values. For each "key" in the first dictionary, a binary search is performed in the second dictionary.

[0092] Let the first dictionary be A, and the one to be checked for duplicates each time be Ax. Let the second dictionary be B, and the "keys" be B(0 - n).

[0093] If Ax < B0, there is no duplication;

[0094] If Ax > Bn, there is no duplication;

[0095] If Ax is within the range of B(0 - n), it is compared with the middle value of B each time to narrow down the range and determine whether they are exactly equal. If so, the "value" of the duplicate graph is output, which is the original path it contains.

[0096] The color pictures of the relevant steps are more intuitive, but according to the detailed rules, no examples will be given here, and it is provided in the form containing some grayscale pictures as above.

[0097] In summary, the present invention obtains low-frequency information through DCT, transforms the image from the pixel domain to the frequency domain. Generally, there are many redundancies and correlations in images. After transformation to the frequency domain, only a few frequency component coefficients are not zero, and most coefficients are zero (or close to zero). The coefficient matrix after DCT transformation has increasing frequencies from the upper left corner to the lower right corner. Therefore, the energy of the picture is mainly retained in the low-frequency coefficients in the upper left corner. The method provided by the present invention retains more information and has stronger authenticity.

[0098] The above are only the preferred embodiments of the present invention, and do not limit the design of this case. All equivalent changes made according to the key design of this case fall within the protection scope of this case.

Claims

1. A Python-based image duplication checking method, characterized in that: Including steps: 1) Obtain multiple color images to be checked for duplicates and existing images; 2) Using the resize function provided by the Opencv library to scale the color image; the scaling obtains a 32*32 pixel RGB three-channel image; 3) performing calculations on the image according to the RGB three channels and combining them to obtain a 32*32 three-dimensional matrix of the image; 4) In the 32*32 three-dimensional matrix of the image, the R channel takes the upper left 8*8, middle 8*8, and lower right 8*8 areas, the G channel takes the middle 8*8 and lower left 8*8 areas, and the B channel takes the middle 8*8 and upper right 8*8 areas. The image feature matrix in 8*8 format is obtained by calculating the arithmetic mean of the R channel, G channel, and B channel areas; 5) Converting the image feature matrix into a 64-bit list and calculating the average value; comparing the 64-bit list with the average value, assigning 0 if the value is less than the average value and 1 if the value is greater than the average value to obtain an image mean binary sequence; looping through the image mean binary sequence, converting it into decimal with a step size of three numbers to obtain an image mean decimal sequence; 6) Fill the tens place of the digits less than 10 in the decimal sequence of the image mean with zeros to obtain the hash values ​​of the color image to be checked for duplicates and the existing color image; 7) Assume that dictionary A contains the key of the color picture to be checked for duplicates and the value of the color picture to be checked for duplicates, and assume that dictionary B contains the key of the existing color picture and the value of the existing color picture; the color picture value to be checked for duplicates and the existing color picture value contain the hash value of the color picture to be checked for duplicates and the existing color picture and the original path of the color picture to be checked for duplicates and the existing color picture; the color picture key to be checked for duplicates and the existing color picture key are sequence-tagged respectively; compare dictionary A with dictionary B, assume that the sample of the color picture value to be checked for duplicates is Ax, and assume that the sample of the existing color picture value is B(0-n); if Ax is less than B0, the color picture to be checked for duplicates and the existing color picture are not repeated; if Ax is greater than Bn, the color picture to be checked for duplicates and the existing color picture are not repeated; if Ax is within the interval of B(0-n), compare it with the middle value of B, narrow the range by binary search, and determine whether they are completely equal. If they are completely equal, output the value of the color picture to be checked for duplicates and the value of the existing color picture; otherwise, the color picture to be checked for duplicates and the existing color picture are not repeated.

2. A Python-based image duplication checking method, characterized in that: Including steps: 1) Obtain multiple grayscale images to be checked for duplicates and existing images; 2) Using the resize function of the Opencv library to scale the grayscale image; the scaling obtains a 32*32 pixel grayscale image; 3) performing calculations on the grayscale image according to the image to obtain the 32*32 image matrix; 4) In the middle 8*8 area of ​​the image matrix, an 8*8 format image feature matrix is ​​obtained by taking the arithmetic mean of the 8*8 area; 5) Converting the image feature matrix into a 64-bit list and calculating the average value; comparing the 64-bit list with the average value, assigning 0 if the value is less than the average value and 1 if the value is greater than the average value to obtain an image mean binary sequence; looping through the image mean binary sequence, converting it into decimal with a step size of three numbers to obtain an image mean decimal sequence; 6) Fill the tens place of the digits less than 10 in the decimal sequence of the image mean with zeros to obtain the hash values ​​of the image to be checked for duplicates and the existing grayscale image; 7) Assume that dictionary A contains the grayscale image key to be checked for duplicates and the grayscale image value to be checked for duplicates, and dictionary B contains the existing grayscale image key and the existing grayscale image value; the grayscale image value to be checked for duplicates and the existing grayscale image value contain the hash values ​​of the grayscale image to be checked for duplicates and the existing grayscale image, and the original paths of the grayscale image to be checked for duplicates and the existing grayscale image; the grayscale image key to be checked for duplicates and the existing grayscale image key are respectively sequence-labeled; Compare dictionary A with dictionary B, let the grayscale image value sample to be checked for duplicates be Ax, and let the existing grayscale image value sample be B(0-n); if Ax is less than B0, the grayscale image to be checked for duplicates and the existing grayscale image are not repeated; if Ax is greater than Bn, the grayscale image to be checked for duplicates and the existing grayscale image are not repeated; if Ax is within the interval of B(0-n), compare it with the middle value of B, narrow the range through binary search, and determine whether they are completely equal. If they are completely equal, output the grayscale image value to be checked for duplicates and the existing grayscale image value; otherwise, the grayscale image to be checked for duplicates and the existing grayscale image are not repeated.

3. A database of a Python-based image duplication checking method, characterized in that: It includes a storage space, and the storage space is distributed to store the Python-based image duplication checking method and information as described in claim 1.

4. A database of a Python-based image duplication checking method, characterized in that: It includes a storage space, and the storage space is distributed to store the Python-based image duplication checking method and information as described in claim 2.

5. The image duplication checking device is characterized by: It includes a memory and a processor; the memory is used to store a computer program; the processor is used to implement a Python-based image duplication detection method as claimed in claim 1 when executing the computer program.

6. The image duplication checking device is characterized by: It includes a memory and a processor; the memory is used to store a computer program; the processor is used to implement a Python-based image duplication checking method as described in claim 2 when executing the computer program.

7. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the Python-based image duplication checking method as claimed in claim 1 is implemented.

8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the Python-based image duplication checking method as described in claim 2 is implemented.

9. A system for checking duplicate images, characterized in that: The apparatus comprises the image duplication checking device according to claim 5, an Internet interface and peripherals, wherein the peripherals include a display, a keyboard and a mouse. The image duplication checking device is connected to the Internet interface and the peripheral device in sequence; The display is used to display the Python-based image duplication checking method as claimed in claim 1; The keyboard and mouse are used to control and modify the Python-based image duplication detection method as claimed in claim 1; The Internet interface is used to connect the Python-based image duplication checking method as described in claim 1 to the Internet.

10. A system for checking duplicate images, characterized in that: The apparatus comprises the image duplication checking device according to claim 6, an Internet interface and peripherals, wherein the peripherals include a display, a keyboard and a mouse. The image duplication checking device is connected to the Internet interface and the peripheral device in sequence; The display is used to display the Python-based image duplication checking method as claimed in claim 2; The keyboard and mouse are used to control and modify the Python-based image duplication detection method as described in claim 2; The Internet interface is used to connect the Python-based image duplication checking method as described in claim 2 to the Internet.

Citation Information

Patent Citations

  • Image retrieval method and device based on picture content and electronic equipment

    CN111382298A

  • Picture retrieval method and device and computer equipment

    CN112579812A