Full-automatic human body full-length x-ray image fusing and splicing method and device
Through the fully automatic full-length X-ray image fusion splicing method of human body, the maximum two-dimensional correlation value is used to determine the optimal splicing position and perform gray balance, which solves the problems of low automation and low accuracy in the existing technology, and achieves efficient and accurate full-length X-ray splicing of human body.
Patent Information
- Application Number
- PCT/CN2023/127535
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-18
- Filing Date
- 2023-10-30
- Publication Date
- 2025-03-27
AI Technical Summary
The prior art has problems such as low degree of automation, low accuracy and complex operation in full-length X-ray splicing of human bodies, which is difficult to meet the needs of clinical diagnosis and treatment.
The fully automatic full-length X-ray image fusion splicing method is used to identify the images of the trunk and the two lower limbs, calculate the maximum two-dimensional correlation value to determine the optimal splicing position, and balance the grayscale value using the fusion transition algorithm to achieve automated splicing.
It improves splicing efficiency and accuracy, has clear imaging, natural splicing gaps, high bone alignment, and small image distortion rate, which overcomes the splicing misalignment problem caused by different lateral depths.
Smart Images

Figure CN2023127535_27032025_PF_FP_ABST
Abstract
Description
Fully automatic human body full-length X-ray image fusion and splicing method and device Technical Field
[0001] The present invention relates to the field of medical imaging technology, and in particular to a method and device for fully automatic fusion and splicing of full-length human body X-ray images. Background Art
[0002] Currently, the X-ray fluoroscopic imaging systems commonly used in orthopedic clinical diagnosis have a limited field of view. However, in the diagnosis and surgical treatment of orthopedic areas such as the human spine and long bones, it is necessary to obtain complete anatomical images to facilitate the precise location of bone and joint lesions and the measurement of anatomical parameters, such as the length, angle, and force line of both lower limbs (the line connecting the midpoints of the hip, knee, and ankle joints). In the diagnosis and treatment of clinical conditions such as adolescent scoliosis correction, spinal artificial lumbar disc replacement, total hip replacement, artificial femoral head replacement, artificial knee replacement, lower limb deformity correction, and prosthetic limb installation, the full-length images provided by full-length human body X-ray splicing technology can provide reliable data for clinical orthopedic diagnosis, preoperative planning, and postoperative efficacy evaluation.
[0003] Currently, there are various X-ray scanning methods for acquiring full-length images of the human body, including linear scanning, rotational scanning, wide-angle scanning, and slot scanning. Different X-ray scanning methods require different image preprocessing and stitching methods.
[0004] The most widely used digital X-ray imaging system currently is a linear plain scan system. Based on the automatic tracking movement of the X-ray tube and detector, it can automatically capture several independent digital X-ray image sequences in a single acquisition process. Radiologists then need to perform post-processing, that is, semi-automatic stitching of the full-length images.
[0005] Image stitching technology has always been a hot topic of concern and research for many scholars at home and abroad. The problems of existing image stitching methods are as follows:
[0006] 1. The phase correlation method is based on signal transform domain theory. In this method, images are transformed from two-dimensional signals into the frequency domain, and the spatial relationship between images is determined using the cross-power spectrum. This method is independent of the specific image content and offers good registration accuracy for images that only undergo translational transformations. However, X-ray images are distorted by depth information, making it unsuitable for full-length X-ray stitching of the human body.
[0007] 2. Ruler-based X-ray image stitching. This method requires adding a ruler to the X-ray image and stitching the images based on the ruler scale and numerical values. This stitching method is not automated, is time-consuming and labor-intensive, and has difficulty ensuring image quality, resulting in low clinical operability.
[0008] 3. Equidistant matching method based on image pixel grayscale values. This method requires a large amount of calculation on pixel grayscale data, which is computationally intensive and is also sensitive to brightness changes and geometric distortion.
[0009] In summary, it is necessary to propose a fully automatic human body full-length X-ray image fusion and stitching method to solve the defect that the existing technology is not suitable for human body full-length X-ray stitching.
[0010] Summary of the Invention
[0011] The purpose of the present invention is to provide a fully automatic human body full-length X-ray image fusion and splicing method and device to improve the splicing efficiency and accuracy of human body full-length X-ray images.
[0012] The present invention provides a fully automatic human body full-length X-ray image fusion and splicing method, comprising:
[0013] Acquire a full-length X-ray image of a human body to be stitched, wherein the full-length X-ray image to be stitched is a plurality of target X-ray images under the same imaging viewing angle;
[0014] Determining overlapping areas to be stitched between adjacent target X-ray images;
[0015] Identifying a torso image in the target X-ray image, calculating a maximum two-dimensional correlation coefficient value of grayscale values of corresponding pixels in overlapping areas between adjacent torso images, and determining an optimal stitching position for the torso images;
[0016] Identifying the lower limb images in the target X-ray image, establishing a splicing reference line for the gap separating the lower limbs based on a feature extraction algorithm, dividing the lower limb images into left and right lower limb images according to the splicing reference line, and calculating the optimal splicing positions of the left and right lower limb images respectively;
[0017] According to the optimal splicing position, the target X-ray images are automatically fused and spliced according to the corresponding human body structure, and the grayscale values of the overlapping areas between adjacent target X-ray images are balanced based on the fusion transition algorithm to obtain a spliced and fused full-length X-ray image of the human body.
[0018] Preferably, the identifying of the torso image in the target X-ray image, calculating the maximum two-dimensional correlation coefficient value of the grayscale values of corresponding pixels in the overlapping area between adjacent torso images, and determining the optimal stitching position of the torso images includes:
[0019] Estimate the number of pixels in the overlapping area in the longitudinal direction of the adjacent target X-ray images according to the preset shooting conditions, and set it as the initial stitching position;
[0020] Within the offset range formed by the preset pixel threshold range in the vertical and horizontal directions, searching for the horizontal and vertical pixel coordinates that maximize the two-dimensional matrix correlation coefficient of the overlapping area between adjacent target X-ray images, as the optimal stitching position;
[0021] The two-dimensional correlation coefficient r of the overlapping area between adjacent target X-ray images is calculated using the following formula:
[0022] in, is the grayscale mean of the upper image A in the adjacent target X-ray image, is the grayscale mean of the lower image B in the adjacent target X-ray image, A mn 、B mn are the grayscale values of the upper and lower images at coordinates (m, n) respectively.
[0023] Preferably, the method of balancing the grayscale values of overlapping areas between adjacent target X-ray images based on a fusion transition algorithm to obtain a spliced and fused full-length X-ray image of the human body comprises:
[0024] According to the vertical coordinate position of any target X-ray image, the grayscale values at the same position in the overlapping area of adjacent target X-ray images are weighted and summed to generate the grayscale value of the target X-ray image at the vertical coordinate after splicing:
[0025] Among them, w i is the grayscale value of the pixels in the i-th row of the overlapping area of the adjacent target X-ray images finally synthesized, h is the height of the overlapping area, that is, the number of pixels on the vertical axis, A i 、B i are respectively the grayscale values of the pixels in the i-th row in the overlapping areas of the adjacent target X-ray images.
[0026] Preferably, the identifying of the lower limb images in the target X-ray image, establishing a splicing reference line for the gap separating the lower limbs based on a feature extraction algorithm, dividing the lower limb images into left and right lower limb images according to the splicing reference line, and respectively calculating the optimal splicing positions of the left and right lower limb images include:
[0027] Dividing the adjacent target X-ray images into thighs and calves according to the stitching reference line and the stitching seams between the adjacent lower limb images;
[0028] Comparing the pixel widths of the left lower limb image and the right lower limb image in the two lower limb images, and selecting the lower limb image with the larger width;
[0029] According to the selected lower limb image, the corresponding thigh image and calf image in the lower limb image are identified, and the maximum two-dimensional correlation coefficient value of the grayscale values of corresponding pixels in the overlapping area between the thigh image and the calf image is calculated to determine the optimal splicing position and the first translation distance;
[0030] Calculating the maximum two-dimensional correlation coefficient value of the grayscale value of the corresponding pixel points in the overlapping area between the thigh image and the calf image on the left and right lower limb images respectively to determine the corresponding second translation distance;
[0031] The left and right images of both lower limbs are spliced according to the optimal splicing position, the first translation distance, and the second translation distance corresponding to the left and right lower limb images.
[0032] Preferably, establishing a splicing reference line for the gap separating the two lower limbs based on a feature extraction algorithm includes:
[0033] Identify the corresponding calf image in the target X-ray image, and sum and average the grayscale values of the calf image in the vertical axis direction to obtain a preset grayscale curve l:
[0034] Among them, n is the size of the image in the vertical direction, that is, the number of pixels, w i Indicates the gray value of the i-th pixel under the corresponding horizontal coordinate;
[0035] A moving average filter is used to perform one-dimensional smoothing on the grayscale curve l to obtain a smoothed grayscale curve ls. The nth value ls(n) of the smoothed grayscale curve ls is obtained by averaging the nth-windowSize+1th to nth values of the preset grayscale curve l, as shown in the following formula:
[0036] Among them, windowSize is the preset experience value;
[0037] Establish a dividing line h on the preset grayscale curve l:
[0038] When the dividing line h intersects the smoothed filtered grayscale curve ls, four intersection points are obtained. The horizontal coordinate with the highest grayscale value between the second and third intersection points is calculated, which is the horizontal coordinate of the gap between the lower limbs.
[0039] Preferably, respectively calculating the optimal stitching positions of the left and right lower limb images includes:
[0040] estimating the number of pixels in the overlapping area of the thigh and calf images in the selected lower limb image according to the preset shooting conditions, and setting it as the initial stitching position;
[0041] Within the offset range formed by the preset pixel threshold range in the vertical and horizontal directions, searching for the horizontal and vertical pixel coordinates that maximize the two-dimensional matrix correlation coefficient of the overlapping area between the thigh and calf images in the selected lower limb image, as the optimal stitching position;
[0042] The two-dimensional correlation coefficient r of the overlapping area between the thigh and calf images in the selected lower limb images is calculated using the following formula:
[0043] in, is the grayscale mean of the thigh image A in the selected lower limb image, is the grayscale mean of the lower leg image B in the selected lower limb image, A mn 、B mn are the grayscale values of the thigh and calf images at coordinates (m, n) respectively.
[0044] Preferably, calculating the maximum two-dimensional correlation coefficient value includes:
[0045] Setting the pixel spacing of the target X-ray image;
[0046] During the automatic image stitching process, a two-dimensional correlation coefficient is calculated according to the preset pixel spacing to obtain an initial stitching position interval;
[0047] The two-dimensional correlation coefficient is calculated pixel by pixel within the initial splicing position interval to obtain multiple target splicing positions, the two-dimensional correlation coefficients of the multiple target splicing positions are compared, and the maximum two-dimensional correlation coefficient is output to determine the optimal splicing position.
[0048] The present invention also provides a fully automatic human body full-length X-ray image fusion and splicing device, comprising:
[0049] An acquisition module is used to obtain a full-length X-ray image of a human body to be spliced, wherein the full-length X-ray image to be spliced is a plurality of target X-ray images under the same imaging perspective;
[0050] a determination module, configured to determine overlapping areas to be stitched between adjacent target X-ray images;
[0051] a first calculation module for identifying a torso image in the target X-ray image, calculating a maximum two-dimensional correlation coefficient value of grayscale values of corresponding pixels in overlapping regions between adjacent torso images, and determining an optimal stitching position for the torso images;
[0052] a second calculation module, configured to identify the images of both lower limbs in the target X-ray image, establish a splicing reference line for the gap separating the two lower limbs, divide the images of both lower limbs into left and right lower limb images according to the splicing reference line, and calculate the optimal splicing positions of the left and right lower limb images respectively;
[0053] The fusion and splicing module is used to automatically fuse and splice the target X-ray images according to the corresponding human body structure based on the optimal splicing position, and balance the grayscale values of the overlapping areas between adjacent target X-ray images based on the fusion transition algorithm to obtain a full-length X-ray image of the human body after splicing and fusion.
[0054] The present invention also provides a computer device, comprising:
[0055] a memory for storing a processing program;
[0056] A processor, when executing the processing program, implements the fully automatic human body full-length X-ray image fusion and splicing method as described in the embodiment of the present invention.
[0057] The present invention also provides a readable storage medium, characterized in that a processing program is stored on the readable storage medium, and when the processing program is executed by a processor, it implements the fully automatic human body full-length X-ray image fusion and splicing method as described in the embodiment of the present invention.
[0058] The fully automatic human body full-length X-ray image fusion and splicing method provided by the present invention can achieve the following technical effects:
[0059] 1) Good stitching effect. The image is clear, the transition of the stitching gap is natural, the bone alignment rate is high, the image distortion rate is small, and the stitching misalignment problem caused by different lateral depths is overcome.
[0060] 2) High stitching efficiency. It takes less than 5 seconds to stitch a full-length human X-ray image.
[0061] 3) Fully automated and economical. No manual intervention is required, thus avoiding errors caused by manual splicing, improving splicing efficiency and saving labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] FIG1 is a schematic diagram of the steps of a method for fully automatic fusion and stitching of full-length human body X-ray images according to one embodiment of the present invention;
[0063] FIG2 is a schematic diagram of a method for matching lower limbs separately according to an embodiment of the present invention;
[0064] FIG3 is a comparative example of the effects of matching the entire lower limbs (A) and matching the lower limbs separately (B) in one embodiment of the present invention;
[0065] FIG4 is a first exemplary diagram of establishing a splicing reference line for the gap separating the two lower limbs based on a feature extraction algorithm in one embodiment of the present invention;
[0066] FIG5 is a second example diagram of establishing a splicing reference line for the gap between the lower limbs based on a feature extraction algorithm according to one embodiment of the present invention, wherein l (solid line) is the original preset grayscale curve, ls (dashed line) is the grayscale curve after smoothing and filtering, and h (dotted line) is the dividing line;
[0067] FIG6 is a schematic diagram showing a comparison between a spliced and fused X-ray image of a human body and a direct splicing effect in accordance with an embodiment of the present invention;
[0068] FIG7 is a flow chart of an algorithm for optimizing computing speed based on the squeeze theorem in one embodiment of the present invention;
[0069] FIG8 is a comparative example of an anteroposterior full-length X-ray image of a human body to be spliced and a full-length X-ray image of a human body after the splicing is completed in one embodiment of the present invention;
[0070] FIG9 is a diagram showing a comparison between a full-length lateral X-ray image of a human body to be spliced and a full-length X-ray image of a human body after the splicing is completed in one embodiment of the present invention. DETAILED DESCRIPTION
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0072] Example 1
[0073] As shown in FIG1 , the present invention provides a fully automatic human body full-length X-ray image fusion and splicing method, comprising:
[0074] S1: Obtain full-length X-ray images of a human body to be stitched. The full-length X-ray images to be stitched are multiple target X-ray images arranged in order according to the human body posture from the same imaging perspective. In this embodiment, the multiple target X-ray images can be of a subject standing in a natural weight-bearing position, using a digital X-ray imaging system to capture full-length images of the human body from top to bottom in both anteroposterior and lateral views. The total number of images per single perspective varies depending on the height and body shape of the subject. The algorithm in this embodiment is used to automatically stitch all X-ray images from the same imaging perspective.
[0075] S2: Determine the overlapping area to be stitched between adjacent target X-ray images; in one embodiment of the present invention, the adjacent target X-ray images are upper and lower images when the human body is standing in a weight-bearing position, and there is an overlapping part between the adjacent upper and lower images to facilitate subsequent stitching.
[0076] S3: Identify the torso image in the target X-ray image, calculate the maximum two-dimensional correlation coefficient value of the grayscale values of corresponding pixels in the overlapping area between adjacent torso images, and determine the optimal splicing position of the torso image; calculate the correlation coefficient of the grayscale values of corresponding pixels in the overlapping area. The larger the correlation coefficient, the higher the degree of matching between the two images.
[0077] Specifically, the target X-ray image is a grayscale value matrix of preset bits, and the target X-ray image is a torso image. In one embodiment, the grayscale value matrix of preset bits is a 16-bit grayscale value matrix. The number of pixels of the overlapping area of adjacent target X-ray images in the vertical axis direction is estimated according to the preset shooting conditions, and is set as the initial stitching position. Within the offset range composed of the preset pixel threshold range in the vertical and horizontal directions, the horizontal and vertical pixel coordinates that make the two-dimensional matrix correlation coefficient of the overlapping area between adjacent target X-ray images reach the maximum value are found as the optimal stitching position. In one embodiment, the preset pixel threshold range is ±300 pixels in the vertical axis direction and ±200 pixels in the horizontal axis direction.
[0078] The two-dimensional correlation coefficient r of the overlapping area between adjacent target X-ray images is calculated using the following formula:
[0079] in, is the grayscale mean of the upper image A in the adjacent target X-ray images, is the grayscale mean of the lower image B in the adjacent target X-ray image, A mn 、B mn are the grayscale values of the upper and lower images at coordinates (m, n) respectively. This embodiment is based on a splicing position calculation method for finding the maximum two-dimensional correlation coefficient value, which improves matching efficiency and splicing efficiency.
[0080] S4: Identify the images of both lower limbs in the target X-ray image, establish a splicing reference line for the gap separating the two lower limbs based on a feature extraction algorithm, divide the images of both lower limbs into left and right lower limb images according to the splicing reference line, and calculate the optimal splicing positions of the left and right lower limb images respectively.
[0081] Because full-length human body X-ray images are acquired using cone-beam linear plain scans, the resulting images exhibit cone-beam distortion, meaning that the overlapping portions of the upper and lower images are not completely aligned. This significantly impacts the stitching of the lower leg in front-to-back standing anteroposterior or lateral images, causing misalignment of the tibia and fibula, affecting the measurement of lower limb anatomical parameters. To ensure proper alignment of the tibia and fibula of both legs, the present invention employs a separate stitching and alignment method for lateral lower limb images.
[0082] Specifically, the lower limb images are divided into thighs and calves according to the splicing reference line and the splicing seams between adjacent lower limb images, such as the left thigh X-ray image, the left calf X-ray image, the right thigh X-ray image, and the right calf X-ray image; the pixel widths of the left lower limb image and the right lower limb image in the lower limb images are compared, and the lower limb image with the larger width is selected;
[0083] Based on the selected lower limb image and identifying the corresponding thigh and calf images within the lower limb image, the maximum two-dimensional correlation coefficient of the grayscale values of the corresponding pixels in the overlapping region between the thigh and calf images is calculated to determine the optimal stitching position and the first translation distance. The first translation distance refers to the vertical distance moved when stitching adjacent images, i.e., the pixel width of the overlapping region. In this embodiment, the vertical translation distance is considered for the wider lower limb image.
[0084] In one embodiment, if the left lower limb image is the image on the side with a larger pixel width, the maximum two-dimensional correlation coefficient value of the grayscale values of the pixels corresponding to the overlapping area between the adjacent left thigh X-ray image and the left calf X-ray image is calculated to determine the optimal stitching position; it can be understood that the optimal stitching position here is the stitching seam found between the left thigh X-ray image and the left calf X-ray image.
[0085] The maximum two-dimensional correlation coefficient of the grayscale values of corresponding pixels in the overlapping regions between the thigh and calf X-ray images on the left and right lower limb images is calculated to determine the corresponding second translation distances. In this embodiment, the second translation distances between the left thigh X-ray image and the left calf X-ray image, and between the right thigh X-ray image and the right calf X-ray image, are calculated. The second translation distance refers to the horizontal shift distance between adjacent images when stitching them together, i.e., the pixel width of the overlapping region. This horizontal translation distance must be considered for both the wider and narrower lower limb images.
[0086] The left and right X-ray images of both lower limbs are matched to the same horizontal height according to the optimal splicing position, the first translation distance and the second translation distance positions corresponding to the left and right lower limb images.
[0087] Those skilled in the art will understand that, referring to FIG2 , first find the gap between the two legs as a splicing reference line, i.e., the split seam. The upper and lower images to be spliced are separated left and right according to the split seam, and the two leg images to be spliced are divided into four parts, A, B, C, and D. First, splice A and B according to the splicing position calculation method based on finding the maximum two-dimensional correlation coefficient value in step S3. After using the calculated optimal splicing position and the first translation distance, the second translation distance of C and D is calculated using the two-dimensional correlation coefficient method. This ensures that the left and right images of the two legs are at the same horizontal height. Referring to FIG3 , the fibulas of both legs in the whole match (A) show a "pseudo-fracture" phenomenon at the splicing seam, while the fibulas of both legs in the separate match (B) are smooth and burr-free at the splicing seam.
[0088] In this embodiment, the optimal stitching position, the first translation distance, and the second translation distance are also obtained by calculating the stitching position with the maximum two-dimensional correlation coefficient value. The step S4 of calculating the optimal stitching position of the left and right lower limb X-ray images includes:
[0089] estimating the number of pixels in the overlapping area of the thigh and calf images in the selected lower limb image according to the preset shooting conditions, and setting it as the initial stitching position;
[0090] S416: Within an offset range defined by a preset pixel threshold range on the vertical and horizontal axes, searching for horizontal and vertical pixel coordinates within the offset range that maximize the two-dimensional matrix correlation coefficient of the overlapping region between the thigh and calf images in the selected lower limb image, and using the coordinates as the optimal stitching position;
[0091] S417: Calculate the two-dimensional correlation coefficient r of the overlapping area between the thigh and calf images in the selected lower limb images using the following formula:
[0092] in, is the grayscale mean of the thigh image A in the selected lower limb image, is the grayscale mean of the lower leg image B in the selected lower limb image, A mn 、B mn are the grayscale values of the thigh and calf images at coordinates (m, n) respectively.
[0093] This embodiment uses a feature extraction algorithm to find the gap between the lower limbs. Different subjects have different standing positions when taking lateral radiographs, so the gap between the legs needs to be automatically identified. Specifically, the calf image in the target X-ray image is identified, and the grayscale values of the calf image are summed and averaged along the vertical axis to obtain a preset grayscale curve l:
[0094] Among them, n is the size of the image in the vertical direction, that is, the number of pixels, wi represents the grayscale value of the i-th pixel along the corresponding horizontal axis. In this embodiment, the grayscale values of the last image in each set, namely the calf image, are summed and averaged along the vertical axis. In a cross-legged calf X-ray, the grayscale value of the longitudinal component of the calf is lower. Therefore, the preset grayscale curve l appears as a peak sandwiched between two valleys, as shown in Figure 4. To remove high-frequency noise, i.e., "burrs" in the preset grayscale curve l, a one-dimensional smoothing filter using a moving average filter is applied to l to obtain l s.
[0095] A moving average filter is used to perform one-dimensional smoothing on the grayscale curve l to obtain a smoothed grayscale curve ls. The nth value ls(n) of the smoothed grayscale curve ls is obtained by averaging the nth-windowSize+1th to nth values of the preset grayscale curve l, as shown in the following formula:
[0096] Among them, windowSize is a preset empirical value; in this application scenario, this embodiment takes it as 0.03 times the length of l lenth(l): windowSizwe=0.03*lenth(l); the smoothed grayscale curve ls is obtained, as shown in Figure 5.
[0097] To obtain the coordinates of the gap between the legs, a dividing line h is established on the preset grayscale curve l:
[0098] When the dividing line h intersects with the grayscale curve ls after smooth filtering, four intersection points are obtained. The horizontal coordinate with the highest grayscale value between the second and third intersection points is calculated, which is the horizontal coordinate of the gap between the two lower limbs, that is, the splicing reference line.
[0099] S5: Automatically fusing and splicing the target X-ray images according to the corresponding human body structures based on the optimal splicing positions, and balancing the grayscale values of the overlapping areas between adjacent target X-ray images based on a fusion transition algorithm to obtain a spliced and fused full-length human body X-ray image. Image fusion is intended to eliminate discontinuities in image light intensity or color, ensuring a smooth transition of light intensity at the splicing locations to eliminate sudden changes in light intensity.
[0100] Due to differences in light source position, the average grayscale values of the overlapping portions of the upper and lower images may differ. To achieve a more natural stitching effect and avoid noticeable gaps, a fusion algorithm is used to equalize the grayscale values of the overlapping portions, creating a smooth, continuous transition. The algorithm weights the grayscale values at the same location in the overlapping portions of the upper and lower images based on their vertical coordinates and then sums them to generate the grayscale value of the stitched image at that coordinate.
[0101] According to the vertical coordinate position of any target X-ray image, the grayscale values at the same position in the overlapping area of adjacent target X-ray images are weighted and summed to generate the grayscale value of the target X-ray image at the vertical coordinate after splicing:
[0102] Among them, w i is the grayscale value of the pixels in the i-th row of the overlapping area of the adjacent target X-ray images finally synthesized, h is the height of the overlapping area, that is, the number of pixels on the vertical axis, A i 、B i are the grayscale values of the pixels in the i-th row of the overlapping region of the adjacent target X-ray images. As shown in Figure 6, the stitched image (A) obtained using the fusion transition algorithm has a smooth transition, blending the two images into one. In contrast, the image obtained by direct stitching (B) exhibits a noticeable grayscale difference in the stitched portion, which appears quite abrupt.
[0103] Due to the high image resolution and the large size of the original matrix, calculating the two-dimensional correlation coefficient pixel by pixel is inefficient. To improve computational efficiency, in one embodiment of the present invention, the computational speed is optimized based on the squeeze theorem. Specifically, the pixel spacing of the target X-ray image is pre-set; during the automatic image stitching process, the two-dimensional correlation coefficient is calculated according to the preset pixel spacing to obtain an initial stitching position interval; within the initial stitching position interval, the two-dimensional correlation coefficient is calculated pixel by pixel to obtain multiple target stitching positions; the two-dimensional correlation coefficients of the multiple target stitching positions are compared, and the maximum two-dimensional correlation coefficient is output to determine the optimal stitching position.
[0104] Those skilled in the art will appreciate that the stitching process is optimized by first calculating the two-dimensional correlation coefficient at each large step, setting the pixel spacing to 20 pixels in the vertical direction and 10 pixels in the horizontal direction, to obtain the approximate position interval of the stitching seam, and then calculating the two-dimensional correlation coefficient pixel by pixel within this interval to obtain the precise position of the final stitching seam. This can significantly reduce the amount of calculation and shorten the time required for stitching. Stitching a full-length X-ray image of a human body takes less than 5 seconds. The speed-optimized algorithm flow chart is shown in FIG7 , where i represents the number of loops, overlap represents the total matching range, a and b represent two stitching positions, corr represents the two-dimensional correlation coefficient of the two images at the stitching position, round is the rounding function, and indh is the optimal stitching position finally determined.
[0105] The final display of the stitching result in this embodiment is shown in Figures 8-9. To comply with the reading habits of medical images, the grayscale value of the stitched image is flipped.
[0106] Example 2
[0107] The present invention also provides a fully automatic human body full-length X-ray image fusion and splicing device, comprising:
[0108] An acquisition module is used to obtain a full-length X-ray image of a human body to be spliced, wherein the full-length X-ray image to be spliced is a plurality of target X-ray images under the same imaging perspective;
[0109] a determination module, configured to determine overlapping areas to be stitched between adjacent target X-ray images;
[0110] a first calculation module for identifying a torso image in the target X-ray image, calculating a maximum two-dimensional correlation coefficient value of grayscale values of corresponding pixels in overlapping regions between adjacent torso images, and determining an optimal stitching position for the torso images;
[0111] a second calculation module, configured to identify the images of both lower limbs in the target X-ray image, establish a splicing reference line for the gap separating the two lower limbs, divide the images of both lower limbs into left and right lower limb images according to the splicing reference line, and calculate the optimal splicing positions of the left and right lower limb images respectively;
[0112] The fusion and splicing module is used to automatically fuse and splice the target X-ray images according to the corresponding human body structure based on the optimal splicing position, and balance the grayscale values of the overlapping areas between adjacent target X-ray images based on the fusion transition algorithm to obtain a full-length X-ray image of the human body after splicing and fusion.
[0113] The present invention provides a fully automatic human body full-length X-ray image fusion and stitching device, which obtains full-length images of the human body in the frontal and lateral positions by linear flat scanning from top to bottom through a digital X-ray imaging system, and uses an original algorithm to complete the fully automatic stitching of the images.
[0114] The specific contents and implementation methods of the above-mentioned acquisition module, determination module, first calculation module, second calculation module and fusion and splicing module are as described in Example 1 and will not be repeated here.
[0115] Finally, in order to apply the above-mentioned fully automatic human body full-length X-ray image fusion and stitching method to an image acquisition and generation system or device or equipment with relevant hardware conditions, the present application also provides a computer-readable storage medium, in which a computer program is loaded. When the computer program is executed by a computer, it realizes the functions of the corresponding method embodiment as described above.
[0116] Likewise, the present application also protects a computer-readable storage medium loaded with a computer program for implementing the fully automatic human body full-length X-ray image fusion and stitching method.
[0117] In each of the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program. The computer program includes one or more computer programs. When the computer program is loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, DDL (Digital Subscriber Line, Digital Subscriber Line)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density DVD (Digital Video DiDD, digital video disc)), or a semiconductor medium (eg, a solid-state drive (SSD)).
[0118] It should be noted that, in the above-mentioned embodiment, the terms used herein are only for the purpose of describing specific exemplary embodiments, and are not intended to be restrictive. As used herein, the singular forms "one", "an" and "the or described" may be intended to also include plural forms, unless the context clearly indicates otherwise. The terms "comprise", "include" and "have" are inclusive and therefore specify the presence of stated features, wholes, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, parts and / or their groups. The method steps, processes and operations described herein should not be interpreted as necessarily requiring the method steps, processes and operations to be performed in the specific order discussed or shown, unless otherwise specified, they must be performed in the set step order. It should also be understood that additional or alternative steps may be adopted.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A fully automatic human body full-length X-ray image fusion and splicing method, characterized in that: include: Acquire a full-length X-ray image of a human body to be spliced, wherein the full-length X-ray image to be spliced is a plurality of target X-ray images under the same imaging viewing angle; Determining overlapping areas to be stitched between adjacent target X-ray images; Identify the torso image in the target X-ray image, calculate the maximum two-dimensional correlation coefficient value of the grayscale values of the corresponding pixels in the overlapping areas between adjacent torso images, and determine the optimal splicing position of the torso images; Identify the double lower limb images in the target X-ray image, establish a splicing reference line for the gap separating the double lower limbs based on a feature extraction algorithm, divide the double lower limb images into left and right lower limb images according to the splicing reference line, and calculate the optimal splicing positions of the left and right lower limb images respectively; According to the optimal stitching position, the target X-ray images are automatically fused and spliced according to the corresponding human body structure, and the grayscale values of the overlapping areas between adjacent target X-ray images are balanced based on a fusion transition algorithm to obtain a stitched and fused full-length X-ray image of the human body.
2. The fully automatic human body full-length X-ray image fusion and splicing method as claimed in claim 1, characterized in that: The identifying of the torso image in the target X-ray image, calculating the maximum two-dimensional correlation coefficient value of the grayscale values of the pixels corresponding to the overlapping areas between adjacent torso images, and determining the optimal stitching position of the torso image comprises: Estimate the number of pixels of the overlapping area in the longitudinal direction of the adjacent target X-ray images according to the preset shooting conditions, and set it as the initial stitching position; In the offset range formed by the preset pixel threshold range in the vertical and horizontal directions, find the horizontal and vertical pixel coordinates that make the two-dimensional matrix correlation coefficient of the overlapping area between adjacent target X-ray images reach the maximum value as the optimal stitching position; The two-dimensional correlation coefficient r of the overlapping area between adjacent target X-ray images is calculated using the following formula: in, is the grayscale mean of the upper image A in the adjacent target X-ray image, is the grayscale mean of the lower image B in the adjacent target X-ray image, A mn , B mn are the grayscale values of the upper and lower images at coordinates (m, n) respectively.
3. The fully automatic human body full-length X-ray image fusion and splicing method as claimed in claim 1, characterized in that: The method of balancing the grayscale values of the overlapping areas between adjacent target X-ray images based on the fusion transition algorithm to obtain a spliced and fused full-length X-ray image of the human body comprises: According to the ordinate position of any target X-ray image, the grayscale value weights at the same position of the overlapping area of adjacent target X-ray images are assigned and summed to generate the grayscale value of the target X-ray image at the ordinate after splicing: Among them, w i is the gray value of the pixels in the i-th row of the overlapping area of the adjacent target X-ray images finally synthesized, h is the height of the overlapping area, that is, the number of pixels on the vertical axis, and A i , B i are respectively the grayscale values of the pixels in the i-th row of the overlapping areas of the adjacent target X-ray images.
4. The fully automatic human body full-length X-ray image fusion and splicing method as claimed in claim 1, characterized in that: The step of identifying the double lower limb images in the target X-ray image, establishing a splicing reference line for the gap between the double lower limbs based on a feature extraction algorithm, dividing the double lower limb images into left and right lower limb images according to the splicing reference line, and respectively calculating the optimal splicing positions of the left and right lower limb images includes: Dividing the adjacent target X-ray images into thighs and calves according to the stitching reference line and the stitching seams between the adjacent lower limb images; Compare the pixel widths of the left lower limb image and the right lower limb image in the double lower limb images. Ratio, select the lower limb image with larger width; According to the selected lower limb image and identifying the corresponding thigh image and calf image in the lower limb image, the maximum two-dimensional correlation coefficient value of the grayscale value of the corresponding pixel point in the overlapping area between the thigh image and the calf image is calculated to determine the optimal stitching position and the first translation distance; Calculate the maximum two-dimensional correlation coefficient value of the grayscale value of the corresponding pixel points in the overlapping area between the thigh image and the calf image on the left and right lower limb images to determine the corresponding second translation distance; The left and right images of both lower limbs are spliced according to the optimal splicing position, the first translation distance, and the second translation distance corresponding to the left and right lower limb images.
5. The method for fusion and stitching of full-length human body X-ray images as claimed in claim 4, characterized in that: The method of establishing a splicing reference line for the gap between the two lower limbs based on a feature extraction algorithm comprises: Identify the corresponding calf image in the target X-ray image, and sum and average the grayscale values of the calf image in the vertical direction to obtain a preset grayscale curve l: Among them, n is the size of the image in the vertical direction, that is, the number of pixels, and w i Represents the gray value of the i-th pixel under the corresponding horizontal coordinate; A moving average filter is used to perform one-dimensional smoothing filtering on the grayscale curve l to obtain a smoothed grayscale curve ls. The nth value ls(n) of the smoothed grayscale curve ls is obtained by averaging the nth-windowSize+1th to nth values of the preset grayscale curve l, as shown in the following formula: Among them, windowSize is a preset empirical value; Establish a dividing line h on the preset grayscale curve l: When the dividing line h intersects with the grayscale curve ls after smooth filtering, four intersection points are obtained, and the horizontal coordinate with the highest grayscale value between the second intersection point and the third intersection point is calculated, which is the horizontal coordinate of the gap between the two lower limbs.
6. The method for fusion and stitching of full-length human body X-ray images as claimed in claim 4, characterized in that: The step of respectively calculating the optimal stitching positions of the left and right lower limb images comprises: The number of pixels of the overlapping area of the thigh and calf images in the selected lower limb image is estimated according to the preset shooting conditions, and set as the initial stitching position; Within the offset range formed by the preset pixel threshold range in the longitudinal and transverse directions, find the horizontal and vertical pixel coordinates that make the two-dimensional matrix correlation coefficient of the overlapping area between the thigh and calf images in the selected lower limb image reach the maximum value, as the optimal splicing position; The two-dimensional correlation coefficient r of the overlapping area between the thigh and calf images in the selected lower limb images is calculated using the following formula: in, is the grayscale mean of the thigh image A in the selected lower limb image, is the grayscale mean of the lower leg image B in the selected lower limb image, A mn , B mn They are the grayscale values of the thigh and calf images at coordinates (m, n) respectively.
7. The fully automatic human body full-length X-ray image fusion and splicing method as claimed in claim 1, characterized in that: Calculating the maximum two-dimensional correlation coefficient value includes: Setting the pixel spacing of the target X-ray image; In the process of automatic image stitching, two-dimensional correlation coefficient calculation is performed according to the preset pixel spacing to obtain an initial stitching position interval; The two-dimensional correlation coefficient is calculated pixel by pixel within the initial splicing position interval to obtain multiple target splicing positions, the two-dimensional correlation coefficients of the multiple target splicing positions are compared, and the maximum two-dimensional correlation coefficient is output to determine the best splicing position.
8. A fully automatic human body full-length X-ray image fusion and splicing device, characterized in that: include: An acquisition module, used for acquiring a full-length X-ray image of a human body to be spliced, wherein the full-length X-ray image to be spliced is a plurality of target X-ray images under the same imaging viewing angle; A determination module, used for determining the overlapping area to be stitched between adjacent target X-ray images; A first calculation module is used to identify the torso image in the target X-ray image, calculate the maximum two-dimensional correlation coefficient value of the grayscale values of the corresponding pixels in the overlapping area between adjacent torso images, and determine the optimal splicing position of the torso image; A second calculation module is used to identify the double lower limb images in the target X-ray image, establish a splicing reference line for the gap between the double lower limbs, divide the double lower limb images into left and right lower limb images according to the splicing reference line, and calculate the optimal splicing positions of the left and right lower limb images respectively; The fusion and stitching module is used to automatically fuse and stitch the target X-ray images according to the corresponding human body structure based on the optimal stitching position, and balance the grayscale values of the overlapping areas between adjacent target X-ray images based on a fusion transition algorithm to obtain a full-length X-ray image of the human body after stitching and fusion.
9. A computer device, characterized in that: include: A memory, the memory being used to store a processing program; A processor, wherein when executing the processing program, the processor implements the fully automatic human body full-length X-ray image fusion and splicing method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a processing program, and when the processing program is executed by the processor, the fully automatic human body full-length X-ray image fusion and splicing method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
X-ray human body clairvoyance image automatic anastomosing and splicing method
CN101112315A
Automatic splicing method and device for X-ray images, and terminal equipment
CN107665486A
Method and system for image registration
CN116205954A
X-ray imaging apparatus and x-ray image display method
US20180310905A1
Cited By
Complete imaging method and device for load-bearing position CBCT, electronic equipment and storage medium
CN121564147A
Full imaging method, device, electronic equipment and storage medium of weight-bearing position CBCT
CN121564147B
Method and system for eliminating real-time splicing trace of pathological section scanning image
CN121685328A