A Bad Pixel Correction Method and System Based on Pixel Block Matching

Through the bad point correction method based on pixel block matching, and the translation and correlation coefficient calculation method, the problem of inaccurate edge areas in the prior art is not accurate enough, and efficient correction of bad points in the image is achieved, avoiding edge blur.

CN114245103BActive Publication Date: 2025-06-27HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111432146.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2025-06-27
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

The correction results of existing bad point correction methods in the edge areas of the image are not accurate enough and may lead to blurred edges.

Method used

Using a bad point correction method based on pixel block matching, a multiple translation pixel blocks are generated by obtaining the bad point pixel blocks in the image to be corrected, and a translation operation is performed to generate multiple translation pixel blocks, calculate the correlation coefficient between each translation pixel block and the bad point pixel block, and select the translation pixel block where the maximum correlation coefficient is located instead of the bad point pixel value.

Benefits of technology

Effectively deal with bad points in the image, especially in flat areas and edge areas, to avoid blurring the corrected image in the edge areas, the calculation process is simple and the calculation amount is moderate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114245103B_ABST
    Figure CN114245103B_ABST
Patent Text Reader

Abstract

The present invention discloses a bad pixel correction method and system based on pixel block matching, including: obtaining an image to be corrected, and selecting a pixel block containing bad pixels as a bad pixel block; performing sequential translation of the bad pixel block in the image to be corrected to obtain a plurality of translated pixel blocks of the same size as the bad pixel block; respectively calculating the correlation coefficients of the valid pixel points in the bad pixel block and each translated pixel block to obtain the pixel point correlation values corresponding to each translated pixel block, where the valid pixel points are the pixel points except for the bad pixels; summing the pixel point correlation values of the same translated pixel block relative to the bad pixel block to obtain a pixel correlation coefficient; replacing the bad pixels in the bad pixel block with the bad pixels in the translated pixel block where the maximum pixel correlation coefficient is located to correct the bad pixels; this correction method can effectively process the bad pixels in the flat area and edge area of the image, and at the same time, the calculation process is simple and the calculation amount is moderate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image correction, and particularly to a bad pixel correction method and system based on pixel block matching. Background Art

[0002] Bad pixels are defective pixels that occur due to defects in the array process of an image sensor or errors during the conversion of optical signals, resulting in incorrect information for certain pixels in the image, inaccurate pixel values in the image, and thus defective pixel points. Limited by the manufacturing process of the sensor, bad pixels are inevitable during the manufacturing process of the sensor, and the sensor may also develop bad pixels as the usage time increases or the temperature rises. Bad pixels appear as bright or dark spots that are significantly different from the surrounding pixel points in the image, which can significantly affect the image quality. Therefore, during factory production, the positions of bad pixels are generally determined through testing. Given the known positions of bad pixels, it is very important to correct the bad pixels in the image and optimize the image quality.

[0003] Existing bad pixel correction methods include methods based on gradient information, methods based on inner and outer circle information, etc. Among them, the bad pixel correction method based on gradient generally uses the gradient information in four directions: horizontal, vertical, diagonal, and anti-diagonal, and corrects the pixel values of bad pixels according to the gradient information; the bad pixel correction method based on inner and outer circle information generates inner and outer circles and pixel pairs based on the inner and outer circles with the bad pixel as the center, and corrects the bad pixel to the pixel value corresponding to the smallest pixel pair according to the relationship between the central pixel point and the pixel points in the inner and outer circles. The above methods all have the disadvantages that the correction results of bad pixels in the image edge area are not accurate enough, or the correction results cause edge blurring. Summary of the Invention

[0004] Based on the technical problems existing in the background art, the present invention proposes a bad pixel correction method and system based on pixel block matching, which can effectively process bad pixels in both the flat area and the edge area of the image.

[0005] A bad pixel correction method based on pixel block matching proposed by the present invention includes:

[0006] Obtain the image to be corrected, and select the pixel block containing the bad pixel as the bad pixel block;

[0007] Translate the bad pixel block in the image to be corrected in sequence to obtain a plurality of translated pixel blocks of the same size as the bad pixel block;

[0008] Calculate the correlation coefficients of the valid pixel points in the bad pixel block and each translated pixel block respectively to obtain the pixel point correlation values corresponding to each translated pixel block, where the valid pixel points are the pixel points except the bad pixel;

[0009] Sum the pixel point correlation values of the same translated pixel block relative to the defective pixel block to obtain the pixel correlation coefficient;

[0010] Replace the defective pixel in the defective pixel block with the defective pixel in the translated pixel block where the maximum pixel correlation coefficient is located to correct the defective pixel.

[0011] Further, in the process of sequentially translating the defective pixel block in the image to be corrected to obtain multiple translated pixel blocks of the same size as the defective pixel block, specifically:

[0012] Select a pixel block centered on the defective pixel p(x, y) with a size of k×k as the defective pixel block δ(p(x, y)) k×k

[0013] Translate the defective pixel block according to the set sliding window length and translation amount to obtain the translated pixel block.

[0014] Further, the translated pixel block δ is as follows: δ(p(x - l×s, y - u×s)) k×k

[0015] Among them, p(x - l×s, y - u×s) represents the center point of the translated pixel block, l represents the number of sliding window lengths translated in the horizontal direction, u represents the number of sliding window lengths translated in the vertical direction, and s represents the sliding window length.

[0016] Further, the calculation formula for the pixel point correlation value r(i, j) is as follows:

[0017] ;

[0018] Among them, p(x, y) (i,j) represents the valid pixel point in the defective pixel block, p(x - l×s, y - u×s) (i,j) represents the valid pixel point in the translated pixel block, i and j respectively represent the positions where the valid pixel point deviates from the center of the pixel block. Generally, k takes an odd value, then there is , , and i and j are not both 0 at the same time.

[0019] Further, the optimized calculation formula for the pixel point correlation value is as follows:

[0020] Let ;

[0021] Among them, N is a positive constant, and N >> n.

[0022] Further, in the process of replacing the defective pixel in the defective pixel block with the defective pixel in the translated pixel block where the maximum pixel correlation coefficient is located to correct the defective pixel, specifically:

[0023] ;

[0024] Among them, represents the central pixel value of the pixel block corresponding to the maximum R.

[0025] A bad pixel correction system based on pixel block matching includes an acquisition module, a translation module, a correlation coefficient calculation module, a summation module, and a replacement module;

[0026] The acquisition module is used to acquire the image to be corrected and select the pixel block containing the bad pixel as the bad pixel block;

[0027] The translation module is used to sequentially translate the bad pixel block in the image to be corrected to obtain a plurality of translated pixel blocks of the same size as the bad pixel block;

[0028] The correlation coefficient calculation module is used to calculate the correlation coefficients of the valid pixel points in the bad pixel block and each translated pixel block respectively to obtain the pixel point correlation values corresponding to each translated pixel block, and the valid pixel points are the pixel points except the bad pixel;

[0029] The summation module is used to sum the pixel point correlation values of the same translated pixel block relative to the bad pixel block to obtain the pixel correlation coefficient;

[0030] The replacement module is used to replace the bad pixel in the bad pixel block with the bad pixel in the translated pixel block where the maximum pixel correlation coefficient is located to correct the bad pixel.

[0031] A computer-readable storage medium stores a number of computer programs thereon, and the number of computer programs is used to be called by a processor and execute the bad pixel correction method as described above.

[0032] The advantages of a bad pixel correction method and system based on pixel block matching provided by the present invention are as follows: The bad pixel correction method and system based on pixel block matching provided in the structure of the present invention can effectively process the bad pixels in the flat area and edge area of the image, utilize the similar translated pixel blocks in the image, so that the corrected image will not show obvious blurring in the edge area, and at the same time, the calculation process is simple and the calculation amount is moderate. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a schematic structural diagram of the present invention;

[0034] Figure 2 is k a schematic diagram of the bad pixel block and the translated pixel block when taking 3. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] Next, the technical solution of the present invention will be described in detail through specific embodiments. Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0036] As Figures 1 to 2 shown, a bad pixel correction method based on pixel block matching proposed by the present invention includes:

[0037] S1: Obtain the image to be corrected, and select the pixel block containing the bad pixel as the bad pixel block;

[0038] The position of the bad pixel in the image to be corrected is known, and the bad pixel correction is to correct the bad pixel in the image to be corrected with a known bad pixel position.

[0039] S2: Translate the bad pixel block in the image to be corrected in order to obtain multiple translated pixel blocks of the same size as the bad pixel block;

[0040] In the image to be corrected, the bad pixel block can be translated left and right, up and down. The translated pixel blocks obtained according to the translation amount may or may not overlap with the bad pixel block.

[0041] The specific translation process includes S21 to S22:

[0042] S21: Select the pixel block centered on the bad pixel p(x, y) with a size of k×k as the bad pixel block δ(p(x, y)) k×k ;

[0043] The bad pixel is set at the center position of the bad pixel block. Therefore, the center position of the translated pixel block corresponds to the bad pixel translation point of the bad pixel block, which is convenient for calculating the pixel correlation coefficient and simplifies the calculation complexity; in addition k the size of can be set according to actual needs.

[0044] S22: Translate the bad pixel block according to the set sliding window length and translation amount to obtain the translated pixel block.

[0045] The translation amount includes the horizontal translation amount and the vertical translation amount, which are set according to the actual situation.

[0046] For steps S21 to S22, the following takes an embodiment k when taking 3 for illustration:

[0047] k When taking 3, the corresponding pixel block is as Figure 2As shown in the figure, the 3×3 area on the right represents the bad pixel block centered on the bad point, where the middle non - shaded area represents the bad point. The 3×3 area on the left represents the pixel block obtained by shifting the bad pixel block 4 pixel points to the left and 0 pixel points upward. The length of the sliding window is 1, the horizontal translation amount corresponding to the left - hand offset is 4, and the vertical translation amount corresponding to the upward offset is 0. It can be seen that the sizes of the two pixel blocks are exactly the same. The bad point is represented as p(x,y), and the 3×3 pixel block centered on the bad point is used as the bad pixel block δ(p(x,y)) 3×3 , then, the center of the pixel points of the translated pixel block is p(x - l×s, y - u×s), and the translated pixel block can be expressed as δ(p(x - l×s, y - u×s)) 3×3 , where, l represents the number of sliding window lengths translated in the horizontal direction, u represents the number of sliding window lengths translated in the vertical direction, s represents the length of the sliding window.

[0048] S3: Calculate the correlation coefficients of the effective pixel points in the bad pixel block and each translated pixel block respectively, and obtain the pixel point correlation value r(i,j) corresponding to each translated pixel block. The effective pixel points are the pixel points except the bad point;

[0049]

[0050] Among them, p(x,y) (i,j) represents the effective pixel points in the bad pixel block, p(x - l×s, y - u×s) (i,j) represents the effective pixel points in the translated pixel block. i and j respectively represent the positions where the effective pixel points deviate from the center of the pixel block. Generally, k takes an odd value, then there is

[0051] , , and i and j are not both 0 at the same time.

[0052] This formula means that the correlation coefficient between the effective pixel points in the bad pixel block and the effective pixel points in the translated pixel block is the ratio of the minimum value to the maximum value.

[0053] Since there is a division operation in the calculation formula of the pixel point correlation value r(i,j), in order to improve the calculation efficiency, let

[0054]

[0055] Multiply both sides of r(i,j) by a positive constant N ( N >> n ), then there is:

[0056]

[0057] Multiplying both sides of the equation by a positive constant does not change the relative magnitudes of r(i,j), i.e., the largest r(i,j) remains the largest. At the same time, since N >> n , the integer quotient of N / n can be calculated by means of shifting. If N is appropriately valued, the method of obtaining the integer quotient by shifting can not only ensure the accuracy of N·r(i,j), but also reduce the computational complexity of the method.

[0058] S4: Sum the pixel correlation values of the same translated pixel block with respect to the bad pixel block to obtain the pixel correlation coefficient R ;

[0059] The sum of the correlation coefficients between the pixel block where the bad pixel is located and the translated pixel block R is:

[0060] S5: Replace the bad pixel in the bad pixel block with the bad pixel in the translated pixel block where the maximum pixel correlation coefficient is located to correct the bad pixel.

[0061] The translated pixel block with the maximum pixel correlation coefficient has the highest similarity to the bad pixel block where the bad pixel is located. Use the pixel value of the corresponding pixel point in this translated pixel block as the correction value for the bad pixel. Therefore:

[0062]

[0063] where represents the central pixel value of the pixel block corresponding to when R is the largest.

[0064] Through steps S1 to S5, in terms of similar pixel block matching, a method for finding similar translated pixel blocks is proposed; in terms of calculating the correlation coefficients of similar translated pixel blocks, a method for obtaining the correlation coefficients by shifting is proposed; in terms of correcting the pixel values of bad pixels, a method for correcting the pixel values of bad pixels with the pixel values at the corresponding positions of similar translated pixel blocks is proposed. It can effectively handle the bad pixels in the flat area and edge area of the image, utilize the similar translated pixel blocks in the image, so that the corrected image will not show obvious blurring in the edge area, and at the same time the calculation process is simple and the computational complexity is moderate.

[0065] The hardware platform for the simulation experiment of the above-mentioned dead pixel correction method can be an Intel(R) Core(TM) i5-9400 CPU@ 2.90GHz, and the software platform is Matlab2021a. The experimental scenario of this simulation experiment is as follows: Dead pixels are set at specific positions in the image to be corrected, and two parameters, namely the maximum difference and the average difference between the images before and after dead pixel correction, are compared. Among them, the maximum difference represents the maximum value of the absolute value of the difference between the corrected pixel value of the dead pixel and the true pixel value of the dead pixel, which is used to measure the maximum error of the dead pixel estimation method. The average difference represents the average value of the absolute value of the difference between the corrected pixel value of the dead pixel and the true pixel value of the dead pixel, which is used to measure the average error of the dead pixel estimation method. Taking the image of the LED screen of a certain mobile phone as the image to be corrected, the image value range is 0~4095, and the number of dead pixels is set to 1340. The parameters are set as follows: the sliding window length is 2, the number of translation times in the horizontal direction is 5, and the number of translation times in the vertical direction is 5, resulting in 25 pixel blocks. This patent is compared with the method based on gradient information and the method based on inner and outer circle information under the same experimental data and the same working environment, and the two parameters obtained are as follows: the maximum difference of the dead pixel correction result of the method based on gradient information is 251, and the average difference is 52.25; the maximum difference of the dead pixel correction result of the method based on inner and outer circle information is 165, and the average difference is 39.75; the maximum difference of the dead pixel correction result of this embodiment is 78, and the average difference is 8.68. It can be seen from the parameter comparison that the dead pixel correction method described in this patent is better.

[0066] As described above, the above are only the preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its inventive concept, makes equivalent substitutions or changes, and all should be covered by the protection scope of the present invention.

Claims

1. A bad pixel correction method based on pixel block matching, characterized in that, Including: Obtain the image to be corrected, and select the pixel block containing bad pixels as the bad pixel block; Sequentially translate the bad pixel block in the image to be corrected to obtain multiple translated pixel blocks of the same size as the bad pixel block. Specifically: Select the pixel block centered at the bad pixel p(x,y) with a size of k×k as the bad pixel block δ(p(x,y)) k×k Translate the bad pixel block according to the set sliding window length and translation amount to obtain the translated pixel block; Translate the pixel block δ as follows: δ(p(x - l×s, y - u×s)) k×k Among them, p(x - l×s, y - u×s) represents the center point of the translated pixel block, l represents the number of sliding window lengths translated in the horizontal direction, u represents the number of sliding window lengths translated in the vertical direction, and s represents the sliding window length; Calculate the correlation coefficients of the valid pixel points in the bad pixel block and each translated pixel block respectively to obtain the pixel point correlation values corresponding to each translated pixel block. The valid pixel points are the pixel points except the bad pixels; The calculation formula of the pixel point correlation value r(i, j) is as follows: ; where p(x, y) (i,j) represents the valid pixel points in the bad pixel block, and p(x - l×s, y - u×s) (i,j) represents the valid pixel points in the translated pixel block. i and j respectively represent the positions where the valid pixel points deviate from the center of the pixel block. When k takes an odd value, there is , , and i and j are not both 0 at the same time; Sum the pixel point correlation values of the same translated pixel block relative to the bad pixel block to obtain the pixel correlation coefficient; Replace the bad pixel in the bad pixel block with the bad pixel in the translated pixel block where the pixel correlation coefficient is the maximum to correct the bad pixel. Specifically: ; Among them, represents the central pixel value of the pixel block corresponding to the maximum R.

2. The bad pixel correction method based on pixel block matching according to claim 1, wherein The optimized calculation formula for the pixel point correlation value is as follows: Let ; Among them, N is a positive constant, and N >> n.

3. A bad pixel correction system based on pixel block matching, including an acquisition module, a translation module, a correlation coefficient calculation module, a summation module, and a replacement module; The acquisition module is used to obtain the image to be corrected and select the pixel block containing bad pixels as the bad pixel block; The translation module is used to sequentially translate the bad pixel block in the image to be corrected to obtain multiple translated pixel blocks of the same size as the bad pixel block. Specifically: Select the pixel block centered at the bad pixel p(x,y) with a size of k×k as the bad pixel block δ(p(x,y)) k×k Translate the bad pixel block according to the set sliding window length and translation amount to obtain the translated pixel block; Translate the pixel block δ as follows: δ(p(x - l×s, y - u×s)) k×k Among them, p (x - l×s, y - u×s) represents the center point of the translated pixel block, l represents the number of sliding window lengths translated in the horizontal direction, u represents the number of sliding window lengths translated in the vertical direction, and s represents the sliding window length; The correlation coefficient calculation module is used to calculate the correlation coefficients of the valid pixel points in the bad pixel block and each translated pixel block respectively to obtain the pixel point correlation values corresponding to each translated pixel block. The valid pixel points are the pixel points except the bad pixels; The calculation formula of the pixel point correlation value r(i, j) is as follows: ; where p(x, y) (i,j) represents the valid pixel points in the bad pixel block, and p(x - l×s, y - u×s) (i,j) represents the valid pixel points in the translated pixel block. i and j respectively represent the positions where the valid pixel points deviate from the center of the pixel block. When k takes an odd value, there is , , and i and j are not both 0 at the same time; The summation module is used to sum the pixel point correlation values of the same translated pixel block relative to the bad pixel block to obtain the pixel correlation coefficient; The replacement module is used to replace the bad pixel in the bad pixel block with the bad pixel in the translated pixel block where the pixel correlation coefficient is the maximum to correct the bad pixel. Specifically: ; Among them, represents the central pixel value of the pixel block corresponding to the maximum R.

4. A computer-readable storage medium, characterized in that, Several computer programs are stored on the computer-readable storage medium, and the several computer programs are used to be called by the processor and execute the bad pixel correction method according to any one of claims 1 or 2.

Citation Information

Patent Citations

  • Imaging device and defective pixel correction method

    JP2016192662A