Similarity determination method, device, electronic device and storage medium

Through the method of contour extraction and Gaussian distribution similarity weight calculation, the problem that medical image similarity is difficult to accurately measure, and the accurate reflection and similarity determination of small changes in the spatial position of medical images are achieved.

CN115035312BActive Publication Date: 2025-05-13HANGZHOU SANTAN MEDICAL TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210650612.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2025-05-13
Estimated Expiration
2042-06-09

Smart Images

  • Figure CN115035312B_ABST
    Figure CN115035312B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a similarity determination method, device, electronic device and storage medium. It includes: extracting each first contour pixel and second contour pixel for the main content of the reference image and the floating image; for each first contour pixel, determining its corresponding second contour pixel in the floating image as a matching pixel; calculating each Gaussian distribution similarity weight between each matching pixel and the first contour pixel; the Gaussian distribution similarity weight is the Gaussian distribution function value obtained based on the similarity distance; based on each Gaussian distribution similarity weight and the number of first contour pixels, determining the similarity of the two images. Since the contour pixels are extracted for the main content, the main information in the image can be retained to the maximum extent, and according to the Gaussian distribution characteristics, the smaller the distance between pixels, the larger the Gaussian distribution function value, and using the Gaussian distribution similarity weight to measure the similarity of the two images can reflect the subtle changes of the two images and improve the accuracy of determining the similarity of medical images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a similarity determination method, device, electronic equipment and storage medium. Background Art

[0002] Calculating image similarity by comparing image features (i.e., image similarity measurement) is a very important basic problem in the field of computer vision, and has wide applications in pattern recognition, image classification, image retrieval, and image registration.

[0003] In the prior art, the similarity between images is usually measured by methods such as histogram matching and feature point extraction (such as SIFT). However, in medical scenarios, most medical images are grayscale images and the image changes are small. Different images may have similar distributions of grayscale information in the grayscale domain, but different distributions of grayscale information in the spatial domain. The similarity obtained based on the histogram only reflects the distribution of grayscale information in the grayscale domain, and cannot reflect the distribution of grayscale information in the spatial domain. As for the method of extracting rotationally indeformable features in the image (such as SIFT) and using the degree of feature matching as the similarity, since the calculation of its similarity is independent of the image size and rotation, the influence of light, noise, and perspective conversion on its calculation results is also minimal. Therefore, the similarity determined by the feature point extraction method cannot reflect the difference in the spatial position of the image features.

[0004] It can be seen that the similarity determination method used in the prior art is difficult to accurately measure the similarity of medical images. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a similarity determination method, device, electronic device and storage medium to improve the accuracy of medical image similarity determination. The specific technical solution is as follows:

[0006] In one aspect of the present invention, a similarity determination method is provided, the method comprising:

[0007] Get the reference image and the floating image;

[0008] Performing contour extraction on the main content in the reference image and the main content in the floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image;

[0009] For each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, determining in the floating image each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels;

[0010] For each of the first contour pixels, respectively calculate each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance;

[0011] Based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, the similarity between the reference image and the floating image is determined; wherein the similarity is positively correlated with the Gaussian distribution similarity weights, and negatively correlated with the number of the first contour pixels.

[0012] In an embodiment of the present invention, for each of the first contour pixels, respectively calculating each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel includes:

[0013] For each of the first contour pixels, based on the coordinates of the first contour pixel and the coordinates of each matching pixel, respectively calculate the Euclidean distance between each matching pixel of the first contour pixel and the first contour pixel;

[0014] For each of the first contour pixels, the Euclidean distance between each matching pixel and the first contour pixel is used as an independent variable to calculate a Gaussian distribution function value as each Gaussian distribution similarity weight between the matching pixel and the first contour pixel.

[0015] In one embodiment of the present invention, before calculating, for each of the first contour pixels, the Euclidean distance between each matching pixel and the first contour pixel as an independent variable, a Gaussian distribution function value as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel, the method further includes:

[0016] For each of the first contour pixels, determining a minimum value of the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel, which is the minimum Euclidean distance corresponding to the first contour pixel;

[0017] The method of calculating, for each of the first contour pixels, a Gaussian distribution function value using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel comprises:

[0018] For each of the first contour pixels, taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, calculating a Gaussian distribution function value as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel;

[0019] The determining the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, comprises:

[0020] The quotient of the sum of the maximum Gaussian distribution similarity weights corresponding to each of the first contour pixels and the number of the first contour pixels is calculated as the similarity between the reference image and the floating image.

[0021] In one embodiment of the present invention, respectively extracting contours of the main content in the reference image and the main content in the floating image to obtain first contour pixels of the reference image and second contour pixels of the floating image include:

[0022] Performing Gaussian smoothing filtering on the reference image and the floating image to obtain a filtered reference image and a filtered floating image;

[0023] Contour extraction is performed on the main content in the filtered reference image and the main content in the filtered floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image.

[0024] In a second aspect of the present invention, a similarity determination device is provided, the device comprising:

[0025] An image acquisition module, used for acquiring a reference image and a floating image;

[0026] A contour extraction module, used to perform contour extraction on the main content in the reference image and the main content in the floating image, respectively, to obtain each first contour pixel of the reference image and each second contour pixel of the floating image;

[0027] a matching pixel determination module, configured to determine, for each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, in the floating image, each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels;

[0028] A similarity weight calculation module, used for calculating, for each of the first contour pixels, each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance;

[0029] A similarity determination module is used to determine the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels; wherein the similarity is positively correlated with the Gaussian distribution similarity weights and negatively correlated with the number of the first contour pixels.

[0030] In an embodiment of the present invention, for each of the first contour pixels, respectively calculating each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel includes:

[0031] For each of the first contour pixels, based on the coordinates of the first contour pixel and the coordinates of each matching pixel, respectively calculate the Euclidean distance between each matching pixel of the first contour pixel and the first contour pixel;

[0032] For each of the first contour pixels, the Euclidean distance between each matching pixel and the first contour pixel is used as an independent variable to calculate a Gaussian distribution function value as each Gaussian distribution similarity weight between the matching pixel and the first contour pixel.

[0033] In one embodiment of the present invention, the device further comprises:

[0034] A minimum Euclidean distance determination module, configured to determine, for each of the first contour pixels, a minimum value of the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel, as the minimum Euclidean distance corresponding to the first contour pixel;

[0035] The method of calculating, for each of the first contour pixels, a Gaussian distribution function value using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel comprises:

[0036] For each of the first contour pixels, taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, calculating a Gaussian distribution function value as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel;

[0037] The determining the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, comprises:

[0038] The quotient of the sum of the maximum Gaussian distribution similarity weights corresponding to each of the first contour pixels and the number of the first contour pixels is calculated as the similarity between the reference image and the floating image.

[0039] In one embodiment of the present invention, respectively extracting contours of the main content in the reference image and the main content in the floating image to obtain first contour pixels of the reference image and second contour pixels of the floating image include:

[0040] Performing Gaussian smoothing filtering on the reference image and the floating image to obtain a filtered reference image and a filtered floating image;

[0041] Contour extraction is performed on the main content in the filtered reference image and the main content in the filtered floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image.

[0042] In another aspect of the present invention, an electronic device is provided, characterized in that it includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;

[0043] Memory, used to store computer programs;

[0044] The processor is used to implement any of the above-mentioned similarity determination method steps when executing the program stored in the memory.

[0045] In another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the above-mentioned similarity determination method steps is implemented.

[0046] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned similarity determination methods.

[0047] Beneficial effects of the embodiments of the present invention:

[0048] The similarity determination method provided by the embodiment of the present invention performs contour extraction on the main content in the reference image and the main content in the floating image respectively to obtain each first contour pixel of the reference image and each second contour pixel of the floating image; for each first contour pixel, based on the coordinates of the first contour pixel and a preset range, determines each second contour pixel located within the preset range of the coordinates of the first contour pixel in the floating image as each matching pixel of the first contour pixel; calculates each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel respectively; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance; based on each Gaussian distribution similarity weight between each first contour pixel and its matching pixel, and the number of the first contour pixels, determines the similarity between the reference image and the floating image; wherein the similarity is positively correlated with the Gaussian distribution similarity weight and negatively correlated with the number of the first contour pixels. By applying the embodiment of the present invention, similarity calculation is performed based on the contour pixels of the reference image and the floating image. Since the contour pixels are extracted based on the main content in the reference image and the floating image, the extracted contour pixels can retain the main information in the medical image to the maximum extent and filter out the interference information. At the same time, the similarity between the images is measured by using the Gaussian distribution similarity weight. Since the Gaussian distribution similarity weight is the Gaussian distribution function value obtained by calculating the similarity distance, according to the Gaussian distribution characteristics, the smaller the distance between the two pixels, the larger the Gaussian distribution function value, and the greater the change rate of the Gaussian distribution curve. Therefore, by using the Gaussian distribution similarity weight to measure the similarity between the two images, the subtle changes in the spatial positions of the two images can be better reflected. For medical images with single information and small image changes, their change relationship can be more accurately reflected, thereby improving the accuracy of determining the similarity of medical images.

[0049] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0051] Figure 1 A schematic diagram of a process flow of a similarity determination method provided by an embodiment of the present invention;

[0052] Figure 2 A second flow chart of the similarity determination method provided in an embodiment of the present invention;

[0053] Figure 3 A third flow chart of the similarity determination method provided in an embodiment of the present invention;

[0054] Figure 4 It is a schematic diagram of a one-dimensional Gaussian distribution function curve;

[0055] Figure 5 is a schematic diagram of a Gaussian distribution function curve used in an embodiment of the present invention;

[0056] Figure 6 A fourth flow chart of a similarity determination method provided in an embodiment of the present invention;

[0057] Figure 7 A flowchart of a specific example of a similarity determination method provided in an embodiment of the present invention;

[0058] Figure 8 A schematic diagram of a structure of a similarity determination device provided in an embodiment of the present invention;

[0059] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.

[0061] Image registration is the process of matching and superimposing two or more images acquired at different times, with different sensors (imaging equipment) or under different conditions (weather, illumination, camera position and angle, etc.). It has very important applications in the medical field. Medical image registration refers to seeking a (or a series of) spatial transformations for a medical image (also called a floating image) so that it can achieve spatial consistency with the corresponding points on another medical image (also called a reference image). This consistency means that the same anatomical point on the human body has the same spatial position in the two matching images. After performing medical image registration, it is possible to perform image analysis on multiple images of the patient at the same spatial scale and obtain comprehensive information about the patient in many aspects. Image similarity measurement is the basis of medical image registration.

[0062] In order to improve the accuracy of determining the similarity of medical images, an embodiment of the present invention provides a similarity determination method, device, electronic device and storage medium. The following first describes the similarity determination method provided by an embodiment of the present invention by way of example.

[0063] The similarity determination method provided in the embodiment of the present invention may be applied to electronic devices, and the electronic devices may include computers, servers, etc. The present invention does not make any specific limitation to this.

[0064] See also Figure 1 , Figure 1 A schematic flow chart of a similarity determination method provided in an embodiment of the present invention may specifically include the following steps:

[0065] Step S110, obtaining a reference image and a floating image;

[0066] Step S120, respectively extracting the contours of the main content in the reference image and the main content in the floating image to obtain first contour pixels of the reference image and second contour pixels of the floating image;

[0067] Step S130, for each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, determining in the floating image each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels;

[0068] Step S140, for each of the first contour pixels, respectively calculating each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel;

[0069] Wherein, the Gaussian distribution similarity weight is the Gaussian distribution function value obtained based on the similarity distance;

[0070] Step S150: Determine the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels.

[0071] The similarity is positively correlated with the Gaussian distribution similarity weight, and negatively correlated with the number of pixels of the first contour.

[0072] The similarity determination method provided by the embodiment of the present invention performs contour extraction on the main content in the reference image and the main content in the floating image respectively to obtain each first contour pixel of the reference image and each second contour pixel of the floating image; for each first contour pixel, based on the coordinates of the first contour pixel and a preset range, determines each second contour pixel located within the preset range of the coordinates of the first contour pixel in the floating image as each matching pixel of the first contour pixel; calculates each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel respectively; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance; based on each Gaussian distribution similarity weight between each first contour pixel and its matching pixel, and the number of the first contour pixels, determines the similarity between the reference image and the floating image; wherein the similarity is positively correlated with the Gaussian distribution similarity weight and negatively correlated with the number of the first contour pixels. By applying the embodiment of the present invention, similarity calculation is performed based on the contour pixels of the reference image and the floating image. Since the contour pixels are extracted based on the main content in the reference image and the floating image, the extracted contour pixels can retain the main information in the medical image to the maximum extent and filter out the interference information. At the same time, the similarity between the images is measured by using the Gaussian distribution similarity weight. Since the Gaussian distribution similarity weight is the Gaussian distribution function value obtained by calculating the similarity distance, according to the Gaussian distribution characteristics, the smaller the distance between the two pixels, the larger the Gaussian distribution function value, and the greater the change rate of the Gaussian distribution curve. Therefore, by using the Gaussian distribution similarity weight to measure the similarity between the two images, the subtle changes in the spatial positions of the two images can be better reflected. For medical images with single information and small image changes, their change relationship can be more accurately reflected, thereby improving the accuracy of determining the similarity of medical images.

[0073] In addition, since medical images have a variety of imaging modes, such as CT imaging, X-ray imaging, etc., the existing methods for similarity measurement based on extracted feature points can extract different feature information for images generated by different imaging methods, and the number of feature points and the method of selecting feature points will also affect the calculation of similarity. At the same time, the image information is relatively simple and the information changes little, which will also cause the similarity calculation based on feature points to be unable to accurately extract feature points. By applying the embodiment of the present invention, by calculating the similarity based on the contour pixels of the main content of the reference image and the floating image, rather than calculating the similarity based on the image features extracted from the original image, the influence of the image imaging method, the number of feature points and the method of selecting feature points on the determination of similarity can be eliminated, thereby improving the accuracy of the similarity calculation.

[0074] Next, the above steps S110-S150 are exemplarily described:

[0075] In an embodiment of the present invention, the reference image and the floating image may be images obtained by different imaging methods. The reference image may also be called a template grayscale image, which may be an X-ray image of a patient taken during a physical examination, a surgical procedure, or the like. For example, it may be an X-ray image of a patient's brain, chest, or other parts. An X-ray image is an image obtained by X-ray imaging technology. Of course, the reference image may also be a nuclear magnetic resonance image of the patient. For example, it may be a nuclear magnetic resonance image of a patient's cervical spine, lumbar spine, or other parts. A nuclear magnetic resonance image is an image obtained by nuclear magnetic resonance imaging technology.

[0076] The above-mentioned floating image can be an image obtained through mathematical modeling. In the medical field, the above-mentioned floating image is usually a CT image of the patient. The CT image is an image obtained through CT imaging technology. CT imaging is a technology that combines X-ray scanning projection data with reconstruction mathematics and computer technology to obtain medical images based on layer information. For example, the above-mentioned floating image can be a DRR (Digital Reconstructed Radiograph) image obtained by performing a CT scan on the patient's brain, chest and other parts. Of course, the above-mentioned floating image can also be an image obtained through other imaging technologies, such as ultrasonic imaging, etc., and the present invention does not make specific limitations on this.

[0077] Of course, the reference image may also be a CT image, and the floating image may also be an X-ray image, etc. The present invention does not make any specific limitation on this.

[0078] In medical image registration, the reference image and floating image are usually of the same size and are images generated for the same part. For example, they may be X-ray images and CT images generated for the brain, chest, etc. of the same patient. Of course, the reference image and floating image may also be images generated for the same part of different patients. For example, they may be X-ray images and CT images generated for the brain, chest, etc. of different patients.

[0079] After the reference image and the floating image are acquired, contours of the reference image and the floating image may be extracted respectively.

[0080] In the embodiment of the present invention, contour extraction can be performed for the main content in the reference image and the floating image. The extracted contour information is the contour information of the main content in the reference image and the floating image. For example, the contour information extracted from the X-ray image of the patient's brain is the contour information of the patient's brain in the image, and the contour information extracted from the X-ray image of the patient's chest is the contour information of the patient's chest in the image.

[0081] Generally, the contour extraction canny operator, laplace operator, etc. can be used to extract the contour pixels of the image. In one embodiment of the present invention, the canny operator can be used to extract the contours of the reference image and the floating image respectively to obtain the contour information of the reference image and the floating image. The contour information of the reference image and the floating image can include the grayscale value of each contour pixel of the main content in the two images and the coordinates of each contour pixel.

[0082] In order to distinguish the contour pixels of the above two images, in the embodiment of the present invention, the contour pixels extracted from the reference image are called first contour pixels, and the contour pixels extracted from the floating image are called second contour pixels.

[0083] Usually, the medical images are relatively complex, with large amounts of data and low signal-to-noise ratio. The signal-to-noise ratio is the ratio of the signal to the noise. If contour extraction is performed directly based on the original image, good results may not be obtained. Therefore, in one embodiment of the present invention, the reference image and the floating image may be firstly subjected to noise filtering, and then contour extraction may be performed on the filtered reference image and the floating image respectively.

[0084] Specifically, based on Figure 1 ,like Figure 2 As shown, the contour pixels of the reference image and the floating image can be extracted by the following steps:

[0085] Step S121 , performing Gaussian smoothing filtering on the reference image and the floating image to obtain a filtered reference image and a filtered floating image.

[0086] Gaussian smoothing filter is a linear smoothing filter that is suitable for eliminating Gaussian noise and is widely used in the noise reduction process of image processing. By performing Gaussian smoothing filter on the reference image and the floating image, most of the noise that may interfere with contour extraction can be filtered out and the main information of the image can be retained.

[0087] Step S122: extracting contours of the main content in the filtered reference image and the main content in the filtered floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image.

[0088] In this step, the contour extraction canny operator can be used to extract the contour information of the main content in the filtered reference image and the filtered floating image. After extracting the first contour pixels and the second contour pixels, the contour pixel information corresponding to the first contour pixels and the second contour pixels can be stored.

[0089] As a specific implementation of the embodiment of the present invention, the above-mentioned contour pixel information can be stored in the form of an array. For example, one array can be used to store the information of the above-mentioned first contour pixels, and another array can be used to store the information of the second contour pixels. The above-mentioned array can only store the coordinates of the first or second contour pixels, or can also store the coordinates and grayscale values ​​of the first or second contour pixels.

[0090] Afterwards, the similarity between the reference image and the floating image may be calculated based on the first contour pixels and the second contour pixels.

[0091] As mentioned above, medical image registration refers to seeking a (or a series of) spatial transformations for the floating image so that it can be spatially consistent with the corresponding points on the reference image. Therefore, the required similarity between the reference image and the floating image is actually the similarity between the reference image and the floating image in spatial position. That is to say, in the embodiment of the present invention, the similarity between the reference image and the floating image in spatial position is obtained by calculating the similarity between the first contour pixels and the second contour pixels in spatial position.

[0092] In the embodiment of the present invention, for each first contour pixel, the similarity between the second contour pixel and the first contour pixel in the corresponding area of ​​the floating image can be calculated. The corresponding area can be called the search area corresponding to the first contour pixel. The search area can be obtained based on the coordinates of the first contour pixel.

[0093] As described above, the reference image and the floating image are usually of the same size. Therefore, for each first contour pixel, a position with the same coordinates as the first contour pixel can be found in the floating image. In the embodiment of the present invention, the search area corresponding to each first contour pixel in the floating image can be determined based on the coordinates of each first contour pixel and a preset range.

[0094] The shape and size of the preset range can be set manually based on actual needs and stored in advance. For example, the preset range can be set as a rectangular area centered on the first contour pixel coordinate, and the distance from each side of the rectangular area to the center can be 15 or 20 pixels, and the corresponding rectangular area size can be 31*31, 41*41, etc. Of course, the shape of the preset range can also be a pentagon, a rhombus, etc., and the present invention does not specifically limit this.

[0095] In one embodiment of the present invention, for each first contour pixel, a position in the floating image with the same coordinates as the first contour pixel can be determined, and a search area corresponding to the first contour pixel can be determined within a preset range centered at the position. For example, for a first contour pixel, the first contour pixel coordinates are (x 0 ,y0 ), then we can determine the floating image with coordinates (x 0 ,y 0 ) is the center and the rectangular area of ​​size 31*31 is the search area corresponding to the first contour pixel.

[0096] Of course, in other embodiments of the present invention, for each first contour pixel, a search area can be determined in the reference image based on the coordinates of the first contour pixel and a preset range. And based on the endpoint coordinates of the search area, the search area corresponding to the first contour pixel is determined in the floating image. For example, a first contour pixel with coordinates (x 0 ,y 0 ), then we can determine the reference image with coordinates (x 0 ,y 0 ) as the center and a rectangular area of ​​size 31*31, and based on the coordinates of the four endpoints of the rectangular area, determine that the area surrounded by the same endpoint coordinates in the floating image is the search area corresponding to the first contour pixel.

[0097] Afterwards, for each of the first contour pixels, a second contour pixel existing in the corresponding search area can be searched. The second contour pixel found is the matching pixel of the first contour pixel.

[0098] As a specific implementation of the embodiment of the present invention, for each first contour pixel, the pixel coordinates in the search area corresponding to the first contour pixel can be matched with the coordinates of the second contour pixels, and the second contour pixel corresponding to the successfully matched coordinate is the matching pixel of the first contour pixel. If a matching pixel of a first contour pixel is not found, the first contour pixel can be marked as an unmatched point.

[0099] As described above, each contour pixel can be stored in an array form. For example, for each first contour pixel mentioned above, an array A can be used to store the coordinates P of each first contour pixel. Array A = {P 1 ,P 2 ,…,P N}. Wherein N is the number of the first contour pixels. As a specific implementation, for any first contour pixel P in the array A i , the coordinates of the matching pixels of the first contour pixel can be extracted and stored in array B. Then, the coordinates of each matching pixel in array B and the coordinates of the first contour pixel can be calculated one by one. i The Gaussian distributions between them have similar weights.

[0100] In one embodiment of the present invention, it is also possible to determine whether there is data in the array A used to store the first contour pixel coordinates, so as to determine whether the reference image contour information is successfully extracted and ensure the reliability of the similarity calculation. If there is no data in the array A, an abnormality message can be output and the current similarity calculation can be stopped. If there is data, the above step S130 can be performed, and for each of the first contour pixels, based on the coordinates of the first contour pixel and the preset range, each of the second contour pixels located within the preset range of the coordinates of the first contour pixel is determined in the floating image as each matching pixel of the first contour pixel.

[0101] The Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on the similarity distance. In an embodiment of the present invention, for each first contour pixel, when calculating the Gaussian distribution similarity weight between the first contour pixel and each matching pixel, the similarity distance between the first contour pixel and each matching pixel can be calculated first. The similarity distance can be Euclidean distance, Mahalanobis distance or cosine distance, etc. In an embodiment of the present invention, Euclidean distance can be used to represent the similarity distance between the first pixel and each matching pixel.

[0102] Specifically, based on Figure 1 ,like Figure 3 As shown, the Gaussian distribution similarity weight between the matching pixel and the first contour pixel can be calculated specifically by the following steps:

[0103] Step S141: for each of the first contour pixels, based on the coordinates of the first contour pixel and the coordinates of each matching pixel, respectively calculate the Euclidean distance between each matching pixel of the first contour pixel and the first contour pixel;

[0104] Step S142: for each of the first contour pixels, using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable, calculate a Gaussian distribution function value as each Gaussian distribution similarity weight between the matching pixel and the first contour pixel.

[0105] Next, the above steps S141-S142 are exemplarily described:

[0106] As described above, for each first contour pixel, an array may be used to store the coordinates of the matching pixels of the first contour pixel. Therefore, when calculating the Euclidean distance between the first contour pixel and each of its matching pixels, the Euclidean distance between the elements in the array for storing matching pixels and the first contour pixel may be calculated one by one based on the array.

[0107] In the embodiment of the present invention, in order to better reflect the small changes between the two images, a Gaussian distribution similarity weight can be used to measure the similarity between the two images. The Gaussian distribution similarity weight can be a Gaussian distribution function value calculated using the Euclidean distance as an independent variable.

[0108] Usually, the one-dimensional expression of the Gaussian distribution function is as follows:

[0109]

[0110] Among them, a controls the height of the peak of the curve, b controls the coordinates of the center of the peak, and c is the standard deviation, which controls the convergence speed of the curve. Figure 4 Figure 2 shows a variation curve of a one-dimensional Gaussian distribution function. Figure 4 As shown in the figure, the closer to the peak of the curve, the greater the rate of change of the curve. In other words, for variables x that are close to b in value, even if the difference between the variables x is small, there is a large difference in the value of their Gaussian distribution function. And the closer the variable x is to b in value, the larger the value of its Gaussian distribution function.

[0111] Therefore, for reference images and floating images with small changes in spatial position, using the Gaussian distribution function value corresponding to the Euclidean distance to measure the similarity between the first contour pixels and the matching pixels can better reflect the similarity between the first contour pixels and the matching pixels in spatial position, thereby better reflecting the small changes in spatial position between the two images.

[0112] In one embodiment of the present invention, a one-dimensional Gaussian distribution function with a=1, b=0, c=2 can be used to obtain Gaussian distribution similarity weights. That is, the Gaussian distribution function used in the embodiment of the present invention can be:

[0113]

[0114] Among them, a=1 means that the maximum weight is 1; b=0 means that the maximum value is taken when the distance is 0, and the function on the right side of the peak is taken, and x is the Euclidean distance. Of course, the values ​​of a, b, and c can also be other values, and the present invention does not make specific limitations on this.

[0115] Figure 5 Schematic diagram of the Gaussian function curve used in the embodiment of the present invention. It can be seen that the closer the Euclidean distance is to 0, the larger the corresponding Gaussian distribution function value (i.e., the Gaussian distribution similarity weight) is. Therefore, using the Gaussian distribution function value corresponding to the Euclidean distance as a similarity measurement indicator can more clearly reflect the similarity of the two images.

[0116] After calculating the Gaussian distribution similarity weights between all first contour pixels and their matching pixels, the similarity between the first contour pixels and the second contour pixels can be calculated based on the Gaussian distribution similarity weights between the first contour pixels and their matching pixels.

[0117] In one embodiment of the present invention, the calculated similarity weights of each Gaussian distribution can be normalized, and the normalized result can be used as the similarity between the reference image and the floating image. For example, the quotient of the sum of the similarity weights of each Gaussian distribution and the number of first contour pixels can be calculated, and the quotient can be reduced to a range of 0 to 1 as the similarity between the reference image and the floating image. However, this method may result in a large number of second contour pixels being repeatedly calculated, resulting in poor accuracy of the obtained similarity. Therefore, in another embodiment of the present invention, the similarity weights of each Gaussian distribution can be screened and then calculated.

[0118] In one embodiment of the present invention, for each first contour pixel, the maximum value of the Gaussian distribution similarity weight between the first contour pixel and each of its matching pixels can be retained for subsequent calculations. In this way, the number of second contour pixels that are repeatedly calculated can be reduced. As a specific implementation method, based on Figure 3 ,like Figure 6 As shown, before the above step S142, the following steps may also be included:

[0119] Step S640: for each of the first contour pixels, determine the minimum value of the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel, which is the minimum Euclidean distance corresponding to the first contour pixel.

[0120] based on Figure 3 ,like Figure 6 As shown, the above step S142, for each of the first contour pixels, takes the Euclidean distance between each matching pixel and the first contour pixel as an independent variable, calculates the Gaussian distribution function value as each Gaussian distribution similarity weight between the matching pixel and the first contour pixel, which can be refined as follows:

[0121] Step S1421 : For each of the first contour pixels, taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, calculating a Gaussian distribution function value as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel.

[0122] As described above, the Gaussian distribution similarity weight between the matching pixel of the first contour pixel and the first contour pixel is a Gaussian distribution function value calculated by taking the Euclidean distance between the matching pixel of the first contour pixel and the first contour pixel as an independent variable. It can be seen from the Gaussian distribution function that the Gaussian distribution function value is negatively correlated with the value of the independent variable, that is, the Gaussian distribution similarity weight is negatively correlated with the Euclidean distance. Therefore, the minimum Euclidean distance between the first contour pixel and its matching pixels can be determined, and for each first contour pixel, the Gaussian distribution function value is calculated by taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, and the maximum Gaussian distribution similarity weight corresponding to the first contour pixel can be obtained.

[0123] In this way, for each first contour pixel, only the minimum Euclidean distance of the first contour pixel is used as the independent variable to calculate the maximum Gaussian distribution similarity weight of the first contour pixel, that is, only the Gaussian distribution similarity weight between the matching pixel most similar to the first contour pixel and the first contour pixel is calculated, without calculating the Gaussian distribution similarity weights between each matching pixel of the first contour pixel and the first contour pixel, which can reduce the amount of data processing and save resource consumption.

[0124] based on Figure 3 ,like Figure 6 As shown, the above step S150, based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, determining the similarity between the reference image and the floating image may include:

[0125] Step S151 : Calculate the quotient of the sum of the maximum Gaussian distribution similarity weights corresponding to each of the first contour pixels and the number of the first contour pixels as the similarity between the reference image and the floating image.

[0126] As an implementation, a field W may be pre-set to store the sum of the maximum Gaussian distribution similarity weights corresponding to the first contour pixels. After obtaining the maximum Gaussian distribution similarity weight corresponding to the first contour pixel each time, the maximum Gaussian distribution similarity weight is added to the total weight value W.

[0127] As an implementation method, the similarity between the reference image and the floating image may be calculated by the following formula:

[0128]

[0129] Wherein, W represents the accumulated weight sum, and N represents the number of the first contour pixels.

[0130] Of course, in other embodiments of the present invention, for each first contour pixel, the Euclidean distance between the first contour pixel and its matching pixels can be used as an independent variable to calculate the Gaussian distribution function value as the Gaussian distribution similarity weight between the first contour pixel and its matching pixels. Then, the maximum value among the Gaussian distribution similarity weights between the first contour pixel and its matching pixels is determined as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel.

[0131] Based on the similarity between the reference image and the floating image, the reference image and the floating image can be registered. As can be seen from the above, the Gaussian distribution function change curve is relatively smooth. By measuring the similarity between the first contour pixel and the second contour pixel with the Gaussian distribution similarity weight, a relatively smooth similarity change curve can be obtained. When performing medical image registration, iterative optimization based on the similarity change curve can also obtain better results.

[0132] like Figure 7 As shown, a flowchart of a specific example of a similarity determination method provided by an embodiment of the present invention is shown. After the program starts, the following steps may be specifically included:

[0133] ①. Image reading.

[0134] This step includes reference image reading and floating image reading.

[0135] ②. Perform Gaussian filtering and smoothing on the above reference image and floating image.

[0136] ③. For the image smoothed by Gaussian filtering, use the edge detection algorithm to extract its contour information.

[0137] This step is to extract the contours of the main content in the reference image and the main content in the floating image respectively in the embodiment of the present invention, so as to obtain each first contour pixel of the reference image and each second contour pixel of the floating image.

[0138] ④. Contour information storage.

[0139] That is, the reference image contour information and the floating image contour information are stored. The reference image contour information and the floating image contour information are extracted from the reference image main content and the floating image main content respectively. The reference image contour information includes the grayscale value and coordinates of each reference image contour pixel, and the floating image contour information includes the grayscale value and coordinates of each floating image contour pixel.

[0140] ⑤, determine whether there is a reference image contour point, if not, output abnormal information and end the program; if so, execute step ⑥.

[0141] The above-mentioned contour points are contour pixels in the embodiment of the present invention.

[0142] ⑥For each reference image contour pixel, create a closed area centered on the contour pixel.

[0143] The closed area may be a closed rectangular area with a size of 31*31 and a pixel coordinate of the reference image contour as the center.

[0144] ⑦. Search for floating image contour points in the same closed area of ​​the floating image as matching points of the reference image contour pixels.

[0145] ⑧. Determine whether a matching point is found. If not, mark the reference contour pixel as an unmatched point. If so, for each matching point, calculate the point weight based on the Euclidean distance between the point and the reference contour pixel according to the Gaussian distribution function, and add the point weight to the total weight.

[0146] The above matching points are matching pixels in the embodiment of the present invention.

[0147] In this embodiment, for a reference contour pixel point, the Euclidean distance between the reference contour pixel point and each matching point in its closed area can be calculated, and the minimum Euclidean distance can be determined therefrom. The Gaussian distribution function value is calculated using the minimum Euclidean distance as the independent variable as the Gaussian distribution similarity weight, and the weight is added to the total weight value.

[0148] ⑨. Determine whether all contour points have been calculated. If not, proceed to the next contour point and return to the above step ⑥. If yes, the similarity between the reference image and the floating image can be determined = total weight value / total number of reference image contour points.

[0149] Similarity calculations in existing technologies are mostly based on grayscale information and feature points, but these two methods have limitations for medical images with a lot of interference information, single image information, and small and inconspicuous information changes. Interference information and noise will interfere with the grayscale-based similarity calculation, while the relatively single image information and small information changes will cause the feature point-based similarity calculation to be unable to accurately extract feature points.

[0150] By applying the embodiments of the present invention, the influence of image resolution, noise, and uneven illumination on the contour extraction of the target area can be filtered out, and the contour information, i.e., the main part information in the medical image, can be extracted. The overlapping area of ​​the contours of the two images is used as the similarity index, which can accurately reflect the matching degree of the two medical images and provide a prerequisite for medical image registration.

[0151] In a second aspect of the present invention, a similarity determination device is also provided. Figure 8 As shown, the device may include:

[0152] An image acquisition module 810 is used to acquire a reference image and a floating image;

[0153] The contour extraction module 820 is used to perform contour extraction on the main content in the reference image and the main content in the floating image respectively, to obtain each first contour pixel of the reference image and each second contour pixel of the floating image;

[0154] a matching pixel determination module 830, configured to determine, for each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, in the floating image, each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels;

[0155] The similarity weight calculation module 840 is used to calculate, for each of the first contour pixels, the Gaussian distribution similarity weights between each matching pixel of the first contour pixel and the first contour pixel; wherein the Gaussian distribution similarity weight is the Gaussian distribution function value obtained based on the similarity distance

[0156] The similarity determination module 850 is used to determine the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels; wherein the similarity is positively correlated with the Gaussian distribution similarity weights and negatively correlated with the number of the first contour pixels.

[0157] The similarity determination device provided by the embodiment of the present invention performs contour extraction on the main content in the reference image and the main content in the floating image respectively to obtain each first contour pixel of the reference image and each second contour pixel of the floating image; for each first contour pixel, based on the coordinates of the first contour pixel and a preset range, determines each second contour pixel located within the preset range of the coordinates of the first contour pixel in the floating image as each matching pixel of the first contour pixel; calculates each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel respectively; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance; based on each Gaussian distribution similarity weight between each first contour pixel and its matching pixel, and the number of the first contour pixels, determines the similarity between the reference image and the floating image; wherein the similarity is positively correlated with the Gaussian distribution similarity weight and negatively correlated with the number of the first contour pixels. By applying the embodiment of the present invention, similarity calculation is performed based on the contour pixels of the reference image and the floating image. Since the contour pixels are extracted based on the main content in the reference image and the floating image, the extracted contour pixels can retain the main information in the medical image to the maximum extent and filter out the interference information. At the same time, the similarity between the images is measured by using the Gaussian distribution similarity weight. Since the Gaussian distribution similarity weight is the Gaussian distribution function value obtained by calculating the similarity distance, according to the Gaussian distribution characteristics, the smaller the distance between the two pixels, the larger the Gaussian distribution function value, and the greater the change rate of the Gaussian distribution curve. Therefore, by using the Gaussian distribution similarity weight to measure the similarity between the two images, the subtle changes in the spatial positions of the two images can be better reflected. For medical images with single information and small image changes, their change relationship can be more accurately reflected, thereby improving the accuracy of determining the similarity of medical images.

[0158] In an embodiment of the present invention, for each of the first contour pixels, respectively calculating each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel includes:

[0159] For each of the first contour pixels, based on the coordinates of the first contour pixel and the coordinates of each matching pixel, respectively calculate the Euclidean distance between each matching pixel of the first contour pixel and the first contour pixel;

[0160] For each of the first contour pixels, the Euclidean distance between each matching pixel and the first contour pixel is used as an independent variable to calculate a Gaussian distribution function value as each Gaussian distribution similarity weight between the matching pixel and the first contour pixel.

[0161] In one embodiment of the present invention, the device further comprises: a minimum Euclidean distance determination module (not shown in the figure);

[0162] The minimum Euclidean distance determination module is used to determine, for each of the first contour pixels, a minimum value of the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel, as the minimum Euclidean distance corresponding to the first contour pixel;

[0163] The method of calculating, for each of the first contour pixels, a Gaussian distribution function value using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel comprises:

[0164] For each of the first contour pixels, taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, calculating a Gaussian distribution function value as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel;

[0165] The determining the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, comprises:

[0166] The quotient of the sum of the maximum Gaussian distribution similarity weights corresponding to each of the first contour pixels and the number of the first contour pixels is calculated as the similarity between the reference image and the floating image.

[0167] In one embodiment of the present invention, respectively extracting contours of the main content in the reference image and the main content in the floating image to obtain first contour pixels of the reference image and second contour pixels of the floating image include:

[0168] Performing Gaussian smoothing filtering on the reference image and the floating image to obtain a filtered reference image and a filtered floating image;

[0169] Contour extraction is performed on the main content in the filtered reference image and the main content in the filtered floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image.

[0170] The embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0171] Memory 903, used for storing computer programs;

[0172] The processor 901 is used to execute the program stored in the memory 903 to implement the following steps:

[0173] Get the reference image and the floating image;

[0174] Performing contour extraction on the main content in the reference image and the main content in the floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image;

[0175] For each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, determining in the floating image each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels;

[0176] For each of the first contour pixels, respectively calculate each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance;

[0177] Based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, the similarity between the reference image and the floating image is determined; wherein the similarity is positively correlated with the Gaussian distribution similarity weights, and negatively correlated with the number of the first contour pixels.

[0178] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0179] The communication interface is used for communication between the above electronic device and other devices.

[0180] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0181] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0182] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above similarity determination methods are implemented.

[0183] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes any similarity determination method in the above embodiments.

[0184] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0185] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0186] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, storage medium and program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0187] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A similarity determination method, characterized in that: The method comprises: Get the reference image and the floating image; Performing contour extraction on the main content in the reference image and the main content in the floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image; For each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, determining in the floating image each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels; For each of the first contour pixels, based on the coordinates of the first contour pixel and the coordinates of each matching pixel, respectively calculate the Euclidean distance between each matching pixel of the first contour pixel and the first contour pixel; For each of the first contour pixels, taking the Euclidean distance between each matching pixel and the first contour pixel as an independent variable, a Gaussian distribution function value is calculated as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on the similarity distance; Based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, the similarity between the reference image and the floating image is determined; wherein the similarity is positively correlated with the Gaussian distribution similarity weights, and negatively correlated with the number of the first contour pixels.

2. The method according to claim 1, characterized in that Before calculating, for each of the first contour pixels, the Gaussian distribution function value using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable and using the Gaussian distribution similarity weights between each of the matching pixels and the first contour pixel, the method further includes: For each of the first contour pixels, determining a minimum value of the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel, which is the minimum Euclidean distance corresponding to the first contour pixel; The method of calculating, for each of the first contour pixels, a Gaussian distribution function value using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel comprises: For each of the first contour pixels, taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, calculating a Gaussian distribution function value as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel; The determining the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, comprises: The quotient of the sum of the maximum Gaussian distribution similarity weights corresponding to each of the first contour pixels and the number of the first contour pixels is calculated as the similarity between the reference image and the floating image.

3. The method according to claim 1, characterized in that The extracting contours of the main content in the reference image and the main content in the floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image comprises: Performing Gaussian smoothing filtering on the reference image and the floating image to obtain a filtered reference image and a filtered floating image; Contour extraction is performed on the main content in the filtered reference image and the main content in the filtered floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image.

4. A similarity determination device, characterized in that: The device comprises: An image acquisition module, used for acquiring a reference image and a floating image; A contour extraction module, used to perform contour extraction on the main content in the reference image and the main content in the floating image, respectively, to obtain each first contour pixel of the reference image and each second contour pixel of the floating image; a matching pixel determination module, configured to determine, for each of the first contour pixels, based on the coordinates of the first contour pixels and a preset range, in the floating image, each of the second contour pixels located within the preset range of the coordinates of the first contour pixels as each of the matching pixels of the first contour pixels; A similarity weight calculation module, used for calculating, for each of the first contour pixels, each Gaussian distribution similarity weight between each matching pixel of the first contour pixel and the first contour pixel; wherein the Gaussian distribution similarity weight is a Gaussian distribution function value obtained based on a similarity distance; The similarity weight calculation module is specifically used to calculate, for each of the first contour pixels, the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel based on the coordinates of the first contour pixel and the coordinates of each matching pixel; for each of the first contour pixels, using the Euclidean distances between each matching pixel and the first contour pixel as independent variables, calculate a Gaussian distribution function value as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel; A similarity determination module is used to determine the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels; wherein the similarity is positively correlated with the Gaussian distribution similarity weights and negatively correlated with the number of the first contour pixels.

5. The device according to claim 4, characterized in that The device also includes: A minimum Euclidean distance determination module, configured to determine, for each of the first contour pixels, a minimum value of the Euclidean distances between each matching pixel of the first contour pixel and the first contour pixel, as the minimum Euclidean distance corresponding to the first contour pixel; The method of calculating, for each of the first contour pixels, a Gaussian distribution function value using the Euclidean distance between each matching pixel and the first contour pixel as an independent variable as each Gaussian distribution similarity weight between each matching pixel and the first contour pixel comprises: For each of the first contour pixels, taking the minimum Euclidean distance corresponding to the first contour pixel as an independent variable, calculating a Gaussian distribution function value as the maximum Gaussian distribution similarity weight corresponding to the first contour pixel; The determining the similarity between the reference image and the floating image based on the Gaussian distribution similarity weights between each of the first contour pixels and its matching pixels, and the number of the first contour pixels, comprises: The quotient of the sum of the maximum Gaussian distribution similarity weights corresponding to each of the first contour pixels and the number of the first contour pixels is calculated as the similarity between the reference image and the floating image.

6. The device according to claim 4, characterized in that The extracting contours of the main content in the reference image and the main content in the floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image comprises: Performing Gaussian smoothing filtering on the reference image and the floating image to obtain a filtered reference image and a filtered floating image; Contour extraction is performed on the main content in the filtered reference image and the main content in the filtered floating image respectively to obtain first contour pixels of the reference image and second contour pixels of the floating image.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 3 when executing a program stored in a memory.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method and system for interactively obtaining and outputting remote resources on surface of information carrier

    CN104199834A

  • Method for height measurement of human body based on background modeling and binocular vision

    CN105956539A