Abstract:
There is provided an edge detecting method, which is capable of preventing a noise influence caused by imaging device and a color interpolation. The edge detecting method includes the steps of: setting a first kernel based on a center pixel in pixel data arranged in a mosaic structure; setting a second kernel based on the center pixel within the first kernel; detecting whether a pixel having a green value in the second kernel is a defective pixel, and correcting the pixel; converting all pixels of the second kernel into pixels having green value; calculating a slope value by using a mask for detecting an edge in the second kernel; and detecting an edge by adding the slope value to a luminance value obtained by a color space conversion.

Description:
FIELD OF THE INVENTION  
       [0001]     The present invention relates to a method for processing an image signal; and, more particularly, to a method for detecting an edge of an image signal.  
       DESCRIPTION OF RELATED ART  
       [0002]     An image sensor can be used in various fields, such as a cell phone, a personal computer (PC) camera, a medical science, a toy, and so on. That is, the image sensor is widely used in all fields where an image signal is used.  
         [0003]     Such an image sensor captures an image of an object and the captured image is displayed on a screen. A picture quality of the displayed image is largely determined depending on a sharpness of an edge. Accordingly, various correction methods for improving the sharpness of the edge of the image have been proposed.  
         [0004]      FIG. 1  is a schematic block diagram of a conventional image sensor.  
         [0005]     Referring to  FIG. 1 , the conventional image sensor includes a control and external system interface  11 , a pixel array  10 , an analog-to-digital converter (hereinafter, referred to as an ADC)  12 , a line memory  13 , and an image signal processor  14 .  
         [0006]     The pixel array  10  includes pixels arranged in an N×M matrix and detects an image information. The control and external system interface  11  controls an overall operation of the image sensor by using a finite state machine (FSM), and manages an interface operation for an external system. The control and external system interface  11  includes a batch register (not shown) so that several internal operations can be programmed. Also, the control and external system interface  11  controls an operation of the entire chip according to the programmed information.  
         [0007]     Although not shown in  FIG. 1 , an analog line buffer detects and stores voltages of selected pixels of one row. A data value of a column selected by a column decoder is transferred to a variable amplifier through an analog bus.  
         [0008]     If a pixel voltage stored in the analog line buffer is small, the variable amplifier, for example a programmable gain amplifier (PGA), amplifies the pixel voltage. A color correction is performed on the analog data passing through the variable amplifier. Then, the ADC  12  converts the analog data into a digital value.  
         [0009]     The line memory stores the digitalized RGB image signals based on the lines. The image signal processor  14  performs an error correction, a color interpolation, a gamma correction, a color space conversion, and so on.  
         [0010]     Meanwhile, a fixed pattern noise occurs in the image sensor due to an offset voltage, which is caused by a minute difference in the manufacturing process. In order to compensate for the fixed pattern noise, the image sensor employs a correlated double sampling (hereinafter, referred to as a CDS), which reads reset voltage signals and data voltage signals from the pixels of the pixel array  11  and outputs a difference therebetween.  
         [0011]     As described above, the image signal processor  14  performs a color interpolation, a color space conversion, a gamma correction, and an edge detection and enhancement.  
         [0012]     According to a conventional edge detecting and correcting method, a color space conversion is performed to convert an RGB Bayer pattern into an YcbCr pattern space. Among them, a brightness signal Y is used to detect an edge.  
         [0013]     The edge detection will now be described briefly.  
         [0014]     The brightness signal is stored in the line buffer and is inputted to a first-order differentiator. The first-order differentiator differentiates an image signal to obtain a strength and a direction. Then, the brightness signal is inputted to a second-order differentiator. The second-order differentiator performs the differential to extract an edge of an inputted image signal. At this point, the second-order differentiator obtains only a strength of an edge. The edge extracted by the second-order differentiator forms a closed curve. The extracted edge is transferred to a multiplier. The multiplier multiplies the inputted edge by a preset gain so as to enhance a sharpness of the extracted edge. The information on the edge multiplied by the gain is transferred to a Coring.  
         [0015]     The Coring prevents an amplification of noise existing in a low frequency band. That is, the information on the edge having a lower frequency band than a predetermined value is converted into zero. The converted edge information is then transferred to an adder.  
         [0016]     The adder adds the converted edge information transferred from the Coring to the inputted image signal and transfers the result to a clipping circuit. The clipping circuit limits the inputted image within a range of 0-255 in its brightness level. The clipped image signal is outputted as an image signal whose edge is enhanced in the sharpness.  
         [0017]     However, the conventional edge detecting and correcting method does not consider a noise caused by a detective pixel or the imaging devices (the pixel array  10 , the ADC  12  and the line memory  13 ). Therefore, an unintended edge may be detected.  
         [0018]     In addition, since the edge is detected using the brightness signal after the color interpolation, the image signal is affected by noise caused in the color interpolation. Due to this, there is a problem in that a false color caused by the color interpolation is more distinct.  
       SUMMARY OF THE INVENTION  
       [0019]     It is, therefore, an object of the present invention to provide an edge detecting method, which is capable of preventing a noise influence caused by imaging device and a color interpolation and also detecting the edge can be detected without a line memory.  
         [0020]     In an aspect of the present invention, there is provided an edge detecting method, including the steps of: setting a first kernel based on a center pixel in pixel data arranged in a mosaic structure; setting a second kernel based on the center pixel within the first kernel; detecting whether a pixel having a green value in the second kernel is a defective pixel, and correcting the pixel; converting all pixels of the second kernel into pixels having green value; calculating a slope value by using a mask for detecting an edge in the second kernel; and detecting an edge by adding the slope value to a luminance value obtained by a color space conversion.  
         [0021]     The present invention can detect an edge by using the RGB Bayer signal prior to the color interpolation, without using the brightness signal (Y). Thus, the image is not affected by the noise occurring in the color interpolation. Also, in the edge detection, the noise caused by the detective pixel or the previous-stage imaging devices can be compensated, so that the edge is detected more correctly. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0022]     The above and other objects and features of the instant invention will become apparent from the following description of preferred embodiments taken in conjunction with the accompanying drawings, in which:  
         [0023]      FIG. 1  is a schematic block diagram of a conventional image sensor;  
         [0024]      FIG. 2  is a flowchart illustrating an edge detecting method in accordance with an embodiment of the present invention;  
         [0025]      FIGS. 3A and 3B  are flowchart illustrating the step S 204  of  FIG. 2 ;  
         [0026]      FIG. 4  is an exemplary diagram of a case where G luminance values of R and B pixels are interpolated using G pixels in 5×5 kernel by a median filter; and  
         [0027]      FIG. 5  is another exemplary diagram of a case where G luminance values of R and B pixels are interpolated using an average value. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0028]     Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.  
         [0029]      FIG. 2  is a flowchart illustrating an edge detecting method in accordance with an embodiment of the present invention.  
         [0030]     Referring to  FIG. 2 , in step S 201 , a first kernel (for example, a 5×5 kernel) is set based on a center pixel in pixel data of a mosaic arrangement so as to detect an edge. This process is aimed to interpolate a G value because the respective pixels have a luminance value only in one specific color in a color filter array (hereinafter, referred to as a CFA).  
         [0031]     In step S 202 , a second kernel (for example, a 3×3 kernel) is set within the first kernel, based on the center pixel. In step S 203 , G values of all pixels in the second kernel are interpolated using the G pixel (pixel having a luminance value in a green component) of the first kernel. In this manner, the G value is interpolated and the edge is detected using the interpolated G value. That is, in step S 205 , all pixels of the second kernel have the G value.  
         [0032]     Meanwhile, in step S 203 , before all pixels of the second kernel have the G value, it is checked whether or not all pixels of the second kernel have the G value.  
         [0033]     In step S 204 , it is checked whether the pixel having the G value is a defective pixel or a noise, and then its luminance value is corrected. In step S 206 , it is checked whether there is the pixel having no G value. If so, the process returns to the step S 203 .  
         [0034]     In step S 207 , if all pixels have the G value, a slope value is calculated using several masks for the edge detection in the second kernel. At this point, a Laplacian filter is used.  
         [0035]     In step S 208 , the slope value is added to a luminance value obtained by a color space conversion.  
         [0036]     In step S 209 , a Coring and a clipping are performed to prevent a noise amplification and an overflow of an image signal. In step S 210 , a new second kernel is set and the above processes are repeated.  
         [0037]      FIGS. 3A and 3B  are flowcharts of the step S 204  in  FIG. 2 .  
         [0038]     In step S 301 , a second kernel for correcting a distorted luminance value is set. This step of setting the second kernel is the same as the step S 202  of  FIG. 2 .  
         [0039]     In step S 302 , threshold values Th 1  and Th 2  are set and all counters are initialized so as to determine whether or not a center pixel having a G value (a luminance value of the center pixel) in the second kernel is distorted.  
         [0040]     In step S 303 , the luminance value of the center pixel is compared with the threshold value Th 2 . If the luminance value of the center pixel is larger than the threshold value Th 2 , the process proceeds to step S 305 . In step S 304 , if the luminance value of the center pixel is smaller than the threshold value Th 2 , the threshold value Th 1  is again set. That is, the threshold value Th 1  is adjusted according to a luminance value of a current pixel. It is because noise cannot be correctly found when the same threshold value is applied regardless of the luminance values of the pixels.  
         [0041]     In step S 305 , if the threshold value Th 1  is determined, a difference Δ in the luminance values of the center pixel and the pixel of the second kernel (an adjacent pixel having the same color characteristic) is calculated. In step S 307 , if the Δ value is larger than the threshold value Th 1 , a value count 1  representing the number of the adjacent pixels whose luminance value is larger than the threshold value increases. In step S 308 , if the Δ value is smaller than the threshold value Th 1 , a value count 2  representing the number of the pixels whose color characteristic is equal to that of the center pixel increases. In steps S 310  and S 311 , if the value count 1  is zero, it is considered that there is no noise and Edge(i, j) is set to zero. Then, in step S 318 , a next kernel is set.  
         [0042]     Here, the value count 2  is used to count the number of the adjacent pixels arranged in vertical or horizontal positions with respect to the G pixel (pixel having the luminance value of the G value) to be currently interpolated. The pixel to be interpolated and the adjacent pixels are the pixels contained in the second kernel.  
         [0043]     If the value count 1  is not zero, the following processes will be performed.  
         [0044]     It is assumed that the current center pixel is disposed at an i-th row and a j-th column. In step S 312 , it is checked whether or not the value count 1  and the value count 2  are equal to each other and whether differences in the luminance values of the center pixel and the pixels having the same G value are equal to each other.  
         [0045]     Here, the row corresponds to a height of the image and the column corresponds to a width of the image. In steps S 313  to S 316 , if the values count 1  and count 2  are equal to each other and signs of the Δ values for all the adjacent pixels are equal to each other, a weight value is multiplied according to a single (edge) representing whether the pixel luminance value of a (i−1)-th row.  
         [0046]     In other words, Edge(i−1, j−1), Edge(i−1, j) and Edge(i−1, j+1) represent whether pixel values of (j−1)-th, j-th and (j+1)-th columns are abnormal (that is, extremely large or  5  small). If there is the abnormal value among them and a pixel value of the current i-th row and j-th column is abnormal, the corresponding pixel is considered as an edge and thus is not corrected. If there is no abnormal value in the previous row and the pixel value of the current row is abnormal, the corresponding pixel is considered as a noise and thus is corrected. Also, the reason why the weight value of the distorted signal is different is that a white defect must be corrected with a little large value and a dark defect must be corrected with a little small value.  
         [0047]     In step S 317 , if the two count values is not equal to each other and the signs of the Δ values are not equal to each other, Edge(i, j) becomes 1 and a next kernel is set.  
         [0048]      FIG. 4  is an exemplary diagram of a case where G luminance values of R and B pixels are interpolated using G pixels in 5×5 kernel by a median filter. Here, the R and B pixels represent pixels having luminance values in R and B color components, and the G pixel is a pixel having luminance value in G color component.  
         [0049]     In  FIG. 4 , a G luminance value of a pixel R 23  is interpolated in a Gb-type kernel.  
         [0050]     In order to calculate a G luminance value ExG 12  of the pixel R 23  in the Gb-type kernel, luminance values of the adjacent G pixels are required. That is, ExG 12  is used as the G luminance value of the pixel R 23 . Here, the ExG 12  is a median output of the luminance values of the four pixels G 13 , G 22 , G 24  and G 33 . The median output is obtained by selecting two small luminance values and averaging them. Likewise, the G luminance values E×G 21 , E×G 23  and E×G 32  of the pixels B 32 , B 34  and R 43  are calculated in the same manner.  
         [0051]     Also, in  FIG. 4 , G luminance values of pixels R 22 , R 24 , B 33 , R 42  and R 44  are interpolated in a B-type kernel.  
         [0052]      FIG. 5  is another exemplary diagram of a case where G luminance values of R and B pixels are interpolated using an average value.  
         [0053]     In order to interpolate the G luminance value of the pixel R 23  in the Gb-type kernel, a difference VDiff 1  in luminance values of pixels G 13  and G 33 , a difference VDiff 2  in luminance values of pixels G 13  and R 23 , a difference VDiff 3  in luminance values of pixels G 33  and R 23 , a difference HDiff 1  in luminance values of pixels G 22  and G 24 , a difference HDiff 2  in luminance values of pixels G 22  and R 23 , and a difference HDiff 3  in luminance values of pixels G 24  and R 23  are calculated. Then, a sum VDiff of the difference values in a vertical direction and a sum HDiff of the difference values in a horizontal direction are calculated and then their absolute values are calculated as follows: 
 
AbsVDiff=abs(VDiff 1 +VDiff 2 +VDiff 3 ) 
 
AbsHDiff=abs(HDiff 1 +HDiff 2 +HDiff 3 ) 
 
         [0054]     The two absolute values AbsVDiff and AbsHDiff are compared with each other. If the value AbsVDiff is larger than the value AbsHDiff, a value of (G 22 +G 24 ) is used as the G luminance value of the pixel R 23 . If the value AbsVDiff is smaller than the value AbsHDiff, a value of (G 13 +G 33 ) is used as the G luminance value of the pixel R 23 .  
         [0055]     As described above, the present invention can detect an edge by using the RGB Bayer signal prior to the color interpolation, without using the brightness signal (Y). Thus, the image is not affected by the noise occurring in the color interpolation. Also, in the edge detection, the noise caused by the detective pixel or the previous-stage imaging devices can be compensated, so that the edge is detected more correctly.  
         [0056]     In addition, the edge detection algorithm and the color interpolation can be achieved at the same time.  
         [0057]     The present application contains subject matter related to Korean patent application No. 2004-31989, filed in the Korean Patent Office on May 6, 2004, the entire contents of which being incorporated herein by reference.  
         [0058]     While the present invention has been described with respect to the particular embodiments, it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims.