METHOD AND APPARATUS FOR DEFECTIVE PIXEL DETECTJON BASED ON TIiE HUMAN VISUAL SYSTEM!
BACKGROUND OF TBB INVENTION
Related Applications
[0000] This application claims priority to U.S. provisional Application No.
60/760,669, filed January 19, 2006 entitled A Method for Defective Pixel Detection Based on the Human Visual System.
I. Field of the Invention
[0001] The present. Invention relates to the principals of image processing and, more specifically, to the detection and correction, of pixels within a digital image having color values that may not have actually been in the original scene when the photo was taken, Such pixels are common due to dust particles or imperfections in CDD or CMOS photo array elements. In particular, the proposed method involves using lenient thresholds based on. imperceivable differences by the human visual system to perform a quick-test of each pixel with its immediately surrounding neighbors. The present invention also relates to a bad pixel detection module and to program instructions executable by a processor for bad pixel detection,
IL Background
[0002] A defective image pixel is defined as a pixel whose response is considerably different than the value of its neighbors. Dust particles or micralens defects are two common reasons why a given pixel could report erroneous values.
[0003] A common method for bad pixel, detection is to mark a given pixel as defective if it's response is some percent-age or fixed threshold greater than the maximum, or some percentage or fixed threshold less than the minimum of it's .neighbor's values. This process requires numerous read accesses from system memory followed by numerous logical comparisons to compute the maximum and minimum of each neighboring pixels neighbors.
[0004] There is a need to perform bad pixel detection at considerably faster speeds than current known methods. The speed at which bad pixel detection is performed cars be optimized over prior methods by exploiting weaknesses in the human visual system. In short, more lenient thresholds can be used for the red color compared to thresholds green colors, and even more lenient threshold for blue color compared to red and green colors.
[0005] Furthermore, the red, green and blue thresholds can be further relaxed depending on the candidate pixel's magnitude.
SUMMARY OF THE INVENTION
[0006] Ia view of th« above, it is an object of the present invention to provide a method for bad pixel detection at a considerably faster speed than current known methods.
[0007] A further object of the present, invention is to provide a bad pixel detection scheme that performs a quick test on a pixel using a good neighbor pixel of the same color.
[ODOS] A further object of the present invention is to provide a bad pixel detection scheme that exploits weaknesses in the human visual system to optimize the speed of pixel detection.
[0009] A further object of the present invention is to provide a bad pixel detection scheme which employs more lenient thresholds for the red color pixels compared to thresholds of green color pixels^ and even more lenient thresholds for blue color pixels compared to red and green color pixels.
[0010] A further object of the present invention is to provide a bad pixel detection scheme where the red, green and blue thresholds can be further relaxed depending on the candidate pixel's magnitude.
[0011 ] The foregoing and other objects of the present invention are carried out by a bad pixel detection module comprising a quick-test bad pixei detection sub-module operable to compare a difference between a pixel value of a current pixel in an image and a pixel value of only one good neighbor pixel to a threshold selected to create zero noticeable bad pixels in the image.
[0012] The bad pixel detection module further includes a lull-test bad pixel detection sub-module operable to full-test the current pixel to evaluate whether the current pixel is a bad pixel in a kernel only if the current, pixel fails the quick-test. [0013] The present invention also provides a bad pixel detection module comprising a quick -test bad pixel detection sub-module which is operable to compare a difference between a current pixel value of a color in an image and one good neighbor pixel value of the color to a largest threshold. The largest threshold is based on a human visual system response to the color to create xero noticeable bad pixels in the image. The module also includes a full -test bad pixel detection sub-module which is operable
to evaluate whether a noticeable bad pixel is a bad pixel in a kernel, by a full-test of the kernel,
[0014] The bad pixel detection module further includes a quick-test bad pixel, detection sub-module which ts operable to compare the current pixel value to one and only one previously tested good neighbor. The quick-test repeats the quick-test for the next untested pixel.
[001 Sj The bad pixel detection module also includes a full-test bad pixel detection sub-module to resume testing of the current pixel when the current pixel is found to be a noticeable bad pixel during the quick-test.
[0016] The bad pixel detection module sets the thresholds for some pixel shades of the red color more lenient than the thresholds for the green color. [0017] The bad pixel detection module sets the thresholds for each pixel shade of a blue color more lenient than the threshold for a red color and a green color. Moreover, as the magnitude of the pixel values increase, the threshold for the pixel values become raore lenient.
[0018] In another aspect, the present invention is directed to program instructions executable by a processor, the program instructions upon execution being- operable to quick -test a current pixel by comparing a difference between a pixel value of the current pixel in an image and a pixel value of only one good neighbor pixel io a threshold selected to create zero noticeable had pixels in the image. [00.19] The program instructions upon execution being operable to lull-test the current pixel to evaluate whether the current pixel is a bad pixel in a kernel only if the current pixel fails ihe quick-test.
[0020] In yet another aspect, the present Invention is directed to a method for bad pixel detection comprising the steps of quick testing a current pixel by comparing a difference between a current pixel value of a color in an image and one good .neighbor pixel value of the color to a threshold based on a human visual system response to the color to create zero noticeable bad pixels in the image, and full testing a noticeable bad pixel to evaluate whether the noticeable bad pixel is a bad pixel in a kernel.
BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The foregoing summary, as well as the following detailed description of preferred embodiments of the invention, will be better understood when read in conjunction with the accompanying drawings. For the purpose of illustrating the invention, there is shown hi the drawings embodiments which ace presently preferred, ϊt should be understood, however, that the invention is not limited to the precise arrangement shown. In the drawings:
[0022] FΪO 1 shows a common Bayer pattern arrangement;
[0023] FIGS. 2A, 2B5 and 2C illustrate a pixel color scale of a single color from
0 to 255 shades dissected into hot, warm and cold pixel shade categories; [0024] FIG. 3 illustrates a general block diagram of a bad pixel detection module interfaced with a bad pixel correction module shown in phantom; [0025] FIG. 4 illustrates a block diagram of an image processing unit;
[0026] FIG. 5 illustrates a flowchart of a quick-test bad pixel detection method based on the human visual system; and
[0027] FIG-. 6 illustrates a flowchart of an optimized quick-test bsd pixel detection method based on the human visual system and optimized for RGB hot, warm and cold pixel shades.
DETALLED DESCRIPTION OF TBE PREFERRED EMBODIMENTS
[0028] While this invention is susceptible of embodiments in many different forms, this specification and the accompanying drawings disclose only some forms as examples of the use of the invention. The invention is not intended to be limited to the embodiments so described, and the scope of the invention will be pointed out in the appended claims.
[0029] The preferred embodiment of the method mό modules for defective pixel
-detection based on the human visual system according to the present, invention is described below wiih a specific application to images for a liquid crystal display (LCD). However, it. will be appreciated by those of ordinary skill in the art thai the present invention is also well adapted for other types of display units using a RGB pixel scheme or other pixel colors for display. Referring now to the drawings in detail, wherein like numerals are used to indicate like dements throughout, there is shown in FIGS. 3 and 4 a module for bad pixel detection, generally designated at 10, according to the present invention.
[0030] FIG. 1 shows a common Bayer pattern arrangement used by today's
CCD or CMOS manufacturers. In this illustration, even rows contain alternating red and green pixels, and odd rows comprise alternating green and blue pixels. Herein, a pixel's "neighbors" is defined as adjacent pixels which are filtered to respond to the same portion of the color spectrum. For example, if checking to see if the red pixel, denoted as R33 is defective, the neighboring raά pixels which may or may .not be examined are those red pixels denoted Rl L R3L R5'L RO, R53Λ R 15. R35, R55. When checking to see if the blue pixei denoted as B44 is defective, neighboring blue pixels include those
blue pixels denoted as B225 B42, B62, B24, B64, B26, B46, and B66. Finally, when examining a green pixel, e.g. 643, the green neighboring pixels are defined as those green pixel denoted as G41, O32, G52, G23, G63, G34, G54, and G45. [0031] In the example, there are twice as many green pixels than there are blue or red pixels. The neighboring green pixels include those green pixels G32, 052, G34 and O54 which are at a distance of one (1) from the green pixel <343. The green pixels G32, 52, G34 and G54 are corner green pixels immediately bordering the green pixel G43. The green pixels G41, G23, G63, and 645 are at a distance of two (2) pixels from the green pixel G43. In this example, there are eight (S) red pixel neighbors, eight (8) blue pixel neighbors and eight (S) green pixel neighbors.
[0032] Since computing the maximum AND minimum of one's .neighbors is a costly process, the bad pixel detection module 10 incorporates a quick-test bad pixel detection sub-module 20 which first compares the current or candidate pixel being processed to that of one of his neighbors already examined, in order to see if the two are within some threshold of which the difference would be unperceivable by the human visual system (HVS) SO. If so, the bad pixel detection, module 10 moves on to the next pixel for a quick-test bad pixel detection (hereinafter sometimes referred to as the "quick-test method"),
[0033] For example, if a given green pixel has a pixel value of 35, and has a upper-left green neighbor (already processed and known to be good) whose value is 65, then the pixel with the value 55 must either be good., or if it1 is in fact defective, it does not matter since the difference is loo small to be detected by the IWS SO. [0034] The bad pixel detection module 10 -further includes a full-test bad pixel detection sub-module 30 which perforin s a full-test bad pixel detection method (herein
after referred to as a "full-test.") In the exemplary embodiment, if the pixel under evaluation in {he quick-test bad pixel detection sub-moduie 20 is found to be bad, then the bad pixel detection module 10 performs a full-test as will be described later. Nevertheless, if a pixel after the full-test is determined to be "bad" then the bad pixel is corrected by the bad pixel correction module 50 shown in phantom in FIG. 3. [0035] When the full-test is performed the current or candidate pixel is compared against all remaining neighboring pixels of the same color. In the exemplary embodiment, the quick-text bad pixel detection sub-module, always performs the quick* text, on a current or candidate pixel using a good neighbor pixel located at the upper left of the current or candidate pixel. On the other hand, the fuϊl-test will test the current or candidate pixel with the remaining seven (?) neighboring pixels.
[0036] Referring now to FIG. 5, the quick-test bad pixel detection method 100 will now be described in more detail. The method 100 begins with getting an untested pixel which is set as the current pixel at step S 102. Step SI 02 is followed by step S 1.04 where the current pixel value is compared to the good neighbor pixel value. The good neighbor pixel, value is for a previously tested good neighbor of the same color. Step S 104 is followed by step S 106 where a determination is made whether the result (difference) of step S 104 is greater/less than the m ax/mi n human visual system threshold (HVSJTB). If the determination is "YES" (which indicates that, the current pixel is good), then step S106 is followed by step SlOS where a determination is made whether there are any more pixels not yet tested. If the determination at step SiOS is "YES," step $308 loops back or returns to step Sl 02. Otherwise, If the determination is "NO," at step S 108, the method 100 ends.
[0037] Returning to step S 106, if the determination is "NO" (which indicates that tlie current pixel is a noticeable bad pixel), then step S106 is followed by step Sl 10 where a full-test for bad pixel detection is performed where the current pixel is tested against the remaining seven (7) neighboring pixels.
[0038] The quick-test method 100 can be optimized by using a more lenient threshold for red pixels, and even more lenient thresholds for blue Bayer pixels, since the human eye Is least sensitive to changes at these frequencies. For example,, tests have shown that a red,, green, blue thresholds of 16, 12, 30, respectively, works well. The ROB thresholds 40 for the human visual system 80 are used, by the quick-test bad pixel detection sub-module 20.
[0039] The processing times are optimized in the bad pixel detection module 10 by utilising the thresholds in hot, warm and cold lookup tables 42A5 42B and 42C. The hot, warm and cold lookup tables 42A, 42B and 42C include HVS thresholds for red, blue and green pixels based on whether the pixel value is hot, warm and cold. FϊGS. 2A, 2B, and 2C illustrate a pixel color scale of a single color from 0 to 255 shades dissected into the hot, warm and cold shade categories, respectively. A pixel value (PV) of aero (0) represents the coldest pixel value. On the other hand, a pixel value of 255 represents the hottest pixel value. The pixel color scale from 0 to 255 may be for any single color such as red, green., blue, white, black, etc.
[0040] The boxes denoted as 230, 240 in FIG. 2A, 130, 140 in FIG. 2B and 30,
40 in FIG. 2C correspond to pixel values 24O1. 230, 240, 130, 40, 30 in TABLES 1, 2 and 3 below. Each box includes approximately half of the pixel values between two adjacent shades of the same color. For example, box 30 includes pixel values from 26- 35 or 25-34. On the other hand, the pixel values of box 40 includes the pixel values 36-
45 or 35-44. Nevertheless, TABLES L 2, 3 may include an entry for each and every pixel vaiue in the range of 0-255 or other scales of pixel shades. As will be seen from the TABLES L 2, and 3 below, the HVS threshold becomes more lenient as the pixel value magnitude increases.
[004 ϊ] These HVS thresholds for pixel values in the hot range are shown in
Table 1 below.
TABLE ]
[0042] The HVS thresholds for pixel values in the warm range is shown in
Table 2 below.
TABLE 2
[0043] The HVS thresholds for pixel values in the cold range is shown in Table
3 below.
TABLE 3
[0044] The red, blue and green HVS thresholds are used to define the maximum increase and decrease differences during the quick-test The result of the comparison between the current pixel value and the one good neighbor pixel value creates a difference between the two pixel values that is representative of either an increase or a decrease. The maximum pixel difference increase and the maximum pixel difference decrease for red pixels are denoted as MAX_PIX_DIFF_INC_R and MAX_PIX_DIFF_DEC_R. The maximum pixel difference increase and the maximum pixel difference decrease for a blue pixel is denoted as MAX_PIX_DIFF_INC_B and MAX_PIX_DIFF_DEC_B. The maximum pixel difference increase and the maximum pixel difference decrease for a green pixel is denoted as MAX_PIX_DIFF_INC_G and MAX_PIX_DIFF_DEC_G. For a pixel value of 120, which is a warm pixel value for red, green and blue pixels, the MAX_PIX_DIFF_INC_R is 16, the MAX_PIX_DIFF_INC_G is 12 and the MAX_PIX_DIFF_INC_B is 30. Likewise, for a pixel value of 120 for red, green and blue pixels, the MAX_PIX_DIFF_DEC_R is -16, the MAX_PIX_DIFF_DEC_G is -12 and the MAX_PIX_DIFF_DEC_ B is -30.
[0045] The threshold values in TABXJBS I, 2 and 3 above define the
MAXJPIXJDIFFJNC and MAX_PIX_DΪFF_D£C (which is the negative of the threshold value in the TABLES I, 2 and 3).
[0046] Referring now to FIG. 65 the optimized quick-test bad pixel detection method 200 will now be described in detail. The method 200 begins with getting ati untested pixel which is set as the current pixel at step S202. Step S202 is followed, by step S204 where the pixel value for the one good neighbor pixel (GNl?) is obtained. In the example, the upper-left good neighbor pixel is used as a reference point. Step S204 is followed by one of the steps S2Q6A, 206B, and 206C to determine whether the GNP pixel ϊs red, blue or green, respectively. If the GNP pixel is md, then step S206A is followed by steps 208 A where the x&d HVS threshold for the corresponding pixel value of the ONP is obtained from, the hot, warm and cold lookup tables 42A, 42B and 42C. [0047] For example, if the GNP is red and has a pixel value of 30, the red HVS threshold is 25 (see TABLE 3). Step S20SA is followed by step S210A where the .max/rain HVS threshold (HVS TH) is set to the red HVS threshold from the hot, warm and cold lookup tables 42 A, 42B and 42C.
[0048] If the GNP pixel is blue as determined at step S206B, then step S206B is followed by steps 20SB where the blue HVS threshold for the corresponding pixel value is obtained from the hot, warm, and cold lookup tables 42a, 42b and 42c. For example, if the GNP is blue) and has a pixel value of 23Q} the blue HVS threshold is 32 (see TABLE 1). Step S208B is followed by step S210B where the max/min HVS threshold (HVS TH) is set to the blue HVS threshold from the hot. warm and cold lookup tables 42A, 42B and 42C,
[0049] If the GNP is green as determined at step S206C, then step S206C is followed by steps 2OSC where the green HVS threshold for the corresponding pixel vaiue is obtained from the hot, warm and cold lookup tables 42a, 42b and 42c. For example, if the GNF is gree« and has a pixel value of 40, the green HVS threshold is 20 (see TABLE 3). Step S20SC is followed by step S2Ϊ0C where the max/min HVS threshold (HVS TH) is set to the green HVS threshold from the hot, warm and. cold lookup tables 42A, 42B and 42C.
[0050] The RGB HVS thresholds in TABLES I , 2 and 3 are selected such that zero noticeable false negatives are produced.
[0051 ] Steps S210A, 210B, and 210C are followed by step S212 where the current pixel value (red,, blue or green) is compared to one good neighbor .pixel value. Step S212 is followed by step S214 where a determination is .røade whether the result (difference) of step S232 is greater/less than the max/min human visual system threshold (BVS TH) from one of steps S210A, 21GB, mά 210C. As car* be appreciated, the comparison step S2.12 can be moved to begin immediately after step S204. [0052] When determining whether the result is greater/less than the BVS TH7 the determination evaluates whether the result is less than the MAX HX DΪ.FF ΪNC or whether the result is greater than the .MAX ...PIX DlFF DEC, If the determination is "YES" (which means the current pixel is good or not noticeable), then step S2.14 is followed by step S2 Io where a. determination is made whether there are any more pixels not yet tested. If the determination at step S216 is "YES," step $216 loops back or returns to step S202 where the next untested pixel is evaluated. Otherwise, if the determination is "NO," at step S216, the method 200 ends.
[0053] Returning to step S2I4. if the determination is "NO" (which means the current pixel is bad or noticeable) then step S214 is followed by step $21 S where a full- test forbad pixel detection is performed by the M I -test bad pixei detection sub-module 30.
[0054] Referring now to FlG. 4. the image processing unit 60 includes an
Advanced RISC Machine (ARM) 65 or other processing device which is coupled to program instructions 70 and display 75, such as without limitation, a liquid crystal display (LCD). The ARM 65 is coupled to an image source 55 providing an image of pixels subjected to image processing by the image processing unit 60. The program instructions 70 upon execution by the ARM 65 are operable to function as the bad pixel detection module 10 and the bad pixel correction module 50. Thus, the program instructions 70, upon execution, are operable to perform the quick-test and the full -test for bad pixel detection.
[0055] In operation, exploiting the HVS 80 to minimize the need to compute the mm and max of each pixel's .neighbors helped speed up bad pixel correction on the Advanced RISC Machine (ARM) 2.6 times faster.
[0056] It will be appreciated by those of ordinary skill in the art that by the module, method and program instructions disclosed herein, the detection of bad pixels is accomplished considerably faster than, in the conventional art. The speed at which bad pixel detection is performed can be optimized over prior methods by exploiting weaknesses in the human visual system. The process for defective pixel detection according to the present invention is also more economical than the conventional process, for example, which .requires computation of maximum and minimum of neighboring pixel values.
[0057] The foregoing description of the embodiments of the invention has been presented for purposes of Illustration and description, ϊt is not intended to be exhaustive or to limit the invention to the precise form disclosed, and modifications and variations are possible in light of the above teachings or may be acquired from practice of the invention. The embodiments were chosen and described in order to explain the principles of the invention and its practical application to enable one skilled in the art to utilise the invention in various embodiments and with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims appended hereto, and their equivalents.