A Dynamic Range Compression Method, Device, Equipment and Medium
By adjusting the preset index and using the compression function of the target index value to process the image data collected by the ultrasonic imaging device, the problem that the image data cannot be fully displayed is solved, and the image data is fully displayed in the display and the image quality is improved.
Patent Information
- Application Number
- CN202210374094.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-04-11
AI Technical Summary
The prior art cannot compress the image data collected by ultrasonic imaging devices into the dynamic range that can be displayed by the display, resulting in unsatisfactory performance of image details and weak signals, affecting image contrast and integrity.
By obtaining the maximum and minimum values of the image data, adjust the preset index to make the difference within the preset dynamic range, the image data is processed using the target index value and the compression function to ensure that the compressed image data is fully displayed in the display.
The image data collected by ultrasonic imaging equipment is fully displayed in the display, improving the display quality and contrast of the image, and ensuring the integrity of image details.
Smart Images

Figure CN114866785B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to a dynamic range compression method, apparatus, device and medium. Background Art
[0002] Ultrasonic imaging examination is a main medical diagnosis method. Since the dynamic range of the human echo signals collected by an ultrasonic system is very large and it is difficult to display on a conventional display, a dynamic range compression method is used to transform the data range into a range that can be displayed on the display. In an ultrasonic system, a dynamic range compression method is usually used to reduce the dynamic range of the collected image data so that it can be displayed on the display of the ultrasonic imaging device.
[0003] Since it is necessary to quantitatively analyze the amplitude of the image data after dynamic range compression, when the prior art performs dynamic range compression on the image data, the compression function f(x)=20log10(x) is used to implement. Physically, the transformation unit of f(x)=20log10(x) is defined as dB (decibel) to represent the signal intensity, and this definition is borrowed. Specifically, the collected image data is used as the input, and the output f(x) is the image data after dynamic range compression. Figure 1 FIG. is a schematic diagram of dynamic range compression using the compression function f(x) in the prior art. In the figure, the horizontal axis is the image data before compression, and the vertical axis is the image data after dynamic range compression. Using the compression function f(x) to perform dynamic range compression on the image data, a large range of image data can be compressed into a small range. For example, the range of the image data on the horizontal axis in the figure is [0 to 10000], and through the compression function, the image data is compressed into the range of [0 to 255]. Therefore, the range of the large range of image data can be significantly reduced through this compression function, and the range of the small range of image data will not be overly reduced through the transformation of the compression function.
[0004] In the currently commonly used dynamic range compression method, due to the limitation of the data analysis method, it is impossible to change the dynamic range compression value of the image data according to different needs. Although it is generally applicable to the image data collected by most ultrasonic imaging devices, for different human organs, the amplitudes of their ultrasonic echo signals are different. Many tissues are invisible within the specified dynamic range due to weak echoes. The same method cannot perfectly meet the needs of various examination scenarios. The image contrast cannot be adjusted through the compression function, and thus an image satisfactory to the doctor cannot be obtained. That is to say, for the compression result of the image data exceeding the normal dynamic range, very small values and very large values cannot be within the expected dynamic range, resulting in unsatisfactory performance of the image detail information and weak signals. And the imaging examination is to see the complete human tissue structure as much as possible.
[0005] Then, how to compress the image data collected by an ultrasonic imaging device so that the image data after dynamic range compression can be fully displayed on the display of the ultrasonic imaging device is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0006] Embodiments of the present invention provide a dynamic range compression method, apparatus, device and medium, which are used to solve the technical problem that the existing dynamic range compression method cannot compress the image data collected by an ultrasonic imaging device into the dynamic range that can be displayed by the display of the ultrasonic imaging device, thereby affecting the display.
[0007] Embodiments of the present invention provide a dynamic range compression method, and the method includes:
[0008] Obtain the maximum value and the minimum value of the image data collected by the ultrasonic imaging device;
[0009] If the first difference of the image data processed based on the maximum value, the minimum value and a preset compression function is not within the effective interval of the preset dynamic range, determine the adjustment direction of a preset exponent, and sequentially adjust the value of the preset exponent saved in advance according to the adjustment direction until the second difference of the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the effective interval of the preset dynamic range;
[0010] Use the adjusted preset exponent corresponding to the second difference within the effective interval of the preset dynamic range as the target exponent value, and process the image data by using the target exponent value and the preset compression function.
[0011] The present application provides a dynamic range compression device, and the device includes:
[0012] An acquisition module, configured to obtain the maximum value and the minimum value of the image data collected by the ultrasonic imaging device;
[0013] A determination module, configured to determine the adjustment direction of the preset exponent based on whether the first difference of the image data processed based on the maximum value, the minimum value and the preset compression function is within the effective interval of the preset dynamic range;
[0014] An adjustment module, configured to sequentially adjust the value of the preset exponent saved in advance according to the adjustment direction until the second difference of the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the effective interval of the preset dynamic range; use the adjusted preset exponent corresponding to the second difference within the effective interval of the preset dynamic range as the target exponent value;
[0015] A compression module, configured to process the image data by using the target exponential value and the preset compression function.
[0016] The present invention provides an electronic device, which at least includes a processor and a memory. When the processor executes a computer program stored in the memory, the steps of the above dynamic range compression method are implemented.
[0017] The present invention provides a computer-readable storage medium, which stores a computer program executable by an electronic device. When the program runs on the electronic device, the electronic device is caused to execute the steps of the above dynamic range compression method.
[0018] Since the present invention can determine the difference between the processed image data based on the maximum value and the minimum value of the acquired image data and the preset compression function, and adjust the preset exponent according to whether the difference is within the effective interval of the preset dynamic range, and determine the target exponential value of the preset exponent, and compress the image data by using the target exponential value and the preset compression function, the image data after dynamic range compression can be completely displayed on the display of the ultrasonic imaging device. Description of the Drawings
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for description in the embodiments. Obviously, the following described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 A schematic diagram of dynamic range compression using the compression function f(x) in the prior art;
[0021] Figure 2 A schematic diagram of the process of a dynamic range compression method provided by an embodiment of the present invention;
[0022] Figure 3a A schematic diagram of dynamic range compression using a compression function and a certain target exponential value and dynamic range compression based on the method in the prior art provided by an embodiment of the present invention;
[0023] Figure 3b A schematic diagram of dynamic range compression using a compression function and another target exponential value and dynamic range compression based on the method in the prior art provided by an embodiment of the present invention;
[0024] Figure 4aSchematic diagram of dynamic range compression using the target piecewise function corresponding to a certain target index value and the first segmentation value and dynamic range compression using the method based on the prior art provided by the embodiments of the present invention;
[0025] Figure 4b Schematic diagram of dynamic range compression using the target piecewise function corresponding to a certain target index value and the second segmentation value and dynamic range compression using the method based on the prior art provided by the embodiments of the present invention;
[0026] Figure 4c Schematic diagram of dynamic range compression using the target piecewise function corresponding to a certain target index value and the third segmentation value and dynamic range compression using the method based on the prior art provided by the embodiments of the present invention;
[0027] Figure 5 Schematic diagram of the structure of a dynamic range compression device provided by the embodiments of the present invention;
[0028] Figure 6 Schematic diagram of the structure of an electronic device provided by the embodiments of the present invention. Detailed implementation manners
[0029] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts shall fall within the protection scope of the present invention.
[0030] It should be noted that the brief description of the terms in the present invention is only for the convenience of understanding the following described embodiments, rather than intending to limit the embodiments of the present invention. Unless otherwise specified, these terms should be understood in their ordinary and general meanings.
[0031] The terms "first", "second", "third", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar or like objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that such terms can be interchanged under appropriate circumstances.
[0032] The terms "including" and "having" and any variations thereof are intended to cover but not exclusively include. For example, a product or device including a series of components does not necessarily have to be limited to all the clearly listed components, but may include other components not clearly listed or inherent to these products or devices.
[0033] The term "module" refers to any known or later-developed hardware, software, firmware, artificial intelligence, fuzzy logic, or a combination of hardware and / or software code that can perform functions related to that element.
[0034] The preferred embodiments of the present invention will be described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not used to limit the present invention. And without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0035] The embodiments of the present invention provide a dynamic range compression method, device, equipment and medium. In this method, the maximum value and the minimum value of the image data collected by an ultrasonic imaging device are obtained; if the first difference between the image data processed based on the maximum value, the minimum value and a preset compression function does not lie within the effective interval of a preset dynamic range, the adjustment direction of a preset exponent is determined, and the preset exponent pre-saved is adjusted sequentially according to the adjustment direction until the second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent of the preset compression function is within the preset dynamic range; the adjusted preset exponent corresponding to the second difference within the preset range is used as the target exponent value, and the image data is processed by using the target exponent value and the preset compression function.
[0036] Embodiment 1:
[0037] In order to compress the image data collected by an ultrasonic imaging device so that the image data after dynamic range compression can be fully displayed on the display of the ultrasonic imaging device, the embodiments of the present invention provide a dynamic range compression method, device, equipment and medium.
[0038] Figure 2 FIG. is a schematic process diagram of a dynamic range compression method provided by an embodiment of the present invention. The process includes the following steps:
[0039] S201: Obtain the maximum value and the minimum value of the image data collected by the ultrasonic imaging device.
[0040] The dynamic range compression method provided by the embodiments of the present invention is applied to an electronic device, and the electronic device can be an ultrasonic imaging device, a PC, etc.
[0041] Taking the electronic device as an ultrasonic imaging device as an example, the dynamic range compression process will be described in detail below.
[0042] Since the dynamic range of the image data collected by the ultrasonic imaging device is very large, that is, the difference between the maximum value and the minimum value in the image data is very large, it is difficult to fully display the image data on the display of the ultrasonic imaging device. In a possible implementation, a method of dynamic range compression is used to narrow the dynamic range of the image data so that it can be fully displayed on a display with a low dynamic range. Therefore, in order to determine whether the compressed image data can be fully displayed on the display, the maximum value and the minimum value of the image data collected by the ultrasonic imaging device can be obtained. Specifically, the minimum value in the obtained image data can be denoted as x0, and the maximum value in the obtained image data can be denoted as x2.
[0043] S202: If the first difference between the image data processed based on the maximum value, the minimum value and the preset compression function is not within the effective interval of the preset dynamic range, determine the adjustment direction of the preset exponent.
[0044] In order to determine whether to adjust the preset exponent for compression, a compression function is preset in the embodiment of the present invention. This compression function can be a compression function in the prior art, that is, the preset compression function can be f(x) = 20log 10 (x). By using the preset compression function and the maximum value of the image data, the maximum value of the compressed image data can be determined. By using this compression function and the minimum value of the image data, the minimum value of the compressed image data can be determined, and the first difference between the maximum value of the compressed image data and the minimum value of the compressed image data can be determined.
[0045] In order to determine whether the image data after dynamic compression of the image data can be fully displayed on the display of the ultrasonic imaging device, the dynamic range of the display can be obtained, and the effective interval of the dynamic range can be determined according to the dynamic range. This effective interval is determined by the dynamic range that can be displayed by the display and a preset threshold. Only when it does not exceed the dynamic range that can be displayed by the display and the difference from the dynamic range is less than the set threshold, can the image data after dynamic range compression be accurately and fully displayed on the display. Specifically, the dynamic range is the difference between the maximum display value and the minimum display value, that is to say, the dynamic range is a specific value.
[0046] Therefore, after determining the first difference and the effective interval of the preset dynamic range, if the first difference is within the effective interval of the preset dynamic range, it is determined that the current image data can be fully displayed on the display of the ultrasonic imaging device after compression. If it is not within the effective interval of the preset dynamic range, it is determined that the current image data cannot be fully displayed on the display of the ultrasonic imaging device after compression. At this time, it is necessary to determine the adjustment direction of the preset exponent according to the first difference and the effective interval, that is, whether to increase or decrease the preset exponent.
[0047] S203: Adjust the value of the preset exponent saved in advance in accordance with the adjustment direction in sequence until the second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted value of the preset exponent of the preset compression function is within the effective interval of the preset dynamic range, and use the value of the adjusted preset exponent corresponding to the second difference within the effective interval of the preset dynamic range as the target exponent value.
[0048] In the embodiment of the present invention, in order to compress the image data into the dynamic range that can be displayed by the display of the ultrasonic imaging device, so that the image data after dynamic range compression can be completely displayed on the display of the ultrasonic imaging device, it is necessary to adjust the value of the preset exponent to determine the target exponent value. After determining the adjustment direction, adjust the value of the preset exponent saved in advance in accordance with this adjustment direction in sequence. According to the value of the preset exponent after each adjustment, and based on the preset compression function, as well as the maximum value and the minimum value of the obtained image data, respectively determine the maximum value of the obtained image data after being processed by the preset compression function with the adjusted value of the preset exponent as the exponent, and the minimum value of the obtained image data after being processed by the preset compression function with the adjusted value of the preset exponent as the exponent, and determine the second difference between the maximum value of the processed image data and the minimum value of the processed image data, and determine whether the second difference is within the effective interval of the preset dynamic range. If so, determine that the adjustment of the preset exponent ends, and use the adjusted value of the preset exponent as the target exponent value; otherwise, continue to adjust the value of the preset exponent according to the preset adjustment direction until it is determined that the second difference is within the effective interval of the preset dynamic range. The value of the preset exponent saved in advance can be configured, and in the embodiment of the present invention, the value of the preset exponent saved in advance can be 1.
[0049] Specifically, before adjusting the value of the preset exponent according to the adjustment direction, the value of the preset exponent in each adjustment direction can be saved in advance and sorted in descending or ascending order according to the value of the preset exponent. When adjusting the value of the preset exponent according to the adjustment direction, each value can be sequentially selected as the adjusted value of the preset exponent according to the adjustment direction.
[0050] S204: Process the image data by using the target exponent value and the preset compression function.
[0051] After the target index value is determined currently, the dynamic range of the image data can be compressed according to the target index value and a preset compression function, and the image data after the dynamic range compression is determined. Then, the compressed image data is used to replace the image data, thereby solving the problem affecting the display.
[0052] Specifically, if the preset compression function is f(x) = 20log 10 (x), then when processing the image data in the image according to the target index value and the preset compression function, specifically, the compression function with the preset index value as the exponent is used to process the image data in the image. It can be considered that the image data is processed according to g(x, y) = f(x)y, where y is the preset exponent, which is used to adjust the compression rate of the compression function. As an exponential function, which is a proportional transformation function, the scaling of the base can be achieved by changing the exponential term, and the scaling rate depends on the value of the exponent. Therefore, when the preset exponent y is greater than 1, the numerical dynamic range of f(x) will be enlarged, and the compression rate of f(x) will be reduced; when the preset exponent y is between 0 and 1, the numerical dynamic range of f(x) will be reduced, and the compression rate of f(x) will be increased; when the preset exponent y is equal to 1, the original compression rate of f(x) will be maintained.
[0053] Figure 3a FIG. is a schematic diagram of dynamic range compression using a compression function and a certain target index value provided by an embodiment of the present invention and dynamic range compression based on the prior art method. Figure 3b FIG. is a schematic diagram of dynamic range compression using a compression function and another target index value provided by an embodiment of the present invention and dynamic range compression based on the prior art method.
[0054] Figure 3a The curve located above (up and down in the figure) is the curve of dynamic range compression of the image data using the compression function f(x) and the preset exponent when the target index value of the preset exponent is 0.5, that is, the curve of dynamic range compression of the image data using g(x, y) = f(x) y The curve of dynamic range compression of the image data. The curve located below (up and down in the figure) is the curve of dynamic range compression of the image data using the compression function f(x) in the prior art. The horizontal axis is the image data before dynamic range compression, and the vertical axis is the image data after dynamic range compression. As Figure 3a shown, the curve of dynamic range compression using the compression function f(x) with an exponent of 0.5 is more convex upward than the curve of dynamic range compression using the compression function f(x), that is, the curvature of the curve is greater, which means the compression rate is higher. Taking any section intercepted from the horizontal axis, it can be seen that for the corresponding vertical axis parts of the two curves, the range of the compressed image data corresponding to the curve of dynamic range compression using the compression function f(x) with an exponent of 0.5 is smaller, that is, the image data is compressed into a smaller dynamic range.
[0055] Figure 3b The curve located above (up and down in the figure) is the curve for dynamically compressing image data using the compression function f(x) in the prior art. The curve located below (up and down in the figure) is the curve for dynamically compressing image data using the compression function f(x) and a preset exponent when the target exponent value of the preset exponent is 2, that is, using g(x, y) = f(x) y to perform dynamic range compression on the image data. As Figure 3b can be seen, the curve for dynamic range compression using the compression function f(x) is more convex upward than the curve for dynamic range compression using the compression function with an exponent of 2. That is, the curvature of the curve for dynamic range compression using the compression function with an exponent of 2 is smaller, which means the compression rate is lower. Arbitrarily intercepting a section from the horizontal axis can show that for the corresponding vertical axis parts of the two curves, the vertical axis part corresponding to the curve for dynamic range compression using the compression function f(x) with an exponent of 2 is longer, that is, the range of the compressed image data is larger, so that the image data is compressed into a larger dynamic range.
[0056] As an exponential function, a proportional transformation function can achieve the scaling of the base by changing the exponential term, and the scaling rate depends on the value of the exponent. Therefore, when the target exponent value of the preset exponent is between 0 and 1, the numerical dynamic range of f(x) will be reduced, and the compression rate of f(x) will be increased; when the target exponent value of the preset exponent is greater than 1, the numerical dynamic range of the compression function f(x) will be enlarged, and the compression rate of f(x) will be reduced. For the smaller part of the image data, a lower compression rate should be used for compression so that the smaller image data will not be too small after compression, resulting in unclear display; for the larger part of the image data, a higher compression rate should be used for compression so that the larger image data will not exceed the dynamic range that can be displayed by the ultrasonic imaging device after compression, and the entire image can be fully displayed on the display of the ultrasonic imaging device. In the embodiments of the present invention, by reasonably determining the adjustment direction of the preset exponent and reasonably adjusting the compression rate, effective dynamic range compression can be ensured.
[0057] In an embodiment of the present invention, based on whether the first difference between the maximum value and the minimum value of the image data and the image data processed by a preset compression function is within a preset effective dynamic range interval, the adjustment direction of a preset exponent is determined; the value of the preset exponent stored in advance is adjusted sequentially according to this adjustment direction until the second difference corresponding to the maximum value and the minimum value after the image data is adjusted according to the adjusted value of the preset exponent and the preset compression function is within the preset effective dynamic range interval, and the preset exponent is determined as the target exponent value. Using the target exponent value and the preset compression function to perform dynamic range compression on the image data can compress the image data into the dynamic range that can be displayed by the display of the ultrasonic imaging device, so that the image can be fully displayed.
[0058] Embodiment 2:
[0059] In order to display the image data in the dynamic range that the user is interested in more fully, on the basis of the above embodiment, in an embodiment of the present invention, before using the target exponent value and the preset compression function to process the image data, the method includes:
[0060] Receiving at least one input segmentation value and the corresponding segmentation dynamic range for each segmentation interval, where the sum of the segmentation dynamic ranges is equal to the dynamic range;
[0061] According to each segmentation interval, the maximum value and the minimum value of the interval corresponding to the segmentation interval, and the numerical value processed by the preset piecewise function including the compression function using the target exponent value corresponding to the segmentation value and the corresponding segmentation dynamic range, determining the target piecewise function corresponding to each segmentation interval;
[0062] The step of using the target exponent value and the preset compression function to process the image data includes:
[0063] According to the image data, determining the segmentation interval to which the image data belongs, and using the target piecewise function corresponding to the segmentation interval to process the image data.
[0064] In order to determine the segmentation interval corresponding to each segmentation dynamic range, in an embodiment of the present invention, the ultrasonic imaging device can receive the input segmentation value corresponding to each segmentation interval. The input segmentation value can be at least one. If it is one, the range of the image data is divided into two segmentation intervals. If it is two, the range of the image data is divided into three segmentation intervals.
[0065] Since the maximum and minimum values of the image data in the image can be obtained, each segmentation interval can be obtained according to each received segmentation value. Each segmentation interval has a piecewise function of the target exponential value of the corresponding compression function. However, some parameters in this piecewise function are unknown. This piecewise function is a linear function with the target exponential value as the exponent of the compression function. In addition, in order to facilitate the determination of the target piecewise function corresponding to each segmentation interval, in the embodiments of the present invention, the segmentation dynamic range corresponding to each received segmentation interval can also be received. The segmentation dynamic range is each range obtained by dividing the dynamic range, and the sum of the segmentation dynamic ranges is equal to the dynamic range. For example, if the dynamic range is 100 and it is divided into two segmentation intervals, the segmentation dynamic ranges corresponding to each segmentation interval can be 40 and 60 respectively.
[0066] Since each segmentation dynamic range is determined, although the piecewise function of the target exponential value of the compression function corresponding to each segmentation interval contains unknown parameters, and the maximum value and minimum value of each segmentation interval are also determined. Therefore, after compression using the corresponding segmentation function based on the maximum value and minimum value of each segmentation interval, it should be the same as the segmentation dynamic range corresponding to each segmentation interval. In addition, since each segmentation value is within two segmentation intervals, in order to ensure the continuity of image data compression, that is, no matter in which segmentation interval, after processing the segmentation value using the corresponding segmentation function, the processed image data should be the same. Therefore, the target segmentation function of each segmentation interval can also be determined according to each segmentation value in its corresponding segmentation interval and the piecewise function corresponding to this segmentation interval.
[0067] In order to accurately determine the target piecewise function corresponding to each segmentation interval, based on the above embodiments, in the embodiments of the present invention, the determining the target piecewise function corresponding to each segmentation interval according to each segmentation interval, the maximum value and minimum value of this segmentation interval, and the piecewise function of each compression function using the target exponential value for the processed value corresponding to the segmentation value and the corresponding segmentation dynamic range includes:
[0068] For each segmentation interval, according to the maximum value of this segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to this segmentation interval, determine the maximum range value; according to the minimum value of this segmentation interval and the piecewise function of the compression function corresponding to this segmentation interval using the target exponential value, determine the minimum range value, and construct a first equation according to the difference between the maximum range value and the minimum range value and the segmentation dynamic range corresponding to this segmentation interval;
[0069] Construct a second equation for the processed image data corresponding to the segmentation value according to the segmentation value and the corresponding piecewise function;
[0070] Determine the maximum processing value according to the piecewise function corresponding to the maximum value and the segmentation interval to which it belongs, determine the minimum processing value according to the piecewise function corresponding to the minimum value and the segmentation interval to which it belongs, and construct a third equation according to the difference between the maximum processing value and the minimum processing value and the preset dynamic range;
[0071] Determine the target piecewise function corresponding to each segmentation interval according to the first equation, the second equation and the third equation.
[0072] In the embodiments of the present invention, since each segmentation interval corresponds to a piecewise function of the target exponential value of its corresponding compression function, and this piecewise function is a linear function of the target exponential value of the compression function, the piecewise function corresponding to each segmentation interval can be expressed as: p(x, y) = a i *g(x, y) + a j , where g(x, y) = f(x) y , f(x) is the compression function, y is the preset exponent in the embodiments of the present invention. Since the target exponential value is determined, there are only a i and a j as unknowns at this time. Among them, the a i and a j corresponding to different segmentation intervals are different. As long as a i and a j are determined, the target piecewise function of the segmentation interval is determined.
[0073] For example, if there is a segmentation value x1, the piecewise function corresponding to each segmentation interval can be expressed as follows: g(x, y) = f(x) y , f(x) is the compression function. To determine the target piecewise function of the first segmentation interval x0 ≤ x ≤ x1, the values of a1 and a2 need to be determined. To determine the target piecewise function of the second segmentation interval x1 ≤ x ≤ x2, the values of a3 and a4 need to be determined.
[0074] Since each segmentation interval is determined, for each segmentation interval, the maximum range value of the segmentation interval can be determined according to the interval maximum value of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval, and the minimum range value of the segmentation interval can be determined according to the interval minimum value of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval. The difference between the maximum range value and the minimum range value should be equal to the segmentation dynamic range corresponding to the segmentation interval. At this time, the first equation can be constructed.
[0075] Specifically, from the above piecewise function, it can be known that the maximum value of the first segmentation interval is x1, and the piecewise function corresponding to this first segmentation interval is p(x, y) = a1*g(x, y) + a2. According to x1 and this piecewise function, the maximum range value of this first segmentation interval can be obtained as X1; from the above piecewise function, it can be known that the minimum value of the first segmentation interval is x0, and the piecewise function corresponding to this first segmentation interval is p(x, y) = a1*g(x, y) + a2. According to x0 and this piecewise function, the minimum range value of this first segmentation interval can be obtained as X0; the segmentation dynamic range corresponding to this first segmentation interval can be section_range1. Based on the difference between this maximum range value and this minimum range value and the segmentation dynamic range corresponding to this first segmentation interval, a first equation can be constructed, that is, X1 - X0 = section_range1. Correspondingly, based on the second segmentation interval, a first equation can also be constructed, which can be expressed as X2 - X1 = section_range2.
[0076] Since the segmentation value is located within both segmentation intervals, regardless of which segmentation interval the segmentation value is in, after being compressed by the piecewise function corresponding to each segmentation interval, the corresponding compressed image data should be equal. At this time, a second equation can be constructed.
[0077] Specifically, from the above piecewise function, it can be known that the segmentation value is x1, and this segmentation value is located within both the first segmentation interval and the second segmentation interval. After being compressed by the piecewise functions corresponding to these two segmentation intervals respectively, the corresponding compressed image data should be equal. Therefore, based on x1 and the piecewise function p(x, y) = a1*g(x, y) + a2 of the corresponding first segmentation interval and the piecewise function p(x, y) = a3*g(x, y) + a4 of the second segmentation interval, a second equation is constructed, that is, a1*g(x1, y) + a2 = a3*g(x1, y) + a4.
[0078] Where the y value is the target exponential value determined in the above embodiment.
[0079] Since the maximum value and the segmentation interval to which the maximum value belongs, the minimum value and the segmentation interval to which the minimum value belongs are determined, and the preset dynamic range is also determined. The maximum value and the minimum value are respectively compressed by the corresponding piecewise functions to obtain their corresponding maximum processed value and minimum processed value after compression. The difference between this maximum processed value and this minimum processed value and the preset dynamic range should be equal. At this time, a third equation can be constructed.
[0080] Specifically, the maximum value is x2, and the piecewise function corresponding to the segmentation interval to which x2 belongs is p(x, y) = a3*g(x, y) + a4. According to x2 and this piecewise function, the maximum processing value is X2; the minimum value is x0, and the piecewise function corresponding to the segmentation interval to which it belongs is p(x, y) = a1*g(x, y) + a2. According to x0 and this piecewise function, the minimum processing value X0 can be obtained; this preset dynamic range can be represented by max_range. Since the difference between this maximum processing value and the minimum processing value should be equal to this preset dynamic range, a third equation can be constructed, that is, X2 - X0 = max_range.
[0081] According to this first equation, second equation, and third equation, the values of a1 and a2, and a3 and a4 can be determined, and then the target piecewise function corresponding to each segmentation interval can be determined.
[0082] Exemplarily, this piecewise function can be expressed as: The segmentation value x1 = x0*scale, where scale is the determination parameter of this segmentation value. By default, this determination parameter can be 0.5, f(x) = 20log 10 (x), g(x, y) = f(x) y . Different piecewise functions have the same processed image data value at the segmentation value. By means of the parameter a i the curvature of the curve of the piecewise function can be adjusted. After being segmented by the segmentation value x1, the image data less than and greater than this segmentation value will be transformed by piecewise functions with different curvatures, so that the image data in different segmentation intervals can adopt different compression ratios, and thus the image data in the dynamic range of interest to the user can be displayed more fully.
[0083] When there are more than two segmentation values, because the interval minimum value in the smaller segmentation interval and the segmentation function corresponding to this smaller segmentation interval in each adjacent two segmentation intervals can be used to determine an intermediate minimum range value, and according to the maximum value in a larger segmentation interval and the segmentation function corresponding to this larger segmentation interval, an intermediate maximum range value can be determined. The difference between this intermediate maximum range value and the intermediate minimum range value should be equal to the sum value of the segmentation dynamic ranges corresponding to these two segmentation intervals, that is, a third equation can be constructed for each two adjacent segmentation intervals, so as to facilitate the determination of the target piecewise function.
[0084] For example, the maximum value of the image data is x3, and the minimum value is x0. Two segmentation values x1 and x2 are received, and the obtained segmentation intervals are the first segmentation interval x0 - x1, the second segmentation interval x1 - x2, and the third segmentation interval x2 - x3. According to the above description, it can be known that each segmentation interval corresponds to a piecewise function, and there are 2 unknowns in each piecewise function. Based on the interval maximum value and interval minimum value of each segmentation interval, and the piecewise function corresponding to the segmentation interval, a first equation can be constructed respectively, that is, a total of 3 first equations can be constructed. According to the continuity of different piecewise functions at the segmentation value, a second equation can be constructed. That is, according to the characteristic that the image data processed by the piecewise function corresponding to the first segmentation interval with x1 is equal to the image data processed by the piecewise function corresponding to the second segmentation interval with x1, a second equation can be constructed. Correspondingly, according to the characteristic that the image data processed by the segmentation functions corresponding to the second and third segmentation intervals with x2 is equal, a second equation can be constructed. Based on the interval minimum value of the first segmentation interval and the piecewise function corresponding to the first segmentation interval, the intermediate minimum processing value can be obtained. Similarly, based on the interval maximum value of the second segmentation interval and the piecewise function corresponding to the second segmentation interval, the intermediate maximum processing value can be obtained. The difference between the intermediate maximum processing value and the intermediate minimum processing value should be equal to the sum of the segmentation ranges corresponding to these two segmentation intervals. Similarly, based on the interval minimum value of the second segmentation interval and the interval maximum value of the third segmentation interval, a third equation can also be constructed. Another third equation can also be constructed based on the difference between the image data processed by the corresponding segmentation functions of the minimum value and the maximum value should be equal to the preset dynamic range. Based on each equation constructed above, the target piecewise function corresponding to each segmentation interval can be determined.
[0085] The determination process of the target piecewise function when there are more segmentation values is similar to the above process and will not be elaborated here.
[0086] Figure 4a This is a schematic diagram of dynamic range compression using the target piecewise function corresponding to a certain target exponential value and the first segmentation value and dynamic range compression based on the method of the prior art provided by the embodiment of the present invention; Figure 4b This is a schematic diagram of dynamic range compression using the target piecewise function corresponding to a certain target exponential value and the second segmentation value and dynamic range compression based on the method of the prior art provided by the embodiment of the present invention; Figure 4c This is a schematic diagram of dynamic range compression using the target piecewise function corresponding to a certain target exponential value and the third segmentation value and dynamic range compression based on the method of the prior art provided by the embodiment of the present invention.
[0087] Figure 4aThe curve located above (up and down in the figure) is the curve obtained by performing dynamic range compression on the image data using each target piecewise function determined by the first segmentation value determined by a preset exponent with a target exponent value of 0.5 and a determination parameter of 0.5. The curve located below (up and down in the figure) is the curve obtained by performing dynamic range compression on the image data using the compression function f(x) of the prior art. Figure 4b The curve obtained by performing dynamic range compression on the image data using each target piecewise function determined by the second segmentation value determined by a preset exponent with a target exponent value of 0.5 and a determination parameter of 2 almost coincides with the curve obtained by performing dynamic range compression on the image data using the compression function f(x) of the prior art. Figure 4c The curve located above (up and down in the figure) is the curve obtained by performing dynamic range compression on the image data using the compression function f(x) of the prior art. The curve located below (up and down in the figure) is the curve obtained by performing dynamic range compression on the image data using each target piecewise function determined by the third segmentation value determined by a preset exponent with a target exponent value of 0.5 and a determination parameter of 4. In the figure, the horizontal axis is the image data before dynamic range compression, and the vertical axis is the image data after dynamic range compression.
[0088] As Figure 4a , Figure 4b , Figure 4c and Figure 3a show, it can be seen that in Figure 3aBased on this, by changing the value of the determination parameter scale, the value of the segmentation value x1 can be changed, and the curvature of the curves of different piecewise functions in different data intervals can be changed. When the value of the determination parameter scale changes from small to large, the curvature of the piecewise function curve gradually decreases on the basis of the curve of dynamically compressing the image data using the preset compression function and the target exponent, that is, the compression rate of dynamically compressing the image data continuously decreases, and different segmentation intervals still remain smoothly connected. The dynamic range compression of the image data in different segmentation intervals is realized with different compression rates. Because only by compressing the smaller part of the image data with a lower compression rate can the smaller image data not be too small after compression, resulting in unclear display; by compressing the larger part of the image data with a higher compression rate, the larger image data after compression will not exceed the dynamic range that can be displayed by the ultrasonic imaging device, so that the entire image can be completely displayed on the display of the ultrasonic imaging device. Because suitable compression rates are used for image data of different range sizes, the compressed image data can be better displayed on the display of the ultrasonic system. In the embodiment of the present invention, by segmenting the image data and adjusting the determination parameter of the corresponding segmentation interval according to the input segmentation dynamic range, and then adjusting the compression rate of the corresponding segmentation interval, the image data in different segmentation intervals can be compressed with different and more suitable compression rates for the segmentation interval, so that the image data in the dynamic range of interest to the user is more fully displayed, and different segmentation intervals after compression still remain smoothly connected.
[0089] Embodiment 3:
[0090] In order to compress the image data into the dynamic range that can be displayed by the ultrasonic imaging device, so that the image data after dynamic range compression can be completely displayed relatively clearly on the display of the ultrasonic imaging device. On the basis of the above embodiments, in the embodiment of the present invention, the determination of the adjustment direction of the preset exponent includes:
[0091] If the first difference between the maximum value and the minimum value is greater than the preset dynamic range, the adjustment direction corresponding to the preset exponent is to decrease;
[0092] If the first difference between the maximum value and the minimum value is less than the preset dynamic range, and the difference from the preset dynamic range is greater than the set threshold, the adjustment direction corresponding to the preset exponent is to increase.
[0093] In an embodiment of the present invention, the adjustment direction of the preset exponent is determined by judging the corresponding relationship between the first difference and the preset dynamic range. If the first difference calculated by the preset compression function for the maximum value and the minimum value is greater than the preset dynamic range, it indicates that the image data after dynamic compression of the image data according to the compression function cannot be fully displayed on the display of the ultrasonic imaging device. Then, the preset exponent can be adjusted based on the saved value of the preset exponent, and the corresponding adjustment direction is to decrease the adjustment. If the first difference calculated by the preset compression function for the maximum value and the minimum value is less than the preset dynamic range, and the difference from the preset dynamic range is greater than the set threshold, it indicates that the image data after dynamic compression of the image data according to the compression function is too small and cannot be clearly and fully displayed on the display of the ultrasonic imaging device. Then, the preset exponent can be adjusted based on the saved value of the preset exponent, and the corresponding adjustment direction is to increase the adjustment.
[0094] Embodiment 4:
[0095] In order to compress the image data into the dynamic range that can be displayed by the ultrasonic imaging device, so that the image data after dynamic range compression can be more accurately and fully displayed on the display of the ultrasonic imaging device. On the basis of the above embodiments, in an embodiment of the present invention, the sequentially adjusting the preset exponent saved in advance according to the adjustment direction includes:
[0096] Sequentially adjusting the preset exponent saved in advance according to the adjustment direction and the preset step size.
[0097] In an embodiment of the present invention, in order to compress the image data more accurately into the dynamic range of interest, a step size can be preset, and the preset exponent saved in advance is sequentially adjusted according to the adjustment direction and the preset step size. For example, the preset step size can be 0.1.
[0098] Embodiment 5:
[0099] In order to compress the image data into the dynamic range that can be displayed by the ultrasonic imaging device, so that the image data after dynamic range compression can be fully displayed on the display of the ultrasonic imaging device. On the basis of the above embodiments, in an embodiment of the present invention, determining whether the first difference of the image data processed by the maximum value, the minimum value and the preset compression function is not within the effective interval of the preset dynamic range includes:
[0100] Based on the maximum value and the preset compression function, determine the maximum value of the processed image data;
[0101] Based on the minimum value and the preset compression function, determine the minimum value of the processed image data;
[0102] Determine a first difference between the maximum value and the minimum value of the processed image data;
[0103] Determine whether the difference between the first difference and the preset dynamic range does not exceed a preset threshold;
[0104] If so, and the first difference does not exceed the preset dynamic range, determine that the first difference is within the valid interval of the preset dynamic range; otherwise, determine that the first difference is not within the valid interval of the preset dynamic range.
[0105] In the embodiments of the present invention, in order to compress the acquired image data into the dynamic range that can be displayed by the display of the ultrasonic imaging device, so that the image data after dynamic range compression can be completely and relatively clearly displayed on the display of the ultrasonic imaging device, the dynamic range that can be displayed by the display of the ultrasonic imaging device can be obtained in advance as the preset dynamic range, and the valid interval of this dynamic range can be determined according to this dynamic range. This valid interval is determined by the dynamic range that can be displayed by this display and a preset threshold. Only when it does not exceed the dynamic range that can be displayed by this display and the difference from this dynamic range is less than the set threshold, can the image data after dynamic range compression be accurately and completely displayed on this display. Wherein the size of the preset dynamic range is determined by the ability of the display of the ultrasonic imaging device.
[0106] Determine the difference between the maximum value and the minimum value of the processed image data obtained by processing the maximum value and the minimum value through the preset compression function as the first difference, and determine whether the first difference is within the valid interval of the preset dynamic range by judging the size of the difference between the first difference and the preset dynamic range and the preset threshold. Specifically, if the difference between the first difference and the preset dynamic range does not exceed the preset threshold and the first difference does not exceed the preset dynamic range, then the first difference is within the valid interval of the preset dynamic range; if the difference between the first difference and the preset dynamic range is greater than the preset threshold, then the first difference is not within the valid interval of the preset dynamic range.
[0107] Embodiment 6:
[0108] Figure 5 The following is a schematic structural diagram of a dynamic range compression device provided by an embodiment of the present invention. The device includes:
[0109] An acquisition module 501, configured to acquire the maximum value and the minimum value of the image data acquired by the ultrasonic imaging device;
[0110] A determination module 502, configured to determine an adjustment direction for a preset exponent according to whether a first difference between image data processed based on the maximum value, the minimum value, and a preset compression function is within a valid interval of a preset dynamic range; sequentially adjust the value of the preset exponent saved in advance according to the adjustment direction until a second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the valid interval of the preset dynamic range; use the adjusted preset exponent corresponding to the second difference within the valid interval of the preset dynamic range as a target exponent value;
[0111] A compression module 503, configured to process the image data by using the target exponent value and the preset compression function.
[0112] Further, the apparatus further includes:
[0113] A receiving module 504, configured to receive at least one segmentation value and a segmentation dynamic range corresponding to each segmentation interval input, where the sum of the segmentation dynamic ranges is equal to the dynamic range;
[0114] The determination module 502 is specifically configured to determine a target piecewise function corresponding to each segmentation interval according to each segmentation interval, a maximum value of the interval, a minimum value of the interval, a numerical value processed corresponding to the segmentation value of a piecewise function of the target exponent value of each preset compression function, and the corresponding segmentation dynamic range;
[0115] The compression module 503 is specifically configured to determine a segmentation interval to which the image data belongs according to the image data, and process the image data by using the target piecewise function corresponding to the segmentation interval.
[0116] Further, the determining module 502 is specifically configured to, for each segmentation interval, determine the maximum range value according to the interval maximum value of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval; determine the minimum range value according to the interval minimum value of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval, construct a first equation according to the difference between the maximum range value and the minimum range value and the segmentation dynamic range corresponding to the segmentation interval; construct a second equation for the processed image data corresponding to the segmentation value according to the segmentation value and the corresponding piecewise function; determine the maximum processing value according to the maximum value and the piecewise function corresponding to the segmentation interval to which it belongs, determine the minimum processing value according to the minimum value and the piecewise function corresponding to the segmentation interval to which it belongs, construct a third equation according to the difference between the maximum processing value and the minimum processing value and the preset dynamic range; and determine the target piecewise function corresponding to each segmentation interval according to the first equation, the second equation, and the third equation.
[0117] Further, the determining module 502 is specifically configured to, if the first difference between the maximum value and the minimum value is greater than the preset dynamic range, the adjustment direction corresponding to the preset exponent is to decrease; if the first difference between the maximum value and the minimum value is less than the preset dynamic range and the difference from the preset dynamic range is greater than the set threshold, the adjustment direction corresponding to the preset exponent is to increase.
[0118] Further, the determining module 502 is specifically configured to sequentially adjust the preset exponent stored in advance according to the adjustment direction and the preset step size.
[0119] Further, the determining module 502 is specifically configured to determine the maximum value of the processed image data based on the maximum value and the preset compression function; determine the minimum value of the processed image data based on the minimum value and the preset compression function; determine the first difference between the maximum value of the processed image data and the minimum value of the processed image data; determine whether the difference between the first difference and the preset dynamic range does not exceed the preset threshold; if so, and the first difference does not exceed the preset dynamic range, determine that the first difference is within the effective interval of the preset dynamic range; otherwise, determine that the first difference is not within the effective interval of the preset dynamic range.
[0120] Since the present invention can determine the difference of the processed image data based on the maximum value and the minimum value of the acquired image data and a preset compression function, adjust the preset exponent according to whether the difference is within the effective interval of the preset dynamic range, and determine the target exponent value of the preset exponent, and compress the image data by using the target exponent value and the preset compression function, so that the image data after dynamic range compression can be fully displayed on the display of the ultrasonic imaging device.
[0121] Embodiment 7:
[0122] Based on the above embodiments, some embodiments of the present invention further provide an electronic device. Figure 6 The following is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 6 shown, it includes: a processor 601, a communication interface 602, a memory 603, and a communication bus 604. Among them, the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0123] The memory 603 stores a computer program. When the program is executed by the processor 401, the processor 601 is caused to execute the following steps:
[0124] Obtain the maximum value and the minimum value of the image data collected by the ultrasonic imaging device; if the first difference between the processed image data based on the maximum value, the minimum value and the preset compression function is not within the effective interval of the preset dynamic range, determine the adjustment direction of the preset exponent, and sequentially adjust the value of the preset exponent stored in advance according to the adjustment direction until the second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the effective interval of the preset dynamic range; use the adjusted preset exponent corresponding to the second difference within the effective interval of the preset dynamic range as the target exponent value, and use the target exponent value and the preset compression function to process the image data.
[0125] Further, the processor 601 is further configured to receive at least one segmentation value and the corresponding segmentation dynamic range of each segmentation interval input, where the sum of the segmentation dynamic ranges is equal to the dynamic range; according to each segmentation interval, the interval maximum value and the interval minimum value corresponding to the segmentation interval, and the processed value and the corresponding segmentation dynamic range corresponding to the segmentation value of the piecewise function of the target exponent value of each preset compression function, determine the target piecewise function corresponding to each segmentation interval; according to the image data, determine the segmentation interval to which the image data belongs, and use the target piecewise function corresponding to the segmentation interval to process the image data.
[0126] Further, the processor 601 is further configured to, for each segmentation interval, determine a maximum range value according to the interval maximum value of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval; determine a minimum range value according to the interval minimum value of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval, construct a first equation according to the difference between the maximum range value and the minimum range value and the segmentation dynamic range corresponding to the segmentation interval; construct a second equation for the processed image data corresponding to the segmentation value according to the segmentation value and the corresponding piecewise function; determine a maximum processing value according to the maximum value and the piecewise function corresponding to the segmentation interval to which it belongs, determine a minimum processing value according to the minimum value and the piecewise function corresponding to the segmentation interval to which it belongs, construct a third equation according to the difference between the maximum processing value and the minimum processing value and the preset dynamic range; and determine the target piecewise function corresponding to each segmentation interval according to the first equation, the second equation, and the third equation.
[0127] Further, the processor 601 is further configured to, if the first difference between the maximum value and the minimum value is greater than the preset dynamic range, the adjustment direction corresponding to the preset exponent is to decrease; if the first difference between the maximum value and the minimum value is less than the preset dynamic range and the difference from the preset dynamic range is greater than the set threshold, the adjustment direction corresponding to the preset exponent is to increase.
[0128] Further, the processor 601 is further configured to sequentially adjust the preset exponent stored in advance according to the adjustment direction and the preset step size.
[0129] Further, the processor 601 is further configured to determine the maximum value of the processed image data based on the maximum value and the preset compression function; determine the minimum value of the processed image data based on the minimum value and the preset compression function; determine the first difference between the maximum value of the processed image data and the minimum value of the processed image data; determine whether the difference between the first difference and the preset dynamic range does not exceed a preset threshold; if so, and the first difference does not exceed the preset dynamic range, determine that the first difference is within the effective interval of the preset dynamic range; otherwise, determine that the first difference is not within the effective interval of the preset dynamic range.
[0130] The communication bus mentioned above in the server can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity in illustration, only a thick line is used in the figure to represent it, but it does not mean that there is only one bus or one type of bus.
[0131] The communication interface 602 is used for communication between the above-mentioned electronic device and other devices.
[0132] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0133] The above-mentioned processor may be a general-purpose processor, including a central processing unit, a Network Processor (NP), etc.; it may also be a Digital Signal Processing (DSP), an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0134] Embodiment 8:
[0135] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored. When the program runs on the electronic device, the electronic device is caused to perform the following steps when executing:
[0136] Obtain the maximum value and the minimum value of the image data collected by the ultrasonic imaging device; if the first difference between the image data processed based on the maximum value, the minimum value and a preset compression function is not within the valid interval of the preset dynamic range, determine the adjustment direction of a preset exponent, and sequentially adjust the value of the preset exponent saved in advance according to the adjustment direction until the second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the valid interval of the preset dynamic range; use the adjusted preset exponent corresponding to the second difference within the valid interval of the preset dynamic range as the target exponent value, and process the image data using the target exponent value and the preset compression function.
[0137] Further, before processing the image data by using the target exponential value and the preset compression function, the method further includes:
[0138] Receiving at least one segmentation value and a segmentation dynamic range corresponding to each segmentation interval, where the sum of the segmentation dynamic ranges is equal to the dynamic range; determining a target piecewise function corresponding to each segmentation interval according to each segmentation interval, the maximum value and the minimum value of the interval corresponding to the segmentation interval, and the processed value corresponding to the segmentation value and the corresponding segmentation dynamic range of the piecewise function of the target exponential value of each preset compression function.
[0139] The processing the image data by using the target exponential value and the preset compression function includes: determining the segmentation interval to which the image data belongs according to the image data, and processing the image data by using the target piecewise function corresponding to the segmentation interval.
[0140] Further, the determining a target piecewise function corresponding to each segmentation interval according to each segmentation interval, the maximum value and the minimum value of the interval corresponding to the segmentation interval, and the processed value corresponding to the segmentation value and the corresponding segmentation dynamic range of the piecewise function of the target exponential value of each preset compression function includes:
[0141] For each segmentation interval, determining a maximum range value according to the maximum value of the interval of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval; determining a minimum range value according to the minimum value of the interval of the segmentation interval and the piecewise function of the target exponential value of the compression function corresponding to the segmentation interval, constructing a first equation according to the difference between the maximum range value and the minimum range value and the segmentation dynamic range corresponding to the segmentation interval; constructing a second equation according to the segmentation value and the piecewise function corresponding to the processed image data corresponding to the segmentation value; determining a maximum processing value according to the maximum value and the piecewise function corresponding to the segmentation interval to which it belongs, determining a minimum processing value according to the minimum value and the piecewise function corresponding to the segmentation interval to which it belongs, and constructing a third equation according to the difference between the maximum processing value and the minimum processing value and the preset dynamic range; determining a target piecewise function corresponding to each segmentation interval according to the first equation, the second equation and the third equation.
[0142] Further, the determining the adjustment direction of the preset exponent includes:
[0143] If the first difference between the maximum value and the minimum value is greater than the preset dynamic range, the adjustment direction corresponding to the preset exponent is to decrease; if the first difference between the maximum value and the minimum value is less than the preset dynamic range and the difference from the preset dynamic range is greater than the set threshold, the adjustment direction corresponding to the preset exponent is to increase.
[0144] Further, the step of sequentially adjusting the preset exponents saved in advance according to the adjustment direction includes:
[0145] Sequentially adjusting the preset exponents saved in advance according to the adjustment direction and a preset step size.
[0146] Further, determining whether the first difference of the image data processed based on the maximum value, the minimum value, and a preset compression function is not within the effective interval of the preset dynamic range includes:
[0147] Based on the maximum value and the preset compression function, determining the maximum value of the processed image data; based on the minimum value and the preset compression function, determining the minimum value of the processed image data; determining the first difference between the maximum value and the minimum value of the processed image data; determining whether the difference between the first difference and the preset dynamic range does not exceed a preset threshold; if so, and the first difference does not exceed the preset dynamic range, determining that the first difference is within the effective interval of the preset dynamic range; otherwise, determining that the first difference is not within the effective interval of the preset dynamic range.
[0148] Since the present invention can determine the difference of the processed image data based on the maximum value and the minimum value of the acquired image data and a preset compression function, adjust the preset exponent according to whether the difference is within the effective interval of the preset dynamic range, and determine the target exponent value of the preset exponent, and compress the image data by using the target exponent value and the preset compression function, so that the image data after dynamic range compression can be fully displayed on the display of the ultrasonic imaging device.
[0149] The embodiments of the present invention mainly illustrate the process in which an ultrasonic imaging device converts the collected human echo signals into the form of ultrasonic images through a series of conversions, and compresses the image data before display into the dynamic range that can be displayed by the low dynamic range display of the ultrasonic imaging device. Similarly, in a possible implementation manner, the application scenario of the present invention may not be limited to the B mode, and may be extended to modes such as color flow mode, Doppler mode, and elastography.
[0150] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0151] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0152] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0154] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.
Claims
1. A dynamic range compression method, characterized in that The method includes: Obtaining the maximum value and the minimum value of the image data collected by an ultrasonic imaging device; If the first difference between the image data processed based on the maximum value, the minimum value and a preset compression function is not within the effective interval of a preset dynamic range, determining the adjustment direction for a preset exponent, and sequentially adjusting the value of the preset exponent stored in advance according to the adjustment direction until the second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the effective interval of the preset dynamic range; Using the adjusted preset exponent corresponding to the second difference within the effective interval of the preset dynamic range as the target exponent value, and processing the image data by using the target exponent value and the preset compression function; Wherein, the determination process of the second difference includes: Based on the adjusted preset exponent value and based on the preset compression function, determining the maximum value of the image data processed by the preset compression function with the adjusted preset exponent value as the exponent, determining the minimum value of the image data processed by the preset compression function with the adjusted preset exponent value as the exponent, and determining the second difference between the maximum value and the minimum value of the processed image data; Wherein, before processing the image data by using the target exponent value and the preset compression function, the method further includes: Receiving at least one segmentation value and the segmentation dynamic range corresponding to each segmentation interval, wherein the sum of the segmentation dynamic ranges is equal to the dynamic range; According to each segmentation interval, the interval maximum value and the interval minimum value corresponding to the segmentation interval, and the segmented function of each preset compression function using the target exponent value at the processed value corresponding to the segmentation value and the corresponding segmentation dynamic range, determining the target segmented function corresponding to each segmentation interval; The processing the image data by using the target exponent value and the preset compression function includes: According to the image data, determining the segmentation interval to which the image data belongs, and processing the image data by using the target segmented function corresponding to the segmentation interval; the segmented function is a linear function of the compression function with the target exponent value as the exponent.
2. The method according to claim 1, characterized in that, The determining the target segmented function corresponding to each segmentation interval according to each segmentation interval, the interval maximum value and the interval minimum value corresponding to the segmentation interval, and the segmented function of each preset compression function using the target exponent value at the processed value corresponding to the segmentation value and the corresponding segmentation dynamic range includes: For each segmentation interval, determining the maximum range value according to the interval maximum value of the segmentation interval and the segmented function of the preset compression function using the target exponent value corresponding to the segmentation interval; determining the minimum range value according to the interval minimum value of the segmentation interval and the segmented function of the preset compression function using the target exponent value corresponding to the segmentation interval, and constructing a first equation according to the difference between the maximum range value and the minimum range value and the segmentation dynamic range corresponding to the segmentation interval; Construct a second equation for the processed image data corresponding to the segmentation value according to the segmentation value and the corresponding piecewise function. Determine the maximum processing value according to the maximum value and the piecewise function corresponding to the segmentation interval to which it belongs, determine the minimum processing value according to the minimum value and the piecewise function corresponding to the segmentation interval to which it belongs, and construct a third equation according to the difference between the maximum processing value and the minimum processing value and the preset dynamic range. Determine the target piecewise function corresponding to each segmentation interval according to the first equation, the second equation, and the third equation.
3. The method according to claim 1, wherein The determination of the adjustment direction for the preset exponent includes: If the first difference between the maximum value and the minimum value is greater than the preset dynamic range, the adjustment direction corresponding to the preset exponent is to decrease. If the first difference between the maximum value and the minimum value is less than the preset dynamic range and the difference from the preset dynamic range is greater than the set threshold, the adjustment direction corresponding to the preset exponent is to increase.
4. The method according to claim 1, characterized in that, The sequential adjustment of the preset exponent saved in advance according to the adjustment direction includes: Sequentially adjust the preset exponent saved in advance according to the adjustment direction and the preset step size.
5. The method according to claim 1, wherein Determining whether the first difference of the image data processed by the maximum value, the minimum value, and the preset compression function is not within the effective interval of the preset dynamic range includes: Determine the maximum value of the processed image data based on the maximum value and the preset compression function. Determine the minimum value of the processed image data based on the minimum value and the preset compression function. Determine the first difference between the maximum value and the minimum value of the processed image data. Judge whether the difference between the first difference and the preset dynamic range does not exceed the preset threshold. If so, and the first difference does not exceed the preset dynamic range, determine that the first difference is within the effective interval of the preset dynamic range; otherwise, determine that the first difference is not within the effective interval of the preset dynamic range.
6. A dynamic range compression device, characterized in that, The device includes: An acquisition module for acquiring the maximum value and the minimum value of the image data acquired by the ultrasonic imaging device. A determination module for determining the adjustment direction of the preset exponent according to that if the first difference of the image data processed by the maximum value, the minimum value, and the preset compression function is not within the effective interval of the preset dynamic range, sequentially adjusting the value of the preset exponent saved in advance according to the adjustment direction until the second difference between the adjusted image data corresponding to the maximum value and the minimum value determined according to the adjusted preset exponent value of the preset compression function is within the effective interval of the preset dynamic range; using the adjusted preset exponent corresponding to the second difference within the effective interval of the preset dynamic range as the target exponent value. A compression module for processing the image data by using the target exponent value and the preset compression function. The determining module is specifically configured to determine, according to the value of the adjusted preset exponent and based on the preset compression function, the maximum value of the image data processed by the preset compression function with the value of the adjusted preset exponent as the exponent, determine the minimum value of the image data processed by the preset compression function with the value of the adjusted preset exponent as the exponent, and determine the second difference between the maximum value of the processed image data and the minimum value of the processed image data; The device further includes: a receiving module, configured to receive at least one input segmentation value and the segmentation dynamic range corresponding to each segmentation interval, where the sum of the segmentation dynamic ranges is equal to the dynamic range; The determining module is specifically configured to determine, according to each segmentation interval, the maximum value and the minimum value of the interval corresponding to the segmentation interval, and the preset piecewise function of each compression function using the target exponent value, the processed value corresponding to the segmentation value and the corresponding segmentation dynamic range, to determine the target piecewise function corresponding to each segmentation interval; The compression module is specifically configured to determine the segmentation interval to which the image data belongs according to the image data, and process the image data using the target piecewise function corresponding to the segmentation interval; the piecewise function is a linear function of the compression function with the target exponent value as the exponent.
7. An electronic device, characterized in that, The electronic device includes at least a processor and a memory. When the processor executes the computer program stored in the memory, the steps of a dynamic range compression method as described in any one of claims 1-5 are implemented.
8. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device. When the program runs on the electronic device, the electronic device is caused to execute the steps of a dynamic range compression method as described in any one of claims 1-5.
Citation Information
Patent Citations
Compressing dynamic range in images by using darkness gamma transfer function
CN112541863A