Ray source focus identification method and device, electronic equipment and storage medium

By segmenting and identifying the test images generated by the X-ray device, the focus value is determined, and the problems of low focus adjustment efficiency and poor consistency in the prior art are solved, and automatic focus adjustment according to the working conditions is realized.

CN119963805APending Publication Date: 2025-05-09SUZHOU POWERSITE ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411974087.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The prior art is difficult to automatically adjust the focus of the X-ray equipment, resulting in troublesome operation, poor consistency, low efficiency, and inability to adjust the focus according to working conditions.

Method used

By obtaining the initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, tube current and filament current, image segmentation and recognition are performed, to detect whether the image meets the preset standards and determine the focus value.

Benefits of technology

Adjustment according to the corresponding focus under various parameters of the X-ray equipment is realized, which improves the efficiency and consistency of focus adjustment and adapts to different working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963805A_ABST
    Figure CN119963805A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of rays, in particular to a ray source focus recognition method and device, electronic equipment and a storage medium. Acquiring an initial X-ray resolution test image generated by the X-ray equipment based on the current tube voltage, the current tube current and the current filament current; segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images; each target sub-resolution test image comprises a test vertical line, a test transverse line and a focus value; identifying each target sub-resolution test image, and detecting whether each target sub-resolution test image meets a preset standard; and determining the focus value corresponding to the target sub-resolution test image meeting the preset standard as the current tube voltage, the current tube current and the focus corresponding to the current filament current corresponding to the X-ray equipment. According to the method, the focuses corresponding to various parameters of the X-ray equipment are determined, and then focus adjustment is carried out according to the focuses corresponding to various parameters and working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of ray technology, and in particular to a ray source focus identification method, device, electronic equipment and storage medium. Background Art

[0002] Microfocus X-ray source is a high-precision X-ray device widely used in medical imaging, industrial non-destructive testing, materials science and other fields. The development of microfocus X-ray source has greatly improved the resolution and application range of X-ray imaging, making it possible to detect smaller details and defects; among them, the accuracy of imaging is the key to the quality of microfocus X-ray source. Therefore, it is necessary to automatically adjust the position of the focus.

[0003] In existing technologies, the size, depth and position of the focus can be measured using the pinhole imaging method; the traditional focus adjustment process is cumbersome to operate, has poor consistency, low efficiency, and is affected by many external factors. In addition, the focus cannot be automatically adjusted according to the working conditions.

[0004] Therefore, how to determine the focus corresponding to various parameters of the X-ray equipment, and then adjust the focus according to the working conditions based on the focus corresponding to various parameters has become an urgent problem to be solved. Summary of the invention

[0005] In view of this, the present invention provides a ray source focus identification method, device, electronic device and storage medium to solve the problem of how to determine the focus corresponding to various parameters of the X-ray device, and then according to the focus corresponding to various parameters.

[0006] In a first aspect, the present invention provides a method for identifying a focus of a ray source, the method comprising:

[0007] Acquire an initial X-ray resolution test image generated by the X-ray device based on a current tube voltage, a current tube current, and a current filament current;

[0008] The initial X-ray resolution test image is segmented to obtain a plurality of target sub-resolution test images; each target sub-resolution test image includes a test vertical line, a test horizontal line and a focus value;

[0009] Identify each target sub-resolution test image and detect whether each target sub-resolution test image meets a preset standard;

[0010] The focus value corresponding to the target sub-resolution test image that meets the preset standard is determined as the focus corresponding to the current tube voltage, the current tube current, and the current filament current of the X-ray device.

[0011] The ray source focus identification method provided in the embodiment of the present application obtains the initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current, so that the working conditions corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device can be detected. Then, the initial X-ray resolution test image is segmented to obtain multiple target sub-resolution test images, thereby ensuring the accuracy of the multiple target sub-resolution test images obtained. Then, each target sub-resolution test image is identified to detect whether each target sub-resolution test image meets the preset standard, so that it can be determined whether each target sub-resolution test image generated based on the current tube voltage, the current tube current and the current filament current meets the preset standard, thereby facilitating the adjustment of the tube voltage, the tube current and the filament current of the X-ray device according to the detection results. Then, the focus value corresponding to the target sub-resolution test image that meets the preset standard is determined as the focus corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device, thereby realizing the determination of the focus corresponding to various parameters of the X-ray device, and then adjusting the focus according to the working conditions according to the focus corresponding to various parameters.

[0012] In an optional implementation, the initial X-ray resolution test image is segmented to obtain a plurality of target sub-resolution test images, including:

[0013] Performing image preprocessing on the initial X-ray resolution test image to obtain a target X-ray resolution test image;

[0014] The target X-ray resolution test image is segmented to obtain multiple target sub-resolution test images.

[0015] The ray source focus identification method provided in the embodiment of the present application performs image preprocessing on the initial X-ray resolution test image to obtain a target X-ray resolution test image, thereby ensuring the accuracy of the obtained target X-ray resolution test image, and further ensuring the accuracy of multiple target sub-resolution test images obtained by segmenting the target X-ray resolution test image.

[0016] In an optional implementation, the target X-ray resolution test image is segmented to obtain a plurality of target sub-resolution test images, including:

[0017] Performing image recognition on the target X-ray resolution test image to determine a region of interest in the target X-ray resolution test image, wherein the region of interest includes a sub-resolution test image;

[0018] According to each region of interest, the target X-ray resolution test image is segmented to obtain each initial sub-resolution test image;

[0019] From among the initial sub-resolution test images, determine the initial sub-resolution test image with the largest focus value as the sub-resolution test image to be processed;

[0020] Identify a target test vertical line in the sub-resolution test image to be processed, and calculate an angle between the target test vertical line and the horizontal line;

[0021] According to the angle of the target test vertical line relative to the horizontal line, the position of each initial sub-resolution test image is adjusted to obtain a target sub-resolution test image corresponding to each initial sub-resolution test image, so that the test vertical line in each target sub-resolution test image is perpendicular to the horizontal line.

[0022] The ray source focus identification method provided in the embodiment of the present application performs image recognition on the target X-ray resolution test image, determines the region of interest in the target X-ray resolution test image, and ensures the accuracy of the region of interest in the determined target X-ray resolution test image. According to each region of interest, the target X-ray resolution test image is segmented to obtain each initial sub-resolution test image, and the accuracy of each initial sub-resolution test image is ensured. Then, from each initial sub-resolution test image, the initial sub-resolution test image with the largest focus value is determined as the sub-resolution test image to be processed, thereby ensuring that the test vertical line and the test horizontal line in the determined sub-resolution test image to be processed are easy to identify. Then, the target test vertical line in the sub-resolution test image to be processed is identified, and the angle of the target test vertical line relative to the horizontal line is calculated. Then, according to the angle of the target test vertical line relative to the horizontal line, the position of each initial sub-resolution test image is adjusted to obtain the target sub-resolution test image corresponding to each initial sub-resolution test image, so that the test vertical line in each target sub-resolution test image is perpendicular to the horizontal line, thereby ensuring the accuracy of the result of whether each target sub-resolution test image obtained by detection meets the preset standard.

[0023] In an optional implementation, identifying each target sub-resolution test image and detecting whether each target sub-resolution test image meets a preset standard includes:

[0024] For each target sub-resolution test image, the target sub-resolution test image is identified to determine a test horizontal line area and a test vertical line area in the target sub-resolution test image;

[0025] For the test horizontal line area, determine the number of first target maximum values ​​and the number of first target minimum values ​​in the test horizontal line area;

[0026] For the test vertical line area, determine the number of second target maximum values ​​and the number of second target minimum values ​​in the test vertical line area;

[0027] Detect whether the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to a first threshold, and whether the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to a second threshold;

[0028] If the number of the first target maxima and the number of the second target maxima are greater than or equal to the first threshold, and the number of the first target minima and the number of the second target minima are greater than or equal to the second threshold, it is determined that the target sub-resolution test image meets the preset standard.

[0029] The ray source focus identification method provided in the embodiment of the present application identifies the target sub-resolution test image for each target sub-resolution test image, determines the test horizontal line area and the test vertical line area in the target sub-resolution test image, and ensures the accuracy of the determined test horizontal line area and the test vertical line area. For the test horizontal line area, the number of first target maxima and the number of first target minima in the test horizontal line area are determined, and the accuracy of the number of first target maxima and the number of first target minima in the determined test horizontal line area is ensured. For the test vertical line area, the number of second target maxima and the number of second target minima in the test vertical line area are determined, and the accuracy of the number of second target maxima and the number of second target minima in the determined test vertical line area is ensured. Detect whether the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to a first threshold, and whether the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to a second threshold; if the number of the first target maximum values ​​and the number of the second target minimum values ​​are greater than or equal to the first threshold, and the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to the second threshold, then determine that the target sub-resolution test image meets the preset standard, thereby ensuring the accuracy of the determined target sub-resolution test image meeting the preset standard.

[0030] In an optional implementation, for the test horizontal line area, determining the number of first target maximum values ​​and the number of first target minimum values ​​in the test horizontal line area includes:

[0031] For the test horizontal line area, the sum of the pixel values ​​corresponding to the pixel points in each row is calculated to obtain the row pixel sum;

[0032] Based on the sum of each row of pixels, a row pixel sum curve is generated;

[0033] Determine a plurality of first initial maxima and first initial minima from the row pixels and the curve;

[0034] From each first initial maximum value and each first initial minimum value, a first target maximum value and a first target minimum value are determined, and the number of first target maximum values ​​and the number of first target minimum values ​​are determined.

[0035] The ray source focus identification method provided in the embodiment of the present application calculates the sum of the pixel values ​​corresponding to each row of pixel points for the test horizontal line area to obtain the row pixel sum, thereby ensuring the accuracy of the obtained row pixel sum. Based on the row pixel sum, a row pixel sum curve is generated; multiple first initial maxima and first initial minima are determined from the row pixel sum curve, ensuring the accuracy of the multiple first initial maxima and first initial minima determined. Then, from each first initial maximum and each first initial minimum, the first target maximum and the first target minimum are determined, and the number of first target maximums and the number of first target minimums are determined, ensuring the accuracy of the determined first target maximum and the first target minimum, and then ensuring the accuracy of the number of determined first target maximums and the number of first target minimums.

[0036] In an optional implementation, determining a first target maximum value and a first target minimum value from each first initial maximum value and each first initial minimum value includes:

[0037] Calculate the number of increments corresponding to each first initial maximum value and the number of decrements corresponding to each first initial minimum value; the number of increments is used to characterize the number of increments of the value obtained by obtaining the first initial maximum value; the number of decrements is used to characterize the number of decrements of the value obtained by obtaining the first initial minimum value;

[0038] Calculate the increment magnitude corresponding to each first initial maximum value and the decrement magnitude corresponding to each first initial minimum value; the increment magnitude is used to characterize the magnitude of the increase in the value obtained by obtaining the first initial maximum value; the decrement magnitude is used to characterize the magnitude of the decrease in the value obtained by obtaining the first initial minimum value;

[0039] Determine each first initial maximum value whose number of increments is greater than a preset number of increments and whose increment magnitude is greater than a preset increment magnitude as a first standby maximum value;

[0040] Determine each first initial minimum value whose decreasing times are greater than the preset decreasing times and whose decreasing amplitude is greater than the preset decreasing amplitude as the first standby minimum value;

[0041] From each of the first backup maximum values ​​and each of the first backup minimum values, a first target maximum value and a first target minimum value are determined.

[0042] The ray source focus identification method provided in the embodiment of the present application calculates the number of increments corresponding to each first initial maximum value and the number of decrements corresponding to each first initial minimum value, thereby ensuring the accuracy of the calculated number of increments corresponding to each first initial maximum value and the number of decrements corresponding to each first initial minimum value. Then, the increment magnitude corresponding to each first initial maximum value and the decrement amplitude corresponding to each first initial minimum value are calculated, thereby ensuring the accuracy of the calculated increment magnitude corresponding to each first initial maximum value and the decrement amplitude corresponding to each first initial minimum value. Then, each first initial maximum value with an increment number greater than a preset increment number and an increment magnitude greater than a preset increment magnitude is determined as a first standby maximum value, thereby ensuring the accuracy of the determined first standby maximum value. Each first initial minimum value with a decrement number greater than a preset decrement number and a decrement amplitude greater than a preset decrement amplitude is determined as a first standby minimum value, thereby ensuring the accuracy of the determined first standby minimum value. Then, from each first standby maximum value and each first standby minimum value, the first target maximum value and the first target minimum value are determined, thereby ensuring the accuracy of the determined first target maximum value and the first target minimum value.

[0043] In an optional implementation, determining the first target maximum value and the first target minimum value from each first backup maximum value and each first backup minimum value includes:

[0044] Arrange the first backup maximum values ​​and the first backup minimum values ​​in the order of the corresponding horizontal coordinates in the row pixels and the curve from left to right;

[0045] sequentially calculating the differences between adjacent first standby maximum values ​​and first standby minimum values;

[0046] If the difference between the first backup maximum value and the first backup minimum value is less than the preset difference, the value on the left side of the two is deleted to obtain each first target maximum value and each first target minimum value.

[0047] The ray source focus identification method provided in the embodiment of the present application arranges each first spare maximum value and each first spare minimum value in the order of the corresponding horizontal coordinates in the row pixels and the curve from left to right; the difference between the adjacent first spare maximum values ​​and the first spare minimum values ​​is calculated in sequence, ensuring the accuracy of the difference between the adjacent first spare maximum values ​​and the first spare minimum values ​​calculated. If there is a difference between the first spare maximum value and the first spare minimum value that is less than the preset difference, the value on the left side of the two is deleted to obtain each first target maximum value and each first target minimum value, ensuring the accuracy of each first target maximum value and each first target minimum value obtained.

[0048] In a second aspect, the present invention provides a device for identifying a focus of a radiation source, the device comprising:

[0049] An acquisition module, used to acquire an initial X-ray resolution test image generated by the X-ray device based on a current tube voltage, a current tube current, and a current filament current;

[0050] A segmentation module is used to segment the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images; each target sub-resolution test image includes a test vertical line, a test horizontal line and a focus value;

[0051] A detection module is used to identify each target sub-resolution test image and detect whether each target sub-resolution test image meets a preset standard;

[0052] The determination module is used to determine the focus value corresponding to the target sub-resolution test image that meets the preset standard as the focus corresponding to the current tube voltage, current tube current and current filament current of the X-ray device.

[0053] The ray source focus identification device provided in the embodiment of the present application obtains the initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current, so that the working conditions corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device can be detected. Then, the initial X-ray resolution test image is segmented to obtain multiple target sub-resolution test images, thereby ensuring the accuracy of the multiple target sub-resolution test images obtained. Then, each target sub-resolution test image is identified to detect whether each target sub-resolution test image meets the preset standard, so that it can be determined whether each target sub-resolution test image generated based on the current tube voltage, the current tube current and the current filament current meets the preset standard, thereby facilitating the adjustment of the tube voltage, the tube current and the filament current of the X-ray device according to the detection results. Then, the focus value corresponding to the target sub-resolution test image that meets the preset standard is determined as the focus corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device, thereby realizing the determination of the focus corresponding to various parameters of the X-ray device, and then adjusting the focus according to the working conditions according to the focus corresponding to various parameters.

[0054] In a third aspect, the present invention provides an electronic device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the radiation source focus identification method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0055] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for identifying the focus of a ray source according to the first aspect or any corresponding embodiment thereof.

[0056] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for identifying a ray source focus of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 is a schematic flow chart of a method for identifying a ray source focus according to an embodiment of the present invention;

[0059] Figure 2 is a schematic diagram of an initial X-ray resolution test image according to an embodiment of the present invention;

[0060] Figure 3 is a schematic flow chart of another ray source focus identification method according to an embodiment of the present invention;

[0061] Figure 4 is a schematic diagram of each target sub-resolution test image according to an embodiment of the present invention;

[0062] Figure 5 is a schematic flow chart of another ray source focus identification method according to an embodiment of the present invention;

[0063] Figure 6 is a schematic diagram of row pixels and curves generated according to an embodiment of the present invention;

[0064] Figure 7 is a schematic diagram of column pixels and curves generated according to an embodiment of the present invention;

[0065] Figure 8 is a structural block diagram of a device for identifying a ray source focus according to an embodiment of the present invention;

[0066] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0068] Microfocus X-ray source is a high-precision X-ray device widely used in medical imaging, industrial non-destructive testing, materials science and other fields. The development of microfocus X-ray source has greatly improved the resolution and application range of X-ray imaging, making it possible to detect smaller details and defects; among them, the accuracy of imaging is the key to the quality of microfocus X-ray source. Therefore, it is necessary to automatically adjust the position of the focus.

[0069] In existing technologies, the size, depth and position of the focus can be measured using the pinhole imaging method; the traditional focus adjustment process is cumbersome to operate, has poor consistency, low efficiency, and is affected by many external factors. In addition, the focus cannot be automatically adjusted according to the working conditions.

[0070] Therefore, how to determine the focus corresponding to various parameters of the X-ray equipment, and then adjust the focus according to the working conditions based on the focus corresponding to various parameters has become an urgent problem to be solved.

[0071] It should be noted that the execution subject of the method for identifying the focus of a ray source provided in the embodiment of the present application may be a device for identifying the focus of a ray source, and the device for identifying the focus of a ray source may be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware, wherein the electronic device may be a processor in an X-ray device, or may be an electronic device independent of the X-ray device. In the following method embodiments, the execution subject is an electronic device as an example for explanation.

[0072] According to an embodiment of the present invention, an embodiment of a method for identifying a focus of a ray source is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0073] In this embodiment, a method for identifying a ray source focus is provided, which can be used in the above-mentioned electronic device. Figure 1 is a flow chart of a method for identifying a ray source focus according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0074] Step S101 : acquiring an initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current.

[0075] Specifically, the electronic device can receive an initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current; the electronic device can also receive an initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current input by the user.

[0076] The embodiment of the present application does not specifically limit the manner in which the electronic device obtains the initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current.

[0077] It should be noted that different tube voltages, different tube currents and different filament currents generate different initial X-ray resolution test images.

[0078] Step S102, segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images.

[0079] Each target sub-resolution test image includes a test vertical line, a test horizontal line and a focus value.

[0080] The test vertical lines are used to test the vertical resolution of the X-ray imaging system. Different groups of vertical lines have different spacings, representing different levels of resolution. For example, the vertical line group marked with "3" near the upper left corner has wider spacings, and as the number increases, the spacings of the vertical line groups gradually become narrower. This design is to simulate object structures of different degrees of fineness to help evaluate the smallest details that the X-ray system can distinguish. In medical imaging or industrial non-destructive testing, the ability to clearly distinguish finer vertical lines means that the X-ray system has a higher resolution in the vertical direction and can detect smaller lesions or defects.

[0081] The test lines are used to test the horizontal resolution of the X-ray imaging system. Different groups of lines have different spacing, representing different levels of resolution. For example, the group of lines marked with "3" near the upper left corner has wider spacing, and as the number increases, the spacing of the line groups gradually narrows. This design is to simulate object structures of different degrees of fineness to help evaluate the smallest details that the X-ray system can distinguish. In medical imaging or industrial non-destructive testing, the ability to clearly distinguish finer lines means that the X-ray system has a higher resolution in the horizontal direction and can detect smaller lesions or defects.

[0082] Among them, the focus value can represent the focus corresponding to each target sub-resolution test image. In addition, the focus value can also represent the width of the test vertical line and the test horizontal line, as well as the interval between adjacent test vertical lines and the interval between adjacent test horizontal lines.

[0083] For example, Figure 2 Shown is a schematic diagram of the initial X-ray resolution test image. Figure 2 The "3" in the figure indicates the focus value corresponding to the first multiple target sub-resolution test image in the upper left corner, and represents that the width of the test vertical lines and the test horizontal lines in the first multiple target sub-resolution test image in the upper left corner is 3μm, the interval between adjacent test vertical lines is 3μm, and the interval between adjacent test horizontal lines is 3μm. Figure 2 The other digital symbols in the figure have the same meaning as the "3" symbol and are not repeated here.

[0084] Specifically, the electronic device can identify the initial X-ray resolution test image, determine the positions of each target sub-resolution test image included in the initial X-ray resolution test image based on the identification result, and then segment the initial X-ray resolution test image according to the positions of each target sub-resolution test image to obtain multiple target sub-resolution test images.

[0085] This step will be described in detail below.

[0086] Step S103: identifying each target sub-resolution test image, and detecting whether each target sub-resolution test image meets a preset standard.

[0087] Specifically, the electronic device may identify the pixel values ​​corresponding to each target sub-resolution test image, and then detect whether the target sub-resolution test image meets a preset standard based on the pixel value identification result.

[0088] This step will be described in detail below.

[0089] Step S104, determining the focus value corresponding to the target sub-resolution test image that meets the preset standard as the focus corresponding to the current tube voltage, current tube current and current filament current of the X-ray device.

[0090] Specifically, the electronic device may determine the focal point value corresponding to the target sub-resolution test image that meets the preset standard as the focal point corresponding to the current tube voltage, current tube current, and current filament current of the X-ray device.

[0091] The ray source focus identification method provided in this embodiment obtains the initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current, so that the working conditions corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device can be detected. Then, the initial X-ray resolution test image is segmented to obtain multiple target sub-resolution test images, thereby ensuring the accuracy of the multiple target sub-resolution test images obtained. Then, each target sub-resolution test image is identified to detect whether each target sub-resolution test image meets the preset standard, so that it can be determined whether each target sub-resolution test image generated based on the current tube voltage, the current tube current and the current filament current meets the preset standard, thereby facilitating the adjustment of the tube voltage, the tube current and the filament current of the X-ray device according to the detection results. Then, the focus value corresponding to the target sub-resolution test image that meets the preset standard is determined as the focus corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device, thereby realizing the determination of the focus corresponding to various parameters of the X-ray device, and then adjusting the focus according to the working conditions according to the focus corresponding to various parameters.

[0092] In this embodiment, a method for identifying a ray source focus is provided, which can be used in the above-mentioned electronic device. Figure 3 is a flow chart of a method for identifying a ray source focus according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0093] Step S201 : acquiring an initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current.

[0094] For details about this step, please refer to the above description of step S101, which will not be elaborated here.

[0095] Step S202 , segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images.

[0096] Each target sub-resolution test image includes a test vertical line, a test horizontal line and a focus value.

[0097] Specifically, the above step S202 may include the following steps:

[0098] Step S2021, performing image preprocessing on the initial X-ray resolution test image to obtain a target X-ray resolution test image.

[0099] Specifically, the electronic device can use a preset filtering algorithm to filter the initial X-ray resolution test image to remove pulse noise such as salt and pepper noise, and obtain the X-ray resolution test image after the first processing.

[0100] Among them, the preset filtering algorithm can be median filtering, Gaussian filtering, wavelet transform filtering, or other filtering methods. The embodiment of the present application does not specifically limit the preset filtering algorithm.

[0101] The electronic device then performs grayscale correction on the X-ray resolution test image after the first processing.

[0102] Specifically, the electronic device can collect a standard template image of uniform material, calculate the grayscale mean and standard deviation of the standard template image, and then perform pixel-by-pixel grayscale correction on the X-ray resolution test image after the first processing. For example, a grayscale correction method based on polynomial fitting is used to establish a grayscale transformation polynomial according to the grayscale statistical information of the standard template image, and the pixel grayscale value of the X-ray resolution test image after the first processing is substituted into the polynomial for correction, so that the grayscale distribution of the X-ray resolution test image after the first processing is more uniform, and the contrast and clarity of the X-ray resolution test image after the first processing are improved, thereby obtaining the X-ray resolution test image after the second processing.

[0103] Next, the electronic device can use a histogram equalization method to redistribute the grayscale histogram of the X-ray resolution test image after the second processing, so that the grayscale range of the X-ray resolution test image after the second processing is expanded, the overall contrast of the image is enhanced, and the originally blurred lines and details are more clearly distinguishable, thereby obtaining a target X-ray resolution test image.

[0104] Step S2022, segmenting the target X-ray resolution test image to obtain a plurality of target sub-resolution test images.

[0105] Specifically, the above step S2022 may include the following steps:

[0106] Step a1, performing image recognition on the target X-ray resolution test image to determine the region of interest in the target X-ray resolution test image.

[0107] The region of interest includes a sub-resolution test image.

[0108] Specifically, the electronic device can use the grayscale information positioning method to analyze the grayscale distribution of the target X-ray resolution test image to preliminarily locate the area of ​​interest. Since there is usually a grayscale difference between the lines and the background of the resolution test pattern, for example, the lines may be black or white, and the background is gray, the lines and the background can be distinguished by setting a grayscale threshold. The grayscale distribution of the image can be statistically analyzed using a histogram to determine the pixel value range corresponding to the grayscale peak, and based on this, a threshold can be set to segment out the area that may contain the line pattern.

[0109] Then, electronic devices can also use shape and geometric features to locate the region of interest. For the resolution test pattern, the lines are usually straight lines with a certain length and direction. Edge detection algorithms, such as Canny edge detection, can be used to extract edge information in the image. The Canny edge detection algorithm calculates the gradient amplitude and direction of the pixels in the image, finds edge points with drastic changes in intensity, and then forms lines by connecting these edge points. For the detected edge lines, based on their length, direction, and geometric relationship with each other (such as parallel, vertical, etc.), the line area that meets the characteristics of the resolution test pattern can be identified, thereby determining the region of interest.

[0110] After initially locating the region of interest, the electronic device can use a region growing algorithm for precise extraction. The region growing algorithm starts from a seed point and merges adjacent pixels into a region based on certain similarity criteria (such as grayscale similarity, texture similarity, etc.). For an X-ray resolution test image, a pixel located inside a line pattern can be selected as a seed point, and then similar surrounding pixels are gradually merged into this region based on features such as the pixel's grayscale value or edge strength until the stopping condition is met (such as the size of the region reaches a certain limit, the surrounding pixels no longer meet the similarity criteria, etc.), and the region of interest in the target X-ray resolution test image is determined.

[0111] Step a2: segment the target X-ray resolution test image according to each region of interest to obtain each initial sub-resolution test image.

[0112] Specifically, the electronic device can perform image segmentation on the target X-ray resolution test image based on the position information corresponding to each region of interest accurately extracted by the region growing algorithm in the above steps to obtain each initial sub-resolution test image.

[0113] Step a3: Determine, from among the initial sub-resolution test images, the initial sub-resolution test image with the largest focus value as the sub-resolution test image to be processed.

[0114] Specifically, the electronic device may determine, from among the initial sub-resolution test images, an initial sub-resolution test image with the largest focus value as the sub-resolution test image to be processed.

[0115] Among them, it should be noted that the maximum focus value indicates that the size of the target test vertical lines and the target test horizontal lines in the sub-resolution test image to be processed is the largest, and the interval between adjacent target test vertical lines and adjacent target test horizontal lines is the largest, which is most convenient for identifying the target test vertical lines in the sub-resolution test image to be processed.

[0116] Step a4, identifying the target test vertical line in the sub-resolution test image to be processed, and calculating the angle between the target test vertical line and the horizontal line.

[0117] Specifically, the electronic device can identify the target test vertical line in the sub-resolution test image to be processed based on a preset edge detection algorithm, and then use the Hough transform straight line fitting algorithm to perform straight line fitting on the target test vertical line to obtain multiple spare straight lines. Then, the electronic device can screen the multiple spare straight lines according to the characteristics of the target test vertical line to obtain the target straight line. Then, the angle of the target straight line relative to the horizontal line is calculated.

[0118] It should be noted that the target test vertical line has a certain length range (which can be pre-set according to the specifications of the resolution test image), is relatively straight (judged by indicators such as the error of the straight line fitting), and its position in the image meets the layout characteristics of the resolution test pattern (for example, it is in a specific area and has a relatively fixed position relationship with other known reference elements, etc.). These conditions are used to screen out target straight lines that meet the requirements.

[0119] The preset edge detection algorithm may be a Canny edge detection algorithm, a Sobel operator, or other edge detection algorithms. The embodiment of the present application does not specifically limit the preset edge detection algorithm.

[0120] Step a5, adjusting the position of each initial sub-resolution test image according to the angle of the target test vertical line relative to the horizontal line, and obtaining a target sub-resolution test image corresponding to each initial sub-resolution test image, so that the test vertical line in each target sub-resolution test image is perpendicular to the horizontal line.

[0121] Specifically, the electronic device can determine the rotation angle that needs to be used to rotate the initial sub-resolution test image based on the calculated angle value of the target test vertical line relative to the horizontal line. Then, each initial sub-resolution test image is rotated according to the rotation angle to obtain a target sub-resolution test image corresponding to each initial sub-resolution test image, so that the test vertical line in each target sub-resolution test image is perpendicular to the horizontal line.

[0122] For example, Figure 4 As shown, it is a schematic diagram of each target sub-resolution test image obtained.

[0123] Step S203: identifying each target sub-resolution test image, and detecting whether each target sub-resolution test image meets a preset standard.

[0124] For details about this step, please refer to the above description of step S103, which will not be elaborated here.

[0125] Step S204, determining the focus value corresponding to the target sub-resolution test image that meets the preset standard as the focus corresponding to the current tube voltage, current tube current and current filament current of the X-ray device.

[0126] For details about this step, please refer to the above description of step S104, which will not be elaborated here.

[0127] The ray source focus identification method provided in the embodiment of the present application performs image preprocessing on the initial X-ray resolution test image to obtain the target X-ray resolution test image, thereby ensuring the accuracy of the obtained target X-ray resolution test image. Then, the target X-ray resolution test image is image recognized to determine the region of interest in the target X-ray resolution test image, thereby ensuring the accuracy of the determined region of interest in the target X-ray resolution test image. According to each region of interest, the target X-ray resolution test image is image segmented to obtain each initial sub-resolution test image, thereby ensuring the accuracy of each initial sub-resolution test image. Then, from each initial sub-resolution test image, the initial sub-resolution test image with the largest focus value is determined as the sub-resolution test image to be processed, thereby ensuring that the test vertical line and the test horizontal line in the determined sub-resolution test image to be processed are easy to identify. Then, the target test vertical line in the sub-resolution test image to be processed is identified, and the angle of the target test vertical line relative to the horizontal line is calculated. Then, according to the angle between the target test vertical line and the horizontal line, the position of each initial sub-resolution test image is adjusted to obtain a target sub-resolution test image corresponding to each initial sub-resolution test image, so that the test vertical line in each target sub-resolution test image is perpendicular to the horizontal line, thereby ensuring the accuracy of the result of whether each target sub-resolution test image obtained by detection meets the preset standard.

[0128] In this embodiment, a method for identifying a ray source focus is provided, which can be used in the above-mentioned electronic device. Figure 5 is a flow chart of a method for identifying a ray source focus according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:

[0129] Step S301 : acquiring an initial X-ray resolution test image generated by the X-ray device based on the current tube voltage, the current tube current and the current filament current.

[0130] For details about this step, please refer to the above description of step S201, which will not be elaborated here.

[0131] Step S302, segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images; each target sub-resolution test image includes a test vertical line, a test horizontal line and a focus value.

[0132] For details about this step, please refer to the above description of step S202, which will not be elaborated here.

[0133] Step S303: identify each target sub-resolution test image and detect whether each target sub-resolution test image meets a preset standard.

[0134] Specifically, the above step S303 may include the following steps:

[0135] Step S3031 : for each target sub-resolution test image, identify the target sub-resolution test image, and determine a test horizontal line area and a test vertical line area in the target sub-resolution test image.

[0136] Specifically, for each target sub-resolution test image, the electronic device can identify the test horizontal lines and test vertical lines in the target sub-resolution test image according to a preset edge detection algorithm, and then obtain edge information of multiple horizontal lines and multiple vertical lines respectively.

[0137] Then, the electronic device uses the Hough transform straight line fitting algorithm to perform straight line fitting on the edge information of multiple horizontal lines and the edge information of multiple vertical lines to obtain multiple spare horizontal lines and multiple spare vertical lines. Then, the electronic device can screen the multiple spare vertical lines according to the characteristics of the test vertical line to obtain the target vertical line, and screen the multiple spare horizontal lines according to the characteristics of the test horizontal line to obtain the target horizontal line.

[0138] Finally, the electronic device obtains the linear equation (e.g., the form in a rectangular coordinate system or the relevant parameters in a polar coordinate form) for each screened target horizontal line, and determines the starting and ending coordinate ranges of the target horizontal line in the image (e.g., the minimum and maximum values ​​of the horizontal coordinate and the minimum and maximum values ​​of the vertical coordinate) by calculating the coordinates of the intersection of the straight line and the image boundary. The area enclosed by these coordinate ranges is the test horizontal line area corresponding to the target horizontal line. Similarly, for each target vertical line, the linear equation (e.g., the form in a rectangular coordinate system or the relevant parameters in a polar coordinate form) is obtained, and determines the starting and ending coordinate ranges of the target vertical line in the image (e.g., the minimum and maximum values ​​of the horizontal coordinate and the minimum and maximum values ​​of the vertical coordinate) by calculating the coordinates of the intersection of the straight line and the image boundary. The area enclosed by these coordinate ranges is the test horizontal line area corresponding to the target vertical line.

[0139] Step S3032: for the test horizontal line area, determine the number of first target maximum values ​​and the number of first target minimum values ​​in the test horizontal line area.

[0140] Specifically, the above step S3032 may include the following steps:

[0141] Step b1, for the test horizontal line area, calculate the sum of the pixel values ​​corresponding to the pixel points in each row to obtain the row pixel sum.

[0142] Specifically, for the test horizontal line area, in each row, from the starting position to the ending position of the horizontal coordinate, all the pixels in the row are traversed, and the pixel values ​​of each pixel are added to obtain the total pixel value of the row, that is, the row pixel sum.

[0143] Step b2, generating a row pixel sum curve based on the sum of each row of pixels.

[0144] Specifically, the electronic device generates a row pixel sum curve based on the row pixels and. For example, Figure 6 As shown, a schematic diagram of the generated row pixels and curves is shown.

[0145] Step b3, determining multiple first initial maximum values ​​and first initial minimum values ​​from the row pixels and the curve.

[0146] Specifically, the electronic device traverses all data points corresponding to the row pixels and the curve (i.e., the pixels and values ​​corresponding to each row), and starts from the starting point of the row pixels and the curve, and sequentially compares the size relationship of each data point with its adjacent data points to determine whether it is a maximum value or a minimum value, thereby determining a plurality of first initial maximum values ​​and first initial minimum values ​​from the row pixels and the curve.

[0147] Step b4, determining the first target maximum value and the first target minimum value from each first initial maximum value and each first initial minimum value, and determining the number of the first target maximum values ​​and the number of the first target minimum values.

[0148] The above step b4 of “determining the first target maximum value and the first target minimum value from each first initial maximum value and each first initial minimum value” may include the following steps:

[0149] Step b41, calculating the number of increments corresponding to each first initial maximum value and the number of decrements corresponding to each first initial minimum value.

[0150] Among them, the increasing number is used to characterize the number of times the value increases to obtain the first initial maximum value; the decreasing number is used to characterize the number of times the value decreases to obtain the first initial minimum value. That is, the increasing number refers to the number of times the value increases (that is, the sum of pixels increases) in the process of gradually rising from a local low point of the row pixels and the curve until the first initial maximum point is reached; and the decreasing number refers to the number of times the value decreases (the sum of pixels decreases) when it gradually decreases from a local high point of the row pixels and the curve until the first initial minimum point is reached. By calculating these times, the changing characteristics of the row pixels and the curve near the extreme points can be further quantified, providing a more detailed basis for analyzing the resolution and other related characteristics of the X-ray imaging system.

[0151] Specifically, the electronic device can start from each first initial maximum point that has been determined, and perform a backtracking search along the row pixels and the curve to its left side (that is, the direction with relatively small values) to find the first starting point that meets the conditions. This condition is usually: the value of the point is less than the value of its subsequent adjacent point, which means that the value starts from this point and enters an increasing state until the corresponding first initial maximum point. Then, starting from the found starting point to the corresponding first initial maximum point, the values ​​of the two adjacent points are compared in turn. Whenever it is found that the value of the latter point is greater than the value of the previous point, the number of increments is increased by 1.

[0152] Similar to calculating the number of increments corresponding to each first initial maximum value, for each first initial minimum value point, trace back along the row pixels and the curve to its left (the direction with relatively large values) to find the starting point. The condition that this starting point must meet is: the value of the point is greater than the value of its subsequent adjacent point, which means that the value starts to decrease from this point and continues until the corresponding first initial minimum value point. Then, starting from the found starting point to the corresponding first initial minimum value point, compare the values ​​of the two adjacent points one by one. Whenever it is found that the value of the latter point is less than the value of the previous point, the number of decrements is increased by 1.

[0153] Step b42, calculating the increment magnitude corresponding to each first initial maximum value and the decrement magnitude corresponding to each first initial minimum value.

[0154] Among them, the increment amplitude is used to characterize the amplitude of the increase in the value obtained by the first initial maximum value; the decrement amplitude is used to characterize the amplitude of the decrease in the value obtained by the first initial minimum value. That is, the increment amplitude refers to the degree of increase in the sum of pixel values ​​from the starting point of the rising phase of the row pixels and the curve to the first initial maximum point. It is measured by calculating the difference in the sum of pixel values ​​between these two points. Similarly, the decrement amplitude refers to the degree of decrease in the sum of pixel values ​​from the starting point of the falling phase of the row pixels and the curve to the first initial minimum point, which is also determined by calculating the difference between the two points. These amplitude values ​​can reflect the drastic degree of pixel value change in the horizontal line area in the row direction, which is of great significance for analyzing the resolution and other characteristics of the imaging system.

[0155] Specifically, for each first initial maximum value, the electronic device first determines the starting point of the first initial maximum value increment phase. Then, from the maximum value point, trace back along the row pixels and the curve to the left (the direction of the smaller pixel value), find the first position where the pixel value is smaller than the pixel value of the adjacent point on the right, and the sum of the pixel values ​​at this position is set to start_sum. The sum of the pixel values ​​corresponding to the first initial maximum value point is set to max_sum.

[0156] The increment rate can be max_sum-start_sum. For example, if the sum of the pixel values ​​of a first initial maximum value point is 100 and the sum of the pixel values ​​of the increment starting point is 60, the increment rate is 40.

[0157] For each first initial minimum value, the electronic device first determines the starting point of the first initial minimum value decreasing phase. From the first initial minimum value point, trace back to the left (in the direction of larger pixel values) to find the position where the first pixel value is greater than the pixel value of its adjacent point on the right, and the sum of the pixel values ​​at this position is set to start_min_sum. Then, trace back to the left (in the direction of smaller pixel values) along the row pixels and curve from the maximum value point to find the position where the first pixel value is less than the pixel value of its adjacent point on the right, and the sum of the pixel values ​​at this position is set to min_sum. The sum of the pixel values ​​corresponding to the first initial maximum value point is set to min_sum.

[0158] The increment rate may be start_min_sum-min_sum. For example, if the sum of the pixel values ​​of a first initial minimum point is 30 and the sum of the pixel values ​​of the decreasing starting point is 60, the increment rate is 30.

[0159] Step b43, determining each first initial maximum value whose number of increments is greater than the preset number of increments and whose increment amount is greater than the preset increment amount as the first standby maximum value.

[0160] Specifically, the electronic device may receive a preset number of increments and a preset increment magnitude input by a user, and then compare the number of increments corresponding to each first initial maximum value with the preset number of increments, and compare the increment magnitude corresponding to the first initial maximum value with the preset increment magnitude.

[0161] The electronic device determines each first initial maximum value whose increment times are greater than the preset increment times and whose increment magnitude is greater than the preset increment magnitude as a first standby maximum value.

[0162] Step b44, determining each first initial minimum value whose decreasing times are greater than the preset decreasing times and whose decreasing amplitude is greater than the preset decreasing amplitude as the first standby minimum value.

[0163] Specifically, the electronic device may receive a preset decrement number and a preset decrement range input by a user, and then compare the decrement number corresponding to each first initial minimum value with the preset decrement number, and compare the decrement range corresponding to the first initial minimum value with the preset decrement range.

[0164] The electronic device determines each first initial minimum value whose decreasing times are greater than the preset decreasing times and whose decreasing amplitude is greater than the preset decreasing amplitude as the first standby minimum value.

[0165] Step b45, determining the first target maximum value and the first target minimum value from each first backup maximum value and each first backup minimum value.

[0166] Specifically, the above step b45 may include the following steps:

[0167] Step b451, arrange the first spare maximum values ​​and the first spare minimum values ​​in the order of the corresponding horizontal coordinates in the row pixels and the curve from left to right.

[0168] Specifically, the electronic device may obtain the horizontal coordinates corresponding to each first spare maximum value and each first spare minimum value in the row pixel and the curve, respectively.

[0169] Then, the first spare maximum values ​​and the first spare minimum values ​​are arranged in the order from left to right of the horizontal coordinates corresponding to the first spare maximum values ​​and the first spare minimum values ​​in the row pixels and the curve, respectively.

[0170] Step b452, calculate the differences between adjacent first backup maximum values ​​and first backup minimum values ​​in sequence.

[0171] Specifically, the electronic device sequentially calculates the differences between adjacent first backup maximum values ​​and first backup minimum values.

[0172] Step b453, if the difference between the first backup maximum value and the first backup minimum value is less than the preset difference, delete the value on the left side of the two to obtain each first target maximum value and each first target minimum value.

[0173] Specifically, the electronic device can compare the difference between the adjacent first standby maximum value and the first standby minimum value with the preset difference. If the difference between the adjacent first standby maximum value and the first standby minimum value is less than the preset difference, the electronic device deletes the value on the left side of the two, thereby obtaining each first target maximum value and each first target minimum value.

[0174] Step S3033: for the test vertical line area, determine the number of second target maximum values ​​and the number of second target minimum values ​​in the test vertical line area.

[0175] Specifically, for the test vertical line area, the sum of the pixel values ​​corresponding to each column of pixels is calculated to obtain the column pixel sum. Then, the electronic device generates a column pixel sum curve based on the column pixel sum. Figure 7 As shown, a schematic diagram of the generated column pixels and curves is shown.

[0176] Then, multiple second initial maximum values ​​and second initial minimum values ​​are determined from the column pixels and the curve. The electronic device calculates the number of increments corresponding to each second initial maximum value and the number of decrements corresponding to each second initial minimum value; the number of increments is used to characterize the number of increments of the value obtained by obtaining the second initial maximum value; the number of decrements is used to characterize the number of decrements of the value obtained by obtaining the second initial minimum value.

[0177] In addition, the electronic device calculates the incremental amplitude corresponding to each second initial maximum value and the decrement amplitude corresponding to each second initial minimum value; the incremental amplitude is used to characterize the amplitude of the increase in the value obtained by the second initial maximum value; the decrement amplitude is used to characterize the amplitude of the decrease in the value obtained by the second initial minimum value.

[0178] Then, the electronic device can determine each second initial maximum value whose increment times are greater than the preset increment times and whose increment magnitude is greater than the preset increment magnitude as the second standby maximum value. At the same time, each second initial minimum value whose decrement times are greater than the preset decrement times and whose decrement magnitude is greater than the preset decrement magnitude is determined as the second standby minimum value.

[0179] The electronic device arranges each second spare maximum value and each second spare minimum value in the order of the corresponding horizontal coordinates in the column pixels and the curve from left to right. Then, the difference between the adjacent second spare maximum values ​​and the second spare minimum values ​​is calculated in sequence. If the difference between the second spare maximum value and the second spare minimum value is less than the preset difference, the value on the left side of the two is deleted to obtain each second target maximum value and each second target minimum value.

[0180] Step S3034, detecting whether the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to the first threshold, and whether the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to the second threshold.

[0181] Specifically, the electronic device may receive the first threshold and the second threshold for input, or may receive the first threshold and the second threshold sent by other devices. The embodiment of the present application does not specifically limit the manner in which the electronic device obtains the first threshold and the second threshold.

[0182] Then, the electronic device compares the number of the first target maximum values ​​and the number of the second target maximum values ​​with the first threshold, respectively, and compares the number of the first target minimum values ​​and the number of the second target minimum values ​​with the second threshold. It detects whether the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to the first threshold, and whether the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to the second threshold.

[0183] Step S3035, if the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to the first threshold, and the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to the second threshold, it is determined that the target sub-resolution test image meets the preset standard.

[0184] Specifically, if the number of first target maxima and the number of second target maxima are greater than or equal to a first threshold, and the number of first target minima and the number of second target minima are greater than or equal to a second threshold, it is determined that the target sub-resolution test image meets the preset standard.

[0185] If the number of first target maxima and / or the number of second target maxima is less than the first threshold, and / or the number of first target minima and the number of second target minima is less than the second threshold, it is determined that the target sub-resolution test image does not meet the preset standard.

[0186] Step S304, determining the focus value corresponding to the target sub-resolution test image that meets the preset standard as the focus corresponding to the current tube voltage, current tube current and current filament current of the X-ray device.

[0187] For details about this step, please refer to the above description of step S204.

[0188] The ray source focus identification method provided in the embodiment of the present application identifies the target sub-resolution test image for each target sub-resolution test image, determines the test horizontal line area and the test vertical line area in the target sub-resolution test image, and ensures the accuracy of the determined test horizontal line area and the test vertical line area. For the test horizontal line area, the sum of the pixel values ​​corresponding to each row of pixel points is calculated to obtain the row pixel sum, thereby ensuring the accuracy of the obtained row pixel sum. Based on the row pixel sum, a row pixel sum curve is generated; multiple first initial maximum values ​​and first initial minimum values ​​are determined from the row pixel sum curve, ensuring the accuracy of the determined multiple first initial maximum values ​​and first initial minimum values. Then, the number of increments corresponding to each first initial maximum value and the number of decrements corresponding to each first initial minimum value are calculated, ensuring the accuracy of the calculated number of increments corresponding to each first initial maximum value and the number of decrements corresponding to each first initial minimum value. Then, the increment amplitude corresponding to each first initial maximum value and the decrement amplitude corresponding to each first initial minimum value are calculated, ensuring the accuracy of the calculated increment amplitude corresponding to each first initial maximum value and the decrement amplitude corresponding to each first initial minimum value. Then, each first initial maximum value whose number of increments is greater than the preset number of increments and whose increment magnitude is greater than the preset increment magnitude is determined as the first standby maximum value, thereby ensuring the accuracy of the determined first standby maximum value. Each first initial minimum value whose number of decrements is greater than the preset number of decrements and whose decrement magnitude is greater than the preset decrement magnitude is determined as the first standby minimum value, thereby ensuring the accuracy of the determined first standby minimum value. Finally, each first standby maximum value and each first standby minimum value are arranged from left to right in the order of the corresponding horizontal coordinates in the row pixels and the curve; the difference between adjacent first standby maximum values ​​and first standby minimum values ​​is calculated in sequence, thereby ensuring the accuracy of the difference between adjacent first standby maximum values ​​and first standby minimum values ​​calculated. If there is a difference between the first standby maximum value and the first standby minimum value that is less than the preset difference, the value on the left side of the two is deleted to obtain each first target maximum value and each first target minimum value, thereby ensuring the accuracy of the number of first target maximum values ​​and the number of first target minimum values ​​in the determined test horizontal line area. For the test vertical line area, the number of second target maxima and the number of second target minima in the test vertical line area are determined, thereby ensuring the accuracy of the determined number of second target maxima and the number of second target minima in the test vertical line area.Detect whether the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to a first threshold, and whether the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to a second threshold; if the number of the first target maximum values ​​and the number of the second target minimum values ​​are greater than or equal to the first threshold, and the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to the second threshold, then determine that the target sub-resolution test image meets the preset standard, thereby ensuring the accuracy of the determined target sub-resolution test image meeting the preset standard.

[0189] In this embodiment, a device for identifying the focus of a ray source is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0190] This embodiment provides a device for identifying the focus of a radiation source. Figure 8 As shown, including:

[0191] An acquisition module 401 is used to acquire an initial X-ray resolution test image generated by the X-ray device based on a current tube voltage, a current tube current, and a current filament current;

[0192] The segmentation module 402 is used to segment the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images; each target sub-resolution test image includes a test vertical line, a test horizontal line and a focus value;

[0193] A detection module 403 is used to identify each target sub-resolution test image and detect whether each target sub-resolution test image meets a preset standard;

[0194] The determination module 404 is used to determine the focus value corresponding to the target sub-resolution test image that meets the preset standard as the focus corresponding to the current tube voltage, current tube current and current filament current of the X-ray device.

[0195] In some optional embodiments, the segmentation module 402 is specifically used to perform image preprocessing on the initial X-ray resolution test image to obtain a target X-ray resolution test image; and segment the target X-ray resolution test image to obtain multiple target sub-resolution test images.

[0196] In some optional embodiments, the segmentation module 402 is specifically used to perform image recognition on the target X-ray resolution test image, determine the region of interest in the target X-ray resolution test image, wherein the region of interest includes a sub-resolution test image; perform image segmentation on the target X-ray resolution test image according to each region of interest to obtain each initial sub-resolution test image; determine, from each initial sub-resolution test image, the initial sub-resolution test image with the largest focus value as the sub-resolution test image to be processed; identify the target test vertical line in the sub-resolution test image to be processed, and calculate the angle between the target test vertical line and the horizontal line; adjust the position of each initial sub-resolution test image according to the angle between the target test vertical line and the horizontal line to obtain a target sub-resolution test image corresponding to each initial sub-resolution test image, so that the test vertical line in each target sub-resolution test image is perpendicular to the horizontal line.

[0197] In some optional embodiments, the detection module 403 is specifically used to identify the target sub-resolution test image for each target sub-resolution test image, determine the test horizontal line area and the test vertical line area in the target sub-resolution test image; for the test horizontal line area, determine the number of first target maxima and the number of first target minima in the test horizontal line area; for the test vertical line area, determine the number of second target maxima and the number of second target minima in the test vertical line area; detect whether the number of first target maxima and the number of second target maxima are greater than or equal to a first threshold, and whether the number of first target minima and the number of second target minima are greater than or equal to a second threshold; if the number of first target maxima and the number of second target maxima are greater than or equal to the first threshold, and the number of first target minima and the number of second target minima are greater than or equal to the second threshold, then determine that the target sub-resolution test image meets the preset standard.

[0198] In some optional embodiments, the detection module 403 is specifically used to calculate the sum of pixel values ​​corresponding to each row of pixel points for a test horizontal line area to obtain a row pixel sum; generate a row pixel sum curve based on each row pixel sum; determine multiple first initial maxima and first initial minima from the row pixel sum curve; determine a first target maximum and a first target minimum from each first initial maximum and each first initial minimum, and determine the number of first target maxima and the number of first target minima.

[0199] In some optional embodiments, the detection module 403 is specifically used to calculate the number of increases corresponding to each first initial maximum value and the number of decreases corresponding to each first initial minimum value; the number of increases is used to characterize the number of times the value increases through which the first initial maximum value is obtained; the number of decreases is used to characterize the number of times the value decreases through which the first initial minimum value is obtained; the increment corresponding to each first initial maximum value and the decrement amplitude corresponding to each first initial minimum value are calculated; the increment amplitude is used to characterize the amplitude of the increase in the value through which the first initial maximum value is obtained; the decrement amplitude is used to characterize the amplitude of the decrease in the value through which the first initial minimum value is obtained; each first initial maximum value whose number of increases is greater than the preset number of increases and whose increment amplitude is greater than the preset increment amplitude is determined as the first spare maximum value; each first initial minimum value whose number of decreases is greater than the preset number of decreases and whose decrement amplitude is greater than the preset decrement amplitude is determined as the first spare minimum value; and the first target maximum value and the first target minimum value are determined from each first spare maximum value and each first spare minimum value.

[0200] In some optional embodiments, the detection module 403 is specifically used to arrange each first backup maximum value and each first backup minimum value in order from left to right according to the corresponding horizontal coordinates in the row pixels and the curve; calculate the difference between adjacent first backup maximum values ​​and first backup minimum values ​​in turn; if the difference between the first backup maximum value and the first backup minimum value is less than a preset difference, delete the value on the left side of the two to obtain each first target maximum value and each first target minimum value.

[0201] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0202] The radiation source focus identification device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0203] The embodiment of the present invention also provides an electronic device having the above Figure 8 The radiation source focus identification device shown.

[0204] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Fig. 9As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0205] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0206] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0207] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0208] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0209] The electronic device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0210] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0211] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0212] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0213] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for identifying a ray source focus, characterized in that: The method comprises: Acquire an initial X-ray resolution test image generated by the X-ray device based on a current tube voltage, a current tube current, and a current filament current; Segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images; each of the target sub-resolution test images includes a test vertical line, a test horizontal line and a focus value; Identify each of the target sub-resolution test images to detect whether each of the target sub-resolution test images meets a preset standard; The focus value corresponding to the target sub-resolution test image that meets a preset standard is determined as the focus corresponding to the current tube voltage, the current tube current, and the current filament current of the X-ray device.

2. The method according to claim 1, characterized in that The step of segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images includes: Performing image preprocessing on the initial X-ray resolution test image to obtain a target X-ray resolution test image; The target X-ray resolution test image is segmented to obtain a plurality of target sub-resolution test images.

3. The method according to claim 2, characterized in that The step of segmenting the target X-ray resolution test image to obtain a plurality of target sub-resolution test images includes: Performing image recognition on the target X-ray resolution test image to determine a region of interest in the target X-ray resolution test image, wherein the region of interest includes a sub-resolution test image; According to each of the regions of interest, the target X-ray resolution test image is segmented to obtain each initial sub-resolution test image; From the initial sub-resolution test images, determine the initial sub-resolution test image with the largest focus value as the sub-resolution test image to be processed; Identifying a target test vertical line in the sub-resolution test image to be processed, and calculating an angle between the target test vertical line and a horizontal line; According to the angle of the target test vertical line relative to the horizontal line, the position of each of the initial sub-resolution test images is adjusted to obtain the target sub-resolution test image corresponding to each of the initial sub-resolution test images, so that the test vertical line in each of the target sub-resolution test images is perpendicular to the horizontal line.

4. The method according to claim 1, characterized in that: The identifying each of the target sub-resolution test images and detecting whether each of the target sub-resolution test images meets a preset standard includes: For each of the target sub-resolution test images, the target sub-resolution test image is identified to determine a test horizontal line area and a test vertical line area in the target sub-resolution test image; For the test horizontal line area, determining the number of first target maximum values ​​and the number of first target minimum values ​​in the test horizontal line area; For the test vertical line area, determining the number of second target maximum values ​​and the number of second target minimum values ​​in the test vertical line area; Detecting whether the number of the first target maximum values ​​and the number of the second target maximum values ​​are greater than or equal to a first threshold, and whether the number of the first target minimum values ​​and the number of the second target minimum values ​​are greater than or equal to a second threshold; If the number of the first target maxima and the number of the second target maxima are greater than or equal to the first threshold, and the number of the first target minima and the number of the second target minima are greater than or equal to the second threshold, it is determined that the target sub-resolution test image meets the preset standard.

5. The method according to claim 4, characterized in that The step of determining the number of first target maximum values ​​and the number of first target minimum values ​​in the test horizontal line area includes: The step of calculating the sum of pixel values ​​corresponding to each row of pixel points in the test horizontal line area to obtain a row pixel sum; Based on each of the row pixel sums, generating a row pixel sum curve; Determine a plurality of first initial maxima and first initial minima from the row of pixels and the curve; The first target maximum value and the first target minimum value are determined from each of the first initial maximum values ​​and each of the first initial minimum values, and the number of the first target maximum values ​​and the number of the first target minimum values ​​are determined.

6. The method according to claim 5, characterized in that The step of determining the first target maximum value and the first target minimum value from each of the first initial maximum values ​​and each of the first initial minimum values ​​comprises: Calculate the number of increments corresponding to each of the first initial maximum values ​​and the number of decrements corresponding to each of the first initial minimum values; the number of increments is used to characterize the number of increments of the value obtained by obtaining the first initial maximum value; the number of decrements is used to characterize the number of decrements of the value obtained by obtaining the first initial minimum value; Calculate the increment magnitude corresponding to each of the first initial maximum values ​​and the decrement magnitude corresponding to each of the first initial minimum values; the increment magnitude is used to characterize the magnitude of the increase in the value obtained by obtaining the first initial maximum value; the decrement magnitude is used to characterize the magnitude of the decrease in the value obtained by obtaining the first initial minimum value; Determine each of the first initial maximum values ​​whose number of increments is greater than a preset number of increments and whose increment magnitude is greater than a preset increment magnitude as a first standby maximum value; Determine each of the first initial minimum values ​​whose decreasing times are greater than the preset decreasing times and whose decreasing amplitude is greater than the preset decreasing amplitude as a first standby minimum value; The first target maximum value and the first target minimum value are determined from each of the first backup maximum values ​​and each of the first backup minimum values.

7. The method according to claim 6, characterized in that The determining the first target maximum value and the first target minimum value from each of the first spare maximum values ​​and each of the first spare minimum values ​​comprises: Arrange the first spare maximum values ​​and the first spare minimum values ​​in the order of the corresponding horizontal coordinates in the row of pixels and the curve from left to right; sequentially calculating the differences between adjacent first standby maximum values ​​and first standby minimum values; If the difference between the first backup maximum value and the first backup minimum value is less than the preset difference, the value on the left side of the two is deleted to obtain each of the first target maximum values ​​and each of the first target minimum values.

8. A device for identifying the focus of a radiation source, characterized in that: The device comprises: An acquisition module, used to acquire an initial X-ray resolution test image generated by the X-ray device based on a current tube voltage, a current tube current, and a current filament current; A segmentation module, used for segmenting the initial X-ray resolution test image to obtain a plurality of target sub-resolution test images; each of the target sub-resolution test images includes a test vertical line, a test horizontal line and a focus value; A detection module, used to identify each of the target sub-resolution test images and detect whether each of the target sub-resolution test images meets a preset standard; A determination module is used to determine the focus value corresponding to the target sub-resolution test image that meets the preset standard as the focus corresponding to the current tube voltage, the current tube current and the current filament current of the X-ray device.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the ray source focus identification method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the ray source focus identification method according to any one of claims 1 to 7.