This application claims priority under 35 U.S.C. § 119 to Korean Patent Application No. 10-2016-0090853, filed on Jul. 18, 2016 in the Korean Intellectual Property Office, the disclosure of which is incorporated by reference herein in its entirety.
1. Technical Field
Exemplary embodiments of the present inventive concept relate to image processing, and more particularly to bad pixel correction in image sensors.
2. Discussion of Related Art
A digital camera is a camera that stores pictures in electronic memory. Typically, a digital camera uses an image sensor that converts light into electrical charges. An image sensor detects and conveys information that constitutes an image. Most digital cameras use a charge-coupled device (CCD) image sensor or a complementary metal-oxide-semiconductor (CMOS) image sensor. A CCD image sensor uses a MOS capacitor and a CMOS image sensor relies on diodes or transistors to convert light into electronic signals.
The digital camera includes a lens, one or more filters, and one or more image sensor arrays (e.g., CCD or CMOS). The lens is used to focus light to pass through the filter and onto an image sensor array. Photons passing through each pixel of the filter are sensed by a corresponding pixel sensor in the image sensor array.
However, when one or more of the pixel sensors malfunction, quality of the image captured by the image sensor is greatly reduced. A malfunctioning pixel sensor can be referred to as a bad pixel. Thus, there is a need for a method and system that can correct bad pixels.
According to an exemplary embodiment of the inventive concept, a method of detecting a bad pixel in an image sensor includes: determining, a first color of a center pixel of a Bayer patch output by the image sensor; extracting, a main patch, a first auxiliary patch, and a second auxiliary patch from the Bayer patch, having the first color, a second other color, and a third other color, respectively; generating a normalized patch of the first color from the main patch and the auxiliary patches that brings a level of the auxiliary patches to a level of the main patch; and detecting whether the center pixel of the Bayer patch is a bad pixel using the normalized patch.
According to an exemplary embodiment of the inventive concept, an apparatus to detect a bad pixel in an image sensor includes a digital signal processor (DSP) configured to determine a first color of a center pixel of a Bayer patch output by the image sensor, extract a main patch, a first auxiliary patch, and a second auxiliary patch from the Bayer patch, having the first color, a second other color, and a third other color, respectively, generate a normalized patch of the first color from the main patch and the auxiliary patches that brings a level of the auxiliary patches to a level of the main patch, and detect whether the center pixel of the Bayer patch is a bad pixel using the normalized patch.
According to an exemplary embodiment of the inventive concept, a digital camera includes an image sensor, a Bayer filter, an analog to digital converter configured to convert intensity of light sensed by the image sensor that passes through the Bayer filter into a Bayer patch, a storage device storing a table indicating which pixels of the image sensor are corrupted, and a digital signal processor (DSP) configured to extract a main patch, a first auxiliary patch, and a second auxiliary patch from the Bayer patch, having a first color, a second other color, and a third other color, respectively, generate a normalized patch of the first color from the main patch and the auxiliary patches that brings a level of the auxiliary patches to a level of the main patch, and update the table based on the normalized patch.
The present inventive concept will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
Hereinafter, exemplary embodiments of the inventive concept in conjunction with accompanying drawings will be described. Below, details, such as detailed configurations and structures, are provided to aid a reader in understanding embodiments of the inventive concept. Therefore, embodiments described herein may be variously changed or modified without departing from embodiments of the inventive concept.
Modules in the drawings or the following detailed description may be connected with other modules in addition to the components described in the detailed description or illustrated in the drawings. Each connection between the modules or components may be a connection by communication or may be a physical connection.
At least one embodiment of the inventive concept brings the level of two auxiliary channels of a Bayer Pattern patch to that of the central channel to generate a normalized patch that allows local information to be extracted from two auxiliary channels for the main channel. To do so, an energy that tries to make the normalized patch as smooth as possible is minimized. The minimization may ignore the corrupted pixels and take into consideration a main direction detected in the patch.
In an exemplary embodiment, the lens 110 focuses light to pass through the Bayer filter 120 and onto the image sensor array 130. The light passing through each pixel of the Bayer filter 120 are sensed by a corresponding pixel sensor in the image sensor array 130. The ADC 140 converts the intensity of the light sensed by the image sensor array 130 into corresponding digital pixel data, which may be referred to as a Bayer Patch or Bayer Patch data.
The buffer 150, storage device 170, or memory device 180 may include, for example, a Random Access Memory (RAM), a Read Only Memory (ROM), a Dynamic RAM (DRAM), a Synchronous DRAM (SD-RAM), a flash memory, a volatile memory, a non-volatile memory, a cache memory, a buffer, a short term memory unit, a long term memory unit, or other suitable memory units.
If a given pixel of a certain color (e.g., green) in a Bayer sensor (e.g., 130) is malfunctioning, in order calculate its missing information, it is useful to extract all possible information from a close neighborhood to the given pixel, including pixels that are of another color (e.g., red and/or blue). In an exemplary embodiment of the inventive concept, the information extraction from direct neighbors belong to an auxiliary channel is made possible through an affine transformation that locally adjusts the level of neighboring pixels to the level of a central pixel of the main channel.
The method includes extracting of the individual channel color patches from a given Bayer pattern Patch 410 (e.g., Patch P) that was captured by the image sensor array 130 (S401). As shown in
The method further includes extraction of a Main direction d from the Bayer pattern patch 410 (S402). The extraction of the Main direction d may occur before the individual color patches are extracted or at the same time. For example, an algorithm may be applied to determine whether the Bayer pattern Patch 410 is considered overall to be an image of a horizontal line, an image of a vertical line, an image of a positive diagonal line (e.g., a forward slash ‘/) or an image of a negative diagonal line (e.g., back slash ‘\’). The Main direction d may be determined by using image gradient and/or edge detection algorithms.
Once the main patch and aux patches have been extracted, and the Main direction d has been determined, the method builds a connectivity table (S403). The table includes each of the main patch, the aux 1 patch, and the aux2 patch, and a plurality of pixel intensity difference terms, where each difference term is an adjacent pixel intensity difference among pixels in the Main direction d.
The pixel intensity difference terms are chosen to calculate a weighted harmonic energy over the Main direction d.
For example, if the Main direction d is horizontal h, then the following Equation 1 is used.
Eh(P)=Σi=15Σj=14αi,j+1i,j(Pij−Pi(j+1))2 [Equation 1]
The i above represents a row of the patch, the j above represents a column of the patch, Pij represents an intensity of a first pixel, Pi(j+1) represents an intensity of a second pixel that is adjacent to the first pixel in the horizontal direction, and each horizontal pixel difference corresponds to Pij−Pi(j+1).
For example, if the Aux 1 Patch 452 of
For example, if the Main direction d is vertical v, then the following Equation 2 is used:
Ev(P)=Σj=15Σi=14αi+1,ji,j(Pij−P(i+1)j)2 [Equation 2]
Pij represents an intensity of a first pixel, P(i+1)j represents an intensity of a second pixel that is adjacent to the first pixel in the vertical direction, and each vertical pixel intensity difference corresponds to Pij−P(i+1)j.
For example, if the Aux 1 Patch 452 of
For example, if the Main direction d is a forward slash s, then the following Equation 3 is used:
Es(P)=Σi=14Σj=25αi+1,j−1i,j(Pij−P(i+1)(j−1))2 [Equation 3]
Pij represents an intensity of a first pixel, P(i+1)(j−1) represents an intensity of a second pixel that is adjacent to the first pixel in a diagonal direction that slants to the right, and each corresponding diagonal pixel difference corresponds to Pij−P(i+1)(j−1).
For example, if the Aux 1 Patch 452 of
The pixel difference terms when the Main direction d is the backward slash b may be calculated in a similar manner to the description provided above for the forward slash direction using the following Equation 4:
Eb(P)=Σi=14Σj=14αi+1,j+1i,j(Pij−P(i+1)(j+1))2 [Equation 4]
In exemplary embodiment, the building of the connectivity table also considers the input of the corrupted pixels mask 420, which indicates whether one or more of the pixels of the image sensor array 130 corresponding to the analyzed Bayer pattern patch are malfunctioning or are corrupted. For example, when the Bayer pattern patch 410 is 5×5 as shown in
Once the harmonic energy equation corresponding to the Main direction d has been setup based on the determined pixel intensity differences and mask values α, a minimization is performed (S404). The minimization includes creating a quadratic minimization problem (e.g., quadratic minimization problem). The below Equation 5 shows the problem created using patch 410, which includes a green central pixel.
mina
The goal is to find the four coefficients a1, a2, b1, b2 such that for a given direction dϵ{h, v, s, b}, the above equation is minimized. The parameter 1r represents a patch filled with 1 on the positions that correspond to red (e.g., see positions 1, 3, 11, 13, 21, 23 of
v=(MTM)−1MTb [Equation 6]
In another embodiment, the interpolation performs the interpolation by attempting to fit a line (linear interpolation) through intensities of the neighbor pixels.
If it is concluded that the center pixel is bad, then the corrupted pixels mask 420 is updated to indicate that the pixel is bad and/or the pixel data associated with the center pixel is corrected (S406). The pixel correction may be performed using the result of the above described linear interpolation. For example, if the linear interpolation concluded that the center pixel with a value of 60 should have instead been 70, then the pixel data associated with the center pixel of patch 410 can be updated from 60 to 70 and stored in memory 180.
Next, the method may check a new pixel of a new Bayer Patch (S407). For example, the new pixel could be pixel 13 of
mina
For example, if the new pixel is pixel 17 of
mina
For example, when pixel 17 is used, the new Bayer Patch could include pixels 5-24 and a horizontal line of pixels adjacent to pixels 20-24.
In an embodiment, a demosaic algorithm is operated on one or more of the normalized patches to generate a corrected image. For example, the demosaic algorithm can be operated on a red normalized patch to estimate a blue patch and a green patch, and then the red normalized patch can be fused together with the estimated patches to the corrected image. The demosaic algorithm may be used to reconstruct a full color from the incomplete color samples output by the image sensor 130.
The above-described methods may be tangibly embodied on one or more computer readable medium(s) (i.e., program storage devices such as a hard disk, magnetic floppy disk, RAM, ROM, CD ROM, Flash Memory, etc., and executable by any device or machine comprising suitable architecture, such as a general purpose digital computer having a processor, memory, and input/output interfaces).
Although the present inventive concept has been described in connection with exemplary embodiments thereof, those skilled in the art will appreciate that various modifications can be made to these embodiments without substantially departing from the principles of the present inventive concept.
Number | Date | Country | Kind |
---|---|---|---|
10-2016-0090853 | Jul 2016 | KR | national |
Number | Name | Date | Kind |
---|---|---|---|
6741753 | Moroney | May 2004 | B1 |
7015961 | Kakarala | Mar 2006 | B2 |
8441562 | Szedo et al. | May 2013 | B1 |
8913163 | Seo | Dec 2014 | B2 |
20090040343 | Kao | Feb 2009 | A1 |
20100034481 | Forutanpour | Feb 2010 | A1 |
20160142659 | Shin | May 2016 | A1 |
Number | Date | Country | |
---|---|---|---|
20180020173 A1 | Jan 2018 | US |