A method and system for detecting and processing blind pixels in infrared images
By generating verification arrays and neighboring gradient arrays, calculating the ratio of the correlation gradient sum to neighboring gradient sums, and judging and correcting blind element points in infrared images, the problem of low processing efficiency of added random blind element in infrared images is solved, and imaging quality and detection efficiency are improved.
Patent Information
- Application Number
- CN202211534735.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-11-29
AI Technical Summary
The prior art cannot effectively process the newly added random blind elements, resulting in a decrease in imaging quality of infrared images and low blind element detection processing efficiency.
By obtaining the pixel value to be measured and the neighborhood pixel value, a verification array and the first neighborhood gradient array are generated, the ratio of the associated gradient sum and the neighborhood gradient sum is calculated, the maximum value is filtered to generate the second neighborhood gradient array, and the ratio is determined whether the pixel point to be measured is a blind element point, and correction is performed.
It improves the imaging quality of infrared images, reduces blind element misjudgment and missed detection, and improves the efficiency of blind element detection processing.
Smart Images

Figure CN115880241B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of infrared thermal imaging technology, and in particular to a method and system for detecting and processing blind pixels in infrared images. Background Art
[0002] Thermal imaging systems generate infrared images from infrared light emitted by objects, and are widely used in military, medical, industrial, and agricultural sectors. Infrared detectors are a crucial component of thermal imaging systems, and infrared images are derived from their output signals.
[0003] During the manufacturing and use of infrared detectors, factors such as semiconductor material properties, manufacturing processes, and operating environments can cause some pixels in the detector to exhibit abnormalities. These abnormal pixels are called blind pixels. Because blind pixels can appear permanently bright, permanently dim, or periodically flicker, they can degrade infrared image quality.
[0004] To improve infrared image quality, a uniform blackbody radiation image is pre-collected. Blind pixels are then identified based on national standards for pixel responsivity and noise, resulting in a blind pixel table. Blind pixels in the table can then be replaced during subsequent image processing. However, this blind pixel detection method cannot handle newly added random blind pixels, reducing detection efficiency. Summary of the Invention
[0005] The present application provides a method and system for detecting and processing blind pixels in infrared images to solve the problem of low efficiency in detecting and processing blind pixels.
[0006] In a first aspect, the present application provides a method for detecting and processing blind pixels in infrared images, comprising:
[0007] Obtain a pixel value to be measured and a neighborhood pixel value, wherein the pixel value to be measured is the pixel value of the pixel point to be measured; the neighborhood pixel value is the pixel value of the neighborhood pixel point; the neighborhood pixel point is the pixel point in a blind pixel detection window corresponding to the pixel point to be measured, and the blind pixel detection window includes the pixel point to be measured and at least 8 neighborhood pixels of the pixel point to be measured;
[0008] Generate a verification array and a first neighborhood gradient array according to the neighborhood pixel values in the blind pixel detection window;
[0009] Calculating a first difference between the pixel value to be tested and each pixel value in the verification array, and adding absolute values of the first differences to obtain an associated gradient sum;
[0010] Screening out the maximum value in the first neighborhood gradient array to generate a second neighborhood gradient array;
[0011] Calculating the sum of the neighborhood pixel values in the second neighborhood gradient array to obtain a neighborhood gradient sum;
[0012] If the ratio of the associated gradient sum to the neighborhood gradient sum is greater than a preset gradient threshold, blind pixel correction is performed on the pixel to be tested. By processing the blind pixel points in the infrared image through the blind pixel detection window, the imaging quality of the infrared image can be improved.
[0013] In combination with the first aspect, in one possible implementation of the first aspect, a verification array and a first neighborhood gradient array are generated based on the neighborhood pixel values in the blind pixel detection window, including: traversing the neighborhood pixel values to obtain the maximum and minimum values among the neighborhood pixel values; and filtering out the maximum and minimum values among the neighborhood pixel values to generate a verification array. Calculating the second difference of the pixel values in the adjacent directions of the pixel to be tested, the adjacent directions include the horizontal direction, vertical direction, and diagonal direction of the pixel to be tested; and extracting the absolute value of the second difference to generate a first neighborhood gradient array. The verification array and the first neighborhood gradient array can facilitate verification of whether the pixel to be tested is a blind pixel point.
[0014] In conjunction with the first aspect, in one possible implementation of the first aspect, the correlation gradient sum is calculated according to the following formula:
[0015]
[0016] Where G1 is the associated gradient sum; Sort_P' is the verification array; C is the pixel to be tested; and n is the number of neighborhood pixels in the verification array.
[0017] In conjunction with the first aspect, in one possible implementation of the first aspect, the neighborhood gradient sum is calculated according to the following formula:
[0018]
[0019] Where G2 is the neighborhood gradient sum; t is the first neighborhood gradient array; max(t) is the maximum value of array t; and m is the number of second differences in the first neighborhood gradient array.
[0020] In combination with the first aspect, in one possible implementation of the first aspect, the maximum value and the minimum value in the verification array are analyzed; if the pixel value to be measured is greater than the maximum value in the verification array, or the pixel value to be measured is less than the minimum value in the verification array, blind pixel correction is performed on the pixel point to be measured to reduce the missed detection rate of the blind pixel detection processing process.
[0021] In combination with the first aspect, in one possible implementation of the first aspect, the average pixel value and the third difference of the verification array are calculated, and the third difference is the difference between the maximum value and the minimum value in the verification array; the average pixel value, the third difference and the judgment threshold are added to obtain a first verification value; the difference between the average pixel value and the third difference is calculated to obtain a fourth difference; the judgment threshold is subtracted from the fourth difference to obtain a second verification value; if the pixel value to be measured is greater than the first verification value, or the pixel value to be measured is less than the second verification value, blind pixel correction is performed on the pixel point to be measured to reduce the missed detection rate of the blind pixel detection process.
[0022] In combination with the first aspect, in one possible implementation of the first aspect, the average pixel value is calculated according to the following formula:
[0023]
[0024] Where Sort_P' is the validation array, and n is the number of neighborhood pixels in the validation array.
[0025] In combination with the first aspect, in one possible implementation of the first aspect, the pixel to be measured is corrected, including: parsing the target direction corresponding to the minimum value in the first neighborhood gradient array; obtaining the target pixel value in the target direction; calculating the target pixel average value of the target pixel value, and correcting the pixel to be measured by the target pixel average value to improve the imaging quality of the infrared image.
[0026] In combination with the first aspect, in one possible implementation of the first aspect, a target image is obtained, wherein the target image is a grayscale image; the coordinates of the pixel points to be measured in the target image are traversed; and the blind pixel detection window is defined according to the coordinates of the pixel points to be measured to reduce the problem of missed pixel detection in the target image.
[0027] In a second aspect, the present application provides a detection and processing system for blind pixels in infrared images, comprising: an acquisition module, a detection module, and a processing module, wherein:
[0028] The acquisition module is configured to obtain the pixel value to be measured and the neighborhood pixel value, wherein the pixel value to be measured is the pixel value of the pixel point to be measured; the neighborhood pixel value is the pixel value of the neighborhood pixel point; the neighborhood pixel point is the pixel point in the blind pixel detection window corresponding to the pixel point to be measured, and the blind pixel detection window includes the pixel point to be measured and at least 8 neighborhood pixel points of the pixel point to be measured.
[0029] The detection module is configured to generate a verification array and a first neighborhood gradient array based on the neighborhood pixel values in the blind pixel detection window; calculate a first difference between the pixel value to be tested and each pixel value in the verification array, and add the absolute values of the first difference to obtain an associated gradient sum; filter out the maximum value in the first neighborhood gradient array to generate a second neighborhood gradient array; calculate the sum of each neighborhood pixel value in the second neighborhood gradient array to obtain a neighborhood gradient sum.
[0030] The processing module is configured to perform blind pixel correction on the pixel to be measured if the ratio of the associated gradient sum to the neighborhood gradient sum is greater than a preset gradient threshold.
[0031] It can be seen from the above technical solutions that the infrared image blind pixel detection and processing method and system provided by the present application can perform blind pixel detection on each pixel point in the infrared image through a blind pixel detection window. Among them, the blind pixel detection window includes the pixel point to be tested and at least 8 neighboring pixel points of the pixel point to be tested. Then, based on the neighboring pixel values in the blind pixel detection window, a verification array and a first neighboring gradient array are generated. Then, the first difference between the pixel value to be tested and the pixel values in the verification array is calculated, and the absolute value of the first difference is added to obtain the associated gradient sum. After the maximum value in the first neighboring gradient array is filtered out to obtain the second neighboring gradient array, the sum of the neighboring pixel values in the second neighboring gradient array is calculated to obtain the neighboring gradient sum. When the ratio of the associated gradient sum to the neighboring gradient sum is greater than the preset gradient threshold, the pixel point to be tested is corrected for blind pixels to reduce blind pixel misjudgments and improve the efficiency of blind pixel detection processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0033] Figure 1 A schematic diagram of the effect of the braille image provided in an embodiment of the present application;
[0034] Figure 2 A flowchart of a method for detecting and processing blind pixels in infrared images provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of the effect of the blind pixel detection window provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of a process for generating a verification array and a first neighborhood gradient array provided in an embodiment of the present application;
[0037] Figure 5A schematic diagram of a blind spot correction process according to an embodiment of the present application;
[0038] Figure 6 A schematic diagram of the effect of an image after blind pixel detection processing provided in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of the structure of a system for detecting and processing blind pixels in infrared images provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following embodiments are described in detail, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numbers in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following embodiments are not intended to represent all possible implementations consistent with the present application. They are merely examples of systems and methods consistent with certain aspects of the present application, as detailed in the claims.
[0041] Since blind points usually appear in infrared images, such as Figure 1 As shown, blind pixels may appear to be constantly bright, constantly dark, or periodically flicker, resulting in poor imaging quality of the infrared image. Therefore, in some embodiments, blind pixel detection is performed based on radiation calibration. First, a uniform blackbody radiation image is collected in advance, and blind pixels are judged in the radiation image based on indicators such as pixel response rate and noise to obtain a blind pixel table. Then, during subsequent image processing, the blind pixel points in the blind pixel table are replaced. The detection method based on radiation calibration is simple in principle, but cannot handle newly added random blind pixels.
[0042] Therefore, in some embodiments, blind pixel detection can also be performed based on the scene. This scene-based detection approach requires the accumulation of sampled data, which is then used to determine blind pixels. However, this approach lacks real-time performance and is prone to false detections. Furthermore, due to image non-uniformity, some scenes require the creation of a dataset, resulting in low detection efficiency.
[0043] Based on the above application scenarios, in order to alleviate the problem of low efficiency in blind pixel detection processing, such as Figure 2 As shown, the present application provides a method for detecting and processing blind pixels in infrared images, comprising the following steps:
[0044] S100: Obtain the value of the pixel to be tested and the values of the neighboring pixels.
[0045] Among them, the pixel value is used to characterize the sampling results of each pixel in the image to be detected, and the specific numerical value it represents is different for different types of images. For example, for infrared images, since the sampling result of the infrared camera is the temperature information radiated by the target object, when it is reflected in the infrared image, it is the grayscale value of the image, that is, the higher the temperature, the lower the corresponding grayscale value (the brighter). For color images taken by ordinary cameras (or ordinary cameras in combination with infrared cameras), their color values can represent the depth of a certain color, or can be the grayscale values corresponding to the three channels of R, G, and B, or can be the grayscale values corresponding to each pixel in the grayscale image obtained according to the fusion grayscale algorithm. In the embodiments of the present application, grayscale values are used as examples to illustrate the color value. It should be understood that the corresponding processing method can also be used in the processing of other types of color values.
[0046] The pixel value to be tested is the pixel value of the pixel point to be tested; the neighborhood pixel value is the pixel value of the neighborhood pixel point; the neighborhood pixel point is the pixel point in the blind pixel detection window corresponding to the pixel point to be tested, and the blind pixel detection window includes the pixel point to be tested and at least 8 neighborhood pixel points of the pixel point to be tested.
[0047] It should be noted that the pixel value in the embodiment of the present application is the grayscale value in the infrared image, wherein the grayscale value is the value of a pixel coordinate point in the grayscale image.
[0048] For example: if the pixel value of the pixel to be tested is C, then a blind pixel detection window centered on C is defined, and the size of the blind pixel detection window is 3*3. Figure 3 As shown, Figure 3 is the blind pixel detection window of the pixel point C to be tested. Figure 3 Where P0, P1, P2, P3, P4, P5, P6 and P7 are the pixel values of the eight neighboring pixels of the pixel C to be tested.
[0049] In some embodiments, to obtain the value of the pixel to be tested and the values of the neighboring pixels, a target image can be first obtained. The target image is a grayscale image, so that the pixel values of each pixel in the target image can be obtained. The coordinates of the pixel to be tested in the target image are then traversed, and the blind pixel detection window is defined based on the coordinates of the pixel to be tested. In other words, when detecting an image using the blind pixel detection window, it is necessary to traverse every pixel in the image for detection and judgment, thereby reducing the possibility of missed detections during the blind pixel detection process.
[0050] S200: Generate a verification array and a first neighborhood gradient array according to neighborhood pixel values in the blind pixel detection window.
[0051] When testing an image using a blind pixel detection window, the pixel values in the blind pixel detection window must be used to determine whether the pixel under test is a blind pixel. However, simply comparing the values displayed in the blind pixel detection window with the pixel values under test cannot accurately determine whether the pixel under test is a blind pixel. Therefore, it is necessary to process and analyze the pixel values in the blind pixel detection window to generate a verification array and a first neighborhood gradient array. The verification array and the first neighborhood gradient array are then used to determine the pixel values under test, thereby improving the accuracy of blind pixel detection.
[0052] In some embodiments, the maximum and minimum values of the neighboring pixel values are compared with the pixel value to be tested to determine whether the pixel to be tested is a blind pixel. If the pixel value to be tested is greater than the maximum value of the neighboring pixel value, or if the pixel value to be tested is less than the minimum value of the neighboring pixel value, the pixel to be tested is determined to be a blind pixel and blind pixel correction is performed. However, in the process of blind pixel detection, using the maximum and minimum values of the neighboring pixel values as judgment thresholds may result in missed detections due to values that are too large or too small.
[0053] Therefore, in some embodiments, Figure 4 As shown, the step of generating the verification array and the first neighborhood gradient array according to the neighborhood pixel values in the blind pixel detection window, i.e., step S200, specifically includes the following steps:
[0054] S210: Traverse the neighborhood pixel values to obtain the maximum value and the minimum value of the neighborhood pixel values.
[0055] In the blind pixel detection window, the values of the neighboring pixels can be counted and sorted, and then the maximum and minimum values of the neighboring pixel values can be obtained based on the sorting results.
[0056] For example: the pixel value of the pixel to be tested is C, and the blind pixel detection window is Figure 3 As shown. Figure 3 P0, P1, P2, P3, P4, P5, P6, and P7 are recorded as array P. Then, the elements in array P are sorted according to the numerical values of P0, P1, P2, P3, P4, P5, P6, and P7 to obtain the sorted array Sort_P. The maximum and minimum values of array Sort_P are selected from array Sort_P. The maximum and minimum values of array Sort_P are the maximum and minimum values of the neighborhood pixel values.
[0057] S211: Screen out the maximum and minimum values in the neighborhood pixel values to generate a verification array.
[0058] After counting all the neighborhood pixel values and determining the maximum and minimum values, these values are removed. The remaining pixel values form the validation array. In other words, the maximum value in the validation array is the next maximum value among the neighborhood pixel values, and the minimum value in the validation array is the next minimum value among the neighborhood pixel values.
[0059] For example: the pixel value of the pixel to be tested is C, and the blind pixel detection window is Figure 3 As shown, the Sort_P array is the array obtained by sorting all neighboring pixel values. P0 and P7 are the maximum and minimum values of the Sort_P array, respectively. Excluding P0 and P7, the array Sort_P' is obtained. The elements in Sort_P' are P1, P2, P3, P4, P5, and P6, and Sort_P' is the validation array.
[0060] S212: Calculate a second difference between pixel values in adjacent directions of the pixel to be tested.
[0061] The adjacent directions include the horizontal direction, vertical direction, and diagonal direction of the pixel to be tested, and the diagonal direction includes the left diagonal direction and the right diagonal direction. The difference between the values of two neighboring pixels in the horizontal direction, vertical direction, left diagonal direction, and left diagonal direction of the pixel to be tested is calculated.
[0062] For example: the pixel value of the pixel to be tested is C, and the blind pixel detection window is Figure 3 As shown, the pixel values in the horizontal direction are P6 and P7, the pixel values in the vertical direction are P1 and P5, the pixel values in the left diagonal direction are P0 and P4, and the pixel values in the left diagonal direction are P2 and P6. At the same time, the difference values in the above four directions are calculated according to the following formula:
[0063] Horizontal direction: t'(1) = P7 - P3; vertical direction: t'(2) = P1 - P5; left diagonal direction: t'(3) = P0 - P4; right diagonal direction: t'(4) = P2 - P6.
[0064] S213: Extracting the absolute value of the second difference to generate a first neighborhood gradient array.
[0065] After calculating the second difference, the absolute value of the second difference is extracted, and then a first neighborhood gradient array is constructed based on the absolute value of the second difference.
[0066] For example: the pixel value of the pixel to be tested is C, and the blind pixel detection window is Figure 3 As shown, the absolute value of the difference in four directions of the pixel to be tested is calculated according to the following formula:
[0067] Horizontal direction: t(1) = |P7-P3|, i.e., the absolute value of the horizontal pixel difference; vertical direction: t(2) = |P1-P5|, i.e., the absolute value of the vertical pixel difference; left diagonal direction: t(3) = |P0-P4|, i.e., the absolute value of the left diagonal pixel difference; right diagonal direction: t(4) = |P2-P6|, i.e., the absolute value of the right diagonal pixel difference. t(1), t(2), t(3), and t(4) are neighborhood gradients. The values of the neighborhood gradients form array t, which is the first neighborhood gradient array.
[0068] S300: Calculating a first difference between the pixel value to be tested and each pixel value in the verification array, and adding the absolute values of the first differences to obtain a correlation gradient sum.
[0069] After obtaining the verification array, the pixel value to be tested is subtracted from each pixel value in the verification array, and then the absolute values of the obtained differences are added. The sum obtained by the addition is the associated gradient sum of the pixel point to be tested.
[0070] In some embodiments, the associated gradient sum is calculated as follows:
[0071]
[0072] Where G1 is the associated gradient sum; Sort_P' is the verification array; C is the pixel to be tested; and n is the number of neighborhood pixels in the verification array.
[0073] For example, if the verification array is Sort_P', and the elements in Sort_P' are P1, P2, P3, P4, P5, and P6, then the associated gradient sum is calculated using the following formula:
[0074]
[0075] The calculated value of G1 is the associated gradient sum.
[0076] S400: Screening out the maximum value in the first neighborhood gradient array to generate a second neighborhood gradient array.
[0077] When generating the verification array, to improve the accuracy of blind pixel detection, the maximum and minimum values of the neighborhood pixel values are filtered out. Similarly, to improve precision, the maximum value of the first neighborhood gradient array is also filtered out to generate the second neighborhood gradient array. This second neighborhood gradient array is used to judge the pixel value to be tested, thereby improving the accuracy of blind pixel detection.
[0078] For example, array t is the first neighborhood gradient array. The elements in array t are: t(1), t(2), t(3), and t(4). Among them, t(4) is the maximum value. Then t(4) is filtered out to generate the second neighborhood gradient array t'. The elements of the second neighborhood gradient array t' are t(1), t(2), and t(3).
[0079] S500: Calculate the sum of each neighborhood pixel value in the second neighborhood gradient array to obtain a neighborhood gradient sum.
[0080] The second neighborhood gradient array is the array of pixels in the first neighborhood gradient array after excluding the maximum value in the first neighborhood gradient array. By calculating the sum of the pixel values in the second neighborhood gradient array, we can calculate the sum of the pixel values after excluding the maximum value in the first neighborhood gradient array. This sum is the neighborhood gradient sum.
[0081] In some embodiments, the neighborhood gradient sum is calculated according to the following formula:
[0082]
[0083] Where G2 is the neighborhood gradient sum; t is the first neighborhood gradient array; max(t) is the maximum value of array t; and m is the number of second differences in the first neighborhood gradient array.
[0084] For example, array t is the first neighborhood gradient array, and the elements in array t are: t(1), t(2), t(3) and t(4), where t(4) is the maximum value. Then the neighborhood gradient and G2 are calculated according to the following formula:
[0085]
[0086] S600: If the ratio of the associated gradient sum to the neighborhood gradient sum is greater than a preset gradient threshold, blind pixel correction is performed on the pixel to be measured.
[0087] After determining the associated gradient sum and the neighborhood gradient sum, the ratio of the associated gradient sum to the neighborhood gradient sum is calculated and compared with a preset gradient threshold. If the ratio of the associated gradient sum to the neighborhood gradient sum is greater than the preset gradient threshold, the pixel to be tested is determined to be a blind pixel and the blind pixel is corrected. If the ratio of the associated gradient sum to the neighborhood gradient sum is greater than the preset gradient threshold, the detection continues for other pixels to be tested in the target image.
[0088] For example, if the associated gradient sum is G1, the neighborhood gradient sum is G2, and the gradient threshold GT is preset, the associated neighborhood gradient ratio G can be calculated using the formula G = G1 / G2. When G > GT, the pixel to be considered is considered a blind pixel and blind pixel correction is performed.
[0089] In some embodiments, as Figure 5 As shown, the pixel to be measured is corrected, which specifically includes the following steps:
[0090] S610: Analyze the target direction corresponding to the minimum value in the first neighborhood gradient array.
[0091] S611: Acquire the target pixel value in the target direction.
[0092] S612: Calculate a target pixel average value of the target pixel value, and correct the pixel to be measured using the target pixel average value.
[0093] When the pixel to be tested is determined to be a blind pixel, the target direction corresponding to the minimum element in the first neighborhood array is analyzed, and then two pixel values in the target direction are obtained and the average pixel value of the two pixel values is calculated. Based on the obtained average pixel value, the pixel value of the target pixel is corrected for the blind pixel using the target average pixel value. The infrared image after correction is as follows: Figure 6 As shown, it has higher imaging quality.
[0094] For example, array t is the first neighborhood gradient array, and the elements of array t are: t(1), t(2), t(3), and t(4). Among them, t(2) is the minimum value in array t, and t(2) is the difference between the vertical pixel values P1 and P5 of the pixel to be tested. After determining that the pixel to be tested is a blind pixel, the average value avg1 of P1 and P5 is calculated, and the pixel value to be tested is corrected according to avg1.
[0095] Furthermore, to further improve the accuracy of blind pixel detection and reduce missed detections, in some embodiments, the maximum and minimum values in the verification array are analyzed. If the value of the pixel to be tested is greater than the maximum value in the verification array, or if the value of the pixel to be tested is less than the minimum value in the verification array, blind pixel correction is performed on the pixel to be tested.
[0096] For example, if the pixel value to be tested is C and the verification array is Sort_P', then the maximum value DH and the minimum value GL of the array Sort_P' are calculated. If C > DH, the pixel to be tested is determined to be a blind pixel; if C < GL, the pixel to be tested is determined to be a blind pixel. The identified blind pixel is then corrected to improve the image's preserved detail.
[0097] Furthermore, in some embodiments, the average pixel value of the verification array and a third difference value are calculated, where the third difference value is the difference between the maximum value and the minimum value in the verification array; the average pixel value, the third difference value, and the judgment threshold value are added together to obtain a first verification value. That is, the first verification value ΔC1 is:
[0098] ΔC1=avg+dif+th
[0099] Among them, avg is the average pixel value, dif is the third difference, and th is the judgment threshold.
[0100] Calculate the difference between the average pixel value and the third difference value to obtain a fourth difference value; subtract the judgment threshold from the fourth difference value to obtain a second verification value. That is, the second verification value ΔC2 is:
[0101] ΔC2=avg-dif-th
[0102] Among them, avg is the average pixel value, dif is the third difference, and th is the judgment threshold.
[0103] If the pixel value to be tested is greater than the first verification value, or less than the second verification value, blind pixel correction is performed on the pixel to be tested. The judgment threshold is a preset value, a rule of thumb. If the judgment threshold is too large, missed detections may occur; if it is too small, misjudgments may occur. Therefore, the judgment threshold can be adjusted freely based on the application scenario.
[0104] In some embodiments, the average pixel value is calculated according to the following formula:
[0105]
[0106] Where Sort_P' is the validation array, and n is the number of neighborhood pixels in the validation array.
[0107] For example, if the pixel value to be tested is C, the verification array is Sort_P', and the judgment threshold th is 65, then the maximum value DH and the minimum value GL of the array Sort_P' are calculated. Then the third difference dif = DH - GL, and the average pixel value avg is:
[0108]
[0109] The first verification value ΔC1 is [avg + (DH - GL) + 65], and the second verification value ΔC2 is [avg - (DH - GL) - 65]. If C > [avg + (DH - GL) + 65], the pixel under test is determined to be a blind pixel; if C < [avg - (DH - GL) - 65], the pixel under test is determined to be a blind pixel. The identified blind pixel is then corrected to improve image detail.
[0110] It is understood that the judgment conditions for detecting whether a pixel to be tested is a blind pixel in the above embodiment can be a combination of one or more of the above conditions. The more judgment conditions there are, the lower the false detection rate of blind pixel detection. This is not limited in this application.
[0111] Based on the above-mentioned infrared image blind pixel detection and processing method, the present application also provides an infrared image blind pixel detection and processing system, such as Figure 7 As shown, the system includes: an acquisition module, a detection module and a processing module, wherein:
[0112] The acquisition module is configured to obtain the pixel value to be measured and the neighborhood pixel value, wherein the pixel value to be measured is the pixel value of the pixel point to be measured; the neighborhood pixel value is the pixel value of the neighborhood pixel point; the neighborhood pixel point is the pixel point in the blind pixel detection window corresponding to the pixel point to be measured, and the blind pixel detection window includes the pixel point to be measured and at least 8 neighborhood pixel points of the pixel point to be measured.
[0113] The detection module is configured to generate a verification array and a first neighborhood gradient array based on the neighborhood pixel values in the blind pixel detection window; calculate a first difference between the pixel value to be tested and each pixel value in the verification array, and add the absolute values of the first difference to obtain an associated gradient sum; filter out the maximum value in the first neighborhood gradient array to generate a second neighborhood gradient array; calculate the sum of each neighborhood pixel value in the second neighborhood gradient array to obtain a neighborhood gradient sum.
[0114] The processing module is configured to perform blind pixel correction on the pixel to be measured if the ratio of the associated gradient sum to the neighborhood gradient sum is greater than a preset gradient threshold.
[0115] It can be seen from the above technical solutions that the infrared image blind pixel detection and processing method and system provided by the present application can perform blind pixel detection on each pixel point in the infrared image through a blind pixel detection window. Among them, the blind pixel detection window includes the pixel point to be tested and at least 8 neighboring pixel points of the pixel point to be tested. Then, based on the neighboring pixel values in the blind pixel detection window, a verification array and a first neighborhood gradient array are generated. Then, the first difference between the pixel value to be tested and each pixel value in the verification array is calculated, and the absolute value of the first difference is added to obtain the associated gradient sum. After the maximum value in the first neighborhood gradient array is filtered out to obtain the second neighborhood gradient array, the sum of each neighborhood pixel value in the second neighborhood gradient array is calculated to obtain the neighborhood gradient sum. When the ratio of the associated gradient sum to the neighborhood gradient sum is greater than the preset gradient threshold, the pixel point to be tested is corrected for a blind pixel point to improve the efficiency of blind pixel detection processing.
[0116] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without expending creative work shall fall within the scope of protection of this application.
Claims
1. A method for detecting and processing blind pixels in infrared images, characterized in that: include: Obtaining a pixel value to be measured and neighboring pixel values, wherein the pixel value to be measured is the pixel value of the pixel point to be measured; The neighborhood pixel value is the pixel value of the neighborhood pixel point; The neighborhood pixel points are pixel points in a blind pixel detection window corresponding to the pixel point to be tested, and the blind pixel detection window includes the pixel point to be tested and at least 8 neighborhood pixel points of the pixel point to be tested; Generating a verification array and a first neighborhood gradient array according to the neighborhood pixel values in the blind pixel detection window includes: Traversing the neighborhood pixel values to obtain the maximum and minimum values among the neighborhood pixel values; Screening out the maximum and minimum values among the neighborhood pixel values to generate a verification array; Calculating a second difference in pixel values in adjacent directions of the pixel to be measured, where the adjacent directions include a horizontal direction, a vertical direction, and a diagonal direction of the pixel to be measured; Extracting the absolute value of the second difference to generate a first neighborhood gradient array; Calculating a first difference between the pixel value to be tested and each pixel value in the verification array, and adding absolute values of the first differences to obtain an associated gradient sum; Screening out the maximum value in the first neighborhood gradient array to generate a second neighborhood gradient array; Calculating the sum of the neighborhood pixel values in the second neighborhood gradient array to obtain a neighborhood gradient sum; The neighborhood gradient sum is calculated according to the following formula: Where G2 is the neighborhood gradient sum; t is the first neighborhood gradient array; max(t) is the maximum value of array t; m is the number of second differences in the first neighborhood gradient array; If the ratio of the associated gradient sum to the neighborhood gradient sum is greater than a preset gradient threshold, performing blind pixel correction on the pixel to be measured; Also includes: Analyze the maximum and minimum values in the verification array; If the value of the pixel to be measured is greater than the maximum value in the verification array, or the value of the pixel to be measured is less than the minimum value in the verification array, blind pixel correction is performed on the pixel to be measured.
2. The infrared image blind pixel detection and processing method according to claim 1, characterized in that: The correlation gradient and are calculated as follows: Where G1 is the associated gradient sum; Sort_P' is the verification array; C is the pixel to be tested; and n is the number of neighborhood pixels in the verification array.
3. The method for detecting and processing blind pixels in infrared images according to claim 1, characterized in that: Also includes: Calculating an average pixel value of the verification array and a third difference, where the third difference is a difference between a maximum value and a minimum value in the verification array; Adding the average pixel value, the third difference value, and the judgment threshold to obtain a first verification value; Calculating a difference between the average pixel value and the third difference value to obtain a fourth difference value; Subtracting the judgment threshold from the fourth difference to obtain a second verification value; If the value of the pixel to be measured is greater than the first verification value, or the value of the pixel to be measured is less than the second verification value, blind pixel correction is performed on the pixel to be measured.
4. The method for detecting and processing blind pixels in infrared images according to claim 3, characterized in that: The average pixel value is calculated according to the following formula: Where Sort_P' is the validation array, and n is the number of neighborhood pixels in the validation array.
5. The infrared image blind pixel detection and processing method according to claim 1, characterized in that: Correcting the pixel to be tested includes: Analyze the target direction corresponding to the minimum value in the first neighborhood gradient array; Obtaining a target pixel value in the target direction; A target pixel average value of the target pixel value is calculated, and the pixel point to be measured is corrected by the target pixel average value.
6. The infrared image blind pixel detection and processing method according to claim 1, characterized in that: include: Acquire a target image, where the target image is a grayscale image; Traversing the coordinates of the pixels to be measured in the target image; The blind pixel detection window is defined according to the coordinates of the pixel point to be detected.
7. A system for detecting and processing blind pixels in infrared images, applied to the method for detecting and processing blind pixels in infrared images according to claim 1, characterized in that: include: An acquisition module is configured to obtain a pixel value to be measured and a neighboring pixel value, wherein the pixel value to be measured is a pixel value of a pixel point to be measured; The neighborhood pixel value is the pixel value of the neighborhood pixel point; The neighborhood pixel points are pixel points in a blind pixel detection window corresponding to the pixel point to be tested, and the blind pixel detection window includes the pixel point to be tested and at least 8 neighborhood pixel points of the pixel point to be tested; A detection module is configured to generate a verification array and a first neighborhood gradient array according to neighborhood pixel values in the blind pixel detection window; Calculating a first difference between the pixel value to be tested and each pixel value in the verification array, and adding the absolute values of the first differences to obtain an associated gradient sum; filtering out the maximum value in the first neighborhood gradient array to generate a second neighborhood gradient array; Calculating the sum of the neighborhood pixel values in the second neighborhood gradient array to obtain a neighborhood gradient sum; The processing module is configured to perform blind pixel correction on the pixel to be measured if the ratio of the associated gradient sum to the neighborhood gradient sum is greater than a preset gradient threshold.
Citation Information
Patent Citations
Defective pixel detecting and correcting method based on minimal mid-value gradient filtering
CN104463891A
Dead pixel detection method, electronic equipment and apparatus thereof
CN106205437A