A method for dynamic range compression processing of ultrasonic images
Through the combination of Gamma correction and Retinex algorithm, global brightness adjustment and local enhancement of ultrasound images are solved, and the problem of loss of details in ultrasound image compression is achieved, which improves image clarity and adaptability while retaining details.
Patent Information
- Application Number
- CN202510264613.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-03-07
AI Technical Summary
When the existing ultrasonic image processing technology compresses the dynamic range, the subtle defect information is ignored, the image quality is poor, and the global compression method does not fully consider the local information of the image, resulting in loss of details.
The Gamma correction algorithm is used for global brightness adjustment, combined with the Retinex algorithm for local enhancement, and the contrast enhancement factor and adaptive nonlinear offset factor are introduced. Key features are extracted through the deep learning model, image quality scores are calculated, and parameters are automatically adjusted to optimize image effects.
While retaining image detail information, it improves the clarity and adaptability of the image, reduces image distortion, and ensures that the image has good effect in different display environments.
Smart Images

Figure CN119784862B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a method for dynamically compressing the range of ultrasonic images. Background Art
[0002] Ultrasonic testing is a non-destructive testing technology widely used in industries such as industrial and medical fields. Its basic principle is to utilize the propagation characteristics of ultrasonic waves in workpieces. By emitting ultrasonic waves and analyzing their reflected echoes, the internal structure and defects of an object can be evaluated. Ultrasonic waves refer to sound waves with frequencies higher than the audible range of the human ear (20 Hz - 20 kHz), usually between 0.5 and 15 MHz. During the testing process, an ultrasonic wave transmitter emits ultrasonic waves into the object to be tested. When the sound waves encounter material interfaces or defects, the sound waves will be reflected back and captured by the receiver. By analyzing the time delay, amplitude change, and phase change of the reflected wave, the position, size, and nature of the defects can be inferred, thereby evaluating the internal structure of the material.
[0003] Since ultrasonic B-Scan and C-Scan images can intuitively display the internal situation of an object, they have become common and important tools in defect detection. The ultrasonic receiver converts the mechanical vibration signal received by the probe wafer into an electrical signal, and then converts the analog signal into a digital signal through an analog-to-digital converter for quantization display. The digital signal is usually a high-dynamic-range signal, which may have a digital precision of up to 14 bits, 16 bits, or higher, and can capture minute changes and defects inside the object.
[0004] However, due to the limitations of display devices and the human eye, high-dynamic-range A-Scan ultrasonic signals cannot be directly and effectively displayed. Therefore, during the imaging process, these signals usually need to be compressed to form low-dynamic-range A-Scan signals, and then the compressed A-Scan signals are used for imaging to form B-Scan and C-Scan for presentation on the display device.
[0005] Existing ultrasonic imaging technologies usually adopt linear or logarithmic compression methods to directly convert high-dynamic-range ultrasonic data into low-dynamic-range ultrasonic data for imaging. This global-based compression method ignores subtle defect information and results in poor quality of ultrasonic images. A small number of scholars have applied methods in the field of digital image processing to ultrasonic images. For example, the US patent with the publication number CN111819465A discloses a system and method for adaptively configuring the dynamic range for ultrasonic image display; however, this method requires user input to determine the percentages of black and medium gray, and improper settings will cause the image effect to be counterproductive; in addition, this method is based on a global compression method and does not fully consider the local information of the image, resulting in loss of image details;
[0006] Therefore, we propose a method that can compress the dynamic range of an image while preserving the detailed information of the image. Summary of the Invention
[0007] The purpose of the present invention is to provide a method for compressing the dynamic range of an ultrasonic image, which can solve the problem of loss of detailed information after traditional ultrasonic image processing.
[0008] The present invention is realized through the following technical solutions:
[0009] A method for compressing the dynamic range of an ultrasonic image includes:
[0010] Obtain the original A-Scan data with a high dynamic range and convert it into two-dimensional matrix data;
[0011] Preprocess the two-dimensional matrix data to obtain standard input data;
[0012] Use the Gamma correction algorithm to perform non-linear brightness adjustment on the standard input data, initially compress the dynamic range of the image, and generate a compressed image after global brightness adjustment;
[0013] Based on the Retinex algorithm, decompose the compressed image after global brightness adjustment, and introduce a contrast enhancement factor and an adaptive non-linear offset factor to calculate a compressed enhanced image with a low dynamic range.
[0014] Furthermore, the ultrasonic echo signal received by the ultrasonic board card is converted into the original A-Scan data with a high dynamic range through an analog-to-digital converter, and then a gate is used to select the effective signal area, and multiple A-Scan data are integrated into two-dimensional matrix data for two-dimensional imaging.
[0015] Furthermore, the preprocessing process includes grayscale processing, edge detection, and data normalization.
[0016] Furthermore, the specific steps of the edge detection include:
[0017] Use the Canny edge detection algorithm to identify the true contour of the workpiece;
[0018] Replace the 0 pixel values outside the workpiece contour with NaN data.
[0019] Furthermore, use a guided filter to smooth the compressed image after global brightness adjustment and decompose it to generate a basic layer.
[0020] Furthermore, the contrast enhancement factor The calculation formula is:
[0021] ;
[0022] Among them, is the pixel value of the pixel point of the compressed image after global brightness adjustment; is the maximum pixel value of the pixel point of the compressed image after global brightness adjustment; is the contrast control parameter.
[0023] Furthermore, the adaptive non-linear offset factor has the following calculation formula:
[0024] ;
[0025] Among them, is the non-linear control parameter; is the average value of.
[0026] Furthermore, the enhanced compressed image has the following calculation formula:
[0027] ;
[0028] Among them, is the base layer obtained by smoothing the compressed image after global brightness adjustment by the guided filter.
[0029] Furthermore, a deep learning model is used to extract key features from the enhanced compressed image ;
[0030] Based on the key features, the quality score of each frame of image is calculated;
[0031] It is judged whether the enhanced compressed image is reasonable according to the quality score;
[0032] If it is not reasonable, the Gamma correction parameter, the contrast enhancement factor and the adaptive non-linear offset factor are adjusted, and the enhanced compressed image is recalculated;
[0033] If it is reasonable, the reasonable enhanced compressed image is output.
[0034] Furthermore, a convolutional neural network is used to extract key features from the enhanced compressed image.
[0035] The technical solution of the present invention has at least the following advantages and beneficial effects:
[0036] The present invention discloses a method for dynamically compressing the dynamic range of ultrasonic images. By using the Gamma correction algorithm to compress the global dynamic range of the preprocessed image, and the Retinex algorithm to enhance the local part of the compressed image after global brightness adjustment, the output enhanced compressed image can not only be presented on a standard display device, but also effectively retain the original detailed information of the image, facilitating subsequent lossless processing and detection steps; and by introducing a contrast enhancement factor and an adaptive non-linear offset factor, the Retinex algorithm can intelligently adjust the mapping intensity according to the image content, further improving the flexibility and adaptability of image processing;
[0037] In addition, by using the Gamma correction technology as a means of globally non-linearly adjusting the brightness, it can simulate the sensitivity of the human eye to brightness, optimize the visual effect of ultrasonic images, reduce image distortion, and improve the clarity of the images;
[0038] Furthermore, in the Retinex algorithm, the image after globally non-linearly adjusting the brightness is smoothed by a guided filter to obtain a base layer, and the guidance image of the guided filter is constructed by a median filter. The median filter replaces the central pixel value by selecting the median of the local window, effectively removing the sharp noise in the image while retaining the mutation characteristics of the signal, and using the median filter to construct the guidance image can retain the edge information of the image while effectively removing the noise. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flowchart of a method of the present invention;
[0040] Figure 2 is a schematic structural diagram of a system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.
[0042] Embodiment 1
[0043] As Figure 1 shown, a method for dynamically compressing the dynamic range of ultrasonic images includes:
[0044] Obtain the original A-Scan data with a high dynamic range and convert it into two-dimensional matrix data;
[0045] The process of obtaining the original A-Scan data is as follows: The ultrasonic echo signal received by the ultrasonic board card is converted into the original A-Scan data with a high dynamic range by an analog-to-digital converter; then, the gate is used to select the effective signal area, and multiple A-Scan data are integrated into a two-dimensional matrix data for two-dimensional imaging, that is, B-Scan data or C-Scan data; in addition, this method is applicable to various types of industrial ultrasonic nondestructive testing, including the penetration method, the pulse echo method, and the time of flight diffraction (TOFD) method, etc., supports two-dimensional imaging modes (B-Scan and C-Scan), and has wide applicability in different detection scenarios.
[0046] Preprocess the two-dimensional matrix data to obtain the standard input data;
[0047] Use the Gamma correction algorithm to perform non-linear brightness adjustment on the standard input data, initially compress the dynamic range of the image, and generate a compressed image with globally adjusted brightness , that is, perform global dynamic range compression on the image; among them, Gamma correction is a non-linear tone mapping method used to adjust the brightness distribution of the image to compensate for the brightness perception characteristics of the display device or the human eye. It achieves global dynamic range compression by changing the intensity of each pixel value in the image. Specifically, it converts the pixel values according to a power-law function (i.e., the Gamma function);
[0048] Gamma correction is based on the following formula:
[0049] ;
[0050] Among them, is the pixel brightness value of the input image, usually normalized to the interval [0,1]; is the pixel brightness value of the output image after Gamma correction; is an adjustable parameter, that is, the Gamma correction parameter, which determines the shape of the curve;
[0051] When < 1, Gamma correction will increase the contrast in the dark area; while when > 1, it will reduce the contrast in the bright area; selecting an appropriate value can make the image look more natural and better adapt to different display environments and viewing conditions;
[0052] Based on the Retinex algorithm, decompose the compressed image with globally adjusted brightness , and introduce a contrast enhancement factor and an adaptive non-linear offset factor to calculate a low dynamic range enhanced compressed image. This algorithm is used to perform local adaptive dynamic range compression on the compressed image.
[0053] Example 2
[0054] The preprocessing process includes grayscale processing, edge detection, and data normalization.
[0055] 1) Grayscale processing
[0056] Convert a high-dynamic-range two-dimensional matrix (usually B-Scan or C-Scan image data composed of multiple A-Scan data) into a grayscale image, where the grayscale value of each pixel corresponds to the amplitude of the original A-Scan data at the corresponding point in the matrix.
[0057] The purpose is to simplify the data form: the original ultrasonic data is essentially single-channel amplitude information. Directly mapping it to a grayscale image avoids redundant color channels such as the RGB three channels and reduces the computational complexity; focus on amplitude information: ultrasonic imaging characterizes material properties through echo intensity, and a grayscale image can intuitively reflect amplitude differences (the higher the brightness, the stronger the signal intensity), facilitating the observation of structural features; and data standardization: unify all input images into a single-channel grayscale form, eliminate the interference of color differences on the algorithm, and ensure the consistency of the processing flow.
[0058] 2) Edge detection
[0059] If the scanning range covers the entire workpiece, since the shape of the workpiece is usually irregular, there are filled 0 pixel values at the periphery of the workpiece in the matrix data for imaging. These pixels will interfere with subsequent calculations. Therefore, first use the Canny edge detection algorithm to identify the true contour of the workpiece. Then, replace the 0 pixel values outside the workpiece contour with NaN to exclude the influence of 0 pixel values on the overall image, where NaN is the abbreviation of "Not-a-Number", which is a special numerical type indicating "not a number". If only a partial scan is performed inside the workpiece without involving the workpiece edge and external filled values, this step can be omitted.
[0060] The purpose is to remove interference: when the scanning range covers the entire workpiece, there may be zero-valued pixels in the image that do not belong to the actual object. Edge detection can accurately mark the boundary of the workpiece and replace the pixel values in the external irrelevant areas with NaN to avoid their influence on subsequent calculations; improve accuracy: ensure that the data used for imaging analysis is limited to the inside of the actual workpiece, thereby improving the accuracy of the final result; and optimize computing resources: only process the inside of the workpiece, reducing unnecessary computational volume and improving computational efficiency.
[0061] After adding NaN values to the data, it is necessary to mark the positions of special values through a mask so that the special values do not participate in subsequent calculations.
[0062] 3) Data normalization
[0063] Normalize the matrix data to the interval [0, 1] according to the minimum and maximum values, providing a standardized input for the subsequent compression algorithm;
[0064] The specific calculation formula is as follows:
[0065] ;
[0066] where is the original matrix data, and are the minimum and maximum values of the original matrix data respectively.
[0067] Through the normalization process, it is possible to eliminate the data range differences brought by different ultrasonic devices or imaging conditions, such as gain settings, probe frequencies, etc., providing a standardized input for the subsequent dynamic range compression algorithm; and providing a suitable input range for subsequent operations such as dynamic range compression. For example, Gamma correction usually requires the input value to be between [0, 1].
[0068] Example 3
[0069] In addition, use a guided filter to smooth the compressed image after global brightness adjustment to obtain the base layer . The guidance image of the guided filter is obtained by performing median filtering on . The guided filter is an edge-preserving filter that uses the information of the guidance image to filter the input image.
[0070] The core principle of the guided filter is to use the guidance image to filter the image to be processed, which can not only smooth the image but also preserve the edge information. Before using the guided filter, it is necessary to construct the guidance image first. Common methods for constructing the guidance image include directly using the input image, using Gaussian filtering to generate the guidance image, and using the grayscale image to generate the guidance image.
[0071] In view of the situation that there is more noise in the ultrasonic images in the industrial scenario, use a median filter to filter the input image to construct the guidance image, remove the sharp noise in the image, and retain the mutation part of the signal, that is, the edge part in the image.
[0072] The median filter replaces the pixel value by selecting the median within the neighborhood of each pixel in the image, effectively removing salt-and-pepper noise and keeping the edges clear. Although the computational complexity is relatively high, it can better retain the image details while denoising, and it is a non-linear filtering method that balances denoising and detail retention. Selecting the size of the neighborhood can significantly affect the filtering result. When a larger neighborhood (i.e., a larger window) is selected, the smoothing effect of the image is more obvious. To retain more detailed information, a neighborhood with a size of 3x3 is selected here to calculate the median.
[0073] After adding special values to the image data, if the neighborhood of a pixel contains special values, only the non-special values within the neighborhood are sorted to select the median. If the number of elements in the list of neighborhood pixel values after removing special values is odd, the median is the middle number; if the number of elements is even, the median is usually the average of the two middle numbers.
[0074] In addition, the contrast enhancement factor is calculated by the formula:
[0075] ;
[0076] where is the pixel value of the compressed image pixel point after global brightness adjustment; is the maximum pixel value of the compressed image pixel point after global brightness adjustment; is the contrast control parameter. When is greater than 1, the image contrast is enhanced. When is less than 1, the image contrast is reduced. Here takes a constant greater than 1.
[0077] Here, the larger the value of , the greater is, which means the higher the degree of contrast enhancement for this pixel point. is used to control the intensity of contrast enhancement. When increases as a whole, the contrast enhancement effect is more significant. In this way, the contrast enhancement factor
[0078] can be adaptively adjusted according to the gray value of each pixel in the image. Specifically, the formula for calculating the adaptive non-linear offset factor
[0079] is:
[0080] where is the non-linear control parameter; is 's average value.
[0081] reflects the overall brightness level of the image. If is higher, will also be higher.
[0082] Finally, the formula for the enhanced compressed image is:
[0083] ;
[0084] where is the base layer obtained after being smoothed by a guided filter. Performing a division operation in the logarithmic domain is equivalent to performing a subtraction operation in the luminance domain. Therefore, is the input image subtracted by its base layer to obtain the detail layer, and this detail layer is the enhanced image of concern.
[0085] Specifically, the contrast enhancement factor is used to adjust the contrast within the local area of the image. The larger the pixel value of a pixel point in the image, the larger the value, and the larger the corresponding pixel value of the output image ; the smaller the pixel value of a pixel point in the image, the smaller the value, and the smaller the corresponding pixel value of the output image . That is, the difference between different gray levels in the image becomes more obvious.
[0086] And the purposes of this factor are to improve visibility: by increasing the local contrast, details that were originally difficult to distinguish in the image can be made more clearly visible, especially in areas with high and low signal amplitudes; and to maintain a natural appearance: although the contrast is enhanced, it is still necessary to ensure that the image looks natural without producing oversharpening or distortion; and to adapt to local characteristics: the ultrasonic image of the workpiece reflects its internal complex material characteristics, and the contrast enhancement factor can be adaptively adjusted according to the characteristics of each local area, so as to better present the characteristics of the material or defects.
[0087] The adaptive non - linear offset factor , is used to adjust the input value of the logarithmic function. The characteristic of the logarithmic function is that its gradient, that is, the rate of change of the function, gradually decreases as the input value increases. This means that when the input value is small, the change of the logarithmic function is fast, and when the input value is large, the change is slow.
[0088] adjusts the starting point of the logarithmic function. By changing this starting point, the non - linear intensity of the logarithmic function can be controlled. Specifically:
[0089] If is small (the average value of the pixels of the compressed image after global brightness adjustment), that is, the image is darker. is small ( ), then the logarithmic function will start from a larger gradient, which means that in the dark areas of the image, the change of the logarithmic function will be more obvious, thus increasing the brightness of these areas.
[0090] On the contrary, if is large, that is, the image is brighter, is large, the gradient of the logarithmic function will be smaller and the change will be slower, which means that in the bright areas of the image, the increase in brightness will be more gentle.
[0091] This method ensures that the local adaptation output can be appropriately mapped according to the different scene contents. In dark scenes, the visibility of details in the dark areas can be increased, while in bright scenes, overexposure can be avoided and the details in the bright areas can be maintained. In this way, the image processing algorithm can better adapt to different scene conditions and improve the image quality. And the purpose of this factor is to correct the brightness deviation: in different detection scenes, the brightness of the image may change for various reasons, and the adaptive non-linear offset factor can be automatically adjusted according to the actual situation to make the overall brightness of the image closer to the real situation; protect the details in the dark areas: for low-brightness areas, appropriate offset can prevent these areas from becoming too dark and losing key information; avoid overexposure, and the dark areas are areas with low signal intensity, usually areas with large attenuation: similarly, in high-brightness areas, reasonable offset can help prevent the loss of details caused by too high brightness; and intelligent mapping intensity: two adaptive coefficients are introduced, allowing the algorithm to intelligently adjust the mapping intensity according to the image content, further enhancing the flexibility and adaptability of image processing.
[0092] The common goals of the two factors are: to optimize the visual effect of the image, so that the finally generated image can maintain good contrast and brightness balance globally and highlight important details locally; by calculating and applying these two factors in an automated way, the need for manual adjustment by users is reduced and the processing efficiency is improved; and in fields such as medical diagnosis and industrial flaw detection, such technology can ensure that the image quality meets professional requirements and can flexibly cope with imaging challenges under various complex conditions.
[0093] Example 4
[0094] In addition, this method can also use a deep learning model to extract key features from the enhanced compressed image, aiming to identify and quantify important visual attributes in the image, such as contrast, sharpness, noise level, etc., and these features will be used as the basis for subsequent quality assessment;
[0095] Specifically, a pre-trained convolutional neural network (CNN), such as the ResNet model, can be selected. It should be noted that in the pre-training process of the ResNet model, high-quality ultrasound images without noise are generated through the COMSOL simulation software. Then, the simulation data is input into the ResNet model for training to complete the pre-training. Then, the last layer or the last few layers of the selected model are used as feature extractors to obtain high-dimensional feature vectors, which capture the spatial structure and semantic information of the images. Finally, according to the specific task requirements, custom layers, such as fully connected layers and pooling layers, can be added on the basis of the pre-trained model to further refine the feature representation;
[0096] The specific extraction process of key features includes:
[0097] 1) Ensure that all input images have the same resolution, that is, usually scale the images to the input size expected by the model;
[0098] 2) Normalize the image pixel values to [0, 1];
[0099] 3) If the original image is a grayscale image and the CNN model requires RGB input, a pseudo-color image can be constructed by copying the grayscale channel; vice versa;
[0100] 4) To increase the generalization ability of the model, operations such as random cropping, flipping, and rotation can be applied during the training phase, but keep the original during inference;
[0101] 5) Download and load the pre-trained weights of the selected model, ensuring that only the convolutional layer part is used, excluding the top classifier;
[0102] 6) Create a PyTorch model instance that only contains the convolutional layers in the original model. The activation output before the last convolutional layer can be selected to be retained as the feature representation, which is usually the most informative part; and the PyTorch model is as follows:
[0103] import torch
[0104] from torchvision import models, transforms
[0105] # Load the pre-trained ResNet model and remove the classifier part
[0106] model = models.resnet50(pretrained=True)
[0107] modules = list(model.children())[:-1]# Remove the last fully connected layer
[0108] feature_extractor = torch.nn.Sequential(*modules)
[0109] # Set to evaluation mode
[0110] feature_extractor.eval()
[0111] # Define the preprocessing transformation
[0112] preprocess = transforms.Compose(
[0113] transforms.Resize((224, 224)),
[0114] transforms.ToTensor(),
[0115] transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224,0.225]), )
[0117] # Feature extraction function
[0118] def extract_features(image):
[0119] # Preprocess the image
[0120] input_tensor = preprocess(image).unsqueeze(0) # Add a batch dimension
[0121] with torch.no_grad(): # Disable gradient calculation
[0122] features = feature_extractor(input_tensor)
[0123] return features.flatten().numpy() # Flatten the features into a one-dimensional array
[0124] # Example call
[0125] # image is a PIL.Image object
[0126] features = extract_features(image)
[0127] 7) Input the preprocessed image into the newly constructed feature extractor, perform forward propagation calculation, and obtain the feature vectors corresponding to each image. These feature vectors contain rich spatial structure and semantic information;
[0128] 8) Use the principal component analysis (PCA) technique to reduce the dimension for better visualization or to simplify subsequent calculations;
[0129] 9) Normalize the feature vectors again to ensure the comparability of the eigenvalues between different images.
[0130] Based on the key features, calculate the quality score for each frame of the image; by synthesizing multiple key features, assign a quality score to each frame of the image to facilitate quantifying the overall performance of the image;
[0131] First, establish a quality evaluation system suitable for the application scenario. For example, it can include the weight configuration of multiple dimensions such as contrast, clarity, and noise level; then, multiply each eigenvalue by its corresponding weight and sum them to obtain the final quality score, which can be completed through simple linear combination or mapped using more complex non-linear functions;
[0132] In addition, to enhance the intelligence of quality assessment, train a supervised learning model, such as a support vector machine (SVM), random forest (RF), or regression model. This supervised learning model can learn the difference patterns between high-quality images and low-quality images based on historical data and predict the quality score of new images accordingly;
[0133] Judge whether the enhanced compressed image is reasonable according to the quality score; determine whether the current image processing result meets the expected standard, thereby determining whether to further adjust the parameters. One or more quality score thresholds can be preset to distinguish between "reasonable" and "unreasonable" images, and these thresholds can be flexibly adjusted according to the actual application requirements;
[0134] After that, by comparing the calculated quality score with the set threshold, if the score is higher than the threshold, the image is considered reasonable; otherwise, it is regarded as unreasonable;
[0135] If it is unreasonable, adjust the Gamma correction parameter, contrast enhancement factor, and adaptive non-linear offset factor, and recalculate the enhanced compressed image; that is, when the image quality does not meet the standard, automatically adjust the relevant parameters to optimize the image effect until a satisfactory level is reached;
[0136] where the Gamma correction parameter When adjusting according to the overall brightness of the image, if the image is too dark, reduce value to increase the brightness; if the image is too bright, then increase value to reduce the brightness;
[0137] Contrast enhancement factor Adjustment: For the case where the contrast of a local area is too low, appropriately increase the contrast control parameter to make the difference between different gray levels more obvious;
[0138] Adaptive non-linear offset factor : Adjust the offset factor according to the characteristics of the brightness distribution in the image to ensure that the dark area is not too dark and the bright area is not overexposed;
[0139] If reasonable, output a reasonable enhanced compressed image, that is .
[0140] Example 5
[0141] As shown in the attached Figure 2 An ultrasonic image dynamic range compression processing system, including a data acquisition module, a processing module, an output module and a feedback analysis module;
[0142] The data acquisition module is used to acquire the original A-Scan data with high dynamic range and convert it into a two-dimensional matrix;
[0143] The processing module includes a preprocessing unit, a preliminary compression unit and an enhancement unit, where the preprocessing unit is used to preprocess the original A-Scan data, the preliminary compression unit uses the Gamma correction algorithm to perform preliminary compression on the preprocessed data, and the enhancement unit enhances the preliminary compressed image data;
[0144] The output module is used to output the enhanced image data;
[0145] The feedback analysis module is used to analyze whether the enhanced image data meets the expected standard, and when it does not meet the expected standard, it can adjust the Gamma correction parameters of the preliminary compression unit, as well as the contrast enhancement factor and the adaptive non-linear offset factor of the enhancement unit.
[0146] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An ultrasonic image dynamic range compression processing method, characterized in that: Including: Obtain the original A-Scan data with high dynamic range and convert it into two-dimensional matrix data; The ultrasonic echo signal received by the ultrasonic board card generates the original A-Scan data with high dynamic range through an analog-to-digital converter, and then uses a gate to select the effective signal area, and integrates multiple A-Scan data into two-dimensional matrix data for imaging; Preprocess the two-dimensional matrix data to obtain standard input data; Use the Gamma correction algorithm to perform non-linear brightness adjustment on the standard input data, initially compress the dynamic range of the image, and generate a compressed image after global brightness adjustment; Based on the Retinex algorithm, decompose the compressed image after global brightness adjustment, and use a guided filter to smooth the compressed image after global brightness adjustment, and decompose and generate a base layer, where the guidance image of the guided filter is obtained by median filtering the compressed image after global brightness adjustment; Introduce a contrast enhancement factor and an adaptive non-linear offset factor, and calculate a compressed enhanced image with low dynamic range in combination with the base layer; Extract key features from the enhanced compressed image using a deep learning model ; Calculate the quality score of each frame of image based on key features; Judge whether the compressed enhanced image is reasonable according to the quality score; If it is unreasonable, adjust the Gamma correction parameter, the contrast enhancement factor, and the adaptive non-linear offset factor, and recalculate the compressed enhanced image; If it is reasonable, output the reasonable compressed enhanced image.
2. The ultrasonic image dynamic range compression processing method according to claim 1, characterized in that: The preprocessing process includes grayscale processing, edge detection, and data normalization.
3. The ultrasonic image dynamic range compression processing method according to claim 2, characterized in that: The specific steps of the edge detection include: Use the Canny edge detection algorithm to identify the true contour of the workpiece; Replace the 0 pixel values outside the workpiece contour with NaN data.
4. The ultrasonic image dynamic range compression processing method according to claim 1, wherein: The contrast enhancement factor is calculated by the following formula: ; Among them, is the pixel value of the pixel point of the compressed image after global brightness adjustment; is the maximum pixel value of the pixel point of the compressed image after global brightness adjustment; is the contrast control parameter.
5. The ultrasonic image dynamic range compression processing method according to claim 4, wherein: The adaptive non-linear offset factor has the following calculation formula: ; Among them, is a non-linear control parameter; is the average value of 6. The ultrasonic image dynamic range compression processing method according to claim 5, characterized in that: The enhanced compressed image The calculation formula is as follows: ; Among them, is the base layer obtained by smoothing the compressed image after the guided filter adjusts the global brightness.
7. The ultrasonic image dynamic range compression processing method according to claim 1, characterized in that: Use a convolutional neural network to extract key features from the compressed enhanced image.
Citation Information
Patent Citations
System and method for adaptively configuring dynamic range for ultrasound image display
CN111819465A
Image enhancement method, display device and computer readable storage medium
CN107644409A
License plate image brightness processing method, device and equipment
CN110473158A
Image brightness enhancement method and device
CN113947553A