Image scale calculation method based on wire type image quality meter wire diameter measurement

By preprocessing and straight-line detection of X-ray images from wire-type image quality meters, and calculating the slope and tilt angle, the problem of accurately calculating the image scale in the absence of standard-sized parts is solved, thus enabling the assessment of X-ray imaging quality.

CN116485872BActive Publication Date: 2026-04-28SHANGHAI DIANJI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI DIANJI UNIV
Filing Date
2023-04-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In the industrial field, due to differences in imaging equipment and the objects being photographed, it is impossible to accurately calculate the image scale of the wire-type image quality meter without standard-sized parts, which makes it impossible to assess the quality of X-ray imaging.

Method used

By preprocessing the X-ray image of the wire-type image quality meter, selecting a local area with a rectangular bounding box, performing binarization, detecting the coordinates of the straight line and endpoints, calculating the slope and tilt angle, and combining the image quality meter model and nominal wire diameter, the scale is calculated.

Benefits of technology

This invention enables the accurate calculation of the wire diameter of the wire-type image quality meter without the availability of standard-sized parts, thereby obtaining the scale of the X-ray image and solving the problem of evaluating the quality of X-ray imaging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116485872B_ABST
    Figure CN116485872B_ABST
Patent Text Reader

Abstract

The application provides a kind of image scale calculation method based on wire type image quality gauge wire diameter measurement, and belongs to the field of image processing technology.The method comprises the following steps: step 1, pre-processing the ray image containing the wire type image quality gauge;step 2, selecting the local area of the image quality gauge as ROI by rectangular frame;step 3, carrying out binaryzation processing on the ROI obtained in step 2;step 4, detecting straight line and endpoint coordinates by using straight line detection method on the result obtained in step 3;step 5, calculating the slope of the obtained straight line, and obtaining the wire diameter of the wire type image quality gauge by using trigonometric function;step 6, comparing the image quality gauge model and the nominal wire diameter, and calculating the scale.The application can calculate the wire diameter of different wire numbers of the wire type image quality gauge, and can obtain the scale of different ray images by comparing the actual nominal wire diameter of the wire type image quality gauge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and specifically to a method for calculating image scale based on wire diameter measurement using a wire-type image quality meter. Background Technology

[0002] Image quality meters, as tools for inspecting and quantitatively evaluating the quality of radiographic images, can not only determine the quality of film images but also assess radiographic techniques, film darkroom processing, and defect inspection capabilities. Currently, wire-type image quality meters are widely used in radiographic imaging quality inspection, and their types and specifications are basically standardized.

[0003] In the industrial field, due to the different shooting equipment and the varying sizes of the objects being photographed, there is usually no fixed scale. Therefore, without knowing the image scale, it is impossible to obtain accurate image information, making it difficult to evaluate the film.

[0004] Some literature proposes a method for determining the image scale of an image quality meter using standard-sized parts. However, the standard-sized parts required for this method are usually only available from the manufacturer. Such standard-sized parts are not available at the application site, and the standard-sized parts of different image quality meters are not interchangeable. This method cannot be used when it is necessary to obtain the image scale of the image quality meter as soon as possible.

[0005] Therefore, how to use image processing technology to calculate the wire diameter of the wire-type image quality meter and thus obtain the scale of the X-ray image is the technical problem that the present invention aims to solve. Summary of the Invention

[0006] To address the aforementioned problems in the prior art, this invention provides a method for calculating image scale based on wire diameter measurement using a wire-type image quality meter.

[0007] The specific technical solution is as follows:

[0008] A method for calculating image scale based on wire diameter measurement using a wire-type image quality meter, the method comprising:

[0009] Step 1 involves preprocessing the X-ray image containing the wire quality meter;

[0010] Step 2: Select a local area of ​​the image quality meter as the ROI using a rectangle;

[0011] Step 3: Binarize the ROI obtained in Step 2;

[0012] Step 4 uses a line detection method to detect the line and endpoint coordinates based on the results obtained in Step 3;

[0013] Step 5 calculates the slope of the obtained straight line and uses trigonometric functions to determine the wire diameter of the wire-type image quality meter;

[0014] Step 6: Calculate the scale by comparing the image quality meter model and nominal wire diameter.

[0015] Furthermore, step 1 in the method specifically includes:

[0016] For X-ray images containing a wire-type image quality meter, the window width and window level are adjusted, and filtering is performed to highlight the contour information of the image quality meter.

[0017] Furthermore, in step 2 of the method:

[0018] The ROI selection method is truncation selection, that is, the right half of the image quality meter is selected as the ROI.

[0019] Furthermore, step 3 in the method specifically includes:

[0020] The grayscale distribution of the ROI is statistically analyzed, and threshold segmentation is performed according to the specific situation to obtain a binarized image with clear image quality contours.

[0021] Furthermore, step 4 of the method specifically includes:

[0022] The LSD line detection algorithm is used to detect lines. First, the gradient magnitude and direction of all points in the image are calculated. Then, adjacent points with small gradient direction changes are treated as a connected region. Next, based on the rectangularity of each region, it is determined whether it needs to be broken according to rules to form multiple regions with larger rectangularity. Finally, all generated regions are improved and filtered, and the regions that meet the conditions are retained, which is the final line detection result.

[0023] Furthermore, step 5 of the method specifically includes:

[0024] Step 51: Count all endpoints with an x-coordinate of 0. This is one endpoint of the line. At the same time, record the coordinates of the other endpoint to obtain multiple point pairs.

[0025] Step 52: Arrange the endpoints with an x-coordinate of 0 in descending order of their y-coordinates;

[0026] Step 53: The difference between each pair of vertical coordinates is the distance d in the vertical direction between image quality meters of different line numbers;

[0027] Step 54: Calculate the slope k for each pair of points, and then calculate the tilt angle using Formula 1.

[0028] α = 90° - |arctan(k)| (Formula 1)

[0029] Step 55: Calculate the parallel distance between the two straight lines using Formula 2, which is the diameter of the image quality meter wire.

[0030] Formula 2: w = d*sin(α)

[0031] Step 56: By comparing the actual image quality meter model and nominal wire diameter, the actual size corresponding to each unit pixel can be calculated.

[0032] The beneficial effects of the above-described technical solution of the present invention are as follows:

[0033] This invention can calculate the wire diameter of different wire numbers of a wire-type image quality meter, and by comparing it with the actual nominal wire diameter of the wire-type image quality meter, the scale of different X-ray images can be determined. Attached Figure Description

[0034] Figure 1 This is a flowchart of an image scale calculation method based on wire diameter measurement using a wire-type image quality meter.

[0035] Figure 2 This is a schematic diagram illustrating the principle of wire diameter calculation. Detailed Implementation

[0036] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with specific embodiments.

[0037] Please see Figure 1 The diagram illustrates a flowchart of a wire diameter measurement method based on line detection for wire profile image quality meters, according to an embodiment of the present invention. The method includes the following steps:

[0038] Step 1: Adjust the window width and window level of the X-ray image containing the wire-type image quality meter, and perform filtering to highlight the contour information of the image quality meter.

[0039] Image preprocessing is crucial for achieving line detection technology. Image preprocessing involves denoising and contrast enhancement to improve image quality. Due to the small grayscale variation in the image quality indicator region, window width and level need to be adjusted to enhance local contrast and make its outline clearer. Simultaneously, X-ray images contain quantum noise, quantization noise, scattering noise, and system thermal noise, making many edge details and information difficult to identify, necessitating image filtering. To prevent image distortion, this embodiment employs homomorphic filtering to preserve image detail features during preprocessing, combining frequency filtering and spatial grayscale transformation. Based on the image's reflectivity model as the foundation for frequency domain processing, image quality is improved by compressing the brightness range and enhancing contrast.

[0040] Step 2: To facilitate machine recognition and conditional filtering, a local image of the image quality meter area is cropped as the ROI.

[0041] It should be noted that the area where the image quality meter is located may have some background interference, such as defects in the workpiece or grayscale changes caused by thickness variations. These interferences should be avoided when selecting the Region of Interest (ROI) to reduce the difficulty of subsequent processing. In this embodiment, the ROI selection method is truncation selection, that is, the right half of the image quality meter is selected as the ROI.

[0042] Step 3: Statistically analyze the grayscale distribution of the ROI, and perform threshold segmentation according to the specific situation to obtain a binarized image with clear image quality contours.

[0043] A grayscale histogram is a statistical representation of the grayscale values ​​of a grayscale image, clearly showing the grayscale distribution. The selected Region of Interest (ROI) should only include the image sensor and a background with similar grayscale values; therefore, its grayscale histogram will show two peaks. The lower grayscale value represents the image sensor's grayscale, and the higher grayscale value represents the background grayscale. Using a bimodal binarization method effectively highlights the image sensor's outline.

[0044] Step 4: Use a line detection algorithm to obtain the line and the coordinates of its endpoints.

[0045] Line detection technology is the core of wire diameter measurement. It uses computer vision to detect straight lines on an object's surface, thereby determining the wire diameter of the image quality meter. Based on the parallel and equidistant characteristics of wire-type image quality meters, this embodiment employs the LSD line detection algorithm. First, the gradient magnitude and direction of all points in the image are calculated. Then, adjacent points with small gradient direction changes are considered as a connected region. Next, based on the rectangularity of each region, it is determined whether it needs to be broken according to rules to form multiple regions with larger rectangularities. Finally, all generated regions are improved and filtered, retaining those that meet the conditions; this is the final line detection result.

[0046] Please refer to the principle of wire diameter calculation. Figure 2 , Figure 2 middle:

[0047] d: Pixel distance of each wire diameter in the vertical direction;

[0048] α: Image quality meter tilt angle;

[0049] w: pixel distance of the image quality meter wire diameter.

[0050] Step 5: Process the line detection results as follows:

[0051] (1) Count all endpoints with a horizontal coordinate of 0. This is one endpoint of the line. At the same time, record the coordinates of the other endpoint to obtain multiple point pairs.

[0052] (2) Arrange the endpoints with x-coordinate 0 in descending order of y-coordinate.

[0053] (3) The difference between each pair of vertical coordinates is the distance d between different line number image quality meters in the vertical direction.

[0054] (4) Calculate the slope k for each pair of points and find the tilt angle. The calculation formula is:

[0055] α = 90° - |arctan(k)|

[0056] (5) Further calculate the parallel distance between the two lines, which is the diameter of the image quality meter wire. The calculation formula is:

[0057] w = d*ain(α)

[0058] (6) By referring to the actual image quality meter model and nominal wire diameter provided in Table 1 and Table 2, the actual size corresponding to each unit pixel can be calculated.

[0059] Table 1

[0060] Optometer model 1 2 3 4 Line number (1)-(7) (6)-(12) (10)-(16) (13)-(19)

[0061] Table 2

[0062]

[0063] It should be noted that, unlike a general scale, the scale obtained by this method is pixel distance: actual distance. Since the wire diameter of an image quality meter is usually measured in mm, this scale means that each pixel unit corresponds to n mm units.

[0064] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for calculating image scale based on wire diameter measurement using a wire-type image quality meter, characterized in that: Includes the following steps: Step 1 involves preprocessing the X-ray image containing the wire quality meter; Step 2: Select a local area of ​​the image quality meter as the ROI using a rectangle; Step 3: Binarize the ROI obtained in Step 2; Step 4 uses a line detection method to detect the line and endpoint coordinates based on the results obtained in Step 3; Step 5 calculates the slope of the obtained straight line and uses trigonometric functions to determine the wire diameter of the wire-type image quality meter; Step 6: Calculate the scale by comparing the image quality meter model and nominal wire diameter.

2. The image scale calculation method based on wire diameter measurement using a wire-type image quality meter as described in claim 1, characterized in that, Step 1 in the method specifically includes: For X-ray images containing a wire-type image quality meter, the window width and window level are adjusted, and filtering is performed to highlight the contour information of the image quality meter.

3. The image scale calculation method based on wire diameter measurement using a wire-type image quality meter as described in claim 2, characterized in that, In step 2 of the method: The ROI selection method is truncation selection, that is, the right half of the image quality meter is selected as the ROI.

4. The image scale calculation method based on wire diameter measurement using a wire-type image quality meter as described in claim 3, characterized in that, Step 3 in the method specifically involves: The grayscale distribution of the ROI is statistically analyzed, and threshold segmentation is performed according to the specific situation to obtain a binarized image with clear image quality contours.

5. The image scale calculation method based on wire diameter measurement using a wire-type image quality meter as described in claim 4, characterized in that, Step 4 in the method specifically involves: The LSD line detection algorithm is used to detect lines. First, the gradient magnitude and direction of all points in the image are calculated. Then, adjacent points with small gradient direction changes are treated as a connected region. Next, based on the rectangularity of each region, it is determined whether it needs to be broken according to rules to form multiple regions with larger rectangularity. Finally, all generated regions are improved and filtered, and the regions that meet the conditions are retained, which is the final line detection result.

6. The image scale calculation method based on wire diameter measurement using a wire-type image quality meter as described in claim 5, characterized in that, Step 5 of the method specifically includes: Step 51: Count all endpoints with an x-coordinate of 0. This is one endpoint of the line. At the same time, record the coordinates of the other endpoint to obtain multiple point pairs. Step 52: Arrange the endpoints with an x-coordinate of 0 in descending order of their y-coordinates; Step 53: The difference between each pair of vertical coordinates is the distance d in the vertical direction between image quality meters of different line numbers; Step 54: Calculate the slope k for each pair of points, and then calculate the tilt angle using Formula 1. α = 90° - |arctan(k)| (Formula 1) Step 55: Calculate the parallel distance between the two straight lines using Formula 2, which is the diameter of the image quality meter wire. Formula 2: w = d*sin(α) Step 56: By comparing the actual image quality meter model and nominal wire diameter, the actual size corresponding to each unit pixel can be calculated.

Citation Information

Patent Citations

  • Scale length calculation method and device, computer equipment and storage medium

    CN112950568A