Disclosure of Invention
The invention provides a method and a device for enhancing the details of a dynamic infrared image, which are used for at least solving the problem that the detail enhancement of the infrared image can not be realized in the prior art.
An embodiment of a first aspect of the present invention provides a method for enhancing details of a dynamic infrared image, including:
calculating attribute values of all frame images in an infrared image sequence, wherein the attribute values comprise window width values and window level values, and defining the attribute value of a first frame image in the infrared image sequence as an initial attribute value;
And correcting the attribute value of the frame image based on the difference value between the attribute value of the frame image and the initial attribute value.
According to some embodiments of the invention, the method further comprises secondarily adjusting the attribute values of the frame image according to an adjustment policy based on the corrected attribute values;
the adjustment strategy comprises the following steps:
When the corrected attribute value satisfies: And is also provided with When the modified attribute value is adjusted to be a preset attribute value;
When the corrected attribute value satisfies: and when l < Max, adjusting the window width value in the modified attribute value to be w=2 (Max-l);
When the corrected attribute value satisfies: and when l > Min, adjusting the window width value in the modified attribute value to be w=2 (l-Min);
Wherein w represents a window width value, l represents a window level value, max represents a maximum gray value of the infrared image sequence, and Min represents a minimum gray value of the infrared image sequence.
According to some embodiments of the invention, the performing secondary adjustment on the attribute value of the frame image according to the adjustment policy based on the corrected attribute value includes:
Gray stretching is carried out on the frame image based on the corrected attribute value;
Displaying the frame image with the gray stretching completed;
And finishing secondary adjustment of the attribute values on the displayed frame image.
According to some embodiments of the invention, the frame image is gray-stretched based on the following formula:
Where Ho represents the gray value after stretching, hi represents the original gray value, A, B represents the end of the gray stretching range, and a < B.
According to some embodiments of the invention, the gray scale stretching range [ A, B ] is [0,255].
According to some embodiments of the invention, there is provided:
the computing unit is used for computing attribute values of all frame images in the infrared image sequence, wherein the attribute values comprise window width values and window level values, and the attribute value of a first frame image in the infrared image sequence is defined as an initial attribute value;
and the first correction unit is used for correcting the attribute value of the frame image based on the difference value between the attribute value of the frame image and the initial attribute value.
According to some embodiments of the invention, the apparatus further comprises a second correction unit, configured to perform secondary adjustment on the attribute value of the frame image according to an adjustment policy based on the corrected attribute value;
the adjustment strategy comprises the following steps:
When the corrected attribute value satisfies: And is also provided with When the modified attribute value is updated to be a preset attribute value;
When the corrected attribute value satisfies: and l < Max, the window level value does not change, the window width value is adjusted to w=2 (Max-l);
When the corrected attribute value satisfies: And l is greater than or equal to Max, or And when l is less than or equal to Min, the window width value and the window level value are not adjusted any more;
When the corrected attribute value satisfies: And l > Min, the window level value does not change, the window width value is adjusted to w=2 (l-Min);
Wherein w represents a window width value, l represents a window level value, max represents a maximum gray value of the infrared image sequence, and Min represents a minimum gray value of the infrared image sequence.
According to some embodiments of the invention, the performing secondary adjustment on the attribute value of the frame image according to the adjustment policy based on the corrected attribute value includes:
Gray stretching is carried out on the frame image based on the corrected attribute value;
Displaying the frame image with the gray stretching completed;
And finishing secondary adjustment of the attribute values on the displayed frame image.
According to some embodiments of the invention, the frame image is gray-stretched based on the following formula:
Where Ho represents the gray value after stretching, hi represents the original gray value of the infrared image, A, B represents the end value of the gray stretching range, and a < B.
According to some embodiments of the invention, the gray scale stretching range [ A, B ] is [0,255].
By adopting the technical scheme provided by the embodiment of the invention, the window width value and the window level value of the infrared image sequence of other frames are corrected based on the difference value between the window width value and the window level value of the infrared image of other frames and the window width value and the window level value of the infrared image of the first frame, so that the overexposure problem caused by larger scene change of the infrared image can be solved, and the effect of enhancing the details of the infrared image sequence is realized.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
An embodiment of a first aspect of the present invention provides a method for enhancing details of a dynamic infrared image, including:
and calculating attribute values of all frame images in the infrared image sequence, wherein the attribute values at least comprise window width values and window level values. And defining the attribute value of the first frame image in the infrared image sequence as an initial attribute value.
And correcting the attribute values of the other frame images based on the difference value between the attribute values of the other frame images and the initial attribute value.
It can be understood that when the attribute values of the other frame images are corrected, the attribute values of the other frame images are different from the initial attribute values of the first frame image, and the obtained difference is superimposed on the attribute values of the other frame images to be used as new attribute values of the other frame images.
By adopting the technical scheme provided by the embodiment of the invention, the window width value and the window level value of the infrared image sequence of other frames are corrected based on the difference value between the window width value and the window level value of the infrared image of other frames and the window width value and the window level value of the infrared image of the first frame, so that the overexposure problem caused by larger scene change of the infrared image can be solved, and the effect of enhancing the details of the infrared image sequence is realized.
On the basis of the above-described embodiments, various modified embodiments are further proposed, and it is to be noted here that only the differences from the above-described embodiments are described in the various modified embodiments for the sake of brevity of description.
According to some embodiments of the invention, the method further comprises secondarily adjusting the attribute values of the frame image according to an adjustment policy based on the corrected attribute values.
The adjustment strategy comprises the following steps:
When the corrected attribute value satisfies: And is also provided with And updating the corrected attribute value to be a preset attribute value. Or recalculate the attribute values and update the attribute values via an external operational input.
When the corrected attribute value satisfies: And l < Max, the window level value does not change, the window width value is adjusted to w=2 (Max-l).
When the corrected attribute value satisfies: And l is greater than or equal to Max, or And when l is less than or equal to Mi n, the window width value and the window level value are not adjusted any more.
When the corrected attribute value satisfies: And l > Min, the window level value does not change, the window width value is adjusted to w=2 (l-Min).
Wherein w represents a window width value, l represents a window level value, max is the maximum value of the gray values of each frame of the infrared image sequence, and Min is the minimum value of the gray values of each frame of the infrared image sequence.
According to some embodiments of the invention, the performing secondary adjustment on the attribute value of the frame image according to the adjustment policy based on the corrected attribute value includes:
And carrying out gray scale stretching on the frame image in a linear mapping gray scale stretching mode based on the corrected attribute value. The 16-bit raw infrared image data is converted into an 8-bit gray scale image that can be directly displayed on a display.
And displaying the infrared image after the gray stretching is completed on a display.
The secondary adjustment of the attribute values is done for an infrared image displayed on the display. For example, according to the adjustment strategy, dynamic adjustment of the attribute values is achieved on the display using an external operation such as a mouse.
According to some embodiments of the present invention, the infrared image is gray-stretched based on a gray-value mapping relationship shown in the following formula 1:
Where Ho represents the gray value after stretching, hi represents the original gray value of the infrared image, A, B represents the end value of the gray stretching range, and a < B.
According to some embodiments of the invention, since the color channels displayed by the display are all 8 bits, the range of gray scale stretching [ A, B ] is set to [0,255].
An embodiment of a second aspect of the present invention provides a device for enhancing details of a dynamic infrared image, including:
the computing unit is used for computing attribute values of all frame images in the infrared image sequence, wherein the attribute values comprise window width values and window level values, and the attribute value of the first frame image in the infrared image sequence is defined as an initial attribute value.
For example, the computing unit may be a window width filter.
And the first correction unit is used for correcting the attribute value of the frame image based on the difference value between the attribute value of the frame image and the initial attribute value.
It can be understood that when the attribute values of the other frame images are corrected, the attribute values of the other frame images are different from the initial attribute values of the first frame image, and the obtained difference is superimposed on the attribute values of the other frame images to be used as new attribute values of the other frame images.
By adopting the technical scheme provided by the embodiment of the invention, the window width value and the window level value of the infrared image sequence of other frames are corrected based on the difference value between the window width value and the window level value of the infrared image of other frames and the window width value and the window level value of the infrared image of the first frame, so that the overexposure problem caused by larger scene change of the infrared image can be solved, and the effect of enhancing the details of the infrared image sequence is realized.
According to some embodiments of the invention, the apparatus further comprises a second correction unit, configured to perform a secondary adjustment on the attribute value of the frame image according to an adjustment policy based on the corrected attribute value.
The adjustment strategy comprises the following steps:
When the corrected attribute value satisfies: And is also provided with And updating the corrected attribute value to be a preset attribute value.
When the corrected attribute value satisfies: And l < Max, the window level value does not change, the window width value is adjusted to w=2 (Max-l).
When the corrected attribute value satisfies: And l is greater than or equal to Max, or And when l is less than or equal to Min, the window width value and the window level value are not adjusted any more.
When the corrected attribute value satisfies: And l > Min, the window level value does not change, the window width value is adjusted to w=2 (l-Min).
Wherein w represents a window width value, 1 represents a window level value, max is the maximum value of the gray values of each frame of the infrared image sequence, and Min is the minimum value of the gray values of each frame of the infrared image sequence.
According to some embodiments of the invention, the performing secondary adjustment on the attribute value of the frame image according to the adjustment policy based on the corrected attribute value includes:
and carrying out gray stretching operation on the frame image by adopting an image gray stretching visualization algorithm based on the corrected attribute value.
And displaying the frame image after the gray stretching is completed.
And finishing secondary adjustment of the attribute values on the displayed frame image. For example, the attribute values are adjusted on the display using a mouse or the like, depending on the adjustment strategy.
According to some embodiments of the invention, the frame image is gray-stretched based on the following equation 1:
Where Ho represents the gray value after stretching, hi represents the original gray value of the infrared image, A, B represents the end value of the gray stretching range, and a < B.
According to some embodiments of the invention, since the color channels displayed by the display are all 8 bits, the range of gray scale stretching [ A, B ] is set to [0,255].
The method of dynamic infrared image detail enhancement is described in detail below in one specific embodiment. It is to be understood that the following description is exemplary only and is not intended to limit the invention in any way. All similar structures and similar variations of the invention are included in the scope of the invention.
Referring to fig. 1, in the present embodiment, first, a window-width filter reads a 16-bit infrared image sequence, and selects a first frame image in the infrared image sequence to operate. The window width filter determines a gray scale interval of interest for the first frame image, calculates gray scale distribution of the infrared image, calculates a window width value and a window level value of the first frame image, and takes the window width value and the window level value as an initial window width value and an initial window level value. And (3) carrying out gray stretching operation on the first frame image based on the initial window width value and the initial window level value, and converting the 16-bit original infrared image data into an 8-bit gray image which can be directly displayed on a display according to the following formula 1.
And then, according to the adjustment strategy, using external mouse operation as input, and secondarily adjusting the window width value and the window level value of the infrared image.
Before the second frame image is switched, the window width and level filter calculates the window width and level values of the second frame image, and makes a difference with the initial window width and level values to obtain a correction value, and the correction value is added to the window width and level values of the second frame image to serve as new window width and level values of the second frame image.
And carrying out gray stretching on the second frame of infrared image according to the formula 1 according to the corrected new window width value and window level value, and displaying the second frame of infrared image on a display after stretching is completed.
Finally, according to the adjustment strategy, the window width value and the window level value of the infrared image are adjusted for the second time through external mouse operation to realize interactive adjustment. And the other frame images are sequentially subjected to dynamic window width value and window level value adjustment and gray stretching according to the scheme, so that the detail enhancement of the dynamic infrared image can be realized.
By adopting the technical scheme in the embodiment, the gray scale information of the infrared image is utilized to dynamically select a proper gray scale visualization range by using the gray scale stretching method of the image based on the window width, so that the problem of weak and small target information loss caused by directly adopting a histogram equalization algorithm is avoided. The window width value and the window level value of the infrared image sequence are interactively updated in real time in the image sequence processing process by using an adjusting algorithm, so that not only can the manual adjusting effect be updated in real time, but also a weak and small target can be effectively extracted from an image, and the high efficiency and the comparability of the image detail enhancement are improved. When the infrared image frames are switched, a dynamic time domain updating algorithm is used, the gray level difference between the infrared images of each frame is utilized to dynamically adjust window width, the problem of overexposure caused by large scene change of the infrared images is solved, the complexity of detail enhancement work in the infrared image data analysis process is greatly reduced, and meanwhile, the efficiency from Shan Zhanggong infrared images to integral sequence detail enhancement is also increased.
It should be noted that the foregoing description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the present invention by those skilled in the art, and various combinations of the embodiments may be freely combined. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
In the description of the present specification, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.