A fuzzy calculation method, device and equipment for image similarity and medium
By calculating the similarity coefficient of the image gray value histogram, the problem of image similarity judgment when the gray value peaks are similar but do not overlap in the existing technology is solved, and the accuracy and applicability of image blur comparison are realized.
Patent Information
- Application Number
- CN202311252504.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-09-26
AI Technical Summary
Existing image grayscale similarity algorithms struggle to accurately determine image similarity when grayscale peak values are similar but do not overlap, leading to discrepancies with human judgment results.
The similarity between each gray value in the image and its neighboring gray values is calculated using a gray value histogram. The fuzzy similarity of the image is determined by calculating the first similarity coefficient and the second similarity coefficient.
It enables accurate blur comparison of images with similar but non-overlapping grayscale peak values, meeting the needs of practical applications.
Smart Images

Figure CN117274643B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image similarity degree judgment, and particularly relates to a fuzzy calculation method, device and equipment of image similarity degree and a medium. BACKGROUND
[0002] In the existing image similarity method, the commonly used method is to judge based on the image gray similarity algorithm. The mainstream algorithm of the current image gray similarity mainly uses the Hausdorff coefficient for judgment. When the peak values of the gray values of two images are similar but do not overlap, the Hausdorff coefficient is used for judgment, and it is considered that the image similarity is low, which is different from the result of manual judgment at this time. In actual application, fuzzy comparison is usually required for such pictures.
[0003] Therefore, it is urgent to provide a fuzzy calculation method of image similarity to meet the actual application requirements. SUMMARY
[0004] In order to solve the problems in the prior art, the embodiments of the present application provide a fuzzy calculation method, device, equipment and medium of image similarity, which can realize fuzzy comparison of the similarity of two images with similar but non-overlapping gray value peaks to meet the actual application requirements.
[0005] In a first aspect, the present application provides a fuzzy calculation method of image similarity, which comprises:
[0006] The first image and the second image are respectively converted into gray scale images to obtain a first gray value histogram and a second gray value histogram;
[0007] According to the first gray value histogram and the second gray value histogram, the similarity of each gray value in the first image and the adjacent gray value in the second image is calculated;
[0008] According to the similarity of each gray value in the first image and the adjacent gray value in the second image, a first similarity coefficient of the first image and the second image is calculated;
[0009] According to the first image similarity coefficient, the similarity of the first image and the second image is judged.
[0010] In a second aspect, the present application provides a fuzzy calculation device of image similarity, which comprises:
[0011] The statistical module is configured to convert the first image and the second image into gray scale images respectively to obtain a first gray value histogram and a second gray value histogram;
[0012] The calculation module is configured to calculate the similarity of each gray value in the first image and the adjacent gray value in the second image according to the first gray value histogram and the second gray value histogram;
[0013] an analysis module configured to calculate a first similarity coefficient of the first image and the second image according to a similarity of each gray value in the first image to a neighboring gray value in the second image;
[0014] a judgment module configured to judge the similarity of the first image and the second image according to the first image similarity coefficient.
[0015] In a third aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method of the first aspect.
[0016] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program, when executed in a computer, causes the computer to execute the method of the first aspect.
[0017] The embodiment of the present application provides a fuzzy calculation method, device and equipment of image similarity and a medium. First, the first image and the second image are converted into gray scale images to obtain a first gray value histogram and a second gray value histogram. Then, the similarity of each gray value in the first image to a neighboring gray value in the second image is calculated according to the first gray value histogram and the second gray value histogram. Then, the first image similarity coefficient of the first image and the second image is calculated according to the similarity of each gray value in the first image to a neighboring gray value in the second image. Finally, the similarity of the first image and the second image is judged according to the first image similarity coefficient. The above technical solution of the present application calculates the similarity of each gray value in the first image to a neighboring gray value in the second image to obtain the first image similarity coefficient of the first image and the second image, realizes the fuzzy comparison of the gray similarity of the first image and the second image, and meets the actual application requirement. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0019] Figure 1 is a flow chart of a fuzzy calculation method of image similarity provided by an embodiment of the present application;
[0020] Figure 2 is a hardware architecture diagram of an electronic device provided by an embodiment of the present application;
[0021] Figure 3is a structural diagram of a fuzzy calculation device for image similarity provided by an embodiment of the present application;
[0022] Figure 4 is a set of contrast images provided by an embodiment of the present application;
[0023] Figure 5 is a gray value histogram of a set of contrast images provided by an embodiment of the present application; Figure 4
[0024] Figure 6 is another set of contrast images provided by an embodiment of the present application;
[0025] Figure 7 is a gray value histogram of another set of contrast images provided by an embodiment of the present application; Figure 6 DETAILED DESCRIPTION
[0026] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0027] With reference to Figure 1 The embodiment of the present application provides a fuzzy calculation method for image similarity, which comprises the following steps:
[0028] Step 100: converting the first image and the second image into gray scale images respectively to obtain a first gray value histogram and a second gray value histogram by statistics;
[0029] Step 102: calculating the similarity between each gray value in the first image and the adjacent gray value in the second image according to the first gray value histogram and the second gray value histogram;
[0030] Step 104: calculating a first similarity coefficient of the first image and the second image according to the similarity between each gray value in the first image and the adjacent gray value in the second image;
[0031] Step 106: judging the similarity between the first image and the second image according to the first similarity coefficient of the first image.
[0032] In the embodiment, first, the first image and the second image are converted into gray scale images respectively to obtain a first gray scale value histogram and a second gray scale value histogram; and according to the first gray scale value histogram and the second gray scale value histogram, the similarity of each gray scale value in the first image to the adjacent gray scale value in the second image is calculated; then according to the similarity of each gray scale value in the first image to the adjacent gray scale value in the second image, a first similarity coefficient of the first image and the second image is calculated; finally, according to the first similarity coefficient of the first image, the similarity of the first image and the second image is judged. The above technical scheme of the present application realizes the fuzzy comparison of the gray scale similarity of the first image and the second image by calculating the similarity of each gray scale value in the first image to the adjacent gray scale value in the second image to obtain the first similarity coefficient of the first image and the second image, so as to meet the actual application requirements.
[0033] The following describes Figure 1 The execution manner of each step is shown.
[0034] For step 100:
[0035] The present application respectively performs gray scale processing on the first image and the second image to obtain a first gray scale image and a second gray scale image; and then based on the first gray scale image and the second gray scale image, a first gray scale value histogram and a second gray scale value histogram are respectively obtained. When the first gray scale value histogram and the second gray scale value histogram are obtained, i is taken as the horizontal coordinate and the frequency f(i) of the occurrence of i is taken as the vertical coordinate gray scale, and the formula is: Wherein, p is an array composed of all f(i), that is, all values of the gray scale value histogram.
[0036] For step 102:
[0037] In an embodiment of the present application, step 102 can specifically include:
[0038] According to the first gray scale value histogram and the second gray scale value histogram, a feature vector of the first image and a feature vector of the second image are obtained;
[0039] According to the feature vector of the first image and the feature vector of the second image, the similarity of each gray scale value in the first image to multiple adjacent gray scale values in the second image is calculated.
[0040] In the embodiment, the feature vector of the first image (including the feature vector of each gray scale value in the first image) and the feature vector of the second image (including the feature vector of each gray scale value in the second image) are obtained according to the first gray scale value histogram and the second gray scale value histogram, which provides a basis for subsequently calculating the similarity of each gray scale value in the first image to multiple adjacent gray scale values in the second image by using the similarity formula.
[0041] In one embodiment of the present application, the formula for calculating the similarity is:
[0042]
[0043] In the formula, i is a gray value, i is 1, 2, 3, …, 256; j is the distance between the gray value and the adjacent gray value, j is -9, -8, -7, …, 9; i+j is the adjacent gray value of i, 1≤i+j≤256; p(i) is the feature vector of the first image at i, q(i+j) is the feature vector of the second image at the adjacent gray value of i, and k(i) is the similarity between the first image at i and the adjacent gray value of the second image at i. The adjacent gray value includes the same gray value as i (i.e., when j is 0).
[0044] In actual application, many times the demand for image comparison is to find similar images similar to manual judgment rather than to find two completely consistent images, for example, finding similar products, similar species, similar places, etc. through photographing and recognizing images, which are all fuzzy comparisons of images. However, for some images with certain differences in acquisition conditions, for example, two images taken at different times in the same scene or the same image searched on different websites, the image tone and clarity may be different, thereby causing the gray values of the two images to be inconsistent. The similarity of the two images determined by the Bhattacharya coefficient may be low. Obviously, the Bhattacharya coefficient is not suitable for determining the similarity of images with similar but not identical gray peaks. Therefore, the present application calculates the similarity between each gray value in the first image and multiple adjacent gray values in the second image by using the above similarity formula, realizes fuzzy comparison of the gray similarity between the first image and the second image, and meets the actual application requirements.
[0045] It should be noted that the similarity between each gray value in the second image and multiple adjacent gray values in the first image can also be calculated according to the above formula, and only the related parameters in the first image and the second image in the formula need to be transposed.
[0046] For step 104:
[0047] In one embodiment of the present application, step 104 can specifically include:
[0048] According to the similarity between each gray value in the first image and multiple adjacent gray values in the second image, the maximum similarity is taken as the target similarity between the gray value in the first image and the adjacent gray value in the second image.
[0049] According to the target similarity, a first similarity coefficient of the first image and the second image is calculated.
[0050] In one embodiment of the present application, the formula for calculating the first similarity coefficient is:
[0051] C(p,q) = ∑max[k(i)]di;
[0052] Wherein, C(p,q) is the first similarity coefficient of the first image and the second image, max[k(i)] is the target similarity of the i-th gray value in the first image and the adjacent gray value in the second image.
[0053] In the embodiment, the maximum similarity (target similarity) of the similarity of each gray value in the first image and the adjacent gray value in the second image is summed to obtain the first similarity coefficient of the first image and the second image, so as to realize the fuzzy comparison of the gray similarity of the first image and the second image.
[0054] It should be noted that the second similarity coefficient based on the similarity of each gray value in the second image and the adjacent gray value in the first image can also be calculated according to the above formula, that is, the related parameters of the first image in the formula are replaced by the related parameters of the second image, that is, max[k(i)] takes the target similarity of the i-th gray value in the second image and the adjacent gray value in the first image.
[0055] In the embodiment, the similarity of each gray value in the first image and the adjacent gray value in the second image calculated by the similarity coefficient formula is compared, the maximum similarity is taken as the target similarity of the gray value in the first image and the adjacent gray value in the second image, and then the target similarity corresponding to each gray value in the first image is summed to obtain the first similarity coefficient of the first image and the second image, so as to realize the fuzzy comparison of the similarity of the images with similar but not coincident gray value peaks and meet the needs of practical application.
[0056] For step 106:
[0057] According to the calculated first similarity coefficient of the first image and the second image, the similarity of the first image and the second image is judged; the closer the value of the first similarity coefficient is to 1, the more similar the two images are; the closer to 0, the more dissimilar the two images are.
[0058] In an embodiment of the present application, the fuzzy calculation method of image similarity further comprises:
[0059] According to the first gray value histogram and the second gray value histogram, the similarity of each gray value in the second image and the adjacent gray value in the first image is calculated;
[0060] According to the similarity of each gray value in the second image and the adjacent gray value in the first image, the second similarity coefficient of the first image and the second image is calculated;
[0061] Based on the first similarity coefficient and the second similarity coefficient, the final similarity coefficient of the first image and the second image is determined to judge the similarity between the first image and the second image.
[0062] In one embodiment of the present invention, the step of "determining the final similarity coefficient of the first image and the second image based on the first similarity coefficient and the second similarity coefficient, so as to determine the similarity between the first image and the second image" includes:
[0063] Determine whether the second similarity coefficient is greater than the first similarity coefficient;
[0064] If so, the second similarity coefficient will be used as the final similarity coefficient;
[0065] If not, the first similarity coefficient will be used as the final similarity coefficient.
[0066] Because using the aforementioned similarity formula, calculating the similarity between each gray value in the first image and multiple neighboring gray values in the second image, and vice versa, may lead to inconsistent calculation results, resulting in different similarity coefficients for the first and second images. Therefore, this invention, after obtaining a first similarity coefficient for the first and second images based on the similarity between "each gray value in the first image and multiple neighboring gray values in the second image," then obtains a second similarity coefficient based on the similarity between "each gray value in the second image and multiple neighboring gray values in the first image." The first and second similarity coefficients are then compared, and the larger value is used as the final similarity coefficient to determine the similarity between the first and second images, thereby further improving the accuracy of the determination. It should be noted that the calculation methods for the first and second similarity coefficients are the same.
[0067] Furthermore, this invention selects two sets of comparison images and uses the Bach coefficient and the similarity coefficient of this invention to perform similarity comparisons respectively; the first set of comparison images ( Figure 4 The grayscale histogram is as follows: Figure 5 As shown, it should be noted that Figure 5 HD41 is Figure 4 The grayscale histogram of the middle left image, hd42 is Figure 4 The grayscale histogram in the middle right image; Figure 7 HD61 is Figure 6 The grayscale histogram of the middle left image, hd62 is Figure 6 The grayscale histogram in the middle right image; Figure 5 and Figure 7 In the graph, the horizontal axis i represents the grayscale value, and f(i) represents the frequency of i. The formula for calculating the Bartholomew's coefficient mentioned in this invention is as follows: Where p(i) and q(i) are the feature vectors of two images at point i in a set of comparison images.
[0068] Based on the grayscale histogram, the similarity of the first set of comparison images calculated using the Bach coefficient formula is 72.1%. Using the similarity coefficient calculation formula of this invention, the similarity of the first set of comparison images is 84.2%, which is a comparison closer to real-world applications; the second set of comparison images ( Figure 6 The grayscale histogram is as follows: Figure 7 As shown, based on the grayscale histogram, the similarity of the second set of comparison images calculated using the Bach coefficient formula is 0%. However, using the similarity coefficient calculation formula of this invention, the similarity of the second set of comparison images is 99%, which represents an extreme application scenario. From the above results, it can be seen that the calculation method of this invention can achieve fuzzy comparison of image grayscale similarity, meeting the needs of real-life scenarios for fuzzy comparison of images with similar but non-overlapping grayscale peak values.
[0069] like Figure 2 , Figure 3 As shown, this embodiment of the invention provides a fuzzy calculation device for image similarity. The device embodiment can be implemented in software, hardware, or a combination of both. From a hardware perspective, as... Figure 2 The diagram shown is a hardware architecture diagram of an electronic device for calculating image similarity according to an embodiment of the present invention. (Except for...) Figure 2 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing packets. Taking software implementation as an example, such as... Figure 3 As shown, a device in a logical sense is formed by the CPU of the electronic device in which it is located reading the corresponding computer program from the non-volatile memory into the memory for execution.
[0070] like Figure 3 As shown, the present invention provides a fuzzy calculation device for image similarity, comprising:
[0071] The statistics module 300 converts the first image and the second image into grayscale images respectively, so as to obtain the first grayscale value histogram and the second grayscale value histogram.
[0072] The calculation module 302 calculates the similarity between each gray value in the first image and its neighboring gray values in the second image based on the first gray value histogram and the second gray value histogram.
[0073] The analysis module 304 calculates a first similarity coefficient of the first image and the second image according to the similarity of each gray value in the first image and the adjacent gray value in the second image.
[0074] The judgment module 306 judges the similarity of the first image and the second image according to the first image similarity coefficient.
[0075] In the embodiments of the present specification, the statistical module 300 can be used to execute step 100 in the above-mentioned method embodiments, the calculation module 302 can be used to execute step 102 in the above-mentioned method embodiments, the analysis module 304 can be used to execute step 104 in the above-mentioned method embodiments, and the judgment module 306 can be used to execute step 106 in the above-mentioned method embodiments.
[0076] In one embodiment of the present application, the calculation module 302 is configured to perform the following operations:
[0077] According to the first gray value histogram and the second gray value histogram, a feature vector of the first image and a feature vector of the second image are obtained.
[0078] According to the feature vector of the first image and the feature vector of the second image, the similarity of each gray value in the first image and multiple adjacent gray values in the second image is calculated respectively.
[0079] In one embodiment of the present application, the formula for calculating the similarity is as follows:
[0080]
[0081] In the formula, i is a gray value, i is 1, 2, 3, …, 256; j is the distance between the gray value and the adjacent gray value, j is -9, -8, -7, …, 9; i+j is the adjacent gray value of i, 1≤i+j≤256; p(i) is the feature vector of the first image at i; q(i+j) is the feature vector of the second image at the adjacent gray value of i; and k(i) is the similarity of the first image at i and the adjacent gray value of the second image at i.
[0082] In one embodiment of the present application, the analysis module 304 is configured to perform the following operations:
[0083] According to the similarity of each gray value in the first image and multiple adjacent gray values in the second image, the maximum similarity is taken as the target similarity of the gray value in the first image and the adjacent gray value in the second image.
[0084] According to the target similarity, a first similarity coefficient of the first image and the second image is calculated.
[0085] In one embodiment of the present application, the formula for calculating the first similarity coefficient is:
[0086] C(p,q) = ∫max[k(i)] di;
[0087] where C(p,q) is the first similarity coefficient of the first image and the second image, and max[k(i)] is the target similarity of the i-th gray value in the first image and the adjacent gray value in the second image.
[0088] In one embodiment of the present application, the calculating module 302 is further configured to perform the following operations:
[0089] calculating the similarity of each gray value in the second image and the adjacent gray value in the first image according to the first gray value histogram and the second gray value histogram;
[0090] The analyzing module 304 is further configured to perform the following operations:
[0091] calculating the second similarity coefficient of the first image and the second image according to the similarity of each gray value in the second image and the adjacent gray value in the first image;
[0092] The judging module 306 is further configured to perform the following operations:
[0093] determining the final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient, so as to judge the similarity of the first image and the second image.
[0094] In one embodiment of the present application, the judging module 306, when performing the step of "determining the final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient, so as to judge the similarity of the first image and the second image", is configured to perform the following operations:
[0095] judging whether the second similarity coefficient is greater than the first similarity coefficient;
[0096] if yes, taking the second similarity coefficient as the final similarity coefficient, so as to judge the similarity of the first image and the second image;
[0097] if no, taking the first similarity coefficient as the final similarity coefficient, so as to judge the similarity of the first image and the second image.
[0098] It can be understood that the structural schematic of the embodiments of the present application does not constitute a specific limitation on the image similarity fuzzy calculation device. In other embodiments of the present application, the image similarity fuzzy calculation device can include more or fewer components than the schematic, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0099] The information interaction, execution process, and the like between the modules in the device are based on the same concept as the method embodiments of the present application, and specific content can be referred to the description in the method embodiments of the present application, which will not be described here.
[0100] The embodiments of the present application also provide an electronic device including a memory and a processor, the memory stores a computer program, and the processor implements the image similarity fuzzy calculation method in any of the embodiments of the present application when executing the computer program.
[0101] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program makes the processor execute the image similarity fuzzy calculation method in any of the embodiments of the present application when the processor executes the computer program.
[0102] Specifically, a system or device equipped with a storage medium can be provided, and the storage medium stores a software program code for implementing the functions of any of the above embodiments, and the computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0103] In this case, the program code read from the storage medium itself can implement the functions of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute a part of the present application.
[0104] The storage medium for providing the program code includes a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0105] In addition, it should be clear that not only the program code read by the computer can be executed, but also part or all of the actual operations can be completed by the operating system and the like operating on the computer based on the instructions of the program code, so as to implement the functions of any of the above embodiments.
[0106] Further, it is understood that the programs while being read by the storage media are written into the memory provided in the extension board inserted into the computer or the memory provided in the extension module connected to the computer, and then the CPU or the like mounted on the extension board or the extension module is caused to perform part or all of the actual operations based on the instructions of the program codes, thereby realizing the functions of any of the above-described embodiments.
[0107] It is noted that the terms such as first and second are used herein only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Also, the terms "comprising", "containing" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also other elements not expressly listed or other elements inherent in such process, method, article or apparatus. Without more limitations, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0108] It is understood by those skilled in the art that all or part of the steps of the above-described method embodiments can be completed by program instruction related hardware, and the aforementioned program can be stored in a computer readable storage medium, and the program performs the steps including the above-described method embodiments when executed; and the aforementioned storage medium includes ROM, RAM, magnetic disc or optical disc and various program code storage media.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit it; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of fuzzy calculation of image similarity, characterized in that, The method comprises: respectively converting the first image and the second image into gray-scale images to obtain a first gray-scale value histogram and a second gray-scale value histogram; calculating the similarity of each gray-scale value in the first image to the adjacent gray-scale value in the second image according to the first gray-scale value histogram and the second gray-scale value histogram; calculating a first similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the first image to the adjacent gray-scale value in the second image; judging the similarity of the first image and the second image according to the first similarity coefficient. The method further comprises: calculating the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image according to the first gray-scale value histogram and the second gray-scale value histogram; calculating a second similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image; determining a final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient to judge the similarity of the first image and the second image. ; The method further comprises: calculating the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image according to the first gray-scale value histogram and the second gray-scale value histogram; calculating a second similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image; determining a final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient to judge the similarity of the first image and the second image. The method further comprises: ; calculating the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image according to the first gray-scale value histogram and the second gray-scale value histogram; 2. The method of claim 1, wherein, calculating a second similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image; determining a final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient to judge the similarity of the first image and the second image. The method further comprises: calculating the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image according to the first gray-scale value histogram and the second gray-scale value histogram; calculating a second similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image; determining a final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient to judge the similarity of the first image and the second image. The method further comprises: calculating the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image according to the first gray-scale value histogram and the second gray-scale value histogram; calculating a second similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image; determining a final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient to judge the similarity of the first image and the second image. The method further comprises: calculating the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image according to the first gray-scale value histogram and the second gray-scale value histogram; calculating a second similarity coefficient of the first image and the second image according to the similarity of each gray-scale value in the second image to the adjacent gray-scale value in the first image; determining a final similarity coefficient of the first image and the second image according to the first similarity coefficient and the second similarity coefficient to judge the similarity of the first image and the second image.
3. The method of claim 2, wherein, According to the first similarity coefficient and the second similarity coefficient, a final similarity coefficient of the first image and the second image is determined to judge the similarity of the first image and the second image, comprising: judging whether the second similarity coefficient is greater than the first similarity coefficient; if yes, taking the second similarity coefficient as the final similarity coefficient to judge the similarity of the first image and the second image; if no, taking the first similarity coefficient as the final similarity coefficient to judge the similarity of the first image and the second image.
4. An apparatus for fuzzy computing of image similarity, characterized by, Applied to the method of any one of claims 1-3, comprising: a statistical module for converting the first image and the second image into gray scale images respectively to obtain a first gray value histogram and a second gray value histogram; a calculation module for calculating the similarity of each gray value in the first image and the adjacent gray value in the second image according to the first gray value histogram and the second gray value histogram; an analysis module for calculating a first similarity coefficient of the first image and the second image according to the similarity of each gray value in the first image and the adjacent gray value in the second image; a judgment module for judging the similarity of the first image and the second image according to the first similarity coefficient.
5. An electronic device, comprising: comprising a memory and a processor, the memory storing a computer program, and the processor executing the computer program to realize the method of any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, a computer program is stored thereon, and when the computer program is executed in a computer, the computer executes the method of any one of claims 1-3.
Citation Information
Patent Citations
Image processing device and method for determining a similarity between two images
US20140169672A1
Image matching method and apparatus, computer device, and storage medium
WO2019237520A1