Image Enhancement Method for Infrared Scene Images of Resistance Arrays Based on Image Processing
Through image processing technology, abnormal areas in the infrared image of the resistor array are analyzed and screened, pixel point correction coefficients are obtained and grayscale value correction is performed, which solves the impact of temperature mixing on infrared images and improves the display effect and accuracy of the image.
Patent Information
- Application Number
- CN202510147050.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-11
AI Technical Summary
When using resistor array infrared images, existing infrared image enhancement technology is difficult to effectively deal with abnormal areas caused by temperature mixing, affecting the display effect of the image.
Through image processing technology, the resistance area and background area in the infrared image of the resistor array are obtained, the distance between the initial abnormal resistance area and the adjacent resistance area, the deviation in the gradient direction and the area of the adjacent resistance area are analyzed, the abnormal resistance area and the normal resistance area are selected, and the background area is clustered, the difference in area proportion and grayscale performance of the class cluster are analyzed, and the abnormal background sub-region and normal background sub-region are selected. Based on these analysis results, the pixel point correction coefficient in each abnormal resistance region is obtained, and the pixel point grayscale values in the abnormal resistance region and the abnormal background sub-region are corrected to obtain the enhanced infrared image.
It effectively reduces the impact of temperature mixing on infrared images, improves the display effect and accuracy of infrared images, and significantly improves the clarity and contrast of infrared images in resistive arrays.
Smart Images

Figure CN119624841B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of infrared image enhancement, and particularly to an image enhancement method for a resistor array infrared scene image based on image processing. Background Art
[0002] The resistor array infrared image enhancement technology is a technology for improving the quality and resolution of infrared images. By enhancing different regions in the resistor array infrared image, the clarity and contrast of the infrared image are significantly improved, enabling subtle infrared radiation to be presented more accurately.
[0003] When the existing methods enhance the infrared image, they achieve enhancement by obtaining the positions of the resistor region and the background region in the infrared image and increasing the contrast between the two regions. Then, for the infrared image of the resistor array, during the operation of the resistor array, when current passes through the resistor, the temperature at the resistor will increase. The increase in the temperature of the resistor region will radiate other regions around the resistor, resulting in a temperature mixing phenomenon in some regions, which shows abnormalities in the infrared image. If the influence of the temperature mixing phenomenon on the infrared image is not analyzed, the display effect of the infrared image will be poor. Summary of the Invention
[0004] To solve the above problems, the present invention provides an image enhancement method for a resistor array infrared scene image based on image processing.
[0005] The image enhancement method for a resistor array infrared scene image based on image processing of the present invention adopts the following technical solutions:
[0006] An embodiment of the present invention provides an image enhancement method for a resistor array infrared scene image, and the method includes the following steps:
[0007] Obtain an infrared image of a resistor array, where the infrared image includes a plurality of resistor regions and a background region;
[0008] According to the gradient values of the resistor regions, screen a plurality of initial abnormal resistor regions; according to the distances between the initial abnormal resistor regions and adjacent resistor regions, the deviations of the gradient directions, and the areas of the adjacent resistor regions, obtain the influence degree of each adjacent resistor region on each initial abnormal resistor region; according to the change in the gray value within the initial abnormal resistor region and the influence degree, obtain the possibility of each initial abnormal resistor region belonging to an abnormal resistor region, and screen out the abnormal resistor regions and normal resistor regions;
[0009] Cluster the pixel points in the background region to obtain a plurality of clusters; according to the area ratio of the clusters in the background region and the gray value performance difference between the clusters and the background region, obtain the possibility of each cluster belonging to an abnormal background sub-region, and screen out the abnormal background sub-regions and normal background sub-regions;
[0010] Obtain the correction coefficient of each pixel point in each abnormal resistance region according to the area of the normal resistance region closest to the abnormal resistance region and the distance between the pixel points in the abnormal resistance region and the closest normal resistance region; according to the correction coefficient and the normal background sub-region, correct the gray values of the pixel points in the abnormal resistance region and the abnormal background sub-region respectively to obtain the enhanced infrared image.
[0011] Further, after obtaining the infrared image of the resistor array, it further includes:
[0012] Obtain the resistor array image, input the resistor array image into the semantic segmentation network to obtain several first resistor regions; regard the region corresponding to each first resistor region in the resistor array image in the infrared image as the resistor region of the infrared image, and regard the remaining region in the infrared image except the resistor region as the background region of the infrared image.
[0013] Further, the specific steps included in obtaining the influence degree of each initial abnormal resistance region by each adjacent resistance region according to the distance between the initial abnormal resistance region and the adjacent resistance region, the deviation of the gradient direction, and the area of the adjacent resistance region are as follows:
[0014] For any initial abnormal resistance region, denote any adjacent resistance region of the initial abnormal resistance region as the first adjacent resistance region; take the absolute value of the difference between the corresponding angular values of the gradient directions of the initial abnormal resistance region and the first adjacent resistance region as the deviation of the gradient direction between the first adjacent resistance region and the initial abnormal resistance region; fuse the distance between the initial abnormal resistance region and the first adjacent resistance region, the deviation of the gradient direction, and the area of the first adjacent resistance region to obtain the influence degree of the initial abnormal resistance region by the first adjacent resistance region; the distance between the initial abnormal resistance region and the first adjacent resistance region, the deviation of the gradient direction are inversely proportional to the influence degree, and the area of the first adjacent resistance region is directly proportional to the influence degree.
[0015] Further, the specific steps included in obtaining the possibility of each initial abnormal resistance region belonging to the abnormal resistance region according to the change of the gray value in the initial abnormal resistance region and the influence degree are as follows:
[0016] For any initial abnormal resistance region, the variance of the gray values of the pixel points within the initial abnormal resistance region is used as the change feature of the gray values within the initial abnormal resistance region; the average value of the influence degrees of the initial abnormal resistance region by all adjacent resistance regions is obtained; the change feature of the gray values within the initial abnormal resistance region and the average value of the influence degrees of the initial abnormal resistance region by all adjacent resistance regions are fused to obtain the possibility that the initial abnormal resistance region belongs to an abnormal resistance region; the change feature of the gray values within the initial abnormal resistance region, the average value of the influence degrees of the initial abnormal resistance region by all adjacent resistance regions, and the possibility that the initial abnormal resistance region belongs to an abnormal resistance region are in a direct proportion relationship.
[0017] Further, the steps for screening out abnormal resistance regions and normal resistance regions are as follows:
[0018] A second threshold is preset, and the initial abnormal resistance regions with a possibility of belonging to an abnormal resistance region greater than the second threshold are used as abnormal resistance regions, and vice versa as normal resistance regions.
[0019] Further, the steps for obtaining the possibility that each cluster belongs to an abnormal background sub-region according to the area ratio of the cluster in the background region and the gray value performance difference between the cluster and the background region are as follows:
[0020] For any cluster; the difference between the average gray value of the pixel points in the cluster and the average gray value of the pixel points in the background region is used as the gray value performance difference between the cluster and the background region; the area ratio of the cluster in the background region and the gray value performance difference between the cluster and the background region are fused to obtain the possibility that the cluster belongs to an abnormal background sub-region; the area ratio of the cluster in the background region, the gray value performance difference between the cluster and the background region, and the possibility that the cluster belongs to an abnormal background sub-region are in an inverse proportion relationship.
[0021] Further, the steps for obtaining the correction coefficient of each pixel point within each abnormal resistance region according to the area of the normal resistance region closest to the abnormal resistance region and the distance between the pixel points within the abnormal resistance region and the closest normal resistance region are as follows:
[0022] For any abnormal resistance region, the normal resistance region closest to the abnormal resistance region is denoted as the first normal resistance region; for any pixel point within the abnormal resistance region, the distance between the pixel point within the abnormal resistance region and the central pixel point of the first normal resistance region is used as the distance between the pixel point within the abnormal resistance region and the first normal resistance region; the area of the first normal resistance region and the distance between the pixel point within the abnormal resistance region and the first normal resistance region are fused to obtain the correction coefficient of the pixel point within the abnormal resistance region; the area of the first normal resistance region is directly proportional to the correction coefficient of the pixel point within the abnormal resistance region, and the distance between the pixel point within the abnormal resistance region and the first normal resistance region is inversely proportional to the correction coefficient of the pixel point within the abnormal resistance region; the correction coefficient is a normalized value.
[0023] Further, the specific steps for correcting the gray values of the pixel points in the abnormal resistance region and the abnormal background sub-region according to the correction coefficient and the normal background sub-region, and obtaining the enhanced infrared image are as follows:
[0024] Multiply the correction coefficient of each pixel point within each abnormal resistance region by the initial gray value of the pixel point to obtain the corrected gray value of each pixel point within each abnormal resistance region; use the average gray value of the pixel points in all normal background sub-regions as the corrected gray value of each pixel point in the abnormal background sub-region; obtain the enhanced infrared image according to the corrected gray value.
[0025] Further, the specific steps for clustering the pixel points in the background region to obtain several clusters are as follows:
[0026] Perform K-means clustering on the pixel points in the background region, and use the absolute value of the difference in gray values between pixel points as the distance metric to obtain several clusters.
[0027] Further, the specific steps for screening several initial abnormal resistance regions according to the gradient value of the resistance region are as follows:
[0028] Preset a first threshold, and use the resistance region with a gradient value greater than the first threshold as the initial abnormal resistance region, where the first threshold is 100.
[0029] The beneficial effects of the technical solution of the present invention are as follows: After obtaining the infrared image of the resistor array, the present invention obtains several resistor regions and background regions of the infrared image through the resistor array image, reduces the interference between different regions, and enables better determination of abnormal regions in the follow-up; by analyzing the distance between the initial abnormal resistor region and adjacent resistor regions, the deviation of the gradient direction, and the area of adjacent resistor regions, the influence degree of each adjacent resistor region on each initial abnormal resistor region is obtained, and then combined with the change of the gray value in the initial abnormal resistor region, the abnormal resistor region and the normal resistor region are obtained, improving the accuracy of determining the abnormal resistor region; by analyzing the area ratio of the cluster in the background region and the gray value difference between the cluster and the background region, the possibility of each cluster belonging to the abnormal background sub-region is obtained, and the abnormal background sub-region and the normal background sub-region are screened out; the accuracy of determining the abnormal resistor region and the abnormal background sub-region under the influence of temperature mixing is improved. Finally, by obtaining the correction coefficient of each pixel point in each abnormal resistor region; according to the correction coefficient and the normal background sub-region, the gray values of the pixel points in the abnormal resistor region and the abnormal background sub-region are corrected respectively, and the enhanced infrared image is obtained, reducing the influence of temperature mixing on the infrared image and improving the display effect of the infrared image. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0031] Figure 1 It is a flowchart of the steps of an image enhancement method for an infrared scene image of a resistor array based on image processing provided by an embodiment of the present invention;
[0032] Figure 2 It is a flowchart for obtaining the enhanced infrared image provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following, in combination with the accompanying drawings and preferred embodiments, details the specific implementation manners, structures, features and effects of the image enhancement method for an infrared scene image of a resistor array based on image processing proposed by the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0035] The following specifically describes the specific solution of the image enhancement method for the infrared scene image of a resistor array based on image processing provided by the present invention in conjunction with the accompanying drawings.
[0036] Please refer to Figure 1 and Figure 2 , which shows the flowchart of the steps of the image enhancement method for the infrared scene image of a resistor array based on image processing provided by an embodiment of the present invention and the flowchart of obtaining the enhanced infrared image. The method includes the following steps:
[0037] Step S001, obtain the infrared image of the resistor array, and the infrared image includes several resistor regions and a background region.
[0038] It should be noted that the main purpose of this embodiment is to determine the abnormal resistor regions and abnormal background sub-regions caused by temperature mixing in the infrared image of the resistor array, so as to correct these two regions and obtain the enhanced infrared image. Before starting the analysis, data is first obtained.
[0039] Specifically, obtaining the infrared image of the resistor array, which includes several resistor regions and a background region on the infrared image, includes the following steps:
[0040] First, obtain the resistor array image and the infrared image of the resistor array.
[0041] Secondly, according to the resistor array image, obtain several resistor regions and a background region of the infrared image.
[0042] Specifically, obtaining the resistor array image and the infrared image of the resistor array is as follows:
[0043] Obtain the resistor array image and the infrared image of the resistor array through an infrared camera; it should be noted that the infrared camera can simultaneously capture the resistor array image and the infrared image of the resistor array. The resistor array image is an RGB image, the infrared image of the resistor array is a grayscale image, the sizes of the resistor array image and the infrared image of the resistor array are the same, and the resistor distribution positions in the two images are the same.
[0044] It should be noted that during the operation of the resistor array, when current passes through the resistors, the temperature at the resistors will increase. The increase in the temperature of the resistor area will radiate to other areas around the resistors, that is, the background area, causing its temperature to rise. Due to different temperature manifestations, temperature mixing phenomena will occur in a small number of areas, making the resistor area and the background area in the infrared image show abnormalities. For the convenience of subsequent analysis, it is necessary to obtain the resistor area and the background area from the infrared image here. Since the resistor array image is an RGB image and is not affected by temperature like an infrared image, the resistor area and the background area in the infrared image are obtained by combining the resistor array image.
[0045] Specifically, according to the resistor array image, several resistor areas and background areas of the infrared image are obtained as follows:
[0046] Input the resistor array image into the semantic segmentation network to obtain several first resistor areas. It should be noted that the semantic segmentation network used in this embodiment is the DeepLabV3 network, which is a well-known technology. The specific structure and training method of this network will not be elaborated here; the area corresponding to each first resistor area in the resistor array image in the infrared image is used as the resistor area of the infrared image, and the remaining area in the infrared image except the resistor area is used as the background area of the infrared image.
[0047] So far, several resistor areas and background areas of the infrared image have been obtained.
[0048] Step S002: Screen several initial abnormal resistor areas according to the gradient values of the resistor areas; obtain the influence degree of each initial abnormal resistor area on each adjacent resistor area according to the distance, deviation of the gradient direction, and area of the adjacent resistor area between the initial abnormal resistor area and the adjacent resistor area; obtain the possibility that each initial abnormal resistor area belongs to the abnormal resistor area according to the change in the gray value and the influence degree within the initial abnormal resistor area, and screen out the abnormal resistor areas and the normal resistor areas.
[0049] It should be noted that when there is a temperature mixing phenomenon in the resistor area, there will be normal and abnormal temperature manifestations in the resistor area. The specific reflection in the infrared image is that the gray value change in the resistor area is large. The gradient information can characterize the degree and direction of the gray value change. Therefore, it is necessary to obtain the gradient value and gradient direction of the resistor area for subsequent analysis.
[0050] Specifically, screening several initial abnormal resistor areas according to the gradient values of the resistor areas includes the following steps:
[0051] First, obtain the gradient value and gradient direction of each resistor area.
[0052] Secondly, according to the gradient values of the resistance regions, several initial abnormal resistance regions are screened.
[0053] Specifically, the gradient values and gradient directions of each resistance region are obtained as follows:
[0054] For any resistance region, the central pixel point of the resistance region is obtained, and the gradient value of the central pixel point is used as the gradient value of the resistance region, and the gradient direction of the central pixel point is used as the gradient direction of the resistance region. It should be noted that when there is a temperature mixing phenomenon in the resistance region, the gray-scale change in the resistance region is large, and the gradient change of the central pixel point of the resistance region is also relatively obvious. Therefore, the gradient information of the central pixel point of the resistance region is used here to replace the gradient information of the resistance region.
[0055] It should be noted that the above obtains the gradient values of the resistance regions. The magnitude of the gradient value can reflect the magnitude of the gray-scale change. The initial abnormal resistance regions can be screened out through the magnitude of the gradient values of the resistance regions. The initial abnormal resistance regions are possible abnormal resistance regions, which reduces the amount of data that needs to be analyzed subsequently.
[0056] Specifically, according to the gradient values of the resistance regions, several initial abnormal resistance regions are screened as follows:
[0057] A first threshold is preset. In this embodiment, the first threshold is described as 100. The resistance regions with gradient values greater than the first threshold are used as the initial abnormal resistance regions, and vice versa, they are not used as the initial abnormal resistance regions.
[0058] It should be noted that since the initial abnormal resistance region reflects the region formed by a resistor in the infrared image, during the normal operation of the resistor array, the surrounding adjacent resistors will also affect the initial abnormal resistance region. If the influence of the surrounding adjacent resistors is not analyzed, it will interfere with the subsequent determination of the abnormal resistance region. Since the influence is mainly related to the area of the adjacent resistance region, the distance between the resistance regions, and the deviation of the gradient direction. If the area of the adjacent resistance region is large, it means that the corresponding resistor of the adjacent resistance region is large, and during the normal operation of the resistor array, its heat generation will have a greater impact on the initial abnormal resistance region. If the distance between the adjacent resistance region and the initial abnormal resistance region is close, it means that the corresponding resistors of the two regions are similar, and the heat generation of the adjacent resistor will also have a greater impact on the initial abnormal resistance region. At the same time, if the deviation of the gradient direction between the adjacent resistance region and the initial abnormal resistance region is similar, it means that the temperature change directions of the two regions are relatively consistent, which can also reflect the influence of the heat generation of the adjacent resistor on the initial abnormal resistance region. Therefore, by analyzing the area of the adjacent resistance region, the distance between the regions, and the deviation of the gradient direction, the influence degree of the initial abnormal resistance region by the surrounding adjacent resistance regions is obtained.
[0059] Preferably, according to the distance between the initial abnormal resistance region and the adjacent resistance regions, the deviation of the gradient direction, and the area of the adjacent resistance regions, the influence degree of each initial abnormal resistance region by each adjacent resistance region is obtained as follows:
[0060] For any initial abnormal resistance region, any adjacent resistance region of the initial abnormal resistance region is denoted as the first adjacent resistance region; the absolute value of the difference between the corresponding angle values of the gradient directions of the initial abnormal resistance region and the first adjacent resistance region is used as the deviation of the gradient direction between the first adjacent resistance region and the initial abnormal resistance region; the distance between the initial abnormal resistance region and the first adjacent resistance region, the deviation of the gradient direction, and the area of the first adjacent resistance region are fused to obtain the influence degree of the initial abnormal resistance region by the first adjacent resistance region; the distance between the initial abnormal resistance region and the first adjacent resistance region, the deviation of the gradient direction are inversely proportional to the influence degree, and the area of the first adjacent resistance region is directly proportional to the influence degree.
[0061] As a specific example, the specific method for obtaining the influence degree is as follows:
[0062] The th adjacent resistance region of any initial abnormal resistance region is denoted as the first adjacent resistance region; it should be noted that the first adjacent resistance region can be the initial abnormal resistance region or not, that is, the resistance region.
[0063]
[0064] In the formula, is the number of pixel points in the first adjacent resistance region; is the th distance between the central pixel points of the initial abnormal resistance region and the first adjacent resistance region; is the th absolute value of the difference between the corresponding angle values of the gradient directions of the initial abnormal resistance region and the first adjacent resistance region. It should be noted that the corresponding angle value of the gradient direction takes the horizontal right as the 0° direction, and the counterclockwise direction is the positive direction; is a preset first hyperparameter, aiming to prevent the denominator from being 0. In this embodiment, is used for description; is the th influence degree of the initial abnormal resistance region by the first adjacent resistance region.
[0065] It should be noted that since the influence is mainly related to the area of the main and adjacent resistance regions, the distance between the resistance regions, and the deviation of the gradient direction, the above formula analyzes the area of the adjacent resistance regions, the distance between the regions, and the deviation of the gradient direction to obtain the influence degree of the initial abnormal resistance region by the surrounding adjacent resistance regions. If The larger it is, it indicates that the resistance of the first adjacent resistance region itself is relatively large, and its influence on the initial abnormal resistance region is greater; The smaller it is, it indicates that the distance between the first adjacent resistance region and the initial abnormal resistance region is closer, and the influence on the initial abnormal resistance region is also greater; The smaller it is, it indicates that the gradient directions of the first adjacent resistance region and the initial abnormal resistance region are approximately the same, that is, the deviation of the gradient direction is small, and the influence of the first adjacent resistance region on the initial abnormal resistance region is also greater.
[0066] It should be noted that the main purpose of this embodiment is to determine the abnormal resistance region and the abnormal background sub-region caused by temperature mixing in the infrared image, so as to correct them and obtain the enhanced infrared image. When there is a temperature mixing phenomenon in the resistance region, the gray-scale change in the resistance region is large, and at the same time, the influence degree by the surrounding adjacent resistance regions is also large. Therefore, by analyzing the gray-scale change of the initial abnormal resistance region and the influence degree by the surrounding adjacent resistance regions, the possibility that the initial abnormal resistance region belongs to the abnormal resistance region can be obtained.
[0067] Specifically, according to the gray-scale value change and influence degree in the initial abnormal resistance region, the possibility that each initial abnormal resistance region belongs to the abnormal resistance region is obtained, and the abnormal resistance regions and the normal resistance regions are screened out. The steps include:
[0068] First, according to the gray-scale value change and influence degree in the initial abnormal resistance region, the possibility that each initial abnormal resistance region belongs to the abnormal resistance region is obtained.
[0069] Secondly, according to the possibility of belonging to the abnormal resistance region, several abnormal resistance regions and several normal resistance regions are screened out.
[0070] Preferably, according to the gray-scale value change and influence degree in the initial abnormal resistance region, the possibility that each initial abnormal resistance region belongs to the abnormal resistance region is obtained as follows:
[0071] For any initial abnormal resistance region, the variance of the gray values of the pixel points within the initial abnormal resistance region is used as the change feature of the gray values within the initial abnormal resistance region; the average value of the influence degree of the initial abnormal resistance region by all adjacent resistance regions is obtained; the change feature of the gray values within the initial abnormal resistance region and the average value of the influence degree of the initial abnormal resistance region by all adjacent resistance regions are fused to obtain the possibility that the initial abnormal resistance region belongs to an abnormal resistance region; the change feature of the gray values within the initial abnormal resistance region, the average value of the influence degree of the initial abnormal resistance region by all adjacent resistance regions, and the possibility that the initial abnormal resistance region belongs to an abnormal resistance region are in a direct proportional relationship.
[0072] As a specific example, the specific method for obtaining the possibility of belonging to an abnormal resistance region is as follows:
[0073]
[0074] In the formula, is the variance of the gray values of the pixel points within the th initial abnormal resistance region; is the average value of the influence degree of the th initial abnormal resistance region by all adjacent resistance regions; is the hyperbolic tangent function for normalization; is the possibility that the th initial abnormal resistance region belongs to an abnormal resistance region.
[0075] It should be noted that when there is a temperature mixing phenomenon in the resistance region, the gray value change within the resistance region is large, and at the same time, the influence degree by the surrounding adjacent resistance regions is also large. Therefore, the above formula obtains the possibility that the initial abnormal resistance region belongs to an abnormal resistance region by analyzing the gray value change of the initial abnormal resistance region and the influence degree by the surrounding adjacent resistance regions. When is larger, it indicates that the gray value distribution of the pixel points within the th initial abnormal resistance region is more chaotic, the gray value change is large, and the possibility that the th initial abnormal resistance region belongs to an abnormal resistance region is greater. At the same time, when is larger, it indicates that the influence degree of the th initial abnormal resistance region by the surrounding adjacent resistance regions is larger, and the possibility that the th initial abnormal resistance region belongs to an abnormal resistance region is also greater.
[0076] It should be noted that the above steps analyze the possibility that the initial abnormal resistance region belongs to the abnormal resistance region. By setting an appropriate threshold, the abnormal resistance region and the normal resistance region can be screened out, so as to better correct the abnormal region in the subsequent process and obtain an enhanced infrared image.
[0077] Specifically, according to the possibility of belonging to the abnormal resistance region, several abnormal resistance regions and several normal resistance regions are screened out, as follows:
[0078] A second threshold is preset. In this embodiment, the second threshold is described as 0.7. The initial abnormal resistance regions with the possibility of belonging to the abnormal resistance region greater than the second threshold are used as the abnormal resistance regions, and vice versa as the normal resistance regions.
[0079] So far, several abnormal resistance regions and several normal resistance regions have been screened out.
[0080] Step S003: Cluster the pixel points in the background region to obtain several clusters; according to the area ratio of the clusters in the background region and the difference in gray-scale performance between the clusters and the background region, obtain the possibility of each cluster belonging to the abnormal background sub-region, and screen out the abnormal background sub-region and the normal background sub-region.
[0081] It should be noted that the main purpose of this embodiment is to determine the abnormal resistance region and the abnormal background sub-region caused by temperature mixing in the infrared image, so as to correct them and obtain an enhanced infrared image. The above analyzes the possibility that the initial abnormal resistance region belongs to the abnormal resistance region. Next, the background region is analyzed to obtain the abnormal background sub-region. Since there are many normal regions and only a small number of abnormal regions in the background region when the temperature mixing phenomenon occurs in the background region, in order to better determine the abnormal background sub-region in the subsequent process, it is first necessary to cluster and divide the background region and analyze the smaller local regions here.
[0082] Specifically, the pixel points in the background region are clustered to obtain several clusters, as follows:
[0083] The pixel points in the background region are subjected to K-means clustering, and the distance metric uses the absolute value of the difference in gray-scale values between pixel points to obtain several clusters; it should be noted that since there are many different gray-scale values in the background region, corresponding to the actual situation that there are many temperatures in the background region of the resistor array, considering comprehensively, the value of K in K-means clustering in this embodiment is 5.
[0084] It should be noted that the above background region is divided through clustering operation to obtain several clusters. Next, it is possible to analyze whether these clusters belong to abnormal background sub-regions. When there is a temperature mixing phenomenon in the background region, there are many normal regions and only a small number of abnormal regions in the background region. That is, if there is temperature mixing in a cluster, the proportion of the area of the cluster in the entire background region is small, and the gray-scale performance of the pixel points in the cluster is also relatively close to the gray-scale performance of the entire background region. Therefore, by analyzing the proportion of the cluster in the background region and the difference in gray-scale performance between the cluster and the background region, the possibility that the cluster belongs to an abnormal background sub-region can be obtained.
[0085] Specifically, according to the area proportion of the cluster in the background region and the difference in gray-scale performance between the cluster and the background region, the possibility that each cluster belongs to an abnormal background sub-region is obtained, and the abnormal background sub-regions and normal background sub-regions are screened out. The steps include:
[0086] First, according to the area proportion of the cluster in the background region and the difference in gray-scale performance between the cluster and the background region, the possibility that each cluster belongs to an abnormal background sub-region is obtained.
[0087] Second, according to the possibility of belonging to an abnormal background sub-region, several abnormal background sub-regions and several normal background sub-regions are screened out.
[0088] Preferably, according to the area proportion of the cluster in the background region and the difference in gray-scale performance between the cluster and the background region, the possibility that each cluster belongs to an abnormal background sub-region is obtained as follows:
[0089] For any one cluster; the difference between the average gray value of the pixel points in the cluster and the average gray value of the pixel points in the background region is used as the difference in gray-scale performance between the cluster and the background region; the area proportion of the cluster in the background region and the difference in gray-scale performance between the cluster and the background region are fused to obtain the possibility that the cluster belongs to an abnormal background sub-region; the area proportion of the cluster in the background region, the difference in gray-scale performance between the cluster and the background region and the possibility that the cluster belongs to an abnormal background sub-region are inversely proportional.
[0090] As a specific example, the specific method for obtaining the possibility of belonging to an abnormal background sub-region is as follows:
[0091]
[0092] In the formula, is the proportion of the number of pixel points in the th cluster in the background region, and the specific proportion is: the ratio of the number of pixel points in the th cluster to the number of pixel points in the background region; is the The average gray value of the pixel points in a cluster; is the average gray value of the pixel points in the background area; is to take the average value; is a preset second hyperparameter, aiming to prevent the denominator from being zero. In this embodiment, is used for narration; is the hyperbolic tangent function, which is used for normalization; is the probability that the nth cluster belongs to the abnormal background sub-region.
[0093] It should be noted that when there is a temperature mixing phenomenon in the background area, there are many normal areas and only a small number of abnormal areas in the background area. That is, when temperature mixing occurs in a cluster, the proportion of the area of the cluster in the entire background area is small. At the same time, the gray-scale performance of the pixel points in the cluster is also relatively close to that of the entire background area. Therefore, the above formula obtains the probability that the cluster belongs to the abnormal background sub-region by analyzing the proportion of the cluster in the background area and the difference in gray-scale performance between the cluster and the background area. When is smaller, it indicates that the area proportion of the cluster in the background area is smaller, and the probability that the cluster belongs to the abnormal background sub-region is greater. When is smaller, it indicates that the average gray value of the cluster is closer to the average gray value of the background area, that is, the difference in gray-scale performance between the cluster and the background area is smaller, and the probability that the cluster belongs to the abnormal background sub-region is also greater.
[0094] It should be noted that the above steps respectively analyze the probability that the cluster belongs to the abnormal background sub-region. By setting appropriate thresholds, the abnormal background sub-region and the normal background sub-region can be screened out, so as to better correct the abnormal area and obtain the enhanced infrared image in the follow-up.
[0095] Specifically, according to the probability of belonging to the abnormal background sub-region, several abnormal background sub-regions and several normal background sub-regions are screened out, as follows:
[0096] The area where the cluster with a probability of belonging to the abnormal background sub-region greater than the preset second threshold is located is used as the abnormal background sub-region, and vice versa as the normal background sub-region.
[0097] So far, several abnormal background sub-regions and several normal background sub-regions have been screened out.
[0098] Step S004: Obtain the correction coefficient of each pixel point in each abnormal resistance area according to the area of the normal resistance area closest to the abnormal resistance area and the distance between the pixel points in the abnormal resistance area and the closest normal resistance area; according to the correction coefficient and the normal background sub-region, correct the gray values of the pixel points in the abnormal resistance area and the abnormal background sub-region respectively, and obtain the enhanced infrared image.
[0099] It should be noted that the main purpose of this embodiment is to determine the abnormal resistance region and the abnormal background sub-region caused by temperature mixing in the infrared image, so as to correct them and obtain the enhanced infrared image. The above-mentioned abnormal resistance region and normal resistance region have been obtained. Next, the abnormal resistance region is corrected. Since the abnormal resistance region is mainly affected by adjacent resistors, in this embodiment, the nearest normal resistance region is combined for analysis. If the area of the normal resistance region is larger than that of the abnormal resistance region, the degree of influence on the abnormal resistance region is greater, and the corresponding correction coefficient should be larger. At the same time, if the distance between the normal resistance regions is closer to the abnormal resistance region, the degree of influence on the abnormal resistance region is also greater, and the corresponding correction coefficient should also be larger. The correction coefficient of each pixel point in the abnormal resistance region is obtained through the distance between the normal resistance region and the abnormal resistance region and the area of the normal resistance region.
[0100] Preferably, according to the area of the normal resistance region closest to the abnormal resistance region and the distance between the pixel point in the abnormal resistance region and the closest normal resistance region, the correction coefficient of each pixel point in each abnormal resistance region is obtained as follows:
[0101] For any abnormal resistance region, the normal resistance region closest to the abnormal resistance region is denoted as the first normal resistance region; for any pixel point in the abnormal resistance region, the distance between the pixel point in the abnormal resistance region and the central pixel point of the first normal resistance region is used as the distance between the pixel point in the abnormal resistance region and the first normal resistance region; the area of the first normal resistance region and the distance between the pixel point in the abnormal resistance region and the first normal resistance region are fused to obtain the correction coefficient of the pixel point in the abnormal resistance region; the area of the first normal resistance region is directly proportional to the correction coefficient of the pixel point in the abnormal resistance region, and the distance between the pixel point in the abnormal resistance region and the first normal resistance region is inversely proportional to the correction coefficient of the pixel point in the abnormal resistance region; the correction coefficient is a normalized value.
[0102] As a specific example, the specific method for obtaining the correction coefficient is as follows:
[0103] Let the normal resistance region closest to the
[0104]
[0105] In the formula, is the number of pixel points in the first normal resistance region; Let the The distance between a pixel and the central pixel of the first normal resistance region; is a linear normalization function; is the th correction coefficient of the th pixel in the abnormal resistance region.
[0106] It should be noted that since the abnormal resistance region is mainly affected by adjacent resistances, the above formula is analyzed in combination with the nearest normal resistance region. The larger is, the larger the area of the first normal resistance region is, and the greater the influence of the first normal resistance region on the th abnormal resistance region is, and the corresponding correction coefficient should be larger; The smaller is, the closer the distance between the first normal resistance region and the
[0107] th abnormal resistance region is, and the greater the influence of the first normal resistance region on the
[0108] th abnormal resistance region is, and the corresponding correction coefficient should also be larger.
[0109] It should be noted that the correction coefficients of each pixel in the abnormal resistance region and the normal background sub-region are obtained above. By using the correction coefficients, the gray values of the pixels in the abnormal background sub-region can be corrected, and by using the gray values of the pixels in the normal background sub-region, the gray values of the pixels in the abnormal background sub-region can be corrected, so as to obtain the enhanced infrared image.
[0110] Specifically, according to the correction coefficients and the normal background sub-region, the gray values of the pixels in the abnormal resistance region and the abnormal background sub-region are corrected respectively to obtain the enhanced infrared image, as follows:
[0111] Through the above steps, the image enhancement method for the infrared scene image of the resistor array based on image processing is completed.
[0112] The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An image enhancement method for a resistor array infrared scene image based on image processing, characterized in that: The method comprises the following steps: Acquire an infrared image of the resistor array, wherein the infrared image includes a plurality of resistor areas and a background area; According to the gradient value of the resistance area, several initial abnormal resistance areas are screened; according to the distance between the initial abnormal resistance area and the adjacent resistance area, the deviation of the gradient direction and the area of the adjacent resistance area, the degree of influence of each initial abnormal resistance area on each adjacent resistance area is obtained; according to the change of the gray value in the initial abnormal resistance area and the degree of influence, the possibility of each initial abnormal resistance area belonging to the abnormal resistance area is obtained, and the abnormal resistance area and the normal resistance area are screened; Cluster the pixels in the background area to obtain several clusters; obtain the possibility that each cluster belongs to the abnormal background sub-area based on the area ratio of the cluster in the background area and the grayscale difference between the cluster and the background area, and screen out the abnormal background sub-area and the normal background sub-area; Obtaining a correction coefficient for each pixel in each abnormal resistance region according to the area of the normal resistance region closest to the abnormal resistance region and the distance between the pixel in the abnormal resistance region and the normal resistance region closest to the abnormal resistance region; and correcting the grayscale values of the pixels in the abnormal resistance region and the abnormal background subregion respectively according to the correction coefficient and the normal background subregion to obtain an enhanced infrared image; The method of obtaining the possibility that each initial abnormal resistance region belongs to the abnormal resistance region according to the change of the gray value in the initial abnormal resistance region and the degree of influence includes the following specific steps: For any initial abnormal resistance area, the variance of the grayscale values of the pixels in the initial abnormal resistance area is used as the variation characteristic of the grayscale values in the initial abnormal resistance area; the average value of the degree of influence of the initial abnormal resistance area by all adjacent resistance areas is obtained; the variation characteristic of the grayscale values in the initial abnormal resistance area and the average value of the degree of influence of the initial abnormal resistance area by all adjacent resistance areas are merged to obtain the possibility that the initial abnormal resistance area belongs to the abnormal resistance area; the variation characteristic of the grayscale values in the initial abnormal resistance area and the average value of the degree of influence of the initial abnormal resistance area by all adjacent resistance areas are directly proportional to the possibility that the initial abnormal resistance area belongs to the abnormal resistance area.
2. The image enhancement method of the resistor array infrared scene image based on image processing according to claim 1 is characterized in that: After acquiring the infrared image of the resistor array, the method further includes: A resistor array image is obtained, and the resistor array image is input into a semantic segmentation network to obtain a plurality of first resistor regions; an area corresponding to each first resistor region in the resistor array image in the infrared image is used as a resistor region of the infrared image, and an area remaining in the infrared image except the resistor region is used as a background region of the infrared image.
3. The image enhancement method of the resistor array infrared scene image based on image processing according to claim 1 is characterized in that: The method of obtaining the degree of influence of each initial abnormal resistance region on each adjacent resistance region according to the distance between the initial abnormal resistance region and the adjacent resistance region, the deviation of the gradient direction and the area of the adjacent resistance region includes the following specific steps: For any initial abnormal resistance region, any adjacent resistance region of the initial abnormal resistance region is recorded as a first adjacent resistance region; the absolute value of the difference between the angle values corresponding to the gradient directions of the initial abnormal resistance region and the first adjacent resistance region is taken as the deviation of the gradient direction of the first adjacent resistance region from the initial abnormal resistance region; The distance between the initial abnormal resistance region and the first adjacent resistance region, the deviation of the gradient direction, and the area of the first adjacent resistance region are integrated to obtain the degree of influence of the initial abnormal resistance region on the first adjacent resistance region; The distance between the initial abnormal resistance region and the first adjacent resistance region and the deviation of the gradient direction are inversely proportional to the degree of influence, and the area of the first adjacent resistance region is directly proportional to the degree of influence.
4. The image enhancement method of the resistor array infrared scene image based on image processing according to claim 1 is characterized in that: The specific steps of screening out the abnormal resistance area and the normal resistance area are as follows: A second threshold is preset, and the initial abnormal resistance region whose probability of belonging to the abnormal resistance region is greater than the second threshold is regarded as the abnormal resistance region, and vice versa, as the normal resistance region.
5. The image enhancement method of the resistor array infrared scene image based on image processing according to claim 1 is characterized in that: The specific steps of obtaining the possibility that each cluster belongs to the abnormal background sub-region according to the area ratio of the cluster in the background region and the grayscale performance difference between the cluster and the background region are as follows: For any cluster; the difference between the average grayscale value of the pixels in the cluster and the average grayscale value of the pixels in the background area is taken as the grayscale performance difference between the cluster and the background area; the area ratio of the cluster in the background area and the grayscale performance difference between the cluster and the background area are fused to obtain the possibility that the cluster belongs to the abnormal background sub-area; the area ratio of the cluster in the background area and the grayscale performance difference between the cluster and the background area are inversely proportional to the possibility that the cluster belongs to the abnormal background sub-area.
6. The image enhancement method of the resistor array infrared scene image based on image processing according to claim 1 is characterized in that: The method of obtaining the correction coefficient of each pixel point in each abnormal resistance region according to the area of the normal resistance region closest to the abnormal resistance region and the distance between the pixel point in the abnormal resistance region and the normal resistance region closest to the abnormal resistance region comprises the following specific steps: For any abnormal resistance region, a normal resistance region closest to the abnormal resistance region is recorded as the first normal resistance region; for any pixel point in the abnormal resistance region, the distance between the pixel point in the abnormal resistance region and the central pixel point of the first normal resistance region is taken as the distance between the pixel point in the abnormal resistance region and the first normal resistance region; the area of the first normal resistance region and the distance between the pixel point in the abnormal resistance region and the first normal resistance region are merged to obtain a correction coefficient of the pixel point in the abnormal resistance region; The area of the first normal resistance region is directly proportional to the correction coefficient of the pixel points in the abnormal resistance region, and the distance between the pixel points in the abnormal resistance region and the first normal resistance region is inversely proportional to the correction coefficient of the pixel points in the abnormal resistance region; the correction coefficient is a normalized value.
7. The image enhancement method of the resistor array infrared scene image based on image processing according to claim 1, characterized in that: The grayscale values of pixels in the abnormal resistance region and the abnormal background subregion are corrected according to the correction coefficient and the normal background subregion to obtain an enhanced infrared image, and the specific steps include the following: The correction coefficient of each pixel in each abnormal resistance area is multiplied by the initial grayscale value of the pixel to obtain the corrected grayscale value of each pixel in each abnormal resistance area; the grayscale mean of the pixels in all normal background sub-areas is used as the corrected grayscale value of each pixel in the abnormal background sub-area; and the enhanced infrared image is obtained according to the corrected grayscale value.
8. The image enhancement method of resistor array infrared scene image based on image processing according to claim 1, characterized in that: The pixel points in the background area are clustered to obtain a number of clusters, and the specific steps include the following: K-means clustering is performed on the pixels in the background area, and the distance metric uses the absolute value of the difference in grayscale values between pixels to obtain several clusters.
9. The image enhancement method of resistor array infrared scene image based on image processing according to claim 1, characterized in that: The specific steps of screening a number of initial abnormal resistance areas according to the gradient value of the resistance area are as follows: A first threshold is preset, and a resistance region with a gradient value greater than the first threshold is taken as an initial abnormal resistance region, wherein the first threshold is 100.
Citation Information
Patent Citations
High-speed cable quality detection method for visual robot
CN117764952A
Visual image-based swinery surface anomaly detection system and method
CN118279936A
Wafer inspection with focus volumetric method
US20160209334A1