A method, device, equipment and medium for adjusting the dynamic range of grayscale images

By obtaining the histogram of grayscale value and generating a dynamic range mapping table, adjusting the grayscale value distribution of grayscale images, the problem of loss of image details in the prior art is solved, and a clearer image display effect is achieved.

CN114648463BActive Publication Date: 2025-07-29CONTEC MEDICAL SYST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210325454.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-07-29
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

The existing grayscale image dynamic range adjustment method fails to effectively retain the detailed information of the area of interest of the image during the mapping process, resulting in a decline in display quality.

Method used

By obtaining the histogram of the grayscale value of the original image, segmentation points and intervals are determined according to the distribution characteristics of the grayscale value, a dynamic range mapping table is generated, and the grayscale value distribution of the image is adjusted using this table.

Benefits of technology

This improves the detail fidelity of image display, reduces the probability of loss of information in the area of interest, and ensures accurate display of the brightness range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114648463B_ABST
    Figure CN114648463B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for adjusting the dynamic range of a grayscale image, relating to the field of image processing. By obtaining the original image and acquiring the grayscale value histogram according to the original image; obtaining the grayscale value segmentation points and segmentation intervals according to the distribution characteristics of the grayscale values in the grayscale value histogram; generating a dynamic range mapping table according to the grayscale value segmentation points and segmentation intervals; and adjusting the original image according to the dynamic range mapping table. It can be seen from this that the solution determines the grayscale value segmentation points and segmentation intervals through the grayscale value distribution information of the image to obtain the dynamic range mapping table for adjusting the image. Because the distribution characteristics of the grayscale values of this image are considered, the grayscale values of the region of interest can be divided more finely, reducing the probability of loss of image detail information; enabling the brightness range that needs to be accurately displayed to be well presented and showing the detail information of the image more clearly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and particularly to a method, apparatus, device and medium for adjusting the dynamic range of a grayscale image. Background Art

[0002] In ultrasonic imaging applied to medical diagnosis, for example, after processes such as beamforming, demodulation filtering, and envelope of an ultrasonic echo signal, a grayscale image with a high dynamic range (High-Dynamic Range, HDR) can be formed. Compared with ordinary images, HDR can provide more dynamic range and image details. However, some display devices cannot display high-dynamic-range images and can only display low-dynamic-range (Low-Dynamic Range, LDR) images, and such images cannot well display the details in the image compared with HDR. Therefore, before adjusting the dynamic range of a high-dynamic-range grayscale image on the display interface of a display device, it is necessary to adjust the dynamic range of the high-dynamic-range grayscale image and map it to a dynamic range suitable for display by the display device. Currently, the method for adjusting the image dynamic range usually uses curve transformation for mapping, and maps the grayscale values of the high-dynamic-range grayscale image and the grayscale values of the low-dynamic-range grayscale image one-to-one according to a preset mapping curve, and this mapping method can quickly complete the adjustment of the dynamic range.

[0003] However, this method does not consider the integrity of image information. When the high-dynamic-range image in clinical applications does not match the preset dynamic range mapping curve, the probability of losing the image detail information in the region of interest in the image is relatively large, the quality of the obtained low-dynamic-range image is low, and the brightness range that needs to be accurately displayed is not well shown.

[0004] In view of the above problems, designing a method for adjusting the dynamic range of a grayscale image that can more clearly display the information in the image is an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of the present application is to provide a method, apparatus, device and medium for adjusting the dynamic range of a grayscale image, which can more clearly display the information in the image.

[0006] To solve the above technical problems, the present application provides a method for adjusting the dynamic range of a grayscale image, including:

[0007] Obtain an original image;

[0008] Obtain a grayscale value histogram according to the original image; obtain grayscale value segmentation points and segmentation intervals according to the distribution characteristics of the grayscale values in the grayscale value histogram;

[0009] Generate a dynamic range mapping table according to the grayscale value segmentation points and the segmentation intervals;

[0010] Adjust the original image according to the dynamic range mapping table.

[0011] Preferably, the distribution characteristics of the gray values include the quantity information and distribution information of the pixel points in the original image within a preset gray value interval.

[0012] Preferably, obtaining the gray value histogram according to the original image includes:

[0013] Obtain the ratio of the number of gray values included in the dynamic range of the original image to a preset value;

[0014] Equally divide the gray value range of the original image into the ratio of gray value intervals, and obtain the number of pixel points in each gray value interval as the gray value histogram;

[0015] Wherein, the gray value range is from 0 to the maximum value of the gray values of the original image.

[0016] Preferably, obtaining the gray value segmentation points and segmentation intervals according to the distribution characteristics of the gray values in the gray value histogram includes:

[0017] Obtain the gray value segmentation points corresponding to all the segmentation intervals. Among them, when initially dividing, the number of the segmentation intervals is one and is the gray value range. The gray value segmentation point is obtained from the gray value corresponding to the pixel point at the halfway point of the total number of pixel points in the corresponding segmentation interval in the gray value histogram and the median value of the gray values of the corresponding segmentation interval;

[0018] Obtain the segmentation intervals according to all the gray value segmentation points;

[0019] Judge whether the number of all the gray value segmentation points is the maximum value of the gray values of the image to be output;

[0020] If so, enter the step of generating the dynamic range mapping table according to the gray value segmentation points and the segmentation intervals;

[0021] If not, return to the step of obtaining the gray value segmentation points corresponding to all the segmentation intervals.

[0022] Preferably, before obtaining the gray value segmentation points and segmentation intervals according to the distribution characteristics of the gray values in the gray value histogram, it further includes:

[0023] Remove the signal of the maximum value noise points in the signal of the gray value histogram to obtain the optimized gray value histogram.

[0024] Preferably, after adjusting the original image according to the dynamic range mapping table, the method further includes:

[0025] Obtaining the next frame of the original image and obtaining a new grayscale value histogram;

[0026] Determining whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition;

[0027] If yes, adjusting the next frame of the original image according to the dynamic range mapping table;

[0028] If not, obtaining a new dynamic range mapping table according to the new grayscale value histogram and the dynamic range mapping table for adjusting the new original image according to the new dynamic range mapping table.

[0029] Preferably, determining whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition includes:

[0030] Determining whether the difference value between the number of pixel points in each interval of the grayscale value histogram and the number of pixel points in each interval of the new grayscale value histogram is less than a threshold;

[0031] If yes, the preset condition is met, and the process proceeds to the step of adjusting the next frame of the original image according to the dynamic range mapping table;

[0032] If not, the preset condition is not met, and the process proceeds to the step of obtaining a new dynamic range mapping table according to the new grayscale value histogram and the dynamic range mapping table for adjusting the new original image according to the new dynamic range mapping table.

[0033] Preferably, obtaining the grayscale value histogram according to the original image includes:

[0034] Performing downsampling on the original image to obtain a downsampled image;

[0035] Obtaining a grayscale value histogram according to the downsampled image.

[0036] To solve the above technical problems, the present application further provides a grayscale image dynamic range adjustment device, including:

[0037] A first obtaining module, configured to obtain an original image;

[0038] A second obtaining module, configured to obtain a grayscale value histogram according to the original image;

[0039] A third obtaining module, configured to obtain grayscale value segmentation points and segmentation intervals according to the distribution characteristics of grayscale values in the grayscale value histogram;

[0040] A generation module, configured to generate a dynamic range mapping table according to the gray value segmentation points and the segmentation intervals;

[0041] An adjustment module, configured to adjust the original image according to the dynamic range mapping table.

[0042] To solve the above technical problems, the present application further provides a gray-scale image dynamic range adjustment device, including:

[0043] A memory, configured to store a computer program;

[0044] A processor, configured to implement the steps of the above-mentioned gray-scale image dynamic range adjustment method when executing the computer program.

[0045] To solve the above technical problems, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned gray-scale image dynamic range adjustment method are implemented.

[0046] The gray-scale image dynamic range adjustment method provided by the present application includes: obtaining an original image, and obtaining a gray value histogram according to the original image; obtaining gray value segmentation points and segmentation intervals according to the distribution characteristics of gray values in the gray value histogram; generating a dynamic range mapping table according to the gray value segmentation points and the segmentation intervals; and adjusting the original image according to the dynamic range mapping table. It can be seen that the solution determines the gray value segmentation points and the segmentation intervals through the gray value distribution information of the image to obtain the dynamic range mapping table for adjusting the image. Because the distribution characteristics of the gray values of this image are considered, the gray values of the region of interest can be divided more finely, reducing the probability of loss of image detail information; enabling the brightness range that needs to be accurately displayed to be well displayed, and more clearly displaying the detail information of the image.

[0047] In addition, the present application further provides a gray-scale image dynamic range adjustment device, equipment and computer-readable storage medium, and the effects are the same as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0049] Figure 1 It is a flowchart of a gray-scale image dynamic range adjustment method provided by an embodiment of the present application;

[0050] Figure 2Flow chart of another method for adjusting the dynamic range of a grayscale image provided by an embodiment of the present application;

[0051] Figure 3 Structural schematic diagram of a device for adjusting the dynamic range of a grayscale image provided by an embodiment of the present application;

[0052] Figure 4 Structural schematic diagram of a device for adjusting the dynamic range of a grayscale image provided by an embodiment of the present application. Detailed implementation manners

[0053] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0054] The core of the present application is to provide a method, device, equipment and medium for adjusting the dynamic range of a grayscale image, which can more clearly display the information in the image, reduce the probability of loss of detailed information in the image collected by an ultrasonic instrument, and enable the brightness range that needs to be accurately displayed to be well presented.

[0055] In order to enable those skilled in the art to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0056] The dynamic range is the ratio between the maximum and minimum values of the brightness levels of a frame of image. The larger the dynamic range of a frame of image, the higher the contrast and the clearer the image details. Among many display devices, some display devices cannot display images with a high dynamic range, for example, they cannot display 16-bit images; they can only display images with a lower dynamic range, for example, display 8-bit images. Therefore, when a frame of high-dynamic-range image needs to be displayed, it is necessary to first implement the mapping from a high-dynamic-range image (HDR) to a low-dynamic-range image (LDR).

[0057] In ultrasonic imaging applied to medical diagnosis, for example, after processes such as beamforming, demodulation filtering, and envelope processing on the ultrasonic echo signal, a grayscale image with a high dynamic range can be formed. However, some display devices cannot display images with a high dynamic range. Therefore, before adjusting the dynamic range of the grayscale image with a high dynamic range on the display interface of the display device, it is necessary to adjust the dynamic range of the grayscale image with a high dynamic range and map it to a dynamic range suitable for the display device to display. Currently, the method for adjusting the image dynamic range usually uses curve transformation for mapping, mapping the grayscale values of the grayscale image with a high dynamic range and the grayscale values of the grayscale image with a low dynamic range one-to-one according to a preset mapping curve. This mapping method can quickly complete the adjustment of the dynamic range. However, this method does not consider the integrity of the image information. When the high dynamic range image for clinical application does not match the preset dynamic range mapping curve, the probability of losing the image detail information in the region of interest in the image is relatively large, and the quality of the obtained low dynamic range image is low, and the brightness range that needs to be accurately displayed is not well presented. Therefore, this embodiment provides a method for adjusting the dynamic range of a grayscale image. It should be noted that the method provided in this embodiment can be applied not only to ultrasonic imaging for medical diagnosis but also to other scenarios for adjusting the dynamic range of grayscale images, which is not limited in this embodiment and is determined according to the specific application scenario. Figure 1 The flowchart of a method for adjusting the dynamic range of a grayscale image provided by an embodiment of the present application is shown as Figure 1 follows. The method for adjusting the dynamic range of a grayscale image includes:

[0058] S10: Obtain the original image.

[0059] S11: Obtain the grayscale value histogram according to the original image.

[0060] S12: Obtain the grayscale value segmentation points and segmentation intervals according to the distribution characteristics of the grayscale values in the grayscale value histogram.

[0061] S13: Generate a dynamic range mapping table according to the grayscale value segmentation points and segmentation intervals.

[0062] S14: Adjust the original image according to the dynamic range mapping table.

[0063] It can be understood that it is first necessary to obtain the original image. In this embodiment, the original image is acquired by an ultrasonic instrument. It should be noted that using an ultrasonic instrument to acquire the original image is only a preferred embodiment and does not limit the type of acquisition device, which depends on the specific implementation situation. The original image acquired by the ultrasonic instrument usually has a high dynamic range, but some display devices cannot display images with a high dynamic range. Therefore, it is necessary to adjust the dynamic range of the acquired original image. It should be noted that in the specific implementation, considering saving the time or difficulty of adjustment, the original image can be preprocessed. In this embodiment, there is no limitation on the preprocessing method, which depends on the specific implementation situation.

[0064] After obtaining the original image, the grayscale value histogram is obtained according to the original image. Specifically, the grayscale values of the pixel points in the original image are counted. First, the grayscale value range in the original image can be divided into several segments to obtain several continuous grayscale value intervals. It is possible to view the number of pixel points in each grayscale value interval in the histogram. Therefore, the obtained grayscale value histogram contains the number information of the pixel points in the original image within the preset grayscale value intervals. There is no limitation on the segmentation method of the grayscale value intervals here. It can be one grayscale value as one grayscale value interval, or several consecutive grayscale values as one grayscale value interval. There is no limitation in this embodiment, which depends on the specific implementation situation.

[0065] After obtaining the grayscale value histogram, the information of each grayscale value interval and the number of pixel points in it is initially obtained. Then, according to the distribution characteristics of the grayscale values in the grayscale value histogram, the grayscale value segmentation points and segmentation intervals are obtained. It can be understood that in this step, considering the number of pixel points and the grayscale value range, the grayscale value intervals with a larger number of pixel points are divided more finely to obtain multiple grayscale value segmentation points and segmentation intervals for segmenting the grayscale value range. In this embodiment, there is no limitation on the specific method of obtaining the grayscale value segmentation points and segmentation intervals according to the distribution characteristics of the grayscale values in the grayscale value histogram, which depends on the specific implementation situation. The obtained segmentation intervals are used to calculate the dynamic range mapping table, and the i-th segment data in the obtained segmentation intervals is adjusted to i - 1, where i is not less than 1. Thus, the original image is adjusted according to the dynamic range mapping table.

[0066] In this embodiment, an original image is obtained, and a grayscale value histogram is obtained based on the original image; according to the distribution characteristics of the grayscale values in the grayscale value histogram, grayscale value segmentation points and segmentation intervals are obtained; a dynamic range mapping table is generated based on the grayscale value segmentation points and segmentation intervals; and the original image is adjusted according to the dynamic range mapping table. It can be seen that the solution determines the grayscale value segmentation points and segmentation intervals through the grayscale value distribution information of the image to obtain a dynamic range mapping table for adjusting the image. Since the distribution characteristics of the grayscale values of this image are considered, the grayscale values of the region of interest can be divided more finely, reducing the probability of loss of image detail information; enabling the luminance range that needs to be accurately displayed to be well presented and showing the detail information of the image more clearly.

[0067] Based on the above embodiment:

[0068] As a preferred embodiment, the distribution characteristics of the grayscale values include the quantity information and distribution information of the pixel points in the original image within a preset grayscale value interval.

[0069] It can be understood that the distribution characteristics of the grayscale values are the distribution characteristics of the pixel point grayscale values in the grayscale value histogram, which include the quantity information and distribution information of different pixel points within a preset grayscale value interval. In this embodiment, the specific quantity of the preset grayscale value interval is not limited and depends on the specific implementation situation. Through the distribution characteristics of the grayscale values in the grayscale value histogram, the number of pixel points located in each grayscale value interval in the histogram, that is, the quantity information of the pixel points in the original image within each preset grayscale value interval, can be viewed.

[0070] In this embodiment, the distribution characteristics of the grayscale values include the quantity information and distribution information of the pixel points in the original image within a preset grayscale value interval, so as to obtain the grayscale value segmentation points and segmentation intervals in the subsequent process through this quantity information and distribution information.

[0071] Based on the above embodiment:

[0072] As a preferred embodiment, obtaining the grayscale value histogram according to the original image includes:

[0073] Obtaining the ratio of the number of grayscale values included in the dynamic range of the original image to a preset value;

[0074] Equally dividing the grayscale value range of the original image into the ratio number of grayscale value intervals, and obtaining the number of pixel points in each grayscale value interval as the grayscale value histogram;

[0075] Wherein, the grayscale value range is from 0 to the maximum value of the grayscale values of the original image.

[0076] In the above embodiments, there is no limitation on the segmentation method of the gray value range of the gray value histogram, which depends on the specific implementation situation. In this embodiment, as a preferred embodiment, first obtain the ratio of the number of gray values included in the dynamic range of the original image to a preset value. Here, the preset value is an empirical value, which depends on the specific implementation situation. Suppose A is the number of gray values of the input original image (where A is the number of bits of the original image), K is the preset value, then the ratio X = A / K. Specifically, divide the gray value range of the original image equally into gray value intervals according to the ratio X, and obtain the number of pixel points in each gray value interval as the gray value histogram. It should be noted that the gray value range is from 0 to the maximum value of the gray values of the original image, that is, [0, A -1].

[0077] In this embodiment, by obtaining the ratio of the number of gray values included in the dynamic range of the original image to the preset value, dividing the gray value range of the original image equally into the number of gray value intervals equal to the ratio, and obtaining the number of pixel points in each gray value interval, a gray value histogram is obtained, which is convenient for subsequent obtaining of gray value segmentation points and segmentation intervals.

[0078] Based on the above embodiments:

[0079] As a preferred embodiment, obtaining the gray value segmentation points and segmentation intervals according to the distribution characteristics of the gray values in the gray value histogram includes:

[0080] Obtain the gray value segmentation points corresponding to all segmentation intervals. Among them, the number of segmentation intervals at the first division is one and is the gray value range, and the gray value segmentation point is obtained from the gray value corresponding to the pixel point at half of the total number of pixel points in the corresponding segmentation interval through the gray value histogram and the median value of the gray values of the corresponding segmentation interval;

[0081] Obtain the segmentation intervals according to all gray value segmentation points;

[0082] Judge whether the number of all gray value segmentation points is the maximum value of the gray values of the image to be output;

[0083] If so, enter the step of generating a dynamic range mapping table according to the gray value segmentation points and segmentation intervals;

[0084] If not, return to the step of obtaining the gray value segmentation points corresponding to all segmentation intervals.

[0085] In the above embodiments, there is no limitation on the specific method of obtaining the gray value segmentation points and segmentation intervals according to the distribution characteristics of the gray values in the gray value histogram, which depends on the specific implementation situation. As a preferred embodiment, in this embodiment, first, the gray value segmentation points corresponding to all segmentation intervals are obtained.

[0086] For the first time to obtain the gray value segmentation points for division, the segmentation interval is the gray value range of the gray value histogram. Specifically, obtain the gray value of the gray value interval corresponding to the pixel point at the position of half of the total number of pixel points in the gray value histogram, and set this gray value as value1; at the same time, obtain the median value of the gray values in the gray value range of the gray value histogram, and set this median value of the gray value as value2. At the same time, it is known that the maximum value V max and the minimum value V min of the gray values in the current segmentation interval (gray value range), then the gray value segmentation point V1 for the first division of the gray value range of the gray value histogram is V1 = a * value1 + (1 - a) * value2, (a < 1). Where a is the weight coefficient, which depends on the specific implementation situation.

[0087] After obtaining the gray value V1 of the first gray value segmentation point, the gray value range can be divided into two new segmentation intervals. At this time, it is necessary to judge whether the number of all gray value segmentation points is the maximum value of the gray values of the image to be output, that is, 2 B - 1; it can also be judged whether the number of new segmentation intervals is 2 B , which can be set in the specific implementation process. If so, enter the step of generating the dynamic range mapping table according to the gray value segmentation points and segmentation intervals, that is, step S13; if not, return to the step of obtaining the gray value segmentation points corresponding to all segmentation intervals, and based on the two segmentation intervals obtained from the first segmentation, obtain the gray value segmentation points corresponding to these two segmentation intervals, where the gray value segmentation point is obtained from the gray value corresponding to the pixel point at half of the total number of pixel points in the corresponding segmentation interval and the median value of the gray values of the corresponding segmentation interval through the gray value histogram. Repeat the above steps for re-segmentation, obtain the corresponding value1 and value2 for each segmentation interval, and respectively obtain the corresponding gray value segmentation points V n (n = 1, 2, 3, 4...), obtain the segmentation intervals according to these gray value segmentation points until it is judged that the number of all gray value segmentation points is the maximum value of the gray values of the image to be output, and end the segmentation. Adjust the i-th segment data in the obtained segmentation interval to i - 1, where i is not less than 1, so as to obtain the dynamic range mapping table.

[0088] In this embodiment, the gray value range is re-divided according to the number of pixel points and the gray value in the gray value histogram. Since the gray value distribution characteristics of this image are considered, the gray value of the pixel points can be divided more finely. In this way, the image mapped by the generated dynamic range mapping table can reduce the probability of loss of detailed information of the image collected by the ultrasonic instrument; the brightness range that needs to be accurately displayed can be well presented, and the detailed information of the image can be displayed more clearly.

[0089] Figure 2 The flowchart of another gray image dynamic range adjustment method provided by the embodiment of the present application. In order to reduce the noise interference in the image, as Figure 2 shown, before obtaining the gray value segmentation points and segmentation intervals according to the distribution characteristics of the gray values in the gray value histogram, that is, before step S12, the method further includes:

[0090] S15: Remove the signal of the maximum value noise points in the signal of the gray value histogram to obtain an optimized gray value histogram.

[0091] In specific implementation, in order to remove the signal of the maximum value noise points in the signal on the histogram, image processing means such as Gaussian filtering or median filtering can be performed on the original image, which is not limited in this embodiment and depends on the specific implementation situation. And in specific implementation, it can also be set to remove the signal of a point whose gray value is not within the preset range among 100 pixel points in the signal. And at this time, the total number of pixel points in the gray value histogram becomes 99% of the original total number of pixel points. That is, if the original total number of pixel points is 200, the optimized total number is 99% * 200 = 198, so as to obtain an optimized gray value histogram.

[0092] In this embodiment, by removing the signal of the maximum value noise points in the signal of the gray value histogram to obtain an optimized gray value histogram, it is beneficial to improve the accuracy of the subsequent obtained segmentation interval.

[0093] It can be understood that through the steps in the above embodiment, the dynamic range transformation of one frame of image is completed. Since in clinical applications, the user continuously moves the probe and the tissue itself moves, each frame of image will change. Therefore, it is necessary to update the mapping relationship of the dynamic range in real time according to the data. However, in order to ensure the continuity of each frame of image, the dynamic range mapping relationship between the front and back two frames of images needs to be gradually transformed. Therefore, after the dynamic range transformation of the first frame is completed, when performing the transformation of other frames, the data needs to be compared. As Figure 2 shown, after adjusting the original image according to the dynamic range mapping table, that is, after step S14, the method further includes:

[0094] S16: Obtain the next frame of the original image and obtain a new gray value histogram.

[0095] S17: Determine whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition; if so, proceed to step S18, if not, then proceed to step S19.

[0096] S18: Adjust the next frame of the original image according to the dynamic range mapping table.

[0097] S19: Obtain a new dynamic range mapping table based on the new grayscale value histogram and the dynamic range mapping table for adjusting the new original image according to the new dynamic range mapping table.

[0098] Specifically, obtain a new original image and a new grayscale value histogram, and determine whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition. Here, there is no limitation on the specific implementation manner for determining whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition, which depends on the specific implementation situation. In this embodiment, there is no limitation on the method for calculating the difference value, which depends on the specific implementation situation. When the difference value meets the preset condition, adjust the new original image according to the dynamic range mapping table. When the difference value does not meet the preset condition, obtain a new dynamic range mapping table based on the new grayscale value histogram and the dynamic range mapping table for adjusting the new original image according to the new dynamic range mapping table.

[0099] In this embodiment, by obtaining a new original image and a new grayscale value histogram, determining whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition, and judging whether to update the dynamic range mapping table according to whether the preset condition is met, the dynamic range transformation output of the original image is realized.

[0100] Based on the above embodiments:

[0101] As a preferred embodiment, determining whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition includes:

[0102] Determine whether the difference value between the number of pixel points in each interval of the grayscale value histogram and the number of pixel points in each interval of the new grayscale value histogram is less than a threshold.

[0103] If so, the preset condition is met, and proceed to the step of adjusting the next frame of the original image according to the dynamic range mapping table;

[0104] If not, the preset condition is not met, and proceed to the step of obtaining a new dynamic range mapping table based on the new grayscale value histogram and the dynamic range mapping table for adjusting the new original image according to the new dynamic range mapping table.

[0105] In the above embodiments, there is no limitation on the specific implementation manner of determining whether the difference value between the grayscale value histogram and the new grayscale value histogram meets the preset conditions, which depends on the specific implementation situation; there is also no limitation on the method for calculating the difference value, which depends on the specific implementation situation. As a preferred embodiment, this embodiment provides a calculation method for the difference value, and the formula is as follows:

[0106]

[0107] Where H1 represents the number of pixel points in each grayscale value interval in the grayscale value histogram of the new original image. H0 represents the number of pixel points in each grayscale value interval in the grayscale value histogram of the current original image. M is the segmentation interval in the dynamic range mapping table.

[0108] Specifically, assume that the current dynamic range mapping table is M out , the threshold is Difth. If Dif < Difth, it meets the preset conditions, and the next frame of the original image is adjusted according to the dynamic range mapping table; if Dif > Difth, it does not meet the preset conditions, and a new dynamic range mapping table M out1 :

[0109] M out1 = λ * Dif * M2 + (1 - λ * Dif) * M out

[0110] Where λ is an empirical value, which depends on the specific implementation situation. M2 is the mapping table relationship of the new original image obtained according to steps S10 to S14, and the new original image is adjusted according to the new dynamic range mapping table.

[0111] In this embodiment, by determining whether the difference value between the number of pixel points in each interval of the grayscale value histogram and the number of pixel points in each interval of the new grayscale value histogram is less than the threshold, it is realized to judge whether the current dynamic range mapping table meets the mapping requirements of the new original image, thereby further realizing the dynamic range transformation output of the original image.

[0112] Based on the above embodiments:

[0113] As a preferred embodiment, obtaining the grayscale value histogram according to the original image includes:

[0114] Performing downsampling on the original image to obtain a downsampled image;

[0115] Obtaining the grayscale value histogram according to the downsampled image.

[0116] In a specific implementation, in order to reduce the processing complexity of the original image and save time, the image is downsampled, and then the grayscale value histogram is obtained based on the downsampled image. Specifically, the original image is reduced under certain sampling conditions. For example, the input original image can be reduced by a factor of s; if the size of the original image is m*n, the size of the downsampled image obtained by downsampling the original image is (m / s)*(n / s). In specific medical diagnoses, the value of s is generally set according to the specific part of the diagnosis. For example, the downsampling factor s for the original abdominal image may be different from that for the original liver image. Since the image is in matrix form, downsampling means changing the image within an s*s window in the original image of size m*n into one pixel, and the grayscale value of this pixel can be taken as the first value or the last value of each s*s window. The first value and the last value can be the grayscale value of the first pixel in the upper left corner and the last pixel in the lower right corner of the s*s window. It can also be the grayscale value of any fixed pixel in the s*s window, or the average value of all pixels in the s*s window, which is not limited in this embodiment and depends on the specific implementation situation.

[0117] In this embodiment, by downsampling the original image to obtain a downsampled image and obtaining the grayscale value histogram based on the downsampled image, the processing complexity is reduced and the sampling time is saved.

[0118] In the above embodiment, the method for adjusting the dynamic range of grayscale images is described in detail. The present application also provides an embodiment corresponding to the device for adjusting the dynamic range of grayscale images. It should be noted that the embodiments of the device part in the present application are described from two perspectives, one is from the perspective of functional modules, and the other is from the perspective of hardware structure.

[0119] Figure 3 FIG. is a schematic structural diagram of a device for adjusting the dynamic range of grayscale images provided by an embodiment of the present application. As Figure 3 shown, the device for adjusting the dynamic range of grayscale images includes:

[0120] A first acquisition module 10, configured to acquire an original image.

[0121] A second acquisition module 11, configured to acquire a grayscale value histogram based on the original image.

[0122] A third acquisition module 12, configured to obtain grayscale value segmentation points and segmentation intervals according to the distribution characteristics of grayscale values in the grayscale value histogram.

[0123] A generation module 13, configured to generate a dynamic range mapping table according to the grayscale value segmentation points and segmentation intervals.

[0124] An adjustment module 14 for adjusting the original image according to the dynamic range mapping table.

[0125] Since the embodiments in the device part correspond to the embodiments in the method part, please refer to the description of the embodiments in the method part for the embodiments in the device part, and will not be elaborated here.

[0126] Figure 4 The following is a schematic structural diagram of another grayscale image dynamic range adjustment device provided by an embodiment of the present application. As Figure 4 shown, the grayscale image dynamic range adjustment device includes:

[0127] A memory 20 for storing computer programs.

[0128] A processor 21 for implementing the steps of the method for adjusting the dynamic range of the grayscale image as mentioned in the above embodiments when executing the computer program.

[0129] The grayscale image dynamic range adjustment device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.

[0130] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.

[0131] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201. After the computer program is loaded and executed by the processor 21, the relevant steps of the grayscale image dynamic range adjustment method disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the grayscale image dynamic range adjustment method.

[0132] In some embodiments, the grayscale image adjustment device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0133] Those skilled in the art can understand that Figure 4 the structure shown in does not constitute a limitation on the grayscale image dynamic range adjustment device, and may include more or fewer components than those shown in the figure.

[0134] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0135] It can be understood that if the method in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage media include: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs, etc., which can store program codes.

[0136] The above has introduced in detail a method, device, equipment and medium for adjusting the dynamic range of a grayscale image provided by this application. Each embodiment in the specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0137] It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.

Claims

1. A method for adjusting the dynamic range of a grayscale image, characterized in that including: obtaining an original image; obtaining a grayscale value histogram according to the original image; obtaining grayscale value segmentation points and segmentation intervals according to the distribution characteristics of grayscale values in the grayscale value histogram; generating a dynamic range mapping table according to the grayscale value segmentation points and the segmentation intervals; adjusting the original image according to the dynamic range mapping table; wherein, the distribution characteristics of the grayscale values include the quantity information and distribution information of the pixel points in the original image within a preset grayscale value interval; the obtaining grayscale value segmentation points and segmentation intervals according to the distribution characteristics of grayscale values in the grayscale value histogram includes: obtaining the grayscale value segmentation points corresponding to all the segmentation intervals, wherein, at the first division, the number of the segmentation intervals is one and is the grayscale value range, and the grayscale value segmentation points are obtained from the grayscale value corresponding to the pixel point at half of the total number of pixel points in the corresponding segmentation interval and the median value of the grayscale values of the corresponding segmentation interval through the grayscale value histogram; obtaining the segmentation intervals according to all the grayscale value segmentation points; judging whether the number of all the grayscale value segmentation points is the maximum value of the grayscale values of the image to be output; if so, entering the step of generating a dynamic range mapping table according to the grayscale value segmentation points and the segmentation intervals; if not, returning to the step of obtaining the grayscale value segmentation points corresponding to all the segmentation intervals.

2. The grayscale image dynamic range adjustment method according to claim 1, wherein the obtaining a grayscale value histogram according to the original image includes: obtaining the ratio of the number of grayscale values included in the dynamic range of the original image to a preset value; equally dividing the grayscale value range of the original image into the ratio of the number of grayscale value intervals, and obtaining the number of pixel points in each grayscale value interval as the grayscale value histogram; wherein, the grayscale value range is from 0 to the maximum value of the grayscale values of the original image.

3. The method for adjusting the dynamic range of a grayscale image according to claim 1, wherein before the obtaining grayscale value segmentation points and segmentation intervals according to the distribution characteristics of grayscale values in the grayscale value histogram, it further includes: removing the signal of the maximum value noise points in the signal of the grayscale value histogram to obtain an optimized grayscale value histogram.

4. The method for adjusting the dynamic range of a grayscale image according to claim 1, characterized in that, after the adjusting the original image according to the dynamic range mapping table, it further includes: obtaining the next frame of original image and obtaining a new grayscale value histogram; judging whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition; if so, adjusting the next frame of original image according to the dynamic range mapping table; if not, obtaining a new dynamic range mapping table according to the new grayscale value histogram and the dynamic range mapping table for adjusting the new original image according to the new dynamic range mapping table.

5. The method for adjusting the dynamic range of a grayscale image according to claim 4, characterized in that, the judging whether the difference value between the grayscale value histogram and the new grayscale value histogram meets a preset condition includes: judging whether the difference value between the number of pixel points in each interval of the grayscale value histogram and the number of pixel points in each interval of the new grayscale value histogram is less than a threshold; if so, meeting the preset condition and entering the step of adjusting the next frame of original image according to the dynamic range mapping table; Otherwise, the preset condition is not satisfied, and the process proceeds to the step of obtaining a new dynamic range mapping table based on the new grayscale value histogram and the dynamic range mapping table, for adjusting the new original image according to the new dynamic range mapping table.

6. The method for adjusting the dynamic range of a grayscale image according to claim 5, wherein The obtaining of the grayscale value histogram based on the original image includes: Downsampling the original image to obtain a downsampled image; Obtaining the grayscale value histogram based on the downsampled image.

7. A grayscale image dynamic range adjustment device, characterized in that, It includes: A first obtaining module, configured to obtain an original image; A second obtaining module, configured to obtain a grayscale value histogram based on the original image; A third obtaining module, configured to obtain grayscale value segmentation points and segmentation intervals according to the distribution characteristics of the grayscale values in the grayscale value histogram; A generating module, configured to generate a dynamic range mapping table according to the grayscale value segmentation points and the segmentation intervals; An adjusting module, configured to adjust the original image according to the dynamic range mapping table; Wherein, the distribution characteristics of the grayscale values include the quantity information and distribution information of the pixel points in the original image within a preset grayscale value interval; The obtaining of the grayscale value segmentation points and segmentation intervals according to the distribution characteristics of the grayscale values in the grayscale value histogram includes: Obtaining all the grayscale value segmentation points corresponding to the segmentation intervals, wherein, at the first division, the number of the segmentation intervals is one and is the grayscale value range, and the grayscale value segmentation point is obtained from the grayscale value corresponding to the pixel point at the midpoint of the total number of pixel points in the corresponding segmentation interval in the grayscale value histogram and the median grayscale value of the corresponding segmentation interval; Obtaining the segmentation intervals according to all the grayscale value segmentation points; Judging whether the number of all the grayscale value segmentation points is the maximum value of the grayscale values of the image to be output; If so, proceeding to the step of generating a dynamic range mapping table according to the grayscale value segmentation points and the segmentation intervals; If not, returning to the step of obtaining all the grayscale value segmentation points corresponding to the segmentation intervals.

8. A grayscale image dynamic range adjustment device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the grayscale image dynamic range adjustment method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the grayscale image dynamic range adjustment method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and system for obtaining noise horizontal curve of image sensor

    CN104504700A

  • Image data processing method, image data processing device, image data processing equipment and computer-readable storage medium

    CN108805829A