A blind cell detection method and device, computer equipment and medium
By using a sliding window detection method in infrared images, comparing the gray values of the center pixel with those of neighboring pixels, and calculating the mean and variance, the problem of low efficiency and inconsistent results in blind pixel detection in existing technologies is solved, achieving efficient detection of isolated and continuous blind pixels and preservation of image edges.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF MICROELECTRONICS CHINESE ACAD OF SCI LTD
- Filing Date
- 2023-03-07
- Publication Date
- 2026-04-28
AI Technical Summary
Existing blind pixel detection methods in infrared imaging systems suffer from computational complexity, low efficiency, and inconsistent detection results, especially for isolated and continuous blind pixels.
An N×N sliding window is used to process a single frame of infrared image. By comparing the gray values of the center pixel with those of its neighboring pixels, the mean and variance are calculated to determine whether the center pixel is a blind pixel. Blind pixels are detected and compensated by replacing the gray value of the center pixel with the mean.
It achieves efficient detection of isolated blind cells and can better preserve image edges. It is characterized by simple computation and easy hardware implementation, and improves the quality of infrared images.
Smart Images

Figure CN116630227B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and in particular to a blind pixel detection method, apparatus, computer equipment, and medium. Background Technology
[0002] Infrared detectors are the core components of infrared imaging systems. They convert the temperature information of target radiation into electrical quantities, which are then converted from analog to digital to achieve infrared imaging. Due to uneven doping in existing detector manufacturing processes, inconsistent output responses among pixels result in isolated or continuous blind pixels in infrared images. Detecting and compensating for the positions of these blind pixels using algorithms can significantly improve image quality and reduce false alarms in the detection of small targets.
[0003] Current blind pixel detection methods mainly include blackbody calibration-based methods and scene-based methods. Among them, the blackbody calibration-based method requires an external radiation source to obtain the response of each pixel under different temperature radiation sources, and then judges it according to the pixel response rate and other indicators in the national standard. This method is simple to calculate, but it is calibrated in the operation of the imaging system, which reduces the system efficiency.
[0004] Scene-based detection methods often use filtering algorithms to smooth infrared images and use residual images for thresholding. However, since the threshold selection is uncertain, the detection effect is uncertain and cannot effectively preserve image edges. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a method, apparatus, computer equipment, and medium for detecting isolated blind pixels in a single frame of infrared image, and to further determine whether neighboring pixels are blind pixels, with good detection performance for consecutive blind pixels as well. The specific scheme is as follows:
[0006] On the one hand, this application provides a blind pixel detection method, characterized by comprising:
[0007] S1, establish an N×N first sliding window for a single frame of thermal infrared image, where N is an odd number, and the first sliding window includes a center pixel and multiple neighboring pixels adjacent to the center pixel;
[0008] S2, compare the gray value of the center pixel with the gray value of the neighboring pixels. If the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel, execute step S3. Otherwise, move the first sliding window along a preset direction and repeat step S2 until the first sliding window traverses the single frame thermal infrared image.
[0009] S3, based on the gray value of the center pixel and the gray value of the neighboring pixels, determine the mean μ and the variance σ of the gray value;
[0010] S4, if the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ), the center pixel is determined to be a blind pixel; otherwise, the center pixel is determined to be a non-blind pixel.
[0011] S5: Determine the neighboring pixel with the largest gray value from multiple neighboring pixels and denot it as the first pixel;
[0012] S6, establish a second sliding window with the first pixel as the center pixel, replace the gray value of the center pixel of the first sliding window with the mean value μ, and repeat steps S2-S4.
[0013] In another aspect, embodiments of this application also provide a blind pixel detection device, characterized in that it includes:
[0014] The establishment unit is used to establish an N×N first sliding window for a single frame of thermal infrared image, where N is an odd number, and the first sliding window includes a center pixel and a plurality of neighboring pixels adjacent to the center pixel;
[0015] The comparison unit is used to compare the gray value of the center pixel with the gray value of the neighboring pixels, and determine that the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel.
[0016] The first determining unit is configured to determine the mean μ and the variance σ of the gray values based on the gray values of the center pixel and the gray values of the neighboring pixels.
[0017] The second determining unit is configured to determine the center pixel as a blind pixel when the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ); otherwise, determine the center pixel as a non-blind pixel.
[0018] The third determining unit is used to determine the neighboring pixel with the largest gray value from multiple neighboring pixels, and is denoted as the first pixel;
[0019] The replacement unit is used to establish a second sliding window with the first pixel as the center pixel, and replace the gray value of the center pixel of the first sliding window with the mean value μ.
[0020] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory:
[0021] The memory is used to store program code and transmit the program code to the processor;
[0022] The processor is used to execute the blind pixel detection method described above according to the instructions in the program code.
[0023] In another aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program for executing the blind pixel detection method described above.
[0024] In another aspect, embodiments of this application provide a computer program product including instructions that, when run on a computer, cause the computer to perform the blind pixel detection method described above.
[0025] This application provides a blind pixel detection method, apparatus, computer device, and medium, including: S1, establishing an N×N first sliding window for a single frame of thermal infrared image, where N is an odd number, the first sliding window including a center pixel and a plurality of neighboring pixels adjacent to the center pixel; S2, comparing the gray value of the center pixel with the gray values of the neighboring pixels, and if the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel, then proceeding to step S3; otherwise, moving the first sliding window along a preset direction and repeating step S2 until... The first sliding window traverses the single-frame thermal infrared image; S3, based on the gray value of the center pixel and the gray value of the neighboring pixels, the mean μ and the variance σ of the gray value are determined; S4, when the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ), the center pixel is determined to be a blind pixel; otherwise, the center pixel is determined to be a non-blind pixel; S5, the neighboring pixel with the largest gray value is determined from multiple neighboring pixels and denoted as the first pixel; S6, a second sliding window is established with the first pixel as the center pixel, the gray value of the center pixel of the first sliding window is replaced with the mean μ, and the steps S2-S4 are repeated.
[0026] In the embodiments of this application, isolated blind pixels in a single frame infrared image can be detected, and it can also be further determined whether the neighboring pixels are blind pixels. It also has a good detection effect on continuous blind pixels. Compared with existing blind pixel detection schemes, in addition to realizing the blind pixel detection function, this invention can also better preserve the image edge. It has the characteristics of simple calculation and easy hardware implementation. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating a blind cell detection method provided in an embodiment of this application is shown;
[0029] Figure 2 This illustration shows a 3×3 encoding diagram of a thermal infrared image provided in an embodiment of this application;
[0030] Figure 3 A 3×3 encoded schematic diagram of another thermal infrared image provided in the embodiments of this application;
[0031] Figure 4 A 3×3 encoding template provided for an embodiment of this application;
[0032] Figure 5 A 3×3 mean template provided for embodiments of this application;
[0033] Figure 6 A structural block diagram of a blind element detection device provided in an embodiment of this application;
[0034] Figure 7 This is a schematic diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0035] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0036] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0037] For ease of understanding, the following detailed description, in conjunction with the accompanying drawings, provides an embodiment of a blind element detection method, apparatus, computer device, and medium provided in this application.
[0038] refer to Figure 1 The diagram shown is a flowchart of a blind pixel detection method provided in an embodiment of this application. The method may include the following steps.
[0039] S1, establish an N×N first sliding window for a single frame of thermal infrared image.
[0040] In this embodiment, single-frame infrared image data collected in an uncooled infrared thermal imaging module can be acquired. An N×N first sliding window is established for the single-frame thermal infrared image. The single-frame thermal infrared image can be traversed cyclically through the first sliding window to complete the blind pixel detection of the single-frame thermal infrared image.
[0041] Where N can be an odd number, for example, when N is 3, a 3×3 first sliding window is established, which includes the center pixel and multiple neighboring pixels adjacent to the center pixel.
[0042] S2: Compare the gray value of the center pixel with the gray values of the neighboring pixels. If the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel, execute step S3. Otherwise, move the first sliding window along the preset direction and repeat step S2 until the first sliding window traverses a single frame of thermal infrared image.
[0043] In this embodiment, the grayscale value of the center pixel can be compared with the grayscale values of adjacent pixels to select bright spots or dark spots in the thermal infrared image for blind spot detection. If the grayscale value of each adjacent pixel is greater than or equal to the grayscale value of the center pixel, the center pixel is considered a dark spot. Figure 2 The diagram shown is a 3×3 encoding schematic of a thermal infrared image provided in an embodiment of this application. The numerical value represents the gray value of a pixel, including a center pixel and 8 neighboring pixels. The gray value of the center pixel is 1, and the gray value of each neighboring pixel is greater than the gray value of the center pixel, indicating that the center pixel is a dark spot.
[0044] When the grayscale value of each neighboring pixel is less than that of the center pixel, the center pixel is considered a bright spot. (Reference) Figure 3 As shown, this is a 3×3 encoding schematic diagram of another thermal infrared image provided in an embodiment of this application. The gray value of the center pixel is 10, and the gray values of each neighboring pixel are all less than the gray value of the center pixel, indicating that the center pixel is a bright spot.
[0045] Bright spots and dark spots are very likely blind spots and require further judgment. Therefore, if the gray value of each adjacent pixel is greater than or equal to the gray value of the center pixel, or if the gray value of each neighboring pixel is less than the gray value of the center pixel, then step S3 is executed.
[0046] Specifically, for neighboring pixels, if not all neighboring pixels have gray values greater than or equal to the gray value of the center pixel, then the center pixel is not a blind spot. If not all neighboring pixels have gray values less than the gray value of the center pixel, then the center pixel is also not a blind spot. In this case, the first sliding window moves along the preset direction and the S2 step is repeated until the first sliding window traverses the single frame of thermal infrared image, thus completing the blind spot detection of the single frame of thermal infrared image.
[0047] In one possible implementation, when N is 3, step S2 can be specifically as follows: compare the gray value of the center pixel with the gray values of the adjacent pixels. For each adjacent pixel, if the gray value of the adjacent pixel is greater than or equal to the gray value of the center pixel, mark the encoding information of the adjacent pixel as 1; if the gray value of the adjacent pixel is less than the gray value of the center pixel, mark the encoding information of the adjacent pixel as 0.
[0048] Specifically, for the acquired single-frame infrared image data, a 3×3 sliding window is established to traverse the thermal infrared image. The gray value of the center pixel is compared with the gray values of the neighboring pixels. Pixels with gray values of the neighboring pixels that are greater than or equal to the gray value of the center pixel are represented as 1, and those that are not represented as 0. The binary encoding is then performed. Subsequently, for the neighboring pixels, the binary encoding can be read in a clockwise direction.
[0049] Encoding clearly defines the state and local texture of pixels surrounding the central pixel. For different types of local textures, 00000000 represents a bright spot, 11111111 represents a dark spot, and 00001111 indicates the presence of an edge within the window. During image processing, different local processing algorithms can be applied to different encoded information. For example, for an edge texture like 00001111, edge extraction and template modification can be performed to achieve edge sharpening, resulting in lower blurring of image edges and better preservation of image edges.
[0050] Specifically, refer to Figure 4 As shown, this is a 3×3 encoding template provided in an embodiment of this application, which can... Figure 2 The gray value is multiplied and added to the 3×3 encoding template, for example, 9×(-1)+1×1=-8<0. In this case, the neighboring pixels in the first row and first column can be represented as 1. When the calculation result is less than or equal to 0, the neighboring pixels are represented as 1, and when the calculation result is greater than 0, the neighboring pixels are represented as 0.
[0051] Of course, when the gray value of an adjacent pixel is greater than or equal to the gray value of the center pixel, the encoding information for marking the adjacent pixel can also be 0. When the gray value of an adjacent pixel is less than the gray value of the center pixel, the encoding information for marking the adjacent pixel can also be 1. There are no specific limitations here, and those skilled in the art can set it according to the actual situation.
[0052] Read the encoding information of all adjacent pixels. If the encoding information of all adjacent pixels is 00000000 or 11111111, it indicates a bright spot or a dark spot. Further determination can be made as to whether it is a blind spot. If so, proceed to step S3. Otherwise, it means that there is no blind spot within the first sliding window. Move the first sliding window along the preset direction and repeat step S2 until the first sliding window has traversed a single frame of thermal infrared image. The preset direction can be along the positive X-axis or Y-axis, and is not specifically limited here.
[0053] S3. Based on the gray values of the center pixel and the gray values of the neighboring pixels, determine the mean μ and the variance σ of the gray values.
[0054] In this embodiment, the mean μ and variance σ of the gray values within the sliding window can be determined based on the gray values of the center pixel and the neighboring pixels. The formulas for calculating the mean μ and variance σ are as follows:
[0055]
[0056] Where n is the number of pixels in the 3×3 template, x i This represents the number of pixels within the template.
[0057]
[0058] Specifically, refer to Figure 5 As shown, this is a 3×3 mean template provided in an embodiment of this application. The mean template can be multiplied by a first sliding window. For example, the mean template and... Figure 2 Multiplying them together, the average value is [(1×9)+(1×2)+(1×3)+(1×8)+(1×1)+(1×4)+(1×7)+(1×6)+(1×5)] / 9=5.
[0059] S4. If the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ), the center pixel is determined to be a blind pixel; otherwise, the center pixel is determined to be a non-blind pixel.
[0060] In this embodiment, it can be determined whether the gray value of the center pixel is within the range of (μ-3σ, μ+3σ). If the gray value of the center pixel is within the range of (μ-3σ, μ+3σ), it can be indicated that the center pixel is a non-blind pixel. If the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ), it can be indicated that the center pixel is a blind pixel. Isolated blind spots in a single frame of thermal infrared image can be detected.
[0061] In one possible implementation, after determining the center pixel as a blind element in step S4, the position information of the center pixel can also be obtained in order to record the position of the blind element.
[0062] S5: Determine the neighboring pixel with the largest gray value from multiple neighboring pixels and denot it as the first pixel;
[0063] In this embodiment of the application, the neighboring pixel with the largest gray value can be determined from multiple neighboring pixels and denoted as the first pixel, so as to determine whether the first pixel with a relatively large gray value is a blind pixel, thereby determining multiple consecutive blind pixels.
[0064] In one possible implementation, the neighboring pixel with the largest gray value can be determined from multiple neighboring pixels, and the encoding information of the neighboring pixel with the largest gray value is marked as 111.
[0065] In this embodiment, the neighboring pixel with the largest gray value can be determined simultaneously from multiple neighboring pixels, and the neighboring pixel with the second largest gray value can be determined from multiple neighboring pixels. The neighboring pixel with the second largest gray value is recorded as the second pixel, thereby determining multiple consecutive blind pixels.
[0066] In one possible implementation, the next largest grayscale value neighboring pixel can be determined from multiple neighboring pixels, and the encoding information of the next largest grayscale value neighboring pixel is marked as 110.
[0067] S6, establish a second sliding window with the first pixel as the center pixel, replace the gray value of the center pixel of the first sliding window with the mean value μ, and repeat steps S2-S4.
[0068] In this embodiment, a second sliding window is established with the first pixel as the new center pixel. The grayscale value of the center pixel is repeatedly compared with the grayscale values of adjacent pixels to determine bright and dark spots. When the center pixel is a bright or dark spot, the mean and variance of the second sliding window are determined. If the grayscale value of the new center pixel is outside the range of (μ-3σ, μ+3σ), the new center pixel, i.e., the first pixel, is determined to be a blind pixel; otherwise, the first pixel is determined to be a non-blind pixel. This allows for the detection of whether the first pixel and the center pixel of the first sliding window are consecutive blind pixels.
[0069] Specifically, when determining the mean and variance of the second sliding window, the center pixel of the first sliding window is a neighboring pixel in the second sliding window. Since the center pixel of the first sliding window has been identified as a blind pixel, the gray value of the blind pixel has no value. The gray value of the center pixel of the first sliding window can be replaced with the mean μ of the first sliding window in order to accurately calculate the mean and variance of the second sliding window.
[0070] In this way, isolated blind pixels in a single frame of infrared image can be detected, and neighboring pixels can be further determined as blind pixels. It also has a good detection effect on continuous blind pixels. Compared with existing blind pixel detection schemes, this invention can not only realize the blind pixel detection function, but also better preserve the image edge. It has the characteristics of simple calculation and easy hardware implementation.
[0071] In this embodiment of the application, when it is determined that the first pixel and the center pixel in the first sliding window are consecutive blind pixels, it is possible to continue to determine whether there are any consecutive blind pixels, thereby improving the accuracy of blind pixel detection for single-frame thermal infrared pixels.
[0072] In this embodiment of the application, after repeatedly executing steps S2-S4 to determine that the first pixel is a blind pixel, the method further includes establishing a third sliding window with the second pixel as the center pixel, replacing the gray value of the center pixel of the first sliding window with the mean value μ, and repeating steps S2-S4 to determine whether the second pixel is a blind pixel, and judging whether the first pixel, the second pixel and the center pixel of the first sliding window are consecutive pixels, thereby improving the accuracy of blind pixel detection.
[0073] In this embodiment, after repeatedly executing steps S2-S4 and determining that the first pixel is a non-blind pixel, it indicates that the neighboring pixel with the largest gray value is not a blind pixel, and the neighboring pixel with the second largest gray value is also not a blind pixel. Therefore, there is no need to detect the neighboring pixel with the second largest gray value, i.e., the second pixel. The blind pixel detection in this area has been completed. The first sliding window can be moved along the preset direction, and step S2 can be repeated until the first sliding window traverses a single frame of thermal infrared image.
[0074] This application provides a blind pixel detection method, including: S1, establishing an N×N first sliding window for a single frame of thermal infrared image, where N is an odd number, the first sliding window including a center pixel and a plurality of neighboring pixels adjacent to the center pixel; S2, comparing the gray value of the center pixel with the gray values of the neighboring pixels, and if the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel, then executing step S3; otherwise, moving the first sliding window along a preset direction and repeating step S2 until the first sliding window... S3. The window iterates through the single-frame thermal infrared image; S4. Based on the gray value of the center pixel and the gray value of the neighboring pixels, the mean μ and the variance σ of the gray value are determined; S5. When the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ), the center pixel is determined to be a blind pixel; otherwise, the center pixel is determined to be a non-blind pixel; S6. The neighboring pixel with the largest gray value is determined from multiple neighboring pixels and denoted as the first pixel; S7. A second sliding window is established with the first pixel as the center pixel, and the gray value of the center pixel of the first sliding window is replaced with the mean μ. Steps S2-S4 are repeated.
[0075] In the embodiments of this application, isolated blind pixels in a single frame infrared image can be detected, and it can also be further determined whether the neighboring pixels are blind pixels. It also has a good detection effect on continuous blind pixels. Compared with existing blind pixel detection schemes, in addition to realizing the blind pixel detection function, this invention can also better preserve the image edge. It has the characteristics of simple calculation and easy hardware implementation.
[0076] Based on the above blind pixel detection methods, this application also provides a blind pixel detection device, as shown in the reference. Figure 6 The diagram shown is a structural block diagram of a blind cell detection device provided in an embodiment of this application. The device may include:
[0077] Establishment unit 201 is used to establish an N×N first sliding window for a single frame thermal infrared image, where N is an odd number, and the first sliding window includes a center pixel and a plurality of neighboring pixels adjacent to the center pixel;
[0078] The comparison unit 202 is used to compare the gray value of the center pixel with the gray value of the neighboring pixels, and determine that the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel.
[0079] The first determining unit 203 is used to determine the mean μ and the variance σ of the gray value based on the gray value of the center pixel and the gray value of the neighboring pixels.
[0080] The second determining unit 204 is used to determine the center pixel as a blind pixel when the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ); otherwise, it determines the center pixel as a non-blind pixel.
[0081] The third determining unit 205 is used to determine the neighboring pixel with the largest gray value from multiple neighboring pixels, and denoted as the first pixel;
[0082] Replacement unit 206 is used to establish a second sliding window with the first pixel as the center pixel, and replace the gray value of the center pixel of the first sliding window with the mean value μ.
[0083] Specifically, the third determining unit is used for:
[0084] The pixel with the largest gray value among multiple neighboring pixels is identified and denoted as the first pixel, and the pixel with the second largest gray value among multiple neighboring pixels is identified and denoted as the second pixel.
[0085] After repeatedly executing steps S2-S4 to determine that the first pixel is a blind pixel, the method further includes:
[0086] Establish a third sliding window with the second pixel as the center pixel, replace the gray value of the center pixel of the first sliding window with the mean value μ, and repeat steps S2-S4.
[0087] Specifically, the blind cell detection device further includes a fourth determining unit, used for:
[0088] After repeatedly executing steps S2-S4 to determine that the first pixel is a non-blind pixel, the first sliding window is moved along a preset direction, and step S2 is repeated until the first sliding window traverses the single frame thermal infrared image.
[0089] Specifically, when N is 3, the comparison unit is used for:
[0090] The grayscale value of the center pixel is compared with the grayscale values of the neighboring pixels. For each neighboring pixel, when the grayscale value of the neighboring pixel is greater than or equal to the grayscale value of the center pixel, the encoding information of the neighboring pixel is marked as 1, and when the grayscale value of the neighboring pixel is less than the grayscale value of the center pixel, the encoding information of the neighboring pixel is marked as 0.
[0091] Read the encoding information of all adjacent pixels. If the encoding information of all adjacent pixels is 00000000 or 11111111, execute step S3. Otherwise, move the first sliding window along the preset direction and repeat step S2 until the first sliding window traverses the single frame thermal infrared image.
[0092] Specifically, the third determining unit is used for:
[0093] The neighboring pixel with the largest gray value is determined from multiple neighboring pixels, and the encoding information of the neighboring pixel with the largest gray value is marked as 111.
[0094] Specifically, the blind cell detection device further includes an acquisition unit, used for:
[0095] After determining that the center pixel is a blind pixel in step S4, the position information of the center pixel is obtained so as to record the position of the blind pixel.
[0096] In the embodiments of this application, isolated blind pixels in a single frame infrared image can be detected, and it can also be further determined whether the neighboring pixels are blind pixels. It also has a good detection effect on continuous blind pixels. Compared with existing blind pixel detection schemes, in addition to realizing the blind pixel detection function, this invention can also better preserve the image edge. It has the characteristics of simple calculation and easy hardware implementation.
[0097] In another aspect, embodiments of this application provide a computer device, with reference to Figure 7 The diagram shown is a schematic representation of a computer device according to an embodiment of this application. The computer device includes a processor 320 and a memory 310.
[0098] The memory is used to store program code and transmit the program code to the processor;
[0099] The processor is used to execute the blind pixel detection method provided in the above embodiments according to the instructions in the program code.
[0100] The computer device may include a terminal device or a server, and the aforementioned blind pixel detection device may be configured in the computer device.
[0101] In another aspect, embodiments of this application also provide a storage medium for storing a computer program for executing the blind pixel detection method provided in the above embodiments.
[0102] In addition, this application also provides a computer program product including instructions, which, when run on a computer, causes the computer to execute the blind pixel detection method provided in the above embodiments.
[0103] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by program instructions in hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.
[0104] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0105] The above description is merely a preferred embodiment of this application. Although this application has disclosed preferred embodiments above, it is not intended to limit this application. Any person skilled in the art can make many possible variations and modifications to the technical solutions of this application using the methods and techniques disclosed above, or modify them into equivalent embodiments with equivalent changes, without departing from the scope of the technical solutions of this application. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of this application without departing from the content of the technical solutions of this application shall still fall within the protection scope of the technical solutions of this application.
Claims
1. A blind pixel detection method, characterized in that, include: S1, establish an N×N first sliding window for a single frame of thermal infrared image, where N is an odd number, and the first sliding window includes a center pixel and multiple neighboring pixels adjacent to the center pixel; S2, compare the gray value of the center pixel with the gray value of the neighboring pixels. If the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or if the gray value of each neighboring pixel is less than the gray value of the center pixel, execute step S3. Otherwise, move the first sliding window along a preset direction and repeat step S2 until the first sliding window traverses the single frame thermal infrared image. S3, based on the gray value of the center pixel and the gray value of the neighboring pixels, determine the mean μ and the variance σ of the gray value; S4, if the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ), the center pixel is determined to be a blind pixel; otherwise, the center pixel is determined to be a non-blind pixel. S5: Determine the neighboring pixel with the largest gray value from multiple neighboring pixels and denot it as the first pixel; S6, establish a second sliding window with the first pixel as the center pixel, replace the gray value of the center pixel of the first sliding window with the mean value μ, and repeat steps S2-S4.
2. The method according to claim 1, characterized in that, Step S5 includes: The pixel with the largest gray value among multiple neighboring pixels is identified and denoted as the first pixel, and the pixel with the second largest gray value among multiple neighboring pixels is identified and denoted as the second pixel. After repeatedly executing steps S2-S4 to determine that the first pixel is a blind pixel, the method further includes: Establish a third sliding window with the second pixel as the center pixel, replace the gray value of the center pixel of the first sliding window with the mean value μ, and repeat steps S2-S4.
3. The method according to claim 2, characterized in that, After repeatedly executing steps S2-S4 to determine that the first pixel is a non-blind pixel, the method further includes: Move the first sliding window along a preset direction and repeat step S2 until the first sliding window traverses the single frame of thermal infrared image.
4. The method according to claim 1, characterized in that, When N is 3, step S2 includes: The grayscale value of the center pixel is compared with the grayscale value of the neighboring pixels. For each neighboring pixel, when the grayscale value of the neighboring pixel is greater than or equal to the grayscale value of the center pixel, the encoding information of the neighboring pixel is marked as 1, and when the grayscale value of the neighboring pixel is less than the grayscale value of the center pixel, the encoding information of the neighboring pixel is marked as 0. Read the encoding information of all neighboring pixels. If the encoding information of all neighboring pixels is 00000000 or 11111111, execute step S3. Otherwise, move the first sliding window along the preset direction and repeat step S2 until the first sliding window traverses the single frame thermal infrared image.
5. The method according to claim 4, characterized in that, Step S5 includes: The neighboring pixel with the largest gray value is determined from multiple neighboring pixels, and the encoding information of the neighboring pixel with the largest gray value is marked as 111.
6. The method according to claim 1, characterized in that, After determining the center pixel as a blind pixel in step S4, the method further includes: The position information of the center pixel is obtained in order to record the position of the blind element.
7. A blind element detection device, characterized in that, include: The establishment unit is used to establish an N×N first sliding window for a single frame of thermal infrared image, where N is an odd number, and the first sliding window includes a center pixel and a plurality of neighboring pixels adjacent to the center pixel; The comparison unit is used to compare the gray value of the center pixel with the gray value of the neighboring pixels, and determine that the gray value of each neighboring pixel is greater than or equal to the gray value of the center pixel, or the gray value of each neighboring pixel is less than the gray value of the center pixel. The first determining unit is configured to determine the mean μ and the variance σ of the gray values based on the gray values of the center pixel and the gray values of the neighboring pixels. The second determining unit is configured to determine the center pixel as a blind pixel when the gray value of the center pixel is outside the range of (μ-3σ, μ+3σ); otherwise, determine the center pixel as a non-blind pixel. The third determining unit is used to determine the neighboring pixel with the largest gray value from multiple neighboring pixels, and is denoted as the first pixel; The replacement unit is used to establish a second sliding window with the first pixel as the center pixel, and replace the gray value of the center pixel of the first sliding window with the mean value μ.
8. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the blind pixel detection method according to any one of claims 1-6 according to the instructions in the program code.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for executing the blind pixel detection method according to any one of claims 1-6.
10. A computer program product comprising instructions that, when run on a computer, causes the computer to perform the blind cell detection method according to any one of claims 1-6.
Citation Information
Patent Citations
Method for dynamically compensating blind pixel
CN101980283A
Automatic online blind pixel detection method
CN106327474A