A camera pixel bad point detection and correction method, system, terminal and medium

By acquiring data through multi-intensity point illumination of the camera, calculating response coefficients and goodness of fit, generating a bad pixel matrix, and performing grayscale correction, the problem of inaccuracy and insufficient correction of camera pixel bad pixel detection is solved, thereby improving the accuracy of detection and correction and image quality.

CN121462754BActive Publication Date: 2026-05-15TECH & ENG CENT FOR SPACE UTILIZATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610013122.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-07
Publication Date
2026-05-15
Estimated Expiration
2046-01-07

AI Technical Summary

Technical Problem

Existing methods for detecting dead pixels in cameras require resetting thresholds when the environment changes, resulting in high detection complexity, susceptibility to noise, incomplete edge pixel detection, inaccurate correction, and insufficient correction values.

Method used

By controlling a uniform light source to illuminate the camera at multiple light intensity points, an image dataset is acquired. The first response coefficient, second response coefficient, and goodness of fit of each pixel are calculated to generate a bad pixel matrix. Gray values ​​are then corrected based on pixel type and location.

Benefits of technology

It improves the accuracy and correction precision of bad pixel detection, reduces the impact of noise, ensures the preservation of image details, and enhances image quality and communication system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121462754B_ABST
    Figure CN121462754B_ABST
Patent Text Reader

Abstract

The application relates to a camera pixel bad point detection and correction method, system, terminal and medium, and relates to the technical field of image detection and correction. The method comprises the following steps: determining a plurality of light intensity points based on the maximum light intensity of a camera pixel response, controlling a uniform light source to irradiate a camera to obtain an image data set; calculating a plurality of response coefficients corresponding to each pixel based on the image data set; discriminating bad points of each pixel of the camera based on a first response coefficient matrix, a second response coefficient matrix and a goodness-of-fit matrix to generate a bad point matrix; for each pixel, determining the type of the pixel based on the bad point matrix, and correcting the gray value of the pixel based on the type, position and preset bad point correction algorithm of each pixel to obtain a corrected image data set. The application can accurately detect camera pixel bad points and effectively correct the pixel gray value, thereby improving the image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection and correction technology, and in particular to a method, system, terminal and medium for detecting and correcting bad pixels in camera pixels. Background Technology

[0002] Laser communication, with its advantages of small divergence angle and concentrated energy, shows broad application prospects in the field of deep space communication. Due to the high precision required for beam pointing, deep space laser communication systems often rely on cameras to detect the centroid of the received light spot, and then use fast-reflecting mirrors to capture and track the spot. A camera, as a photodetector array, consists of numerous pixels. When a laser beam enters the camera's target surface, each pixel generates a photocurrent. The magnitude of the photocurrent is related to the laser intensity. The display device converts the photocurrent into the grayscale values ​​of the corresponding pixels to form an image. Through the camera and display device, an image representing the light intensity received by each pixel can be obtained. Therefore, improving the imaging capabilities of the camera is crucial for laser communication systems.

[0003] In camera imaging, the previous approach to addressing pixel defects typically involved manually setting a defect threshold and using the average of neighboring elements to replace the pixel grayscale value at the defective location. Specifically, a defect detection grayscale threshold was first set, approximately a certain proportion of the background light grayscale value. Each pixel was then detected individually, and its grayscale value was used to determine if it was a defective pixel. If certain conditions were met, it was identified as such, generating a defect matrix. Finally, the average grayscale value of the neighboring pixels surrounding the defective pixel was used as a correction value.

[0004] However, this traditional method has many drawbacks. Before detecting bad pixels, a detection threshold needs to be set based on the background light intensity. When the camera's working environment or background light intensity changes, the method must be retested and a new threshold set; otherwise, the bad pixel detection function will fail, resulting in significant limitations. Furthermore, bad pixel detection requires real-time comparison. During capture and tracking, a large number of frames are generated per second, and each image contains numerous pixels, making individual detection extremely labor-intensive and complex. Additionally, judging whether a pixel is a bad pixel based on only one image is susceptible to accidental factors such as camera thermal noise and shot noise, leading to misjudgments, missed judgments, and some pixels repeatedly switching between bad and non-bad pixel status, resulting in low accuracy. Moreover, since the method relies on the grayscale values ​​of eight neighboring pixels, the number of neighboring pixels at camera edges is insufficient to determine whether edge pixels are bad pixels, resulting in a lack of global coverage. Furthermore, when correcting bad pixels, if there are still bad pixels around the original bad pixel, the correction value will be inaccurate, indicating insufficient consideration. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a method, system, terminal and medium for detecting and correcting camera pixel defects, in order to solve at least one of the above-mentioned technical problems.

[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows:

[0007] Firstly, this application provides a method for detecting and correcting camera pixel defects, employing the following technical solution:

[0008] A method for detecting and correcting dead pixels in a camera includes:

[0009] Based on the maximum light intensity of the camera pixel response, multiple light intensity points are determined, and a uniform light source is controlled to illuminate the camera at the multiple light intensity points to obtain the image dataset corresponding to the camera. The image dataset includes multiple images, and each image contains a gray value matrix of M×N pixels. The M×N pixels represent the row and column size of the camera pixel array.

[0010] Based on the image dataset, calculate the first response coefficient, the second response coefficient, and the goodness of fit for each pixel to obtain the first response coefficient matrix, the second response coefficient matrix, and the goodness of fit matrix;

[0011] Based on the first response coefficient matrix, the second response coefficient matrix, and the goodness-of-fit matrix, each pixel of the camera is identified as a bad pixel, and a bad pixel matrix is ​​generated.

[0012] For each pixel, the type of the pixel is determined based on the bad pixel matrix, wherein the type is a bad pixel or a non-bad pixel. The gray value of the pixel is corrected based on the type and location of each pixel and a preset bad pixel correction algorithm to obtain a corrected image dataset.

[0013] The beneficial effects of this invention are as follows: By controlling a uniform light source to illuminate the camera at multiple light intensity points and acquiring an image dataset, and calculating the first response coefficient, second response coefficient, and goodness of fit based on the pixel response data under different illumination intensities, a multi-dimensional and quantitative characterization of pixel response characteristics is achieved, thereby improving the accuracy of bad pixel detection and effectively distinguishing between real bad pixels and random noise. Furthermore, by combining the generated bad pixel matrix and pixel position information, a corresponding correction algorithm is used for targeted grayscale correction, which can effectively repair bad pixels while preserving image details to the maximum extent, improving correction accuracy and image quality.

[0014] Based on the above technical solution, the present invention can be further improved as follows.

[0015] Further, the step of calculating the first response coefficient, the second response coefficient, and the goodness of fit for each pixel based on the image dataset includes:

[0016] Based on the image dataset and the row and column size of the camera pixel array, a normalized light intensity value sequence is calculated, which represents the average gray value of all pixels in the image at each light intensity point;

[0017] For each pixel, based on the linear regression model, the standardized light intensity value sequence, the row and column size of the camera pixel array, and the number of light intensity points, the first response coefficient, the second response coefficient, and the goodness of fit corresponding to the pixel are calculated.

[0018] The advantages of adopting the above-mentioned further scheme are: by using multiple light intensity points for fitting, compared with the traditional two-point correction method, the influence of shot noise and thermal noise is effectively reduced, and the accuracy and robustness of coefficient calculation are improved; at the same time, the introduction of goodness of fit allows for quantitative evaluation of the linear response quality of each pixel, providing a reliable basis for subsequent bad pixel identification, thereby ensuring the adaptability and reliability of the correction model.

[0019] Furthermore, the formula for calculating the first response coefficient is as follows:

[0020]

[0021] The formula for calculating the second response coefficient is:

[0022]

[0023] The formula for calculating the goodness of fit is:

[0024] ;

[0025] in, For pixels The first response coefficient, For pixels The second response coefficient, For pixels The goodness of fit is given by m, where m represents the m-th row of the camera pixel array, n represents the n-th column of the camera pixel array, K represents the number of light intensity points, and i represents the i-th light intensity point, for a total of K+1 points. For pixels The gray value at the i-th light intensity point, Let be the standardized light intensity value at the i-th light intensity point.

[0026] The beneficial effects of adopting the above-mentioned further scheme are as follows: by using the preset first response coefficient, second response coefficient and goodness-of-fit calculation formula, the calculation is performed based on the image dataset obtained by illuminating the camera with multiple light intensity points. It can adopt a better linear regression fitting method, which is conducive to reducing the influence of noise on the compensation coefficient, improving the accuracy of the compensation coefficient, thereby compensating for the response differences between different pixels of the camera, enhancing the consistency of pixels, reducing image noise, and can also be used for subsequent operations such as bad pixel detection, bad pixel evaluation and gray value compensation.

[0027] Further, the step of performing bad pixel detection on each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix, and the goodness-of-fit matrix to generate a bad pixel matrix includes:

[0028] For each pixel, based on the first response coefficient matrix, it is determined whether the first response coefficient corresponding to the pixel is within a preset first response coefficient interval. Based on the second response coefficient matrix, it is determined whether the second response coefficient corresponding to the pixel is within a preset second response coefficient interval. Based on the goodness-of-fit matrix, it is determined whether the goodness-of-fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness-of-fit interval.

[0029] For each pixel, if the first response coefficient corresponding to the pixel is located in a preset first response coefficient range, and the second response coefficient corresponding to the pixel is located in a preset second response coefficient range, and the goodness of fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness of fit range, then the pixel is determined to be a non-bad pixel; otherwise, the pixel is a bad pixel.

[0030] Based on the discrimination results of each pixel, a bad pixel matrix is ​​generated.

[0031] The beneficial effects of adopting the above-mentioned further scheme are as follows: In the process of judging bad pixels for each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix and the goodness-of-fit matrix, automatic bad pixel identification is achieved by setting a preset threshold range. This can accurately distinguish pixels with abnormal response or failed fitting, generate a bad pixel matrix, and thus ensure that subsequent grayscale correction is only applied to reliable non-bad pixel pixels, avoids incorrect compensation for abnormal pixels, and at the same time can compensate for the response differences between different pixels of the camera, enhance pixel consistency, reduce image noise, improve the tracking performance of the laser communication system and reduce the communication error rate.

[0032] Furthermore, the grayscale value of the pixel is corrected based on the type, location, and a preset bad pixel correction algorithm for each pixel to obtain a corrected image dataset, including:

[0033] For each pixel, if the pixel type is a non-dead pixel, then the target gray value is determined to be the original gray value;

[0034] For each pixel, if the pixel type is a bad pixel, the gray value of the pixel is corrected based on the pixel's position and a preset bad pixel correction algorithm, and the target gray value is determined to be the corrected gray value.

[0035] Based on the target gray value of each pixel, the corrected image dataset is determined.

[0036] The beneficial effects of adopting the above-mentioned further scheme are as follows: by clearly distinguishing pixels into two categories, bad pixels and non-bad pixels, and performing differentiated processing procedures, a high degree of automation of the correction process and clarity of processing logic are achieved; for non-bad pixels, the strategy of retaining the original grayscale value ensures the lossless processing efficiency of effective image information; for bad pixels, the corresponding neighborhood correction algorithm is adaptively called based on their spatial location, so that the correction operation can accurately match the distribution characteristics of the surrounding pixels of the pixel, thereby effectively eliminating bad pixel outliers while maximizing the preservation of the authenticity of image details and geometric features. Finally, by integrating the target grayscale values ​​of all pixels, a high-quality corrected image dataset is generated.

[0037] Furthermore, if the pixel type is a bad pixel, then the grayscale value of the pixel is corrected based on the pixel's position and a preset bad pixel correction algorithm, including:

[0038] If the pixel type is a bad pixel, the position type of the pixel is determined based on the position of the pixel. The position type is any one of the following: a corner point, an edge point, and neither a corner point nor an interior point of the camera pixel.

[0039] Based on the location type of the pixel, determine all adjacent pixels of the pixel;

[0040] Sort the gray values ​​of all adjacent pixels of the pixel in descending order to obtain a sorted gray value sequence;

[0041] The bad pixel markers of all adjacent pixels of the pixel are sorted in order of gray value to obtain a bad pixel marker sequence.

[0042] Based on all adjacent pixels, the gray value sequence, the bad pixel flag sequence, and the preset bad pixel correction formula, the corrected gray value is obtained.

[0043] The beneficial effects of adopting the above-mentioned further scheme are as follows: by adaptively determining the location type of the bad pixel according to its specific location (corner, edge, or interior) in the pixel array, and accurately locking the corresponding number of adjacent pixels accordingly, the processing strategy is refined and targeted; by co-sorting the gray values ​​of adjacent pixels and their bad pixel markers, and calculating based on the sorting results and the preset bad pixel correction formula, the interference of other bad pixels that may exist in the neighborhood on the correction results is weakened while effectively replacing the bad pixel outliers, thus improving the accuracy of gray value correction.

[0044] Furthermore, determining all neighboring pixels of a pixel based on its location type includes:

[0045] If the location type of the pixel is a corner point, then all three adjacent pixels of the pixel are determined to be 3.

[0046] If the location type of the pixel is an edge point and not a corner point, then all adjacent pixels of the pixel are determined to be 5;

[0047] If the location type of the pixel is an interior point, then all of the pixel's neighboring pixels are determined to be 8.

[0048] The beneficial effect of adopting the above-mentioned further scheme is that by finely distinguishing the position type of the pixel into three cases: corner point, edge point (non-corner point) and internal point, and adaptively determining the number of its neighboring pixels to be 3, 5 or 8 respectively, the selection of neighboring pixels can strictly fit the actual spatial structure characteristics of the pixel in the array.

[0049] Secondly, this application provides a camera pixel defect detection and correction system, which adopts the following technical solution:

[0050] A camera pixel dead pixel detection and correction system includes:

[0051] The acquisition module is used to determine multiple light intensity points based on the maximum light intensity of the camera pixel response, and control a uniform light source to illuminate the camera with multiple light intensity points to acquire the image dataset corresponding to the camera. The image dataset includes multiple images, each of which contains a gray value matrix of M×N pixels, and the M×N pixels represent the row and column size of the camera pixel array.

[0052] The pixel response coefficient calculation module calculates the first response coefficient, the second response coefficient, and the goodness of fit for each pixel based on the image dataset, and obtains the first response coefficient matrix, the second response coefficient matrix, and the goodness of fit matrix.

[0053] The bad pixel detection module is used to detect bad pixels for each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix and the goodness-of-fit matrix, and generate a bad pixel matrix.

[0054] The bad pixel correction module is used to determine the type of each pixel based on the bad pixel matrix, wherein the type is a bad pixel or a non-bad pixel, and to correct the gray value of the pixel based on the type, position and preset bad pixel correction algorithm of each pixel to obtain a corrected image dataset.

[0055] Thirdly, this application provides a terminal device that adopts the following technical solution:

[0056] A terminal device includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any one of the first aspects of the method for detecting and correcting camera pixel defects.

[0057] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0058] A computer-readable storage medium storing a computer program that can be loaded by a processor and executed as described in any one of the first aspects of the method for detecting and correcting camera pixel defects.

[0059] Additional aspects and advantages of this application will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of this application. Attached Figure Description

[0060] Figure 1 This is a flowchart illustrating a camera pixel defect detection and correction method according to an embodiment of the present invention.

[0061] Figure 2 A schematic diagram of grayscale value detection for a camera pixel defect detection and correction method provided in an embodiment of the present invention;

[0062] Figure 3 This is a comparison chart of the number of defective pixels detected according to one embodiment of the present invention;

[0063] Figure 4 This is a schematic diagram of the original camera image provided in one embodiment of the present invention.

[0064] Figure 5 This is a schematic diagram of a conventionally detected and corrected image provided in an embodiment of the present invention;

[0065] Figure 6 This is a schematic diagram of an image after defect detection and correction according to an embodiment of the present invention;

[0066] Figure 7 This is a schematic diagram of a camera pixel defect detection and correction system provided in one embodiment of the present invention.

[0067] Figure 8 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0069] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0070] This application provides a method for detecting and correcting camera pixel defects. This method can be executed by a terminal device, which can be a server or a mobile terminal device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The mobile terminal device can be a laptop computer, a desktop computer, etc., but is not limited to these.

[0071] like Figure 1 As shown, a method for detecting and correcting dead pixels in a camera includes:

[0072] S1. Based on the maximum light intensity of the camera pixel response, determine multiple light intensity points, and control a uniform light source to illuminate the camera with multiple light intensity points to obtain the image dataset corresponding to the camera. The image dataset includes multiple images, and each image contains a gray value matrix of M×N pixels. The M×N pixels represent the row and column size of the camera pixel array.

[0073] In this embodiment, multiple light intensity points can be determined using a light intensity adjustment device, such as a light intensity controller. The light intensity controller can precisely control the light intensity of a uniform light source to achieve multiple preset light intensity points. For example, the light intensity controller can change the luminous intensity of the light source by adjusting the current. The determination of light intensity points is based on the maximum light intensity of the camera's pixel response. Multiple light sources with different intensities can be used to sequentially illuminate the camera.

[0074] like Figure 2 As shown, assuming the camera has OK Columns of pixels Indicates the first Line 1 The columns of pixels. Assume the maximum light intensity a pixel can respond to is... Therefore, multiple light intensity points can be set as... , , , ..., , When a uniform light source illuminates the camera, the camera outputs... Image , , , ..., ,in, ( ), Representing pixels When the received light intensity is equal to The grayscale value of the corresponding pixel.

[0075] A camera is a photodetector array composed of many pixels. When a laser beam enters the camera's target surface, a photocurrent is generated in each pixel. The magnitude of the photocurrent is related to the light intensity. The display device converts the photocurrent of each pixel into the grayscale value of the corresponding pixel and assembles it into an image. This results in an image dataset containing multiple images, each image containing an M×N pixel grayscale value matrix, where M×N pixels represent the row and column size of the camera's pixel array.

[0076] S2, calculate the first response coefficient, the second response coefficient, and the goodness of fit for each pixel based on the image dataset, and obtain the first response coefficient matrix, the second response coefficient matrix, and the goodness of fit matrix;

[0077] In this embodiment of the application, S2 includes the following sub-steps:

[0078] S21, based on the image dataset and the row and column size of the camera pixel array, calculate a normalized light intensity value sequence, wherein the normalized light intensity value sequence represents the average gray value of the entire image pixels at each light intensity point;

[0079] S22, for each pixel, based on the linear regression model, the standardized light intensity value sequence, the row and column size of the camera pixel array, and the number of light intensity points, calculate the first response coefficient, the second response coefficient, and the goodness of fit corresponding to the pixel.

[0080] By using multiple light intensity points for fitting, compared with the traditional two-point correction method, the influence of shot noise and thermal noise is effectively reduced, and the accuracy and robustness of coefficient calculation are improved. At the same time, the introduction of goodness of fit allows for quantitative evaluation of the linear response quality of each pixel, providing a reliable basis for subsequent bad pixel identification, thereby ensuring the adaptability and reliability of the correction model.

[0081] In this embodiment of the application, the formula for calculating the standardized light intensity value is as follows:

[0082] ( );

[0083] The formula for calculating the first response coefficient is:

[0084] ;

[0085] The formula for calculating the second response coefficient is:

[0086]

[0087] The formula for calculating goodness of fit is:

[0088] ;

[0089] in, For pixels The first response coefficient, For pixels The second response coefficient, For pixels The goodness of fit is given by m, where m represents the m-th row of the camera pixel array, n represents the n-th column of the camera pixel array, K represents the number of light intensity points, and i represents the i-th light intensity point, for a total of K+1 points. For pixels The gray value at the i-th light intensity point, Let be the standardized light intensity value at the i-th light intensity point.

[0090] Using preset first response coefficients, second response coefficients, and goodness-of-fit calculation formulas, calculations are performed on image datasets obtained from multiple light intensity points illuminating the camera. This allows for the use of a better-performing linear regression fitting method, which helps reduce the impact of noise on the compensation coefficients, improves the accuracy of the compensation coefficients, and thus compensates for the response differences between different pixels of the camera, enhances pixel consistency, reduces image noise, and can also be used for subsequent operations such as bad pixel detection, bad pixel evaluation, and grayscale value compensation.

[0091] S3, based on the first response coefficient matrix, the second response coefficient matrix and the goodness-of-fit matrix, perform bad pixel detection on each pixel of the camera to generate a bad pixel matrix;

[0092] In this embodiment of the application, for each pixel, it is determined whether the first response coefficient corresponding to the pixel is located in a preset first response coefficient interval based on the first response coefficient matrix, and whether the second response coefficient corresponding to the pixel is located in a preset second response coefficient interval based on the second response coefficient matrix, and whether the goodness of fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness of fit interval based on the goodness of fit matrix.

[0093] For each pixel, if the first response coefficient corresponding to the pixel is located in a preset first response coefficient range, and the second response coefficient corresponding to the pixel is located in a preset second response coefficient range, and the goodness of fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness of fit range, then the pixel is determined to be a non-bad pixel; otherwise, the pixel is a bad pixel.

[0094] Based on the discrimination results of each pixel, a bad pixel matrix is ​​generated.

[0095] In this embodiment, the processor's calculation precision and range are set. , upper limit , and lower limit , Set according to the fitting quality requirements lower limit .

[0096] For pixels In other words, when simultaneously satisfying , and Under three conditions, the pixel will Pixel determined to be non-dead Bad pixel parameters If any of the above three conditions is not met, then the image element... Determined as a bad pixel, cell Bad pixel parameters .according to Generate a bad pixel matrix .

[0097] By performing defect detection on each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix, and the goodness-of-fit matrix, automatic defect detection is achieved through a preset threshold range. This can accurately distinguish pixels with abnormal responses or failed fitting, generate a defect matrix, and ensure that subsequent grayscale correction is only applied to reliable non-defect pixels, avoiding incorrect compensation for abnormal pixels. At the same time, it can compensate for the response differences between different pixels of the camera, enhance pixel consistency, reduce image noise, improve the tracking performance of the laser communication system, and reduce the communication error rate.

[0098] S4. For each pixel, the type of the pixel is determined based on the bad pixel matrix, wherein the type is a bad pixel or a non-bad pixel. The gray value of the pixel is corrected based on the type and position of each pixel and a preset bad pixel correction algorithm to obtain the corrected image dataset.

[0099] In this embodiment of the application, the step of correcting the grayscale value of a pixel based on the type, location, and a preset bad pixel correction algorithm of each pixel to obtain a corrected image dataset includes:

[0100] S41, for each pixel, if the pixel type is a non-dead pixel, then the target gray value is determined to be the original gray value;

[0101] S42, for each pixel, if the pixel type is a bad pixel, the gray value of the pixel is corrected based on the position of the pixel and a preset bad pixel correction algorithm, and the target gray value is determined to be the corrected gray value.

[0102] S43, Based on the target gray value of each pixel, determine the corrected image dataset.

[0103] In this embodiment of the application, specifically, if the type of the pixel is a bad pixel, the position type of the pixel is determined based on the position of the pixel, and the position type is any one of the following: corner point, edge point and not a corner point or an interior point of the camera pixel;

[0104] Based on the location type of the pixel, determine all adjacent pixels of the pixel;

[0105] Sort the gray values ​​of all adjacent pixels of the pixel in descending order to obtain a sorted gray value sequence;

[0106] The bad pixel markers of all adjacent pixels of the pixel are sorted in order of gray value to obtain a bad pixel marker sequence.

[0107] Based on all adjacent pixels, the gray value sequence, the bad pixel flag sequence, and the preset bad pixel correction formula, the corrected gray value is obtained.

[0108] Furthermore, if the location type of the pixel is a corner point, then all adjacent pixels of the pixel are determined to be 3;

[0109] If the location type of the pixel is an edge point and not a corner point, then all adjacent pixels of the pixel are determined to be 5;

[0110] If the location type of the pixel is an interior point, then all of the pixel's neighboring pixels are determined to be 8.

[0111] In the above embodiments, it is assumed that the pixel The grayscale value of the corresponding pixel The corrected grayscale value is The correction method is as follows:

[0112] if That is, pixel If it is not a bad pixel, then ;

[0113] if That is, pixel For bad pixels, the following corrections are made:

[0114] if , pixel There are 3 adjacent pixels. Sort the gray values ​​of the 3 adjacent pixels from largest to smallest as follows: The corresponding bad pixel coefficient is The corresponding correction method is as follows:

[0115] ;

[0116] if satisfy Or satisfy Then like a pixel There are 5 adjacent pixels. Sort the gray values ​​of the 5 adjacent pixels from largest to smallest as follows: The corresponding bad pixel coefficient is The corresponding correction method is as follows:

[0117] ;

[0118] if satisfy Then like a pixel There are 8 adjacent pixels. Sort the gray values ​​of these 8 adjacent pixels from largest to smallest as follows: The corresponding bad point coefficient is The corresponding correction method is as follows:

[0119] .

[0120] The embodiments of this application are illustrated below.

[0121] exist , The results of bad pixel detection and correction were verified under the given conditions. For example... Figure 3 As shown, traditional dead pixel detection methods can only detect no more than 60 dead pixels, and the number of dead pixels fluctuates with changes in light intensity. 70% of pixels show completely opposite results for dead pixels under different environments. In contrast, the detection method mentioned in this technical solution can detect 136 dead pixels, and the detected dead pixels are more accurate and the number of dead pixels is more stable.

[0122] This paper compares the correction effects of traditional bad pixel correction methods with those of the method proposed in this technical solution. Figure 4 The original image from the camera. Figure 5 This is the result of a traditional dead pixel correction scheme. Figure 6 This is a modified result of the method proposed in this technical solution. Figure 5 In the middle, at least 10 obvious bad pixels were not detected or accurately corrected, while Figure 6 In this process, the defective pixel correction technology proposed in this technical solution can completely detect and accurately correct defective pixels.

[0123] This method uses a uniform light source to illuminate the camera at multiple light intensity points and acquires an image dataset. Based on the pixel response data under different illumination intensities, it calculates the first response coefficient, the second response coefficient, and the goodness of fit, achieving a multi-dimensional and quantitative characterization of pixel response characteristics. This improves the accuracy of defect detection and effectively distinguishes between real defects and random noise. Furthermore, combining the generated defect matrix and pixel location information, a correction algorithm adapted to the pixel neighborhood structure is used for targeted grayscale correction. This effectively repairs defects while preserving image details to the maximum extent, improving correction accuracy and image quality.

[0124] Figure 7 A schematic diagram of a camera pixel defect detection and correction system 100 is shown.

[0125] like Figure 7 As shown, a camera pixel defect detection and correction system 100 mainly includes:

[0126] The acquisition module 101 is used to determine multiple light intensity points based on the maximum light intensity of the camera pixel response, and control a uniform light source to illuminate the camera with multiple light intensity points to acquire the image dataset corresponding to the camera. The image dataset includes multiple images, each of which contains a gray value matrix of M×N pixels, and the M×N pixels represent the row and column size of the camera pixel array.

[0127] The pixel response coefficient calculation module 102 calculates the first response coefficient, the second response coefficient, and the goodness of fit for each pixel based on the image dataset, and obtains the first response coefficient matrix, the second response coefficient matrix, and the goodness of fit matrix.

[0128] The defect detection module 103 is used to perform defect detection on each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix and the goodness-of-fit matrix, and generate a defect matrix.

[0129] The bad pixel correction module 104 is used to determine the type of each pixel based on the bad pixel matrix, wherein the type is a bad pixel or a non-bad pixel, and to correct the gray value of the pixel based on the type, position and preset bad pixel correction algorithm of each pixel to obtain a corrected image dataset.

[0130] In one example, the module in any of the above devices may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.

[0131] For example, when modules in a device can be implemented via a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor capable of calling programs. Alternatively, these modules can be integrated together as a system-on-a-chip (SOC).

[0132] In this application, various objects such as messages / information / devices / network elements / systems / apparatus / actions / operations / processes / concepts may be named. It is understood that these specific names do not constitute a limitation on the relevant objects. The names may be changed depending on the scenario, context, or usage habits. The understanding of the technical meaning of the technical terms in this application should be mainly determined from their functions and technical effects embodied / performed in the technical solution.

[0133] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0134] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0135] Figure 8 This is a structural block diagram of a terminal device 300 according to an embodiment of this application.

[0136] like Figure 8 As shown, the terminal device 300 includes a processor 301 and a memory 302, and may further include one or more of an information input / output (I / O) interface 303, a communication component 304, and a communication bus 305.

[0137] The processor 301 controls the overall operation of the terminal device 300 to complete all or part of the steps in the aforementioned camera pixel defect detection and correction method. The memory 302 stores various types of data to support the operation of the terminal device 300. This data may include, for example, instructions for any application or method operating on the terminal device 300, as well as application-related data. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as one or more of Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0138] I / O interface 303 provides an interface between processor 301 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 304 is used to test wired or wireless communication between terminal device 300 and other devices. Wireless communication includes Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or one or more combinations thereof. Therefore, the corresponding communication component 304 may include a Wi-Fi component, a Bluetooth component, and an NFC component.

[0139] The communication bus 305 may include a path for transmitting information between the aforementioned components. The communication bus 305 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 305 can be divided into an address bus, a data bus, a control bus, etc.

[0140] The terminal device 300 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute a camera pixel defect detection and correction method given in the above embodiments.

[0141] The following describes the computer-readable storage medium provided in the embodiments of this application. The computer-readable storage medium described below can be referred to in correspondence with the camera pixel defect detection and correction method described above.

[0142] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for detecting and correcting camera pixel defects.

[0143] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] The terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0145] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions claimed in this application.

Claims

1. A method for detecting and correcting dead pixels in a camera, characterized in that, include: Based on the maximum light intensity of the camera pixel response, multiple light intensity points are determined, and a uniform light source is controlled to illuminate the camera at the multiple light intensity points to obtain the image dataset corresponding to the camera. The image dataset includes multiple images, and each image contains a gray value matrix of M×N pixels. The M×N pixels represent the row and column size of the camera pixel array. Based on the image dataset, calculate the first response coefficient, the second response coefficient, and the goodness of fit for each pixel to obtain the first response coefficient matrix, the second response coefficient matrix, and the goodness of fit matrix; Based on the first response coefficient matrix, the second response coefficient matrix, and the goodness-of-fit matrix, each pixel of the camera is identified as a bad pixel, and a bad pixel matrix is ​​generated. For each pixel, the type of the pixel is determined based on the bad pixel matrix, wherein the type is a bad pixel or a non-bad pixel. The gray value of the pixel is corrected based on the type and position of each pixel and a preset bad pixel correction algorithm to obtain a corrected image dataset. The step of identifying bad pixels for each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix, and the goodness-of-fit matrix, and generating a bad pixel matrix, includes: For each pixel, based on the first response coefficient matrix, it is determined whether the first response coefficient corresponding to the pixel is within a preset first response coefficient interval. Based on the second response coefficient matrix, it is determined whether the second response coefficient corresponding to the pixel is within a preset second response coefficient interval. Based on the goodness-of-fit matrix, it is determined whether the goodness-of-fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness-of-fit interval. For each pixel, if the first response coefficient corresponding to the pixel is located in a preset first response coefficient range, and the second response coefficient corresponding to the pixel is located in a preset second response coefficient range, and the goodness of fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness of fit range, then the pixel is determined to be a non-bad pixel; otherwise, the pixel is a bad pixel. Based on the discrimination results of each pixel, a bad pixel matrix is ​​generated; The grayscale value of each pixel is corrected based on its type, location, and a preset bad pixel correction algorithm to obtain a corrected image dataset, including: For each pixel, if the pixel type is a non-dead pixel, then the target gray value is determined to be the original gray value; For each pixel, if the pixel type is a bad pixel, the gray value of the pixel is corrected based on the pixel's position and a preset bad pixel correction algorithm, and the target gray value is determined to be the corrected gray value. Based on the target gray value of each pixel, determine the corrected image dataset; If the pixel is a bad pixel, then the grayscale value of the pixel is corrected based on the pixel's position and a preset bad pixel correction algorithm, including: If the pixel type is a bad pixel, the position type of the pixel is determined based on the position of the pixel. The position type is any one of the following: a corner point, an edge point, and neither a corner point nor an interior point of the camera pixel. Based on the location type of the pixel, determine all adjacent pixels of the pixel; Sort the gray values ​​of all adjacent pixels of the pixel in descending order to obtain a sorted gray value sequence; The bad pixel markers of all adjacent pixels of the pixel are sorted in order of gray value to obtain a bad pixel marker sequence. Based on all adjacent pixels, the gray value sequence, the bad pixel flag sequence, and the preset bad pixel correction formula, the corrected gray value is obtained; Pixel The grayscale value of the corresponding pixel The corrected grayscale value is The correction method is as follows: if That is, pixel If it is not a bad pixel, then , It is a pixel The bad pixel indicator; if That is, pixel For bad pixels, the following corrections are made: if , pixel There are 3 adjacent pixels. Sort the gray values ​​of the 3 adjacent pixels from largest to smallest as follows: The corresponding bad pixel coefficient is The corresponding bad pixel correction formula is: ; if satisfy Or satisfy Then like a pixel There are 5 adjacent pixels. Sort the gray values ​​of the 5 adjacent pixels from largest to smallest as follows: The corresponding bad point coefficient is The corresponding bad pixel correction formula is: ; if satisfy Then like a pixel There are 8 adjacent pixels. Sort the gray values ​​of these 8 adjacent pixels from largest to smallest as follows: The corresponding bad pixel coefficient is The corresponding bad pixel correction formula is: 。 2. The method for detecting and correcting camera pixel defects according to claim 1, characterized in that, The step of calculating the first response coefficient, the second response coefficient, and the goodness of fit for each pixel based on the image dataset includes: Based on the image dataset and the row and column size of the camera pixel array, a normalized light intensity value sequence is calculated, which represents the average gray value of all pixels in the image at each light intensity point; For each pixel, based on the linear regression model, the standardized light intensity value sequence, the row and column size of the camera pixel array, and the number of light intensity points, the first response coefficient, the second response coefficient, and the goodness of fit corresponding to the pixel are calculated.

3. The method for detecting and correcting camera pixel defects according to claim 2, characterized in that, The formula for calculating the first response coefficient is: ; The formula for calculating the second response coefficient is: ; The formula for calculating the goodness of fit is: ; in, For pixels The first response coefficient, For pixels The second response coefficient, For pixels The goodness of fit is given by m, where m represents the m-th row of the camera pixel array, n represents the n-th column of the camera pixel array, K represents the number of light intensity points, and i represents the i-th light intensity point, for a total of K+1 points. For pixels The gray value at the i-th light intensity point, Let be the standardized light intensity value at the i-th light intensity point.

4. The method for detecting and correcting camera pixel defects according to claim 1, characterized in that, The step of determining all neighboring pixels of a pixel based on its location type includes: If the location type of the pixel is a corner point, then all three adjacent pixels of the pixel are determined to be 3. If the location type of the pixel is an edge point and not a corner point, then all adjacent pixels of the pixel are determined to be 5; If the location type of the pixel is an interior point, then all of the pixel's neighboring pixels are determined to be 8.

5. A camera pixel defect detection and correction system, characterized in that, include: The acquisition module is used to determine multiple light intensity points based on the maximum light intensity of the camera pixel response, and control a uniform light source to illuminate the camera with multiple light intensity points to acquire the image dataset corresponding to the camera. The image dataset includes multiple images, each of which contains a gray value matrix of M×N pixels, and the M×N pixels represent the row and column size of the camera pixel array. The pixel response coefficient calculation module is used to calculate the first response coefficient, the second response coefficient and the goodness of fit for each pixel based on the image dataset, so as to obtain the first response coefficient matrix, the second response coefficient matrix and the goodness of fit matrix. The bad pixel detection module is used to detect bad pixels for each pixel of the camera based on the first response coefficient matrix, the second response coefficient matrix and the goodness-of-fit matrix, and generate a bad pixel matrix. The bad pixel correction module is used to determine the type of each pixel based on the bad pixel matrix, wherein the type is a bad pixel or a non-bad pixel, and to correct the gray value of the pixel based on the type, position and preset bad pixel correction algorithm of each pixel to obtain the corrected image dataset. The defect detection module is specifically used for: For each pixel, based on the first response coefficient matrix, it is determined whether the first response coefficient corresponding to the pixel is within a preset first response coefficient interval. Based on the second response coefficient matrix, it is determined whether the second response coefficient corresponding to the pixel is within a preset second response coefficient interval. Based on the goodness-of-fit matrix, it is determined whether the goodness-of-fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness-of-fit interval. For each pixel, if the first response coefficient corresponding to the pixel is located in a preset first response coefficient range, and the second response coefficient corresponding to the pixel is located in a preset second response coefficient range, and the goodness of fit corresponding to the pixel is not less than the lower limit threshold of a preset goodness of fit range, then the pixel is determined to be a non-bad pixel; otherwise, the pixel is a bad pixel. Based on the discrimination results of each pixel, a bad pixel matrix is ​​generated; The dead pixel correction module is specifically used for: For each pixel, if the pixel type is a non-dead pixel, then the target gray value is determined to be the original gray value; For each pixel, if the pixel type is a bad pixel, the gray value of the pixel is corrected based on the pixel's position and a preset bad pixel correction algorithm, and the target gray value is determined to be the corrected gray value. Based on the target gray value of each pixel, determine the corrected image dataset; If the pixel is a bad pixel, then the grayscale value of the pixel is corrected based on the pixel's position and a preset bad pixel correction algorithm, including: If the pixel type is a bad pixel, the position type of the pixel is determined based on the position of the pixel. The position type is any one of the following: a corner point, an edge point, and neither a corner point nor an interior point of the camera pixel. Based on the location type of the pixel, determine all adjacent pixels of the pixel; Sort the gray values ​​of all adjacent pixels of the pixel in descending order to obtain a sorted gray value sequence; The bad pixel markers of all adjacent pixels of the pixel are sorted in order of gray value to obtain a bad pixel marker sequence. Based on all adjacent pixels, the gray value sequence, the bad pixel flag sequence, and the preset bad pixel correction formula, the corrected gray value is obtained; Pixel The grayscale value of the corresponding pixel The corrected grayscale value is The correction method is as follows: if That is, pixel If it is not a bad pixel, then , It is a pixel The bad pixel indicator; if That is, pixel For bad pixels, the following corrections are made: if , pixel There are 3 adjacent pixels. Sort the gray values ​​of the 3 adjacent pixels from largest to smallest as follows: The corresponding bad pixel coefficient is The corresponding bad pixel correction formula is: ; if satisfy Or satisfy Then like a pixel There are 5 adjacent pixels. Sort the gray values ​​of the 5 adjacent pixels from largest to smallest as follows: The corresponding bad pixel coefficient is The corresponding bad pixel correction formula is: ; if satisfy Then like a pixel There are 8 adjacent pixels. Sort the gray values ​​of these 8 adjacent pixels from largest to smallest as follows: The corresponding bad point coefficient is The corresponding bad pixel correction formula is: 。 6. A terminal device, characterized in that, Includes a processor, which is coupled to a memory; The processor is configured to execute a computer program stored in the memory, so that the terminal device performs the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, Includes a computer program or instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1-4.