Dead pixel detection method and device of camera, dead pixel compensation method and storage medium

By using the image difference method to detect bad pixels in cameras, bad pixels are identified by the image difference under different light intensities or exposure parameters, and compensation is performed using adjacent pixels. This solves the problem of difficult edge pixel detection in existing technologies and achieves efficient and accurate bad pixel detection and compensation.

CN120897053APending Publication Date: 2025-11-04LUXSHARE ITECH(ZHEJIANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511284927.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing technologies cannot effectively detect bad pixels at the edge of cameras, and they consume a lot of computation and have low detection efficiency.

Method used

The image difference method uses a camera to capture two images of the same target object under different lighting intensities or exposure parameters, calculates the pixel difference, identifies bad pixels based on the absolute value of the difference, and uses the pixel values ​​of adjacent pixels for compensation.

Benefits of technology

It improves the efficiency and accuracy of camera defect detection, reduces the missed detection of edge pixels, and saves computation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120897053A_ABST
    Figure CN120897053A_ABST
Patent Text Reader

Abstract

The invention provides a dead pixel detection method and device of a camera, a dead pixel compensation method, electronic equipment and a storage medium, and the method comprises the steps: shooting a same target object through employing the camera, and obtaining a first image and a second image which are different in brightness; subtracting the pixel values of the pixel points at the same positions in the first image and the second image to obtain a pixel difference value of the pixel points at the same positions; and determining whether the corresponding pixel point of the camera is a dead pixel based on the absolute value of the pixel difference value of each pixel point in the first image and the second image. Compared with the prior art, the method has the advantages that the image difference method is used for detecting and / or compensating the camera imaging dead pixels, and the method is applied to the fields of outgoing quality detection of camera modules, imaging dead pixel detection and compensation after the camera modules are installed to finished products and the like.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of image processing technology, and in particular to a method for detecting dead pixels in a camera, a method for compensating for dead pixels, a device for detecting dead pixels, an electronic device, and a storage medium. [Background Technology]

[0002] In modern electronic devices, camera modules have become core components, widely used in smartphones, security monitoring, autonomous driving, medical imaging, and many other fields. Camera image quality directly impacts user experience and system reliability. Dead pixels are one of the key factors affecting image quality. Therefore, efficient and accurate detection and compensation (repair) of dead pixels are crucial in the manufacturing process of camera modules (factory quality inspection), their integration into end products (finished product inspection), and even in regular maintenance during use.

[0003] Currently, there are various technical solutions in the field of defect detection and compensation, but all of them have certain limitations:

[0004] The first method is the Pinto algorithm. Specifically, it detects pixel P... N The pixel difference is obtained by comparing the values ​​of the eight adjacent 3×3 pixels (P1~P8), and the bad pixels are determined based on the pixel difference between the adjacent pixels. The disadvantage of this method is that the pixel detection conditions at the corners and edges are not met, which may lead to missed detections. In addition, it is necessary to traverse and judge each pixel, which consumes a lot of computing power and is relatively time-consuming.

[0005] The second method is row detection. Specifically, the detected pixel is subtracted from the two pixels immediately before and after it in the same row to obtain two differences. The bad pixel is determined based on the difference. This method also cannot detect some edge pixels. [Summary of the Invention]

[0006] The purpose of some embodiments of the present invention is to provide a method for detecting bad pixels in a camera, a method for compensating bad pixels, a device for detecting bad pixels in a camera, and a storage medium, which use image interpolation to detect and / or compensate for bad pixels in camera imaging, so as to solve the problem that existing methods cannot detect pixels at the edges.

[0007] According to one aspect of the present invention, some embodiments of the present invention provide a method for detecting dead pixels in a camera, comprising: taking pictures of the same target object using the camera to obtain a first image and a second image with different brightness; subtracting the pixel values ​​of pixels at the same position in the first image and the second image to obtain a pixel difference value of pixels at the same position; and determining whether a corresponding pixel of the camera is a dead pixel based on the absolute value of the pixel difference value of each pixel in the first image and the second image.

[0008] Furthermore, by fixing the relative positional relationship between the camera and the target object, the camera is used to capture images of the same target object, resulting in first and second images with different brightness.

[0009] Furthermore, the target object is a white light panel, which is illuminated with two different light intensities. The camera is used to capture images of the white light panel illuminated with the two different light intensities, resulting in a first image and a second image with different brightness.

[0010] Furthermore, the target object is a white light panel. The camera is used to capture images of the white light panel under two different exposure parameters to obtain a first image and a second image with different brightness.

[0011] Furthermore, if the absolute value of the pixel difference at a pixel point is less than a third predetermined threshold or greater than a second predetermined threshold, then the corresponding pixel point of the camera is considered a bad pixel. The second predetermined threshold and the third predetermined threshold are determined based on the median of the pixel differences of all pixels in the first image and the second image. The second predetermined threshold is greater than the median of the pixel differences of all pixels in the first image and the second image, and the third predetermined threshold is less than the median of the pixel differences of all pixels in the first image and the second image.

[0012] Furthermore, the defective pixels include black spots, bright spots, and irregular light-emitting spots. When the absolute value of the pixel difference of a pixel is less than a first predetermined threshold, the corresponding pixel of the camera is considered to be a black spot or a bright spot. When the absolute value of the pixel difference of a pixel is greater than a second predetermined threshold, or greater than the first threshold and less than a third predetermined threshold, the corresponding pixel of the camera is considered to be an irregular light-emitting spot, wherein the first predetermined threshold is less than the third predetermined threshold.

[0013] Furthermore, the second predetermined threshold is the median of the pixel differences between all pixels in the first and second images plus M times the standard deviation, and the third predetermined threshold is the median of the pixel differences between all pixels in the first and second images minus M times the standard deviation, where M is a positive number between 2 and 3. Two different light intensities or two different exposure parameters are set such that the median of the pixel differences between all pixels is greater than the predetermined difference threshold.

[0014] According to another aspect of the present invention, some embodiments of the present invention provide a method for compensating for dead pixels in a camera, comprising: obtaining dead pixels in the camera using a dead pixel detection method as described in some embodiments of the present invention; and calculating a compensation pixel value for the dead pixel using the pixel values ​​of pixels adjacent to the dead pixel.

[0015] Furthermore, the compensation pixel value for the bad pixel is calculated by using the pixel values ​​of the pixels adjacent to the bad pixel: the median of the pixel values ​​of N×N-1 pixels in the N×N region centered on the bad pixel is used as the compensation pixel value for the bad pixel, where N is an odd number greater than 2.

[0016] According to another aspect of the present invention, some embodiments of the present invention provide a dead pixel detection device for a camera, comprising a processor and a memory, wherein the memory stores image acquisition program code, pixel difference acquisition program code, and dead pixel judgment program code; the processor is configured to execute the image acquisition program code to obtain a first image and a second image with different brightness, which are images of the same target object captured by the camera; the processor is further configured to execute the pixel difference acquisition program code to subtract the pixel value of each pixel at the same position in the first image and the second image to obtain the pixel difference value of each pixel at the same position; the processor is further configured to execute the dead pixel judgment program code to determine whether a corresponding pixel of the camera is a dead pixel based on the pixel difference value of each pixel in the first image and the second image.

[0017] According to another aspect of the present invention, some embodiments of the present invention provide an electronic device including a processor and a memory, the memory storing program instructions, the processor executing the program instructions to perform a dead pixel detection method as described in some embodiments of the present invention or to perform a dead pixel compensation method as described in some embodiments of the present invention.

[0018] According to another aspect of the present invention, some embodiments of the present invention provide a storage medium storing program instructions that are executed to perform a bad pixel detection method as described in some embodiments of the present invention or a bad pixel compensation method as described in some embodiments of the present invention.

[0019] Compared with the prior art, some embodiments of the present invention use the image difference method to detect and / or compensate for bad pixels in camera imaging, which can be used in the fields of camera module factory quality inspection, image bad pixel detection and compensation after installation into finished products. [Attached Image Description]

[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0021] Figure 1 This is a schematic diagram showing the positions of 9 pixels in a 3x3 area;

[0022] Figure 2 This is a flowchart of a camera defect detection method in one embodiment of the present invention;

[0023] Figure 3 This is a flowchart of a camera dead pixel compensation method in one embodiment of the present invention.

Detailed Implementation Methods

[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] The term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that excludes other embodiments. Unless otherwise specified, the terms coupling, connection, linking, and interconnection used herein to indicate electrical connection mean direct or indirect connection. For example, A being connected to B includes both a direct electrical connection between A and B and a connection between A and B via electrical components or circuits.

[0026] Please refer to Figure 2 As shown, it is a flowchart of a camera defect detection method in one embodiment of the present invention. Figure 2 The method for detecting dead pixels in the camera shown includes the following steps.

[0027] Step 210: Use a camera (or the camera module to be tested) to take pictures of the same target object and obtain a first image and a second image with different brightness.

[0028] Specifically, by fixing the relative position of the camera and the target object, the camera captures images of the same target object, resulting in a first image and a second image with different brightness. Fixing the relative position of the camera and the target object ensures that the coordinate system of the first image is consistent with the coordinate system of the second image. In this case, pixels at the same position in the first and second images correspond to the same pixel in the camera.

[0029] In one specific embodiment of the present invention, the target object is a white light panel. The white light panel is lit up with two different light intensities. A camera is used to take pictures of the white light panel lit up with the two different light intensities to obtain a first image and a second image with different brightness.

[0030] In another specific embodiment of the invention, the target object is a white light panel. A camera is used to photograph the white light panel under two different exposure parameters to obtain a first image and a second image with different brightness. In other embodiments, the target object can also be other objects, such as various monochrome uniform plates, preferably a white panel.

[0031] Step 220: Subtract the pixel values ​​of pixels at the same location in the first and second images to obtain the pixel difference for each pixel at the same location. Here, a pixel is the smallest unit of image formation and can be converted into a numerical value for mathematical operations in image processing. The position of a pixel can be considered as its position in the coordinate system of the entire image. When subtracting two images, it is necessary to ensure that the coordinate systems used by the two images are consistent. Pixels at the same location in the first and second images correspond to the same pixel in the camera.

[0032] Step 230: Determine whether the corresponding pixel of the camera is a bad pixel based on the absolute value of the pixel difference between each pixel in the first image and the second image.

[0033] Based on the characteristics of dead pixels in a camera (or the camera module under test), they can be categorized into black spots, bright spots, and irregular luminous spots. Dead pixels are pixels that cannot participate in normal exposure. Black spots and bright spots will always appear as black spots and bright spots under different exposure conditions. Irregular luminous spots, however, exhibit different exposure condition changes compared to other normal exposure points. Subtracting the pixels at the same location in the first and second images reveals a relatively fixed pixel difference between normal pixels due to the different brightness of the light panel in the two images. Based on the characteristics of dead pixels, theoretically, the pixel difference for a dead pixel will be equal to 0 (for black spots / bright spots) or different from other normal pixels (and also different from irregular luminous spots).

[0034] In one embodiment of the present invention, if the absolute value of the pixel difference of a pixel is less than a third predetermined threshold or greater than a second predetermined threshold, the corresponding pixel of the camera is considered to be a bad pixel; otherwise, the corresponding pixel of the camera is considered to be a normal pixel. The second predetermined threshold and the third predetermined threshold are determined based on the median of the pixel differences of all pixels in the first image and the second image. The second predetermined threshold is greater than the median of the pixel differences of all pixels in the first image and the second image, and the third predetermined threshold is less than the median of the pixel differences of all pixels in the first image and the second image.

[0035] Specifically, dead pixels include black spots, bright spots, and irregular luminous spots. When the absolute value of the pixel difference at a given pixel is less than a first predetermined threshold, the corresponding pixel of the camera is considered a black spot or a bright spot. When the absolute value of the pixel difference at a given pixel is greater than a second predetermined threshold, or greater than the first threshold but less than a third predetermined threshold, the corresponding pixel of the camera is considered an irregular luminous spot, where the first predetermined threshold is less than the third predetermined threshold. When the absolute value of the pixel difference at a given pixel is equal to the first predetermined threshold, it can be confirmed according to the specific circumstances; in this embodiment, it can be confirmed as a black spot or a bright spot.

[0036] More specifically, the second predetermined threshold is the median of the pixel differences between all pixels in the first and second images plus M times the standard deviation, and the third predetermined threshold is the median of the pixel differences between all pixels in the first and second images minus M times the standard deviation, where M is a positive number between 2 and 3, such as M = 2, 3, or 2.5. It should be noted that the pixel differences between all pixels in the first and second images typically follow a normal distribution.

[0037] In another optional embodiment of the present invention, if the absolute value of the pixel difference of a pixel is less than or equal to a third predetermined threshold, or if the absolute value of the pixel difference of a pixel is greater than or equal to a second predetermined threshold, then the corresponding pixel of the camera is considered a bad pixel; otherwise, the corresponding pixel of the camera is considered a normal pixel. The second predetermined threshold and the third predetermined threshold are determined based on the median of the pixel differences of all pixels in the first image and the second image. The second predetermined threshold is greater than the median of the pixel differences of all pixels in the first image and the second image, and the third predetermined threshold is less than the median of the pixel differences of all pixels in the first image and the second image.

[0038] In some embodiments of the present invention, pixel difference is used to determine whether a pixel is a defective pixel. The median of the pixel differences of all pixels is used as the criterion. Pixels with pixel differences close to the median are considered to have normal pixel differences and are thus identified as normal pixels. If the difference deviates from the median by more than a preset range, the corresponding pixel is considered a defective pixel. Determining whether a pixel is a defective pixel by pixel difference can detect all pixels within the test range and is not affected by factors such as the location of the defective pixel or whether adjacent pixels are defective.

[0039] In some alternative embodiments of the present invention, whether a pixel is a bad pixel is determined by the pixel difference. The average of the pixel differences of all pixels is used as the judgment standard. If the pixel difference is close to the average, it is considered that the pixel difference of the pixel is within the normal range, and the corresponding pixel is identified as a normal pixel. If the pixel difference deviates from the average and exceeds a preset range, the corresponding pixel is considered to be a bad pixel.

[0040] In one specific embodiment, in order to improve accuracy, it is necessary to set two different light intensities or two different exposure parameters so that the median of the pixel difference of all pixels is greater than a predetermined difference threshold. This makes the overall brightness difference between the first image and the second image large enough to make it easier to distinguish black spots, bright spots and irregular light spots.

[0041] In some embodiments of the present invention, the camera includes a sensor, and the defect detection method checks the sensor of the camera. The sensor in the camera is used to acquire a first image and a second image with different brightness to complete the defect detection.

[0042] Please refer to Figure 3 As shown, it is a flowchart of a camera dead pixel compensation method in one embodiment of the present invention. Figure 3 The method for compensating for dead pixels in the camera shown includes the following steps.

[0043] Step 310, adopt as follows Figure 2 The defect detection method shown obtains the defective pixels of the camera.

[0044] Step 320: Calculate the compensation pixel value for the bad pixel using the pixel values ​​of the pixels adjacent to the bad pixel.

[0045] In one embodiment of the present invention, step 320 calculates the compensation pixel value for the bad pixel using the pixel values ​​of pixels adjacent to the bad pixel: the median of the pixel values ​​of N×N-1 pixels in an N×N region centered on the bad pixel is used as the compensation pixel value for the bad pixel, where N is an odd number greater than 2. For example, if N is 3, the median of the pixel values ​​of 8 pixels in a 3×3 region centered on the bad pixel is used as the compensation pixel value for the bad pixel. If the bad pixel is an edge pixel, the median of the other pixels in the N×N region centered on the bad pixel is used as the compensation pixel value for the bad pixel.

[0046] In another embodiment of the present invention, step 320 calculates the compensation pixel value of the bad pixel using the pixel values ​​of pixels adjacent to the bad pixel: The compensation pixel value of the bad pixel is calculated using the pixel values ​​of pixels directly adjacent to the bad pixel. If the bad pixel is a non-edge pixel, the median of the pixel values ​​of the eight adjacent pixels in a 3×3 region centered on the bad pixel is used as the compensation pixel value. If the bad pixel is an edge pixel, the median of the pixels directly adjacent to the bad pixel is taken as the compensation pixel value. Figure 1 If P2 is a bad pixel and has 5 directly adjacent pixels, then the median of these 5 pixels is taken as the compensation pixel value for the bad pixel.

[0047] In some embodiments of the present invention, the camera includes a sensor, and the dead pixel compensation method uses a dead pixel detection method to check for dead pixels on the camera sensor and then compensates for the dead pixels. According to another aspect of the present invention, one embodiment provides a dead pixel detection device for a camera, comprising a processor and a memory. The memory stores image acquisition program code, pixel difference acquisition program code, and dead pixel judgment program code. The processor is configured to execute the image acquisition program code to obtain a first image and a second image with different brightness, captured by the camera of the same target object. The processor is also configured to execute the pixel difference acquisition program code to subtract the pixel values ​​of pixels at the same position in the first image and the second image to obtain a pixel difference value for each pixel at the same position. The processor is further configured to execute the dead pixel judgment program code to determine whether a corresponding pixel of the camera is a dead pixel based on the pixel difference values ​​of each pixel in the first image and the second image.

[0048] According to another aspect of the present invention, one embodiment of the present invention provides an electronic device including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to perform a dead pixel detection method or a dead pixel compensation method as described above.

[0049] According to another aspect of the present invention, one embodiment of the present invention provides a storage medium storing program instructions that are executed to perform a bad pixel detection method or a bad pixel compensation method as described above in some embodiments of the present invention.

[0050] In summary, some embodiments of the present invention use image interpolation to detect and / or compensate for defective pixels in camera imaging, applicable to camera module factory quality inspection, defective pixel detection after installation in finished products, and compensation in the field of defective pixel detection. The defective pixel detection method, defective pixel compensation method, defective pixel detection device, and storage medium provided by some embodiments of the present invention have the following beneficial effects:

[0051] 1. Compared to the Pinto algorithm, it can save a lot of computation time because in some embodiments of the present invention, each pixel only needs to be subtracted once, while the Pinto algorithm needs to be calculated and compared 8 times. Moreover, it is not limited by the detection conditions. Every pixel in the entire image is subject to the same detection conditions, which reduces the possibility of missed detections.

[0052] 2. Compared with the row detection method, some embodiments of the present invention solve the drawback of being unable to detect consecutive pixels.

[0053] 3. Compared with the prior art, some embodiments of the present invention solve the drawback of being unable to detect some edge pixels.

[0054] It should be noted that any modifications made by those skilled in the art to the specific embodiments of the present invention do not depart from the scope of the claims. Accordingly, the scope of the claims is not limited to the foregoing specific embodiments.

Claims

1. A method for detecting dead pixels in a camera, characterized in that, It includes: The same target object is photographed using the camera to obtain a first image and a second image with different brightness. Subtract the pixel values ​​of each pixel at the same position in the first image and the second image to obtain the pixel difference value of each pixel at the same position; The determination of whether a corresponding pixel of the camera is a dead pixel is based on the pixel difference between each pixel in the first image and the second image.

2. The defect detection method according to claim 1, characterized in that, By fixing the relative positional relationship between the camera and the target object, and using the camera to capture images of the same target object, first images and second images with different brightness are obtained.

3. The defect detection method according to claim 2, characterized in that, The target object is a white light panel. The white light panel is illuminated with two different light intensities, and the camera is used to capture images of the white light panel illuminated with the two different light intensities, resulting in a first image and a second image with different brightness.

4. The defect detection method according to claim 2, characterized in that, The target object is a white light panel. The camera is used to capture images of the white light panel under two different exposure parameters to obtain a first image and a second image with different brightness.

5. The defect detection method according to claim 1, characterized in that, If the absolute value of the pixel difference at a pixel point is less than a third predetermined threshold or greater than a second predetermined threshold, then the corresponding pixel point of the camera is considered a bad pixel. A second predetermined threshold and a third predetermined threshold are determined based on the median of the pixel differences of all pixels in the first image and the second image. The second predetermined threshold is greater than the median of the pixel differences of all pixels in the first image and the second image, and the third predetermined threshold is less than the median of the pixel differences of all pixels in the first image and the second image.

6. The defect detection method according to claim 5, characterized in that, The defects include black spots, bright spots, and irregularly emitting spots. If the absolute value of the pixel difference at a pixel point is less than a first predetermined threshold, then the corresponding pixel point of the camera is considered to be a black point or a bright point. If the absolute value of the pixel difference of a pixel is greater than a second predetermined threshold, or greater than a first threshold but less than a third predetermined threshold, then the corresponding pixel of the camera is considered to be an irregular light-emitting point, wherein the first predetermined threshold is less than the third predetermined threshold.

7. The defect detection method according to claim 6, characterized in that, The second predetermined threshold is the median of the pixel differences between all pixels in the first image and the second image plus M times the standard deviation. The third predetermined threshold is the median of the pixel differences between all pixels in the first image and the second image minus M times the standard deviation, where M is a positive number between 2 and 3.

8. The defect detection method according to claim 5, characterized in that, Set two different light intensities or two different exposure parameters so that the median of the pixel difference among all pixels is greater than a predetermined difference threshold.

9. A method for compensating for dead pixels in a camera, characterized in that, It includes: The bad pixels of the camera are obtained using the bad pixel detection method as described in any one of claims 1-8; The compensation pixel value for the defective pixel is calculated using the pixel values ​​of the pixels adjacent to the defective pixel.

10. The defective pixel compensation method according to claim 9, characterized in that, The compensation pixel value for the defective pixel is calculated using the pixel values ​​of pixels adjacent to the defective pixel: The median pixel value of the N×N-1 pixels in the N×N region centered on the defective pixel is used as the compensation pixel value for the defective pixel, where N is an odd number greater than 2.

11. A defect detection device for a camera, characterized in that, It includes a processor and a memory, wherein the memory stores image acquisition program code, pixel difference acquisition program code, and bad pixel detection program code. The processor is configured to execute image acquisition program code to obtain a first image and a second image with different brightness, taken by the camera of the same target object; The processor is also configured to execute pixel difference acquisition program code to subtract the pixel values ​​of pixels at the same position in the first image and the second image to obtain the pixel difference of pixels at the same position. The processor is also configured to execute bad pixel detection code to determine whether a corresponding pixel of the camera is a bad pixel based on the pixel difference between each pixel in the first image and the second image.

12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing program instructions, the processor executing the program instructions to perform the bad pixel detection method as described in any one of claims 1-8 or to perform the bad pixel compensation method as described in claim 9 or 10.

13. A storage medium, characterized in that, It stores program instructions that are executed to perform the bad pixel detection method as described in any one of claims 1-8 or to perform the bad pixel compensation method as described in claim 9 or 10.