Image size comparison method and device, equipment and storage medium

Through the combination of SIFT feature points and K-neighbor algorithm, the problems of low image size comparison efficiency and insufficient accuracy in the existing technology are solved, and efficient and accurate image size comparison and intuitive result presentation are achieved, which is suitable for image scaling and rotation. and radiation transformation.

CN118608591APending Publication Date: 2024-09-06WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410829660.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Image size comparison methods in the prior art are inefficient and inaccurate, and cannot efficiently and accurately compare image sizes and intuitively display the comparison results.

Method used

Use SIFT feature point extraction and K-neighbor algorithm to match image feature points, generate descriptors and filter stable matching pairs through preset thresholds, calculate image similarity, combine with homography matrix for perspective transformation and splicing, and generate image size comparison results .

Benefits of technology

It improves the accuracy and efficiency of image size comparison, can present the comparison results intuitively, has high stability and robustness, and is suitable for image scaling, rotation and radiation transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608591A
    Figure CN118608591A
Patent Text Reader

Abstract

The invention provides an image size comparison method and device, equipment and a storage medium, and belongs to the field of image processing, and the method comprises the steps: extracting SIFT feature points of an original image, generating a first descriptor, extracting SIFT feature points of a to-be-compared image, and generating a second descriptor; based on a K-proximity algorithm, performing proximity matching on the first descriptor and the second descriptor to generate a plurality of proximity matching pairs, and based on a preset matching threshold, screening out stable matching pairs from the plurality of proximity matching pairs; and calculating the similarity between the original image and the to-be-compared image according to the stable matching pair, and generating an image size comparison result. According to the method, the similarity is calculated by performing proximity matching on the SIFT feature point descriptors through the K proximity algorithm, the accuracy of the calculation result is high, and the calculation efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer image processing, and in particular to an image size comparison method, device, equipment and storage medium. Background Art

[0002] With the rapid development of image processing technology, image recognition and processing have reached the pixel level. Currently, through the high integration of image processing technology and deep learning, image information in industry can be extracted and identified to a greater extent and restored or repaired. For the restored or repaired images, it is necessary to accurately verify their degree of restoration or repair. At the same time, in each neighborhood, it is also involved to compare the sizes of two similar pictures. Therefore, the accuracy and ease of operation of image comparison are increasingly required.

[0003] In the prior art, image size comparison is mainly performed by pairing scattered points of the image and calculating the distance similarity and grayscale similarity of the scattered points. This comparison method produces inaccurate comparison results, has a large amount of calculation and is inefficient.

[0004] Therefore, in order to improve the efficiency and accuracy of image size comparison, there is an urgent need for an image size comparison method that can compare image sizes efficiently and accurately and can intuitively display the comparison results. Summary of the invention

[0005] In view of this, it is necessary to provide an image size comparison method, device, equipment and storage medium to solve the technical problems in the prior art caused by low efficiency and low accuracy of image size comparison.

[0006] In order to solve the above problems, in a first aspect, the present invention provides an image size comparison method, comprising: Extracting SIFT feature points of the original image and generating a first descriptor, extracting SIFT feature points of the image to be compared and generating a second descriptor; Based on the K-nearest neighbor algorithm, the first descriptor and the second descriptor are neighbor matched to generate a plurality of neighbor matching pairs, and a stable matching pair is selected from the plurality of neighbor matching pairs based on a preset matching threshold; The similarity between the original image and the image to be compared is calculated based on the stable matching pair, and an image size comparison result is generated.

[0007] In a possible implementation manner, before extracting the SIFT feature points of the original image, the method further includes: Obtaining an original image and an image to be compared; The original image and the image to be compared are preprocessed.

[0008] In a possible implementation, preprocessing the original image and the image to be compared includes: Cutting the original image and the image to be compared into original images and images to be compared of equal size; Gray-scale the original image of the same size; The images to be compared with the same size are grayed out.

[0009] In a possible implementation, extracting SIFT feature points of the original image to generate a first descriptor, and extracting SIFT feature points of the image to be compared to generate a second descriptor include: Extract SIFT feature points of the original image based on the SIFT algorithm, and calculate and generate the first descriptor according to the SIFT feature points of the original image; The SIFT feature points of the image to be compared are extracted based on the SIFT algorithm, and the second descriptor is generated by calculation according to the SIFT feature points of the image to be compared.

[0010] In a possible implementation, based on the K-nearest neighbor algorithm, the first descriptor is neighbor-matched with the second descriptor to generate multiple neighbor-matching pairs, including: Matching the first descriptor with the second descriptor according to a linear brute force algorithm to generate a descriptor matching pair; Based on the K-nearest neighbor algorithm and according to the descriptor matching pair, multiple neighbor matching is performed again on the second descriptor matched with the first descriptor to generate multiple neighbor matching pairs.

[0011] In a possible implementation, based on a preset matching threshold, a stable matching pair is selected from a plurality of adjacent matching pairs, including: Calculate the distance between the first descriptor and the second descriptor in multiple adjacent matching pairs, and sort the multiple adjacent matching pairs from the shortest distance to the longest distance; Set the matching threshold, filter the adjacent matching pairs whose distance is less than the matching threshold, and generate stable matching pairs.

[0012] In a possible implementation, calculating the similarity between the original image and the image to be compared according to the stable matching pair includes: Counting the number of the stable matching pairs to generate a first value; Counting the number of the first descriptors to generate a second value, counting the number of the second descriptors to generate a third value, comparing the second value and the third value, and taking the maximum value to generate a fourth value; The ratio of the first value to the fourth value is calculated to generate the similarity between the original image and the image to be compared.

[0013] In a possible implementation, generating the image size comparison result includes: Generate corresponding original image feature point coordinates and to-be-compared image feature point coordinates in a stable matching pair according to the first descriptor and the second descriptor; Calculate the homography matrix according to the coordinates of the feature points of the original image and the feature points of the image to be compared, perform perspective transformation according to the homography matrix, and generate the original image to be stitched and the image to be stitched and compared; The original image to be stitched and the image to be stitched for comparison are stitched together to generate an image size comparison result.

[0014] In a second aspect, the present invention further provides an image size comparison device, comprising: A feature extraction module, used to extract SIFT feature points of the original image and generate a first descriptor, extract SIFT feature points of the image to be compared and generate a second descriptor; A comparison module, for performing proximity matching between the first descriptor and the second descriptor based on a K-nearest neighbor algorithm, generating a plurality of proximity matching pairs, and selecting a stable matching pair from the plurality of proximity matching pairs based on a preset matching threshold; The comparison result generating module is used to calculate the similarity between the original image and the image to be compared according to the stable matching pair, and generate an image size comparison result.

[0015] In a third aspect, the present invention also provides an electronic device, comprising a memory and a processor, wherein the memory is used to store programs and data; the processor is coupled to the memory and is used to execute the program stored in the memory to implement the image size comparison method as described above.

[0016] In a fourth aspect, the present invention further provides a computer storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the image size comparison method as described above.

[0017] The beneficial effects of the present invention include: first, the present invention extracts SIFT feature points of the original image and the image to be compared, and calculates SIFT descriptors based on the SIFT feature points. The SIFT feature points are invariant to the scaling, rotation and radiation transformation of the image, and can determine the key points of the image, and can fully reflect the characteristics of the image. The position, scale and direction of the key points of the image are determined based on the SIFT feature points, and the descriptors of the SIFT feature points are calculated to form a high-dimensional feature vector. The descriptors of the SIFT feature points contain the structural information of the image around the key points, and at the same time are invariant to scale, rotation and radiation transformation to a certain extent, and the descriptors have extremely high stability and accuracy in reflecting the image characteristics; then, based on The K-nearest neighbor algorithm matches the descriptor of the original image with the descriptor of the image to be compared, and selects stable matching pairs. The K-nearest neighbor algorithm can effectively match a large number of feature point descriptors and has good robustness. At the same time, the descriptor pairs matched by the K-nearest neighbor algorithm are further screened and the optimal matching pair is selected, which can further improve the accuracy of size comparison. Finally, the similarity between the original image and the image to be compared is calculated through the optimal descriptor matching pair obtained in the previous step, and the size comparison result is intuitively presented. This method uses the K-nearest neighbor algorithm to perform neighborhood matching on the image SITG descriptors, determine the optimal matching pair, and calculate the image similarity based on the optimal matching pair with extremely high accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A schematic diagram of an embodiment of a flow chart of an image size comparison method provided by the present invention; Figure 2 For the present invention Figure 1 A schematic flow chart of an embodiment of S101; Figure 3 For the present invention Figure 1 A schematic diagram of a flow chart of an embodiment of a part of S103; Figure 4 For the present invention Figure 3 A schematic diagram of a flow chart of an embodiment of a part of S104; Figure 5 For the present invention Figure 1 A schematic flow chart of an embodiment of S104; Figure 6A schematic diagram of the structure of an embodiment of an image size comparison device provided by the present invention; Figure 7 A schematic diagram of a scene of an embodiment of an image size comparison method application device provided by the present invention; Figure 8 A structural block diagram of an embodiment of an image size comparison device provided by the present invention; Fig. 9 This is a comparison result diagram of the frame number restoration image and the original image provided by the present invention. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0021] It should be understood that the schematic drawings are not drawn to scale. The flowchart used in the present invention shows the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present invention, and can also remove one or more operations from the flowchart. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0022] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0023] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0024] Before describing the embodiments, the following definitions are given for the relevant terms: SIFT (Scale-Invariant Feature Transform) is a computer vision algorithm used to detect and describe local features in images.

[0025] K-Nearest Neighbor (KNN) is a classification algorithm. The idea of ​​this method is: in the feature space, if most of the k nearest samples (i.e. the closest samples in the feature space) near a sample belong to a certain category, then the sample also belongs to this category.

[0026] The present invention provides an image size comparison method, device, equipment and storage medium, which are described in detail below.

[0027] The embodiment of the present invention provides an image size comparison method, and its flow chart is as follows: Figure 1 As shown, the image size comparison method includes: S101, extracting SIFT feature points of the original image and generating a first descriptor, extracting SIFT feature points of the image to be compared and generating a second descriptor; S102, performing proximity matching on the first descriptor and the second descriptor based on a K-nearest neighbor algorithm to generate a plurality of proximity matching pairs, and selecting a stable matching pair from the plurality of proximity matching pairs based on a preset matching threshold; S103: Calculate the similarity between the original image and the image to be compared based on the stable matching pair, and generate an image size comparison result.

[0028] It should be noted that the SIFT algorithm is used to extract SIFT feature points from images and generate descriptors. First, the SIFT object is created using the opencv built-in library, and then the grayscale image is loaded to detect the SIFT feature points in the image. Feature points are usually key points with significant features in the image, and these feature points are drawn according to the SIFT object; then, the image information around the feature points and the SIFT feature points are used to calculate and generate the descriptor of the SIFT feature points. The descriptor is a feature vector used to describe the feature points and the surrounding images.

[0029] It should be further explained that the K-nearest neighbor algorithm can effectively match a large number of feature point descriptors with good robustness. At the same time, further screening of the descriptor pairs matched by the K-nearest neighbor algorithm and selecting the best matching pair can further improve the accuracy of size comparison.

[0030] Compared with the prior art, the image size comparison method provided in this embodiment firstly extracts SIFT feature points of the original image and the image to be compared, calculates the descriptor of the SIFT feature points of the original image to generate a first descriptor, calculates the descriptor of the SIFT feature points of the image to be compared to generate a second descriptor; then, based on the K-neighbor algorithm, performs neighborhood matching on the first descriptor and the second descriptor to generate multiple neighborhood matching pairs; based on a preset matching threshold, a stable matching pair is screened out from the multiple neighborhood matching pairs; finally, based on the stable matching pairs, the similarity of the original image and the image to be compared is calculated to generate an image size comparison result. The present invention uses the descriptors of the SIFT feature points of the image, performs neighborhood matching on the feature point descriptors based on the K-nearest neighbor algorithm, selects the best matching pair from the matching pairs again, and then calculates the similarity between the original image and the image to be compared, and intuitively presents the size comparison result. The descriptors of the SIFT feature points of the image contain the structural information of the image around the key points, and at the same time are invariant to scale, rotation and radiation transformations to a certain extent. The descriptors have extremely high stability and accuracy in reflecting image features. The K-nearest neighbor matching algorithm can quickly and accurately match the descriptors, and calculates the similarity between the original image and the image to be compared based on the matching pairs, thereby improving the efficiency of the calculation and the accuracy of the calculation results.

[0031] The embodiment of the present invention uses the descriptor of the SIFT feature point of the image to perform proximity matching on the feature point descriptors based on the K-nearest neighbor algorithm, selects the best matching pair, and then calculates the similarity between the original image and the image to be compared, and intuitively presents the size comparison result, with high calculation efficiency and high accuracy of the settlement result.

[0032] In some embodiments of the present invention, before extracting SIFT feature points of the original image, the method further includes: Obtaining an original image and an image to be compared; Preprocess the original image and the image to be compared.

[0033] In some embodiments of the present invention, preprocessing the original image and the image to be compared includes: Cutting the original image and the image to be compared into original images and images to be compared of the same size; Grayscale the original image of the same size; Grayscale the images to be compared with the same size.

[0034] In this embodiment, the original image and the image to be compared are first cut into images of equal size, and then the two images of equal size are grayed out, so that the image size can be reduced, which makes it easier to compare compared to color images and can improve the efficiency of image comparison.

[0035] In some embodiments of the present invention, Figure 2 As shown, Figure 2 The present invention provides Figure 1 The schematic flow chart of a part of the implementation of step S103 includes: S201, matching the first descriptor with the second descriptor according to a linear brute force algorithm to generate a descriptor matching pair; S202 . Based on the K-nearest neighbor algorithm and according to the descriptor matching pairs, multiple neighbor matching is performed again on the second descriptor matched with the first descriptor to generate multiple neighbor matching pairs.

[0036] Specifically, the feature points and descriptors of the two images are first stored in two sets respectively. According to the linear brute force algorithm, the descriptor sets are traversed to quickly locate the feature point descriptors that match the two sets, and a new descriptor matching pair set is generated. According to the descriptor matching pairs, the K-nearest neighbor algorithm is used to perform multiple neighbor matching on the matched descriptor matching pairs again.

[0037] It should be noted that the FLANN algorithm in the opencv library is used to perform linear brute force fast matching on feature descriptors; the FlannBasedMatcher function is called to perform k-nearest neighbor matching between SIFT descriptors to obtain a matching list, each list contains at least one matching item and no more than k matching items, because the perspective transformation of the image needs to contain four or more corner feature information, so K is set to 4 here.

[0038] The embodiment of the present invention first quickly locates and matches the feature points and their descriptors of the two images according to a linear brute force algorithm to generate a descriptor matching pair, and then uses a K-nearest neighbor algorithm to perform multiple neighbor matching on the matched descriptor matching pairs based on the descriptor matching pairs. First, the linear brute force algorithm is used to quickly locate and match, and then k-nearest neighbor matching is performed, which saves the calculation process of k-nearest neighbor matching and greatly improves the calculation efficiency.

[0039] In some embodiments of the present invention, Figure 3 As shown, Figure 3 The present invention provides Figure 1 The flowchart of the embodiment of a part of step S103 includes: S301, calculating the distance between the first descriptor and the second descriptor in multiple adjacent matching pairs, and sorting the multiple adjacent matching pairs from the shortest distance to the longest distance; S302: Set a matching threshold, filter adjacent matching pairs whose distance is less than the matching threshold, and generate stable matching pairs.

[0040] It should be noted that, according to K-nearest neighbor matching, multiple pairs of neighboring matching pairs of descriptors are obtained, and the number of matching pairs does not exceed the K value. Then, the Euclidean distances of the multiple pairs of neighboring matching pairs are calculated, and they are sorted from short to long according to the Euclidean distances, and the matching pairs whose distances are less than the matching threshold are screened out. The Euclidean distance is the true distance between two points in the multidimensional space. The smaller the Euclidean distance, the closer the positions of the two descriptors in the multidimensional space, the more similar the features and attributes, that is, the higher the similarity.

[0041] The embodiment of the present invention further screens the descriptor pairs matched by the K-nearest neighbor algorithm and selects the matching pairs with the best matching degree, thereby further improving the accuracy of the size comparison.

[0042] In some embodiments of the present invention, Figure 4 As shown, Figure 4 The present invention provides Figure 1 The schematic flow chart of an embodiment of step S104 includes: S401, counting the number of stable matching pairs to generate a first value; S402, counting the number of first descriptors to generate a second value, counting the number of second descriptors to generate a third value, comparing the second value and the third value, and taking the maximum value to generate a fourth value; S403: Calculate the ratio of the first value to the fourth value to generate the similarity between the original image and the image to be compared.

[0043] In order to better illustrate the present embodiment, an example is given here. For example, the original image has 100 SIFT feature point descriptors, and the image to be compared has 105 feature point descriptors. Based on the K-nearest neighbor algorithm, 103 matching pairs are matched, and 90 stable matching pairs are screened out through the matching threshold. Then the first value is the number of stable matching pairs, 90, the second value is 100, and the third value is 105. The third value>the second value, then the fourth value is equal to the third value, which is 105. The similarity between the original image and the image to be compared is ,in is the similarity. When the similarity is equal to 1, it means that the size of the original image and the image to be compared are exactly the same.

[0044] In some embodiments of the present invention, Figure 5 As shown, Figure 5 The present invention provides Figure 1 The schematic flow chart of an embodiment of step S104 includes: S501, generating corresponding original image feature point coordinates and to-be-compared image feature point coordinates in a stable matching pair according to a first descriptor and a second descriptor; S502, calculating a homography matrix according to the coordinates of feature points of the original image and the coordinates of feature points of the image to be compared, performing perspective transformation according to the homography matrix, and generating an original image to be spliced ​​and an image to be spliced ​​and compared; S503: stitching the original image to be stitched and the image to be stitched for comparison to generate an image size comparison result.

[0045] It should be noted that the homography matrix is ​​used to describe the mapping relationship between two planes.

[0046] It should be further explained that perspective transformation is a transformation that utilizes the collinearity of the perspective center, the image point, and the target point to rotate the image to a certain angle according to perspective rotation, while keeping the two image graphics unchanged.

[0047] Specifically, the feature point descriptor is the feature vector of the feature point. The feature point contains the position, scale and direction of the key point of the image. The coordinate information of the feature point can be easily obtained based on the descriptor of the feature point. Based on the coordinate information, the mapping relationship between the coordinates of the feature points of the original image and the image to be compared is determined, and the homography matrix is ​​calculated to realize the perspective transformation.

[0048] The embodiment of the present invention calculates the homography matrix of the original image and the image to be compared through the coordinate information of the feature point descriptor, performs perspective transformation according to the homography matrix, and splices the images after the perspective transformation to intuitively present the comparison result.

[0049] In order to better implement the image size comparison method in the embodiment of the present invention, based on the image size comparison method, correspondingly, Figure 6 As shown, the embodiment of the present invention further provides an image size comparison device, and the image size comparison device 600 includes: The feature extraction module 601 is used to extract SIFT feature points of the original image and generate a first descriptor, extract SIFT feature points of the image to be compared and generate a second descriptor; A comparison module 602 is used to perform proximity matching on the first descriptor and the second descriptor based on a K-nearest neighbor algorithm to generate a plurality of proximity matching pairs, and to select a stable matching pair from the plurality of proximity matching pairs based on a preset matching threshold; The comparison result generation module 603 is used to calculate the similarity between the original image and the image to be compared based on the stable matching pair, and generate an image size comparison result.

[0050] The image size comparison device 600 provided in the above embodiment can implement the technical solution described in the above image size comparison method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above image size comparison method embodiment, which will not be repeated here.

[0051] The embodiment of the present invention provides a device for comparing image sizes. Figure 7 A schematic diagram of a scene of an embodiment of an application device of the image size comparison method provided by the present invention, the device comprising: Client 701 is used for the user to input the image to be compared and the original image; Server 702 is used to receive the input image from the client, perform K-nearest neighbor matching based on the feature point descriptors of the image, screen out the best matching pair, calculate the similarity between the original image and the image to be compared based on the best matching pair, and perform homography matrix calculation on the original image and the image to be compared to realize perspective transformation and generate a comparison result.

[0052] Specifically, first, the user provides the original image and the image to be compared restored by image technology on the client; then, the server receives the original image and the image to be compared, and performs cropping and grayscale processing on the original image and the image to be compared; then, the SIFT feature points of the original image and the image to be compared are extracted according to the SIFT algorithm, and the descriptors of the SIFT feature points are calculated; then, the descriptors of the SIFT feature points of the original image and the image to be compared are matched according to the linear brute force algorithm and the K-nearest neighbor algorithm, and then the best matching pair is selected, and the similarity of the original image and the image to be compared is calculated according to the best matching pair, and the homography matrix of the original image and the image to be compared is calculated to realize perspective transformation and generate the comparison result. The whole size comparison process has high calculation efficiency and high calculation result accuracy.

[0053] like Fig. 9 As shown, Fig. 9 This is a comparison result diagram of the frame number restoration image and the original image provided by the present invention. The left side of the operation page is the image upload area, and the right side of the operation page is a comparison splicing diagram of the original image and the frame number image restored by image technology. The similarity between the original image and the frame number image restored by image technology is displayed at the bottom of the operation page, and the image size comparison result is intuitively displayed on the operation page.

[0054] It should be understood that the client 701 used in the embodiment of the present invention can be a device that includes both receiving and transmitting hardware, that is, a device with receiving and transmitting hardware that can perform two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device with a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific client 701 can be a desktop computer, a portable computer, a network server, a PDA (Personal Digital Assistant), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, etc. This embodiment does not limit the type of the client 701.

[0055] In the embodiment of the present invention, the server 702 may be an independent server, or a server network or server cluster composed of servers. For example, the server 702 described in the embodiment of the present invention includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0056] Those skilled in the art will understand that Figure 7 The application environment shown in the figure is only one application scenario of the solution of the present invention and does not constitute a limitation on the application scenario of the solution of the present invention. Other application environments may also include Figure 7 More or fewer clients as shown in , e.g. Figure 7 Only one client is shown in the figure. It can be understood that the application device of the image size comparison method can also include one or more other clients, which are not specifically limited here.

[0057] It should be noted that Figure 7 The scenario diagram of the application device of the image size comparison method shown is only an example. The application device and scenario of the image size comparison method described in the embodiment of the present invention are intended to more clearly illustrate the technical solution of the embodiment of the present invention, and do not constitute a limitation on the technical solution provided by the embodiment of the present invention. Ordinary technicians in this field can know that with the evolution of the application device of the image size comparison method and the emergence of new business scenarios, the technical solution provided by the embodiment of the present invention is also applicable to similar technical problems.

[0058] The present invention also provides an image size comparison device accordingly, such as Figure 8 As shown, Figure 8 This is a structural block diagram of an embodiment of an image size comparison device provided by the present invention. The gene sequence comparison device 800 can be a computing device such as a mobile terminal, a desktop computer, a notebook, a palm computer, and a server. The image size comparison device 800 includes a processor 801 and a memory 802, wherein the memory 802 stores an image size comparison program 803.

[0059] In some embodiments, the memory 802 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 802 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory 802 may also include both an internal storage unit of the computer device and an external storage device. The memory 802 is used to store application software and various types of data installed in the computer device, such as program codes installed in the computer device. The memory 802 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the image size comparison program 803 may be executed by the processor 801, thereby realizing the image size comparison method, device, equipment and storage medium of each embodiment of the present invention.

[0060] In some embodiments, the processor 801 may be a central processing unit (CPU), a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 802, such as executing an image size comparison program.

[0061] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0062] The image size comparison method, device, equipment and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An image size comparison method, characterized in that: include: Extract SIFT feature points of the original image and generate a first descriptor, extract SIFT feature points of the image to be compared and generate a second descriptor; Based on the K-nearest neighbor algorithm, the first descriptor and the second descriptor are neighbor matched to generate a plurality of neighbor matching pairs, and a stable matching pair is selected from the plurality of neighbor matching pairs based on a preset matching threshold; The similarity between the original image and the image to be compared is calculated based on the stable matching pair, and an image size comparison result is generated.

2. The image size comparison method according to claim 1, characterized in that: Before extracting the SIFT feature points of the original image, the method further includes: Obtaining the original image and the image to be compared; The original image and the image to be compared are preprocessed.

3. The image size comparison method according to claim 1, characterized in that: Preprocessing the original image and the image to be compared includes: Cutting the original image and the image to be compared into original images and images to be compared of equal size; Gray-scale the original image of the same size; The images to be compared with the same size are grayed out.

4. The image size comparison method according to claim 2, characterized in that: Based on the K-nearest neighbor algorithm, the first descriptor is matched with the second descriptor to generate multiple neighbor matching pairs, including: Matching the first descriptor with the second descriptor according to a linear brute force algorithm to generate a descriptor matching pair; Based on the K-nearest neighbor algorithm and according to the descriptor matching pair, multiple neighbor matching is performed again on the second descriptor matched with the first descriptor to generate multiple neighbor matching pairs.

5. The image size comparison method according to claim 3, characterized in that: Based on the preset matching threshold, stable matching pairs are selected from multiple adjacent matching pairs, including: Calculate the distance between the first descriptor and the second descriptor in multiple adjacent matching pairs, and sort the multiple adjacent matching pairs from the shortest distance to the longest distance; Set the matching threshold, filter the adjacent matching pairs whose distance is less than the matching threshold, and generate stable matching pairs.

6. The image size comparison method according to claim 4, characterized in that: Calculating the similarity between the original image and the image to be compared according to the stable matching pair includes: Counting the number of the stable matching pairs to generate a first value; Counting the number of the first descriptors to generate a second value, counting the number of the second descriptors to generate a third value, comparing the second value and the third value, and taking the maximum value to generate a fourth value; The ratio of the first value to the fourth value is calculated to generate the similarity between the original image and the image to be compared.

7. The image size comparison method according to claim 5, characterized in that: The generating the image size comparison result includes: Generate corresponding original image feature point coordinates and to-be-compared image feature point coordinates in a stable matching pair according to the first descriptor and the second descriptor; Calculate the homography matrix according to the coordinates of the feature points of the original image and the feature points of the image to be compared, perform perspective transformation according to the homography matrix, and generate the original image to be stitched and the image to be stitched and compared; The original image to be stitched and the image to be stitched for comparison are stitched together to generate an image size comparison result.

8. An image size comparison device, characterized in that: include: A feature extraction module, used to extract SIFT feature points of the original image and generate a first descriptor, extract SIFT feature points of the image to be compared and generate a second descriptor; A comparison module, for performing proximity matching between the first descriptor and the second descriptor based on a K-nearest neighbor algorithm, generating a plurality of proximity matching pairs, and selecting a stable matching pair from the plurality of proximity matching pairs based on a preset matching threshold; The comparison result generating module is used to calculate the similarity between the original image and the image to be compared according to the stable matching pair, and generate an image size comparison result.

9. A device, characterized in that: It includes a memory and a processor, wherein the memory is used to store programs and data; the processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the image size comparison method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of an image size comparison method as described in any one of claims 1 to 7.