An image enhancement method for a handheld X-ray machine
By employing adaptive preprocessing and multi-scale decomposition techniques, the problem of poor image quality in handheld X-ray machines at low radiation doses was solved, enabling rapid and accurate image enhancement on resource-constrained equipment and improving diagnostic value.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGSHI KANGKAI TECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-30
AI Technical Summary
Handheld X-ray machines produce poor image quality under low radiation dose conditions, and traditional algorithms are time-consuming and lagging when running on resource-constrained equipment, which limits the real-time performance of image enhancement and its diagnostic value.
An adaptive preprocessing method based on global image information entropy and effective grayscale range is adopted, combined with Laplacian pyramid multi-scale decomposition and piecewise linear lookup table, to perform dynamic range pre-compression, feature energy distribution screening and dynamic block-limited contrast adaptive histogram equalization, thereby achieving precise image enhancement.
Achieve rapid and accurate image enhancement with limited resources, improve dynamic range and detail clarity, suppress noise and artifacts, and support rapid diagnosis in the field or at the bedside.
Smart Images

Figure CN122312460A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to an image enhancement method for handheld X-ray machines. Background Technology
[0002] In mobile imaging scenarios for primary healthcare screening and point-of-care diagnosis, handheld X-ray machines, as core digital imaging devices, directly determine the accuracy of doctors' identification of lesions based on the quality of the output images. As the demands for portability and real-time performance of handheld devices continue to increase in fields such as field rescue, community outreach, and tiered healthcare, acquiring high-quality medical images under low-radiation-dose conditions and ensuring robust algorithm operation on embedded platforms with extremely limited hardware resources has become a highly challenging and novel technical problem in this field.
[0003] Currently, the industry typically employs multi-scale Laplacian pyramid enhancement, contrast-limited adaptive histogram equalization, or spatial multi-level noise reduction techniques for post-processing handheld digital X-ray images. These approaches establish specific pixel transformation models in the spatial or frequency domains, utilizing mathematical operators to capture and amplify weak details in the image to calculate contrast enhancement parameters that meet clinical diagnostic requirements.
[0004] In existing technologies, most image enhancement tasks are performed on high-performance workstations or desktop computers with dedicated graphics cards, and the resulting processing often relies on complex floating-point operations and large-scale iterations. Handheld devices are severely limited by size, power consumption, and cost during actual operation, resulting in extremely limited computing resources for their built-in chips. Furthermore, low-dose imaging modes introduce significant quantum noise and background artifacts. These factors cause traditional high-complexity algorithms to experience severe time lags and memory overflows during operation, leading to a significant decrease in the real-time performance of image enhancement and making it difficult to accurately reflect the fine textures of anatomical structures. This disconnect between computational load and image quality limits the on-site diagnostic value of handheld devices, making it difficult to effectively support rapid diagnosis and treatment in the field or at the bedside. Therefore, this invention proposes an image enhancement method for handheld X-ray machines to address the aforementioned problems. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an image enhancement method for handheld X-ray machines, thereby resolving the problems mentioned in the background section.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an image enhancement method for handheld X-ray machines, comprising:
[0007] Step 1: Obtain the image to be processed and perform grayscale statistics to construct a smooth grayscale histogram. Extract the global information entropy and effective grayscale range of the image from the smooth grayscale histogram.
[0008] Step 2: Use the effective grayscale range to perform linear mapping on the image to be processed to complete dynamic range pre-compression and generate a preprocessed image;
[0009] Step 3: Perform multi-scale decomposition on the preprocessed image to construct a Laplacian pyramid composed of several different frequency layers;
[0010] Step 4: Calculate the characteristic energy distribution of each frequency layer in the Laplace pyramid, and compare the characteristic energy distribution with the energy threshold to screen out the core enhancement layer and determine the non-core layer.
[0011] Step 5: Determine enhancement parameters using the global information entropy of the image, perform gain processing on the high-frequency core layer of the core enhancement layer by calling a preset piecewise linear lookup table, and perform dynamic block-limited contrast adaptive histogram equalization on the mid-low frequency core layer of the core enhancement layer.
[0012] Step six involves performing pyramid reconstruction using the processed high-frequency core layer, mid-to-low-frequency core layer, and non-core layer to obtain an enhanced X-ray image.
[0013] Preferably, the construction of the smooth grayscale histogram involves dividing the grayscale values of the image to be processed into several equal-width intervals, counting the number of pixels in each equal-width interval to obtain an initial histogram, and then using a moving average filter to perform smoothing processing on the initial histogram.
[0014] Preferably, the dynamic range pre-compression is to compress the effective grayscale range Pixel values within the range are linearly mapped to the full dynamic range. The mapping formula is:
[0015] ,
[0016] in, The original grayscale value. The grayscale value is the result of linear expansion. The preset maximum grayscale value for the image. and These represent the lower and upper limits of the effective grayscale range.
[0017] Preferably, the multi-scale decomposition is achieved by constructing a Gaussian pyramid through Gaussian blurring and downsampling of the preprocessed image, and by calculating the difference between adjacent Gaussian layers to generate a Laplacian pyramid composed of several layers with different frequencies.
[0018] Preferably, the feature energy distribution is obtained by calculating the pixel variance of each frequency layer in the Laplacian pyramid. When the pixel variance is greater than the energy threshold, the frequency layer is determined to be the core enhancement layer.
[0019] The non-core layer includes the highest frequency noise layer and the extremely low frequency background layer whose pixel variance is lower than the energy threshold, and the original values of the non-core layer are retained without any enhancement operation.
[0020] Preferably, the piecewise linear lookup table is a one-dimensional array pre-calculated and stored based on the logarithmic gain curve, and the gain processing accesses the one-dimensional array using the pixel values of the high-frequency core layer as an index.
[0021] The dynamic block-limited contrast adaptive histogram equalization is based on mapping the block size according to the magnitude of the global information entropy of the image, and the block size is reduced when the global information entropy of the image increases.
[0022] The dynamic block-limited contrast adaptive histogram equalization sets a clipping threshold based on the global information entropy of the image, and increases the clipping threshold when the global information entropy of the image increases.
[0023] Preferably, the calculation formula for the pyramid reconstruction is:
[0024] ,
[0025] in, For the first Layer-based image reconstruction; upsample is the upsampling operation. This is the result of the reconstruction of the previous layer. It can be the high-frequency core layer, the mid-to-low frequency core layer, or the non-core layer.
[0026] Preferably, the energy threshold is adaptively calculated based on the noise level of the image to be processed. Specifically, the background region that does not contain tissue structure in the image to be processed is extracted and the gray standard deviation is calculated to evaluate the noise level. The energy threshold is dynamically set according to the positive correlation mapping relationship of the noise level so that the core enhancement layer can automatically exclude the frequency layer that is severely contaminated by noise under different radiation dose environments.
[0027] Preferably, the storage structure of the one-dimensional array includes several discrete grayscale sampling points and corresponding gain transformation values, wherein the gain transformation values are based on the logarithmic gain curve. It is obtained by pre-calculation and fixed-point rounding, where C is the dynamic gain coefficient determined based on the global information entropy of the image;
[0028] The gain processing includes performing linear interpolation between adjacent sampling points pointed to by the index, so as to achieve a smooth mapping of continuous grayscale changes while reducing memory usage.
[0029] Preferably, during the execution of the dynamic block-limited contrast adaptive histogram equalization, the reduction of the block size and the increase of the shearing threshold are configured to be triggered synchronously, so as to simultaneously improve the local spatial frequency response and suppress excessive accumulation of background grayscale in the complex tissue area with large global information entropy of the image.
[0030] The shearing threshold is weighted and adjusted according to the hierarchical index of the low-frequency core layer. As the hierarchical index increases from the lower to the higher layers in the Laplacian pyramid, the shearing threshold is adjusted accordingly to prevent blocky artifacts from appearing in the reconstructed image.
[0031] This invention provides an image enhancement method for handheld X-ray machines. It has the following beneficial effects:
[0032] 1. This invention adopts an adaptive preprocessing scheme based on the global information entropy and effective grayscale range of the image to achieve the technical effect of automatically adapting to different shooting locations and exposure doses, realizing accurate compression of the dynamic range of the image, and solving the shortcomings of traditional fixed parameter algorithms in contrast adjustment failure under handheld low-dose photography.
[0033] 2. This invention adopts a technical solution of Laplace pyramid multi-scale decomposition combined with feature energy distribution screening to achieve instruction-level optimization effect of allocating computing resources on demand, realize targeted enhancement of core detail layers and effective shielding of high-frequency noise layers, and solve the problem that handheld devices cannot balance noise reduction and detail enhancement under strict resource constraints.
[0034] 3. This invention adopts a heterogeneous frequency domain enhancement technology based on piecewise linear lookup tables, which achieves the technical effect of transforming complex nonlinear logarithmic operations into high-speed table lookup access, enabling the enhancement algorithm to run in a lightweight and real-time manner on low-end SoC or FPGA platforms, and solving the shortcomings of limited computing power of handheld device computing chips and slow operation of traditional complex algorithms.
[0035] 4. This invention adopts a dynamic block segmentation and shearing threshold synchronous triggering limited contrast adaptive histogram equalization scheme to achieve a synergistic control effect of local texture enhancement and artifact suppression. It can improve the clarity of bone and tissue details while preventing background overexposure, and solve the shortcomings of handheld devices caused by motion shaking or low contrast, resulting in blurry details and uneven imaging.
[0036] 5. This invention adopts a noise adaptive threshold setting based on background region evaluation and a pyramid hierarchical index weighted correction technology to achieve a high degree of unity between enhancement intensity and image naturalness, realize the fidelity processing of clinical diagnostic features of medical images, and solve the shortcomings of existing algorithms that are prone to introducing digital artifacts or edge staircase effects when performing strong enhancement. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the original X-ray image of the present invention;
[0038] Figure 2 This is a schematic diagram of the enhanced image of the present invention;
[0039] Figure 3 This is a schematic diagram showing the comparison before and after preprocessing in this invention;
[0040] Figure 4 This is a schematic diagram of the construction of the Laplace pyramid of the present invention;
[0041] Figure 5 This is a schematic diagram showing the comparison of the high-frequency layer before and after enhancement in this invention;
[0042] Figure 6 This is a schematic diagram comparing the enhancement of the low-frequency layer before and after the present invention;
[0043] Figure 7 This is a flowchart of the image enhancement process of the present invention;
[0044] Figure 8 This is the overall flowchart of the present invention. Detailed Implementation
[0045] To enable those skilled in the art to understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.
[0046] The present invention will now be described in detail with reference to the accompanying drawings:
[0047] This invention provides an image enhancement method for handheld X-ray machines, comprising:
[0048] Step 1: Obtain the image to be processed and perform grayscale statistics to construct a smooth grayscale histogram. Extract the global information entropy and effective grayscale range of the image from the smooth grayscale histogram.
[0049] Constructing a smooth grayscale histogram involves dividing the grayscale values of the image to be processed into several equal-width intervals, counting the number of pixels in each equal-width interval to obtain an initial histogram, and then using a moving average filter to smooth the initial histogram.
[0050] Step 2: Linearly map the image to be processed using the effective grayscale range to complete dynamic range pre-compression and generate a preprocessed image;
[0051] Dynamic range precompression is the process of compressing the effective grayscale range. Pixel values within the range are linearly mapped to the full dynamic range. The mapping formula is:
[0052] ,
[0053] in, The original grayscale value. The grayscale value is the result of linear expansion. The preset maximum grayscale value for the image. and These are the lower and upper limits of the effective grayscale range;
[0054] Step 3: Perform multi-scale decomposition on the preprocessed image to construct a Laplacian pyramid consisting of several layers with different frequencies.
[0055] Multiscale decomposition is achieved by constructing a Gaussian pyramid through Gaussian blurring and downsampling of the preprocessed image, and by calculating the difference between adjacent Gaussian layers to generate a Laplacian pyramid composed of several layers with different frequencies.
[0056] Step 4: Calculate the characteristic energy distribution of each frequency layer in the Laplace pyramid, and compare the characteristic energy distribution with the energy threshold to screen out the core enhancement layer and determine the non-core layer.
[0057] The feature energy distribution is obtained by calculating the pixel variance of each frequency layer in the Laplacian pyramid. When the pixel variance is greater than the energy threshold, the frequency layer is determined to be the core enhancement layer.
[0058] The non-core layer includes the highest frequency noise layer and the extremely low frequency background layer with pixel variance below the energy threshold, and the original values of the non-core layer are retained without enhancement operations.
[0059] The energy threshold is adaptively calculated based on the noise level of the image to be processed. Specifically, the background region that does not contain tissue structure is extracted from the image to be processed and the gray standard deviation is calculated to evaluate the noise level. The energy threshold is dynamically set according to the positive correlation mapping relationship of the noise level so that the core enhancement layer can automatically exclude the frequency layer that is severely contaminated by noise under different radiation dose environments.
[0060] Step 5: Use the global information entropy of the image to determine the enhancement parameters, call the preset piecewise linear lookup table to perform gain processing on the high-frequency core layer in the core enhancement layer, and perform dynamic block-limited contrast adaptive histogram equalization on the mid-low frequency core layer in the core enhancement layer.
[0061] The piecewise linear lookup table is a one-dimensional array that is pre-calculated and stored based on the logarithmic gain curve. Gain processing accesses the one-dimensional array by using the pixel values of the high-frequency core layer as an index.
[0062] Dynamic block-limited contrast adaptive histogram equalization maps the block size based on the magnitude of the global information entropy of the image, and reduces the block size when the global information entropy of the image increases.
[0063] Dynamic block-limited contrast adaptive histogram equalization sets a clipping threshold based on the global information entropy of the image. When the global information entropy of the image increases, the clipping threshold is increased.
[0064] The storage structure of a one-dimensional array includes several discrete grayscale sampling points and corresponding gain transformation values. The gain transformation values are derived from the logarithmic gain curve. It is obtained by pre-calculation and fixed-point rounding, where C is the dynamic gain coefficient determined based on the global information entropy of the image;
[0065] Gain processing includes performing linear interpolation between adjacent sampling points pointed to by the index, so as to achieve a smooth mapping of continuous grayscale changes while reducing memory usage;
[0066] During the execution of Dynamic Block Limiting Contrast Adaptive Histogram Equalization, the reduction of block size and the increase of clipping threshold are configured to be triggered synchronously, so as to simultaneously improve the local spatial frequency response and suppress excessive accumulation of background grayscale in complex tissue regions with large global information entropy of the image.
[0067] The shearing threshold is weighted and adjusted according to the hierarchical index of the low- and mid-frequency core layer. Following the hierarchical index, it increases from the lower to the higher levels in the Laplacian pyramid. The shearing threshold is adjusted accordingly to prevent block artifacts from appearing in the reconstructed image.
[0068] Step six involves performing pyramid reconstruction using the processed high-frequency core layer, mid-to-low frequency core layer, and non-core layer to obtain an enhanced X-ray image.
[0069] The formula for calculating the reconstruction of the pyramids is:
[0070] ,
[0071] in, For the first Layer-reconstructed image, For upsampling operation, This is the result of the reconstruction of the previous layer. It can be a high-frequency core layer, a mid-to-low frequency core layer, or a non-core layer.
[0072] Image global information entropy, as an information-theoretic metric, is mainly used to quantify the richness and complex distribution of information contained in a medical image to be processed. In the adaptive enhancement framework proposed in this invention, information entropy serves as a core control parameter, reflecting the spatial complexity of anatomical structures in the image and indicating the noise level present in the image. It dynamically guides the determination of image block size and the mapping strategy for the shearing threshold, achieving precise adaptation of the processing process.
[0073] The effective grayscale range refers to the distribution range of grayscale values in the image to be processed that actually carry biological tissue anatomical information. This range must exclude a very small number of noise pixels that deviate from the main signal and saturated pixels caused by device limitations. The accurate definition of this grayscale range is crucial for subsequent processing. It is mainly used to determine the upper and lower boundaries of stretching in linear grayscale mapping, ensuring that the operation range of image enhancement is strictly limited to the signal area with diagnostic value, and avoiding interference with invalid areas.
[0074] The Laplacian pyramid is a classic multi-scale image decomposition model. This model decomposes the original image by downsampling layer by layer and calculating the difference information between adjacent layers, resulting in: a high-frequency layer containing extremely fine noise and edge contour information; a mid-frequency layer representing tissue texture and moderate structural features; and a low-frequency layer carrying overall anatomical morphology and macroscopic background information. This allows for the separation and independent processing of different spatial frequency features.
[0075] Piecewise linear lookup tables are mapping array structures that are pre-built and stored in the device's memory through offline computation. This structure transforms the mapping process, which originally required complex floating-point operations or transcendental function calculations, into direct addressing and value retrieval operations on memory addresses. While strictly ensuring the accuracy of image enhancement algorithms, it significantly reduces the computational load on the processor of handheld medical devices, meeting real-time processing requirements.
[0076] Contrast-limited adaptive histogram equalization (CHE) is a classic local image enhancement operator. The core of the method is to divide the input image into several overlapping or non-overlapping sub-regions, perform histogram equalization on each sub-block, and then perform threshold clipping and pixel redistribution on the histogram before equalization to suppress noise amplification. This method can effectively enhance the detail representation in low-contrast regions while avoiding the noise enhancement problem introduced by excessive contrast expansion.
[0077] This invention establishes the decision-making basis for data perception by constructing a smooth gray-level histogram and extracting global information entropy and effective gray-level intervals. Smoothing eliminates discrete noise interference in the original statistical data, making the extracted effective intervals more representative. Extracting global information entropy accurately identifies the complexity of image content, matching optimal parameters for specific imaging scenarios at the initial algorithm stage, avoiding the poor robustness issues that arise when fixed parameters are used to handle human tissues of varying thicknesses or different imaging doses.
[0078] This invention performs dynamic range precompression and linear mapping across the entire dynamic range, significantly improving the original low-dose effect. This addresses the problem of extremely low contrast and excessive darkness in X-ray images. By stretching a limited grayscale bit depth to the saturation range, anatomical structures that were originally obscured in the dark areas of the image are initially revealed. This preprocessing scheme provides a high dynamic range signal input for multi-scale decomposition, significantly reduces quantization errors, ensures that weak signals are not lost during frequency domain decomposition, and provides doctors with a basic brightness distribution that conforms to visual habits when reviewing images.
[0079] This invention constructs a multi-scale Laplacian pyramid to precisely decompose complex medical image features along the spatial frequency axis. This hierarchical mechanism allows the algorithm to bypass redundant correlations between pixels and directly perform independent operations on bone edges, vascular textures, and soft tissue backgrounds. By deconstructing images at different scales, this invention successfully achieves parallel optimization of fine details and macroscopic composition, providing a physically independent pathway for subsequent targeted noise filtering and feature enhancement—a technological leap unmatched by single-scale processing methods.
[0080] This invention utilizes characteristic energy distribution to screen core enhancement layers and identify non-core layers, achieving intelligent simplification of computational resources while ensuring final image quality. By comparing energy thresholds, the algorithm automatically identifies the highest-frequency layers that almost entirely contain random quantum noise and proactively abandons enhancement operations on invalid layers. This strategy completely changes the resource waste caused by the indiscriminate processing of all layers in traditional algorithms, greatly reducing the load on the central processing unit of handheld devices, and fundamentally resolving the core technical contradiction between high image quality requirements and the limited computing power of embedded chips.
[0081] This invention employs heterogeneous frequency domain adaptive enhancement to achieve efficient and customized processing for different anatomical features. For the piecewise linear lookup table technique used in the high-frequency core layer, the computationally intensive transcendental function operation is transformed into an instantaneous lookup operation, achieving an order-of-magnitude improvement in computational speed while maintaining the logarithmic enhancement effect. For the dynamic block-based strategy implemented in the mid-to-low frequency core layer, the enhancement granularity is adaptively adjusted according to the image information entropy.
[0082] This invention performs pyramid reconstruction, fusing and upsampling each layer using adaptively optimized feature frequencies. By introducing a weighted hierarchical index during reconstruction, it ensures extremely high spatial continuity of the enhanced signal during re-fusion. This iterative addition process restores the original image resolution and eliminates potential blocky effects or staircase artifacts by superimposing different frequency components. The final enhanced X-ray image is visually clear and fully preserves the lesion details required for auxiliary diagnosis, greatly improving the reliability of clinical diagnosis.
[0083] Example 1:
[0084] In this embodiment, the present invention is applied to the clinical diagnosis of discrete fractures or fine bone cracks in the limbs using a handheld X-ray machine. The imaging characteristics of the limbs are that the bone tissue has a high natural contrast with the surrounding soft tissue and background air, but the spatial frequency of the trabeculae and fine fracture lines is extremely high and is easily affected by handheld device shake and low-dose quantum noise.
[0085] First, the digital detector of the handheld X-ray machine acquires the raw 14-bit or 16-bit depth image to be processed. Since handheld devices are usually used in unshielded environments, there is some background scattering interference. Therefore, in this embodiment, grayscale statistics are performed first in step one.
[0086] Smoothing histogram construction: The system divides the grayscale range from 0 to 65535 into 1024 equal-width intervals and counts the pixel frequency within each interval. To eliminate statistical noise caused by detector defects or random pulses, a moving average filter with a window width of 5 is applied. This filter slides across the histogram array, using a formula to weight and smooth the frequency of each interval.
[0087] Feature extraction: The global information entropy of the image is calculated from the smoothed histogram. For skeletal areas, the entropy value is usually at an intermediate level due to the clear distinction between the background and tissue. Simultaneously, the system determines the effective grayscale range by identifying grayscale values with a cumulative frequency distribution between 2% and 98%. The benefit of this step is that it eliminates potential lead-shielded areas or overexposed areas that are directly penetrated by the image edges, ensuring that subsequent processing focuses on meaningful skeletal pixels.
[0088] To address the limitation that most handheld device displays are 8-bit or 10-bit, the aforementioned effective range is used to perform linear pre-alignment on the image before non-linear processing.
[0089] Linear mapping execution: The system will map the original image to... The pixels, using the formula Mapping to full range .
[0090] This step artificially expands the grayscale difference between the skeletal cortex and the medullary cavity by "stretching" the histogram. When observed with the naked eye, the originally grayish image now shows clear outlines, providing a high signal-to-noise ratio baseline for frequency layer decomposition.
[0091] To achieve targeted enhancement of microfracture lines, the system enters a multi-scale decomposition stage.
[0092] Pyramid construction: A Gaussian kernel convolution is performed on the preprocessed image, followed by interlaced downsampling to construct a pyramid. A five-layer Gaussian pyramid was constructed. Then, the Laplacian frequency layer was obtained by subtracting the upsampled images of the higher-layer Gaussian pyramids from the current layer. and residual bottom layer .
[0093] Energy threshold determination is key to the intelligent screening feature in this embodiment. The system first extracts the pure background areas at the four corners of the image and calculates the grayscale standard deviation to assess the current noise level. Since the handheld device was used for indoor shooting, the noise level was set to a low level. Based on the positive correlation mapping, the energy threshold It is set to a smaller value.
[0094] Core layer selection: Calculate the pixel variance of each Laplacian layer. Experiments show that... mid-high frequency and The variance of the mid-frequency layer is significantly higher than that of the mid-frequency layer. The texture features representing bones are mainly concentrated in mid-high frequency and The intermediate frequency layer is therefore labeled as the core enhancement layer. Because of its extremely high frequency, the layer mainly contains electronic thermal noise and has energy below the threshold, it is determined to be a non-core layer.
[0095] The system employs different hardware-friendly enhancement operators based on the physical meaning of each level.
[0096] High-frequency core layer processing: targeting layers containing fine trabeculae. The system calls a pre-defined piecewise linear lookup table. This table is based on a logarithmic function. The result is obtained through discretization. Considering the need for high sharpness in the skeleton, the gain coefficient C is chosen to be relatively large. The algorithm directly uses... The absolute value of the layer pixel is used as a memory index to instantly read the enhanced pixel offset. To ensure smooth grayscale transitions, the system performs linear interpolation between adjacent sampling points in the lookup table, effectively avoiding the staircase effect caused by quantization.
[0097] Mid-to-low frequency core layer processing: targeting layers containing skeletal contours In the next layer, the system performs dynamic block-limited contrast-adaptive histogram equalization. Based on the extracted moderate entropy, the system divides the image into 16x16 sub-blocks.
[0098] Block size and shearing threshold are triggered synchronously: To prevent noise amplification caused by excessive contrast stretching, the shearing threshold... It is set to the normal value.
[0099] Non-core layer protection: For layers determined to be non-core... In the noise layer, the system keeps the original data unchanged and does not apply any gain in order to suppress "snowflake" noise at the source.
[0100] Finally, the processed levels are reconstructed in reverse.
[0101] Iterative superposition: The reconstruction formula is When stacking layers, the system uses the hierarchical index for weighted adjustments. Because the limb skeleton requires clear boundaries, it is given a slightly higher weight when reconstructing lower layers.
[0102] In the final enhanced images, the edge sharpness of the bone cortex is improved, and the micro-trabecular structure within the medullary cavity is clearly defined. That is, even with a standard radiation dose, occult fracture lines less than 0.1 mm wide can be clearly observed. Thanks to the use of lookup tables and hierarchical skipping mechanisms, the algorithm's runtime on the embedded mainframe is controlled within 150 ms, perfectly meeting the real-time diagnostic requirements of image review immediately after imaging.
[0103] Example 2:
[0104] In this embodiment, the present invention is applied to a handheld device. A scene of image enhancement using a X-ray machine on the human chest or abdomen. The physical characteristics of such areas are that the human body is relatively thick and the tissue overlaps severely, resulting in an extremely compressed grayscale distribution in the original image. Furthermore, due to the superposition of photoelectric effect and Compton scattering, the image contains a large number of low-frequency background scattering lines and faint soft tissue textures.
[0105] First, the handheld device acquires raw 16-bit medical digital images in chest imaging mode. The chest contains air from the lungs, soft tissue from the heart, and hard tissue from the ribs, resulting in a wide grayscale distribution.
[0106] The system uses 2048 equal-width intervals for histogram statistics. Since images of thick areas often have unevenly distributed scattered rays, the initial histogram often exhibits jagged, random fluctuations. This embodiment uses a Gaussian kernel-based moving average filter to smooth the histogram and filter out spurious signals.
[0107] The calculated global information entropy of the image is typically high in chest scenes. This high entropy signal acts as a central control instruction, telling subsequent algorithms that the current image content is extremely rich and the organizational structure is complex, requiring the activation of a "micro-detail mining" mode rather than a simple global stretching.
[0108] By analyzing the slope of the edges on both sides of the histogram, the effective grayscale range is identified. For thick tissues, this range tends to shift towards higher grayscale areas. The system accurately locates this range to prevent severe grayscale "blending" during dynamic range compression.
[0109] The formula maps pixels within the effective range to the full dynamic range. In the thoracic cavity scene, the benefit of this step is that it "push" the faint pixel values behind the mediastinum into the brightness range that is perceptible to the naked eye, so that the lung texture and rib shadows are initially separated.
[0110] During processing, the system utilizes the on-chip SRAM of the embedded SoC to establish a lookup buffer, ensuring that the preprocessed image data has the highest data throughput efficiency when entering multi-scale decomposition. This is crucial for preventing frame drops when handheld devices process large chest X-rays.
[0111] The system decomposes the image into a six-layer Laplacian pyramid. In chest images, lung texture is typically distributed in... to Layers, while the macroscopic anatomical contours are distributed in layer.
[0112] Calculations revealed that, The feature energies of the layers all far exceed the energy threshold. Due to the relatively high radiation dose from chest radiography, the noise level extracted from the background region is... Lower, therefore energy threshold It is set as the global minimum.
[0113] Unlike Example 1, in this scenario the system will exclude the highest frequency... All layers outside the core are designated as core enhancement layers. This "full-spectrum enhancement" strategy ensures that everything from the fine alveolar structure to the macroscopic cardiac contour is simultaneously enhanced.
[0114] Synchronous triggering logic execution: Since the global information entropy of the image is high, the system automatically activates the synchronous triggering mechanism of "reducing the block size" and "increasing the shearing threshold".
[0115] The system reduces the size of the processed sub-blocks from the default 32x32 stepped size to 8x8. The technical advantage of reducing the block size is that it significantly improves the local spatial frequency response, allowing small lung nodules hidden under the shadow of the ribs to generate sufficient local contrast shift to be visually highlighted.
[0116] Coordinated adjustment of shear threshold: To complement subtle enhancements, the shear threshold is synchronously increased, allowing for large local stretching of histogram equalization.
[0117] To prevent in Excessive enhancement of low- and mid-frequency layers can produce "block artifacts," so the system introduces a layer correction factor. Since the layers increase in the pyramid, the upper limit of the shearing threshold is lowered accordingly to ensure that large-span brightness transitions maintain the naturalness and continuity of medical images.
[0118] Reconstruction and Gain Fusion: All core layers that have been processed are reconstructed along with the remaining non-core layers.
[0119] The reconstructed chest images exhibit exceptionally high depth in the mediastinal, lung, and cardiac overlapping areas. The ends of pulmonary vascular patterns are clearly visible, and the tissue structures behind the mediastinum are no longer completely black. Furthermore, due to the use of hierarchical indexing weighting, the entire image does not exhibit the edge halos or step-like artifacts commonly seen in traditional CLAHE algorithms. On the low-power display of a handheld device, this algorithm still provides visual depth comparable to that of a desktop medical reading station.
[0120] Example 3:
[0121] In this embodiment, the present invention is applied to an extremely low-dose photography scenario. This scenario is commonly seen in field battlefield first aid, temporary screening at disaster sites, or photography of extremely sensitive populations. Its technical challenges lie in the extremely low signal-to-noise ratio, the image being heavily covered by quantum noise, and the potential for severe non-uniform basis fluctuations in the image due to unstable hardware power supply.
[0122] After acquiring the image, the system analyzed the smoothed grayscale histogram and found that its peaks were extremely wide and flat, indicating that the image contained a large number of randomly distributed grayscale values. The calculated global information entropy of the image was low, reflecting that the true structural information was submerged in the noisy background.
[0123] The system extracts the effective grayscale range and, by statistically analyzing the dark areas at the edges of the image to be processed, extracts the grayscale standard deviation. Because it is extremely low-dose photography, this standard deviation is very large, directly reflecting the extremely high noise level.
[0124] Because the noise level assessed in the aforementioned steps is extremely high, the algorithm dynamically increases the energy threshold based on logic; this action generates a chain of technical advantages. When calculating the characteristic energy distribution of each layer of the Laplace pyramid, because the threshold is significantly raised, energy that would normally belong to the core layer at normal doses is affected. In this scenario, the energy of a layer is determined to be mostly contributed by noise, and therefore it is classified as a non-core layer.
[0125] The system actively skips the enhancement processing of these high-frequency noise layers. The "active obstacle avoidance" mode avoids the fatal flaw of traditional enhancement algorithms that incorrectly amplify "snowflake" noise, thus achieving underlying protection of the signal-to-noise ratio.
[0126] For the core enhancement layer containing macroscopic contours, a smooth curve with a minimal gain coefficient is invoked from a piecewise linear lookup table. During gain processing, strict linear interpolation between adjacent sampling points is performed. In low-dose images, the continuity between pixels is inherently fragile; linear interpolation ensures that the enhanced grayscale levels maintain continuous mapping, preventing digital tomography.
[0127] Due to the low information entropy, the system sets the CLAHE block size to its maximum value. Histogram equalization is performed within the large blocks, which essentially acts as a smoothing and enhancing effect similar to low-pass filtering. This effectively suppresses small local noise fluctuations while improving the visibility of key anatomical parts.
[0128] The fidelity logic of the reconstruction process involves superimposing the unenhanced noise layer with the smoothed and enhanced structural layer. This embodiment addresses the persistent problem of handheld devices being "unreadable and hesitant to enhance" at extremely low doses. By rationally discarding the noise layer and cautiously enhancing the structural layer, the final enhanced image appears slightly smoother visually due to physical dose limitations, but the key anatomical structures are firmly extracted.
[0129] Because the algorithm skips more than half of the complex calculations, the battery life of handheld devices is indirectly improved in extreme environments, and the processing latency is reduced to an extremely low level, ensuring accurate initial clinical screening through multiple rapid shots in power-constrained outdoor environments.
[0130] Embodiments of the present invention have been presented and described. It will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An image enhancement method for a handheld X-ray machine, characterized by, include: Step 1: Obtain the image to be processed and perform grayscale statistics to construct a smooth grayscale histogram. Extract the global information entropy and effective grayscale range of the image from the smooth grayscale histogram. Step 2: Use the effective grayscale range to perform linear mapping on the image to be processed to complete dynamic range pre-compression and generate a preprocessed image; Step 3: Perform multi-scale decomposition on the preprocessed image to construct a Laplacian pyramid composed of several different frequency layers; Step 4: Calculate the characteristic energy distribution of each frequency layer in the Laplace pyramid, and compare the characteristic energy distribution with the energy threshold to screen out the core enhancement layer and determine the non-core layer. Step 5: Determine enhancement parameters using the global information entropy of the image, perform gain processing on the high-frequency core layer of the core enhancement layer by calling a preset piecewise linear lookup table, and perform dynamic block-limited contrast adaptive histogram equalization on the mid-low frequency core layer of the core enhancement layer. Step six involves performing pyramid reconstruction using the processed high-frequency core layer, mid-to-low-frequency core layer, and non-core layer to obtain an enhanced X-ray image.
2. The image enhancement method for a handheld X-ray machine according to claim 1, characterized in that, The construction of the smooth grayscale histogram involves dividing the grayscale values of the image to be processed into several equal-width intervals, counting the number of pixels in each equal-width interval to obtain an initial histogram, and then using a moving average filter to perform smoothing processing on the initial histogram.
3. The image enhancement method for handheld X-ray machines according to claim 1, characterized in that, The dynamic range precompression is to compress the effective grayscale range. Pixel values within the range are linearly mapped to the full dynamic range. The mapping formula is: , in, The original grayscale value. The grayscale value is the result of linear expansion. The preset maximum grayscale value for the image. and These represent the lower and upper limits of the effective grayscale range.
4. The image enhancement method for handheld X-ray machines according to claim 1, characterized in that, The multi-scale decomposition is achieved by constructing a Gaussian pyramid through Gaussian blurring and downsampling of the preprocessed image, and by calculating the difference between adjacent Gaussian layers to generate a Laplacian pyramid composed of several layers with different frequencies.
5. The image enhancement method for a handheld X-ray machine according to claim 1, characterized in that, The characteristic energy distribution is obtained by calculating the pixel variance of each frequency layer in the Laplacian pyramid. When the pixel variance is greater than the energy threshold, the frequency layer is determined to be the core enhancement layer. The non-core layer includes the highest frequency noise layer and the extremely low frequency background layer whose pixel variance is lower than the energy threshold, and the original values of the non-core layer are retained without any enhancement operation.
6. The image enhancement method for handheld X-ray machines according to claim 1, characterized in that, The piecewise linear lookup table is a one-dimensional array pre-calculated and stored based on the logarithmic gain curve, and the gain processing accesses the one-dimensional array by using the pixel values of the high-frequency core layer as an index. The dynamic block-limited contrast adaptive histogram equalization is based on mapping the block size according to the magnitude of the global information entropy of the image, and the block size is reduced when the global information entropy of the image increases. The dynamic block-limited contrast adaptive histogram equalization sets a clipping threshold based on the global information entropy of the image, and increases the clipping threshold when the global information entropy of the image increases.
7. The image enhancement method for a handheld X-ray machine according to claim 1, characterized in that, The calculation formula for the reconstruction of the pyramids is as follows: , in, For the first Layer-reconstructed image, For upsampling operation, This is the result of the reconstruction of the previous layer. It can be the high-frequency core layer, the mid-to-low frequency core layer, or the non-core layer.
8. The image enhancement method for a handheld X-ray machine according to claim 5, characterized in that, The energy threshold is adaptively calculated based on the noise level of the image to be processed. Specifically, the background region that does not contain tissue structure in the image to be processed is extracted and the gray standard deviation is calculated to evaluate the noise level. The energy threshold is dynamically set according to the positive correlation mapping relationship of the noise level so that the core enhancement layer can automatically exclude the frequency layer that is severely contaminated by noise under different radiation dose environments.
9. The image enhancement method for a handheld X-ray machine according to claim 6, characterized in that, The storage structure of the one-dimensional array includes several discrete grayscale sampling points and corresponding gain transformation values, wherein the gain transformation values are based on the logarithmic gain curve. It is obtained by pre-calculation and fixed-point rounding, where C is the dynamic gain coefficient determined based on the global information entropy of the image; The gain processing includes performing linear interpolation between adjacent sampling points pointed to by the index, so as to achieve a smooth mapping of continuous grayscale changes while reducing memory usage.
10. An image enhancement method for a handheld X-ray machine according to claim 6, characterized in that, During the execution of the dynamic block-limited contrast adaptive histogram equalization, the reduction of the block size and the increase of the shearing threshold are configured to be triggered synchronously, so as to simultaneously improve the local spatial frequency response and suppress excessive accumulation of background grayscale in the complex tissue area with large global information entropy of the image. The shearing threshold is weighted and adjusted according to the hierarchical index of the low-frequency core layer. As the hierarchical index increases from the lower to the higher layers in the Laplacian pyramid, the shearing threshold is adjusted accordingly to prevent blocky artifacts from appearing in the reconstructed image.