Bad pixel correction method and apparatus
By analyzing the feature information of consecutive image frames, the bad pixel type is predicted and corrected, solving the problem of difficulty in identifying gradually deteriorating bad pixels in existing technologies, and achieving more efficient bad pixel correction and improved user experience.
Patent Information
- Application Number
- CN202611224130.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies struggle to identify and correct progressively worsening dead pixels in a timely manner, leading to decreased image quality and a poor user experience.
By acquiring multiple consecutive image frames, the feature information of pixel positions is analyzed to predict brightness change trends, identify bad pixel types, and select appropriate correction strategies based on the types, including the prediction and correction of potential bad pixels.
It improves the flexibility and accuracy of bad pixel correction, enabling timely identification and correction of potential bad pixels, thereby enhancing image quality and user experience.
Smart Images

Figure CN123164342A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method and apparatus for defective pixel correction. Background Technology
[0002] During the manufacturing and use of image sensors, some pixels may become damaged, resulting in bright spots, dark spots, or fixed noise in the output image, affecting image quality. These damaged pixels are called dead pixels. Existing technologies typically use two methods for dead pixel correction: static correction and dynamic correction. Static correction is performed by the manufacturer after production, recording the coordinates of all dead pixels in a static list, and then finding and correcting them by looking up the table. Dynamic correction identifies dead pixels based on the grayscale differences between each pixel and its neighboring pixels in a single frame, and then uses the grayscale values of neighboring pixels for interpolation correction. However, existing dead pixel correction technologies mainly target fixed dead pixels that have already shown obvious abnormal characteristics. As some dead pixels gradually deteriorate, their abnormal states are difficult to identify and correct in a timely manner, leading to correction lag and problems such as flickering or sudden bright spots in the image, affecting the user experience. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method and apparatus for defective pixel correction, which identifies and corrects defective pixels that are gradually deteriorating, thereby reducing the impact of defective pixels on image quality and improving user experience.
[0004] In a first aspect, embodiments of the present invention provide a method for defect correction, the method comprising: Acquire multiple consecutive image frames; The feature information of each pixel position is determined based on the multiple image frames; Determine the defective pixel and its type based on the feature information; Based on the correction strategy corresponding to the type of the bad pixel, the bad pixel is corrected; The types of bad pixels include potential bad pixels. The method for determining the bad pixels of the potential bad pixel type includes: predicting the brightness change trend of the pixel position based on the feature information; determining the bad pixel probability of the pixel position based on the brightness change trend; and determining the pixel position as a bad pixel of the potential bad pixel type in response to the bad pixel probability of the pixel position exceeding a preset probability.
[0005] Optionally, determining the feature information of each pixel position based on the plurality of image frames includes: Based on the multiple image frames, a set of pixel values for each pixel position in the red channel, green channel, blue channel and infrared channel is obtained respectively. The set of pixel values includes the pixel values of the pixel position in each image frame in the corresponding channel. The feature information of the pixel position is determined based on the set of pixel values corresponding to the pixel position.
[0006] Optionally, the feature information includes the degree of anomaly at the pixel location and the standard deviation of the pixel value in each channel. The types of bad pixels also include fixed bad pixels and / or flickering bad pixels. The method for determining the type of bad pixel (fixed bad pixel) includes: The number of abnormal frames and the number of consecutive abnormal frames at the pixel position are determined based on the degree of abnormality at the pixel position. The number of abnormal frames is used to characterize the number of image frames at the pixel position that are in an abnormal state, and the number of consecutive abnormal frames is used to characterize the number of image frames at the pixel position that are in an abnormal state consecutively. In response to the fact that the standard deviation of the pixel value at the pixel location in each channel exceeds a first threshold and the number of consecutive abnormal frames at the pixel location exceeds a first preset number, the pixel location is determined to be a dead pixel of a fixed dead pixel type. The method for determining the type of bad pixel as flickering bad pixel includes: in response to the fact that the standard deviation of the pixel value of the pixel position in each channel is not less than a second threshold and does not exceed a first threshold, and the proportion of abnormal frames of the pixel position is within a preset range, the pixel position is determined to be a bad pixel of the type of flickering bad pixel; The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to a pixel location being a fixed bad pixel type or a flickering bad pixel type, the pixel value at that pixel location is corrected using a spatial interpolation algorithm.
[0007] Optionally, the feature information includes the standard deviation of pixel values at the pixel location in each channel, and the type of bad pixel further includes spectrally selective bad pixels. The method for determining the type of bad pixel corresponding to the spectrally selective bad pixel includes: In response to the fact that the standard deviation of the pixel value at the pixel location in the target channel is less than the third threshold, and the standard deviation of the pixel value at the pixel location in other channels outside the target channel is greater than the first threshold, the pixel location is determined to be a spectrally selective bad pixel. The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to the pixel location being a spectrally selective bad pixel, a reference channel corresponding to the target channel is determined; Obtain the first ratio of the statistical value of the target channel pixel value to the statistical value of the reference channel pixel value at the neighboring pixel location, and the reference channel pixel value at the pixel location; The target channel pixel value at the pixel position is corrected based on the first ratio and the reference channel pixel value at the pixel position.
[0008] Optionally, the feature information includes the mapping relationship between the abnormality degree of the pixel position and the global brightness, and the type of bad pixel also includes illumination-dependent bad pixels. The method for determining the type of bad pixel corresponding to the illumination-dependent bad pixel includes: The mapping relationship between the degree of abnormality of the pixel location and the global brightness indicates whether the pixel location is abnormal only in dark frames or only in bright frames, and determines that the pixel location is a bad pixel of the illumination-dependent bad pixel type. The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to the fact that the pixel location is a bad pixel of the illumination-dependent bad pixel type, the corresponding weight is selected according to the global brightness of the current image frame, and the pixel value of the pixel location is corrected by a weighted spatial interpolation algorithm.
[0009] Optionally, the feature information includes the slope of the brightness change at the pixel location, and the step of predicting the brightness change trend at the pixel location based on the feature information and determining the probability of a bad pixel at the pixel location based on the brightness change trend includes: The pixel position that meets the preset conditions is determined as the target pixel position; Based on the slope of the brightness change at the target pixel location, a linear regression or moving average method is used to predict the expected slope at the target pixel location. The probability of a bad pixel at the target pixel location is determined based on the expected slope. The preset conditions include: The standard deviation of the pixel value at the pixel location in any channel is not less than a third threshold and less than a second threshold, and / or the slope of the brightness change indicates that the number of consecutively increasing frames of the pixel brightness at the pixel location exceeds a second preset number.
[0010] Optionally, the correction strategy based on the type of the bad pixel to correct the bad pixel includes: In response to the pixel location being a potential bad pixel, the pixel location is moved into the prediction list, the expected number of deteriorated frames is determined based on the expected slope, and the expected number of deteriorated frames for the pixel location is updated in real time. In response to the fact that the expected number of degraded frames at the target pixel location is less than a third preset number, the target pixel location is pre-corrected.
[0011] Optionally, the pre-correction of the target pixel position includes: The pixel value of the target pixel location in the current image frame is smoothly fused with the pixel value in the historical image frames.
[0012] Optionally, the method further includes: The defective pixels are moved into a defective pixel list, and each defective pixel in the defective pixel list has a corresponding validity period; In response to the bad pixel being in an abnormal state during the validity period, the validity period of the bad pixel is updated to the initial value; If the defective pixel remains in a normal state throughout the validity period, the defective pixel is removed from the defective pixel list.
[0013] Secondly, embodiments of the present invention also provide a defect correction device, the device comprising: The image caching module is used to acquire multiple consecutive image frames; The feature extraction module is used to determine the feature information of each pixel position based on the multiple image frames; A defective pixel classification module is used to determine the defective pixel and its type based on the feature information. The defective pixel correction module is used to correct the defective pixel based on the correction strategy corresponding to the type of defective pixel; The types of bad pixels include potential bad pixels. The method for determining the bad pixels of the potential bad pixel type includes: predicting the brightness change trend of the pixel position based on the feature information; determining the bad pixel probability of the pixel position based on the brightness change trend; and determining the pixel position as a bad pixel of the potential bad pixel type in response to the bad pixel probability of the pixel position exceeding a preset probability.
[0014] This invention acquires multiple consecutive image frames, determines feature information of each pixel position based on the multiple image frames, determines bad pixels and their types based on the feature information, and corrects bad pixels based on the correction strategy corresponding to the bad pixel type. The bad pixel types include potential bad pixels. The method for determining the type of potential bad pixel includes: predicting the brightness change trend of the pixel position based on the feature information; determining the probability of a bad pixel at the pixel position based on the brightness change trend; and determining that the pixel position is a potential bad pixel if the probability of a bad pixel at the pixel position exceeds a preset probability. Therefore, this invention can identify bad pixel types and select corresponding correction strategies for correction, improving the flexibility and accuracy of bad pixel correction. Simultaneously, it can identify and correct potential bad pixels, improving the user experience. Attached Figure Description
[0015] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which: Figure 1 This is a flowchart of the defect correction method according to an embodiment of the present invention; Figure 2 This is a flowchart of the potential defect determination method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the potential defect correction process according to an embodiment of the present invention; Figure 4 This is a flowchart of the bad pixel update process according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a dead pixel correction device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0016] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0017] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0018] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0019] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0020] In the field of image processing technology, especially in scenarios such as smartphones and medical imaging where accurate color reproduction of different objects is required, it is crucial to accurately and promptly correct bad pixels in images.
[0021] Figure 1 This is a flowchart of a defect correction method according to an embodiment of the present invention. Figure 1 As shown, the defect correction method in this embodiment specifically includes the following steps: Step S110: Acquire multiple consecutive image frames.
[0022] Specifically, the electronic device can cache the current image frame to the corresponding storage space while displaying it, and at the same time delete historical image frames in the storage space that are more than a certain number of frames away from the current image frame, so as to ensure that multiple consecutive image frames are always stored in the storage space. Preferably, in order to balance the effect of bad pixel recognition and storage resource consumption, 5-15 image frames can be cached.
[0023] Since all image frames have the same specifications, for each pixel position, there exists a corresponding pixel and its pixel value in each image frame. Preferably, in this embodiment, each pixel consists of four channels: red channel, green channel, blue channel, and infrared channel. That is, each pixel includes pixel values under four different channels: R value, G value, B value, and IR value.
[0024] Step S120: Determine the feature information of each pixel position based on multiple image frames. The feature information is used to characterize the temporal response characteristics of the pixel position in each channel. Optionally, the feature information includes the set of pixel values for the pixel position in each channel, where the set of pixel values includes the pixel values of the pixel position in each image frame for the corresponding channel. For example, if multiple image frames include five image frames P1-P5, and for pixel position (x, y), its pixel values in each image frame are (R1, G1, B1, IR1), (R2, G2, B2, IR2), (R2, G2, B2, IR2), (R3, G3, B3, IR3), and (R3, G3, B3, IR3), then the set of pixel values for pixel position (x, y) in the red channel can be determined as (R1, R2, R3, R4, R5).
[0025] Furthermore, the feature information also includes the mean pixel value and / or standard deviation of the pixel value for each channel. The mean pixel value reflects the long-term brightness level of the pixel location in the corresponding channel, while the standard deviation reflects the stability of the pixel location in the corresponding channel. Specifically, step S120 may include: acquiring the set of pixel values for each pixel location in the red, green, blue, and infrared channels based on multiple image frames; and determining the feature information of the pixel location based on the set of pixel values corresponding to that pixel location. For example, for any set of pixel values for a pixel location in the red channel, calculating the standard deviation of each element R1-R5 in the set of pixel values, and using this as the standard deviation of the pixel value for that pixel location in the red channel.
[0026] Furthermore, the feature information also includes the degree of anomalousness of the pixel position in each image frame and / or the mapping relationship between the degree of anomalousness of the pixel position and the global brightness. This mapping relationship is used to reflect the influence of the global brightness on the degree of anomalousness of the pixel position. Specifically, step S120 may further include: obtaining the degree of anomalousness of the pixel position in each image frame and the corresponding global brightness; performing linear fitting based on multiple sets of anomalousness and global brightness to obtain the mapping relationship between the degree of anomalousness of the pixel position and the global brightness. Optionally, the degree of anomalousness can be characterized by the difference between the pixel brightness of the pixel position in the corresponding image frame and the statistical value of the pixel brightness of neighboring pixel positions. When the degree of anomalousness exceeds the corresponding threshold, it can be determined that the pixel position is in an abnormal state in the corresponding image frame; otherwise, it is determined that it is in a normal state in the corresponding image frame. The statistical value of the pixel brightness of neighboring pixel positions refers to the mean or median of the pixel brightness of the eight neighboring pixel positions of the pixel position.
[0027] Based on the degree of anomaly of a pixel location in each image frame, it can be further determined whether the pixel location is in an abnormal state in each image frame, and thus determine the number of abnormal frames and the number of consecutive abnormal frames for that pixel location. The number of abnormal frames represents the number of image frames in which the pixel location is in an abnormal state, and the number of consecutive abnormal frames represents the number of image frames in which the pixel location is in an abnormal state consecutively. For example, for image frames P1-P5, if the pixel location is in an abnormal state in P1 and P3-P5, and is in a normal state in P4, then its number of abnormal frames is determined to be 4 (i.e., four frames P1, P3, P4, and P5), and its number of consecutive abnormal frames is determined to be 3 (i.e., three frames P3, P4, and P5).
[0028] The pixel brightness corresponding to a pixel location can be obtained by weighted summing of the pixel values at that location across all channels. The brightness weights for each channel can be preset or determined based on the spectral response characteristics of the image acquisition device, the characteristics of the display device, or pre-implemented calibration operations. The global brightness of an image frame can be determined based on the average pixel brightness at each pixel location within that image frame, or based on the ambient illuminance at the time of image acquisition.
[0029] Furthermore, the feature information also includes the slope of the brightness change at the pixel location, used to reflect whether the pixel location is deteriorating. Specifically, step S120 may further include: obtaining the pixel brightness of the pixel location in each image frame, performing piecewise linear fitting or curve fitting on each pixel brightness, and determining the set of slopes in the obtained fitting function as the brightness change slope of the pixel location. For example, if the pixel brightness of the pixel location (x, y) in image frames P1-P5 is I1-I5 respectively, after performing linear fitting, the obtained fitting function can be regarded as a curve composed of four line segments: P1-P2, P2-P3, P3-P4, and P4-P5, where each line segment has a corresponding slope k12, k23, k34, and k45, and the brightness change slope of the pixel location (x, y) is the set composed of k12, k23, k34, and k45.
[0030] Step S130: Determine the defective pixel and its type based on the feature information.
[0031] Optionally, dead pixels can be categorized into different types based on their manifestation, such as fixed dead pixels, flickering dead pixels, spectrally selective dead pixels, illumination-dependent dead pixels, and latent dead pixels. Each type of dead pixel corresponds to a different determination method and correction strategy. It should be understood that the types of dead pixels in this embodiment are not limited to the above five types. In practical applications, other types can be set according to the image features or other relevant features corresponding to the pixel positions in a specific scene, and corresponding determination methods and correction strategies can be set. This embodiment does not specifically limit this.
[0032] A fixed bad pixel refers to a pixel location that consistently outputs abnormal pixel values across different image frames. If the standard deviation of the pixel value at any pixel location exceeds a first threshold across all channels, and the number of consecutive abnormal frames at that pixel location exceeds a first preset number, then that pixel location can be determined as a fixed bad pixel. Here, an abnormality at a pixel location in any image frame means that the pixel brightness at that location in that image frame significantly deviates from the pixel brightness of its neighboring pixels; this can be determined by the degree of abnormality at the pixel location.
[0033] Flickering dead pixels refer to pixel locations where pixel values irregularly switch between normal and abnormal states across multiple consecutive image frames. If the standard deviation of pixel values at any given pixel location across all channels is not less than a second threshold and does not exceed a first threshold, and the percentage of abnormal frames at that pixel location is within a preset range (e.g., 20%-80%), then that pixel location can be identified as a flickering dead pixel.
[0034] Spectrally selective bad pixels refer to pixel locations that exhibit abnormal responses only to specific channels, while their responses to other channels are essentially normal. If the standard deviation of pixel values at any given pixel location in the target channel is less than a third threshold, and the standard deviation of pixel values at that location in other channels besides the target channel is greater than a first threshold, then that pixel location can be identified as a spectrally selective bad pixel. The target channel can be any one or more of the red, green, blue, and infrared channels. It can be understood that the first threshold is greater than the second threshold, and the second threshold is greater than the third threshold. In one example, the first, second, and third thresholds can be set to 30, 10, and 5, respectively.
[0035] Illumination-dependent bad pixels are pixel locations that exhibit abnormalities only under specific lighting intensities, while remaining normal under other conditions. If the mapping relationship between the degree of abnormality at any pixel location and the global brightness indicates that the pixel location is abnormal only under specific global brightness levels—for example, abnormal only in dark-field frames or only in bright-field frames—then that pixel location can be identified as an illumination-dependent bad pixel. Dark-field frames and bright-field frames can be determined based on the global brightness of each image frame. For example, image frames with a global brightness not lower than a fourth threshold can be identified as bright-field frames, and image frames with a global brightness lower than the fourth threshold can be identified as dark-field frames.
[0036] A potential bad pixel refers to a pixel location that is not yet a bad pixel but has shown an abnormal trend and has a high risk of deterioration. To determine a potential bad pixel, the brightness change trend of the pixel location can be predicted based on its feature information. The probability of a bad pixel at that location can be determined based on the brightness change trend. If the probability of a bad pixel at that location exceeds a preset probability, the pixel location is determined to be a potential bad pixel. Optionally, to save computational resources, prediction can be initiated only for pixel locations that meet preset conditions.
[0037] Figure 2 This is a flowchart of a method for determining potential defects according to an embodiment of the present invention. Figure 2 As shown, in one optional implementation, determining the defective pixel and its type based on feature information specifically includes the following steps: Step S210: The pixel position that meets the preset conditions is determined as the target pixel position. Optionally, the preset conditions may include: the standard deviation of the pixel value of the pixel position in any channel is not less than a third threshold and less than a second threshold, and / or the number of consecutively increasing frames in which the brightness of the pixel at the pixel position increases, representing the brightness change slope, exceeds a second preset number.
[0038] Step S220: Based on the slope of the brightness change at the target pixel position, predict the expected slope at the target pixel position using linear regression or moving average methods.
[0039] Step S230: Determine the probability of a bad pixel at the target pixel location based on the expected slope. The bad pixel probability characterizes the confidence level of the prediction result. If the expected number of deteriorating frames is N and the bad pixel probability is m, it means that after N image frames, the pixel value at the target pixel location has a probability of m satisfying the judgment conditions for each of the aforementioned bad pixel types. Specifically, the pixel values corresponding to the pixel location in the next few frames can be simulated based on the expected slope, and the expected number of deteriorating frames can be determined by combining the aforementioned methods for determining each bad pixel type. The bad pixel probability can be obtained by inputting the brightness change slope of the target pixel location, the expected slope, and the brightness change slope and expected slope of neighboring pixel locations into a pre-established bad pixel probability model. The bad pixel probability determination model can be a logistic regression model, a Bayesian classification model, or other mathematical models capable of outputting a classification overview or anomaly confidence.
[0040] Step S140: Correct the bad pixels based on the correction strategy corresponding to the type of bad pixel.
[0041] Specifically, for pixel locations with fixed or flickering defect types, the corresponding correction strategy is to correct the pixel value at that location using a spatial interpolation algorithm. For example, obtain the pixel value statistics of the eight neighboring pixels at that location and replace the pixel value at that location with the pixel value statistics. Optionally, the pixel value statistics can be the mean or median of all pixel values.
[0042] For pixel locations with spectrally selective defects, the corresponding correction strategy is as follows: determine the reference channel corresponding to the target channel, obtain the first ratio of the statistical value of the target channel pixel value to the statistical value of the reference channel pixel value at the neighboring pixel location, and the reference channel pixel value at that pixel location, and correct the target channel pixel value at that pixel location based on the first ratio and the reference channel pixel value. Here, the reference channel is a spectral channel that is in a normal state and has a certain correlation with the target channel pixel value. Preferably, when the target channel is a visible light channel (red, green, or blue channel), its corresponding reference channel is an infrared channel; when the target channel is an infrared channel, its corresponding reference channel is any channel in the visible light channel. In one example, if the target channel is the red channel, then the reference channel can be determined as the infrared channel. The average pixel value R_avg of the red channel and the average pixel value IR_avg of the infrared channel of eight neighboring pixels are obtained. Then, the first ratio R_avg / IR_avg is calculated. Simultaneously, the pixel value IR at that pixel location in the infrared channel is obtained. Based on R_avg / IR_avg and IR, the pixel value (R_avg × IR) / IR_avg at that pixel location in the red channel is calculated. Therefore, the pixel value of the target channel at that pixel location can be corrected based on the neighboring pixel locations.
[0043] For pixel locations with illumination-dependent defects, the corresponding correction strategy is as follows: Based on the global brightness of the current image frame, select the corresponding weights and correct the pixel values at the pixel location using a weighted spatial interpolation algorithm. Specifically, if the pixel location only exhibits anomalies under the target global brightness, set the weight corresponding to that target global brightness as the first weight, and set the weights corresponding to other global brightness levels (excluding the target global brightness) as the second weight. The first and second weights represent the weights of the statistical values of neighboring pixel locations when correcting using the weighted spatial interpolation algorithm, with the first weight being greater than the second weight. Preferably, the first weight can be set to 0.9, and the second weight to 0.2.
[0044] For pixel locations of potential bad pixel types, the corresponding correction strategy is as follows: move the pixel location into the prediction list, determine the expected number of frames to deteriorate based on the expected slope, and update the expected number of frames to deteriorate for the pixel location in real time. If the expected number of frames to deteriorate for a target pixel location is less than a third preset number (e.g., 2 frames), pre-correct the target pixel location. Pre-correction of the target pixel location includes: smoothly fusing the pixel value of the target pixel location in the current image frame with the pixel value in historical image frames. Specifically, obtain the statistical values of the pixel values of the target pixel location in multiple historical image frames and assign them a corresponding third weight; obtain the pixel value of the target pixel location in the current image frame and assign it a corresponding fourth weight; and perform a weighted sum of the statistical values of the pixel values of the target pixel location in multiple historical image frames and the pixel value in the current image frame to obtain the corrected pixel value. Preferably, the third weight can be set to 0.4 and the fourth weight to 0.6. While pre-correcting the target pixel location, it can be removed from the prediction list. The prediction list includes the coordinates of bad pixels of each potential bad pixel type and the corresponding expected number of frames to deteriorate.
[0045] Optionally, updating the expected number of deteriorated frames at a pixel location in real time includes: decrementing the expected number of deteriorated frames at each pixel location in the prediction list by one in response to an update of the current image frame. In other optional implementations, updating the expected number of deteriorated frames at a pixel location in real time may further include: predicting the expected slope of each pixel location based on multiple currently cached image frames in response to an update of the current image frame, thereby determining and updating its corresponding expected number of deteriorated frames. The specific prediction process is similar to the aforementioned method and will not be elaborated further here. Figure 3 This is a schematic diagram of the potential defect correction process according to an embodiment of the present invention. Figure 3 As shown, for pixel position (x1, y1), the expected number of degraded frames decreases as the current image frame is updated. When it decreases to 2, pixel position (x1, y1) is pre-corrected and removed from the prediction list.
[0046] Therefore, this embodiment can identify and correct potential bad pixels one or more frames before they worsen, reducing computational resource consumption while achieving pre-correction of bad pixels, ensuring that bad pixels do not have a perceptible impact on the image, and improving image display quality and user experience.
[0047] Figure 4 This is a flowchart of the bad pixel update process according to an embodiment of the present invention. Figure 4 Furthermore, in this embodiment, each defective pixel is stored in a list format, including the coordinates of each defective pixel, its corresponding defective pixel type, and its validity period. After step S130, the defective pixel correction method of this embodiment further includes: moving the defective pixel into the defective pixel list and setting a corresponding validity period (T frame) for it, while continuously monitoring the state of the defective pixel. The validity period of each defective pixel decreases with the update of the current image frame. If the defective pixel is detected to be in an abnormal state within the validity period, its corresponding validity period is updated to the initial value T frame. If the defective pixel remains in a normal state within the validity period, it is removed from the defective pixel list after its validity period expires, in order to save system resources. Here, a defective pixel deviating from the normal state means that it meets any of the aforementioned defective pixel type judgment conditions. Thus, this embodiment can ensure that each defective pixel is updated in real time, avoiding the continuous consumption of computing resources by some temporary defective pixels, and further improving system performance.
[0048] It is understood that the specific values of the thresholds, preset ranges, and weights mentioned in this embodiment can be determined based on empirical values or statistical results of calibration samples. The specific values mentioned above are only for illustrative purposes and do not impose any restrictions on their specific values.
[0049] This embodiment acquires multiple consecutive image frames, determines the feature information of each pixel position based on the multiple image frames, determines the bad pixel and its type based on the feature information, and corrects the bad pixel based on the correction strategy corresponding to the bad pixel type. The bad pixel type includes potential bad pixels. The method for determining the type of potential bad pixel includes: predicting the brightness change trend of the pixel position based on the feature information; determining the probability of a bad pixel at the pixel position based on the brightness change trend; and determining that the pixel position is a potential bad pixel if the probability of a bad pixel at the pixel position exceeds a preset probability. Therefore, it is possible to identify the bad pixel type and select the corresponding correction strategy for correction, improving the flexibility and accuracy of bad pixel correction. Simultaneously, it is possible to identify and correct potential bad pixels, improving the user experience.
[0050] Figure 5 This is a schematic diagram of a dead pixel correction device according to an embodiment of the present invention. Figure 5 As shown, the defective pixel correction device 5 in this embodiment includes an image caching module 51, a feature extraction module 52, a defective pixel classification module 53, and a defective pixel correction module 54.
[0051] Image caching module 51 is used to acquire multiple consecutive image frames. Feature extraction module 52 is used to determine the feature information of each pixel position based on multiple image frames. Defect pixel classification module 53 is used to determine the defective pixels and their types based on the feature information. Defective pixel correction module 54 is used to correct defective pixels based on the correction strategy corresponding to the defective pixel type.
[0052] This embodiment acquires multiple consecutive image frames, determines the feature information of each pixel position based on the multiple image frames, determines the bad pixel and its type based on the feature information, and corrects the bad pixel based on the correction strategy corresponding to the bad pixel type. The bad pixel type includes potential bad pixels. The method for determining the bad pixel corresponding to the potential bad pixel type includes: predicting the brightness change trend of the pixel position based on the feature information, determining the bad pixel probability of the pixel position based on the brightness change trend, and determining that the pixel position is a potential bad pixel if the bad pixel probability of the pixel position exceeds a preset probability. Thus, it is possible to identify the bad pixel type and select the corresponding correction strategy for correction, improving the flexibility and accuracy of bad pixel correction. At the same time, it is possible to identify and correct potential bad pixels, improving the user experience.
[0053] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. (For example...) Figure 6 As shown, Figure 6 The illustrated electronic device is a general-purpose data processing device, comprising a general-purpose computer hardware architecture, including at least a processor 61 and a memory 62. The processor 61 and memory 62 are connected via a bus 63. The memory 62 is adapted to store instructions or programs executable by the processor 61. The processor 61 can be a standalone microprocessor or a collection of one or more microprocessors. Thus, the processor 61 executes the instructions stored in the memory 62, thereby performing the method flow of the embodiments of the present invention as described above to process data and control other devices. The bus 63 connects the aforementioned components together, and also connects these components to a display controller 64, a display device, and an input / output (I / O) device 65. The input / output (I / O) device 65 can be a mouse, keyboard, modem, network interface, touch input device, motion-sensing input device, printer, and other devices known in the art. Typically, the input / output device 65 is connected to the system via an input / output (I / O) controller 66.
[0054] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus (devices), or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0055] This application is described with reference to flowchart illustrations of methods, apparatus (devices), and computer program products according to embodiments of this application. It should be understood that each step in the flowchart can be implemented by computer program instructions.
[0056] These computer program instructions may be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction means, the implementation process of which is described in the instruction means. Figure 1 The function specified in one or more processes.
[0057] These computer program instructions may also be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, produce instructions for implementing processes. Figure 1 A device for a function specified in one or more processes.
[0058] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program for use by a computer to execute some or all of the above-described method embodiments.
[0059] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program specifying the relevant hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0060] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for defective pixel correction, characterized in that, The method includes: Acquire multiple consecutive image frames; The feature information of each pixel position is determined based on the multiple image frames; Determine the defective pixel and its type based on the feature information; Based on the correction strategy corresponding to the type of the bad pixel, the bad pixel is corrected; The types of bad pixels include potential bad pixels. The method for determining the bad pixels of the potential bad pixel type includes: predicting the brightness change trend of the pixel position based on the feature information; determining the bad pixel probability of the pixel position based on the brightness change trend; and determining the pixel position as a bad pixel of the potential bad pixel type in response to the bad pixel probability of the pixel position exceeding a preset probability.
2. The method according to claim 1, characterized in that, The step of determining the feature information of each pixel position based on the multiple image frames includes: Based on the multiple image frames, a set of pixel values for each pixel position in the red channel, green channel, blue channel and infrared channel is obtained respectively. The set of pixel values includes the pixel values of the pixel position in each image frame in the corresponding channel. The feature information of the pixel position is determined based on the set of pixel values corresponding to the pixel position.
3. The method according to claim 2, characterized in that, The feature information includes the degree of anomaly at the pixel location and the standard deviation of the pixel value in each channel. The types of bad pixels also include fixed bad pixels and / or flickering bad pixels. The method for determining the type of fixed bad pixels includes: The number of abnormal frames and the number of consecutive abnormal frames at the pixel position are determined based on the degree of abnormality at the pixel position. The number of abnormal frames is used to characterize the number of image frames at the pixel position that are in an abnormal state, and the number of consecutive abnormal frames is used to characterize the number of image frames at the pixel position that are in an abnormal state consecutively. In response to the fact that the standard deviation of the pixel value at the pixel location in each channel exceeds a first threshold and the number of consecutive abnormal frames at the pixel location exceeds a first preset number, the pixel location is determined to be a dead pixel of a fixed dead pixel type. The method for determining the type of bad pixel as flickering bad pixel includes: in response to the fact that the standard deviation of the pixel value of the pixel position in each channel is not less than the second threshold and does not exceed the first threshold, and the proportion of abnormal frames of the pixel position is within a preset range, the pixel position is determined to be a bad pixel of the type of flickering bad pixel; The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to the fact that the pixel location is a fixed bad pixel type or a flickering bad pixel type, the pixel value at the pixel location is corrected using a spatial interpolation algorithm.
4. The method according to claim 2, characterized in that, The feature information includes the standard deviation of pixel values at the pixel location in each channel. The types of bad pixels also include spectrally selective bad pixels. The method for determining the type of bad pixel corresponding to the spectrally selective bad pixel includes: In response to the fact that the standard deviation of the pixel value at the pixel location in the target channel is less than the third threshold, and the standard deviation of the pixel value at the pixel location in other channels outside the target channel is greater than the first threshold, the pixel location is determined to be a spectrally selective bad pixel. The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to the pixel location being a spectrally selective bad pixel, a reference channel corresponding to the target channel is determined; Obtain the first ratio of the statistical value of the target channel pixel value to the statistical value of the reference channel pixel value at the neighboring pixel location, and the reference channel pixel value at the pixel location; The target channel pixel value at the pixel position is corrected based on the first ratio and the reference channel pixel value at the pixel position.
5. The method according to claim 1, characterized in that, The feature information includes the mapping relationship between the abnormality of the pixel position and the global brightness. The types of bad pixels also include illumination-dependent bad pixels. The method for determining the type of illumination-dependent bad pixel includes: The mapping relationship between the degree of abnormality of the pixel location and the global brightness indicates whether the pixel location is abnormal only in dark frames or only in bright frames, and determines that the pixel location is a bad pixel of the illumination-dependent bad pixel type. The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to the fact that the pixel location is a bad pixel of the illumination-dependent bad pixel type, the corresponding weight is selected according to the global brightness of the current image frame, and the pixel value of the pixel location is corrected by a weighted spatial interpolation algorithm.
6. The method according to claim 2, characterized in that, The feature information includes the slope of the brightness change at the pixel location. The step of predicting the brightness change trend at the pixel location based on the feature information and determining the probability of a bad pixel at the pixel location based on the brightness change trend includes: The pixel position that meets the preset conditions is determined as the target pixel position; Based on the slope of the brightness change at the target pixel location, a linear regression or moving average method is used to predict the expected slope at the target pixel location. The probability of a bad pixel at the target pixel location is determined based on the expected slope. The preset conditions include: the standard deviation of the pixel value at the pixel position in any channel is not less than a third threshold and less than a second threshold, and / or the number of consecutively increasing frames representing the pixel brightness at the pixel position by the brightness change slope exceeds a second preset number.
7. The method according to claim 6, characterized in that, The correction strategy based on the type of the bad pixel corrects the bad pixel, including: In response to the pixel location being a potential bad pixel, the pixel location is moved into the prediction list, the expected number of deteriorated frames is determined based on the expected slope, and the expected number of deteriorated frames for the pixel location is updated in real time. In response to the fact that the expected number of degraded frames at the target pixel location is less than a third preset number, the target pixel location is pre-corrected.
8. The method according to claim 7, characterized in that, The pre-correction of the target pixel position includes: The pixel value of the target pixel location in the current image frame is smoothly fused with the pixel value in the historical image frames.
9. The method according to claim 1, characterized in that, The method further includes: The defective pixels are moved into a defective pixel list, and each defective pixel in the defective pixel list has a corresponding validity period; In response to the bad pixel being in an abnormal state during the validity period, the validity period of the bad pixel is updated to the initial value; If the defective pixel remains in a normal state throughout the validity period, the defective pixel is removed from the defective pixel list.
10. A defective pixel correction device, characterized in that, The device includes: The image caching module is used to acquire multiple consecutive image frames; The feature extraction module is used to determine the feature information of each pixel position based on the multiple image frames; A defective pixel classification module is used to determine the defective pixel and its type based on the feature information. The defective pixel correction module is used to correct the defective pixel based on the correction strategy corresponding to the type of defective pixel; The types of bad pixels include potential bad pixels. The method for determining the bad pixels of the potential bad pixel type includes: predicting the brightness change trend of the pixel position based on the feature information; determining the bad pixel probability of the pixel position based on the brightness change trend; and determining the pixel position as a bad pixel of the potential bad pixel type in response to the bad pixel probability of the pixel position exceeding a preset probability.
