A method and terminal for identifying a beam limiter region in an X-ray image

By preprocessing the X-ray image and second-order derivative edge extraction, combined with morphological analysis and curve feature screening, the problem of low beam limiter area recognition accuracy is solved, and the positioning accuracy and image post-processing quality of beam limiter area are improved.

CN114419017BActive Publication Date: 2025-03-28安健科技(重庆)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210087375.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-03-28
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify and locate beam limiter areas in X-ray images, especially in mobile X-ray photography systems, resulting in a decrease in image post-processing quality and an increase in physician workload.

Method used

By pre-processing the X-ray image, including cropping, scaling and grayscale normalization, the edge region is then extracted using a second-order derivative, morphological analysis and curve feature screening, and finally the beam limiter region is output.

Benefits of technology

It improves the system's positioning accuracy of the beam limiter area in X-ray images, reduces the probability of false detection and missed detection, automatically provides cropping boundaries, and reduces the work burden of doctors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419017B_ABST
    Figure CN114419017B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and a terminal for identifying a beam limiter region in an X-ray image. After preprocessing the X-ray image, the preprocessed image is processed based on a second-order derivative, so that the edge region in the preprocessed image can be effectively extracted and a corresponding edge region image can be obtained. Furthermore, by performing morphological analysis on the edge region image, complex image processing can be transformed into curve processing, and the edge region can be divided into multiple groups of different edge curves. Finally, by analyzing the curve features of the multiple groups of different edge curves, the curves in the edge curves that meet the beam limiter features can be extracted and output as the beam limiter region, thereby improving the positioning accuracy of the system for the beam limiter region in the X-ray image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for identifying a beam limiter region in an X-ray image. Background Art

[0002] In X-ray photography systems, beam limiters are often used to limit the irradiation range of X-rays. The operating physician can adjust the window size of the beam limiter so that the X-rays only irradiate the area of ​​interest that the physician considers, thereby effectively reducing the dose absorbed by the patient's body. In X-ray photography systems, after the image is captured, an algorithm is required to perform post-processing such as enhancement on the original image to meet the physician's diagnostic needs. However, in X-ray images containing beam limiter imaging areas, the presence of beam limiter shadows will affect the enhancement effect of the area of ​​interest. In addition, the operating physician needs to crop the beam limiter shadow area before providing it to other physicians for diagnosis. Therefore, accurately identifying the beam limiter area from the X-ray image can not only provide it to the post-processing algorithm to improve the image post-processing quality, but also automatically provide the operating physician with an effective area cropping boundary, reducing the workload of the operating physician and improving the efficiency of X-ray photography.

[0003] Although in some X-ray systems, the beam limiter can provide real-time feedback on the window size, and the host computer can locate the beam limiter area in the X-ray image by combining other system parameters such as the source-image distance (SID) from the X-ray source to the detector, in other systems, especially in mobile X-ray systems, the beam limiter does not have a feedback function, and the system cannot accurately provide parameters such as SID, resulting in the beam limiter area in the image cannot be easily located.

[0004] At present, most of the existing solutions adopt the method of directly extracting the edge of the original image. For example, the grayscale features of the extracted edge are further analyzed to determine whether the extracted edge is the limiter boundary; for example, Radon transform (or Hough transform) is performed on the edge image, and the peak point in the generated sinusoidal diagram is used as the transformation coordinate corresponding to the limiter edge. However, since the grayscale features of the limiter boundary are relatively complex, the probability of false detection and missed detection is high when the straight line of the original image is directly extracted. For example, in X-ray images of the abdomen, lumbar spine and other parts, the limiter edge is seriously interfered by scattered rays, the features are not obvious, and it is easy to miss detection; in addition, since some anatomical structures of the human body form very complex and numerous textures in the X-ray image, pseudo peaks will be generated in the Radon transform sinusoidal diagram of the edge image, which is easy to cause false detection, such as the lung texture in the chest front view. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method for identifying a beam limiter region in an X-ray image, thereby improving the positioning accuracy of the system for the beam limiter region in the X-ray image.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A method for identifying a beam limiter region in an X-ray image comprises the steps of:

[0008] Acquire an X-ray image and perform preprocessing to obtain a preprocessed image;

[0009] Performing second-order derivative edge region extraction on the preprocessed image to obtain an edge region image;

[0010] Performing morphological analysis on the edge region image to obtain multiple groups of edge curves;

[0011] Extracting the features of the edge curves and screening multiple groups of edge curves according to the features to obtain feature curves;

[0012] The image region determined by the characteristic curve is output as the beam limiter region.

[0013] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0014] A terminal for identifying a beam limiter region in an X-ray image comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the above-mentioned method for identifying a beam limiter region in an X-ray image are implemented: acquiring an X-ray image and performing preprocessing to obtain a preprocessed image; performing edge region extraction using second-order derivatives on the preprocessed image to obtain an edge region image; performing morphological analysis on the edge region image to obtain multiple groups of edge curves; extracting features of the edge curves and screening multiple groups of edge curves according to the features to obtain feature curves; and outputting the image region determined by the feature curve as a beam limiter region.

[0015] The beneficial effects of the present invention are as follows: by preprocessing the X-ray image and then processing the preprocessed image based on the second-order derivative, the edge area in the preprocessed image can be effectively extracted and the corresponding edge area image can be obtained, and further by performing morphological analysis on the edge area image, complex image processing can be transformed into curve processing, and the edge area can be divided into multiple groups of different edge curves. Finally, by analyzing the curve features of the multiple groups of different edge curves, the curves in the edge curves that meet the beam limiter features can be extracted, and the area formed by them can be output as the beam limiter area, thereby improving the system's positioning accuracy of the beam limiter area in the X-ray image. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flowchart of the steps of a method for identifying a beam limiter area in an X-ray image in an embodiment of the present invention;

[0017] Figure 2 This is a schematic structural diagram of a terminal for identifying a beam limiter region in an X-ray image in an embodiment of the present invention;

[0018] Figure 3 is an example diagram of an X-ray image after preprocessing in an embodiment of the present invention;

[0019] Figure 4 Schematic diagram of comparison between a Laplace image and a peak image of an enhanced image in an embodiment of the present invention;

[0020] Figure 5 is an example diagram of an edge region in an X-ray image extracted in an embodiment of the present invention;

[0021] Figure 6 Schematic diagram of three types of corrosion templates for a method for identifying a beam limiter region in an X-ray image in an embodiment of the present invention;

[0022] Figure 7 is a schematic diagram of an uncorroded edge image in an embodiment of the present invention;

[0023] Figure 8 A schematic diagram of an edge image after corrosion in an embodiment of the present invention;

[0024] Fig. 9 Schematic diagram of the position relationship of the fitting straight line in the embodiment of the present invention;

[0025] Fig.10 is another step flow chart of a method for identifying a beam limiter region in an X-ray image in an embodiment of the present invention;

[0026] Fig.11 is a schematic diagram of a candidate curve in an embodiment of the present invention;

[0027] Fig.12 is a schematic diagram of a first target curve in an embodiment of the present invention;

[0028] Fig.13 is a schematic diagram of a crest transition zone image in an embodiment of the present invention;

[0029] Fig.14 is a schematic diagram of a second target curve in an embodiment of the present invention;

[0030] Fig.15 This is another step flow chart of a method for identifying a beam limiter region in an X-ray image in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0032] Please refer to Figure 1 , a method for identifying a beam limiter region in an X-ray image, comprising the steps of:

[0033] Acquire an X-ray image and perform preprocessing to obtain a preprocessed image;

[0034] Performing second-order derivative edge region extraction on the preprocessed image to obtain an edge region image;

[0035] Performing morphological analysis on the edge region image to obtain multiple groups of edge curves;

[0036] Extracting the features of the edge curves and screening multiple groups of edge curves according to the features to obtain feature curves;

[0037] The image region defined by the characteristic curve is output as a beam limiter region.

[0038] From the above description, it can be seen that the beneficial effects of the present invention are: by preprocessing the X-ray image and then processing the preprocessed image based on the second-order derivative, the edge area in the preprocessed image can be effectively extracted and the corresponding edge area image can be obtained, and further by performing morphological analysis on the edge area image, the complex image processing can be transformed into curve processing, and the edge area can be divided into multiple groups of different edge curves. Finally, by analyzing the curve characteristics of the multiple groups of different edge curves, the curves in the edge curves that meet the beam limiter characteristics can be extracted, and the image area limited by them can be output as the beam limiter area, thereby improving the system's positioning accuracy of the beam limiter area in the X-ray image.

[0039] Furthermore, the performing edge region extraction of the second-order derivative of the preprocessed image to obtain the edge region image comprises:

[0040] Filtering the preprocessed image by a Laplace operator to obtain a Laplace image; the Laplace image includes a trough interval, a flat interval and a peak interval;

[0041] enhancing the Laplace image to obtain an enhanced image;

[0042] The histogram of the enhanced image is counted to segment the peak interval to obtain the edge area image.

[0043] From the above description, it can be seen that in the X-ray image, due to the interference of scattered rays and other reasons, the grayscale change between the beam limiter and the air area, and between the beam limiter and the human anatomical structure is not a strong step, but a relatively slow grayscale transition area. Therefore, compared with the conventional first-order differential operator, the edge area image of the preprocessed image is extracted by the second-order differential Laplace operator, and different grayscale transition areas such as peaks and troughs, as well as grayscale flat areas are extracted from the preprocessed image to obtain trough intervals, flat intervals and peak intervals, and the Laplace image is further enhanced, so that the peak area is enhanced and the trough area is weakened. At the same time, most of the anatomical texture tissues and flat areas are also weakened, so that the peak interval can be easily separated in the subsequent segmentation process, thereby improving the acquisition accuracy of the edge area image.

[0044] Furthermore, the performing morphological analysis on the edge region image to obtain multiple groups of edge curves includes:

[0045] Acquire all connected domains in the edge region image;

[0046] Deleting the connected domain that does not meet the preset conditions to obtain a valid edge region image;

[0047] Performing morphological thinning on the effective edge region image to obtain an edge image;

[0048] Morphological erosion is performed on the edge image to obtain a plurality of groups of edge curves.

[0049] From the above description, it can be seen that by obtaining all connected domains in the edge area image and screening the connected domains according to preset conditions, the invalid areas in the edge area image are reduced, and the effective edge area image is further refined to extract the edge image, and then the edge image is morphologically eroded, so that the edges of the texture detail areas in the image, the edges of the beam limiters, and the edges of the skin lines and other interconnected curves can be separated to obtain multiple edge curves that are not interconnected, thereby improving the extraction accuracy of the edge curves.

[0050] Furthermore, the performing morphological corrosion on the edge image to obtain a plurality of groups of edge curves comprises:

[0051] Corroding the edge image using a preset corrosion template;

[0052] Performing least square straight line fitting on a preset neighborhood of each edge pixel in the eroded edge image;

[0053] According to a preset fitting mean square error, different curves are separated to obtain a plurality of groups of edge curves.

[0054] From the above description, it can be seen that by corroding the edge image and performing least squares straight line fitting, different curves can be separated by the preset fitting mean square error, that is, judging whether the curve can be fitted into a straight line. If not, the curve is separated, such as separating the connection area of ​​two vertical beam limiter edges, so as to achieve the purpose of separating edge curves from each other.

[0055] Furthermore, the extracting the features of the edge curves and screening the plurality of groups of edge curves according to the features to obtain the feature curves comprises:

[0056] Create a circumscribed ellipse for each edge curve to obtain a major axis value and a minor axis value of the circumscribed ellipse;

[0057] The edge curve is screened according to the ratio of the major axis value to the minor axis value: k = a / b 2 ;

[0058] Among them, a represents the major axis value, b represents the minor axis value, and k represents the ratio;

[0059] The edge curves whose ratios are lower than a preset value are deleted.

[0060] From the above description, it can be seen that each edge curve is screened by using a curve circumscribed ellipse. When the ratio of the major axis value to the minor axis value corresponding to the edge curve does not meet the requirements, the edge curve is deleted, thereby judging the length of the edge curve and whether it is a straight line in a quantifiable numerical way. Therefore, the effective edge curve set can be determined, further improving the extraction accuracy of the edge curve.

[0061] Furthermore, the extracting the features of the edge curves and screening the plurality of groups of edge curves according to the features to obtain the feature curves comprises:

[0062] Accumulatively projecting the enhanced image along a first preset direction to obtain a first target curve;

[0063] Obtaining a peak interval on the first target curve;

[0064] Obtaining a boundary peak band according to the peak interval;

[0065] Accumulate and project the boundary crest band along a second preset direction to obtain a second target curve;

[0066] It is determined whether the second target curve meets the boundary condition, and if so, it is marked as the characteristic curve.

[0067] It can be seen from the above description that by cumulatively projecting the enhanced image along the first preset direction and the second preset direction in sequence, information corresponding to the edge curve is obtained from different directions, thereby improving the accuracy of edge curve judgment.

[0068] Further, the determining whether the second target curve satisfies the boundary condition, and if so, marking it as the characteristic curve comprises:

[0069] Extracting all trough intervals in the second target curve and the lengths corresponding to the trough intervals;

[0070] Counting the lengths of all the trough intervals to obtain the total length of the trough intervals and the length of the longest trough interval;

[0071] It is determined whether the total length of the trough interval is greater than a first trough interval length threshold or whether the longest trough interval length is greater than a second trough interval length. If one of the conditions is met, it is determined to be a non-beam limiter edge.

[0072] From the above description, it can be seen that by obtaining the corresponding trough interval in the second target curve, it is judged whether the edge curve is a beam limiter edge. When the judgment condition is met, the curve is judged as a non-beam limiter edge. The edge curve is judged in combination with the trough interval to improve the judgment accuracy of the edge curve.

[0073] Further, the determining whether the second target curve satisfies the boundary condition, and if so, marking it as the characteristic curve further includes:

[0074] Extracting all flat intervals in the second target curve and positions corresponding to the flat intervals;

[0075] It is determined whether the number of the flat intervals is less than a preset number, or whether the flat intervals are located at both ends of the second target curve. If one of the conditions is met, it is determined to be a non-beam limiter edge.

[0076] From the above description, it can be seen that by obtaining the corresponding flat interval in the second target curve, it is judged whether the edge curve is a beam limiter edge. When the judgment condition is met, the curve is judged as a non-beam limiter edge. The edge curve is judged in combination with the flat interval to improve the accuracy of edge curve judgment.

[0077] Further, the determining whether the second target curve satisfies the boundary condition, and if so, marking it as the characteristic curve further includes:

[0078] Extracting all peak intervals in the second target curve and the lengths corresponding to the peak intervals;

[0079] Counting the total length of the peak interval, the total length of the flat interval and the mean of the peak interval;

[0080] It is determined in turn whether the total length of the peak interval is greater than the shortest boundary distance, whether the sum of the total length of the peak interval and the total length of the flat interval is greater than the second target curve, and whether the mean of the peak interval is greater than the preset peak area mean. If all of the above conditions are met, it is determined to be the edge of the beam limiter.

[0081] From the above description, it can be seen that since there may be direct projection areas of the beam limiter at both ends of the transition peak area of ​​the beam limiter boundary in the extended area in the current edge direction of the entire image, and the value of the enhanced image in this part of the area is very small and relatively flat, while the value in the transition peak area is very large, therefore, by obtaining the corresponding flat interval and peak interval in the second target curve to determine whether the edge curve is the beam limiter edge, the possibility of misjudgment can be reduced and the accuracy of edge curve judgment can be improved.

[0082] Please refer to Figure 2 A terminal for identifying a beam limiter area in an X-ray image comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned method for identifying a beam limiter area in an X-ray image is implemented.

[0083] The above-mentioned method and terminal for identifying the beam limiter area in the X-ray image of the present invention can be applied to various types of X-ray image processing, such as being applied to X-ray photography systems including fixed X-ray photography systems and mobile X-ray photography systems, and are described below through specific implementation methods:

[0084] Embodiment 1

[0085] Please refer to Figure 1 , a method for identifying a beam limiter region in an X-ray image, comprising the steps of:

[0086] S1, obtaining an X-ray image and preprocessing it to obtain a preprocessed image, including the steps of:

[0087] S11, cropping the X-ray image to remove invalid pixels to obtain the original X-ray image I original ;The cropping parameters are determined by the X-ray detector used by the system;

[0088] S12, scaling the original X-ray image to obtain a scaled image I scale ;I scale = resize(I original ); Since the original X-ray image matrix is ​​generally large, the acquisition speed of the beam limiter area can be increased after scaling;

[0089] S13, normalizing the grayscale values ​​of pixels in the zoomed image to the interval [0-255];

[0090] Igray =(I scale -min(I scale )) / (max(I scale )-min(I scale ))*255; where min(I scale )、max(I scale ) refer to I scale The minimum grayscale value and the maximum grayscale value in the image are normalized; after the grayscale values ​​are normalized, the detection of the beam limiter area can be better implemented;

[0091] S14, processing the zoomed image by algorithms such as Gamma change or Log change, etc., which can improve the contrast between the beam limiter area and the non-beam limiter area and highlight the target boundary features; please refer to Figure 3 , is an example of an X-ray image after preprocessing;

[0092] S2, performing edge region extraction of the second-order derivative on the preprocessed image to obtain an edge region image, comprising the steps of:

[0093] S21, filtering the pre-processed image by using a Laplace operator to obtain a Laplace image I L ; Wherein, the Laplace operator may be a second-order differential Laplace operator, or the LoG (Laplacian of Gaussian) operator and the DoG (Difference of Gaussian) operator are used to extract the boundary transition area of ​​the X-ray image; the Laplace image includes a trough interval, a flat interval and a peak interval; and in the Laplace image, the boundary of the original grayscale image and the grayscale transition area of ​​the texture detail area will show peaks and troughs; the peak is on the low grayscale value side of the edge grayscale transition area, and the trough is on the high grayscale value side; the wider the transition area, the wider the width of the peak and the trough;

[0094] S22, enhancing the Laplace image to obtain an enhanced image I L_enhance ;

[0095] Calculate the gray value of the enhanced image: I L_enhance =I L / I;

[0096] In X-ray images of certain parts (body positions), the strength of the beam limiter edge is often weakened by thicker anatomical structures. For example, in the lateral view of the cervical spine, the upper and lower beam limiter edges of the image are weakened by the skull and shoulder, respectively. The edge area is enhanced by enhancing the Laplace image.

[0097] Please refer to Figure 4In the peak area of ​​the beam limiter edge, the basic grayscale is lower because it is closer to the beam limiter area, so the edge will be enhanced. In the trough area of ​​the beam limiter edge, the basic grayscale is higher and the edge strength will be relatively weakened. In most of the detailed texture areas of the anatomical structure, the basic grayscale is relatively high and the edge will be relatively weakened. In addition, in the beam limiter edge area, the anatomical structure tissue causes less damage to the peak than to the trough, so the edge area is enhanced.

[0098] S23, calculating the histogram of the enhanced image to segment the peak interval to obtain the edge area image;

[0099] Statistically enhanced image I L_enhance Histogram Hist_I L_enhance , and calculate the segmentation point ThreEdge to segment the peak mask:

[0100]

[0101] Get the edge peak mask image I_Mask peakregion :

[0102]

[0103] Among them, M and N represent I L_enhance The height and width of the edge ratio; EdgeRatio is the segmentation ratio, such as setting it to 0.15; max(I L_enhance ) indicates I L_enhance The gray value maximum value in the edge peak mask image I_Mask peakregion This is the edge area image; please refer to Figure 5 is the edge peak mask image obtained after processing;

[0104] S3, performing morphological analysis on the edge region image to obtain multiple groups of edge curves, including the steps of:

[0105] S31, acquiring all connected domains in the edge region image;

[0106] S32, deleting the connected domain that does not meet the preset conditions to obtain a valid edge region image;

[0107] Since there are many subtle texture areas of anatomical structures in the edge area image, excluding such boundary areas before extracting the edge curve can improve the algorithm's recognition speed of the effective beam limiter edge curve;

[0108] S33, performing morphological refinement on the effective edge region image to obtain an edge image I skel; Since in the edge image, the edges of the image texture detail area, the beam limiter edges, the skin line edges, etc. are connected to each other, and the beam limiter edges that are perpendicular to each other may also be connected together; therefore, these edges must be effectively separated;

[0109] S34, corroding the edge image using a preset corrosion template to obtain multiple sets of edge curves, including:

[0110] S341, corroding the edge image using a preset corrosion template;

[0111] Please refer to Figure 6 , the edge image Iskel is corroded by using preset templates (T-type, Y-type and Z-type) and 90°, 180° and 270° rotation templates;

[0112] S342, performing least square straight line fitting on a preset neighborhood of each edge pixel in the eroded edge image, and separating different curves according to a preset fitting mean square error to obtain a plurality of groups of edge curves;

[0113] Specifically, for the edge image I skel The 31*31 neighborhood of each edge pixel in the image is fitted with the least square straight line. The pixels with a fitting mean square error greater than the set threshold ThreMinErr (the empirical value is 6) may be the connection area of ​​the vertical beam limiter edge. At the same time, in the edge image I skel By setting such pixels to 0, the purpose of separating the edges of mutually perpendicular beam limiters is achieved;

[0114] Assume that the mean square error of the fitting is expressed as E, then: I skel =0,E(x,y)>ThreMinErr;

[0115] In an optional implementation, before executing step S342, the edge image I skel After the size is reduced to a preset ratio, step S342 is performed. When the target pixel point (the pixel point corresponding to the edge curve) is obtained, it is upsampled and mapped to the edge image I skel In the process, the edge curve is obtained, thereby improving the execution speed of the algorithm;

[0116] Please refer to Figure 7 and Figure 8 , is the edge image I before and after processing skel It can be clearly seen that the edge image I after processing skel The curves that are perpendicular to each other or have a large connection angle are separated; however, the image contains not only the edge curve of the beam limiter, but also the edge curve of the skin and the edge curve of a small part of the anatomical structure, so it is also necessary to separate the edge image Iskel Further extracting the plurality of groups of edge curves in the step S4;

[0117] S4, extracting the features of the edge curve and screening multiple groups of edge curves according to the features to obtain a feature curve comprises the following steps:

[0118] S41, circumscribing an ellipse for each edge curve to obtain a major axis value and a minor axis value of the circumscribing ellipse;

[0119] S42, screening the edge curve according to the ratio k of the major axis value to the minor axis value: k = a / b 2 ; Deleting the edge curve whose ratio k is lower than a preset value;

[0120] Wherein, a represents the major axis value, b represents the minor axis value, and k represents the ratio; from the analysis of the curve shape, the closer the curve is to a straight line and the longer it is, the more likely it is the edge of the beam limiter; therefore, the curve with a longer major axis and a shorter minor axis is more likely to be the edge of the beam limiter; if the k value is set to 10, the edge curve with a k value less than 10 in the edge curve can be obtained; and the characteristic curve is obtained;

[0121] S5. Output the image region defined by the characteristic curve as a beam limiter region.

[0122] Embodiment 2

[0123] The difference between this embodiment and the first embodiment is that after S42 in step S4, the edge curve is further screened:

[0124] Please refer to Fig. 9 , is the result of the least square method for linear fitting of the curve; if the angle between the fitted straight line and the positive direction of the x-axis in the first rectangular coordinate system XOY is θ, θ∈(-90,90]; the foot point of the perpendicular from the center of the image to the fitted straight line is P(x,y); let the second rectangular coordinate system SOT be the first rectangular coordinate system XOY rotated 90-θ clockwise; obviously, the fitted straight line is perpendicular to the s-axis, the foot point is P, let the coordinates of point P in the SOT coordinate system be (S,0);

[0125] Please refer to Fig.10 , obtaining a candidate curve set C according to the plurality of sets of edge curves;

[0126] A1. Obtain the edge curve in the candidate curve set C; obtain and judge in order of k value from large to small, which can improve the efficiency of screening;

[0127] The edge curve is used to characterize the position of the beam limiter boundary. After obtaining the edge curve, it is necessary to continue to analyze the information near the position of the edge curve in the enhanced edge image, so the edge curve is no longer analyzed. The role of the edge curve is only to roughly locate the position of the beam limiter boundary in the image.

[0128] A2. Accumulate and project the enhanced image along a first preset direction to obtain a first target curve Proj L ; The first preset direction is along the negative direction of the t-axis; Fig.11 As shown, if the curve Lc is the beam limiter boundary curve, then the beam limiter boundary transition peak area is in Proj L A clear wave crest is formed in the wave, and the foot point S must be located at Proj L in the crest area;

[0129] A3. Obtaining a peak interval on the first target curve;

[0130] Please refer to Fig.12 , in Proj L The center is the foot point S, r peak Find the coordinates of the peak maximum point S for the radius peak :

[0131] Project L (S peak )=max(Proj L (Sr peak :S+r peak ));

[0132] Then S peak As the coordinate center point, Proj L (S peak ) / 6 is the projection value threshold, find S peak The main wave peak boundary point S on the left and right sides L , S R :

[0133] Project L (S L -1)≤Proj L (S peak ) / 6;Proj L (S L )>Proj L (S peak ) / 6

[0134] Project L (S R +1)≤Proj L (S peak ) / 6;ProjL (S R )>Proj L (S peak ) / 6, and get the main interval of the peak: Proj L (S L :S R );

[0135] A4. Obtaining a boundary peak band according to the peak interval;

[0136] Please refer to Fig.13 , generate a peak main interval mask according to the peak interval:

[0137]

[0138] Proj_Mask L_Peak Back-project to size I L_Enhence From the mask image of size, we get the mask I_Mask of the peak transition zone L_Peak ; and further calculate the boundary peak band I L_PeakRegion :

[0139] I L_PeakRegion =I_Mask L_Peak *I L_Enhence ;

[0140] A5. Accumulate and project the boundary crest band along a second preset direction to obtain a second target curve Proj L_Pend ; The second preset direction is along the s-axis direction;

[0141] Please refer to Fig.14 , is the second target curve Proj L_Pend image;

[0142] A6. Determine whether the second target curve meets the boundary condition, and if so, mark it as the characteristic curve;

[0143] Among them, the boundary conditions include: first, proj L_Pend There is no obvious valley area, if there is, it is marked as the edge of the beam limiter:

[0144] A611. Extract all trough intervals in the second target curve and the lengths corresponding to the trough intervals;

[0145] A612. Count the lengths of all the trough intervals to obtain the total length of the trough intervals and the length of the longest trough interval;

[0146] A613: Determine whether the total length of the trough interval is greater than the first trough interval length threshold or whether the longest trough interval length is greater than the second trough interval length. If one of the conditions is met, determine that it is not a beam limiter edge. Specifically:

[0147] Assume the trough threshold ThreValley = -0.03, and generate the trough area mask Mask Valley (x):

[0148]

[0149] Statistics Mask Valley Continuous interval, the length of each continuous interval is Len Valley (i), i=0, 1, 2, .... Assume that the second valley interval length threshold MaxValleyLen is 100, and the first valley interval length threshold is MaxValleyLen / 2, if there exists:

[0150] ∑Len Valley (i)>MaxValleyLen or max(Len valley (i))>MaxValleyLen / 2, then the current area has an obvious valley area, which is determined to be a non-limiter edge, and returns to obtain the next curve;

[0151] Second, Project L_Pend Whether the flat interval meets the preset conditions, if so, it is marked as the edge of the beam limiter:

[0152] A621. Extract all flat intervals in the second target curve and positions corresponding to the flat intervals;

[0153] A622: Determine whether the number of the flat intervals is less than a preset number, or whether the flat intervals are located at both ends of the second target curve. If one of the conditions is met, it is determined to be a non-beam limiter edge. Specifically:

[0154] Assume the preset number 2, flat area threshold ThreFlat = 0.03, and obtain the flat area mask Mask Flat (x):

[0155]

[0156] Statistics Mask Flat The length and position of the continuous interval; if the above conditions are not met, the current curve is determined to be a non-beam limiter edge, and the next curve is returned; if the above conditions are met, the total length of the flat interval Len is counted Flat ;

[0157] Third, check whether the effective boundary peak area meets the preset conditions. If so, it is marked as the edge of the beam limiter:

[0158] A631. Extract all peak intervals in the second target curve and the lengths corresponding to the peak intervals;

[0159] Counting the total length of the peak interval, the total length of the flat interval and the mean of the peak interval;

[0160] It is determined in sequence whether the total length of the peak interval is greater than the shortest boundary distance, whether the sum of the total length of the peak interval and the total length of the flat interval is greater than the second target curve, and whether the mean of the peak interval is greater than the preset peak area mean. If all of the above conditions are met, it is determined to be the edge of the beam limiter. Specifically:

[0161] Usually, there is only one continuous interval in the peak of the beam limiter boundary area, but due to the interference of some anatomical structures, this interval may be disconnected, the number of peak intervals increases, and the length of a single interval decreases; the peak area threshold is set to ThrePeak = 0.05; the part between ThreFlat and ThreFlat is considered to be other texture areas and transition areas; get the peak area Mask Peak :

[0162]

[0163] Statistics Mask Peak The continuous interval and length of each continuous interval are obtained as Len Peak (i), i = 0, 1, 2, ...; let the minimum mean value of the peak area be MinAvePeak = 0.08; let Mask Peak The starting point of the upper valid interval is start, the ending point is end, and the shortest edge distance is MinEdgeDistance; if conditions (1), (2) and (3) are met at the same time:

[0164] Len Peak >MinEdgeDistance (1)

[0165]

[0166] LenP eak +Len Flat >0.9*Len Proj (3)

[0167] Then the current curve is determined to be the beam limiter boundary; Len Peak =Sum(Len Peak (i)), Len Proj For ProjectL_Pend Overall length;

[0168] Finally, the image beam limiter region projection mask is generated and returned. The relative position relationship between the beam limiter region and the curve L under the current projection angle θ can be obtained from the S value sign. If S>0, it means that L is a right boundary:

[0169]

[0170] If S < 0, it is the left boundary:

[0171]

[0172] Embodiment 3

[0173] This embodiment provides a specific method for detecting the edge of an effective beam limiter, which can be performed simultaneously with step S4;

[0174] In digital X-ray images acquired under normal photographic conditions, the number of beam limiter edges in the image is generally 0, 2 or 4, and they are parallel to the image edge, and the edges are parallel or perpendicular to each other; however, in some special photographic positions (parts) (such as the calcaneal axis position), and in mobile X-ray photography systems, affected by various factors, the number of beam limiter edges in the image may be 0, 1, 2, 3 or 4, the edge directions are irregular, and there is a certain deviation in the parallel or perpendicular relationship between them;

[0175] In this embodiment, the maximum angle error θ between the two parallel beam limiter edges in the image is assumed Err_Para , the maximum angle error of the mutually perpendicular beam limiter edges θ Err_Pend ; Set θ Err_Para =5°,θ Err_Pend =8°, the angle can be adjusted according to the actual usage scenario of the photography system;

[0176] Please refer to Fig.15 , effective beam limiter edge detection includes the steps:

[0177] B1. Obtain the geometric features of the curves in set C;

[0178] B2. Detect the first beam limiter boundary in C. Specifically:

[0179] The detection is performed according to the method steps in the second embodiment; if the detection fails, the detection is directly returned and the detection is ended; if the detection is successful, the curve is set as the first curve, and the characteristics of the first curve such as the angle θ 1 , and the perpendicular P from the center of the image to the first curve 1 Perform parallel edge detection;

[0180] In the curve set C, select the angle θ in the range [θ-θErr_Para ,θ+θ Err_Para ], and the foot of the perpendicular from the image center to the fitting line satisfies ||P 1 -P||≥MinEdgeDistance, let the set of these curves be C2;

[0181] B3, detecting the second beam limiter boundary in C2;

[0182] Get a curve in C2 and set it as the second curve, and set the angle of the second curve to θ 2 ;

[0183] B4, generating a candidate curve set C3 according to the boundary of the first curve and the second curve;

[0184] According to the angle of the first curve and the angle of the second curve, select from C the curves that satisfy:

[0185] Angle θ Pend =θ 1 ±90° or θ Pend =(θ 1 +θ 2 ) / 2±90°, and obtain the candidate curve set C3;

[0186] The curve in C3 satisfies: |θ-θ Pend |≤θ Err_Pend ;

[0187] B5, detect the third beam limiter boundary in C3;

[0188] Get a curve in C3 and set it as the third curve, and set the angle of the second curve shown to θ 3 , let P be the foot of the perpendicular line from the image center to the third beam limiter edge curve fitting line 3 ;

[0189] B6. Generate a candidate curve set C4 according to the third curve;

[0190] Filter out from C3 those that satisfy ||P 3 -P||≥MinEdgeDistance curve, generate candidate curve set C4;

[0191] B7. Detect the fourth beam limiter edge in C4.

[0192] Embodiment 4

[0193] Please refer to Figure 2, a terminal for identifying a beam limiter region in an X-ray image, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step in a method for identifying a beam limiter region in an X-ray image as described in any one of embodiments 1 to 3 is implemented;

[0194] In conventional X-ray imaging systems, the operating physician needs to manually cut off the beam limiter area in the host computer. By sending the beam limiter area information obtained by the beam limiter area recognition method in the X-ray image to the host computer, automatic cutting can be achieved, reducing the workload of the operating physician and improving the imaging efficiency. That is, the host computer can remove the beam limiter area and directly provide the area of ​​interest to the operating physician. The host computer can also provide a pre-cut range in the image observation interface for the physician to confirm the cutting. Compared with the method of directly obtaining the beam limiter area based on the X-ray imaging system hardware information (beam limiter window size feedback, SID, relative position of the beam limiter and the detector, etc.), this method has the following advantages:

[0195] First, low economic cost: it does not require a hardware platform with specific functions, and can be directly used by writing it into the X-ray imaging workstation as a set of program algorithms;

[0196] Second, the performance is not affected by the mechanical errors of the system;

[0197] Third, it is suitable for mobile X-ray photography systems and does not require strict clinical photography positioning.

[0198] In summary, the present invention provides a method and a terminal for identifying a beam limiter region in an X-ray image.

[0199] After the X-ray image is preprocessed by cropping, scaling and grayscale normalization, the boundary transition area of ​​the preprocessed image is extracted based on the second-order differential Laplace operator, and enhancement processing is performed at the same time. The edge area in the preprocessed image can be effectively extracted and the corresponding edge area image can be obtained. Further, by performing connected area processing, morphological refinement processing, morphological erosion and least squares straight line fitting on the edge area image, the complex image processing can be transformed into curve processing, and the edge area can be divided into multiple groups of different edge curves. Finally, by analyzing the curve characteristics of multiple groups of different edge curves, the curve that meets the beam limiter characteristics in the edge curve can be extracted and output as the beam limiter area, thereby improving the system's positioning accuracy of the beam limiter area in the X-ray image.

[0200] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for identifying a beam limiter region in an X-ray image, characterized in that: Includes steps: Acquire an X-ray image and perform preprocessing to obtain a preprocessed image; Performing second-order derivative edge region extraction on the preprocessed image to obtain an edge region image; Performing morphological analysis on the edge region image to obtain multiple groups of edge curves; Extracting the features of the edge curves and screening multiple groups of edge curves according to the features to obtain feature curves; Outputting the image region determined by the characteristic curve as a beam limiter region; The performing edge region extraction of the second-order derivative on the preprocessed image to obtain the edge region image comprises: Filtering the preprocessed image by a Laplace operator to obtain a Laplace image; the Laplace image includes a trough interval, a flat interval and a peak interval; enhancing the Laplace image to obtain an enhanced image; Counting the histogram of the enhanced image to segment the peak interval to obtain the edge area image; The extracting the features of the edge curves and screening the plurality of groups of edge curves according to the features to obtain the feature curves comprises: Accumulatively projecting the enhanced image along a first preset direction to obtain a first target curve; Obtaining a peak interval on the first target curve; Obtaining a boundary peak band according to the peak interval; Accumulate and project the boundary crest band along a second preset direction to obtain a second target curve; It is determined whether the second target curve meets the boundary condition, and if so, it is marked as the characteristic curve.

2. The method for identifying a beam limiter region in an X-ray image according to claim 1, characterized in that: The performing morphological analysis on the edge region image to obtain multiple groups of edge curves includes: Acquire all connected domains in the edge region image; Deleting the connected domain that does not meet the preset conditions to obtain a valid edge region image; Performing morphological thinning on the effective edge region image to obtain an edge image; Morphological erosion is performed on the edge image to obtain a plurality of groups of edge curves.

3. The method for identifying a beam limiter region in an X-ray image according to claim 2, characterized in that: The performing morphological corrosion on the edge image to obtain a plurality of groups of edge curves comprises: Corroding the edge image using a preset corrosion template; Performing least square straight line fitting on a preset neighborhood of each edge pixel in the eroded edge image; According to a preset fitting mean square error, different curves are separated to obtain a plurality of groups of edge curves.

4. The method for identifying a beam limiter region in an X-ray image according to claim 1, characterized in that: The extracting the features of the edge curves and screening the plurality of groups of edge curves according to the features to obtain the feature curves comprises: Create a circumscribed ellipse for each edge curve to obtain a major axis value and a minor axis value of the circumscribed ellipse; The edge curve is screened according to the ratio of the major axis value to the minor axis value: ; Among them, a represents the major axis value, b represents the minor axis value, and k represents the ratio; The edge curves whose ratios are lower than a preset value are deleted.

5. The method for identifying a beam limiter region in an X-ray image according to claim 1, characterized in that: The determining whether the second target curve satisfies the boundary condition, and if so, marking it as the characteristic curve comprises: Extracting all trough intervals in the second target curve and the lengths corresponding to the trough intervals; Counting the lengths of all the trough intervals to obtain the total length of the trough intervals and the length of the longest trough interval; If the total length of the trough interval is greater than the first trough interval length threshold or the longest trough interval length is greater than the second trough interval length, if one of the conditions is met, it is determined to be a non-beam limiter edge.

6. The method for identifying a beam limiter region in an X-ray image according to claim 1, characterized in that: The determining whether the second target curve satisfies the boundary condition and marking it as the characteristic curve if so further comprises: Extracting all flat intervals in the second target curve and positions corresponding to the flat intervals; If the number of the flat intervals is less than a preset number, or the flat intervals are located at both ends of the second target curve, and one of the conditions is met, it is determined to be a non-beam limiter edge.

7. A method for identifying a beam limiter region in an X-ray image according to claim 6, characterized in that: The determining whether the second target curve satisfies the boundary condition and marking it as the characteristic curve if so further comprises: Extracting all peak intervals in the second target curve and the lengths corresponding to the peak intervals; Counting the total length of the peak interval, the total length of the flat interval and the mean of the peak interval; If the total length of the peak interval is greater than the shortest boundary distance, the sum of the total length of the peak interval and the total length of the flat interval is greater than 0.9 times the total length of the second target curve, and the mean of the peak interval is greater than the preset peak area mean, if all of the above conditions are met, it is determined to be the edge of the beam limiter.

8. A terminal for identifying a beam limiter region in an X-ray image, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the various steps in the method for identifying a beam limiter area in an X-ray image as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Beam limiting device detection method based on X-ray image

    CN106327511A

  • Viewpoint positioning method and device, electronic equipment and computer readable storage medium

    CN113378790A