Processing system, method, storage medium and x-ray imaging device for x-ray images

CN122597189APending Publication Date: 2026-08-18ZHONGKE HUIYUAN VISUAL TECHNOLOGY (LUOYANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610483582.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-13
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

然而,这种处理模式存在明显的缺陷:

Benefits of technology

[0024] By employing the aforementioned technical solution and utilizing a hardware pipeline based on a programmable gate array (PGA) architecture, logarithmic transformation, multi-scale filtering, fusion processing, and enhancement units are integrated within the PGA processor. Leveraging the parallel computing capabilities of the hardware pipeline, the I/O bottleneck caused by data backhaul to the PC and the computational latency of software serial execution are eliminated. Logarithmic domain transformation and multi-scale filtering are performed synchronously during data stream transmission without waiting for complete data transmission. This transforms the time-consuming convolution operations of traditional software mode into pixel-level streaming processing in a single clock cycle, significantly reducing processing latency and achieving real-time enhancement and denoising of X-ray images. This solves the hardware bottleneck faced by FPGAs in implementing complex image processing algorithms. Simultaneously, reflection components are obtained through multi-scale filtering, and dynamic range enhancement is performed. The enhanced final image is then output through the data output interface. This effectively removes noise while preserving image details, allowing the processor to directly output feature-optimized images without transmitting uncompressed and processed raw high-bit-depth data. This helps reduce bandwidth pressure on the transmission interface, avoiding bandwidth waste. Overall, this achieves high efficiency, lightweight design, and real-time processing of X-ray image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597189A_ABST
    Figure CN122597189A_ABST
Patent Text Reader

Abstract

The application discloses an X-ray image processing system, method, storage medium and X-ray imaging equipment. The system comprises a processor adopting a programmable gate array architecture and a data output interface, the processor comprising a logarithmic conversion module, a plurality of parallel different-scale filter branches, a fusion processing unit and an enhancement unit. By utilizing the parallel computing characteristics of the hardware pipeline, the IO bottleneck caused by data back transmission PC and the computing delay of software serial execution are eliminated, and the logarithmic domain conversion and multi-scale filtering are synchronously completed in the data stream transmission process without waiting for complete data transmission. Therefore, the processing delay is reduced, the real-time detection demand of a high-speed production line is met, and the image quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of digital image processing and embedded systems, and in particular to an X-ray image processing system, method, storage medium, and X-ray imaging device. Background Technology

[0002] Currently, X-ray imaging technology is widely used in industrial non-destructive testing and medical imaging. Existing X-ray image processing solutions typically employ a host computer software processing model. This involves connecting the camera body and a PC via a high-speed, high-bandwidth optical interface to transmit the raw, unprocessed image data to the PC, where denoising and enhancement are then performed using algorithms or software written in languages ​​such as C++. However, this processing model has significant drawbacks: First, image data must be completely transmitted to the PC before it can be processed, resulting in high processing latency, which cannot meet the millisecond-level real-time response requirements of high-speed automatic detection on the production line.

[0003] Second, complex noise reduction and enhancement algorithms (such as large-size filtering and histogram equalization) consume a lot of CPU resources, resulting in heavy CPU load and affecting the ability to process multiple tasks in parallel.

[0004] Third, transmitting raw, high-bit-depth data without compression or processing puts enormous pressure on the transmission interface bandwidth, resulting in bandwidth waste. Summary of the Invention

[0005] In view of this, this application provides an X-ray image processing system, method, storage medium, and X-ray imaging device, which utilizes a hardware pipeline to achieve real-time image data enhancement and denoising, and realizes zero-frame delay image processing.

[0006] According to a first aspect of this application, an X-ray image processing system is provided, the system comprising: A processor employing a programmable gate array (PGA) architecture, the processor comprising: The logarithmic transformation module is used to convert the deserialized data stream of the X-ray detector output signal to the logarithmic domain to generate a logarithmic domain image. Multiple parallel filtering branches of different scales are connected to the output of the logarithmic transformation module to perform filtering processing on the logarithmic domain image; The fusion processing unit is connected to the output of the multiple parallel filtering branches of different scales, and is used to obtain the global illumination component based on the output results of the multiple parallel filtering branches of different scales, and to perform a difference operation between the logarithmic domain image and the global illumination component to obtain the reflection component. An enhancement unit, connected to the output of the fusion processing unit, is used to enhance the dynamic range of the reflection component; A data output interface is connected to the output terminal of the processor and is used to output the enhanced image.

[0007] Optionally, the system further includes: A preprocessing module is used to perform cascaded denoising on the data stream; and / or to perform dynamic bad pixel correction and non-uniformity correction on the data stream based on a noise-signal response model; The cascaded denoising includes spatial domain denoising and temporal domain denoising; the noise-signal response model is constructed using X-ray flat-field images at different doses, and the noise-signal response model conforms to the photon transport curve, with its fitting function expressed as: ; In the formula, for The corresponding theoretical noise standard deviation, For pixel grayscale values, and The fitting coefficients are denoted as .

[0008] Optionally, the preprocessing module includes a temporal noise reduction unit and a spatial noise reduction unit, wherein the spatial noise reduction unit is connected to the output of the temporal noise reduction unit; The temporal denoising unit is used to calculate the pixel feature difference value between the current frame pixel and the previous frame pixel under the same coordinates; and to determine an adaptive recursive coefficient that matches the pixel feature difference value; and to perform temporal recursive filtering on the current frame pixel and the previous frame pixel based on the adaptive recursive coefficient to obtain the first-level denoised pixel. The spatial domain denoising unit is used to calculate spatial domain weights based on the grayscale similarity between the first-level denoised pixel and its neighboring pixels; and to perform weighted processing on the neighboring pixels based on the spatial domain weights, and extract the second-level denoised pixels from them; wherein the weights of the neighboring pixels and the spatial domain weights are both negatively correlated with the grayscale difference of the neighboring pixels relative to the first-level denoised pixels.

[0009] Optionally, when the temporal noise reduction unit performs temporal recursive filtering on the current frame pixels and the previous frame pixels based on the adaptive recursive coefficient, it is further configured to decrease the adaptive recursive coefficient when the feature difference value is less than the static threshold, and increase the adaptive recursive coefficient when the feature difference value is greater than the motion threshold.

[0010] Optionally, the preprocessing module includes: The defective pixel correction unit is used to obtain the theoretical noise standard deviation from the noise-signal response model using the gray value of the pixel to be detected as an index; and to calculate the difference value between the pixel to be detected and its neighboring pixels of the same color channel; and, if the difference value is greater than the dynamic detection threshold, to determine that the pixel to be detected is a defective pixel, and to perform interpolation replacement on the pixel to be detected using the weighted average of the neighboring pixels. The dynamic detection threshold is positively correlated with the theoretical noise standard deviation.

[0011] Optionally, the logarithmic transformation module is specifically configured to match the pixel grayscale values ​​of the data stream with a preset logarithmic mapping table to determine the logarithmic domain value corresponding to the pixel grayscale value in the preset logarithmic mapping table; and to reorganize the logarithmic domain value spatially based on the pixel where the pixel grayscale value is located to construct a pixel matrix that meets the requirements of the filter branch window; and to perform time-series alignment on the pixel matrix to generate the logarithmic domain image synchronized with the clock of the filter branch.

[0012] Optionally, the multiple parallel filtering branches of different scales include at least one first filtering branch and at least one second filtering branch; The at least one first filtering branch is used to perform low-pass filtering on the logarithmic domain image, which is less than or equal to a scale threshold, and output at least one first illumination component. The at least one second filtering branch is used to downsample the logarithmic domain image by a preset magnification, perform low-pass filtering processing greater than a scale threshold, and then upsample and restore it to output at least one second illumination component. The fusion processing unit is specifically used to perform a weighted summation of the first illumination component and the second illumination component to obtain the global illumination component. The at least one first filter branch has a different scale, and the at least one second filter branch has a different scale; the preset magnification of the at least one second filter branch is positively correlated with its scale.

[0013] Optionally, the processor further includes: A scale-adaptive unit is configured to calculate the edge density distribution and noise power spectrum of the logarithmic domain image; determine a minimum filtering scale based on the edge density distribution and a maximum filtering scale based on the noise power spectrum; and generate filtering parameters for the multiple parallel filtering branches of different scales based on a logarithmic interval between the minimum filtering scale and the maximum filtering scale.

[0014] According to a second aspect of this application, a method for processing X-ray images is provided, applied to a programmable gate array architecture, the method comprising: The deserialized data stream of the X-ray detector output signal is converted to the logarithmic domain to generate a logarithmic domain image. The logarithmic domain image is filtered by multiple parallel filtering branches of different scales to extract the global illumination component. The reflection component is obtained by performing a difference operation between the logarithmic domain image and the global illumination component; The reflection component is dynamically enhanced, and the enhanced image is output.

[0015] Optionally, the method further includes: Cascaded denoising is performed on the data stream; and / or, dynamic bad pixel correction and non-uniformity correction are performed on the data stream based on a noise-signal response model; The cascaded denoising includes spatial domain denoising and temporal domain denoising; the noise-signal response model is constructed using X-ray flat-field images at different doses, and the noise-signal response model conforms to the photon transport curve, with its fitting function expressed as: ; In the formula, for The corresponding theoretical noise standard deviation, For pixel grayscale values, and The fitting coefficients are denoted as .

[0016] Optionally, the cascaded denoising of the data stream includes: Calculate the pixel feature difference between the current frame pixel and the previous frame pixel at the same coordinates; Determine an adaptive recursive coefficient that matches the pixel feature difference value; Based on the adaptive recursive coefficients, temporal recursive filtering is performed on the current frame pixels and the previous frame pixels to obtain the first-level denoised pixels. Spatial weights are calculated based on the gray-level similarity between the first-level denoised pixel and its neighboring pixels. The neighboring pixels are weighted based on the spatial domain weights, and the second-level denoised pixels are extracted from them; The weights of the neighboring pixels and the spatial weights are both negatively correlated with the grayscale difference of the neighboring pixels relative to the first-level denoised pixels.

[0017] Optionally, the method further includes: If the feature difference value is less than the static threshold, decrease the adaptive recursive coefficient; If the feature difference value is greater than the motion threshold, the adaptive recursive coefficient is increased.

[0018] Optionally, the dynamic bad pixel correction of the data stream based on the noise-signal response model includes: obtaining the theoretical noise standard deviation from the noise-signal response model using the gray value of the pixel to be detected as an index; Calculate the difference between the pixel to be detected and its neighboring pixels of the same color channel; If the difference value is greater than the dynamic detection threshold, the pixel to be detected is determined to be a bad pixel, and the pixel to be detected is replaced by interpolation using the weighted average of the neighboring pixels. The dynamic detection threshold is positively correlated with the theoretical noise standard deviation.

[0019] Optionally, the step of converting the data stream to the logarithmic domain and generating a logarithmic domain image includes: The pixel grayscale values ​​of the data stream are matched with a preset logarithmic mapping table to determine the logarithmic field value corresponding to the pixel grayscale value in the preset logarithmic mapping table; Based on the pixel where the pixel grayscale value is located, the logarithmic field value is spatially reorganized to construct a pixel matrix that meets the requirements of the filter branch window; The pixel matrix is ​​time-aligned to generate the logarithmic domain image synchronized with the clock of the filter branch.

[0020] Optionally, the step of filtering the logarithmic domain image through multiple parallel filtering branches of different scales to extract the global illumination component includes: The logarithmic domain image is subjected to low-pass filtering processing with a scale threshold less than or equal to at least one first filtering branch, and at least one first illumination component is output. After downsampling the logarithmic domain image by a preset magnification through at least one second filtering branch, it is subjected to low-pass filtering processing with a scale threshold greater than the scale threshold, and then upsampled and restored to output at least one second illumination component. The first illumination component and the second illumination component are weighted and summed to obtain the global illumination component. The at least one first filter branch has a different scale, and the at least one second filter branch has a different scale; the preset magnification of the at least one second filter branch is positively correlated with its scale.

[0021] Optionally, the method further includes: Calculate the edge density distribution and noise power spectrum of the logarithmic domain image; The minimum filtering scale is determined based on the edge density distribution, and the maximum filtering scale is determined based on the noise power spectrum. Between the minimum filtering scale and the maximum filtering scale, filtering parameters for the multiple parallel filtering branches of different scales are generated based on a logarithmic interval.

[0022] According to a third aspect of this application, a readable storage medium is provided that stores a program or instructions thereon, which, when executed by a processor, implement the steps of the above-described X-ray image processing method.

[0023] According to a fourth aspect of this application, an X-ray imaging device is provided, including an X-ray detector and an X-ray image processing system as described above. The LVDS or MIPI signal output by the X-ray detector is deserialized and then input to the X-ray image processing system for real-time image processing.

[0024] By employing the aforementioned technical solution and utilizing a hardware pipeline based on a programmable gate array (PGA) architecture, logarithmic transformation, multi-scale filtering, fusion processing, and enhancement units are integrated within the PGA processor. Leveraging the parallel computing capabilities of the hardware pipeline, the I / O bottleneck caused by data backhaul to the PC and the computational latency of software serial execution are eliminated. Logarithmic domain transformation and multi-scale filtering are performed synchronously during data stream transmission without waiting for complete data transmission. This transforms the time-consuming convolution operations of traditional software mode into pixel-level streaming processing in a single clock cycle, significantly reducing processing latency and achieving real-time enhancement and denoising of X-ray images. This solves the hardware bottleneck faced by FPGAs in implementing complex image processing algorithms. Simultaneously, reflection components are obtained through multi-scale filtering, and dynamic range enhancement is performed. The enhanced final image is then output through the data output interface. This effectively removes noise while preserving image details, allowing the processor to directly output feature-optimized images without transmitting uncompressed and processed raw high-bit-depth data. This helps reduce bandwidth pressure on the transmission interface, avoiding bandwidth waste. Overall, this achieves high efficiency, lightweight design, and real-time processing of X-ray image processing.

[0025] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0026] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic diagram of the structure of the X-ray image processing system provided in an embodiment of this application is shown; Figure 2 A flowchart illustrating the X-ray image processing method provided in an embodiment of this application is shown. Figure 3 The image shows a raw X-ray image acquired using existing technology; Figure 4 The output image of the X-ray image processing system provided in an embodiment of this application is shown; Figure 5 An algorithm logic block diagram of the X-ray image processing system provided in an embodiment of this application is shown.

[0027] Figure label: 110 Processor, 111 Logarithmic conversion module, 112 Filtering branch, 113 Fusion processing unit, 114 Enhancement unit, 120 Data output interface. Detailed Implementation

[0028] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0029] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0030] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the word “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “attached” to another element, it can be directly connected or attached to the other element, or there may be intermediate elements. Furthermore, the word “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0031] Exemplary embodiments according to this application will now be described in more detail with reference to the accompanying drawings. However, these exemplary embodiments may be implemented in many different forms and should not be construed as being limited to the embodiments set forth herein. It should be understood that these embodiments are provided so that the disclosure of this application is thorough and complete, and that the concept of these exemplary embodiments is fully conveyed to those skilled in the art.

[0032] This embodiment provides an X-ray image processing system, such as... Figure 1As shown, the system includes a processor 110 with a field-programmable gate array (FPGA) architecture and a data output interface 120 connected thereto.

[0033] The processor 110 is used for real-time enhancement and denoising of X-ray image data. The data output interface 120 is used to output the image enhanced by the processor 110.

[0034] Specifically, the internal logic of the processor 110 is divided into multiple functional modules, each of which works synchronously under the drive of a clock. Data flows through each level of processing unit like water, including: a logarithmic transformation module 111, multiple parallel filtering branches of different scales 112, a fusion processing unit 113, and an enhancement unit 114.

[0035] The logarithmic conversion module 111 is used to convert the deserialized data stream of the X-ray detector output signal to the logarithmic domain to generate a logarithmic domain image.

[0036] Multiple parallel filtering branches 112 at different scales are connected to the output of the logarithmic transformation module 111 to filter the logarithmic domain image provided by the module. Each of these filtering branches 112 corresponds to a specific filtering scale. For example, the first branch processes small-scale details, the second branch processes medium-scale background, and the third branch processes large-scale illumination. This allows filtering at multiple scales to be completed simultaneously within one clock cycle, resulting in higher computational efficiency. It should be understood that "scale" here refers to the standard deviation of the Gaussian function.

[0037] The fusion processing unit 113 is connected to the output of multiple parallel filtering branches 112 of different scales, and is used to obtain the global illumination component based on the output of the multiple parallel filtering branches 112 of different scales. It also performs a difference operation between the logarithmic domain image and the global illumination component to separate the reflection component that reflects the essential properties of the object.

[0038] The enhancement unit 114 is connected to the output of the fusion processing unit 113 and is used to enhance the dynamic range of the reflection component so that the separated reflection component is remapped to a grayscale space suitable for human eye observation or subsequent AI recognition, which helps to improve the contrast and detail visibility of the image.

[0039] The X-ray image processing system provided in this application adopts a hardware pipeline based on a programmable gate array (PGA) architecture. It integrates logarithmic transformation, multi-scale filtering, fusion processing, and enhancement units within the PGA processor. Leveraging the parallel computing characteristics of the hardware pipeline, it eliminates the I / O bottleneck caused by data transmission back to the PC and the computational latency of software serial execution. Logarithmic domain transformation and multi-scale filtering are completed synchronously during data stream transmission without waiting for complete data transmission. This transforms the time-consuming convolution operations of traditional software mode into pixel-level streaming processing in a single clock cycle, significantly reducing processing latency and achieving real-time enhancement and denoising of X-ray images. It solves the hardware bottleneck faced by FPGAs in implementing complex image processing algorithms. Simultaneously, it obtains reflection components through multi-scale filtering and performs dynamic range enhancement, outputting the enhanced final image through a data output interface. While effectively removing noise while preserving image details, it allows the processor to directly output feature-optimized images without transmitting uncompressed and processed raw high-bit-depth data. This helps reduce bandwidth pressure on the transmission interface, avoiding bandwidth waste, and overall achieving high efficiency, lightweight design, and real-time processing of X-ray images.

[0040] For example, the data output interface can be a standard industrial camera interface such as Camera Link, GigE Vision, or USB 3.0. The enhanced image data is directly packaged and output through the FPGA's high-speed transceiver, eliminating the need for secondary processing by PC software and significantly reducing the CPU load on the host computer.

[0041] In practical applications, the logarithmic transformation module is specifically used to match the pixel grayscale values ​​of the data stream with a preset logarithmic mapping table to determine the logarithmic domain value corresponding to the pixel grayscale value in the preset logarithmic mapping table; based on the spatial dimension reorganization of the logarithmic domain value of the pixel where the pixel grayscale value is located, a pixel matrix that meets the requirements of the filter branch window is constructed; and the pixel matrix is ​​time-aligned to generate a logarithmic domain image synchronized with the clock of the filter branch.

[0042] In this embodiment, logarithmic and exponential operations are transformed into lookup table (LUT) operations, and complex nonlinear calculations are converted into memory read operations. This avoids the significant DSP resource consumption associated with directly implementing logarithmic operations using traditional CORDIC algorithms or Taylor series expansions. After finding the logarithmic domain value corresponding to the pixel grayscale value, the spatial dimensions are reorganized using row buffers. This converts the one-dimensional serial pixel stream into a two-dimensional pixel matrix window that meets the requirements of spatial convolution. Timing alignment techniques are then used to eliminate phase deviations in the data stream during the transformation process, ensuring that the output pixel matrix is ​​strictly aligned on the time axis. This allows the generated logarithmic domain image to be completely synchronized with the operating clock of subsequent filtering branches, avoiding data loss or processing errors. Furthermore, this eliminates the data waiting and computational bottlenecks in the image processing pipeline within the FPGA hardware, supporting real-time pixel-level throughput of X-ray images under high-speed dynamic detection.

[0043] It is understandable that, due to the typically large dynamic range of X-ray images (e.g., 16-bit), direct logarithmic calculations would consume significant logic resources and result in high latency. Therefore, distributed RAM or Block RAM (BRAM) can be used to store a pre-defined logarithmic mapping table, facilitating the conversion of logarithmic operations into memory read operations and significantly improving processing speed. While the above embodiment uses BRAM to store a pre-defined logarithmic mapping table as an example, in other embodiments, for applications with lower resolution or smaller dynamic range, distributed RAM or logic resources can also be used to construct the mapping table to balance resource consumption. Furthermore, the window size for spatial dimension reorganization is not fixed but can be flexibly configured according to the specific algorithm requirements of subsequent filtering branches, for example, configured as a 7x7 or 9x9 window. These transformations are all within the scope of this application.

[0044] In practical applications, multiple parallel filtering branches of different scales include at least one first filtering branch and at least one second filtering branch.

[0045] At least one first filtering branch is used to perform low-pass filtering on the logarithmic domain image at a scale threshold less than or equal to the scale threshold, and output at least one first illumination component; at least one second filtering branch is used to perform low-pass filtering on the logarithmic domain image after downsampling at a preset magnification, and then upsampling and restoring, and output at least one second illumination component.

[0046] In this system, at least one first filter branch has a different scale, and at least one second filter branch has a different scale. Multiple first or second filter branches can be configured, each corresponding to a different filter scale, to obtain smoother illumination estimation results.

[0047] It should be noted that the preset multiplier corresponding to at least one second filter branch is positively correlated with its scale.

[0048] The fusion processing unit is specifically used to perform a weighted summation of the first illumination component and the second illumination component to obtain the global illumination component.

[0049] In this embodiment, a scale-level, sampling-adaptive multi-parallel filtering architecture is constructed to perform Gaussian filtering on images of different scales. Specifically, for small-scale features less than or equal to a scale threshold, the first filtering branch preserves local illumination details. For large-scale features greater than the scale threshold, the image is first downsampled to reduce the image resolution, and then filtering is performed on the low-resolution image. Due to the significant reduction in image size, the required row cache depth and convolution kernel size are correspondingly reduced, resulting in a significant reduction in storage consumption. The filtering operation after downsampling is performed on the low-resolution image, but its equivalent receptive field is expanded several times. After filtering, upsampling is used for restoration, which can achieve large-scale illumination estimation with low storage resource consumption. From the underlying logic, this avoids the exponential consumption of logic resources (BRAM / DSP) caused by directly constructing ultra-large convolution kernels in the FPGA, so as to ensure the real-time performance of FPGA data processing. Finally, inside the FPGA, the fusion processing unit receives the illumination components output from each branch in parallel through an addition tree structure and generates a weighted global illumination component. This allows the global illumination component to integrate illumination information at different scales, preserving local details while reflecting the overall background, thus providing an accurate benchmark for subsequent reflection component extraction.

[0050] Understandably, the weights of the first and second illumination components can be preset according to the application scenario or dynamically adjusted based on image features. For example, for areas rich in detail, the smaller scale component is given a higher weight; for areas with a flat background, the larger scale component is given a higher weight.

[0051] For example, the processor has three filtering branches, namely: The small-scale (standard deviation of Gaussian function σ = 0.5~1.0) filtering branch, also known as the first filtering branch, is used to extract subtle changes in illumination. The mesoscale (standard deviation of Gaussian function σ=1.5~2.5) filtering branch, also known as the first second filtering branch, is used to perform 2x2 downsampling on the original image, followed by mesoscale filtering, and then upsampling through bilinear interpolation to restore the image, thereby obtaining a medium-range illumination estimate with low resource consumption. The large-scale (standard deviation of Gaussian function σ=3.0~5.0) filtering branch, also known as the second filtering branch, is used to perform 4x4 downsampling on the original image, followed by large-scale filtering and upsampling to recover the overall illumination background over a large area.

[0052] The brightness estimation maps obtained from the three-channel filtering are then weighted according to a preset weight (e.g., ...). A weighted average is then applied to obtain the final global illumination component. Subsequently, this illumination component is subtracted from the original logarithmic domain image to obtain the reflection component.

[0053] In one embodiment, the processor further includes a scale-adaptive unit.

[0054] The scale-adaptive unit is used to calculate the edge density distribution and noise power spectrum of the logarithmic domain image; the minimum filtering scale is determined based on the edge density distribution, and the maximum filtering scale is determined based on the noise power spectrum; between the minimum and maximum filtering scales, filtering parameters of multiple parallel filtering branches of different scales are generated based on logarithmic intervals.

[0055] The filtering parameters include the filter kernel size, Gaussian standard deviation (scale σ), filter weight coefficients, and filter kernel sampling step size.

[0056] In this embodiment, a constrained multi-scale filtering interval conforming to a logarithmic distribution is dynamically constructed through quantitative analysis of the statistical characteristics of image edges and noise. Within the multi-scale filtering interval, the parameters of each parallel branch are generated by discretization with a logarithmic step size.

[0057] For example, when extremely high image edge density is detected, the system sets the minimum filtering scale to a small value to ensure that minute defect features are not filtered out; when extremely high noise power spectrum is detected, the system sets the maximum filtering scale to a large value to ensure that strong noise can be effectively smoothed.

[0058] In one embodiment, the X-ray image processing system further includes a preprocessing module.

[0059] The preprocessing module can be used to perform cascaded noise reduction on the data stream.

[0060] Among them, cascaded denoising includes spatial domain denoising and temporal domain denoising.

[0061] In this embodiment, while suppressing spatial noise in a single frame image through spatial domain denoising, inter-frame redundant noise is eliminated using temporal domain denoising. This allows for the gradual reduction of the background noise floor while maintaining extremely high edge sharpness, significantly improving the signal-to-noise ratio and enhancing image clarity. Furthermore, the cascaded structure of spatial and temporal domain denoising perfectly matches the hardware pipeline mechanism, reducing the pressure on the system's pixel throughput bandwidth.

[0062] In specific application scenarios, the preprocessing module includes a time-domain noise reduction unit and a spatial-domain noise reduction unit. The outputs of the spatial-domain noise reduction unit and the time-domain noise reduction unit are connected to achieve a cascaded structure.

[0063] The temporal denoising unit is used to calculate the pixel feature difference value between the current frame pixel and the previous frame pixel at the same coordinates; determine the adaptive recursive coefficient matching the pixel feature difference value; and perform temporal recursive filtering on the current frame pixel and the previous frame pixel based on the adaptive recursive coefficient to obtain the first-level denoised pixels.

[0064] The spatial domain denoising unit is used to calculate the spatial domain weight based on the grayscale similarity between the first-level denoised pixel and its neighboring pixels; the neighboring pixels are weighted based on the spatial domain weight, and the second-level denoised pixels are extracted from them.

[0065] The second-level denoised pixels can be extracted by taking the weighted median as the second-level denoised pixel, or by obtaining the second-level denoised pixel through a double-weighted average.

[0066] Both the weights of neighboring pixels and the spatial weights are negatively correlated with the grayscale difference between the neighboring pixels and the pixels denoised in the first stage. The adaptive recursive operation function of the temporal denoising unit can be expressed as: ; In the formula, The pixel data at the same coordinates as the previous frame; This refers to the pixel data of the current frame. These are adaptive recursive coefficients.

[0067] In this embodiment, a temporal denoising unit first captures the pixel feature differences between adjacent frames. A dynamic balance is established through adaptive recursive coefficients: deep recursion is implemented in static regions to eliminate random quantum noise, while the recursive weights are automatically reduced in moving regions to avoid trailing artifacts. This completes the first stage of background filtering without sacrificing spatial resolution. Subsequently, a spatial denoising unit, based on the initially denoised pixels, refines spatial weights using neighborhood grayscale similarity, achieving nonlinear filtering for residual noise. This ensures sufficient averaging in smooth regions while selectively preserving high-frequency edges and minute defect features. This effectively removes X-ray-specific photon shot noise while retaining minute defect features, and avoids the high computational resource consumption problems associated with traditional frequency domain filtering.

[0068] Understandably, the time-domain noise reduction unit can access external storage to read the previous frame of data, while all other operations are completed in the on-chip resources inside the FPGA, avoiding repeated reading and writing of intermediate results.

[0069] It's worth noting that when the temporal denoising unit performs temporal recursive filtering on the pixels of the current frame and the previous frame based on adaptive recursive coefficients, it also decreases the adaptive recursive coefficients when the feature difference value is less than a stillness threshold, and increases the adaptive recursive coefficients when the feature difference value is greater than a motion threshold; where the motion threshold is greater than the stillness threshold. This adaptive mechanism reduces the recursive coefficients when detecting still scenes with values ​​less than the stillness threshold, allowing for averaging with more historical frame information and significantly improving the signal-to-noise ratio. Conversely, it increases the recursive coefficients when detecting moving scenes with values ​​greater than the motion threshold, avoiding motion blur and reducing reliance on historical frames, thus reducing the frequency of external storage access and achieving intelligent allocation of bandwidth resources.

[0070] In another embodiment, the preprocessing module is also used to perform dynamic bad pixel correction and non-uniformity correction on the data stream based on a noise-signal response model.

[0071] In this embodiment, noise and abnormal pixels are dynamically identified and corrected based on the real-time signal strength of the image, avoiding false defects or interference caused by fixed or random bad pixels. Furthermore, it can compensate for uneven brightness caused by inconsistent pixel responses, resulting in more uniform image grayscale and better consistency. This provides higher-quality data input for subsequent filtering and enhancement, contributing to improved final image quality and detection reliability.

[0072] It should be noted that the noise-signal response model is constructed using X-ray flat-field images at different doses. The noise-signal response model conforms to the photon transport curve, and its fitting function is expressed as: ; In the formula, for The corresponding theoretical noise standard deviation; The pixel grayscale value; and These are the fitting coefficients. This reflects the contribution of photon shot noise and is related to the quantum efficiency of X-ray photons, with a coefficient... This reflects the contribution of readout noise and is related to the detector's electronics. During system power-on initialization or offline calibration, the FPGA controls the X-ray source to emit different doses of radiation, acquiring multiple sets of flat-field images. The optimal image is then fitted using statistical methods. and The model is assigned a value and stored in non-volatile memory. During operation, the preprocessing module calls this model in real time for correction.

[0073] In specific application scenarios, the preprocessing module includes a bad pixel correction unit.

[0074] The defective pixel correction unit is used to obtain the theoretical noise standard deviation from the noise-signal response model using the gray value of the pixel to be detected as an index; calculate the difference between the pixel to be detected and its neighboring pixels of the same color channel; if the difference value is greater than the dynamic detection threshold, determine that the pixel to be detected is a defective pixel, and use the weighted average of the neighboring pixels to interpolate and replace the pixel to be detected.

[0075] Among them, the dynamic detection threshold is positively correlated with the theoretical noise standard deviation.

[0076] In this embodiment, the corresponding theoretical noise standard deviation is adaptively obtained using grayscale values ​​as indexes, and the detection threshold is dynamically determined. This ensures accurate differentiation between real noise and abnormal pixels under different signal intensities, avoiding false detections or missed detections caused by fixed thresholds. Simultaneously, interpolation replacement using the weighted average of neighboring pixels effectively removes bad pixels while maintaining the continuity of local image texture, improving image fidelity and the reliability of subsequent image processing.

[0077] In specific application scenarios, the preprocessing module includes a non-uniformity correction unit.

[0078] The non-uniformity correction unit is used to perform linear correction on each input pixel using a preset gain and bias coefficient table.

[0079] In this embodiment, the inherent differences in the response characteristics of each pixel of the sensor can be accurately compensated, effectively eliminating fixed-pattern noise generated by the sensor. This improves the uniformity and fidelity of the image, provides high-quality pixel input for subsequent image processing, and enhances the stability and detection accuracy of the entire X-ray image processing system.

[0080] This embodiment provides a method for processing X-ray images, applied to a programmable gate array architecture, such as... Figure 2 As shown, the method includes: Step 201: Convert the deserialized data stream of the X-ray detector output signal to the logarithmic domain to generate a logarithmic domain image.

[0081] In this embodiment, logarithmic mapping separates the multiplicative illumination component and the reflection component into an additive relationship, thereby preserving more details in both dark and bright areas while reducing artifacts.

[0082] In practical applications, step 211 specifically includes: Step 201-1: Match the pixel grayscale values ​​of the data stream with a preset logarithmic mapping table to determine the logarithmic field value corresponding to the pixel grayscale value in the preset logarithmic mapping table.

[0083] Step 201-2: Based on the logarithmic domain value of the pixel pair containing the pixel grayscale value, the spatial dimension is reorganized to construct a pixel matrix that meets the requirements of the filter branch window.

[0084] Step 201-3: Perform time-series alignment on the pixel matrix to generate a logarithmic domain image synchronized with the clock of the filter branch.

[0085] In this embodiment, real-time logarithmic floating-point operations are unnecessary; logarithmic domain values ​​can be obtained by looking up a pre-defined logarithmic mapping table, simplifying data processing logic and reducing hardware resource consumption and computational latency. Furthermore, by spatially reorganizing the logarithmic domain values, a pixel matrix adapted to the filter branch window size is constructed, and timing alignment is performed on the pixel matrix to generate a logarithmic domain image synchronized with the filter branch clock. This ensures consistent input data timing for each parallel filter branch, avoiding filtering distortion, pixel misalignment, and artifacts caused by timing deviations, improving the accuracy and reliability of global illumination component extraction, and enhancing the overall system stability.

[0086] Step 202: The logarithmic domain image is filtered by multiple parallel filtering branches of different scales to extract the global illumination component.

[0087] In this embodiment, multi-scale parallel filtering captures illumination changes at different scales. For example, large-scale filtering extracts global illumination, while small-scale filtering preserves local illumination transitions. This avoids the loss of halos or details caused by single-scale filtering, thus enabling more accurate estimation of the true illumination components.

[0088] In practical applications, multiple parallel filtering branches of different scales include at least one first filtering branch and at least one second filtering branch. Step 202 specifically includes: Step 202-1: Perform low-pass filtering on the logarithmic domain image with a scale threshold less than or equal to at least one first filtering branch, and output at least one first illumination component.

[0089] Step 202-2: After downsampling the logarithmic domain image by a preset magnification through at least one second filtering branch, perform low-pass filtering processing with a scale threshold greater than the scale threshold, and then upsample and restore it to output at least one second illumination component.

[0090] Step 202-3: Perform a weighted summation of the first illumination component and the second illumination component to obtain the global illumination component.

[0091] In this system, at least one first filter branch has a different scale, and at least one second filter branch has a different scale. The preset scaling factor corresponding to at least one second filter branch is positively correlated with its scale.

[0092] In this embodiment, parallel processing of first and second filtering branches at different scales captures illumination changes at different scales, ensuring the quality of the filtered image. Simultaneously, by employing downsampling followed by upsampling for large-scale filtering, and ensuring the downsampling rate is positively correlated with the filtering scale, the computational load of large-scale filtering is significantly reduced while maintaining the accuracy of global illumination component extraction. This improves processing efficiency, reduces hardware resource consumption, and achieves effective fusion of high- and low-scale illumination information, ensuring the accuracy and robustness of the global illumination components.

[0093] Step 203 involves performing a difference operation between the logarithmic domain image and the global illumination component to obtain the reflection component.

[0094] Step 204: Perform dynamic range enhancement on the reflection component and output the enhanced image.

[0095] The dynamic range enhancement methods include, but are not limited to, at least one of the following: bit depth mapping through gamma correction, global contrast stretching, global uniform grayscale distribution, improving local texture contrast while maintaining global structure, and reconstructing the image after adjustment in gradient space.

[0096] The X-ray image processing method provided in this application converts the corrected data stream to the logarithmic domain, extracts the global illumination component using multi-scale parallel filtering, and obtains the reflection component by differencing the logarithmic domain image. Then, it performs dynamic range enhancement on the reflection component. On one hand, by implementing global illumination component extraction in parallel through multiple filtering branches of different scales, the image processing speed is significantly improved while maintaining image quality, reducing processing latency and meeting the real-time response requirements of industrial non-destructive testing and medical X-ray imaging scenarios. On the other hand, by pre-processing the logarithmic domain conversion, multi-scale parallel filtering, illumination and reflection component separation, and dynamic enhancement of the reflection component, the original high-bit depth image data does not need to be completely transmitted to the PC for post-processing, effectively reducing data transmission volume and interface bandwidth pressure, and avoiding bandwidth resource waste.

[0097] In one embodiment, prior to step 201, the X-ray image processing method further includes: performing cascaded denoising on the data stream; and / or performing dynamic bad pixel correction and non-uniformity correction on the data stream based on a noise-signal response model.

[0098] Among them, cascaded denoising includes spatial domain denoising and temporal domain denoising.

[0099] In this embodiment, cascaded denoising, dynamic bad pixel correction, and non-uniformity correction are performed on the data stream before logarithmic domain transformation. This eliminates noise, bad pixels, and response inhomogeneity interference in X-ray imaging in advance, providing high-quality data for subsequent processing, preventing defects and noise from being amplified by subsequent enhancement algorithms, and effectively improving the clarity and detection reliability of the final image.

[0100] It should be noted that the noise-signal response model is constructed using X-ray flat-field images at different doses. The noise-signal response model conforms to the photon transport curve, and its fitting function is expressed as: ; In the formula, for The corresponding theoretical noise standard deviation, For pixel grayscale values, and The fitting coefficients are denoted as .

[0101] In practical applications, cascaded denoising of the data stream specifically includes: calculating the pixel feature difference between the current frame pixel and the previous frame pixel at the same coordinates; determining an adaptive recursive coefficient matching the pixel feature difference value; performing temporal recursive filtering on the current frame pixel and the previous frame pixel based on the adaptive recursive coefficient to obtain the first-level denoised pixel; calculating spatial weights based on the grayscale similarity between the first-level denoised pixel and its neighboring pixels; weighting the neighboring pixels based on the spatial weights and extracting the second-level denoised pixel from them.

[0102] Among them, the weights of neighboring pixels and spatial domain weights are both negatively correlated with the grayscale difference of neighboring pixels relative to the first-level denoised pixels.

[0103] Specifically, the adaptive recursive operation function is represented as: .

[0104] In the formula, The pixel data at the same coordinates as the previous frame; This refers to the pixel data of the current frame. These are adaptive recursive coefficients.

[0105] In this embodiment, the feature difference values ​​of pixels in the current frame and the previous frame at the same coordinates are first calculated. Adaptive recursive coefficients are then matched and temporal recursive filtering is performed to obtain the first-level denoised pixels. Spatial weights are then calculated based on the gray-level similarity between the first-level denoised pixels and their neighboring pixels. By using cascaded temporal and spatial filtering, various types of noise in X-ray images can be effectively removed while preserving key details such as image edges and textures to the greatest extent. This avoids the image blurring and detail loss problems that are easily caused by traditional denoising algorithms, improving the denoising effect and image fidelity. At the same time, it avoids the problem of high computational resource consumption caused by traditional frequency domain filtering.

[0106] Furthermore, during temporal denoising, the system can decrease the adaptive recursive coefficient when the feature difference value is less than the static threshold, or increase the adaptive recursive coefficient when the feature difference value is greater than the motion threshold.

[0107] Among them, the motion threshold is greater than the static threshold.

[0108] In this embodiment, an adaptive adjustment mechanism based on dual thresholds can effectively utilize more historical frame information for averaging in static areas, thus fully suppressing noise. In moving or detailed areas, it effectively avoids image blurring and ghosting, balancing noise suppression with image detail preservation. Simultaneously, it reduces the need for historical frames, thereby reducing the frequency of external storage access and contributing to improved accuracy and adaptability of the system in X-ray image denoising.

[0109] In one embodiment, dynamic bad pixel correction of the data stream based on the noise-signal response model includes: obtaining the theoretical noise standard deviation from the noise-signal response model using the gray value of the pixel to be detected as an index; calculating the difference between the pixel to be detected and its neighboring pixels of the same color channel; determining the pixel to be detected as a bad pixel when the difference value is greater than the dynamic detection threshold, and interpolating and replacing the pixel to be detected using the weighted average of the neighboring pixels.

[0110] Among them, the dynamic detection threshold is positively correlated with the theoretical noise standard deviation.

[0111] In this embodiment, the theoretical noise standard deviation is obtained based on the noise-signal response model using grayscale values ​​as an index. This theoretical noise standard deviation is then used as the objective basis for determining whether a pixel is abnormal, dynamically distinguishing between normal fluctuations caused by random noise and defective pixels caused by device defects. Finally, pixels identified as defective pixels are replaced using neighborhood weighted average interpolation. This process maintains local texture continuity while removing defective pixels, improving correction robustness and image fidelity, and eliminates the need for complex iterative calculations, thus reducing hardware resource consumption and processing latency.

[0112] In one embodiment, prior to step 202, the X-ray image processing method further includes: calculating the edge density distribution and noise power spectrum of the logarithmic domain image; determining the minimum filtering scale based on the edge density distribution and the maximum filtering scale based on the noise power spectrum; and generating filtering parameters for multiple parallel filtering branches of different scales based on a logarithmic interval between the minimum and maximum filtering scales.

[0113] The filtering parameters include the filter kernel size, Gaussian standard deviation (scale σ), filter weight coefficients, and filter kernel sampling step size.

[0114] In this embodiment, the minimum and maximum filtering scales are adaptively determined based on the edge density distribution and noise power spectrum of the logarithmic domain image, and parallel multi-scale filtering parameters are generated between them at logarithmic intervals. This enables the filtering scale to accurately match the image content and noise characteristics, effectively extracting the global illumination component while avoiding invalid scale calculations, improving filtering robustness and detail preservation, reducing hardware resource consumption, and optimizing image processing efficiency.

[0115] In one specific embodiment, such as Figure 5 As shown, the method for real-time X-ray image enhancement and denoising based on FPGA is used as an example for illustration: 1. Sensor Noise Modeling (Offline or Power-On Calibration Stage): Acquire X-ray flat-field images at different doses, and construct the sensor's photon transfer curve (PTC) or noise-dependent noise model through statistical analysis. This model is fitted to a lookup table (LUT) or a polynomial function. It is stored in the FPGA's BRAM or external Flash, and is used for adaptive parameter control of subsequent processing modules.

[0116] 2. The LVDS / MIPI signal output by the sensor is deserialized and then enters the FPGA.

[0117] 3. The input data stream first passes through the BPC (Bad Pixel Correction) unit of the FPGA's preprocessing module. A dynamic thresholding method based on a noise model is used. The FPGA indexes the noise model LUT based on the current pixel's grayscale value to obtain the theoretical noise standard deviation. Only when the difference between a pixel and its neighborhood is greater than Time-triggered correction replaces bad pixel values ​​with the average value of adjacent pixels in the same color channel, thus avoiding the accidental removal of high-frequency minute defects. This is followed by the NUC (Non-Uniformity Correction) unit in the preprocessing module, which uses a formula... The correction is performed, among which... is the dark level offset, i.e., the output when each pixel is not illuminated; Gain is the gain difference correction coefficient between pixels. The multipliers and adders utilize DSP slices for efficient computation.

[0118] Specifically, the noise model LUT is formed by fusing the following noise components, including: (1) Acquire sensor output under no-light conditions, obtain the dark level offset of each pixel, and form dark current calibration; (2) Acquire standard light source images under different exposure / irradiation intensities, calibrate the photoelectric response linearity and gain of each pixel, and form a photoresponse calibration; (3) Measure the changes of parameters such as dark current and gain with temperature to form temperature sensitivity analysis index; (4) Separate the inherent, time-invariant non-uniform noise (FPN) of the sensor; (5) Analyze the noise that fluctuates randomly over time (such as shot noise and readout noise) and establish the noise-signal response relationship.

[0119] The above noise components are fused into a complete noise model (usually expressed as: Output = Optical Signal × Gain + Dark Current + Random Noise + FPN) to guide subsequent denoising and non-uniformity correction.

[0120] 4. A cascaded denoising architecture of "temporal recursion + spatial adaptation" is adopted: Level 1: Motion Adaptive Temporal Recursive Filtering (3DNR): Utilizing the high-bandwidth memory interface (DDR4) of the FPGA, a frame-level pipeline is constructed. Pixel data at the same coordinates from the previous frame is read. Combined with the current frame pixels Perform recursive operations: When a stationary object is detected, the K value is decreased (by averaging more historical frames) to increase the signal-to-noise ratio to the theoretical limit; when a moving object or motion blur is detected, the K value is quickly increased using a lookup table (LUT) to avoid motion blur.

[0121] Level 2: Edge-preserving spatial filtering: For residual spatial Gaussian noise, a hardware-friendly improved weighted median filter or bilateral filter operator is used. By calculating the gray-level similarity weights of pixels within a 5×5 sliding window, noise is smoothed while high-frequency edges (such as cracks and skeletal lines) are protected to prevent detail blurring.

[0122] 5. After the data stream is converted into a logarithmic domain image by a LUT, it enters three parallel multi-scale Gaussian filter pipelines: First path (small scale): Directly apply small-window Gaussian filtering to the original image to extract subtle lighting changes; The second approach (mesoscale): The original image is downsampled by 2x2 and then filtered. It is then upsampled and restored by bilinear interpolation to obtain a medium-range illumination estimate with low resource consumption. The third approach (large scale): The original image is downsampled by 4x4, filtered, and restored to obtain a large-scale overall lighting background.

[0123] The brightness estimates obtained from the three filters are weighted and averaged according to preset weights to obtain the final global illumination component. Then, this illumination component is subtracted from the original logarithmic domain image to obtain the reflection component. The reflection component is then restored by exponential transformation and superimposed with a Gamma curve for the final contrast-enhanced output.

[0124] 6. For example Figure 4 As shown, the processed data is transferred to the PC for display via DMA.

[0125] like Figure 3 and Figure 4 As shown, existing raw X-ray images are generally dark, with compressed grayscale levels, loss of detail in both high and low grayscale areas, no clear distinction between dark and bright areas, and blurred details such as fine internal grid / layer structures, edge contours, and central dividing lines, resulting in an overall grayish appearance. In contrast, the processed image from this application shows a significant improvement in overall brightness, a full separation of light and dark levels, greatly enhanced contrast, clear and sharp internal grid textures, prominently highlighted central dividing lines, distinct edge contours, no obvious noise, and relatively complete presentation of structural details. Therefore, compared to raw X-ray images acquired using existing technologies, the X-ray image processing system provided in this application, through end-to-end preprocessing, denoising, and enhancement processing, effectively solves problems such as insufficient brightness, low contrast, obscured details, and noise interference in the original image. It significantly improves the visibility of image details, contrast, and imaging quality, while achieving real-time processing with low latency, low bandwidth, and low CPU load, perfectly adapting to the application requirements of industrial non-destructive testing and medical X-ray imaging.

[0126] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0127] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0128] Based on the above, Figure 2 Accordingly, embodiments of this application also provide a readable storage medium storing a computer program thereon, which, when executed by a processor employing a programmable gate array, implements the above-described method. Figure 2 The method for processing X-ray images is shown.

[0129] It should be understood that the readable storage medium in this embodiment is not limited to storing program code implementing the above method, but may also store related configuration parameters and lookup table data (such as preset logarithmic mapping tables, fitting coefficients of noise-signal response models, etc.). When the system needs to upgrade the algorithm or adjust the processing parameters, only the program or data in the storage medium needs to be updated, without replacing the FPGA chip or other hardware circuits, which greatly improves the maintainability and flexibility of the system and reduces the iteration cost of the system.

[0130] Based on the above, Figure 1The system embodiment shown, and Figure 2 To achieve the above objectives, the present application also provides an X-ray imaging device, as illustrated in the method embodiments. This X-ray imaging device includes an X-ray detector and the X-ray image processing system described in the above embodiments. The LVDS or MIPI signal output by the X-ray detector is deserialized and then input to the X-ray image processing system for real-time image processing.

[0131] Specifically, the X-ray detector employs a CMOS image sensor architecture to receive X-rays penetrating the object under test and convert them into electrical signals. After acquiring raw image data, it outputs an image data stream via a high-speed serial interface such as LVDS (Low Voltage Differential Signaling) or MIPI (Mobile Industry Processor Interface). The data stream undergoes serial-to-parallel conversion and clock recovery via the FPGA's built-in high-speed serial transceiver GTH / GTY and a dedicated deserialization chip, before being input to the X-ray image processing system as a parallel pixel data stream. The processing system implements end-to-end real-time processing based on FPGA hardware: sequentially performing operations such as dynamic bad pixel correction, non-uniformity correction, motion-adaptive temporal recursive denoising, edge spatial filtering, logarithmic domain transformation, multi-scale parallel illumination extraction, reflection component separation and dynamic range enhancement, and Gamma correction. It can complete millisecond-level real-time image processing at the detector end without transmitting the entire raw high-bit-depth data to a host computer, ultimately outputting a high-quality X-ray image with clear details, high contrast, low noise, and uniform illumination, which can be directly used in defect detection, medical diagnosis, and other scenarios.

[0132] Those skilled in the art will understand that the X-ray imaging device structure provided in this embodiment does not constitute a limitation on the X-ray imaging device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0133] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.

[0134] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.

Claims

1. A system for processing X-ray images, characterized in that, The system includes: A processor employing a programmable gate array (PGA) architecture, the processor comprising: The logarithmic transformation module is used to convert the deserialized data stream of the X-ray detector output signal to the logarithmic domain to generate a logarithmic domain image. Multiple parallel filtering branches of different scales are connected to the output of the logarithmic transformation module to perform filtering processing on the logarithmic domain image; The fusion processing unit is connected to the output of the multiple parallel filtering branches of different scales, and is used to obtain the global illumination component based on the output results of the multiple parallel filtering branches of different scales, and to perform a difference operation between the logarithmic domain image and the global illumination component to obtain the reflection component. An enhancement unit, connected to the output of the fusion processing unit, is used to enhance the dynamic range of the reflection component; A data output interface is connected to the output terminal of the processor and is used to output the enhanced image.

2. The X-ray image processing system according to claim 1, characterized in that, The system also includes: A preprocessing module is used to perform cascaded denoising on the data stream; and / or to perform dynamic bad pixel correction and non-uniformity correction on the data stream based on a noise-signal response model; The cascaded denoising includes spatial domain denoising and temporal domain denoising; the noise-signal response model is constructed using X-ray flat-field images at different doses, and the noise-signal response model conforms to the photon transport curve, with its fitting function expressed as: ; In the formula, for The corresponding theoretical noise standard deviation, For pixel grayscale values, and represents the fitting coefficient.

3. The X-ray image processing system according to claim 2, characterized in that, The preprocessing module includes a time-domain noise reduction unit and a spatial-domain noise reduction unit, and the spatial-domain noise reduction unit is connected to the output of the time-domain noise reduction unit. The temporal noise reduction unit is used to calculate the pixel feature difference value between the current frame pixel and the previous frame pixel under the same coordinates; And, determine an adaptive recursive coefficient that matches the pixel feature difference value; and, based on the adaptive recursive coefficient, perform temporal recursive filtering on the current frame pixel and the previous frame pixel to obtain the first-level denoised pixel; The spatial domain noise reduction unit is used to calculate spatial weights based on the gray-level similarity between the first-level denoised pixel and its neighboring pixels. Furthermore, the neighboring pixels are weighted based on the spatial domain weights, and second-level denoised pixels are extracted from them; The weights of the neighboring pixels and the spatial weights are both negatively correlated with the grayscale difference of the neighboring pixels relative to the first-level denoised pixels.

4. The X-ray image processing system according to claim 3, characterized in that, When performing temporal recursive filtering on the current frame pixel and the previous frame pixel based on the adaptive recursive coefficient, the temporal noise reduction unit is further configured to decrease the adaptive recursive coefficient when the feature difference value is less than the static threshold, and increase the adaptive recursive coefficient when the feature difference value is greater than the motion threshold.

5. The X-ray image processing system according to claim 2, characterized in that, The preprocessing module includes: The defective pixel correction unit is used to obtain the theoretical noise standard deviation from the noise-signal response model using the gray value of the pixel to be detected as an index; and to calculate the difference value between the pixel to be detected and its neighboring pixels of the same color channel; and, if the difference value is greater than the dynamic detection threshold, to determine that the pixel to be detected is a defective pixel, and to perform interpolation replacement on the pixel to be detected using the weighted average of the neighboring pixels. The dynamic detection threshold is positively correlated with the theoretical noise standard deviation.

6. The X-ray image processing system according to claim 1, characterized in that, The logarithmic transformation module is specifically used to match the pixel grayscale values ​​of the data stream with a preset logarithmic mapping table to determine the logarithmic domain value corresponding to the pixel grayscale value in the preset logarithmic mapping table; and to reorganize the logarithmic domain value spatially based on the pixel where the pixel grayscale value is located to construct a pixel matrix that meets the requirements of the filtering branch window. Furthermore, the pixel matrix is ​​time-aligned to generate the logarithmic domain image synchronized with the clock of the filter branch.

7. The X-ray image processing system according to claim 1, characterized in that, The multiple parallel filtering branches of different scales include at least one first filtering branch and at least one second filtering branch; The at least one first filtering branch is used to perform low-pass filtering on the logarithmic domain image, which is less than or equal to a scale threshold, and output at least one first illumination component. The at least one second filtering branch is used to downsample the logarithmic domain image by a preset magnification, perform low-pass filtering processing greater than a scale threshold, and then upsample and restore it to output at least one second illumination component. The fusion processing unit is specifically used to perform a weighted summation of the first illumination component and the second illumination component to obtain the global illumination component. The at least one first filter branch has a different scale, and the at least one second filter branch has a different scale; the preset magnification of the at least one second filter branch is positively correlated with its scale.

8. A method for processing X-ray images, characterized in that, Applied to a programmable gate array architecture, the method includes: The deserialized data stream of the X-ray detector output signal is converted to the logarithmic domain to generate a logarithmic domain image. The logarithmic domain image is filtered by multiple parallel filtering branches of different scales to extract the global illumination component. The reflection component is obtained by performing a difference operation between the logarithmic domain image and the global illumination component; The reflection component is dynamically enhanced, and the enhanced image is output.

9. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by a processor employing a programmable gate array, the X-ray image processing method as described in claim 8 is implemented.

10. An X-ray imaging device, characterized in that, The system includes an X-ray detector and an X-ray image processing system as described in any one of claims 1 to 7, wherein the LVDS or MIPI signal output by the X-ray detector is deserialized and input to the X-ray image processing system for real-time image processing.