Medical image splicing method and device, readable storage medium and electronic device

By using the phase correlation method to calculate the displacement transformation matrix in medical image stitching, and combining the matching of key feature points based on scale information iteration, the problems of large splicing error and low efficiency in the existing technology are solved, and higher splicing accuracy and efficiency are achieved.

CN119991433APending Publication Date: 2025-05-13INST OF ENERGY HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ENERGY LAB)
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202510076797.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing medical image stitching methods have problems such as large stitching error and low efficiency.

Method used

The phase correlation method is used to calculate the displacement transformation matrix, and combined with the matching of key feature points based on scale information iteration, the stitching transformation relationship matrix is ​​calculated, and the stitching of medical images is completed through these matrices.

Benefits of technology

It effectively reduces the splicing error caused by inaccurate displacement calculations, improves the accuracy of splicing, and makes the splicing better match the details and overall structure of the spliced ​​images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991433A_ABST
    Figure CN119991433A_ABST
Patent Text Reader

Abstract

The invention discloses a medical image splicing method and device, a readable storage medium and an electronic device. The method comprises the following steps: acquiring a plurality of medical images; calculating the displacement of adjacent images in the plurality of medical images by adopting a phase correlation method to obtain a displacement transformation matrix; calculating an overlapping region of the adjacent images according to the displacement transformation matrix, and obtaining an ROI region according to the overlapping region by using an ROI extraction algorithm; key feature point extraction is carried out on the ROI through a feature point extraction algorithm, and a plurality of key feature points are obtained; iterating an optimal matching relation of the plurality of key feature points based on the scale information, and calculating a splicing transformation relation matrix according to the optimal matching relation to obtain a transformation matrix of the ROI region; and completing splicing of the plurality of medical images according to the displacement transformation matrix and the transformation matrix of the ROI region. The invention relates to the technical field of medical image processing, and solves the technical problems of large splicing error and low splicing efficiency of an existing medical image splicing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical image processing, and relates to image stitching technology, specifically to a medical image stitching method and device, a readable storage medium, and an electronic device. Background Art

[0002] In today's medical environment, the acceleration of the aging process in my country has led to a continuous increase in the demand for total knee replacement surgery, and the number of surgeries has shown a significant growth trend. After the total knee replacement surgery is completed, it is necessary to immediately evaluate the results of the surgery based on the full-length film of the lower limb. Usually, when obtaining images of the patient's lower limbs, a C-arm X-ray machine is used for shooting operations. However, due to the constraints of the inherent field of view of the X-ray equipment itself, it is difficult to fully cover the patient's entire lower limb structure at one time, and it is necessary to adopt a segmented shooting method to obtain the image information of each part of the lower limb. Therefore, in order to form a complete lower limb image, it is necessary to use manual splicing methods to integrate these scattered image fragments.

[0003] However, the traditional manual splicing method is not only complicated to operate, but also places extremely high demands on the professional qualities and practical experience of the performing doctors. It not only increases the doctors' workload and time costs to a certain extent, but also introduces problems such as splicing errors and low efficiency due to the intervention of human factors, which in turn has an adverse impact on the accuracy and timeliness of the evaluation of surgical results, and seriously restricts the improvement of medical diagnosis efficiency and quality. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a medical image stitching method and device, a readable storage medium, and an electronic device, which are used to solve the technical problems of large stitching errors and low efficiency in the existing medical image stitching methods.

[0005] To achieve the above object, the first aspect of the present invention provides a medical image stitching method, comprising:

[0006] S1, obtaining a plurality of X-ray medical images to be stitched and preprocessing them to obtain a plurality of medical images of uniform size;

[0007] S2, using a phase correlation method to calculate the displacement of adjacent images in a number of medical images to obtain a displacement transformation matrix;

[0008] S3, calculating the overlapping area of ​​adjacent images according to the displacement transformation matrix, and obtaining the ROI area of ​​the adjacent images according to the overlapping area using the ROI extraction algorithm;

[0009] S4, extracting key feature points from the ROI area through a feature point extraction algorithm to obtain a number of key feature points;

[0010] S5, iterating the optimal matching relationship of several key feature points based on the scale information, calculating the splicing transformation relationship matrix according to the optimal matching relationship using the feature point matching algorithm, and obtaining the transformation matrix of the ROI area of ​​the adjacent image;

[0011] S6, completing the splicing of several medical images according to the displacement transformation matrix and the transformation matrix of the ROI region.

[0012] Furthermore, the preprocessing includes unifying the spacing and sizes of adjacent images by using image resampling and image padding to obtain a plurality of medical images of uniform size.

[0013] Furthermore, the phase correlation method is used to calculate the displacement of adjacent images in a plurality of medical images, including:

[0014] S2-1, sequentially extracting two adjacent images from a plurality of medical images to obtain adjacent images;

[0015] S2-2, after converting the adjacent images into the frequency domain by using fast Fourier transform, performing noise reduction processing in the frequency domain by using bandpass frequency domain filtering to obtain adjacent frequency domain images after noise reduction;

[0016] S2-3, based on the adjacent frequency domain images after denoising, an inverse Fourier transform is performed on the cross power spectrum to obtain an inverse Fourier transform matrix, and the maximum peak value of the inverse Fourier transform matrix is ​​calculated to obtain a displacement transformation matrix (tx, ty); wherein tx represents the horizontal displacement of adjacent images, and ty represents the vertical displacement of adjacent images.

[0017] Furthermore, the calculating the overlapping area of ​​adjacent images according to the displacement transformation matrix includes:

[0018] S3-1, calculating the starting coordinates (x si ,y si ) and the end coordinate (x ei ,y ei ); wherein i=1, 2, respectively represent the indexes of the first image and the second image, the first image represents the previous image in the adjacent images, and the second image represents the next image in the adjacent images;

[0019] S3-2, calculate (x ei -x si ) and (y ei -y si ), and obtain the overlapping area; wherein the overlapping area includes the starting coordinates, ending coordinates, width and height of the overlapping area on the first image and the second image respectively.

[0020] Furthermore, the starting coordinate (xsi ,y si ) and the end coordinate (x ei ,y ei ) includes:

[0021] When i=1:

[0022] Determine whether tx is greater than or equal to 0; if so, then x s1 =tx,x e1 =w; otherwise, x s1 =0,x e1 =w+tx;

[0023] Determine whether ty is greater than or equal to 0; if so, then y s1 =ty,y e1 =h; otherwise, y s1 =0,y e1 =h+ty;

[0024] When i=2:

[0025] Determine whether tx is greater than or equal to 0; if so, then x s2 =0,x e2 =w-tx; otherwise, x s2 =-tx,x e2 =w;

[0026] Determine whether ty is greater than or equal to 0; if so, then y s2 =0,y e2 =h-ty; otherwise, y s2 =-ty,y e2 =h;

[0027] Wherein, w represents the width of the medical image, and h represents the height of the medical image.

[0028] Furthermore, the iteratively obtaining the optimal matching relationship of a plurality of key feature points based on the scale information includes:

[0029] S5-1, partitioning a number of key feature points to obtain a number of initial partitions, and performing feature matching on a number of key points using a feature point matching algorithm based on the initial partitions to obtain a transformation relationship matrix;

[0030] S5-2, transforming the ROI region according to the transformation relationship matrix to obtain a transformed ROI region;

[0031] S5-3, calculate the scale information of the transformed ROI area, and repeat S5-1 to S5-3 until the optimal scale information is found to obtain the optimal matching relationship of several key feature points; wherein the scale information represents the difference value between the two images.

[0032] Furthermore, the stitching of several medical images is completed according to the displacement transformation matrix and the transformation matrix of the ROI region, including:

[0033] S6-1, extracting initial adjacent images from a plurality of medical images to obtain current adjacent images;

[0034] S6-2, combining the displacement transformation matrix of the current adjacent image and the transformation matrix of the ROI region to obtain an overall transformation matrix;

[0035] S6-3, transforming the ROI region of the second image according to the overall transformation matrix, and splicing the transformed ROI region of the second image onto the first image, completing the splicing of adjacent images to obtain a spliced ​​image; wherein the first image represents the previous image in the current adjacent images, and the second image represents the next image in the current adjacent images;

[0036] S6-4, extracting the next image of the current adjacent image from the plurality of medical images, and combining it with the spliced ​​image to form the current adjacent image, and repeating S6-1 to S6-4 until the splicing of the plurality of medical images is completed.

[0037] A second aspect of the present invention provides a medical image stitching device, comprising:

[0038] Image acquisition module: used to sequentially acquire lower limb images by directional translation of a mobile C-arm X-ray machine of an image acquisition device and perform preprocessing to obtain a number of medical images with overlapping areas between two adjacent images;

[0039] Displacement calculation module: used to calculate the displacement of adjacent images in a number of medical images using the phase correlation method to obtain a displacement transformation matrix;

[0040] ROI extraction module: used to calculate the overlapping area of ​​adjacent images according to the displacement transformation matrix, and use the ROI extraction algorithm to obtain the ROI area of ​​the adjacent images according to the overlapping area;

[0041] Feature matching module: used to extract key feature points from the ROI area through a feature point extraction algorithm to obtain several key feature points; and,

[0042] Based on the scale information, the optimal matching relationship of several key feature points is iterated, and the splicing transformation relationship matrix is ​​calculated according to the optimal matching relationship using the feature point matching algorithm to obtain the transformation matrix of the ROI area;

[0043] Image stitching module: used to stitch several medical images according to the displacement transformation matrix and the transformation matrix of the ROI area;

[0044] It should be noted that the image acquisition module, displacement calculation module, ROI extraction module, feature matching module and image stitching module of the present invention are in communication connection.

[0045] A third aspect of the present invention provides a readable storage medium for medical image stitching, on which a computer program is stored. When the computer program is executed by a processor, each step in the medical image stitching method described in the first aspect is implemented.

[0046] A fourth aspect of the present invention provides an electronic device for medical image stitching, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the medical image stitching method as described above when executing the computer program.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention uses the phase correlation method to calculate the displacement transformation matrix, and combines the key feature point matching based on scale information iteration to calculate the splicing transformation relationship matrix. In the displacement calculation process, through a series of operations such as image resampling, padding, frequency domain conversion, noise reduction, and cross-power spectrum inverse Fourier transform, the relative displacement information of adjacent images can be accurately obtained, and the displacement can be determined accurately to the pixel level, effectively reducing the splicing error caused by inaccurate displacement calculation;

[0049] When iteratively matching key feature points based on scale information, the present invention can find a more accurate optimal matching relationship by partitioning, calculating scale information multiple times and adjusting the matching relationship, thereby further improving the accuracy of stitching, making the stitched images better consistent in details and overall structure, and providing doctors with more reliable image information for surgical effect evaluation. 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 described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0051] Figure 1 A schematic diagram of the technical process of the medical image stitching method provided by the present invention;

[0052] Figure 2 A schematic diagram of the framework of the computer program in the medical image stitching device provided by the present invention. DETAILED DESCRIPTION

[0053] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] See also Figure 1 The first aspect of the present invention provides a medical image stitching method, comprising:

[0055] S1, obtaining a plurality of X-ray medical images to be stitched and preprocessing them to obtain a plurality of medical images of uniform size;

[0056] S2, using a phase correlation method to calculate the displacement of adjacent images in a number of medical images to obtain a displacement transformation matrix;

[0057] S3, calculating the overlapping area of ​​adjacent images according to the displacement transformation matrix, and obtaining the ROI area of ​​the adjacent images according to the overlapping area using the ROI extraction algorithm;

[0058] S4, extracting key feature points from the ROI area through a feature point extraction algorithm to obtain a number of key feature points;

[0059] S5, iterating the optimal matching relationship of several key feature points based on the scale information, calculating the splicing transformation relationship matrix according to the optimal matching relationship using the feature point matching algorithm, and obtaining the transformation matrix of the ROI area of ​​the adjacent image;

[0060] S6, completing the splicing of several medical images according to the displacement transformation matrix and the transformation matrix of the ROI region.

[0061] In this embodiment, in step S1, a plurality of X-ray medical images to be stitched are obtained, including:

[0062] The mobile C-arm X-ray machine of the image acquisition device is used to sequentially capture the images of the patient's lower limbs by directional translation to obtain lower limb X-ray medical images for stitching, and the two adjacent images should have overlapping areas.

[0063] Exemplarily, the overlapping area of ​​two adjacent images should be no less than 1 / 3 of the image.

[0064] In this embodiment, the phase correlation method is used in step S2 to calculate the displacement of adjacent images in a plurality of medical images, including:

[0065] Firstly, two adjacent images from a number of medical images are sequentially extracted to obtain adjacent images;

[0066] Then, the spacing and size of adjacent images are unified by using image resampling and image padding to obtain unified adjacent images; for example, if the size of one image is 500×500 pixels and the other is 480×520 pixels, through resampling and padding operations, they can both be converted to the same standard size, such as 512×512 pixels, so that when performing subsequent operations such as frequency domain transformation, data processing is more standardized and accurate.

[0067] Next, the unified adjacent images are converted to the frequency domain using the fast Fourier transform, and then the noise reduction is performed in the frequency domain using bandpass frequency domain filtering to obtain the adjacent frequency domain images after noise reduction; the fast Fourier transform is a mathematical tool that converts images from the spatial domain to the frequency domain. In the frequency domain, the frequency components of the image are separated, and the noise usually appears as a high-frequency signal. Bandpass frequency domain filtering can remove noise from the image according to the set frequency range while retaining the main feature information of the image. For example, in medical X-ray images, there may be some high-frequency noise caused by equipment noise or other interference factors. Bandpass filtering can effectively reduce the impact of these noises on displacement calculations and improve the accuracy of calculations.

[0068] Finally, the inverse Fourier transform of the cross power spectrum is performed based on the adjacent frequency domain images after denoising to obtain the inverse Fourier transform matrix, and the maximum peak of the inverse Fourier transform matrix is ​​calculated to obtain the displacement transformation matrix (tx, ty); where tx represents the horizontal displacement of adjacent images, and ty represents the vertical displacement of adjacent images. The cross power spectrum reflects the correlation between the two images in the frequency domain, and its inverse Fourier transform matrix represents the relative displacement information between the images in the spatial domain. By finding the maximum peak of the inverse Fourier transform matrix, the relative displacement of the image in the horizontal and vertical directions can be determined, that is, the displacement transformation matrix (tx, ty) is obtained.

[0069] S3, calculating the overlapping area of ​​adjacent images according to the displacement transformation matrix, and obtaining the ROI area of ​​the adjacent images according to the overlapping area using the ROI extraction algorithm, including:

[0070] First, tx and ty in the displacement transformation matrix represent the relative displacement of adjacent images in the horizontal and vertical directions respectively;

[0071] When tx ≥ 0 is judged, it means that the latter image is displaced in the positive direction (for example, to the right) relative to the previous image in the x direction, then the starting coordinate x of the overlapping area in the previous image is s1 is equal to tx, ending coordinate x e1 is equal to the width w of the medical image itself; the starting coordinate x of the overlapping area in the latter image s2 0, ending coordinate x e2It is equal to the image width w minus tx, because the overlap starts from the shifted position and ends at the boundary of the original width of the image, that is, x s1 =tx,x e1 =w,x s2 =0,x e2 =w-tx;

[0072] When tx<0, that is, the latter image is displaced in the negative direction in the x direction relative to the previous image, the starting coordinate x of the overlapping area in the previous image is s1 Set to 0, the end coordinate xe1 is the image width w plus tx,; the starting coordinate x of the overlapping area in the next image s2 -tx, ending coordinate x e2 Equal to the image width w; that is, x s1 =0,x e1 =w+tx,x s2 =-tx,x e2 =w;

[0073] Similarly, for the vertical direction, when ty ≥ 0, y s1 =ty,y e1 =h,y s2 =0,y e2 =h-ty; otherwise, y s1 =0,y e1 =h+ty,y s2 =-ty,y e2 =h;

[0074] Then, by calculating (x ei -x si ) and (y ei -y si ), we can get the horizontal and vertical dimensions of the overlapping area, i.e., width and height. This determines the range of the overlapping area, including its position (starting coordinates) and size (width and height) in the first image and the second image.

[0075] Then, the ROI extraction algorithm is used to accurately intercept the area from the original adjacent image according to the start coordinates, end coordinates, width and height information of the determined overlapping area, so as to obtain the ROI area of ​​the adjacent image.

[0076] After the ROI region of the adjacent image is obtained, in S4, a feature point extraction algorithm is used to extract key feature points of the ROI region to obtain several key feature points of the ROI region.

[0077] Then in step S5, the optimal matching relationship of several key feature points is iterated based on the scale information, and the splicing transformation relationship matrix is ​​calculated according to the optimal matching relationship using the feature point matching algorithm to obtain the transformation matrix of the ROI area of ​​the adjacent image;

[0078] Specifically, in this embodiment, a plurality of key feature points are first divided into zones to ensure that there is only one key feature point in each zone, and an initial key feature point matching relationship is formed accordingly;

[0079] Then, based on this matching relationship, the scale information of the two ROI area images is calculated, that is, the difference value between the two images. For example, the mean square scale information is the mean square value of the pixel difference between the two images obtained by using the mean square difference calculation formula;

[0080] Then adjust the matching relationship of the key feature points again and repeat the above steps;

[0081] Until the optimal scale information is found and the optimal matching relationship of several key feature points is obtained;

[0082] Finally, according to the optimal matching relationship, a feature point matching algorithm is used, such as the SURF feature point matching algorithm in this embodiment, to calculate the splicing transformation relationship matrix of the ROI regions of the two images to obtain the transformation matrix of the ROI regions of the adjacent images.

[0083] S6, completing the splicing of several medical images according to the displacement transformation matrix and the transformation matrix of the ROI region.

[0084] In step S6, all images are stitched together by stitching adjacent images in sequence, and each stitched image will form an adjacent image with the next image, thus repeating the process continuously to stitch together several medical images into a complete image of the affected area; specifically,

[0085] In this embodiment, initial adjacent images are firstly extracted from a number of medical images to obtain current adjacent images;

[0086] Then the displacement transformation matrix of the current adjacent image and the transformation matrix of the ROI area are combined to obtain the overall transformation matrix;

[0087] Then, the ROI area of ​​the latter image is transformed according to the overall transformation matrix, and the ROI area of ​​the transformed image is spliced ​​onto the former image, so as to complete the splicing of adjacent images and obtain the spliced ​​image;

[0088] Finally, the next image of the current adjacent image is extracted from the plurality of medical images, and the next image is combined with the stitched image to form the current adjacent image, and the above steps are repeated until the stitching of the plurality of medical images is completed.

[0089] See also Figure 2 A second aspect of the present invention provides a medical image stitching device, comprising:

[0090] Image acquisition module: used to sequentially acquire lower limb images by directional translation of a mobile C-arm X-ray machine of an image acquisition device and perform preprocessing to obtain a number of medical images with overlapping areas between two adjacent images;

[0091] Displacement calculation module: used to calculate the displacement of adjacent images in a number of medical images using the phase correlation method to obtain a displacement transformation matrix;

[0092] ROI extraction module: used to calculate the overlapping area of ​​adjacent images according to the displacement transformation matrix, and use the ROI extraction algorithm to obtain the ROI area of ​​the adjacent images according to the overlapping area;

[0093] Feature matching module: used to extract key feature points from the ROI area through a feature point extraction algorithm to obtain several key feature points; and,

[0094] Based on the scale information, the optimal matching relationship of several key feature points is iterated, and the splicing transformation relationship matrix is ​​calculated according to the optimal matching relationship using the feature point matching algorithm to obtain the transformation matrix of the ROI area;

[0095] Image stitching module: used to stitch several medical images according to the displacement transformation matrix and the transformation matrix of the ROI area.

[0096] The medical image stitching method of the present invention is further described below through specific embodiments:

[0097] Step S1, obtaining multiple lower limb X-ray medical images to be stitched. First, use the image acquisition device, a mobile C-arm X-ray machine, to sequentially acquire the patient's lower limb images by directional translation, and obtain the lower limb X-ray medical images (img-1, img-2, img-3, img-n) for stitching. Two adjacent images should have an overlapping area, and the overlapping area of ​​the two images should be no less than 1 / 3 of the image;

[0098] Step S2, use the phase correlation method to estimate the displacement between medical images. First, extract the first two lower limb X-ray medical images img-1 and img-2. If the spacing and size of the two images img-1 and img-2 are inconsistent, unify the spacing and size of the two images through the image resampling algorithm and filling method. Then perform fast Fourier transform on the two images img-1 and img-2 to obtain two frequency domain images img-1-fft and img-2-fft; use Butterworth bandpass frequency domain filtering to reduce noise on the image to eliminate the influence of external factors on image acquisition. Finally, calculate the inverse Fourier transform of the cross power spectrum of the two frequency domain images img-1-fft and img-2-fft, find its maximum peak and obtain the displacement transformation matrix (tx, ty) of the two images;

[0099] Step S3, calculate the overlapping area between the medical images according to the displacement estimation result, and extract the overlapping area as the ROI area. According to the displacement estimation result calculated in step S2, that is, the displacement transformation matrix (tx, ty) of the two images, calculate the position and size of the overlapping area between the two medical images, and extract the overlapping area into ROI area images roi-1 and roi-2 through the ROI area extraction algorithm;

[0100] Step S4, extracting key feature points of the ROI region of the recognition image. The two ROI region images roi-1 and roi-2 extracted in step S3 are subjected to key feature point extraction algorithm to obtain roi-1-f1, roi-1-f2..., roi-1-fm and roi-2-f1, roi-2-f2..., roi-2-fn;

[0101] Step S5, iteratively find the optimal matching relationship of the key feature points based on the scale information, and then calculate the splicing transformation relationship matrix. The key feature points roi-1-f1, roi-1-f2..., roi-1-fm and roi-2-f1, roi-2-f2..., roi-2-fn of the two ROI area images extracted in step S4 are first partitioned to ensure that there is only one key feature point in each area, and the initial key feature point matching relationship is formed accordingly. Based on this matching relationship, the scale information of the two ROI area images is calculated. Adjust the matching relationship of the key feature points again and repeat the above steps; iteratively find the optimal matching relationship of the key feature points; based on the optimal matching relationship, calculate the transformation matrix of the ROI areas of the two medical images.

[0102] Step S6, completing the image stitching according to the displacement estimation and the stitching transformation relationship matrix. According to the transformation matrix of the ROI region of the two medical images calculated in step S5 and the displacement estimation obtained in step S2, the overall transformation matrix is ​​calculated, and the latter image is stitched onto the former image to complete the stitching.

[0103] In this embodiment, when the stitched image of the first two images is obtained, the stitched image is stitched with the third image to be stitched by repeating steps S2-S6 to obtain the stitched image of the first three images, and so on, until the stitching of the last image is completed.

[0104] A third aspect of the present invention provides a readable storage medium for medical image stitching, on which a computer program is stored. When the computer program is executed by a processor, each step of the medical image stitching method of the first aspect is implemented.

[0105] A fourth aspect of the present invention provides an electronic device for medical image stitching, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements each step of the above medical image stitching method when executing the computer program.

[0106] Working principle of the present invention:

[0107] First, multiple lower limb X-ray images to be spliced ​​are obtained, and then the phase correlation method is used to estimate the displacement of two adjacent images. According to the displacement estimation result, the overlapping area of ​​the two images is extracted as the ROI area, and the key feature points of the ROI areas of the two images are extracted and identified, and the optimal matching relationship of the key feature points is iteratively calculated. Based on this, the splicing transformation relationship matrix of the ROI areas of the two images is calculated, and the latter image is spliced ​​onto the former image, and the splicing of other lower limb X-ray images is completed in sequence. The present invention can automatically, accurately and efficiently complete the splicing of lower limb X-ray images, which is convenient for doctors to evaluate the surgical effect of total knee replacement surgery.

[0108] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A medical image stitching method, characterized in that: include: S1, obtaining a plurality of X-ray medical images to be stitched and preprocessing them to obtain a plurality of medical images of uniform size; S2, using a phase correlation method to calculate the displacement of adjacent images in a number of medical images to obtain a displacement transformation matrix; S3, calculating the overlapping area of ​​adjacent images according to the displacement transformation matrix, and obtaining the ROI area of ​​the adjacent images according to the overlapping area using the ROI extraction algorithm; S4, extracting key feature points from the ROI area through a feature point extraction algorithm to obtain a number of key feature points; S5, iterating the optimal matching relationship of several key feature points based on the scale information, calculating the splicing transformation relationship matrix according to the optimal matching relationship using the feature point matching algorithm, and obtaining the transformation matrix of the ROI area of ​​the adjacent image; S6, completing the splicing of several medical images according to the displacement transformation matrix and the transformation matrix of the ROI region.

2. The medical image stitching method according to claim 1, characterized in that: The phase correlation method is used to calculate the displacement of adjacent images in a plurality of medical images, including: S2-1, sequentially extracting two adjacent images from a plurality of medical images to obtain adjacent images; S2-2, after converting the adjacent images into the frequency domain by using fast Fourier transform, performing noise reduction processing in the frequency domain by using bandpass frequency domain filtering to obtain adjacent frequency domain images after noise reduction; S2-3, based on the adjacent frequency domain images after denoising, an inverse Fourier transform is performed on the cross power spectrum to obtain an inverse Fourier transform matrix, and the maximum peak value of the inverse Fourier transform matrix is ​​calculated to obtain a displacement transformation matrix (tx, ty); wherein tx represents the horizontal displacement of adjacent images, and ty represents the vertical displacement of adjacent images.

3. The medical image stitching method according to claim 1, characterized in that: The step of calculating the overlapping area of ​​adjacent images according to the displacement transformation matrix includes: S3-1, calculating the starting coordinates (x si ,y si ) and the end coordinate (x ei ,y ei ); wherein i=1, 2, respectively represent the indexes of the first image and the second image, the first image represents the previous image in the adjacent images, and the second image represents the next image in the adjacent images; S3-2, calculate (x ei -x si ) and (y ei -y si ), and obtain the overlapping area; wherein the overlapping area includes the starting coordinates, ending coordinates, width and height of the overlapping area on the first image and the second image respectively.

4. The medical image stitching method according to claim 3, characterized in that: The starting coordinates (x si ,y si ) includes: When i=1: Determine whether tx is greater than or equal to 0; if so, then x s1 =tx; otherwise, x s1 =0; Determine whether ty is greater than or equal to 0; if so, then y s1 =ty; otherwise, y s1 =0; When i=2: Determine whether tx is greater than or equal to 0; if so, then x s2 =0; otherwise, x s2 = -tx; Determine whether ty is greater than or equal to 0; if so, then y s2 =0; otherwise, y s2 =-ty; Wherein, w represents the width of the medical image, and h represents the height of the medical image.

5. The medical image stitching method according to claim 3, characterized in that: The end coordinate (x ei ,y ei ) includes: When i=1: Determine whether tx is greater than or equal to 0; if so, then x e1 =w; otherwise, x e1 =w+tx; Determine whether ty is greater than or equal to 0; if so, then y e1 =h; otherwise, y e1 =h+ty; When i=2: Determine whether tx is greater than or equal to 0; if so, then x e2 =w-tx; otherwise, x e2 =w; Determine whether ty is greater than or equal to 0; if so, then y e2 =h-ty; otherwise, y e2 =h.

6. The medical image stitching method according to claim 1, characterized in that: The iterative method of obtaining the optimal matching relationship of a plurality of key feature points based on the scale information includes: S5-1, partitioning a number of key feature points to obtain a number of initial partitions, and performing feature matching on a number of key points using a feature point matching algorithm based on the initial partitions to obtain a transformation relationship matrix; S5-2, transforming the ROI region according to the transformation relationship matrix to obtain a transformed ROI region; S5-3, calculate the scale information of the transformed ROI area, and repeat S5-1 to S5-3 until the optimal scale information is found to obtain the optimal matching relationship of several key feature points; wherein the scale information represents the difference value between the two images.

7. The medical image stitching method according to claim 1, characterized in that: The method of completing the splicing of a plurality of medical images according to the displacement transformation matrix and the transformation matrix of the ROI region includes: S6-1, extracting initial adjacent images from a plurality of medical images to obtain current adjacent images; S6-2, combining the displacement transformation matrix of the current adjacent image and the transformation matrix of the ROI region to obtain an overall transformation matrix; S6-3, transforming the ROI region of the second image according to the overall transformation matrix, and splicing the transformed ROI region of the second image onto the first image, completing the splicing of adjacent images to obtain a spliced ​​image; S6-4, extracting the next image of the current adjacent image from the plurality of medical images, and combining it with the spliced ​​image to form the current adjacent image, and repeating S6-1 to S6-4 until the splicing of the plurality of medical images is completed.

8. A medical image stitching device, characterized in that: include: Image acquisition module: used to sequentially acquire lower limb images by directional translation of a mobile C-arm X-ray machine of an image acquisition device and perform preprocessing to obtain a number of medical images with overlapping areas between two adjacent images; Displacement calculation module: used to calculate the displacement of adjacent images in a number of medical images using the phase correlation method to obtain a displacement transformation matrix; ROI extraction module: used to calculate the overlapping area of ​​adjacent images according to the displacement transformation matrix, and use the ROI extraction algorithm to obtain the ROI area of ​​the adjacent images according to the overlapping area; Feature matching module: used to extract key feature points from the ROI area through a feature point extraction algorithm to obtain several key feature points; and, Based on the scale information, the optimal matching relationship of several key feature points is iterated, and the splicing transformation relationship matrix is ​​calculated according to the optimal matching relationship using the feature point matching algorithm to obtain the transformation matrix of the ROI area; Image stitching module: used to stitch several medical images according to the displacement transformation matrix and the transformation matrix of the ROI area.

9. A readable storage medium for medical image stitching, on which a computer program is stored, characterized in that: When the computer program is executed by a processor, each step of the medical image stitching method according to any one of claims 1 to 7 is implemented.

10. An electronic device for medical image stitching, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step of the medical image stitching method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image matching method and video processing method

    CN105447841A

  • Real-time image splicing method for police unmanned aerial vehicle investigation and evidence obtaining

    CN106683046A

  • Automatic registering and fused splicing method of multiple images

    CN106886977A

  • Image stitching method for focal plane terahertz imaging

    CN108537735A

  • A method for calculating the basic matrix of binocular camera based on region division

    CN109242911A