Method and system for infrared image edge enhancement

By converting infrared images to grayscale images and performing edge detection and pseudo-color fusion, the problem of image distortion in existing technologies is solved, and the sharpness of infrared image edges is enhanced.

CN116109511BActive Publication Date: 2026-03-20WUHAN GUIDE SENSMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing infrared image edge enhancement techniques are blind in the full-image convolutional filtering operation, resulting in image distortion and loss of low-frequency effective information, making it difficult to quickly identify distant targets.

Method used

The infrared image is converted into a grayscale image. An edge intensity matrix and threshold are obtained through an edge detection algorithm. After filtering, pseudo-color is added, and the grayscale and color edge images are fused to enhance the edges.

Benefits of technology

It achieves clear display of infrared image edges, avoids image distortion, and enhances the recognizability of target edges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116109511B_ABST
    Figure CN116109511B_ABST
Patent Text Reader

Abstract

The application provides a method and system for infrared image edge enhancement, comprising: converting an original infrared image into a gray image; converting the original infrared image into an original edge image through a preset edge detection algorithm; performing filtering processing on the original edge image to obtain a smooth edge image; adding pseudo color to the smooth edge image to obtain a color edge image; and fusing the gray image and the color edge image to obtain an edge enhanced image. The gray image does not display color information but only displays brightness information, so that the edge of the image can be obviously displayed by fusing the color edge image on the gray image, thereby achieving the effect of image edge enhancement.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of infrared image, and particularly relates to a method and system for edge enhancement of infrared image. BACKGROUND

[0002] The edge information of infrared image is generally fuzzy, and the color gradient of infrared image is also not as rich as that of visible light image. In general, a long-distance target in an infrared image cannot be quickly identified, and thus an infrared image enhancement technique is needed to identify and enhance the edge of the target.

[0003] Common enhancement techniques include convolution filtering, high-pass filter filtering, morphological filtering, etc. After filtering operation is performed on the image, part of the low-frequency information is filtered out, and strong edge information is retained, so as to highlight the target boundary.

[0004] The existing image edge enhancement technique generally uses a morphological algorithm to perform sharpening enhancement on the whole image. This method does not introduce any edge detection, and although it can improve the edge effect of the image to a certain extent, the convolution filtering operation based on the whole image has a certain blindness and can cause image distortion, and a large amount of effective low-frequency information is lost. SUMMARY

[0005] The main purpose of the embodiment of the present application is to provide a method and system for edge enhancement of infrared image. The gray-scale image of the technical scheme of the present application only displays luminance information and does not display color information, and thus the fusion of the edge image with color on the gray-scale image can obviously display the edge of the infrared image, so as to achieve the effect of edge enhancement of the infrared image.

[0006] In a first aspect, a method for edge enhancement of an infrared image is provided, and the method comprises the following steps:

[0007] Converting an original infrared image into a gray-scale image;

[0008] Converting the original infrared image into an original edge image through a preset edge detection algorithm;

[0009] Performing filtering processing on the original edge image to obtain a smooth edge image;

[0010] Adding pseudo-color to the smooth edge image to obtain a color edge image;

[0011] Fusing the gray-scale image and the color edge image to obtain an edge-enhanced image.

[0012] In one possible implementation, the step of converting the original infrared image into an original edge image through a preset edge detection algorithm specifically comprises the following steps:

[0013] obtaining an edge intensity matrix of the original infrared image according to pixel gradient changes of the original infrared image;

[0014] calculating an edge intensity threshold of the original infrared image according to the edge intensity matrix;

[0015] judging whether the edge intensity corresponding to a coordinate point in the edge intensity matrix is greater than the edge intensity threshold, and further determining an edge pixel value of the coordinate point in the original edge image.

[0016] In another possible implementation, the obtaining the edge intensity matrix of the original infrared image according to the pixel gradient changes of the original infrared image includes:

[0017] obtaining a horizontal pixel gradient change G x and a vertical pixel gradient change G y of the original infrared image, and calculating the edge intensity matrix M;

[0018] the edge intensity matrix M is related to the G x and the G y .

[0019]

[0020] In another possible implementation, the calculating the edge intensity threshold of the original infrared image according to the edge intensity includes:

[0021] calculating an edge intensity histogram M_Hist according to the edge intensity matrix M;

[0022] calculating the edge intensity threshold of the original infrared image according to formula (I), where formula (I) is:

[0023]

[0024] where index represents a pixel index in the edge intensity histogram, threshold is the edge intensity threshold, width represents a width of the original infrared image, height represents a height of the original infrared image, and p represents a proportion of a pixel number less than the threshold threshold to a total pixel number in the original infrared image.

[0025] In another possible implementation, the judging whether the edge intensity corresponding to a coordinate point in the edge intensity matrix is greater than the edge intensity threshold, and further determining an edge pixel value of the coordinate point in the original edge image includes:

[0026] if the edge intensity corresponding to the coordinate point in the original infrared image is greater than the edge intensity threshold, the edge pixel value of the coordinate point is a product of the edge intensity and a preset coefficient;

[0027] if the edge intensity corresponding to the coordinate point in the original infrared image is less than or equal to the edge intensity threshold, the edge pixel value of the coordinate point is 0.

[0028] In another possible implementation, when the grayscale image is fused with the color edge image, the corresponding pixel value selection method of the coordinate point comprises:

[0029] traversing the smoothed edge image;

[0030] if the edge pixel value of the coordinate point is 0, the coordinate point does not represent edge information in the smoothed edge image, and the coordinate point selects the corresponding pixel value in the grayscale image;

[0031] if the edge pixel value of the coordinate point is not 0, the coordinate point represents edge information in the smoothed edge image, and the coordinate point selects the corresponding pixel value in the color edge image.

[0032] In another possible implementation, the preset coefficient comprises one of an amplification coefficient and a normalization factor.

[0033] In another possible implementation, the normalization factor is calculated in a manner of a difference ratio of a gray level of the grayscale image and a maximum pixel gradient and a minimum pixel gradient of the original infrared image; and the amplification coefficient is a preset value.

[0034] In another possible implementation, the original edge image is filtered in one of median filtering, mean filtering or Gaussian filtering.

[0035] In a second aspect, an infrared image edge enhancement system is provided, which comprises:

[0036] a grayscale image acquisition module configured to convert an original infrared image into a grayscale image;

[0037] an original edge image acquisition module configured to convert the original infrared image into an original edge image by using a preset edge detection algorithm;

[0038] a smoothed edge image acquisition module configured to filter the original edge image to obtain a smoothed edge image;

[0039] a color edge image module configured to add pseudo-color to the smoothed edge image to obtain a color edge image;

[0040] An edge enhancement image module is configured to fuse the gray-scale image with the color edge image to obtain an edge enhancement image.

[0041] The present application fuses the edge image with color on the gray-scale image according to the characteristic that the gray-scale image only displays luminance information but not color information, so that the edge of the image can be obviously displayed in the gray-scale image, thereby achieving the effect of image edge enhancement. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced.

[0043] Figure 1 The flow chart of the method for infrared image edge enhancement provided by one embodiment of the present application is shown in FIG. 1.

[0044] Figure 2 The flow chart of the method for infrared image edge enhancement provided by another embodiment of the present application is shown in FIG. 2.

[0045] Figure 3 The structure diagram of the system for infrared image edge enhancement provided by one embodiment of the present application is shown in FIG. 3.

[0046] Figure 4 The structure diagram of the system for infrared image edge enhancement provided by another embodiment of the present application is shown in FIG. 4.

[0047] Figure 5 The physical structure diagram of the electronic device of the present application is shown in FIG. 5.

[0048] Figure 6 The flow chart of the method for infrared image edge enhancement provided by the embodiment of the present application is shown in FIG. 6.

[0049] DETAILED DESCRIPTION

[0050] The embodiments of the present application will be described in detail below, and the examples of the embodiments are shown in the drawings, wherein the same or similar notations represent the same or similar modules or modules with the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be explained as the limitation of the present application.

[0051] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, modules, components, and / or groups thereof. It should be understood that when we say a module is “connected” or “coupled” to another module, it can be directly connected or coupled to the other module, or there may be an intermediate module. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein includes all or any of the modules and all combinations thereof of one or more associated listed items.

[0052] To make the objectives, technical solutions, and advantages of the present invention clearer, the implementation of the present invention will be described in further detail below with reference to the accompanying drawings.

[0053] The technical solutions of the present invention and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0054] like Figure 1 The diagram shows a flowchart of an infrared image edge enhancement method according to an embodiment of the present invention, the method comprising:

[0055] Step 101: Convert the original infrared image into a grayscale image;

[0056] Step 102: Convert the original infrared image into an original edge image using a preset edge detection algorithm;

[0057] Step 103: Filter the original edge image to obtain a smooth edge image;

[0058] Step 104: Add pseudo-color to the smoothed edge image to obtain a colored edge image;

[0059] Step 105: Fuse the grayscale image with the color edge image to obtain an edge-enhanced image.

[0060] In the embodiment of the present application, for the original infrared image, firstly, a gray image which can display the main information of the object more clearly and an edge image which can display the edge information of the object more clearly are obtained, and then the edge enhanced image is obtained by fusing the gray image and the edge image. In the process of obtaining the edge image, the original edge image is also subjected to smoothing processing and coloring processing, so that when the edge enhanced image is finally fused, a smooth edge image with obvious color edge can be generated, so that the enhanced infrared image can display the edge of the image more clearly.

[0061] In the embodiment of the present application, the original infrared image is converted into a gray image, the original infrared image is converted into an original edge image through a preset edge detection algorithm, the original edge image is subjected to filtering processing to obtain a smooth edge image, the smooth edge image is added with pseudo color to obtain a color edge image, and the gray image and the color edge image are fused to obtain an edge enhanced image. The gray image displays only the brightness information and does not display color information, so that the edge of the image can be obviously displayed by fusing the color edge image on the gray image, so as to achieve the effect of image edge enhancement.

[0062] As shown in Figure 2 Fig. 2 is a flow chart of a method for enhancing the edge of an infrared image according to another embodiment of the present application, and the method comprises the following steps:

[0063] In step 201, the edge intensity matrix of the original infrared image is obtained according to the gradient change of the pixels of the original infrared image.

[0064] In step 202, the edge intensity threshold of the original infrared image is calculated according to the edge intensity matrix.

[0065] In step 203, whether the edge intensity corresponding to the coordinate point in the edge intensity matrix is greater than the edge intensity threshold is judged, and then the edge pixel value of the coordinate point in the original edge image is determined.

[0066] In the embodiment of the present application, the edge intensity matrix of the original infrared image is obtained according to the gradient change of the pixels of the original infrared image, the edge intensity threshold is obtained by calculating the edge intensity matrix, the edge intensity of each pixel in the original infrared image is compared with the edge intensity threshold, and the pixel value corresponding to the pixel point greater than the edge intensity threshold can be obtained.

[0067] In the embodiment of the present application, the edge intensity matrix of the original infrared image is obtained according to the gradient change of the pixels of the original infrared image, the edge intensity matrix of the original infrared image is obtained according to the gradient change of the pixels of the original infrared image, and the edge intensity matrix of the original infrared image is obtained according to the gradient change of the pixels of the original infrared image.

[0068] Obtaining the pixel gradient change G in the horizontal direction of the original infrared image x and the pixel gradient change G in the vertical direction y , to obtain the edge intensity matrix M.

[0069] The relationship between the edge intensity matrix M and the Gx and the Gy is:

[0070] In the embodiment of the present application, the pixel gradient change G in the horizontal direction of the original infrared image x may be obtained according to the formula , and the pixel gradient change G in the vertical direction y may be obtained according to the formula After the G x and the G y are obtained, the edge intensity matrix M can be obtained according to the formula .

[0071] The edge intensity threshold of the original infrared image is calculated from the edge intensity, and the specific method comprises:

[0072] The edge intensity histogram M_Hist is calculated from the edge intensity matrix M.

[0073] The edge intensity threshold of the original infrared image is calculated by formula (I), and the formula (I) is:

[0074]

[0075] Wherein: index represents the pixel index in the edge intensity histogram; threshold is the edge intensity threshold; width represents the width of the original infrared image; height represents the height of the original infrared image; and p represents the proportion of the number of pixels less than the threshold threshold in the original infrared image to the total number of pixels.

[0076] The edge intensity threshold of the original infrared image is calculated from the edge intensity, and the specific method comprises:

[0077] If the edge intensity of the coordinate point in the original infrared image is greater than the edge intensity threshold, the edge pixel value of the coordinate point is the product of the edge intensity and a preset coefficient.

[0078] If the edge intensity of the coordinate point in the original infrared image is less than or equal to the edge intensity threshold, the edge pixel value of the coordinate point is 0.

[0079] In the embodiment of the present application, the edge intensity threshold of the original infrared image can be obtained according to the formula The relationship between the edge pixel value and the edge pixel threshold value is displayed: if the edge intensity corresponding to the coordinate point in the original infrared image is less than or equal to the edge intensity threshold value, the edge pixel value of the coordinate point is 0; if the edge intensity corresponding to the coordinate point in the original infrared image is greater than the edge intensity threshold value, the edge pixel value of the coordinate point is the product of the edge intensity and a preset coefficient, wherein M is the edge intensity, the amplification coefficient c and the normalization factor factor are the preset coefficients, and in the specific calculation process, the preset coefficients can be selected as one of the amplification coefficient c and the normalization factor factor, and the normalization factor factor can be obtained by the difference ratio of the gray level of the gray image and the maximum pixel gradient value and the minimum pixel gradient value of the original infrared image, and the amplification coefficient c is a preset value.

[0080] When the gray image and the color edge image are fused, the corresponding pixel value selection method of the coordinate point comprises:

[0081] The smooth edge image is traversed;

[0082] If the edge pixel value of the coordinate point is 0, the coordinate point does not represent edge information in the smooth edge image, and the coordinate point selects the corresponding pixel value in the gray image;

[0083] If the edge pixel value of the coordinate point is not 0, the coordinate point represents edge information in the smooth edge image, and the coordinate point selects the corresponding pixel value in the color edge image.

[0084] In the embodiment of the application, for the gray image and the color edge image in the fusion process, the selection of the pixel value of each pixel point of the fusion part is realized according to the following principles: if the edge pixel value of the coordinate point is 0, the coordinate point does not represent edge information in the smooth edge image, and the coordinate point selects the corresponding pixel value in the gray image; if the edge pixel value of the coordinate point is not 0, the coordinate point represents edge information in the smooth edge image, and the coordinate point selects the corresponding pixel value in the color edge image.

[0085] The selection method can be displayed according to the formula , wherein i is the index of the pixel point, Edge_image[i] is the pixel value of the i point in the smooth edge image, Gray_image[i] is the pixel value of the i point in the gray image, and Color_edge_image[i] is the pixel value of the i point in the color edge image.

[0086] As shown in Figure 3 The structure diagram of the system for enhancing the edge of the infrared image provided by the embodiment of the application, the system comprises:

[0087] The grayscale image acquisition module 301 is used to convert the original infrared image into a grayscale image through dimming processing;

[0088] The original edge image acquisition module 302 is used to convert the original infrared image into an original edge image using a preset edge detection algorithm;

[0089] The smooth edge image acquisition module 303 is used to filter the original edge image to obtain a smooth edge image;

[0090] The color edge image module 304 is used to add pseudo-color processing to the smooth edge image to obtain a color edge image;

[0091] The edge enhancement image module 305 is used to fuse and enhance the grayscale image and the color edge image to obtain an edge enhancement image.

[0092] In this embodiment of the invention, the original infrared image is first processed by acquiring a grayscale image that clearly displays the main structure of the object and an edge image that clearly displays the edge information of the object. Then, the grayscale image and the edge image are fused to obtain the edge-enhanced image. During the edge image acquisition process, the original edge image is also smoothed and colored. This results in a smooth edge image with clearly colored edges when finally fused into the edge-enhanced image, allowing the enhanced infrared image to display the edges of the image more clearly.

[0093] In this embodiment of the invention, the original infrared image is converted into a grayscale image; a preset edge detection algorithm is used to convert the original infrared image into an original edge image; the original edge image is filtered to obtain a smooth edge image; pseudo-color is added to the smooth edge image to obtain a colored edge image; and the grayscale image and the colored edge image are fused to obtain an edge-enhanced image. Since grayscale images only display brightness information and not color information, fusing a colored edge image onto a grayscale image can clearly display the edges of the image, thereby achieving the effect of image edge enhancement.

[0094] like Figure 4 The diagram shown is a structural diagram of an infrared image edge enhancement system provided in another embodiment of the present invention. The original edge image acquisition module 302 includes:

[0095] The edge intensity matrix acquisition unit 401 is used to obtain the edge intensity matrix of the original infrared image from the pixel gradient changes of the original infrared image;

[0096] The edge intensity threshold acquisition unit 402 is used to calculate the edge intensity threshold of the original infrared image from the edge intensity matrix;

[0097] The edge pixel value determination unit 403 is configured to determine whether the edge strength corresponding to a coordinate point in the edge strength matrix is greater than the edge strength threshold value, and further determine the edge pixel value of the coordinate point in the original edge image.

[0098] In the embodiment of the present application, the edge strength matrix of the original infrared image is obtained according to the gradient change of each pixel in the original infrared image, the edge strength threshold value is obtained by calculating the edge strength matrix, and the edge strength of each pixel in the original infrared image is compared with the edge strength threshold value, and the pixel value corresponding to the pixel greater than the edge strength threshold value is obtained.

[0099] The edge strength matrix of the original infrared image is obtained according to the gradient change of each pixel in the original infrared image, the edge strength threshold value is obtained by calculating the edge strength matrix, and the edge strength of each pixel in the original infrared image is compared with the edge strength threshold value, and the pixel value corresponding to the pixel greater than the edge strength threshold value is obtained.

[0100] The horizontal pixel gradient change Gx of the original infrared image is obtained x and the vertical pixel gradient change Gy of the original infrared image is obtained y , and the edge strength matrix M is calculated.

[0101] The relationship between the edge strength matrix M and the Gx and the Gy is:

[0102] In the embodiment of the present application, the horizontal pixel gradient change Gx of the original infrared image is obtained x according to the formula , and the vertical pixel gradient change Gy of the original infrared image is obtained y according to the formula After the Gx and the Gy are obtained x , the edge strength matrix M is obtained according to the formula y

[0103] The edge strength threshold value of the original infrared image is obtained by calculating the edge strength, and the specific method includes:

[0104] The edge strength histogram M_Hist is calculated from the edge strength matrix M.

[0105] The edge strength threshold value of the original infrared image is calculated by the formula (I), and the formula (I) is:

[0106]

[0107] ​​Wherein: index represents the pixel index in the edge intensity histogram; threshold is the edge intensity threshold; width represents the width of the original infrared image; height represents the height of the original infrared image; p represents the proportion of the number of pixels less than the threshold threshold in the original infrared image to the total number of pixels.

[0108] Wherein, the judgment of whether the edge intensity corresponding to the coordinate point in the edge intensity matrix is greater than the edge intensity threshold, and the determination of the edge pixel value of the coordinate point in the original edge image, the specific method comprises:

[0109] If the edge intensity corresponding to the coordinate point in the original infrared image is greater than the edge intensity threshold, the edge pixel value of the coordinate point is the product of the edge intensity and the preset coefficient.

[0110] If the edge intensity corresponding to the coordinate point in the original infrared image is less than or equal to the edge intensity threshold, the edge pixel value of the coordinate point is 0.

[0111] In the embodiment of the application, the relationship between the edge pixel value and the edge pixel threshold can be shown according to the formula

[0112]

[0113] The relationship between the edge pixel value and the edge pixel threshold is shown: if the edge intensity corresponding to the coordinate point in the original infrared image is less than or equal to the edge intensity threshold, the edge pixel value of the coordinate point is 0; if the edge intensity corresponding to the coordinate point in the original infrared image is greater than the edge intensity threshold, the edge pixel value of the coordinate point is the product of the edge intensity and the preset coefficient, wherein M is the edge intensity, the amplification coefficient c and the normalization factor factor are the preset coefficients, and in the specific calculation process, the preset coefficients can be selected as one of the amplification coefficient c and the normalization factor factor, and the normalization factor factor can be obtained by the difference ratio of the gray level of the gray image and the maximum pixel gradient value and the minimum pixel gradient value of the original infrared image, and the amplification coefficient c is a preset value.

[0114] Wherein, when the gray image and the color edge image are fused, the corresponding pixel value selection method of the coordinate point comprises:

[0115] Traverse the smoothed edge image;

[0116] If the edge pixel value of the coordinate point is 0, the coordinate point does not represent edge information in the smoothed edge image, and the coordinate point selects the corresponding pixel value in the gray image.

[0117] If the edge pixel value of the coordinate point is not 0, the coordinate point represents edge information in the smoothed edge image, and the coordinate point selects the corresponding pixel value in the color edge image.

[0118] In the embodiment of the present application, for the grayscale image and the color edge image in the fusion process, the selection of the pixel value of each pixel point of the fusion part is implemented according to the following principle: if the edge pixel value of the coordinate point is 0, the coordinate point does not represent edge information in the smoothed edge image, and the coordinate point selects the corresponding pixel value in the grayscale image; if the edge pixel value of the coordinate point is not 0, the coordinate point represents edge information in the smoothed edge image, and the coordinate point selects the corresponding pixel value in the color edge image.

[0119] For the selection method, the formula

[0120]

[0121] is used to display, wherein i is the index of the pixel point, Edge_image[i] is the pixel value of i point in the smoothed edge image, Gray_image[i] is the pixel value of i point in the grayscale image, and Color_edge_image[i] is the pixel value of i point in the color edge image.

[0122] In the embodiment of the present application, the role of the normalization factor factor is to normalize the edge intensity matrix of the original infrared image to the interval of 0-255, so that subsequent calculation processes can be facilitated. It is found through actual tests that the change range of p is very small, and in order to simplify the calculation, p can be opened as a user parameter, that is, the value of p can be adjusted by the user according to actual needs, and the preferred value of p can be set to 0.95.

[0123] Figure 5 An example of a schematic diagram of the physical structure of an electronic device is shown in FIG. 1. Figure 5 As shown in FIG. 1, the electronic device can include a processor 501, a communications interface 502, a memory 503, and a communications bus 504, wherein the processor, the communications interface, and the memory complete mutual communication through the communications bus. The processor can invoke the logical instructions in the memory to execute the method for infrared image edge enhancement, which includes: converting an original infrared image into a grayscale image; converting the original infrared image into an original edge image through a preset edge detection algorithm; performing filtering processing on the original edge image to obtain a smoothed edge image; adding pseudo-color to the smoothed edge image to obtain a color edge image; and fusing the grayscale image and the color edge image to obtain an edge-enhanced image.

[0124] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0125] On the other hand, embodiments of the present invention also provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the infrared image edge enhancement method provided in the above method embodiments, the method including: converting the original infrared image into a grayscale image; converting the original infrared image into an original edge image using a preset edge detection algorithm; filtering the original edge image to obtain a smooth edge image; adding pseudo-color to the smooth edge image to obtain a color edge image; and fusing the grayscale image and the color edge image to obtain an edge-enhanced image.

[0126] In another aspect, embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the infrared image edge enhancement method provided in the above embodiments. The method includes: converting an original infrared image into a grayscale image; converting the original infrared image into an original edge image using a preset edge detection algorithm; filtering the original edge image to obtain a smooth edge image; adding pseudo-color to the smooth edge image to obtain a color edge image; and fusing the grayscale image and the color edge image to obtain an edge-enhanced image.

[0127] like Figure 6As shown is a flowchart of a method for infrared image edge enhancement provided by an embodiment of the present application, the method flow includes: 1, converting an original 16-bit resolution infrared Y16 image into an 8-bit grayscale image through dimming; 2, converting the infrared Y16 image into an original edge image through a preset edge detection algorithm; 3, performing filtering processing on the original edge image obtained in step 2 to obtain a smooth edge image; 4, performing pseudo-color adding processing on the smooth edge image obtained in step 3 to obtain a color edge image; 4, performing image fusion on the grayscale image of step 1 and the color edge image of step 4 to obtain an edge enhancement image.

[0128] It should be understood that although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.

[0129] The above only describes some implementation manners of the present application, and it should be noted that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A method for edge enhancement of infrared images, characterized in that, The method includes: converting the original infrared image into a grayscale image; converting the original infrared image into an original edge image using a preset edge detection algorithm; filtering the original edge image to obtain a smooth edge image; adding pseudo-color to the smooth edge image to obtain a colored edge image; and fusing the grayscale image and the colored edge image to obtain an edge-enhanced image. Specifically, the method of converting the original infrared image into an original edge image using the preset edge detection algorithm includes: obtaining an edge intensity matrix of the original infrared image from the pixel gradient changes of the original infrared image; calculating an edge intensity threshold of the original infrared image from the edge intensity matrix; determining whether the edge intensity corresponding to a coordinate point in the edge intensity matrix is ​​greater than the edge intensity threshold, and thus determining the edge pixel value of the coordinate point in the original edge image. Specifically, if the edge intensity corresponding to a coordinate point in the original infrared image is greater than the edge intensity threshold, then the edge pixel value of the coordinate point is the product of the edge intensity and a preset coefficient; if the edge intensity corresponding to a coordinate point in the original infrared image is less than or equal to the edge intensity threshold, then the edge pixel value of the coordinate point is 0. When fusing the grayscale image with the color edge image, the method for selecting the corresponding pixel value of the coordinate point includes: traversing the smooth edge image; if the edge pixel value of the coordinate point is 0, then the coordinate point does not represent edge information in the smooth edge image, and the corresponding pixel value in the grayscale image is selected for the coordinate point; if the edge pixel value of the coordinate point is not 0, then the coordinate point represents edge information in the smooth edge image, and the corresponding pixel value in the color edge image is selected for the coordinate point.

2. The method as described in claim 1, characterized in that, The method for obtaining the edge intensity matrix of the original infrared image from the pixel gradient changes of the original infrared image specifically includes: obtaining the horizontal pixel gradient change G in the original infrared image. x and the pixel gradient change in the vertical direction G y The edge intensity matrix M is calculated; the edge intensity matrix M and the G x and the G y The relationship is: 。 3. The method as described in claim 1, characterized in that, The method for calculating the edge intensity threshold of the original infrared image from the edge intensity includes: calculating the edge intensity histogram M_Hist from the edge intensity matrix M; and calculating the edge intensity threshold of the original infrared image using formula (I), which is: Where: index represents the pixel index in the edge intensity histogram; threshold is the edge intensity threshold; width represents the width of the original infrared image; height represents the height of the original infrared image; p represents the proportion of the number of pixels smaller than the threshold in the original infrared image to the total number of pixels in the image.

4. The method as described in claim 1, characterized in that, The preset coefficients include one of the amplification coefficient and the normalization factor.

5. The method as described in claim 4, characterized in that, The normalization factor is calculated as the ratio of the difference between the gray level of the grayscale image and the difference between the maximum and minimum pixel gradient values ​​of the original infrared image; the magnification factor is a preset value.

6. The method as described in claim 1, characterized in that, The original edge image is subjected to one of median filtering, mean filtering, or Gaussian filtering.