METHOD AND SYSTEM OF CORRECTING DEFECTIVE PIXELS

20180278867 ยท 2018-09-27

Assignee

Inventors

Cpc classification

International classification

Abstract

Provided is a method of correcting a defective pixel of a digital image. In the method, the defective pixels are pre-corrected. The similarities of normal pixels and each defective pixel are calculated. The weight of each normal pixel to each defective pixel is calculated based on the similarities of the normal pixels and each defective pixel. The weight of each normal pixel to each defective pixel is normalized. The normalized weighted values of the normal pixels to each defective pixel are weighted summed to obtain the corrected pixel value of each defective pixel.

Claims

1-10. (canceled)

11. A method of correcting a defective pixel of a digital image, comprising: calculating similarities between a plurality of normal pixels and the defective pixel, wherein the calculated similarities are based on comparisons between neighborhoods centered on the normal pixels and a neighborhood centered on the defective pixel; calculating weights of the plurality of normal pixels to the defective pixel based on the calculated similarities between the plurality of normal pixels and the defective pixel; and normalizing the calculated weights of the normal pixels and weighting the values of the normal pixels with the normalized weights to obtain a corrected value of the defective pixel.

12. The method of claim 11, wherein the plurality of normal pixels are at least one of a plurality of random normal pixels of the digital image, a plurality of normal pixels in the neighborhood centered on the defective pixel, and all of the normal pixels in the digital image.

13. The method of claim 11, wherein the normal pixel having the greatest similarity to the defective pixel has the largest calculated weight.

14. The method of claim 11, further comprising: calculating a sum of the weighted values of the normal pixels; and correcting the value of the defective pixel using the calculated sum.

15. The method of claim 14, wherein the corrected value of the defective pixel is equal to the calculated sum.

16. The method of claim 11, further comprising: pre-correcting the defective pixel.

17. A system of correcting a defective pixel of a digital image, comprising: a similarity calculation circuit configured to calculate similarities between a plurality of normal pixels and the defective pixel, wherein the calculated similarities are based on comparisons between neighborhoods centered on the normal pixels and a neighborhood centered on the defective pixel; a weight calculation circuit in communication with the similarity calculation circuit and configured to calculate the weights of the plurality of normal pixels to the defective pixel based on the calculated similarities between the plurality of normal pixels and the defective pixel; and a correcting circuit in communication with the weight calculation circuit and configured to normalize the calculated weights of the normal pixels and to weigh the values of the normal pixels with the normalized weights to obtain a corrected value for the defective pixel.

18. The system of claim 17, wherein the plurality of normal pixels are at least one of a plurality of random normal pixels of the digital image, a plurality of normal pixels in the neighborhood centered on the defective pixel, and all of the normal pixels in the digital image.

19. The system of claim 17, wherein the normal pixel having the greatest similarity to the defective pixel has the largest calculated weight.

20. The system of claim 17, wherein the correcting circuit is further configured to: weigh the values of the normal pixels with the normalized weights; calculate a sum of the weighted values of the normal pixels; and correct the value of the defective pixel using the calculated sum.

21. The system of claim 20, wherein the corrected value of the defective pixel is equal to the calculated sum.

22. The system of claim 17, further comprising: a pre-correcting circuit configured to pre-correct the defective pixel.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Implementations of the present technology will now be described, by way of example only, with reference to the attached figures, wherein:

[0034] FIG. 1 is a diagram illustrating a conventional method of correcting defective pixels;

[0035] FIG. 2 is a diagram illustrating the correction of pixels by the conventional method of FIG. 1;

[0036] FIG. 3 is a flowchart illustrating a method of correcting defective pixels according to an embodiment of the present disclosure;

[0037] FIG. 4 is a diagram illustrating a simplified method of correcting defective pixels according to an embodiment of the present disclosure;

[0038] FIG. 5 shows a graph illustrating testing results of the conventional method of FIG. 1 and the simplified method of FIG. 4; and

[0039] FIG. 6 is a block diagram illustrating a system of correcting defective pixels according to an embodiment of the present disclosure.

DETAILED DESCRIPTION

[0040] Referring to FIG. 3, a flowchart illustrating a method of correcting defective pixels according to an embodiment of the present disclosure. The method includes the following steps:

[0041] In step S10, each defective pixel is pre-corrected.

[0042] If there are other defective pixels neighboring a specific defective pixel, the pixel value of the specific defective pixel cannot be corrected. Therefore, each defective pixel is first pre-corrected. In step S10, a set of pixel representing positions of defective pixels ascertained at the factory or by the user is defines as C.sub.p: {P.sub.1, P.sub.2, . . . , P.sub.I}. The set of pixels C.sub.p is traversed. That is, for each defective pixel P.sub.i, 1?i?I, in C.sub.p, a pre-corrected pixel value is adopted as the pixel value of each defective pixel P.sub.i by pre-correcting set C.sub.p using the conventional averaging method. It is understood that, in other embodiments, a defective pixel can also be pre-corrected using a nearest neighbor method, i.e., using a pixel value of the surrounding normal pixels as the pixel value of the defective pixel.

[0043] In step S11, similarities, of a plurality of normal pixels to each defective pixel are calculated.

[0044] The plurality of normal pixels can be random normal pixels in the digital image, or they can be the normal pixels in a neighborhood centered on the defective pixel. Specifically, a set of normal pixels is defined as C: {P.sub.1, P.sub.2, . . . , P.sub.I} consisting of pixels that are all normal pixels. Set C can include all normal, pixels in the digital image or can consist of a pixel neighborhood surrounding the defective pixel P.sub.i.

[0045] In step S11 the whole digital image is traversed. That is, all normal pixels in the digital image are taken as the normal pixels. For each normal pixel, P.sub.j, 1?i?J, the similarity of each normal pixel P.sub.j to a defective pixel P.sub.i is calculated based on a neighborhood similarity as follows:


D(P.sub.i,P.sub.j)=?U.sub.R(P.sub.i)?U.sub.R(P.sub.j)?(1).

[0046] Where P.sub.i is a defective pixel; P.sub.j represents a normal pixel neighboring the defective pixel P.sub.i; a distance D(P.sub.i, P.sub.j) represents the similarity between the normal pixel P.sub.j and the defective pixel P.sub.i, where the greater the distance D(P.sub.i, P.sub.j) is, the lower the similarity between the normal pixel P.sub.j and the defective pixel P.sub.i is, and hence the lower the weight of the normal pixel P.sub.j to the defective pixel P.sub.i is: U.sub.R(P.sub.i) represents a neighborhood of the defective pixel P.sub.i, i.e., the defective pixel P.sub.i is the center of a matrix having a size of 2R+1, where R is a positive integer

[0047] In the embodiment of the present disclosure, in equation (1) above, the similarity between, two pixels is determined by their neighborhood similarity. Therefore, equation (1) can also be used to measure the similarity between a normal pixel P.sub.j and another normal pixel. Equation (1) can use any norm. In one embodiment, equation (1) generally uses the Euclidean distance, L.sup.2 norm.

[0048] In step S12, the weight of each normal pixel to the defective pixel is calculated based on the similarity of each normal pixel to the defective pixel.

[0049] The weight and the distance are inversely related, and many functions can be used to describe the relationship between the weight and the distance. In one embodiment of the present disclosure, the weight W.sub.i,j of a normal pixel P.sub.j to a defective pixel P.sub.i is calculated as follows:

[00006] W i , j = e - D 2 ? ( P i , P j ) ? 2 , or ( 2 ) W i , j = - ? 1 + D ? ( P i , P j ) . ( 3 )

[0050] Where ? is a constant and D(P.sub.i, P.sub.j) represents the similarity of the normal pixel Pj to the defective pixel P.sub.i. Obviously, equation (3) has less calculation amount than equation (2). In other embodiments of the present disclosure, other functions can be used to calculate the weight of the normal pixel P.sub.j to the defective pixel P.sub.i

[0051] In step S13, the weight of each normal pixel to the defective pixel is normalized, and a weighted sum of the normalized weighted values of the normal pixels is adopted as the corrected pixel value of the defective pixel.

[0052] The corrected pixel value {circumflex over (P)}.sub.i of the defective pixel P.sub.i is calculated by the following equations:

[00007] P ^ i = .Math. j .Math. W i , j * .Math. P j , where ( 4 ) W i , j * = W i , j .Math. j .Math. W i , j . ( 5 )

[0053] Where W*.sub.i,j represents the normalized weight, and W.sub.i,j represents the weight of the normal pixel P.sub.j to the defective pixel P.sub.i. In calculating the corrected pixel value of the defective pixel, different influences of the pixels in the neighborhood on correction of the defective pixel have been fully considered so that a normal pixel more similar to shooting information of the defective pixel has a greater weight. As such, the corrected pixel value of the defective pixel is better obtained such that it is closer to the original information, and the defective pixel is more accurately corrected.

[0054] When the set of pixels C includes more normal pixels, i.e., when the neighborhood centered on the defective pixel P.sub.i becomes larger, the calculation of the corrected pixel value of the defective pixel P.sub.i becomes more complicated. In one embodiment of the present disclosure, a simplified method of correcting defective pixels is provided. The simplified method is suitable to be performed by Field Programmable Gate Array circuits while still retaining the general nature of the approach. Referring to FIG. 4, for example, in channel R, a set of pixels representing positions of defective pixels ascertained at the factory or by the user is defined as C.sub.p: {P.sub.1, P.sub.2, . . . , P.sub.I}, assuming that the neighborhood has a half size of R, where R is a positive integer. A 3?3 neighborhood is used, i.e., the corrected pixel value of the defective pixel {circumflex over (R)}.sub.22 is obtained by calculation based on the weighted values of eight normal pixels that are nearest to the defective pixel. The conventional averaging method for correction can be regarded as an exception to this weighted method. Set C is now degraded as: {R.sub.11, R.sub.12, R.sub.13, R.sub.21, R.sub.23, R.sub.31, R.sub.32, R.sub.33}. First, set C.sub.p is traversed to have each defective pixel P.sub.i in set C pre-corrected using the conventional averaging method, and the pre-corrected pixel value is adopted as the pixel value of the detective pixel. Next, for each defective pixel P.sub.i, 1?i?I, in set C, a neighborhood (2R+1)?(2R+1) centered on the defective pixel is traversed. Here, for each normal pixel P.sub.j, 1?i?J, in the neighborhood, the distance D(P.sub.i, P.sub.j) between, each normal pixel P.sub.j and the defective pixel P.sub.i is calculated using equation (1), and the weight W.sub.i,j of each normal pixel P.sub.j to the defective pixel P.sub.i is calculated using equation (2) or equation (3). Finally, the weight is normalized using equation (5), and a weighted sum of the normalized weighted values of the normal pixels P.sub.j is adopted as the corrected pixel value of the defective pixel using equation (4).

[0055] In embodiments of the present disclosure, the simplified method described above uses a 3?3 pixel neighborhood for simulation under different SNR conditions. White Gaussian noise of different SNRs are added to a standard test picture (512?512), and one thousand defective pixels are randomly placed in the standard test picture without repetition of the pixel positions. The values of the normal pixels having positions corresponding to the set of the defective pixels placed are represented as S: {P.sub.1, P.sub.2, . . . P.sub.I}. The corrected pixel values that are calculated using the conventional averaging method using a 3?3 neighborhood are represented as ?.sub.1: {{circumflex over (P)}.sub.1.sup.(1),{circumflex over (P)}.sub.2.sup.(1), . . . ,{circumflex over (P)}.sub.1.sup.(1)}. The normal pixel values that are calculated using the simplified method of the present disclosure (using a 3?3 neighborhood, with ??1) are represented as ?.sub.2: {{circumflex over (P)}.sub.1.sup.(2),{circumflex over (P)}.sub.2.sup.(2), . . . ,{circumflex over (P)}.sub.1.sup.(2)}. The corrects SNRs are calculated as follows:

[00008] SNR .Math. .Math. 1 = 20 .Math. .Math. log ? ( std ? ( P ) std ? ( .Math. P - P ( 1 ) .Math. ) ) .Math. .Math. and SNR .Math. .Math. 2 = 20 .Math. .Math. log ? ( std ? ( P ) std ? ( .Math. P - P ( 2 ) .Math. ) ) .

[0056] FIG. 5 shows a graph of the corrected SNRs under different noise conditions. It is observed that the SNR of the simplified method in the present disclosure has about 0.5 dB gain under a low SNR condition, about 2 dB gain under a high SNR condition. In other words, the corrected value of the defective pixel obtained using the method of the present disclosure is closer to the original information.

[0057] In an embodiment of the present disclosure, a defective pixel is pre-corrected using a conventional averaging method. Similarities between a plurality of normal pixels and the defective pixel are calculated. Weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel are calculated. The weights are normalized, and a weighted sum of values of the normal pixels according to the normalized weights is adopted as a corrected value of the defective pixel. Thus, different influences of the pixels in the neighborhood on correction of the defective pixel can be fully considered so that a normal pixel more similar to shooting information of the defective pixel has a greater weight. As such, the corrected pixel value of toe defective pixel is better obtained such that it is closer to the original information, and the defective pixel is more accurately corrected.

[0058] Referring to FIG. 6, which is a block diagram illustrating a system of correcting defective pixels according to an embodiment of the present disclosure, a system 20 of correcting defective pixels includes a pre-correcting unit 21, a similarity calculation unit 22, a weight calculation unit 23, and a correcting unit 24. The pre-correcting unit 21 pre-corrects each defective pixel using the conventional averaging method.

The similarity calculation unit 22 is in communication with the pre-correcting unit 21 and is configured to calculate similarities between a plurality of normal pixels and the defective pixel. The weight calculation unit 23 is in communication with the similarity calculation unit 22 and is configured to calculate weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel. The correcting unit 24 is in communication with the weight calculation unit 23 and is configured to normalize the weights and adopt a weighted sum of values of the normal pixels according to the normalized weights as a corrected value of the defective pixel.

[0059] In the embodiment of the present disclosure, a set of pixels representing positions of defective pixels ascertained at the factory or by the user is defined as C.sub.p: {P.sub.1, P.sub.2, . . . , P.sub.I}. The set of pixels C.sub.p is traversed. That is, for each defective pixel P.sub.i, 1?i?I, in C.sub.p, a pre-corrected pixel value is adopted as the pixel value of each defective pixel P.sub.i by pre-correcting set C.sub.p using the conventional averaging method. This will ensure proper process of correcting the defective pixels.

[0060] In the embodiment of the present disclosure, the plurality of normal pixels can be random normal pixels in the digital image, or they can be the normal pixels in a neighborhood centered on the defective pixel. Specifically, a set of normal pixels is defined as C: {P.sub.1, P.sub.2, . . . , P.sub.I} consisting of pixels that are all normal pixels. Set C can include all normal pixels in the digital image or can consist of a pixel neighborhood surrounding the defective pixel P.sub.j.

[0061] In the embodiment of the present disclosure, the similarity calculation unit 22 traverses the whole digital image. That is, all normal pixels in the digital image are taken as the normal pixels. For each normal pixel P.sub.j, 1?i?J, the similarity of each normal pixel P.sub.j to a defective pixel P.sub.i is calculated based on a neighborhood similarity as follows:


D(P.sub.i,P.sub.j)=?U.sub.R(P.sub.i)?U.sub.R(P.sub.j)?,

[0062] Where P.sub.i is a defective pixel; P.sub.j represents a normal pixel neighboring the defective pixel P.sub.j; a distance D(P.sub.i, P.sub.j) represents the similarity between the normal pixel P.sub.j and the defective pixel P.sub.j, where the greater the distance D(P.sub.i, P.sub.j) is, the lower the similarity between the normal pixel P.sub.j and the defective pixel P.sub.i is, and hence the lower the weight of the normal pixel P.sub.j to the defective pixel P.sub.i is; U.sub.R(P.sub.i) represents a neighborhood of the defective pixel P.sub.i, i.e., the defective pixel P.sub.i is the center of a matrix having a sixe of 2R+1, where R is a positive integer.

[0063] The equation above can use any norm, and can generally use the Euclidean distance, L.sup.2 norm. The equation above can also be used to measure the similarity between a normal pixel P.sub.j and another normal pixel. In actual calculation, the center pixel can be left out from the calculation to effectively enhance the measuring performance.

[0064] In the embodiment of the present disclosure, the weight calculation unit 23 calculates, for each normal pixel P.sub.j, the weight W.sub.i,j of the normal pixel P.sub.j to a defective pixel P.sub.i as follows:

[00009] W i , j = e - D 2 ? ( P i , P j ) ? 2 , or .Math. .Math. W i , j = - ? 1 + D ? ( P i , P j ) .

[0065] Wherein ? is a constant and D(P.sub.i, P.sub.j) represents the similarity of the normal pixel Pj to the defective pixel P.sub.i. Obviously, in other embodiment of the present disclosure, other functions can be used to calculate the weight of the normal pixel P.sub.j to the defective pixel P.sub.i.

[0066] The correcting unit 24 calculates the corrected pixel value {circumflex over (P)}.sub.i of the defective pixel P.sub.i as follows:

[00010] P ^ i = .Math. j .Math. W i , j * .Math. P j .Math. .Math. and .Math. .Math. W i , j * = W i , j .Math. j .Math. W i , j .

[0067] Where W*.sub.i,j represents the normalized weight, and W.sub.i,j represents the weight of the normal pixel P.sub.j to the defective pixel P.sub.i. In calculating the corrected pixel value of the defective pixel, different influences of the pixels in the neighborhood on correction of the defective pixel have been fully considered so that a normal pixel more similar to shooting information of the defective pixel has a greater weight. As such, the corrected pixel value of the defective pixel is better obtained such that it is closer to the original information, and the defective pixel is more accurately corrected.

[0068] In the embodiment of the present disclosure, a system configure to operate on a simplified method of correcting defective pixels is provided. Take channel R as an example, a set of pixels representing positions of defective pixels ascertained at the factory or by the user is defined as C.sub.p: {P.sub.1, P.sub.2, . . . , P.sub.I}, assuming that the neighborhood has a half size of R, where R is a positive integer. A 3?3 neighborhood is used, i.e., the corrected pixel value of the defective pixel {circumflex over (R)}.sub.22 is obtained by calculation based on the weighted values of eight normal pixels that are nearest to the defective pixel. First, set C.sub.p is traversed to have each defective pixel P.sub.i in set C pre-corrected using the conventional averaging method, and the pre-corrected pixel value is adopted as the pixel value of the defective pixel. Next, for each defective pixel P.sub.i, 1?i?I, in set C, a neighborhood (2R+1)?(2R+1) centered on the defective pixel is traversed. For each normal pixel P.sub.j, 1?i?J, in the neighborhood, the distance D(P.sub.i, P.sub.j) between each normal pixel P.sub.j and the defective pixel P.sub.j and the weight W.sub.i,j of the normal pixel P.sub.j to the defective pixel P.sub.i are calculated using the corresponding equations above. Finally, the weight is normalized, and a weighted sum of the normalized weighted values of the normal pixels is adopted as the corrected pixel value of the defective pixel.

[0069] In the embodiment of the present disclosure, the pre-correcting unit 21 pre-corrects each defective pixel using the conventional averaging method. The similarity calculation unit 22 calculates similarities between a plurality of normal pixels and the defective pixel. The weight calculation unit 23 calculates weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel. The correcting unit 24 normalizes the weights and adopts a weighted sum of values of the normal pixels according to the normalized weights as a corrected value of the defective pixel. Thus, different influences of the pixels in the neighborhood on correction of the defective pixel can be fully considered so that a normal pixel more similar to shooting information of the defective pixel has a greater weight. As such, the corrected pixel value of the defective pixel is better obtained such that it is closer to the original information, and the defective pixel is more accurately corrected.

[0070] The embodiment shown and described above are only examples. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in matters of shape, size and arrangement of the parts within the principles of the present disclosure up to, and including, the full extent established by the broad general meaning of the terms used in the claims.