Image matching method and device
By removing non-target areas, segmentation and corrosion treatment in the CT image, the overlapping area of the target area is determined, and the problem of low matching efficiency and accuracy of CT image is solved, and more efficient organ and lesion recognition is achieved.
Patent Information
- Application Number
- CN202010677668.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-14
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-01-03
AI Technical Summary
When doctors compare CT images at different time points, it is difficult for doctors to accurately identify and match lung organs and lesions, resulting in low efficiency and low accuracy. The existing technology has not effectively solved this problem.
By removing the non-target area in the target image to be matched, threshold segmentation, corrosion and area communication processing are performed, and matching images are determined to be matched when the overlap area of the target area is the largest, so as to improve recognition and matching efficiency.
It improves the matching efficiency and accuracy of CT images, facilitates doctors to compare organ changes at different time points, and solves the problems of low efficiency and low accuracy caused by relying on personal experience.
Smart Images

Figure CN111898657B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image matching method and device. Background Art
[0002] CT (Computed Tomography) images are a common means of determining the location and specific conditions of lesions. Doctors usually need to visually inspect CT images based on their experience to determine the lesions and infer the condition. Due to interference from medical devices, visceral activity and growth, the morphology of lung CT images obtained at different times for the same patient can vary greatly, making it more difficult for doctors to follow up on lung diseases. Doctors visually compare different CT images, resulting in low efficiency and accuracy in identifying organs and lesions based on CT images.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide an image matching method and device to at least solve the technical problem in the related art that an observer is required to autonomously identify and match organs and parts in CT images of different periods, which completely relies on personal experience, has low efficiency and low accuracy.
[0005] According to one aspect of an embodiment of the present invention, there is provided an image matching method, comprising: removing non-target areas in a plurality of target images to be matched, and determining a target area to be matched in the target image; matching the plurality of target images according to the target area, and determining a matching image in which the target areas of the plurality of target images are superimposed when the overlapping area of the target areas of the plurality of target images is the largest.
[0006] Optionally, non-target areas in multiple target images to be matched are removed, and determining the target area to be matched in the target image includes: performing threshold segmentation processing on the target image to generate a binary image of the target image; performing an erosion operation on the binary image of the target image to remove adhesion of various parts of the binary image; removing non-target areas in the binary image by means of area generation to determine the target area of the target image.
[0007] Optionally, performing threshold segmentation processing on the target image to generate a binary image of the target image includes: performing threshold segmentation on the target image through a threshold segmentation algorithm to determine an optimal threshold of the target image; judging whether the optimal threshold is within a preset threshold range; when the optimal threshold is within the preset threshold range, performing threshold segmentation on the target image according to the optimal threshold to generate the binary image; when the optimal threshold is not within the preset threshold range, arbitrarily specifying a value within the preset threshold range as the optimal threshold, and generating the binary image according to the specified optimal threshold.
[0008] Optionally, before performing an erosion operation on the binary image of the target image to remove adhesions between the parts of the binary image, the method further includes: performing downsampling processing on the binary image of the target image; and performing hole filling processing on the binary image after the downsampling processing.
[0009] Optionally, matching multiple target images according to the target area to determine a case where an overlapping area of the target areas of the multiple target images is the largest, the matching image of the target areas of the multiple target images superimposed includes: determining multiple components of the target area of each target image; matching multiple target images according to the multiple components to determine a matching image of the target areas of the multiple target images superimposed.
[0010] Optionally, determining the multiple components of the target area of each of the target images includes: performing region connectivity processing on the target area of the target image to determine multiple connected areas of the target area of the target image; and respectively determining the components corresponding to the multiple connected areas.
[0011] Optionally, separately determining components corresponding to multiple connected areas includes: determining bounding boxes of multiple connected areas; when sizes of the bounding boxes of multiple connected areas do not exceed a preset size threshold, determining a size relationship between the sizes of the bounding boxes of the multiple connected areas; when the size relationship between the sizes of the bounding boxes is the same as the size relationship between the real sizes of the multiple components, determining that the real component corresponding to the bounding box corresponds to the connected area corresponding to the bounding box.
[0012] Optionally, performing regional connectivity processing on the target area of the target image to determine multiple connected areas of the target area of the target image includes: performing eight-connectivity processing on the target area of the target image to determine multiple connected areas and bounding boxes of each connected area; determining whether the size of the bounding box of the connected area meets a preset condition, and if the size of the bounding box does not meet the preset condition, discarding the connected area; if the size of the bounding box meets the preset condition, retaining the connected area; determining whether the size of the bounding box of the connected area exceeds a preset size threshold, and if the size of the bounding box exceeds a second preset size threshold, performing an erosion operation on the connected area, performing eight-connectivity processing, and determining multiple connected areas.
[0013] Optionally, before performing region connectivity processing on the target region of the target image and determining a plurality of connected regions of the target region of the target image, the method further includes: performing an opening operation reconstruction processing on the target region of the target image.
[0014] Optionally, after performing regional connectivity processing on the target area of the target image and determining multiple connected areas of the target area of the target image, the method further includes: dilating the target area of the target image after the regional connectivity processing; and performing shape repair on the target image after the dilation processing based on the initial target image after downsampling processing and hole filling.
[0015] According to another aspect of an embodiment of the present invention, an image matching device is also provided, including: a determination module, used to remove non-target areas in multiple target images to be matched, and determine the target area that needs to be matched in the target image; a matching module, used to match the multiple target images according to the target area, and determine a matching image in which the target areas of the multiple target images are superimposed when the overlapping area of the target areas of the multiple target images is the largest.
[0016] According to another aspect of an embodiment of the present invention, a storage medium is further provided, the storage medium comprising a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute any one of the above-mentioned image matching methods.
[0017] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned image matching methods when running.
[0018] In an embodiment of the present invention, non-target areas in multiple target images to be matched are removed to determine the target area to be matched in the target image; multiple target images are matched according to the target area to determine that the target areas of the multiple target images have the largest overlapping area, and the target areas of the multiple target images are superimposed in a matching image manner; the target areas of different multiple target images are matched to determine the position with the largest overlapping area, which is the heaviest and matching result of the multiple target images; and multiple target areas are superimposed to effectively determine the similarities and differences of the target areas of the multiple target images, thereby facilitating comparative observation, thereby achieving the technical effect of improving recognition and matching efficiency and improving accuracy, and further solving the technical problem in the related art that the observer needs to autonomously identify and match organs and parts in CT images of different periods, which depends entirely on personal experience, and has low efficiency and low accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0020] Figure 1 is a flow chart of an image matching method according to an embodiment of the present invention;
[0021] Figure 2 is a flow chart of a lung CT image registration method according to an embodiment of the present invention;
[0022] Figure 3-1 is a schematic diagram of a transverse position of a first lung image after threshold segmentation processing according to an embodiment of the present invention;
[0023] Figure 3-2 is a schematic diagram of a coronal view of a first lung image after threshold segmentation processing according to an embodiment of the present invention;
[0024] Figure 3-3 is a schematic diagram of a sagittal position of a first lung image after threshold segmentation processing according to an embodiment of the present invention;
[0025] Figure 3-4 is a schematic diagram of a transverse position of a second lung image after threshold segmentation processing according to an embodiment of the present invention;
[0026] Figure 3-5 is a schematic diagram of a coronal view of a second lung image after threshold segmentation processing according to an embodiment of the present invention;
[0027] Figure 3-6 is a schematic diagram of a sagittal position of a second lung image after threshold segmentation processing according to an embodiment of the present invention;
[0028] Figure 4-1 is a schematic diagram of a cross-sectional view of a first image after downsampling and hole filling according to an embodiment of the present invention;
[0029] Figure 4-2 is a schematic diagram of a coronal position of a first image after downsampling and hole filling according to an embodiment of the present invention;
[0030] Figure 4-3 is a schematic diagram of a sagittal position of a first image after downsampling and hole filling according to an embodiment of the present invention;
[0031] Figure 4-4 is a schematic diagram of a transverse position of a second image after downsampling and hole filling according to an embodiment of the present invention;
[0032] Figure 4-5 is a schematic diagram of a coronal position of a second image after downsampling and hole filling according to an embodiment of the present invention;
[0033] Figure 4-6 is a schematic diagram of a sagittal position of a second image after downsampling and hole filling according to an embodiment of the present invention;
[0034] Figure 5-1 is a schematic diagram of a first image cross-section after removing a non-lung area according to an embodiment of the present invention;
[0035] Figure 5-2 is a schematic diagram of a coronal position of a first image after removing a non-lung area according to an embodiment of the present invention;
[0036] Figure 5-3 is a schematic diagram of a sagittal position of a first image after removing a non-lung area according to an embodiment of the present invention;
[0037] Figure 5-4 is a schematic diagram of a transverse section of a second image after removing a non-lung area according to an embodiment of the present invention;
[0038] Figure 5-5 is a schematic diagram of a coronal position of a second image after removing a non-lung area according to an embodiment of the present invention;
[0039] Figure 5-6 is a schematic diagram of a sagittal position of a second image after removing a non-lung area according to an embodiment of the present invention;
[0040] Figure 6-1 is a schematic diagram of a transverse position of a first image after opening operation reconstruction according to an embodiment of the present invention;
[0041] Figure 6-2 is a schematic diagram of a coronal position of a first image reconstructed by an opening operation according to an embodiment of the present invention;
[0042] Figure 6-3is a schematic diagram of a sagittal position of a first image reconstructed by an opening operation according to an embodiment of the present invention;
[0043] Figure 6-4 is a schematic diagram of a transverse position of a second image reconstructed by an opening operation according to an embodiment of the present invention;
[0044] Figure 6-5 is a schematic diagram of a coronal position of a second image reconstructed by an opening operation according to an embodiment of the present invention;
[0045] Figure 6-6 is a schematic diagram of a sagittal position of a second image reconstructed by an opening operation according to an embodiment of the present invention;
[0046] Figure 7-1 is a schematic diagram of a transverse position of a first region of a first image after connected region analysis according to an embodiment of the present invention;
[0047] Figure 7-2 is a schematic diagram of a coronal position of a first region of a first image after connected region analysis according to an embodiment of the present invention;
[0048] Figure 7-3 is a schematic diagram of a sagittal position of a first region of a first image after connected region analysis according to an embodiment of the present invention;
[0049] Figure 7-4 is a schematic diagram of a transverse position of a second region of a first image after connected region analysis according to an embodiment of the present invention;
[0050] Figure 7-5 is a schematic diagram of a coronal position of a second region of a first image after connected region analysis according to an embodiment of the present invention;
[0051] Figure 7-6 is a schematic diagram of a sagittal position of a second region of a first image after connected region analysis according to an embodiment of the present invention;
[0052] Figure 7-7 is a schematic diagram of a transverse position of a first region of a second image after connected region analysis according to an embodiment of the present invention;
[0053] Figure 7-8 is a schematic diagram of a coronal position of a first region of a second image after connected region analysis according to an embodiment of the present invention;
[0054] Figure 7-9 is a schematic diagram of a sagittal position of a first region of a second image after connected region analysis according to an embodiment of the present invention;
[0055] Figure 7-10 is a schematic diagram of a transverse position of a second region of a second image after connected region analysis according to an embodiment of the present invention;
[0056] Figure 7-11is a schematic diagram of a coronal position of a second region of a second image after connected region analysis according to an embodiment of the present invention;
[0057] Figure 7-12 is a schematic diagram of a sagittal position of a second region of a second image after connected region analysis according to an embodiment of the present invention;
[0058] Figure 8-1 is a schematic diagram of a transverse section of a first region of a first image after shape restoration according to an embodiment of the present invention;
[0059] Figure 8-2 is a schematic diagram of a coronal view of a first region of a first image after shape restoration according to an embodiment of the present invention;
[0060] Figure 8-3 is a schematic diagram of a sagittal position of a first region of a first image after shape restoration according to an embodiment of the present invention;
[0061] Figure 8-4 is a schematic diagram of a transverse section of a second region of a first image after shape restoration according to an embodiment of the present invention;
[0062] Figure 8-5 is a schematic diagram of a coronal view of a second region of a first image after shape restoration according to an embodiment of the present invention;
[0063] Figure 8-6 is a schematic diagram of a sagittal position of a second region of a first image after shape restoration according to an embodiment of the present invention;
[0064] Figure 8-7 is a schematic diagram of a transverse section of a first region of a second image after shape restoration according to an embodiment of the present invention;
[0065] Figure 8-8 is a schematic diagram of a coronal view of a first region of a second image after shape restoration according to an embodiment of the present invention;
[0066] Figure 8-9 is a schematic diagram of a sagittal position of a first region of a second image after shape restoration according to an embodiment of the present invention;
[0067] Figure 8-10 is a schematic diagram of a transverse section of a second region of a second image after shape restoration according to an embodiment of the present invention;
[0068] Figure 8-11 is a schematic diagram of a coronal view of a second region of a second image after shape restoration according to an embodiment of the present invention;
[0069] Figure 8-12 is a schematic diagram of a sagittal position of a second region of a second image after shape restoration according to an embodiment of the present invention;
[0070] Figure 9-1is a schematic diagram of a left lung transverse section of a first image according to an embodiment of the present invention;
[0071] Figure 9-2 is a schematic diagram of a left lung coronal position of a first image according to an embodiment of the present invention;
[0072] Figure 9-3 is a schematic diagram of a left lung sagittal position of a first image according to an embodiment of the present invention;
[0073] Figure 9-4 is a schematic diagram of a right lung transverse section of a first image according to an embodiment of the present invention;
[0074] Figure 9-5 is a schematic diagram of a right lung coronal position of a first image according to an embodiment of the present invention;
[0075] Figure 9-6 is a schematic diagram of a sagittal view of the right lung of a first image according to an embodiment of the present invention;
[0076] Figure 9-7 is a schematic diagram of a left lung transverse section of a second image according to an embodiment of the present invention;
[0077] Figure 9-8 is a schematic diagram of a left lung coronal position of a second image according to an embodiment of the present invention;
[0078] Figure 9-9 is a schematic diagram of a left lung sagittal position of a second image according to an embodiment of the present invention;
[0079] Figure 9-10 is a schematic diagram of a right lung transverse section of a second image according to an embodiment of the present invention;
[0080] Figure 9-11 is a schematic diagram of a right lung coronal position of a second image according to an embodiment of the present invention;
[0081] Figure 9-12 is a schematic diagram of a sagittal view of the right lung of a second image according to an embodiment of the present invention;
[0082] Figure 10-1 is a schematic diagram of a registration result of a left lung transverse position of a first image according to an embodiment of the present invention;
[0083] Figure 10-2 is a schematic diagram of a registration result of the left lung coronal position of the first image according to an embodiment of the present invention;
[0084] Figure 10-3 is a schematic diagram of a registration result of the left lung sagittal position of the first image according to an embodiment of the present invention;
[0085] Figure 10-4 is a schematic diagram of a registration result of a right lung transverse section of a first image according to an embodiment of the present invention;
[0086] Figure 10-5 is a schematic diagram of a registration result of the right lung coronal position of the first image in an embodiment of the present invention;
[0087] Figure 10-6 is a schematic diagram of a registration result of the sagittal plane of the right lung of the first image according to an embodiment of the present invention;
[0088] Figure 10-7 is a schematic diagram of a registration result of a left lung transverse position of a second image according to an embodiment of the present invention;
[0089] Figure 10-8 is a schematic diagram of a registration result of the left lung coronal position of the second image according to an embodiment of the present invention;
[0090] Figure 10-9 is a schematic diagram of a registration result of the left lung sagittal plane of the second image according to an embodiment of the present invention;
[0091] Figure 10-10 is a schematic diagram of a registration result of a right lung transverse section of a second image according to an embodiment of the present invention;
[0092] Figure 10-11 is a schematic diagram of a registration result of the right lung coronal position of the second image according to an embodiment of the present invention;
[0093] Figure 10-12 is a schematic diagram of a registration result of a sagittal plane of the right lung of a second image according to an embodiment of the present invention;
[0094] Fig.11 is a schematic diagram of an image matching device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0095] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0096] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0097] According to an embodiment of the present invention, a method embodiment of an image matching method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0098] Figure 1 is a flow chart of an image matching method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0099] Step S102, removing non-target areas in the multiple target images to be matched, and determining the target area to be matched in the target image;
[0100] Step S104 , matching the multiple target images according to the target area, and determining a matching image in which the target areas of the multiple target images are superimposed when the overlapping area of the target areas of the multiple target images is the largest.
[0101] Through the above steps, the non-target areas in the multiple target images to be matched are removed to determine the target area to be matched in the target image; the multiple target images are matched according to the target area to determine that the overlapping area of the target areas of the multiple target images is the largest, and the target areas of the multiple target images are superimposed in a matching image manner, and the target areas of different multiple target images are matched to determine the position with the largest overlapping area, which is the heaviest and matching result of the multiple target images. By superimposing multiple target areas, the similarities and differences of the target areas of the multiple target images are effectively determined, and the purpose of facilitating comparative observation is achieved, thereby achieving the technical effect of improving recognition and matching efficiency and improving accuracy, and further solving the technical problem in the related technology that the observer needs to autonomously identify and match the organs and parts in CT images of different periods, which depends entirely on personal experience, is inefficient, and has low accuracy.
[0102] The target image may be a computed tomography (CT) image, and the target region of the CT image may be a region of a target organ, such as a lung region, including the left lung and the right lung. The non-target region may include the background of the CT image or the region of other scanned organs. The non-target region in the CT image is removed by an algorithm, and the CT image is matched with respect to the target region. When it is determined that the overlap area of the target region is the largest, multiple target images are matched to generate a matching image.
[0103] The above-mentioned multiple target images may be images of the target area at different periods, that is, CT images of the target organ at different periods. By matching the CT images of multiple target organs and superimposing them to generate matching images, the images of the target organs at multiple periods can be superimposed together for comparison, which more vividly reflects the changes in the target area at different periods, thereby facilitating doctors' interpretation, improving recognition and matching efficiency, and improving accuracy.
[0104] Optionally, non-target areas in multiple target images to be matched are removed, and determining the target area to be matched in the target image includes: performing threshold segmentation processing on the target image to generate a binary image of the target image; performing an erosion operation on the binary image of the target image to remove adhesion between parts of the binary image; removing non-target areas in the binary image by region generation to determine the target area of the target image.
[0105] The OTSU threshold segmentation algorithm can be to use a threshold to divide the histogram into two parts. When the variance of the two parts is the largest, the optimal threshold is obtained for segmentation. This method has a good segmentation effect when the CT values of the target and the background are greatly different, but sometimes the CT image quality is poor and the difference between the two is not obvious. The OTSU threshold segmentation cannot effectively separate the target from the background. This embodiment uses the OTSU threshold segmentation algorithm combined with the specified threshold for segmentation, which can further improve the effect of threshold segmentation on CT images.
[0106] The binary image obtained by the above threshold segmentation will include air, target organs, such as lung parenchyma, trachea, background bed, etc. Some target areas and non-target areas may be adhered to each other. For example, lung parenchyma and air may be adhered to each other, which will result in the removal of the target area when the non-target area is removed. Therefore, it is necessary to perform an erosion operation on the binary image after the above threshold segmentation. Specifically, a circular template with a radius of r is used to erode the binary image to remove the adhesion between the target area and the non-target area.
[0107] The target area and non-target area in the binary image after de-adhesion are basically separated. The non-target area can be removed by the region growing algorithm, and only the target area is retained. Specifically, the four edges of the first layer of the image at three angles of the CT image are used as seed points for region growing. Usually, the CT image performs a tomographic scan on the same target object to generate images at three angles, including the transverse, coronal, and sagittal planes.
[0108] Optionally, performing threshold segmentation processing on the target image to generate a binary image of the target image includes: performing threshold segmentation on the target image through a threshold segmentation algorithm to determine the optimal threshold of the target image; judging whether the optimal threshold is within a preset threshold range; when the optimal threshold is within the preset threshold range, performing threshold segmentation on the target image according to the optimal threshold to generate a binary image; when the optimal threshold is not within the preset threshold range, arbitrarily specifying a value within the preset threshold range as the optimal threshold, and generating a binary image according to the specified optimal threshold.
[0109] Specifically, the OTSU threshold segmentation algorithm is combined with the specified threshold method for segmentation. OTSU is used to perform threshold segmentation on the three-dimensional CT image to obtain the optimal threshold T; determine whether T is within the preset CT value (-1024 to -400) of the lung parenchyma; if T is within the preset CT value of the lung parenchyma, proceed directly to the next step; if T is not within the preset CT value of the lung parenchyma, specify the preset Tmin=-1024 and Tmax=-400 to perform threshold segmentation on the above CT image, and finally obtain a binary image with background and target separated.
[0110] Optionally, before performing an erosion operation on the binary image of the target image to remove adhesions between the parts of the binary image, the method further includes: performing downsampling processing on the binary image of the target image; and performing hole filling processing on the binary image after the downsampling processing.
[0111] This embodiment only needs to roughly segment the target area and perform a downsampling operation on the binary image after threshold segmentation, which does not affect the accuracy of registration and can reduce the program running time.
[0112] Since the binary image will be eroded in the next step, in order to avoid excessive corrosion of the target area and make it unrecoverable, the holes of the binary image are filled before the corrosion operation to improve the corrosion resistance of the target area.
[0113] Optionally, matching multiple target images according to the target area to determine that the overlapping area of the target areas of the multiple target images is the largest, the matching image with the target areas of the multiple target images superimposed includes: determining multiple components of the target area of each target image; matching multiple target images according to the multiple components to determine that the overlapping area of the target areas of the multiple target images is the largest, the matching image with the target areas of the multiple target images superimposed.
[0114] The above-mentioned target area may include multiple components, for example, the components of the lung area include the left lung and the right lung. The target image is matched according to the multiple components, that is, the components of the target image are matched with the components of other target images, for example, the left lung of the target image is matched with the left lung of other target images, and the right lung of the target image is matched with the right lung of other target images. When the overlapping area of the target areas of different target images is the largest, the target areas of the multiple target images are superimposed to determine the matching image. Thereby, the images of the target organs at multiple periods are superimposed together for comparison, which more vividly reflects the changes in the target area at different periods, thereby facilitating the doctor's interpretation, improving the recognition and matching efficiency, and improving the accuracy.
[0115] Multiple target images are matched according to multiple components to determine that the overlapping area of the target regions of the multiple target images is the largest. This can be done by matching multiple components of the target region one by one. For example, the target region is a lung region, and the components of the lung region include a left lung and a right lung. The left lung is matched first to determine that the overlapping area of the left lung of the target image and the left lungs of other target images is the largest. After the left lung is matched, the right lung is matched to determine that the overlapping area of the right lung of the target image and the right lungs of other target images is the largest.
[0116] In the process of component registration, multiple operations such as scaling, rotation, and translation can be performed successively. By scaling, the corresponding component areas of the target regions of different target images are first made to be of the same level and comparable. Then, rotation and translation operations are performed to find the position where the corresponding component areas of the target regions of different target images have the largest overlap area.
[0117] For example, in the above-mentioned left lung matching process, the enclosing box of the left lung of the first image and the enclosing box of the left lung of the second image are first used to calculate the scaling ratio and obtain the transformation matrix parameters as the initial parameters; on the basis of the initial parameters, a rotation operation is performed around the image center within the preset arc range to calculate the overlapping area of the left lung of the first image and the left lung of the second image, and the transformation matrix parameters when the area is maximally overlapped are selected as intermediate parameters; on the basis of the intermediate parameters, a translation operation is performed within the preset translation range to calculate the overlapping area of the left lung of the first image and the right lung of the second image, and the transformation matrix parameters when the area is maximally overlapped are selected as final parameters; the right lung registration operation is the same as above, and the images of the same patient at different times can be the first image and the second image respectively, and finally a total of four transformation matrix parameters are obtained and the results are saved. At this point, this embodiment uses the final transformation matrix parameters to generate the final matching image.
[0118] Optionally, determining the multiple components of the target area of each target image includes: performing region connectivity processing on the target area of the target image to determine multiple connected areas of the target area of the target image; and respectively determining the components corresponding to the multiple connected areas.
[0119] The target area of the target image is subjected to regional interconnection processing to obtain multiple connected areas. The size of the connected area is calculated through a bounding box and compared with the size of a preset component. If the conditions are met, the connected area is determined to be the component.
[0120] Optionally, respectively determining components corresponding to multiple connected areas includes: determining bounding boxes of the multiple connected areas; when the sizes of the bounding boxes of the multiple connected areas do not exceed a preset size threshold, determining a size relationship between the sizes of the bounding boxes of the multiple connected areas; when the size relationship between the sizes of the bounding boxes is the same as the size relationship between the sizes of the real multiple components, determining that the real component corresponding to the bounding box corresponds to the connected area corresponding to the bounding box.
[0121] The sizes of the bounding boxes of multiple connected areas do not exceed the preset size threshold, that is, the size of the connected area shall not be larger than the size of the largest component. The above preset size threshold may be the size of the largest component to prevent the connected area from including multiple different components, which may lead to analysis errors.
[0122] When the size relationship of the bounding box is the same as the size relationship of the real multiple components, it is determined that the real components corresponding to the bounding box correspond to the connected areas corresponding to the bounding box. For example, the target area is the lung area, and the components are the left lung and the right lung.
[0123] The largest and second largest connected areas among multiple connected areas are selected and recorded as the first area and the second area; the bounding box of the first area is calculated, and if the width of the bounding box meets the size condition, the first area and the second area are the left lung and right lung parenchyma images, respectively, wherein the size of the left lung is preset to be larger than that of the right lung.
[0124] Optionally, performing regional connectivity processing on the target area of the target image to determine multiple connected areas of the target area of the target image includes: performing eight-connectivity processing on the target area of the target image to determine multiple connected areas and bounding boxes of each connected area; determining whether the size of the bounding box of the connected area meets a preset condition, and discarding the connected area if the size of the bounding box does not meet the preset condition; retaining the connected area if the size of the bounding box meets the preset condition; determining whether the size of the bounding box of the connected area exceeds a preset size threshold, and performing an erosion operation on the connected area if the size of the bounding box exceeds the preset size threshold, performing eight-connectivity processing on the connected area, and determining multiple connected areas.
[0125] The above preset conditions may be that the width of the bounding box is greater than a first width value preset in advance, or the aspect ratio of the bounding box is greater than a preset aspect ratio value, or the minimum height of the bounding box is greater than half of the image height, then the above connected domain value on the binary image is set to 0, that is, the connected area is discarded, which is similar to the removal of the non-target area.
[0126] While retaining the connected area, determine whether the size of the bounding box of the connected area exceeds the preset size threshold. If it exceeds, it means that the above-mentioned connected area includes multiple different components. Therefore, the connected area is re-eroded, eight-connected processing is performed, and multiple connected areas are re-determined.
[0127] Optionally, before performing region connectivity processing on the target region of the target image and determining a plurality of connected regions of the target region of the target image, the method further includes: performing an opening operation reconstruction processing on the target region of the target image.
[0128] Opening reconstruction can correctly restore the shape of the object retained after corrosion, fill holes, and remove all targets connected to the image boundary. Therefore, opening reconstruction in this step can effectively improve the segmentation effect of lung parenchyma.
[0129] Optionally, after performing regional connectivity processing on the target area of the target image and determining multiple connected areas of the target area of the target image, the method further includes: dilating the target area of the target image after the regional connectivity processing; and performing shape repair on the dilated target image based on the initial target image after downsampling processing and hole filling.
[0130] Since the corrosion operation is performed during the connected domain analysis, which will affect the size and shape of the lung parenchyma area, we first dilate the image, and then perform a logical AND operation on the dilated image and the image after downsampling and hole filling after the above threshold segmentation to complete the shape repair.
[0131] It should be noted that this embodiment also provides an optional implementation, which is described in detail below.
[0132] The incidence and mortality of lung cancer in China are both the highest among all kinds of malignant tumors, and it has posed a huge threat to the health of residents. Clinically, the cure rate of early lung cancer is as high as over 90%. Early detection of lung abnormalities can control the disease and reduce mortality. The early detection and diagnosis of small lung nodules (3-30mm in diameter) are of great significance for the early diagnosis and treatment of lung cancer. Effective differential diagnosis of lung nodules, rapid identification of benign and malignant nodules, early removal of malignant nodules, and avoiding unnecessary overtreatment are the keys to the diagnosis and treatment of lung nodules. Therefore, it is crucial to follow up and compare the patient's small lung nodules and observe the growth of the nodules and the benign and malignant changes for the timely treatment of lung nodules.
[0133] In the actual diagnosis and treatment process, doctors have difficulty observing the changes of pulmonary nodules through lung CT images due to interference from medical devices, lung breathing and growth, etc. Therefore, a fast and accurate image registration algorithm can help doctors locate the location of pulmonary nodules in the same patient at different examination periods more quickly and accurately, improving the detection efficiency and accuracy of doctors.
[0134] Due to the interference of medical devices, lung breathing and growth, the morphology of lung CT images obtained at different times for the same patient can be quite different, which increases the difficulty for doctors to follow up on lung diseases. Therefore, we propose a lung CT image registration method based on the minimum bounding box. First, the first image (i.e., fixed image, which remains in place during registration) and the second image (i.e., moving image, which moves during registration to determine the final registration position) are segmented to obtain the left and right lung parenchyma binary images and bounding boxes (BoundingBox) of the first image and the second image. Then, the bounding boxes of the two images are used to calculate the TransformMatrix parameters of the initial registration of the left and right lung parenchyma, and then the initial registration image is fine-tuned (rotated, translated) within a small range to obtain the TransformMatrix parameters when the overlap area is the largest, completing the lung registration. The above TransformMatrix is a function of element transformation in CCS, and its essence is to transform the image through a matrix.
[0135] Figure 2is a flow chart of a lung CT image registration method according to an embodiment of the present invention, such as Figure 2 As shown, this embodiment provides a lung CT image registration method based on a minimum bounding box, which is as follows:
[0136] 1. Threshold segmentation
[0137] The basic principle of the OTSU threshold segmentation algorithm is: use the threshold to divide the histogram into two parts, and when the variance of the two parts is the largest, the optimal threshold is obtained for segmentation. This method has a good segmentation effect when the CT value difference between the target and the background is large, but sometimes the CT quality is poor and the difference between the two is not obvious. Using OTSU for threshold segmentation cannot effectively separate the target from the background. Therefore, this method uses a method combining OTSU with a specified threshold for segmentation. The above OTSU algorithm is an efficient algorithm for binarization of a squadron image proposed by Japanese scholar OTSU. The specific steps are:
[0138] (1) Use OTSU to perform threshold segmentation on the 3D CT image and obtain the optimal threshold T;
[0139] (2) Determine whether T is within the range of lung parenchymal CT values (-1024 to -400);
[0140] (3) If it is, proceed directly to the next step. If not, specify Tmin = -1024 and Tmax = -400 for threshold segmentation. Finally, a binary image with background and target separated is obtained, such as Figure 3-1 to Figure 3-6 shown.
[0141] in, Figure 3-1 is a schematic diagram of a transverse position of a first lung image after threshold segmentation processing according to an embodiment of the present invention; Figure 3-2 is a schematic diagram of a coronal view of a first lung image after threshold segmentation processing according to an embodiment of the present invention; Figure 3-3 is a schematic diagram of a sagittal position of a first lung image after threshold segmentation processing according to an embodiment of the present invention; Figure 3-4 is a schematic diagram of a transverse position of a second lung image after threshold segmentation processing according to an embodiment of the present invention; Figure 3-5 is a schematic diagram of a coronal view of a second lung image after threshold segmentation processing according to an embodiment of the present invention; Figure 3-6 4 is a schematic diagram of a sagittal view of a second lung image after threshold segmentation processing according to an embodiment of the present invention.
[0142] 2. Downsampling
[0143] Since this method calculates the Transform Matrix through the bounding box for registration, only the lungs need to be roughly segmented. Therefore, downsampling the binary image after threshold segmentation does not affect the accuracy of registration and can reduce the program running time.
[0144] 3. Hole filling
[0145] Since the image will be corroded in the next step, in order to avoid excessive corrosion of the lung parenchyma that cannot be restored, the holes in the image are filled before the corrosion operation.
[0146] Get the image after downsampling and hole filling, such as Figure 4-1 to Figure 4-6 As shown, Figure 4-1 is a schematic diagram of a cross-sectional view of a first image after downsampling and hole filling according to an embodiment of the present invention; Figure 4-2 is a schematic diagram of a coronal position of a first image after downsampling and hole filling according to an embodiment of the present invention; Figure 4-3 is a schematic diagram of a sagittal position of a first image after downsampling and hole filling according to an embodiment of the present invention; Figure 4-4 is a schematic diagram of a transverse position of a second image after downsampling and hole filling according to an embodiment of the present invention; Figure 4-5 is a schematic diagram of a coronal position of a second image after downsampling and hole filling according to an embodiment of the present invention; Figure 4-6 is a schematic diagram of the sagittal position of the second image after downsampling and hole filling according to an embodiment of the present invention.
[0147] 4. Remove non-lung areas
[0148] After steps 1-3, a binary image with air, lung parenchyma, trachea, and background bed as the foreground is obtained. Sometimes there is adhesion between the lung parenchyma and the air, which causes the lung parenchyma to be removed during region growing. Therefore, this embodiment first performs an erosion operation on the image to remove the adhesion, and then uses region growing to remove the non-lung area. The specific steps are:
[0149] (1) Use a circular template with a radius of r to erode the binary image;
[0150] (2) The four edges of the first layer of the three-dimensional image are used as seed points for region growing.
[0151] Get an image with non-lung areas removed, such as Figure 5-1 to Figure 5-6 As shown, Figure 5-1 is a schematic diagram of a first image cross-section after removing a non-lung area according to an embodiment of the present invention; Figure 5-2 is a schematic diagram of a coronal position of a first image after removing a non-lung area according to an embodiment of the present invention; Figure 5-3 is a schematic diagram of a sagittal position of a first image after removing a non-lung area according to an embodiment of the present invention; Figure 5-4 is a schematic diagram of a transverse section of a second image after removing a non-lung area according to an embodiment of the present invention; Figure 5-5 is a schematic diagram of a coronal position of a second image after removing a non-lung area according to an embodiment of the present invention; Figure 5-64 is a schematic diagram of a sagittal view of a second image after removing the non-lung area according to an embodiment of the present invention.
[0152] 5. Open calculation reconstruction
[0153] Opening reconstruction can correctly restore the shape of the object retained after corrosion, fill holes, and remove all targets connected to the image boundary. Therefore, opening reconstruction in this step can effectively improve the segmentation effect of lung parenchyma.
[0154] Get the image reconstructed by the opening operation, such as Figure 6-1 to Figure 6-6 As shown, Figure 6-1 is a schematic diagram of a transverse position of a first image after opening operation reconstruction according to an embodiment of the present invention; Figure 6-2 is a schematic diagram of a coronal position of a first image reconstructed by an opening operation according to an embodiment of the present invention; Figure 6-3 is a schematic diagram of a sagittal position of a first image reconstructed by an opening operation according to an embodiment of the present invention; Figure 6-4 is a schematic diagram of a transverse position of a second image reconstructed by an opening operation according to an embodiment of the present invention; Figure 6-5 is a schematic diagram of a coronal position of a second image reconstructed by an opening operation according to an embodiment of the present invention; Figure 6-6 4 is a schematic diagram of the sagittal position of the second image reconstructed by the opening operation according to the embodiment of the present invention.
[0155] 6. Connected domain analysis
[0156] After the above operations, sometimes the trachea is still retained in the lung area, which will affect the image registration result. In addition, the method in this paper registers the left and right lung parenchyma separately, so it is necessary to remove the trachea and obtain the component areas of the left and right lungs. The specific steps are:
[0157] (1) Perform 8-connectivity labeling on the 3D image;
[0158] (2) Calculate the bounding box of each connected domain;
[0159] (3) If the width of the bounding box is greater than the preset first width value (e.g., cWholeLungWidth_upperLimit) or the aspect ratio of the bounding box is greater than the preset aspect ratio value (e.g., cWidthHeightRatio) or the minimum height of the bounding box is greater than half of the image height, then the connected domain value is set to 0, otherwise the connected domain is retained;
[0160] (4) Performing connected domain analysis again on the image obtained in (3);
[0161] (5) Select the largest and second largest connected regions, denoted as the first region (Component 1) and the second region (Component 2);
[0162] (6) Calculate the bounding box of the first region. If the width of the bounding box is greater than a second width value preset in advance (e.g., cWholeLungWidth_lowerLimit), it means that the left and right lung parenchyma are not separated due to the influence of the trachea, and then perform (7). Otherwise, the first region and the second region obtained in (5) are the left lung and right lung parenchyma images, respectively.
[0163] (7) Perform an erosion operation on the first region, and then perform 8-connectivity marking, and select the largest and second largest connected regions as the first region and the second region.
[0164] Get the image after connected region analysis, such as Figure 7-1 to Figure 7-12 As shown, Figure 7-1 is a schematic diagram of a transverse position of a first region of a first image after connected region analysis according to an embodiment of the present invention; Figure 7-2 is a schematic diagram of a coronal position of a first region of a first image after connected region analysis according to an embodiment of the present invention; Figure 7-3 is a schematic diagram of a sagittal position of a first region of a first image after connected region analysis according to an embodiment of the present invention; Figure 7-4 is a schematic diagram of a transverse position of a second region of a first image after connected region analysis according to an embodiment of the present invention; Figure 7-5 is a schematic diagram of a coronal position of a second region of a first image after connected region analysis according to an embodiment of the present invention; Figure 7-6 is a schematic diagram of a sagittal position of a second region of a first image after connected region analysis according to an embodiment of the present invention; Figure 7-7 is a schematic diagram of a transverse position of a first region of a second image after connected region analysis according to an embodiment of the present invention; Figure 7-8 is a schematic diagram of a coronal position of a first region of a second image after connected region analysis according to an embodiment of the present invention; Figure 7-9 is a schematic diagram of a sagittal position of a first region of a second image after connected region analysis according to an embodiment of the present invention; Figure 7-10 is a schematic diagram of a transverse position of a second region of a second image after connected region analysis according to an embodiment of the present invention; Figure 7-11 is a schematic diagram of a coronal position of a second region of a second image after connected region analysis according to an embodiment of the present invention; Figure 7-12 It is a schematic diagram of the sagittal position of the second region of the second image after the connected region analysis according to an embodiment of the present invention.
[0165] 7. Shape Repair
[0166] Since the corrosion operation is performed during the connected domain analysis, which will affect the size and shape of the lung parenchyma area, we first dilate the image, and then downsample the dilated image and step 2 and step 3 and perform the hole filling operation on the image to complete the shape repair.
[0167] Get the image after shape repair, such as Figure 8-1 to Figure 8-12 As shown, Figure 8-1 is a schematic diagram of a transverse section of a first region of a first image after shape restoration according to an embodiment of the present invention; Figure 8-2 is a schematic diagram of a coronal view of a first region of a first image after shape restoration according to an embodiment of the present invention; Figure 8-3 is a schematic diagram of a sagittal position of a first region of a first image after shape restoration according to an embodiment of the present invention; Figure 8-4 is a schematic diagram of a transverse section of a second region of a first image after shape restoration according to an embodiment of the present invention; Figure 8-5 is a schematic diagram of a coronal view of a second region of a first image after shape restoration according to an embodiment of the present invention; Figure 8-6 is a schematic diagram of a sagittal position of a second region of a first image after shape restoration according to an embodiment of the present invention; Figure 8-7 is a schematic diagram of a transverse section of a first region of a second image after shape restoration according to an embodiment of the present invention; Figure 8-8 is a schematic diagram of a coronal view of a first region of a second image after shape restoration according to an embodiment of the present invention; Figure 8-9 is a schematic diagram of a sagittal position of a first region of a second image after shape restoration according to an embodiment of the present invention; Figure 8-10 is a schematic diagram of a transverse section of a second region of a second image after shape restoration according to an embodiment of the present invention; Figure 8-11 is a schematic diagram of a coronal view of a second region of a second image after shape restoration according to an embodiment of the present invention; Figure 8-12 4 is a schematic diagram of the sagittal position of the second region of the second image after shape restoration according to an embodiment of the present invention.
[0168] 8. Identify the left and right lungs
[0169] The method in this paper is to register the left and right lung parenchyma separately, so it is necessary to know which of the first and second regions represents the left lung and which represents the right lung in order to complete the registration. The specific steps are:
[0170] (1) Calculate the bounding boxes of the first area and the second area;
[0171] (2) If the widths of the bounding boxes of the first region and the second region are greater than a third width value preset in advance (e.g., m_wholeLungWidth_lowerLimit), it indicates that the lung parenchyma segmentation fails, otherwise, proceed to operation (3);
[0172] (3) If the maximum width of the bounding box of the first area is less than the maximum width of the bounding box of the second area, then the first area is the right lung and the second area is the left lung; otherwise, the first area is the left lung and the second area is the right lung. It should be noted here that, under normal circumstances, the left lung size of most people is larger than the right lung size. Therefore, the left and right lungs are determined by checking whether the maximum width of the bounding box of the first area is less than the maximum width of the bounding box of the second area. The above conditions can be preset. For example, the size relationship of a person's left and right lungs is determined. After that, the size of the left and right lungs is determined by the maximum width of the bounding box based on the determined size relationship of the person's left and right lungs. Specifically, the maximum width of the bounding boxes of the first area and the second area is proportional to the actual size of the left and right lungs.
[0173] Get the left and right lung images, such as Figure 9-1 to Figure 9-12 As shown, Figure 9-1 is a schematic diagram of a left lung transverse section of a first image according to an embodiment of the present invention; Figure 9-2 is a schematic diagram of a left lung coronal position of a first image according to an embodiment of the present invention; Figure 9-3 is a schematic diagram of a left lung sagittal position of a first image according to an embodiment of the present invention; Figure 9-4 is a schematic diagram of a right lung transverse section of a first image according to an embodiment of the present invention; Figure 9-5 is a schematic diagram of a right lung coronal position of a first image according to an embodiment of the present invention; Figure 9-6 is a schematic diagram of a sagittal view of the right lung of a first image according to an embodiment of the present invention; Figure 9-7 is a schematic diagram of a left lung transverse section of a second image according to an embodiment of the present invention; Figure 9-8 is a schematic diagram of a left lung coronal position of a second image according to an embodiment of the present invention; Figure 9-9 is a schematic diagram of a left lung sagittal position of a second image according to an embodiment of the present invention; Figure 9-10 is a schematic diagram of a right lung transverse section of a second image according to an embodiment of the present invention; Figure 9-11 is a schematic diagram of a right lung coronal position of a second image according to an embodiment of the present invention; Figure 9-12 is a schematic diagram of a sagittal view of the right lung of a second image according to an embodiment of the present invention.
[0174] 9. Lung parenchyma registration
[0175] Through steps 1 to 8, we can obtain the binary images and bounding boxes of the left and right lung parenchyma in the first image and the binary images and bounding boxes of the left and right lung parenchyma in the second image. The following takes the left lung as an example to illustrate the registration algorithm process, which is as follows:
[0176] (1) Using the bounding box of the left lung in the first image and the bounding box of the left lung in the second image, calculate the scaling ratio and obtain the initial Transform Matrix parameters, which are recorded as initial parameters (orginal parameters);
[0177] (2) Based on the initial parameters, a rotation operation is performed around the center of the image within a preset arc range to calculate the overlap area between the left lung of the first image and the left lung of the second image, and the TransformMatrix parameters when the area overlaps the most are selected as the intermediate parameters (second parameters);
[0178] (3) Based on the intermediate parameters, a translation operation is performed within a preset translation range to calculate the overlap area between the left lung in the first image and the right lung in the second image, and the Transform Matrix parameters when the area overlaps the most are selected as the final parameters;
[0179] The right lung registration operation is the same as above, and the images of the same patient at different times can be the first image and the second image respectively, and finally four Transform Matrix parameters are obtained and the results are saved. So far, this embodiment uses the final Transform Matrix parameters to complete the registration.
[0180] The final registration result is obtained, such as Figure 10-1 to Figure 10-12 As shown, different grayscales are used to represent the difference areas of overlapping areas of different image pairs. The area with lighter grayscale in the figure is the difference area between the first image and the overlapping area, and the area with darker grayscale in the figure is the difference area between the second image and the overlapping area. Figure 10-1 is a schematic diagram of a registration result of a left lung transverse position of a first image according to an embodiment of the present invention; Figure 10-2 is a schematic diagram of a registration result of the left lung coronal position of the first image according to an embodiment of the present invention; Figure 10-3 is a schematic diagram of a registration result of the left lung sagittal position of the first image according to an embodiment of the present invention; Figure 10-4 is a schematic diagram of a registration result of a right lung transverse section of a first image according to an embodiment of the present invention; Figure 10-5 is a schematic diagram of a registration result of the right lung coronal position of the first image in an embodiment of the present invention; Figure 10-6 is a schematic diagram of a registration result of the sagittal plane of the right lung of the first image according to an embodiment of the present invention; Figure 10-7 is a schematic diagram of a registration result of a left lung transverse position of a second image according to an embodiment of the present invention; Figure 10-8 is a schematic diagram of a registration result of the left lung coronal position of the second image according to an embodiment of the present invention; Figure 10-9 is a schematic diagram of a registration result of the left lung sagittal plane of the second image according to an embodiment of the present invention; Figure 10-10 is a schematic diagram of a registration result of a right lung transverse section of a second image according to an embodiment of the present invention; Figure 10-11 is a schematic diagram of a registration result of the right lung coronal position of the second image according to an embodiment of the present invention; Figure 10-12 Schematic diagram of the registration result of the right lung sagittal plane of the second image according to an embodiment of the present invention.
[0181] Fig.11 is a schematic diagram of an image matching device according to an embodiment of the present invention, such as Fig.11 As shown, according to another aspect of an embodiment of the present invention, there is also provided an image matching device, including: a determination module 112 and a matching module 114. The device is described in detail below.
[0182] The determination module 112 is used to remove non-target areas in the multiple target images to be matched, and determine the target area to be matched in the target image; the matching module 114 is connected to the above-mentioned determination module 112, and is used to match the multiple target images according to the target area, and determine a matching image in which the target areas of the multiple target images are superimposed when the overlapping area of the target areas of the multiple target images is the largest.
[0183] Through the above device, the determination module 112 is used to remove the non-target areas in the multiple target images to be matched, and the target area to be matched in the target image is determined; the matching module 114 matches the multiple target images according to the target area, and determines that when the overlapping area of the target areas of the multiple target images is the largest, the target areas of the multiple target images are superimposed in a matching image manner, and the target areas of different multiple target images are matched to determine the position with the largest overlapping area, which is the heaviest and matching result of the multiple target images. By superimposing multiple target areas, the similarities and differences of the target areas of the multiple target images are effectively determined, and the purpose of facilitating comparative observation is achieved, thereby achieving the technical effect of improving the recognition and matching efficiency and improving the accuracy, and further solving the technical problem in the related art that the observer needs to independently identify and match the organs and parts in the CT images of different periods, which depends entirely on personal experience, and has low efficiency and low accuracy.
[0184] According to another aspect of an embodiment of the present invention, a storage medium is further provided. The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute any one of the above-mentioned image matching methods.
[0185] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned image matching methods is executed.
[0186] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0187] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0188] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0189] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0190] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0191] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0192] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for matching an image, characterized in that: include: Removing non-target areas from a plurality of target images to be matched, and determining a target area to be matched in the target image, wherein the plurality of target images are images of the target area at different periods, the target image is a CT image, and the target area includes at least: a left lung and a right lung; According to the target area, multiple target images are matched, and when the overlapping area of the target areas of the multiple target images is the largest, the matching images of the target areas of the multiple target images are superimposed, and different grayscales are used to represent the difference areas of the overlapping areas of different target images, including: selecting target images of the same patient at different times as the first image and the second image, obtaining the binary image and bounding box of the left lung parenchyma of the first image and the binary image and bounding box of the left lung parenchyma of the second image; using the bounding box of the left lung of the first image and the bounding box of the left lung of the second image, calculating the scaling ratio, and obtaining the initial Transform Matrix parameters, which are recorded as the initial parameters; based on the initial parameters, performing a rotation operation around the image center within a preset arc range, calculating the overlapping area of the left lung of the first image and the left lung of the second image, and selecting the Transform Matrix parameters when the area is maximally overlapped as the intermediate parameters; based on the intermediate parameters, performing a translation operation within a preset translation range, calculating the overlapping area of the left lung of the first image and the right lung of the second image, and selecting the Transform Matrix parameters when the area is maximally overlapped as the final parameters; completing the registration based on the final parameters to obtain the registration result.
2. The method according to claim 1, characterized in that Removing non-target areas from a plurality of target images to be matched, and determining a target area to be matched in the target image comprises: Performing threshold segmentation processing on the target image to generate a binary image of the target image; Performing an erosion operation on the binary image of the target image to remove adhesion of each part of the binary image; The non-target area in the binary image is removed by region generation to determine the target area of the target image.
3. The method according to claim 2, characterized in that Performing threshold segmentation processing on the target image to generate a binary image of the target image includes: Performing threshold segmentation on the target image by using a threshold segmentation algorithm to determine an optimal threshold of the target image; Determining whether the optimal threshold is within a preset threshold range; When the optimal threshold is within the preset threshold range, performing threshold segmentation on the target image according to the optimal threshold to generate the binary image; In the case that the optimal threshold is not within the preset threshold range, a value is arbitrarily specified within the preset threshold range as the optimal threshold, and the binary image is generated according to the specified optimal threshold.
4. The method according to claim 2, characterized in that: Before performing an erosion operation on the binary image of the target image to remove adhesion of each portion of the binary image, the method further includes: Performing downsampling processing on the binary image of the target image; Perform hole filling on the downsampled binary image.
5. The method according to claim 1, characterized in that: When matching the target images according to the target area and determining that the overlapping area of the target areas of the target images is the largest, the matching image superimposed by the target areas of the target images includes: determining a plurality of components of the target area of each of the target images; The target images are matched according to the components to determine a matching image in which the target areas of the target images are superimposed when the overlapping area of the target areas of the target images is the largest.
6. The method according to claim 5, characterized in that Determining the multiple components of the target area of each of the target images includes: Performing region connectivity processing on the target region of the target image to determine a plurality of connected regions of the target region of the target image; Components corresponding to the plurality of connected regions are determined respectively.
7. The method according to claim 6, characterized in that Respectively determining components corresponding to the plurality of connected regions comprises: Determine bounding boxes of a plurality of the connected regions; When the sizes of the bounding boxes of the plurality of connected regions do not exceed a preset size threshold, determining a size relationship between the sizes of the bounding boxes of the plurality of connected regions; When the size relationship of the bounding box is the same as the size relationship of the real sizes of the plurality of components, it is determined that the real components corresponding to the bounding box correspond to the connected areas corresponding to the bounding box.
8. The method according to claim 6, characterized in that Performing region connectivity processing on the target region of the target image to determine a plurality of connected regions of the target region of the target image comprises: Performing eight-connectivity processing on the target area of the target image to determine a plurality of connected areas and a bounding box of each connected area; Determine whether the size of the bounding box of the connected area meets a preset condition, and if the size of the bounding box does not meet the preset condition, discard the connected area; if the size of the bounding box meets the preset condition, retain the connected area; Determine whether the size of the bounding box of the connected area exceeds a preset size threshold. If the size of the bounding box exceeds a second preset size threshold, perform an erosion operation on the connected area, perform eight-connectivity processing, and determine multiple connected areas.
9. The method according to claim 8, characterized in that Before performing region connectivity processing on the target region of the target image to determine a plurality of connected regions of the target region of the target image, the method further includes: An opening operation and reconstruction process is performed on the target area of the target image.
10. The method according to claim 8, characterized in that After performing region connectivity processing on the target region of the target image and determining a plurality of connected regions of the target region of the target image, the method further includes: Performing dilation processing on the target area of the target image after the area connectivity processing; According to the initial target image after downsampling and hole filling, shape restoration is performed on the target image after dilation.
11. An image matching device, characterized in that: include: A determination module, used to remove non-target areas in a plurality of target images to be matched, and determine a target area to be matched in the target image, wherein the plurality of target images are images of the target area at different periods, the target image is a CT image, and the target area includes at least: a left lung and a right lung; A matching module is used to match the multiple target images according to the target area, determine the matching image of the target areas of the multiple target images when the overlapping area of the target areas of the multiple target images is the largest, and use different grayscales to represent the difference area of the overlapping area of different target images, including: selecting the target images of the same patient at different times as the first image and the second image, obtaining the binary image and bounding box of the left lung parenchyma of the first image and the binary image and bounding box of the left lung parenchyma of the second image; using the bounding box of the left lung of the first image and the bounding box of the left lung of the second image, calculating the scaling ratio, and obtaining the initial Transform Matrix parameters, which are recorded as the initial parameters; based on the initial parameters, performing a rotation operation around the image center within a preset arc range, calculating the overlapping area of the left lung of the first image and the left lung of the second image, and selecting the Transform Matrix parameters when the area is maximized as the intermediate parameters; based on the intermediate parameters, performing a translation operation within a preset translation range, calculating the overlapping area of the left lung of the first image and the right lung of the second image, and selecting the Transform Matrix parameters when the area is maximized as the final parameters; completing the registration based on the final parameters to obtain the registration result.
12. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the image matching method according to any one of claims 1 to 10.
13. A processor, characterized in that: The processor is used to run a program, wherein the program executes the image matching method described in any one of claims 1 to 10 when running.
