A method and device for processing thermal imaging images
By increasing the brightness component of pixel points at the edge of the image in the thermal image and superimposing preset edge color, the problem of inconspicuous display of the edge of the fire rescue scene in the thermal image is solved, and a more obvious edge enhancement effect is achieved.
Patent Information
- Application Number
- CN202110291473.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-18
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-03-18
AI Technical Summary
The edges of the fire rescue scene in the thermal imaging image are not obvious, making it difficult to effectively understand the scene when there is heavy smoke and the line of sight is blocked.
By determining the image edge of the original thermal image, increasing the brightness component of the pixel points at the edge, and superimposing translucent preset edge colors at the edge of the image, an edge-enhanced image is obtained.
The edges of the image in the thermal imaging images in the fire rescue scene are enhanced, and the visibility and contrast of the edges are improved, making edge information easier to identify in complex environments.
Smart Images

Figure CN115115566B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and device for processing thermal imaging images. Background Art
[0002] With the development of image technology, the application scope of thermal imaging is becoming wider and wider, and it is becoming more and more important. For example, in a fire rescue scene, due to the heavy smoke, the line of sight is easily blocked, and the visible light imaging detector cannot collect effective visible light images, while the thermal imaging detector can well penetrate the smoke and collect effective thermal imaging images, which is convenient for other personnel to understand the situation of the fire rescue scene.
[0003] However, thermal imaging images are formed based on temperature, which results in unclear display of edges in fire rescue scenes in thermal imaging images. Summary of the invention
[0004] The purpose of the embodiment of the present application is to provide a method and device for processing thermal imaging images to enhance the edges of fire rescue scenes in thermal imaging images. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for processing a thermal imaging image, the method comprising:
[0006] determining image edges of the original thermal imaging image;
[0007] Increasing the brightness component of the pixel points at the edge of the image in the original thermal imaging image to obtain a processed thermal imaging image, wherein the pixel points of the processed thermal imaging image have a chromaticity component and a saturation component;
[0008] A semi-transparent preset edge color is superimposed at the edge of the image in the processed thermal imaging image to obtain an edge-enhanced image.
[0009] Optionally, the step of determining the image edge of the original thermal imaging image includes:
[0010] Separating a high-frequency image from an original thermal imaging image, wherein the high-frequency image displays an image edge of the original thermal imaging image;
[0011] An image edge of the original thermal imaging image is determined based on the high-frequency image.
[0012] Optionally, the step of separating the high-frequency image from the original thermal imaging image includes:
[0013] Taking each pixel point in the original thermal imaging image as the center of a preset window, respectively, calculating the average of the original pixel values of all the pixel points in the preset window as the pixel average value of the pixel point;
[0014] Based on the original pixel value and the pixel mean value of each pixel in the original thermal imaging image, the high-frequency pixel value of each pixel in the original thermal imaging image is determined to obtain the high-frequency image.
[0015] Optionally, taking each pixel point in the original thermal imaging image as the center of a preset window and calculating the average of the original pixel values of all the pixels in the preset window as the pixel average value of the pixel point includes:
[0016] Convert the original thermal imaging image into an integral image, wherein the value of each pixel in the integral image is the sum of the pixel values of all pixels in the rectangular area corresponding to the pixel, and the rectangular area corresponding to the pixel is the rectangular area formed by the upper left corner pixel of the original thermal imaging image to the pixel;
[0017] Based on the integral image, the average of the original pixel values of all pixels in a preset window centered on each pixel is obtained as the pixel average of the pixel.
[0018] Optionally, the step of increasing the brightness component of the pixel points at the edge of the image in the original thermal imaging image includes:
[0019] For each pixel point at the edge of the image in the original thermal imaging image, the sum of the pixel mean value and the gain pixel value of the pixel point is used as the brightness component of the pixel point, and the gain pixel value is the pixel value obtained by linearly amplifying the difference between the original pixel value of the pixel point and the pixel mean value.
[0020] Optionally, the step of superimposing a semi-transparent preset edge color at the image edge in the processed thermal imaging image to obtain an edge-enhanced image includes:
[0021] For each pixel at the edge of the image in the original thermal imaging image, using the weight of the pixel, weighted sum the brightness component of the pixel in the processed thermal imaging image and the brightness component of the preset edge color to obtain an edge enhanced brightness component of the pixel;
[0022] For each pixel at the edge of the image in the original thermal imaging image, weighting the difference between the chromaticity component of the preset edge color and the chromaticity component of the pixel in the processed thermal imaging image using the weight of the pixel to obtain a weighted chromaticity component difference of the pixel, and taking the sum of the weighted chromaticity component difference and a preset parameter value as the edge enhancement chromaticity component of the pixel;
[0023] For each pixel at the edge of the image in the original thermal imaging image, weighting the difference between the saturation component of the preset edge color and the saturation component of the pixel in the processed thermal imaging image using the weight of the pixel to obtain a weighted saturation component difference of the pixel, and taking the sum of the weighted saturation component difference and the preset parameter value as the edge enhancement saturation component of the pixel;
[0024] The edge-enhanced image is obtained based on the edge-enhanced brightness component, the edge-enhanced chrominance component and the edge-enhanced saturation component of each pixel at the edge of the image.
[0025] Optionally, before separating the high-frequency image from the original thermal imaging image, the method further includes:
[0026] Performing median filtering on the original thermal imaging image to obtain a filtered thermal imaging image; the preset multiple of the median filtering window is smaller than the preset window;
[0027] A high-frequency image is separated from the filtered thermal imaging image.
[0028] In a second aspect, an embodiment of the present application provides a device for processing a thermal imaging image, the device comprising:
[0029] A determination unit, used for determining an image edge of an original thermal imaging image;
[0030] A processing unit, configured to increase the brightness component of the pixel points at the edge of the image in the original thermal imaging image to obtain a processed thermal imaging image, wherein the pixel points of the processed thermal imaging image have a chromaticity component and a saturation component;
[0031] The superimposing unit is used to superimpose a semi-transparent preset edge color at the image edge in the processed thermal imaging image to obtain an edge-enhanced image.
[0032] Optionally, the determining unit is specifically configured to:
[0033] Separating a high-frequency image from an original thermal imaging image, wherein the high-frequency image displays an image edge of the original thermal imaging image;
[0034] An image edge of the original thermal imaging image is determined based on the high-frequency image.
[0035] Optionally, the determining unit is specifically configured to:
[0036] Taking each pixel point in the original thermal imaging image as the center of a preset window, respectively, calculating the average of the original pixel values of all the pixel points in the preset window as the pixel average value of the pixel point;
[0037] Based on the original pixel value and the pixel mean value of each pixel in the original thermal imaging image, the high-frequency pixel value of each pixel in the original thermal imaging image is determined to obtain the high-frequency image.
[0038] Optionally, the determining unit is specifically configured to:
[0039] Convert the original thermal imaging image into an integral image, wherein the value of each pixel in the integral image is the sum of the pixel values of all pixels in the rectangular area corresponding to the pixel, and the rectangular area corresponding to the pixel is the rectangular area formed by the upper left corner pixel of the original thermal imaging image to the pixel;
[0040] Based on the integral image, the average of the original pixel values of all pixels in a preset window centered on each pixel is obtained as the pixel average of the pixel.
[0041] Optionally, the processing unit is specifically used to:
[0042] For each pixel point at the edge of the image in the original thermal imaging image, the sum of the pixel mean value and the gain pixel value of the pixel point is used as the brightness component of the pixel point, and the gain pixel value is the pixel value obtained by linearly amplifying the difference between the original pixel value of the pixel point and the pixel mean value.
[0043] Optionally, the superposition unit is specifically used to:
[0044] For each pixel at the edge of the image in the original thermal imaging image, using the weight of the pixel, weighted sum the brightness component of the pixel in the processed thermal imaging image and the brightness component of the preset edge color to obtain an edge enhanced brightness component of the pixel;
[0045] For each pixel at the edge of the image in the original thermal imaging image, weighting the difference between the chromaticity component of the preset edge color and the chromaticity component of the pixel in the processed thermal imaging image using the weight of the pixel to obtain a weighted chromaticity component difference of the pixel, and taking the sum of the weighted chromaticity component difference and a preset parameter value as the edge enhancement chromaticity component of the pixel;
[0046] For each pixel at the edge of the image in the original thermal imaging image, weighting the difference between the saturation component of the preset edge color and the saturation component of the pixel in the processed thermal imaging image using the weight of the pixel to obtain a weighted saturation component difference of the pixel, and taking the sum of the weighted saturation component difference and the preset parameter value as the edge enhancement saturation component of the pixel;
[0047] The edge-enhanced image is obtained based on the edge-enhanced brightness component, the edge-enhanced chrominance component and the edge-enhanced saturation component of each pixel at the edge of the image.
[0048] Optionally, the determination unit is also used to: before separating the high-frequency image from the original thermal imaging image, perform median filtering on the original thermal imaging image to obtain a filtered thermal imaging image; the preset multiple of the median filtering window is smaller than the preset window; and separate the high-frequency image from the filtered thermal imaging image.
[0049] In a fourth aspect, an embodiment of the present application provides a machine-readable storage medium, wherein the machine-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for processing thermal imaging images described above is implemented.
[0050] An embodiment of the present application also provides a computer program, which, when executed on a computer, enables the computer to execute any of the above-mentioned methods for processing thermal imaging images.
[0051] Beneficial effects of the embodiments of the present application:
[0052] In the technical solution provided in the embodiment of the present application, the image edge of the original thermal imaging image is determined, the brightness component of the pixel points at the image edge in the original thermal imaging image is increased, and a semi-transparent preset edge color is superimposed at the image edge to obtain an edge-enhanced image. The higher the brightness, the more obvious the object displayed in the image. In the embodiment of the present application, the image edge of the thermal imaging image in the fire rescue scene is enhanced by increasing the brightness component of the pixel points at the image edge. In addition, in the embodiment of the present application, a semi-transparent preset edge color is superimposed at the image edge, so that the features in the original thermal imaging image are not covered, and the color is superimposed in the original thermal imaging image, which forms a sharp contrast with the non-edge area where the preset edge color is not superimposed, and further enhances the image edge of the thermal imaging image in the fire rescue scene.
[0053] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 A first flow chart of a method for processing thermal imaging images provided in an embodiment of the present application;
[0056] Figure 2 A second flow chart of the method for processing thermal imaging images provided in an embodiment of the present application;
[0057] Figure 3 A third flow chart of the method for processing thermal imaging images provided in an embodiment of the present application;
[0058] Figure 4 A fourth flow chart of the method for processing thermal imaging images provided in an embodiment of the present application;
[0059] Figure 5 A fifth flow chart of the method for processing thermal imaging images provided in an embodiment of the present application;
[0060] Figure 6 A schematic diagram of the structure of a thermal imaging image processing device provided in an embodiment of the present application;
[0061] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0063] Since there are high-temperature objects in the fire rescue scene, the brightness of all objects will be lowered, resulting in the edges of low-temperature objects not being obvious in the thermal imaging image formed according to the temperature.
[0064] In order to solve the above problems, the embodiment of the present application provides a method for processing thermal imaging images. The method can be applied to thermal imaging detectors, or electronic devices such as mobile terminals, laptops, tablet computers, and personal computers (PCs) connected to thermal imaging detectors. For ease of understanding, the following description is based on electronic devices as the execution subject, which does not serve as a limitation.
[0065] In the processing method of the thermal imaging image, the electronic device determines the image edge of the original thermal imaging image, increases the brightness component of the pixel points at the image edge in the original thermal imaging image, and superimposes a semi-transparent preset edge color at the image edge to obtain an edge-enhanced image. The higher the brightness, the more obvious the object displayed in the image. In the embodiment of the present application, the image edge of the thermal imaging image in the fire rescue scene is enhanced by increasing the brightness component of the pixel points at the image edge. In addition, in the embodiment of the present application, a semi-transparent preset edge color is superimposed at the image edge, so that the features in the original thermal imaging image are not covered, and the color is superimposed in the original thermal imaging image, which forms a sharp contrast with the non-edge area where the preset edge color is not superimposed, and further enhances the image edge of the thermal imaging image in the fire rescue scene.
[0066] The following is a detailed description of the thermal imaging image processing method provided in the embodiments of the present application through specific examples.
[0067] See also Figure 1 , Figure 1 A first flow chart of a method for processing a thermal imaging image provided in an embodiment of the present application, the method comprising the following steps:
[0068] Step S11, determining the image edge of the original thermal imaging image.
[0069] In an embodiment of the present application, the thermal imaging detector collects a thermal imaging image as an original thermal imaging image. The electronic device can directly obtain the original thermal imaging image from the thermal imaging detector. The electronic device can directly obtain the original thermal imaging image from a preset database, which is used to store the thermal imaging images collected by the thermal imaging detector. The electronic device determines the image edge of the original thermal imaging image based on the obtained original thermal imaging image.
[0070] Step S12, increasing the brightness component of the pixel points at the edge of the original thermal imaging image to obtain a processed thermal imaging image, wherein the pixel points of the processed thermal imaging image have a chromaticity component and a saturation component.
[0071] In the embodiment of the present application, after determining the edge of the image, the electronic device increases the brightness component of the edge pixel points in the original thermal imaging image, and keeps the brightness component of the non-edge pixel points in the original thermal imaging image unchanged. At this time, the electronic device obtains a black and white image with the brightness component of the edge pixel points increased as the processed thermal imaging image.
[0072] In addition, in the embodiment of the present application, it is necessary to superimpose color on the processed thermal imaging image, which requires that the processed thermal imaging image has a chromaticity component and a saturation component. However, the original thermal imaging image does not have a chromaticity component and a saturation component. In this case, the chromaticity component and saturation component of the black and white image are added to the processed thermal imaging image. For example, if the chromaticity component and saturation component of the black and white image are both 128, then the electronic device adds a chromaticity component and a saturation component of 128 to all pixels in the processed thermal imaging image.
[0073] Step S13, superimposing a semi-transparent preset edge color at the image edge in the processed thermal imaging image to obtain an edge enhanced image.
[0074] In the embodiment of the present application, the preset edge color can be set according to actual needs. For example, the preset edge color can be red, green, blue, etc.
[0075] After processing the thermal imaging image, the electronic device superimposes a semi-transparent preset edge color at the edge of the image in the processed thermal imaging image. The processed thermal imaging image superimposed with the semi-transparent preset edge color is an edge enhanced image.
[0076] In the technical solution provided in the embodiment of the present application, the image edge of the original thermal imaging image is determined, the brightness component of the pixel points at the image edge in the original thermal imaging image is increased, and a semi-transparent preset edge color is superimposed at the image edge to obtain an edge-enhanced image. The higher the brightness, the more obvious the object displayed in the image. In the embodiment of the present application, the image edge of the thermal imaging image in the fire rescue scene is enhanced by increasing the brightness component of the pixel points at the image edge. In addition, in the embodiment of the present application, a semi-transparent preset edge color is superimposed at the image edge, so that the features in the original thermal imaging image are not covered, and the color is superimposed in the original thermal imaging image, which forms a sharp contrast with the non-edge area where the preset edge color is not superimposed, and further enhances the image edge of the thermal imaging image in the fire rescue scene.
[0077] In one embodiment of the present application, the present application also provides a method for processing a thermal imaging image. Figure 2 , Figure 2 This is a second flow chart of a method for processing thermal imaging images provided in an embodiment of the present application. In this method, step S11 can be refined into the following steps.
[0078] S111, separating a high-frequency image from the original thermal imaging image, where the high-frequency image displays an image edge of the original thermal imaging image.
[0079] S112, determining the image edge of the original thermal imaging image based on the high-frequency image.
[0080] In the embodiment of the present application, the high-frequency image is a black-and-white image with relatively large grayscale changes, and the high-frequency image can display the image edges and details in the thermal imaging image.
[0081] The electronic device can separate the high-frequency image from the original thermal imaging image by using Gaussian filtering, or can separate the high-frequency image from the original thermal imaging image by using mean difference. There is no limitation on this. The electronic device can determine the edge in the original thermal imaging image based on the obtained high-frequency image.
[0082] In an optional embodiment, in the high-frequency image, there are areas with pixel values greater than 0 and areas with pixel values less than or equal to 0. The areas with pixel values greater than 0 are areas where high-frequency information is located. Therefore, the electronic device can regard the areas with pixel values greater than 0 in the original thermal imaging image as image edges.
[0083] In the embodiment of the present application, the electronic device may also adopt an edge determination method in the related art to determine the edges in the original thermal imaging image, which is not limited to this.
[0084] In one embodiment of the present application, the electronic device can perform median filtering on the original thermal imaging image to obtain a filtered thermal imaging image. In this way, the noise points in the original thermal imaging image can be filtered out, making the filtered thermal imaging image smoother. The electronic device can separate the high-frequency image from the filtered thermal imaging image, and then obtain an edge-enhanced image based on the high-frequency image, making the edge-enhanced image smoother and improving the display effect of the edge-enhanced image.
[0085] In the embodiment of the present application, the electronic device may also use other methods to determine the image edge of the original thermal imaging image, which is not limited to this.
[0086] In one embodiment of the present application, the present application also provides a method for processing a thermal imaging image. Figure 3 , Figure 3 This is a third flow chart of a method for processing thermal imaging images provided in an embodiment of the present application. In this method, step S111 can be refined into the following steps.
[0087] Step S1111, taking each pixel point in the original thermal imaging image as the center of a preset window, calculating the average of the original pixel values of all the pixels in the preset window as the pixel average value of the pixel point.
[0088] In the embodiment of the present application, the preset window is a window of size N*N, and N can be set according to actual needs. For example, N is 9, 10 or 15, etc. The smaller N is, the smaller the image edge range is. In the case of median filtering of the original thermal imaging image, N is greater than the preset multiple of the window of the median filter. The preset multiple can also be set according to actual needs. For example, the preset multiple is 2, 3, etc. The original pixel value is the pixel value of the pixel point in the original thermal imaging image.
[0089] For each pixel in the original thermal imaging image, the electronic device calculates the average of the original pixel values of all pixels in a preset window centered on the pixel, and the average is the pixel average of the pixel in the original thermal imaging image. After obtaining the pixel average of each pixel in the original thermal imaging image, the low-frequency image corresponding to the original thermal imaging image can be obtained. The pixel value of each pixel in the low-frequency image is the pixel average of the corresponding pixel in the original thermal imaging image.
[0090] Step S1112, based on the original pixel value and the pixel mean of each pixel in the original thermal imaging image, determine the high-frequency pixel value of each pixel in the original thermal imaging image to obtain a high-frequency image.
[0091] In the embodiment of the present application, after obtaining the pixel mean value of each pixel in the original thermal imaging image, the electronic device determines the high-frequency pixel value of each pixel in the original thermal imaging image based on the original pixel value and the pixel mean value of each pixel in the original thermal imaging image to obtain a high-frequency image. The high-frequency pixel value is the pixel value of the pixel in the high-frequency image.
[0092] It can be understood that based on the pixel mean of the pixels in the original thermal imaging image, a low-frequency image corresponding to the original thermal imaging image can be obtained, and the difference between the original thermal imaging image and the low-frequency image is the high-frequency image. That is, the pixel value of each pixel in the high-frequency image is the difference between the original pixel value of the pixel and the pixel mean. Through the difference between the original pixel value of each pixel in the original thermal imaging image and the pixel mean, the electronic device can obtain the high-frequency pixel value of each pixel in the original thermal imaging image, and then obtain the high-frequency image.
[0093] In the embodiment of the present application, the high-frequency image is separated from the original thermal imaging image by using the mean difference of the pixel points. Compared with the Gaussian filtering method, the computational complexity of the electronic device is reduced, the CPU load is reduced, and the processing efficiency of the thermal imaging image is improved.
[0094] In one embodiment of the present application, the present application also provides a method for processing a thermal imaging image. Figure 4 , Figure 4This is a fourth flow chart of a method for processing thermal imaging images provided in an embodiment of the present application. In this method, step S1111 can be refined into the following steps.
[0095] Step S1111a, converting the original thermal imaging image into an integral image, the value of each pixel in the integral image is the sum of the pixel values of all pixels in the rectangular area corresponding to the pixel, and the rectangular area corresponding to the pixel is the rectangular area formed by the upper left corner pixel of the original thermal imaging image to the pixel.
[0096] In the embodiment of the present application, the electronic device may also use other integral image calculation methods in the relevant technology to calculate the integral image of the original thermal imaging image, which is not limited to this.
[0097] Step S1111b, based on the integral image, obtain the average of the original pixel values of all pixels in a preset window centered on each pixel as the pixel average of the pixel.
[0098] The pixel mean of each pixel in the original thermal imaging image is calculated based on the integral image, and there is no need to sum all the pixels in the preset window in turn and then calculate the mean, which further reduces the calculation amount of the electronic equipment and improves the processing efficiency of the thermal imaging image.
[0099] In one embodiment of the present application, based on the above Figure 3 or Figure 4 In the embodiment shown, in the above step S12, the brightness component of the pixel points at the edge of the image in the original thermal imaging image is improved. Specifically, for each pixel point at the edge of the image in the original thermal imaging image, the sum of the pixel mean value and the gain pixel value of the pixel point is used as the brightness component of the pixel point, and the gain pixel value is the pixel value obtained by linearly amplifying the difference between the original pixel value of the pixel point and the pixel mean value.
[0100] In one example, for each pixel at the edge of the original thermal imaging image, the electronic device can use the following formula to increase the brightness component of the pixel:
[0101] Y = (src-ave)*w+ave;
[0102] Wherein, Y represents the brightness component of the pixel, src represents the original pixel value of the pixel, ave represents the pixel mean value of the pixel, and w represents the preset brightness gain. (src-ave)*w represents the gain pixel value of the pixel.
[0103] In the embodiment of the present application, the preset brightness gain w can be set according to actual needs. For example, w can be 1.2, 1.5 or 2. The above src-ave can be understood as the high-frequency pixel value of the pixel point.
[0104] In another example, for each pixel at the edge of the original thermal imaging image, the electronic device can use the following formula to increase the brightness component of the pixel:
[0105] Y = (src - ave + x) + ave;
[0106] Wherein, Y represents the brightness component of the pixel, src represents the original pixel value of the pixel, ave represents the pixel mean value of the pixel, x represents the preset pixel value, and (src-ave+x) represents the gain pixel value of the pixel.
[0107] In the embodiment of the present application, the preset pixel value x can be set according to actual needs. For example, x can be 1, 3, 5 or 10.
[0108] For each pixel, the electronic device obtains a processed pixel value of the pixel based on the improved brightness component of the pixel, and further obtains a processed thermal imaging image.
[0109] In one embodiment of the present application, based on the above Figure 1 In the embodiment shown, the above step S13 may specifically be:
[0110] For each pixel at the edge of the original thermal imaging image, the weight of the pixel is used to perform a weighted sum of the brightness component of the pixel in the processed thermal imaging image and the brightness component of the preset edge color to obtain the edge enhanced brightness component of the pixel;
[0111] For each pixel at the edge of the image in the original thermal imaging image, the difference between the chromaticity component of the preset edge color and the chromaticity component of the pixel in the processed thermal imaging image is weighted by using the weight of the pixel to obtain the weighted chromaticity component difference of the pixel, and the sum of the weighted chromaticity component difference and the preset parameter value is used as the edge enhancement chromaticity component of the pixel;
[0112] For each pixel at the edge of the image in the original thermal imaging image, the difference between the saturation component of the preset edge color and the saturation component of the pixel in the processed thermal imaging image is weighted by using the weight of the pixel to obtain the weighted saturation component difference of the pixel, and the sum of the weighted saturation component difference and the preset parameter value is used as the edge enhancement saturation component of the pixel;
[0113] Based on the edge-enhanced brightness component, edge-enhanced chrominance component and edge-enhanced saturation component of each pixel at the edge of the image, an edge-enhanced image is obtained.
[0114] In one example, for each pixel point of the edge indicated by the high-frequency image in the original thermal imaging image, the electronic device may determine the edge enhancement brightness component of the pixel point using the following formula:
[0115] Y'=Y*(1-a)+colorY*a;
[0116] Among them, Y' represents the edge enhancement brightness component of the pixel, Y represents the brightness component of the pixel in the processed thermal imaging image, colorY represents the brightness component of the preset edge color, and a represents the weight of the pixel.
[0117] For each pixel point of the edge indicated by the high-frequency image in the original thermal imaging image, the electronic device can use the following formula to determine the edge enhancement chrominance component of the pixel point:
[0118] U'=(colorU-U)*a+δ;
[0119] Among them, U' represents the edge enhancement chromaticity component of the pixel, U represents the chromaticity component of the pixel in the processed thermal imaging image, colorU represents the chromaticity component of the preset edge color, a represents the weight of the pixel, and δ represents the preset parameter value.
[0120] For each pixel point of the edge indicated by the high-frequency image in the original thermal imaging image, the electronic device can determine the edge enhancement saturation component of the pixel point using the following formula:
[0121] V'=(colorV-V)*a+δ;
[0122] Wherein, V' represents the edge enhancement saturation component of the pixel, V represents the saturation component of the pixel in the processed thermal imaging image, colorV represents the saturation component of the preset edge color, a represents the weight of the pixel, and δ represents the preset parameter value.
[0123] Through the above method, the edge enhanced brightness component, edge enhanced chroma component and edge enhanced saturation component of each pixel at the edge of the image are obtained, and the pixel value of each pixel at the edge of the image is obtained. The image obtained by combining the pixel value of each pixel at the edge of the image with the pixel value of the pixel at the non-image edge in the processed thermal imaging image is the edge enhanced image.
[0124] The preset parameter value δ can be set according to actual needs. For example, δ can be 5, 10, 12 or 15, etc. δ can be greater than 0 to meet the requirement that the chromaticity component and the saturation component in the image cannot be 0.
[0125] The weight a of the pixel point can be a fixed value, or it can be determined according to the high-frequency pixel value of the pixel point. For example, the electronic device can set: when the high-frequency pixel value of the pixel point is 1-5, the weight a of the pixel point is 0.2; when the high-frequency pixel value of the pixel point is 6-10, the weight a of the pixel point is 0.3; when the high-frequency pixel value of the pixel point is 11-15, the weight a of the pixel point is 0.4; when the high-frequency pixel value of the pixel point is 16-20, the weight a of the pixel point is 0.5; when the high-frequency pixel value of the pixel point is greater than or equal to 21, the weight a of the pixel point is 0.6.
[0126] In the embodiment of the present application, a semi-transparent preset edge color is superimposed on the edge of the image through the pixel weight a.
[0127] In the embodiment of the present application, the electronic device may not perform any processing on the pixel points on the processed thermal imaging image that are not at the edge of the image, so as to further reduce the CPU load and improve the processing efficiency of the thermal imaging image.
[0128] Combine the following Figure 5 The process flow of the thermal imaging image processing method shown in the figure provides a detailed description of the thermal imaging image processing method provided in the embodiment of the present application.
[0129] Step S51: the electronic device obtains an original thermal imaging image.
[0130] Step S52: the electronic device performs median filtering on the original thermal imaging image to obtain a filtered thermal imaging image.
[0131] Step S53: the electronic device calculates the integral image of the filtered thermal imaging image.
[0132] In step S54, the electronic device separates a high-frequency image from the filtered thermal imaging image based on the integral image, and determines an image edge in the filtered thermal imaging image based on the high-frequency image.
[0133] In step S55, the electronic device adds the chroma component and saturation component of the black and white image to all pixels in the filtered thermal imaging image, and increases the brightness component of the pixels at the edge of the image in the filtered thermal imaging image to obtain a processed thermal imaging image.
[0134] Step S56, superimposing a semi-transparent preset edge color on the edge of the processed thermal imaging image to obtain an edge-enhanced image.
[0135] The description of the above steps S51-S56 is relatively simple, and the details can be found in the above Figure 1-3 Description of the part.
[0136] Corresponding to the above-mentioned thermal imaging image processing method, the present application embodiment also provides a thermal imaging image processing device, see Figure 6 As shown, the device comprises:
[0137] A determination unit 61, configured to determine an image edge of an original thermal imaging image;
[0138] A processing unit 62, configured to increase the brightness component of the pixel points at the edge of the original thermal imaging image to obtain a processed thermal imaging image, wherein the pixel points of the processed thermal imaging image have a chromaticity component and a saturation component;
[0139] The superimposition unit 63 is used to superimpose a semi-transparent preset edge color at the image edge in the processed thermal imaging image to obtain an edge-enhanced image.
[0140] Optionally, the determining unit 61 may be specifically configured to:
[0141] A high-frequency image is separated from the original thermal imaging image, wherein the high-frequency image shows an image edge of the original thermal imaging image;
[0142] An image edge of the original thermal imaging image is determined based on the high frequency image.
[0143] Optionally, the determining unit 61 may be specifically configured to:
[0144] Taking each pixel point in the original thermal imaging image as the center of a preset window, the average of the original pixel values of all the pixels in the preset window is calculated as the pixel average value of the pixel point;
[0145] Based on the original pixel value and the pixel mean of each pixel in the original thermal imaging image, the high-frequency pixel value of each pixel in the original thermal imaging image is determined to obtain a high-frequency image.
[0146] Optionally, the determining unit 61 may be specifically configured to:
[0147] The original thermal imaging image is converted into an integral image. The value of each pixel in the integral image is the sum of the pixel values of all pixels in the rectangular area corresponding to the pixel. The rectangular area corresponding to the pixel is the rectangular area formed by the upper left corner pixel of the original thermal imaging image to the pixel.
[0148] Based on the integral image, the average of the original pixel values of all pixels in a preset window centered on each pixel is obtained as the pixel average of the pixel.
[0149] Optionally, the processing unit 62 may be specifically configured to:
[0150] For each pixel at the edge of the image in the original thermal imaging image, the sum of the pixel mean value and the gain pixel value of the pixel is used as the brightness component of the pixel, and the gain pixel value is the pixel value obtained by linearly amplifying the difference between the original pixel value and the pixel mean of the pixel.
[0151] Optionally, the superimposing unit 63 may be specifically used for:
[0152] For each pixel at the edge of the original thermal imaging image, the weight of the pixel is used to perform a weighted sum of the brightness component of the pixel in the processed thermal imaging image and the brightness component of the preset edge color to obtain the edge enhanced brightness component of the pixel;
[0153] For each pixel at the edge of the image in the original thermal imaging image, the difference between the chromaticity component of the preset edge color and the chromaticity component of the pixel in the processed thermal imaging image is weighted by using the weight of the pixel to obtain the weighted chromaticity component difference of the pixel, and the sum of the weighted chromaticity component difference and the preset parameter value is used as the edge enhancement chromaticity component of the pixel;
[0154] For each pixel at the edge of the image in the original thermal imaging image, the difference between the saturation component of the preset edge color and the saturation component of the pixel in the processed thermal imaging image is weighted by using the weight of the pixel to obtain the weighted saturation component difference of the pixel, and the sum of the weighted saturation component difference and the preset parameter value is used as the edge enhancement saturation component of the pixel;
[0155] Based on the edge-enhanced brightness component, edge-enhanced chrominance component and edge-enhanced saturation component of each pixel at the edge of the image, an edge-enhanced image is obtained.
[0156] Optionally, the determination unit 61 can also be used to: before separating the high-frequency image from the original thermal imaging image, perform median filtering on the original thermal imaging image to obtain a filtered thermal imaging image; the preset multiple of the median filtering window is smaller than the preset window; and separate the high-frequency image from the filtered thermal imaging image.
[0157] In the technical solution provided in the embodiment of the present application, the image edge of the original thermal imaging image is determined, the brightness component of the pixel points at the image edge in the original thermal imaging image is increased, and a semi-transparent preset edge color is superimposed at the image edge to obtain an edge-enhanced image. The higher the brightness, the more obvious the object displayed in the image. In the embodiment of the present application, the image edge of the thermal imaging image in the fire rescue scene is enhanced by increasing the brightness component of the pixel points at the image edge. In addition, in the embodiment of the present application, a semi-transparent preset edge color is superimposed at the image edge, so that the features in the original thermal imaging image are not covered, and the color is superimposed in the original thermal imaging image, which forms a sharp contrast with the non-edge area where the preset edge color is not superimposed, and further enhances the image edge of the thermal imaging image in the fire rescue scene.
[0158] Corresponding to the above-mentioned method for processing thermal imaging images, the present application embodiment also provides an electronic device, such as Figure 7 As shown, it includes a processor 71 and a machine-readable storage medium 72, the machine-readable storage medium 72 stores a computer program that can be executed by the processor 71, and the processor 71 is prompted by the computer program to implement any of the above-mentioned steps of the thermal imaging image processing method.
[0159] The machine-readable storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the machine-readable storage medium may also be at least one storage device located away from the aforementioned processor.
[0160] The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0161] In another embodiment provided in the present application, a machine-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned steps of the thermal imaging image processing method is implemented.
[0162] In another embodiment provided in the present application, a computer program is also provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned steps of the method for processing thermal imaging images.
[0163] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0164] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0165] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, machine-readable storage medium, and computer program embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0166] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the protection scope of the present application.
Claims
1. A method for processing thermal imaging images, characterized in that: The method comprises: determining an image edge of an original thermal imaging image, wherein the original thermal imaging image has no chrominance component and no saturation component; Increasing the brightness component of the pixel points at the edge of the image in the original thermal imaging image to obtain a processed thermal imaging image, wherein the pixel points of the processed thermal imaging image are additionally provided with the chromaticity component and the saturation component of the black and white image; A semi-transparent preset edge color is superimposed at the edge of the image in the processed thermal imaging image to obtain an edge-enhanced image.
2. The method according to claim 1, characterized in that The step of determining the image edge of the original thermal imaging image comprises: Separating a high-frequency image from an original thermal imaging image, wherein the high-frequency image displays an image edge of the original thermal imaging image; An image edge of the original thermal imaging image is determined based on the high-frequency image.
3. The method according to claim 2, characterized in that The step of separating the high-frequency image from the original thermal imaging image comprises: Taking each pixel point in the original thermal imaging image as the center of a preset window, respectively, calculating the average of the original pixel values of all the pixel points in the preset window as the pixel average value of the pixel point; Based on the original pixel value and the pixel mean value of each pixel in the original thermal imaging image, the high-frequency pixel value of each pixel in the original thermal imaging image is determined to obtain the high-frequency image.
4. The method according to claim 3, characterized in that The method of taking each pixel point in the original thermal imaging image as the center of a preset window and calculating the average of the original pixel values of all the pixels in the preset window as the pixel average value of the pixel point comprises: Convert the original thermal imaging image into an integral image, wherein the value of each pixel in the integral image is the sum of the pixel values of all pixels in the rectangular area corresponding to the pixel, and the rectangular area corresponding to the pixel is the rectangular area formed by the upper left corner pixel of the original thermal imaging image to the pixel; Based on the integral image, the average of the original pixel values of all pixels in a preset window centered on each pixel is obtained as the pixel average of the pixel.
5. The method according to claim 3, characterized in that: The step of increasing the brightness component of the pixel points at the edge of the image in the original thermal imaging image comprises: For each pixel point at the edge of the image in the original thermal imaging image, the sum of the pixel mean value and the gain pixel value of the pixel point is used as the brightness component of the pixel point, and the gain pixel value is the pixel value obtained by linearly amplifying the difference between the original pixel value of the pixel point and the pixel mean value.
6. The method according to claim 1, characterized in that The step of superimposing a semi-transparent preset edge color at the edge of the image in the processed thermal imaging image to obtain an edge-enhanced image comprises: For each pixel at the edge of the image in the original thermal imaging image, using the weight of the pixel, weighted sum the brightness component of the pixel in the processed thermal imaging image and the brightness component of the preset edge color to obtain an edge enhanced brightness component of the pixel; For each pixel at the edge of the image in the original thermal imaging image, weighting the difference between the chromaticity component of the preset edge color and the chromaticity component of the pixel in the processed thermal imaging image using the weight of the pixel to obtain a weighted chromaticity component difference of the pixel, and taking the sum of the weighted chromaticity component difference and a preset parameter value as the edge enhancement chromaticity component of the pixel; For each pixel at the edge of the image in the original thermal imaging image, weighting the difference between the saturation component of the preset edge color and the saturation component of the pixel in the processed thermal imaging image using the weight of the pixel to obtain a weighted saturation component difference of the pixel, and taking the sum of the weighted saturation component difference and the preset parameter value as the edge enhancement saturation component of the pixel; The edge-enhanced image is obtained based on the edge-enhanced brightness component, the edge-enhanced chrominance component and the edge-enhanced saturation component of each pixel at the edge of the image.
7. The method according to any one of claims 3 to 5, characterized in that: Before separating the high-frequency image from the original thermal imaging image, the method further includes: Performing median filtering on the original thermal imaging image to obtain a filtered thermal imaging image; the preset multiple of the median filtering window is smaller than the preset window; A high-frequency image is separated from the filtered thermal imaging image.
8. A thermal imaging image processing device, characterized in that: The device comprises: A determination unit, configured to determine an image edge of an original thermal imaging image, wherein the original thermal imaging image does not have a chroma component and a saturation component; A processing unit, used for increasing the brightness component of the pixel points at the edge of the image in the original thermal imaging image to obtain a processed thermal imaging image, wherein the pixel points of the processed thermal imaging image are additionally provided with the chromaticity component and the saturation component of the black and white image; The superimposing unit is used to superimpose a semi-transparent preset edge color at the image edge in the processed thermal imaging image to obtain an edge-enhanced image.
9. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores a computer program executable by the processor, and the processor is prompted by the computer program to implement the method steps described in any one of claims 1 to 7.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Systems and methods for enhancing edges in images
US20190333192A1