Method, apparatus, device, and medium for identifying non-human tissue regions in X-ray images

By preprocessing and algorithmic calculation of X-ray images, accurately identifying air areas and beam limiter areas, solving the problem of inaccurate identification in the prior art, and improving the accuracy and efficiency of image processing.

CN114693634BActive Publication Date: 2025-05-30SHENZHEN ANGELL TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210316942.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-05-30
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify air areas and beam limiter areas in X-ray images, resulting in interference in medical image processing and diagnosis.

Method used

By processing the original X-ray grayscale image into a preset size grayscale image, and based on the sobel operator, Canny algorithm and Hough transformation, the overexposure area, binary image, high brightness area and boundary area are calculated, combined with the number of air blocks and boundary area filling, the air area is determined, and the beam limiter area is determined through the Hough transformation.

Benefits of technology

Accurate identification of air areas and beam limiter areas in X-ray images is achieved, unnecessary calculations are reduced, recognition speed and accuracy are improved, and interference to medical image processing and diagnosis is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114693634B_ABST
    Figure CN114693634B_ABST
Patent Text Reader

Abstract

The present application relates to the field of medical image processing, and provides a method, device, equipment and computer-readable storage medium for identifying non-human tissue regions in X-ray images, which can completely and accurately segment or identify the air region and the collimator region in the X-ray image. The method includes: processing the original X-ray grayscale image into a grayscale image of a preset size; calculating the grayscale image of the preset size according to a preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain an overexposed region binary image, a high-brightness region binary image and a boundary region binary image; determining the air region in the grayscale image of the preset size according to the number of air blocks in the overexposed region binary image and the filling of the boundary region binary image, and outputting an air region binary image; using the air region binary image and the grayscale image of the preset size as inputs, and determining the collimator region in the grayscale image of the preset size based on the sobel operator, the Canny algorithm and the Hough transform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical image processing, and particularly to a method, device, equipment and computer-readable storage medium for identifying non-human tissue regions in X-ray images. Background Art

[0002] The images of medical digital radiography (DR) equipment generally include three parts: an air region, a collimator region, and a human tissue region. When the X-ray of the medical DR equipment reaches the detector, the region formed on the X-ray image of the medical DR equipment by the lead leaves of the collimator is the collimator region, the region formed on the X-ray image of the medical DR equipment when passing through human tissues without passing through the collimator is the human tissue region, and the region formed on the X-ray image of the medical DR equipment when reaching the detector only through air without passing through the collimator and without passing through human tissues is the air region. Although the human tissue region is the part that should be focused on in the X-ray image, the invalid information on the air region and the collimator region will interfere with medical image processing and doctor diagnosis. Therefore, these two regions on the X-ray image are also required.

[0003] For the identification of the air region on the X-ray image, the existing method is a threshold-based segmentation method, that is, calculating the threshold by a certain method and then performing segmentation based on the threshold. For the identification of the collimator region, it is performed by a hardware method. However, for the identification of the air region by the threshold-based segmentation method, due to the partial overlap of the gray values of the air, collimator, and human tissue regions, the identification results are often incomplete or incorrect. For the identification of the collimator region by the hardware method, due to the uncertain relative positions of the X-ray tube and the detector of the DR equipment, it is difficult to obtain the collimator region. And when using the threshold-based segmentation method as the method for identifying the air region, there are also the same problems as those in the method for identifying the air region by the threshold-based segmentation method. Summary of the Invention

[0004] The present application provides a method, device, equipment and computer-readable storage medium for identifying non-human tissue regions in X-ray images, which can completely and accurately segment or identify the air region and the collimator region of the X-ray image.

[0005] On the one hand, the present application provides a method for identifying non-human tissue regions in X-ray images, including:

[0006] Processing the original X-ray gray-scale image into a gray-scale image of a preset size;

[0007] Calculating the gray-scale image of the preset size according to a preset gray-scale threshold and the highest gray-scale value, and based on the sobel operator and the Canny algorithm, to obtain an overexposed region binary image, a high-brightness region binary image, and a boundary region binary image;

[0008] Determine the air region in the preset-size grayscale image based on the number of air blocks in the overexposed region binary image and the filling of the boundary region binary image, and output the air region binary image;

[0009] Take the air region binary image and the preset-size grayscale image as inputs, and determine the collimator region in the preset-size grayscale image based on the sobel operator, Canny algorithm, and Hough transform.

[0010] On the other hand, the present application provides an identification device for non-human tissue regions in X-ray images, including:

[0011] A preprocessing module for processing the original X-ray grayscale image into a preset-size grayscale image;

[0012] A calculation module for calculating the preset-size grayscale image according to a preset grayscale threshold and the highest grayscale value, and based on the sobel operator and Canny algorithm, to obtain an overexposed region binary image, a high-brightness region binary image, and a boundary region binary image;

[0013] A first determination module for determining the air region in the preset-size grayscale image based on the number of air blocks in the overexposed region binary image and the filling of the boundary region binary image, and outputting the air region binary image;

[0014] A second determination module for taking the air region binary image and the preset-size grayscale image as inputs, and determining the collimator region in the preset-size grayscale image based on the sobel operator, Canny algorithm, and Hough transform.

[0015] In a third aspect, the present application provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the technical solution of the above-mentioned method for identifying non-human tissue regions in X-ray images are implemented.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the technical solution of the above-mentioned method for identifying non-human tissue regions in X-ray images are implemented.

[0017] As can be seen from the technical solutions provided in the present application above, on the one hand, according to a preset gray threshold and the highest gray value, and based on the sobel operator and the Canny algorithm, a gray image of a preset size is calculated to obtain a binary image of the overexposed area, a binary image of the high-brightness area, and a binary image of the boundary area. Since the air area can be classified, it is convenient to accurately identify the air area in the original X-ray gray image and can reduce unnecessary operations or improve the operation speed. On the other hand, considering that there is generally partial overlap between the air area and the collimator area, therefore, the gray image of the preset size and the binary image of the identified air area are used as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform, the collimator area in the gray image of the preset size is determined, and the air area and the collimator area can also be accurately segmented or identified. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0019] Figure 1 is a flowchart of a method for identifying non-human tissue regions in an X-ray image provided by an embodiment of the present application;

[0020] Figure 2 is a schematic structural diagram of a collimator provided by an embodiment of the present application;

[0021] Figure 3a is a schematic diagram of the relationship between the first upper boundary of the collimator area and the uppermost edge of the binary image of the air area, and the first lower boundary of the collimator area and the lowermost edge of the binary image of the air area provided by an embodiment of the present application;

[0022] Figure 3b is a schematic diagram of the relationship between the first left boundary of the collimator area and the leftmost edge of the binary image of the air area, and the first right boundary of the collimator area and the rightmost edge of the binary image of the air area provided by an embodiment of the present application;

[0023] Figure 4a , Figure 4b , Figure 4c are respectively schematic diagrams of the comparison of the original X-ray gray image without processing, the processing result of the original X-ray gray image according to the prior art (threshold segmentation algorithm), and the result of the air area identified by using the method provided by the embodiment of the present application;

[0024] Figure 5It is a schematic diagram comparing the original X-ray grayscale image provided by the embodiment of the present application with the effect after the collimator area has been segmented or recognized;

[0025] Figure 6 It is a schematic structural diagram of an identification device for non-human tissue regions in an X-ray image provided by the embodiment of the present application;

[0026] Figure 7 It is a schematic structural diagram of an electronic device provided by the embodiment of the present application. Specific Embodiments

[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0028] In this specification, adjectives such as first and second can only be used to distinguish one element or action from another element or action, and do not necessarily require or imply any actual such relationship or order. Where circumstances permit, reference elements or components or steps (etc.) should not be construed as limited to only one of the elements, components, or steps, but can be one or more of the elements, components, or steps, etc.

[0029] In this specification, for ease of description, the dimensions of the various parts shown in the drawings are not drawn according to actual proportional relationships.

[0030] Please refer to the attached Figure 1 , which is an identification method for non-human tissue regions in an X-ray image provided by the embodiment of the present application, mainly including steps S101 to S104, which are described in detail as follows:

[0031] Step S101: Process the original X-ray grayscale image into a grayscale image of a preset size.

[0032] The original X-ray grayscale image can be an X-ray grayscale image obtained by a medical DR device or an imaging system. Since when identifying non-human tissue regions in the original X-ray grayscale image, such as the air region and / or the collimator region, an image with a large resolution is not required. Therefore, in the embodiment of the present application, the original X-ray grayscale image can be processed into a grayscale image of a preset size. For example, it can be compressed into an image with a resolution of 512*512, thereby reducing the subsequent calculation amount.

[0033] Step S102: Calculate a grayscale image of a preset size according to a preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain a binary image of the overexposed area, a binary image of the high-brightness area, and a binary image of the boundary area.

[0034] The inventors of the present application have found through research that there are some obvious characteristics in the air area of the X-ray grayscale image. For example, for the X-ray grayscale image output by the detector of the DR imaging system, its grayscale value generally increases with the increase of the X-ray dose, but the X-ray dose that the detector can detect is limited. That is, when the X-ray dose reaches a certain amount, even if the X-ray dose is increased, the grayscale value of the X-ray grayscale image will not increase. A fixed grayscale value threshold Th can be set according to the detector characteristics, and the area where the grayscale of the X-ray grayscale image exceeds this threshold is regarded as the overexposed area; for another example, for the air area, since the X-ray does not pass through the object and is not absorbed by the object, the brightness is relatively high, generally corresponding to the high-grayscale value area on the X-ray image. A part of the area with the highest grayscale value can be taken as the high-brightness area, which is regarded as a part of the air area; for still another example, since there is no object in the air area, there are basically no details in the X-ray image, and the overall area is relatively smooth. The detailed boundary information of the X-ray image can be extracted to determine whether it is an air area; and so on. Due to the above characteristics of the air area in the X-ray grayscale image, a grayscale image of the preset size can be calculated according to the preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain a binary image of the overexposed area, a binary image of the high-brightness area, and a binary image of the boundary area. Further, considering the above characteristics of the air area in the X-ray grayscale image, the grayscale value performance of the air area under different X-ray doses can be divided into 4 cases: 1) There is no air, which is manifested as no overexposed area in the X-ray grayscale image, and there is a large amount of detailed information such as boundaries in the high-brightness area of the X-ray grayscale image; 2) The X-ray dose is relatively low, which is manifested as no overexposed area in the X-ray grayscale image, but there is no detailed information such as boundaries near the high-brightness area of the X-ray grayscale image; 3) The X-ray dose is normal, which is manifested as there is a partial overexposed area caused by partial air overexposure in the X-ray grayscale image, and there is no detailed information such as boundaries near the partial overexposed area; 4) The X-ray dose is relatively large, which is manifested as there is a complete overexposed area caused by complete air overexposure in the X-ray grayscale image, and there is detailed information such as boundaries near the complete overexposed area. For case 1) of the grayscale value performance under the above X-ray doses, since there is no air, the recognition result of no air area can be directly given. For case 4), since it is completely overexposed, the completely overexposed area can be directly regarded as the air area. However, for case 2) and case 3), the air area cannot be directly recognized, and other methods need to be used.

[0035] As an embodiment of the present application, according to the preset grayscale threshold and the maximum grayscale value, and based on the Sobel operator and the Canny algorithm, a preset size grayscale image is calculated to obtain an overexposed area binary image, a high brightness area binary image, and a boundary area binary image. The steps S201 to S203 are implemented as follows:

[0036] Step S201: Binarize the area in the grayscale image of preset size whose grayscale value is higher than the preset grayscale threshold to obtain a binary image of the overexposed area.

[0037] The preset grayscale image size is I d , the preset gray threshold is th, then calculate I d The area F where the gray value exceeds th h As the overexposed area, the overexposed area F h By performing a binarization operation, a binary image of the overexposed area can be obtained. It should be noted that in order to avoid the influence of abnormal points, before performing the binarization operation, the overexposed area F h Perform corrosion operation.

[0038] Step S202: Binarize the region whose grayscale value exceeds r times of the highest grayscale value in the grayscale image of preset size to obtain a binary image of high brightness region, wherein r is a preset ratio.

[0039] Let the highest gray value be h, t = h*r, then calculate I d The area F where the gray value exceeds t t As a high brightness area, the high brightness area F t By performing a binarization operation, a binary image of the high brightness area can be obtained. Similarly, in order to avoid the influence of abnormal points, the high brightness area F can be processed before the binarization operation. t Perform corrosion operation.

[0040] Step S203: Extracting a gradient image g from the grayscale image of a preset size based on the Sobel operator xy , use the Canny algorithm to calculate the gradient image g xy Binarization is performed to obtain a binary image of the boundary area.

[0041] Specifically, the implementation process of step S203 may be: using the Sobel operator to perform a multiplication of the grayscale image I of the preset size d Filter and get the gradient image g in the x direction x and the gradient image g with few directions y ; Use g x and g y Calculate the gradient magnitude The gradient magnitude gxy and the preset size grayscale image I dThe grayscale values are multiplied point - by - point to obtain the gradient image g xyd ; Use the Canny algorithm on the gradient image g xyd Extract the boundary and perform a binarization operation to obtain the binary image F of the boundary region s . Since the grayscale values where the boundaries of the air region are located are relatively high, therefore, in the above - mentioned embodiment of solving the binary image of the boundary region, it is equivalent to strengthening the intensity of the boundaries of the air region and suppressing the intensity of the boundaries of the low - grayscale - value regions. Therefore, using the Canny algorithm to extract the boundary from the gradient image g xyd can not only enhance the extraction effect of the boundaries of the air region, but also suppress the extraction of the boundaries of the low - grayscale - value regions. After extracting the binary image F of the boundary region s , perform a closing operation to connect the few unbroken boundaries, and then the complete boundary of the air region can be extracted

[0042] Step S103: Determine the air region in the grayscale image of the preset size and output the binary image of the air region according to the number of air blocks in the over - exposure region binary image and the filling of the binary image of the boundary region

[0043] As an embodiment of the present application, the above - mentioned step S103 can be implemented through steps S301 to S303, which are described as follows

[0044] Step S301: If there are no air blocks in the over - exposure region binary image, it is determined that there is no over - exposure region in the grayscale image of the preset size; otherwise, it is determined that there is an over - exposure region in the grayscale image of the preset size

[0045] If there are no air blocks in the over - exposure region binary image, it is obvious that there is no over - exposure region in the grayscale image of the preset size; otherwise, it can be determined that there is an over - exposure region in the grayscale image of the preset size. If it is determined that there is an over - exposure region in the grayscale image of the preset size, it can be further determined whether the over - exposure region is a completely over - exposed region or a partially over - exposed region. The specific determination method is as follows: Denote the binary image of the boundary region as F s , and the binary image of the high - brightness region as F h ; Dilate F s to obtain F se ; Calculate whether there is an intersection between F se and F h . If there is an intersection between F se and F h , it is determined that the over - exposure region existing in the grayscale image of the preset size is a completely over - exposed region; otherwise, it is determined that the over - exposure region existing in the grayscale image of the preset size is a partially over - exposed region. It should be noted that if it is determined that the over - exposure region existing in the grayscale image of the preset size is a completely over - exposed region, then directly determine that the binary image F of the high - brightness region h is the binary image of the air region. In the embodiment of the present application, denote the binary image of the air region as Fa .

[0046] Step S302: Determine whether there is an air region in the grayscale image of the preset size according to whether there is an overexposed region in the grayscale image of the preset size.

[0047] Record the binary image of the high-brightness region as F t , and a specific method for determining whether there is an air region in the grayscale image of the preset size according to whether there is an overexposed region in the grayscale image of the preset size can be: if there is no overexposed region in the grayscale image of the preset size, then further calculate the binary image F of the high-brightness region t and the binary image F of the boundary region s of the intersection of the number of pixels j and the number of pixels k corresponding to air in, if the ratio j / k of j to k is greater than a preset threshold (for example, greater than 0.5), it is determined that there is no air region in the grayscale image of the preset size, otherwise, it can be determined that there is an air region in the grayscale image of the preset size.

[0048] Step S303: If there is no overexposed region in the grayscale image of the preset size and there is an air region in the grayscale image of the preset size, or, if there is a partial overexposed region in the grayscale image of the preset size, use the binary image of the overexposed region or the binary image of the high-brightness region as the filling point image to fill the binary image of the boundary region to obtain the binary image of the air region.

[0049] Whether there is no overexposed region in the grayscale image of the preset size and there is an air region in the grayscale image of the preset size, or there is a partial overexposed region in the grayscale image of the preset size, all the air regions cannot be recognized. In this case, the binary image of the overexposed region or the binary image of the high-brightness region can be used as the filling point image to fill the binary image of the boundary region to obtain the binary image F of the air region a . Specifically, if there is no overexposed region in the grayscale image of the preset size and there is an air region in the grayscale image of the preset size, the binary image of the high-brightness region can be used as the filling point image to fill the binary image of the boundary region; if there is a partial overexposed region in the grayscale image of the preset size, the binary image of the overexposed region can be used as the filling point image to fill the binary image of the boundary region. To prevent filling errors, a low-brightness region can be set, and whether the result is correct is judged according to whether the filled region coincides with the low-brightness region. Specifically, the above-mentioned embodiment of using the binary image of the overexposed region or the binary image of the high-brightness region as the filling point image to fill the binary image of the boundary region to obtain the binary image of the air region can be realized through steps S401 to S404, which are described as follows:

[0050] Step S401: Perform connected region labeling on the non-boundary region of the binary image of the boundary region to obtain the labeled binary image of the boundary region.

[0051] In the embodiment of the present application, the boundary region binary image F s The non-boundary region, that is, the region with a gray value of 0 in the boundary region binary image, can perform connected region labeling on the non-boundary region of the boundary region binary image to obtain the labeled boundary region binary image, and denote the labeled boundary region binary image as F st .

[0052] Step S402: Determine the block in the labeled boundary region binary image that contains the filling point image as the air region filling image obtained after filling the boundary region binary image.

[0053] It is possible to calculate the blocks in the labeled boundary region binary image F st that contain the filling point image and record them. Take the blocks of the filling point image contained in these labeled boundary region binary images as the air region filling image obtained after filling the boundary region binary image F s , and denote it as F sa .

[0054] Step S403: Determine whether there is an intersection between the low-brightness image and the air region filling image to determine whether there is an error in filling the boundary region binary image. Here, the low-brightness image is an image determined according to the low-brightness threshold set for the highest brightness value in the preset-size grayscale image.

[0055] Here, the low-brightness image is an image determined according to the low-brightness threshold set for the highest brightness value in the preset-size grayscale image I d , that is, when the highest brightness value in the preset-size grayscale image I d is h, a low-brightness threshold tl smaller than h can be set. Determine the region in the preset-size grayscale image I d with a brightness lower than the low-brightness threshold tl as the low-brightness image, and denote it as F l . If the low-brightness image F l and the air region filling image F sa have an intersection, it means that there is a filling error in filling the boundary region binary image F s , otherwise, there is no filling error in filling the boundary region binary image F s .

[0056] Step S404: If there is a filling error in filling the boundary region binary image, determine the filling point image as the air region binary image, otherwise, determine the air region filling image as the air region binary image.

[0057] Here, denote the filling point image as F pAs described above, if the preset-size grayscale image has no overexposed area and there is an air area in the preset-size grayscale image, the boundary region binary image can be filled with the high-brightness region binary image as the filling point image; if the preset-size grayscale image has some overexposed areas, the boundary region binary image can be filled with the overexposed region binary image as the filling point image. Therefore, if the preset-size grayscale image has no overexposed area and there is an air area in the preset-size grayscale image, when filling the boundary region binary image with the high-brightness region binary image and the filling is incorrect, the high-brightness region binary image F t is determined as the air region binary image F a ; if the preset-size grayscale image has some overexposed areas, when filling the boundary region binary image with the overexposed region binary image and the filling is incorrect, the overexposed region binary image F h is determined as the air region binary image F a .

[0058] If there is no filling error when filling the boundary region binary image with the overexposed region binary image or the high-brightness region binary image, the air region filling image F sa is determined as the air region binary image F a x

[0059] Step S104: Use the air region binary image and the preset-size grayscale image as inputs, and determine the collimator region in the preset-size grayscale image based on the sobel operator, Canny algorithm, and Hough transform.

[0060] Here, a brief introduction to the collimator of the medical DR device or imaging system is given first. As Figure 2 shown, the collimator is composed of two groups of lead leaves, and each group of lead leaves is composed of two parallel lead leaves (such as a1 and a2 or b1 and b2 in the figure). By controlling the position of the lead leaves, the size of the radiation field can be controlled. The four sides of the collimator will only appear in a specific half area of the X-ray image. For example, the lead leaf b1 will only appear in the upper half area of the X-ray image. By setting limiting conditions, it is only necessary to search for the collimator boundary in the specified area. For example, if b1 only appears in the upper half area of the X-ray image, it is the upper boundary of the collimator; if b2 only appears in the lower half area of the X-ray image, it is the upper boundary of the collimator; if a1 only appears in the left half area of the X-ray image, it is the left boundary of the collimator; if a2 only appears in the right half area of the X-ray image, it is the right boundary of the collimator. After understanding the above background knowledge about the collimator, as an embodiment of the present application, using the air region binary image and the preset-size grayscale image as inputs, and determining the collimator region in the preset-size grayscale image based on the sobel operator, Canny algorithm, and Hough transform can be achieved through steps S501 to S505, which are described as follows:

[0061] Step S501: By eroding the binary image of the air region and scanning the uppermost row, lowermost row, leftmost column, and rightmost column of the binary image of the air region, determine the first upper boundary, first lower boundary, first left boundary, and first right boundary of the collimator region.

[0062] The binary image of the air region can be eroded to shrink the air region. Denote the binary image of the air region as F a as a matrix composed of pixels. Assume that the uppermost row of the binary image of the air region F a is denoted as L 1 , the lowermost row is denoted as L 2 , the leftmost column is denoted as L 3 , the rightmost column is denoted as L 4 , the first upper boundary of the collimator region is denoted as F au , the first lower boundary is denoted as F ad , the first left boundary is denoted as F al , and the first right boundary is denoted as F ar . Then scan the binary image of the air region. If L 1 , L 2 , L 3 , and L 4 are respectively the uppermost edge, lowermost edge, leftmost edge, and rightmost edge where the air region exists in the binary image of the air region, then F au does not cross L 1 , F ad does not cross L 2 , F al does not cross L 3 , and F ar does not cross L 4 . As shown in Figure 3a , it is a schematic diagram of the relationship between F au and L 1 , as well as the relationship between F ad and L 2 . Figure 3b It is a schematic diagram of the relationship between F al and L 3 , as well as the relationship between F ar and L 4 .

[0063] Step S502: Filter the grayscale image of the preset size based on the cross-gradient operator template of the sobel operator, and determine the second upper boundary, second lower boundary, second left boundary, and second right boundary of the collimator region according to the first upper boundary, first lower boundary, first left boundary, and first right boundary of the collimator region.

[0064] Since lead has a high absorption rate for X-rays and the lead leaves of the collimator are designed to be thick, most of the X-rays passing through the lead leaves are absorbed. As a result, the gray value in the collimator area of the X-ray image is relatively lower than that in the air area and the human tissue area. When transitioning from other areas to the collimator area, there is a gradient transformation from high brightness to low brightness. Since the directions of the two groups of lead leaves of the collimator differ by about 90 degrees, and the directions of the two leaves in the same group are opposite, resulting in opposite positive and negative signs of the gradient, two cross-gradient operator templates can be used to calculate the two groups of gradients g x and g y , and these two groups of gradients are perpendicular to each other and can form a two-dimensional coordinate system. According to the intensities of g x and g y , the gradient direction g a is calculated using the arctangent. Specifically, the implementation of step S502 can be as follows: First, use the two cross-gradient operator templates of the Sobel operator to filter the grayscale image I d with a preset size to calculate the two groups of gradients g x and g y ; calculate the gradient angle g x and g y using the arctangent formula according to their intensities, g a = argtan(g y / g x ); calculate the variance of g a to obtain the angle variance g ad ; set a threshold ta, and find the area where the angle variance g ad does not exceed the threshold ta as the restricted area F ta . Denote the second upper boundary, second lower boundary, second left boundary, and second right boundary of the collimator area as F su , F sd , F sl , and F sr , respectively. Then, limit the angle of F su within 90°±15°, and F su has intersections with both F au and F ta . Limit the angle of F sd within 270°±15°, and F sd has intersections with both F ad and F ta . Limit the angle of F sl within 180°±15°, and F sl has intersections with both F al and F ta . Limit the angle of F sr within 0°±15°, and F sr has intersections with both F ar and F taAll have intersections.

[0065] Step S503: Adopt the Canny algorithm, and calculate the strong boundary and weak boundary of the collimator region according to the second upper boundary, second lower boundary, second left boundary, and second right boundary of the collimator region.

[0066] It can be understood that when there is air near the boundary of the collimator, the gray-scale difference is large, and the boundary of the collimator is a strong boundary when calculating the gradient. On the contrary, when there is human tissue near the boundary of the collimator, the gray-scale difference is small, and the boundary of the collimator is a weak boundary when calculating the gradient. The strong boundary of the collimator can be calculated first, and then the boundary of the collimator can be found according to the strong boundary of the collimator. If the strong boundary of the collimator does not meet the set conditions, the weak boundary of the collimator is used to find the boundary of the collimator. In the embodiment of the present application, the strong boundary of the collimator meets the conditions: the gradient amplitude of the strong boundary is large, the gradient value is greater than a relatively high threshold Th, and it is near the air region, and the line length exceeds a certain proportion of the image side length; the weak boundary of the collimator meets the condition: the gradient value is greater than a relatively low threshold tl. In addition, there are regional restrictions on the appearance positions of the four boundaries of the collimator. The upper boundary of the collimator only appears in the upper half of the X-ray image, and only the corresponding region is taken when querying the four boundaries of the collimator. To ensure that the strong boundary is long enough, the weak boundary connected to the strong boundary is retained when calculating the strong boundary.

[0067] Specifically, as an embodiment of the present application, the above-mentioned embodiment of adopting the Canny algorithm and calculating the strong boundary and weak boundary of the collimator region according to the second upper boundary, second lower boundary, second left boundary, and second right boundary of the collimator region can be realized through steps S601 to S603, which are described as follows:

[0068] Step S601: According to g x and g y , calculate the gradient images of the second upper boundary, second lower boundary, second left boundary, and second right boundary, where g x and g y are two sets of gradients calculated after filtering the preset-size gray-scale image Id using two cross-gradient operator templates of the sobel operator.

[0069] Specifically, first use g x and g y to calculate the gradient amplitude Calculate the gradient image g xyu of the second upper boundary of the collimator, the gradient image g xyd of the second lower boundary, the gradient image g xyl of the second left boundary, and the gradient image g xyr of the second right boundary, which are respectively g xyu =gxy .F su 、g xyd = g xy .F sd 、g xyl = g xy .F sl and g xyr = g xy .F sr .

[0070] Step S602: According to the set first threshold and second threshold, use the Canny algorithm to extract the boundaries of the gradient images of the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary respectively, to obtain the strong boundaries of the collimator region, where the second threshold is greater than the first threshold.

[0071] Corresponding to the boundaries of the gradient images of the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary, in the embodiments of the present application, the collimator region has four strong boundaries, which are respectively denoted as F bhu 、F bhd 、F bhl and F bhr .

[0072] Step S603: Use the first threshold to segment the gradient images of the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary to obtain the weak boundaries of the collimator region.

[0073] Similar to the strong boundaries of the collimator region, corresponding to the gradient images of the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary, in the embodiments of the present application, the collimator region has four weak boundaries, which are respectively denoted as F blu 、F bld 、F bll and F blr .

[0074] Step S504: Divide the strong boundaries and weak boundaries of the collimator region to obtain an upper boundary group, a lower boundary group, a left boundary group, and a right boundary group.

[0075] Divide the four strong boundaries and four weak boundaries of the collimator region above according to the principle that each group contains one strong boundary and one weak boundary to divide the strong boundaries and weak boundaries of the collimator region, and obtain an upper boundary group, a lower boundary group, a left boundary group, and a right boundary group, where the upper boundary group includes F bhu and F blu , the lower boundary group includes F bhd and F bld, the left boundary group includes F bhl and F bll , the right boundary group includes F bhr and F blr .

[0076] Step S505: Use the Hough transform and determine the collimator region in the grayscale image of the preset size according to the upper boundary group, the lower boundary group, the left boundary group and the right boundary group.

[0077] As an embodiment of the present application, the above-mentioned embodiment of using the Hough transform and determining the collimator region in the grayscale image of the preset size according to the upper boundary group, the lower boundary group, the left boundary group and the right boundary group can be realized through steps S701 to S703, which are described as follows:

[0078] Step S701: Use the Hough transform and calculate the upper boundary line segment, the lower boundary line segment, the left boundary line segment and the right boundary line segment respectively according to the upper boundary group, the lower boundary group, the left boundary group and the right boundary group.

[0079] Specifically, taking the strong boundary F bhu and the weak boundary F blu included in the upper boundary group as an example, input them into the Hough transform module, and correspondingly obtain the parameter space images phu and plu through the Hough transform. Calculate the maximum values max hu and max lu in the corresponding image regions of phu and plu, as well as the line segments Lhu(ρ1, θ1) and Llu(ρ2, θ2) of the above maximum values. Set the threshold tu according to the side length of the image, and judge whether the maximum values max hu and max lu are greater than tu. If the maximum values max hu and max lu are greater than tu, then output Lhu(ρ1, θ1) as the upper boundary line segment L u , otherwise, output Llu(ρ2, θ2) as the upper boundary line segment L u ; again, taking the strong boundary F bhd and the weak boundary F bld included in the lower boundary group as an example, input them into the Hough transform module, and correspondingly obtain the parameter space images phd and pld through the Hough transform. Calculate the maximum values max hd and max lud in the corresponding image regions of phd and pld, as well as the line segments Lhd(ρ1, θ1) and Lld(ρ2, θ2) of the above maximum values. Set the threshold td according to the side length of the image, and judge whether the maximum values max hd and max ld are greater than td. If the maximum values max hd and max ldIf it is greater than td, then output Lhd(ρ1, θ1) as the upper boundary line segment L ud , otherwise, output Lld(ρ2, θ2) as the upper boundary line segment L d ; the left boundary line segment L l and the right boundary line segment L r can all obtain the upper boundary line segment L in the same way as described above u , the lower boundary line segment L d is obtained by the same method as that for obtaining the upper boundary line segment L

[0080] Step S702: Obtain the four intersection points obtained by the intersection of the upper boundary line segment, the lower boundary line segment, the left boundary line segment, and the right boundary line segment

[0081] After obtaining the upper boundary line segment L u , the lower boundary line segment L d , the left boundary line segment L l and the right boundary line segment L r , it is easy to obtain the four intersection points of these four line segments

[0082] Step S703: Draw the circumscribed rectangle of the quadrilateral with the above four intersection points as vertices, and determine this circumscribed rectangle as the collimator region in the preset-size grayscale image

[0083] From the above-mentioned method for identifying the non-human tissue region of the X-ray image in the attached Figure 1 example, on the one hand, according to the preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, calculate the preset-size grayscale image to obtain the overexposed region binary image, the high-brightness region binary image, and the boundary region binary image. Since the air region can be classified, it is convenient to accurately identify the air region in the original X-ray grayscale image and can reduce unnecessary operations or improve the operation speed; on the other hand, considering that there is generally partial overlap between the air region and the collimator region, therefore, using the preset-size grayscale image and the identified air region binary image as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform to determine the collimator region in the preset-size grayscale image, it is also possible to accurately segment or identify the air region and the collimator region

[0084] As Figure 4a shown in the figure, it is the original X-ray grayscale image without being processed Figure 4b is the processing result of the original X-ray grayscale image according to the existing technology (threshold segmentation algorithm) Figure 4c is the result of the air region identified by using the method provided in the embodiment of the present application; the white part in the figure is the air region, from Figure 4c it can be seen that the method provided in the embodiment of the present application can completely identify the air region. As Figure 5As shown, on the right is the original X-ray grayscale image, where the collimator area has not been segmented yet, and on the left is the effect image after the collimator area has been segmented or recognized.

[0085] Please refer to the attached Figure 6 , which is an identification device for non-human tissue areas in X-ray images provided by an embodiment of the present application. It may include a preprocessing module 601, a calculation module 602, a first determination module 603, and a second determination module 604, which are described in detail as follows:

[0086] The preprocessing module 601 is used to process the original X-ray grayscale image into a grayscale image of a preset size;

[0087] The calculation module 602 is used to calculate the grayscale image of the preset size based on a preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain a binary image of the overexposed area, a binary image of the high-brightness area, and a binary image of the boundary area;

[0088] The first determination module 603 is used to determine the air area in the grayscale image of the preset size and output a binary image of the air area according to the number of air blocks in the binary image of the overexposed area and the filling of the binary image of the boundary area;

[0089] The second determination module 604 is used to use the binary image of the air area and the grayscale image of the preset size as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform, to determine the collimator area in the grayscale image of the preset size.

[0090] Optionally, the attached Figure 6 The exemplary calculation module 602 may include a first binarization unit, a second binarization unit, and a third binarization unit, where:

[0091] The first binarization unit is used to binarize the area in the grayscale image of the preset size where the grayscale value is higher than the preset grayscale threshold, to obtain a binary image of the overexposed area;

[0092] The second binarization unit is used to binarize the area in the grayscale image of the preset size where the grayscale value exceeds r times the highest grayscale value, to obtain a binary image of the high-brightness area, where r is a preset ratio;

[0093] The third binarization unit is used to extract a gradient image g xy from the grayscale image of the preset size based on the sobel operator, xy and binarize the gradient image g

[0094] Optionally, the attached Figure 6 The exemplary first determination module 603 may include an overexposed area determination unit, an air area determination unit, and a filling unit, where:

[0095] An overexposed area determination unit, configured to determine that there is no overexposed area in the grayscale image of a preset size if there is no air block in the binary image of the overexposed area; otherwise, determine that there is an overexposed area in the grayscale image of the preset size.

[0096] An air area determination unit, configured to determine whether there is an air area in the grayscale image of a preset size according to whether there is an overexposed area in the grayscale image of the preset size.

[0097] A filling unit, configured to fill the binary image of the boundary area with the binary image of the overexposed area or the binary image of the high-brightness area as the filling point image to obtain the binary image of the air area if there is no overexposed area in the grayscale image of the preset size and there is an air area in the grayscale image of the preset size, or if there is a partial overexposed area in the grayscale image of the preset size.

[0098] Optionally, the filling unit in the above example may include a marking unit, a filling image determination unit, a filling error determination unit, and an output unit, where:

[0099] A marking unit, configured to perform connected region marking on the non-boundary region of the binary image of the boundary area to obtain the marked binary image of the boundary area.

[0100] A filling image determination unit, configured to determine the block containing the filling point image in the marked binary image of the boundary area as the filling image of the air area obtained after filling the binary image of the boundary area.

[0101] A filling error determination unit, configured to determine whether there is an error in filling the binary image of the boundary area according to whether there is an intersection between the low-brightness image and the filling image of the air area, where the low-brightness image is an image determined according to a low-brightness threshold set for the highest brightness value in the grayscale image of the preset size.

[0102] An output unit, configured to determine the filling point image as the binary image of the air area if there is an error in filling, otherwise, determine the filling image of the air area as the binary image of the air area.

[0103] Optionally, attached Figure 6 The second determination module 604 in the example may include a first boundary determination unit, a second boundary determination unit, a strong and weak boundary determination unit, a boundary group determination unit, and a final determination unit, where:

[0104] A first boundary determination unit, configured to determine the first upper boundary, the first lower boundary, the first left boundary, and the first right boundary of the collimator area by eroding the binary image of the air area and scanning the uppermost row, the lowermost row, the leftmost column, and the rightmost column of the binary image of the air area.

[0105] A second boundary determination unit, configured to filter a preset-size grayscale image based on a cross-gradient operator template of a Sobel operator, and determine a second upper boundary, a second lower boundary, a second left boundary, and a second right boundary of the collimator region according to a first upper boundary, a first lower boundary, a first left boundary, and a first right boundary of the collimator region;

[0106] A strong and weak boundary determination unit, configured to use the Canny algorithm and calculate a strong boundary and a weak boundary of the collimator region according to the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary of the collimator region;

[0107] A boundary group determination unit, configured to divide the strong boundary and the weak boundary of the collimator region to obtain an upper boundary group, a lower boundary group, a left boundary group, and a right boundary group;

[0108] A final determination unit, configured to use the Hough transform and determine the collimator region in the preset-size grayscale image according to the upper boundary group, the lower boundary group, the left boundary group, and the right boundary group.

[0109] Optionally, the strong and weak boundary determination unit in the above example may include a gradient image calculation unit, a boundary extraction unit, and a segmentation unit, where:

[0110] The gradient image calculation unit is configured to calculate a gradient image of the second upper boundary, a gradient image of the second lower boundary, a gradient image of the second left boundary, and a gradient image of the second right boundary according to g x and g y , where the g x and g y are two sets of gradients calculated after filtering the preset-size grayscale image using two cross-gradient operator templates in the Sobel operator;

[0111] The boundary extraction unit is configured to extract boundaries of the gradient image of the second upper boundary, boundaries of the gradient image of the second lower boundary, boundaries of the gradient image of the second left boundary, and boundaries of the gradient image of the second right boundary respectively using the Canny algorithm according to a set first threshold and a second threshold, to obtain the strong boundary of the collimator region, and the second threshold is greater than the first threshold;

[0112] The segmentation unit is configured to segment the gradient image of the second upper boundary, the gradient image of the second lower boundary, the gradient image of the second left boundary, and the gradient image of the second right boundary using the first threshold to obtain the weak boundary of the collimator region.

[0113] Optionally, the final determination unit in the above example may include a Hough transform unit, an intersection point calculation unit, and a drawing unit, where:

[0114] A Hough transform unit, configured to perform a Hough transform and calculate an upper boundary line segment, a lower boundary line segment, a left boundary line segment, and a right boundary line segment according to an upper boundary group, a lower boundary group, a left boundary group, and a right boundary group respectively;

[0115] An intersection point obtaining unit, configured to obtain four intersection points formed by the intersection of the upper boundary line segment, the lower boundary line segment, the left boundary line segment, and the right boundary line segment;

[0116] A drawing unit, configured to draw a circumscribed rectangle of a quadrilateral with the four intersection points as vertices, and determine the circumscribed rectangle as a collimator region in a grayscale image of a preset size.

[0117] From the above-mentioned Figure 6 recognition device for the non-human tissue region of the X-ray image in the example, on the one hand, according to a preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, calculate a grayscale image of a preset size to obtain an overexposed region binary image, a high-brightness region binary image, and a boundary region binary image. Since the air region can be classified, it is convenient to accurately identify the air region in the original X-ray grayscale image and can reduce unnecessary operations or improve the operation speed; on the other hand, considering that there is generally partial overlap between the air region and the collimator region, therefore, using the grayscale image of the preset size and the binary image of the recognized air region as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform, determine the collimator region in the grayscale image of the preset size, and it is also possible to accurately segment or identify the air region and the collimator region.

[0118] Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 7 shown, the electronic device 7 in this embodiment mainly includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as a program for the method for recognizing the non-human tissue region of the X-ray image. When the processor 70 executes the computer program 72, it implements the steps in the embodiment of the method for recognizing the non-human tissue region of the X-ray image, such as Figure 1 the steps S101 to S104 shown. Alternatively, when the processor 70 executes the computer program 72, it implements the functions of each module / unit in the above-mentioned device embodiments, such as Figure 6 the functions of the preprocessing module 601, the calculation module 602, the first determination module 603, and the second determination module 604 shown.

[0119] Exemplarily, the computer program 72 for the method of identifying non-human tissue regions in X-ray images mainly includes: processing the original X-ray grayscale image into a grayscale image of a preset size; calculating the grayscale image of the preset size according to the preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain a binary image of the overexposed region, a binary image of the high-brightness region, and a binary image of the boundary region; determining the air region in the grayscale image of the preset size and outputting a binary image of the air region according to the number of air blocks in the binary image of the overexposed region and the filling of the binary image of the boundary region; using the binary image of the air region and the grayscale image of the preset size as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform, to determine the collimator region in the grayscale image of the preset size. The computer program 72 can be divided into one or more modules / units, and one or more modules / units are stored in the memory 71 and executed by the processor 70 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 72 in the electronic device 7. For example, the computer program 72 can be divided into the functions of a preprocessing module 601, a calculation module 602, a first determination module 603, and a second determination module 604 (modules in the virtual device), and the specific functions of each module are as follows: The preprocessing module 601 is used to process the original X-ray grayscale image into a grayscale image of a preset size; the calculation module 602 is used to calculate the grayscale image of the preset size according to the preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain a binary image of the overexposed region, a binary image of the high-brightness region, and a binary image of the boundary region; the first determination module 603 is used to determine the air region in the grayscale image of the preset size and output a binary image of the air region according to the number of air blocks in the binary image of the overexposed region and the filling of the binary image of the boundary region; the second determination module 604 is used to use the binary image of the air region and the grayscale image of the preset size as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform, to determine the collimator region in the grayscale image of the preset size.

[0120] The electronic device 7 may include but is not limited to the processor 70 and the memory 71. Those skilled in the art can understand that Figure 7 this is merely an example of the electronic device 7 and does not constitute a limitation on the electronic device 7. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the computing device may also include input and output devices, network access devices, buses, etc.

[0121] The so-called processor 70 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0122] The memory 71 may be an internal storage unit of the electronic device 7, such as the hard disk or memory of the electronic device 7. The memory 71 may also be an external storage device of the electronic device 7, such as a plug-in hard disk equipped on the electronic device 7, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 71 may also include both the internal storage unit of the electronic device 7 and the external storage device. The memory 71 is used to store computer programs and other programs and data required by the device. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0123] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above device can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.

[0124] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0125] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0126] In the embodiments provided in this application, it should be understood that the disclosed devices / apparatuses and methods can be implemented in other ways. For example, the device / apparatus embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.

[0127] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0128] In addition, the functional units in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0129] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-transitory computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of the present application, it can also be completed by a computer program instructing relevant hardware. The computer program for the method of identifying non-human tissue regions in X-ray images can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above method embodiments, that is, process the original X-ray grayscale image into a grayscale image of a preset size; calculate the grayscale image of the preset size based on a preset grayscale threshold and the highest grayscale value, and based on the sobel operator and the Canny algorithm, to obtain a binary image of the overexposed region, a binary image of the high-brightness region, and a binary image of the boundary region; determine the air region in the grayscale image of the preset size and output a binary image of the air region according to the number of air blocks in the binary image of the overexposed region and the filling of the binary image of the boundary region; use the binary image of the air region and the grayscale image of the preset size as inputs, and based on the sobel operator, the Canny algorithm, and the Hough transform, determine the collimator region in the grayscale image of the preset size. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The non-transitory computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the non-transitory computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the non-transitory computer-readable medium does not include electrical carrier signals and telecommunication signals. The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of the present application, and should all be included in the protection scope of the present application. The above-described specific implementation manners have further elaborated on the purpose, technical solutions, and beneficial effects of the present application. It should be understood that the above is only the specific implementation manner of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application should all be included in the protection scope of the present invention.

Claims

1. A method for identifying non-human tissue regions in X-ray images, characterized in that, the method includes: Processing the original X-ray grayscale image into a preset-size grayscale image; Obtaining a binary image of the overexposed region according to a preset grayscale threshold, obtaining a binary image of the high-brightness region according to the highest grayscale value, and obtaining a binary image of the boundary region based on the sobel operator and the Canny algorithm; If there is no air block in the binary image of the overexposed region, it is determined that there is no overexposed region in the preset-size grayscale image; otherwise, it is determined that there is an overexposed region in the preset-size grayscale image; according to whether there is an overexposed region in the preset-size grayscale image, it is judged whether there is an air region in the preset-size grayscale image; if there is no overexposed region in the preset-size grayscale image and there is an air region in the preset-size grayscale image, or, if there is a partial overexposed region in the preset-size grayscale image, then using the binary image of the overexposed region or the binary image of the high-brightness region as the filling point image to fill the binary image of the boundary region, obtaining a binary image of the air region; By eroding the binary image of the air region and scanning the uppermost row, lowermost row, leftmost column and rightmost column of the binary image of the air region, determining the first upper boundary, first lower boundary, first left boundary and first right boundary of the collimator region; filtering the preset-size grayscale image based on the cross-gradient operator template of the sobel operator, and according to the first upper boundary, first lower boundary, first left boundary and first right boundary of the collimator region, determining the second upper boundary, second lower boundary, second left boundary and second right boundary of the collimator region; using the Canny algorithm, and according to the second upper boundary, second lower boundary, second left boundary and second right boundary of the collimator region, calculating to obtain the strong boundary and weak boundary of the collimator region; dividing the strong boundary and weak boundary of the collimator region to obtain an upper boundary group, a lower boundary group, a left boundary group and a right boundary group; using the Hough transform, and according to the upper boundary group, lower boundary group, left boundary group and right boundary group, determining the collimator region in the preset-size grayscale image.

2. The method for identifying non-human tissue regions in X-ray images according to claim 1, characterized in that, the obtaining of the binary image of the overexposed region according to the preset grayscale threshold includes: binarizing the region in the preset-size grayscale image with a grayscale value higher than the preset grayscale threshold, obtaining the binary image of the overexposed region; The obtaining of the binary image of the high-brightness region based on the highest gray value includes: binarizing the region in the grayscale image of the preset size where the gray value exceeds r times of the highest gray value to obtain the binary image of the high-brightness region, where r is a preset ratio; The binary image of the boundary region obtained based on the Sobel operator and the Canny algorithm includes: extracting a gradient image from the grayscale image of the preset size based on the Sobel operator g xy , and binarizing the gradient image using the Canny algorithm g xy to obtain the binary image of the boundary region.

3. The method for identifying non-human tissue regions in X-ray images according to claim 1, characterized in that, the using the binary image of the overexposed region or the binary image of the high-brightness region as the filling point image to fill the binary image of the boundary region, obtaining the binary image of the air region, includes: Performing connected region labeling on the non-boundary region of the binary image of the boundary region, obtaining a labeled binary image of the boundary region; Determining the block containing the filling point image in the labeled binary image of the boundary region as the air region filling image obtained after filling the binary image of the boundary region; Determine whether the filling of the binary image of the boundary region is incorrect according to whether there is an intersection between the low-brightness image and the air region filling image, where the low-brightness image is an image determined according to a low-brightness threshold set for the highest brightness value in the preset-size grayscale image; If the filling is incorrect, determine the filling point image as the binary image of the air region; otherwise, determine the air region filling image as the binary image of the air region.

4. The method for identifying non-human tissue regions in an X-ray image according to claim 1, characterized in that, when using the Canny algorithm and calculating the strong boundary and weak boundary of the collimator region according to the second upper boundary, second lower boundary, second left boundary and second right boundary of the collimator region, it includes: According to g x and g y , calculate the gradient images of the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary. The g x and g y are two sets of gradients obtained by filtering the grayscale image of the preset size using two cross-gradient operator templates in the Sobel operator respectively; According to the set first threshold and second threshold, use the Canny algorithm to extract the boundaries of the gradient images of the second upper boundary, second lower boundary, second left boundary and second right boundary respectively to obtain the strong boundary of the collimator region, where the second threshold is greater than the first threshold; Use the first threshold to segment the gradient images of the second upper boundary, second lower boundary, second left boundary and second right boundary to obtain the weak boundary of the collimator region.

5. The method for identifying non-human tissue regions in an X-ray image according to claim 1, characterized in that, when using the Hough transform and determining the collimator region in the preset-size grayscale image according to the upper boundary group, lower boundary group, left boundary group and right boundary group, it includes: Use the Hough transform and calculate the upper boundary line segment, lower boundary line segment, left boundary line segment and right boundary line segment respectively according to the upper boundary group, lower boundary group, left boundary group and right boundary group; Obtain the four intersection points obtained by the intersection of the upper boundary line segment, lower boundary line segment, left boundary line segment and right boundary line segment; Draw the circumscribed rectangle of the quadrilateral with the four intersection points as vertices, and determine the circumscribed rectangle as the collimator region in the preset-size grayscale image.

6. An apparatus for identifying non-human tissue regions in an X-ray image, characterized in that, the apparatus includes: A preprocessing module for processing the original X-ray grayscale image into a preset-size grayscale image; A calculation module for obtaining a binary image of the overexposed region according to a preset grayscale threshold, obtaining a binary image of the high-brightness region according to the highest grayscale value, and obtaining a binary image of the boundary region based on the sobel operator and the Canny algorithm; A first determination module, configured to determine that there is no overexposed area in the preset-size grayscale image if there is no air block in the overexposed area binary image; otherwise, determine that there is an overexposed area in the preset-size grayscale image; determine whether there is an air area in the preset-size grayscale image according to whether there is an overexposed area in the preset-size grayscale image; if there is no overexposed area in the preset-size grayscale image and there is an air area in the preset-size grayscale image, or if there is a partial overexposed area in the preset-size grayscale image, use the overexposed area binary image or the high-brightness area binary image as a filling point image to fill the boundary area binary image to obtain an air area binary image; A second determination module, configured to determine the first upper boundary, the first lower boundary, the first left boundary, and the first right boundary of the collimator area by eroding the air area binary image and scanning the uppermost row, the lowermost row, the leftmost column, and the rightmost column of the air area binary image; filter the preset-size grayscale image based on the cross-gradient operator template of the sobel operator, and determine the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary of the collimator area according to the first upper boundary, the first lower boundary, the first left boundary, and the first right boundary of the collimator area; use the Canny algorithm, and calculate the strong boundary and the weak boundary of the collimator area according to the second upper boundary, the second lower boundary, the second left boundary, and the second right boundary of the collimator area; divide the strong boundary and the weak boundary of the collimator area to obtain an upper boundary group, a lower boundary group, a left boundary group, and a right boundary group; use the Hough transform, and determine the collimator area in the preset-size grayscale image according to the upper boundary group, the lower boundary group, the left boundary group, and the right boundary group.

7. An electronic device, the electronic device includes 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 of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, the computer-readable storage medium stores a computer program, wherein, when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for detecting and identifying cerebral micro-hemorrhage points of SWI images based on machine learning

    CN109190690A