TWI520603B - Method for processing bad pixel and image processing apparatus thereof - Google Patents
Method for processing bad pixel and image processing apparatus thereof Download PDFInfo
- Publication number
- TWI520603B TWI520603B TW102125451A TW102125451A TWI520603B TW I520603 B TWI520603 B TW I520603B TW 102125451 A TW102125451 A TW 102125451A TW 102125451 A TW102125451 A TW 102125451A TW I520603 B TWI520603 B TW I520603B
- Authority
- TW
- Taiwan
- Prior art keywords
- pixel
- pixels
- exposure time
- value
- overexposed
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims description 19
- 238000005070 sampling Methods 0.000 claims description 31
- 238000001514 detection method Methods 0.000 claims description 25
- 230000008439 repair process Effects 0.000 claims description 24
- 238000003672 processing method Methods 0.000 claims description 19
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 230000011514 reflex Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Landscapes
- Studio Devices (AREA)
- Image Processing (AREA)
Description
本發明是有關於一種影像處理技術,且特別是有關於一種針對有不同曝光時間的影像的壞像素處理方法與其影像處理裝置。 The present invention relates to an image processing technique, and more particularly to a bad pixel processing method and an image processing apparatus thereof for images having different exposure times.
所謂「動態範圍」,是指畫面中的最大亮度值與最小亮度值的範圍或比值。對於攝影而言,動態範圍又可分為「影像感測器的動態範圍」和「場景的動態範圍」。其中,影像感測器的動態範圍是指感光元件所能接受亮度變化的範圍。場景的動態範圍是指拍攝場景中的亮度差異範圍,也就是畫面中最亮區域和最暗區域的差異。 The "dynamic range" refers to the range or ratio of the maximum brightness value and the minimum brightness value in the picture. For photography, the dynamic range can be further divided into "dynamic range of image sensor" and "dynamic range of scene". Among them, the dynamic range of the image sensor refers to the range in which the photosensitive element can accept the change in brightness. The dynamic range of the scene refers to the range of brightness differences in the shooting scene, that is, the difference between the brightest and darkest areas in the scene.
當場景的動態範圍大於影像感測器的動態範圍時,代表拍攝場景中有極端的亮部與暗部,超出了感光元件所能記錄的色階,因此照片中會出現全黑或全白的區塊。為了克服此缺陷,高動態範圍(High Dynamic Range,HDR)影像感測器透過影像處理技術,使得處理後影像的動態範圍大於一般相機擷取的單一影像所提供的動態範圍。 When the dynamic range of the scene is larger than the dynamic range of the image sensor, it means that there are extreme bright and dark parts in the shooting scene, which exceeds the color gradation that the photosensitive element can record, so the black or white area will appear in the photo. Piece. In order to overcome this drawback, the High Dynamic Range (HDR) image sensor transmits image processing technology, so that the dynamic range of the processed image is larger than the dynamic range provided by a single image captured by a general camera.
高動態範圍影像感測器的其中一種操作模式為產生同畫面中兩條長曝光及兩條短曝光連續交替的影像。利用長曝光及短曝光連續交替拍攝所得的單一影像中會產生部分的像素與其他的像素有不同的曝光時間,但現有的壞點修正技術是基於單一影像僅有單一曝光時間的假設。也就是說,使用長曝光及短曝光連續交替拍攝所得的單一影像並無法直接應用現有的壞點修正技術。據此,上述的壞點修正問題將影響高動態範圍影像的品質。 One of the operating modes of the high dynamic range image sensor is to generate images of two long exposures and two short exposures in the same picture. A single image obtained by continuous alternate shooting with long exposure and short exposure will produce a partial exposure time different from that of other pixels, but the existing dead pixel correction technique is based on the assumption that a single image has only a single exposure time. That is to say, the use of long exposure and short exposure continuous alternate shooting of a single image does not directly apply the existing dead pixel correction technique. Accordingly, the above-mentioned bad point correction problem will affect the quality of high dynamic range images.
本發明提供一種壞像素處理方法與其影像處理裝置,可以在一張影像有不同曝光時間的情況下偵測壞像素並修正壞像素。 The present invention provides a bad pixel processing method and an image processing apparatus thereof, which can detect bad pixels and correct bad pixels when one image has different exposure times.
本發明一實施例提出一種壞像素處理方法,用於影像處理裝置。此方法包括:取得多個像素,其中所述像素中的多個第一像素具有第一曝光時間,所述像素中的多個第二像素具有第二曝光時間,第一曝光時間不同於第二曝光時間,且所述像素中的目前像素屬於第一曝光時間;調整各第二像素的顏色值以對應至第一曝光時間;判斷所述像素是否過曝光以產生判斷結果;根據所述第一像素、調整後的所述第二像素與判斷結果來判斷目前像素是否為壞像素;以及若目前像素為壞像素,修正目前像素。 An embodiment of the present invention provides a bad pixel processing method for an image processing apparatus. The method includes: obtaining a plurality of pixels, wherein a plurality of first pixels of the pixels have a first exposure time, and a plurality of second pixels of the pixels have a second exposure time, the first exposure time being different from the second Exposure time, and the current pixel in the pixel belongs to a first exposure time; adjusting a color value of each second pixel to correspond to a first exposure time; determining whether the pixel is overexposed to generate a determination result; according to the first The pixel, the adjusted second pixel and the determination result determine whether the current pixel is a bad pixel; and if the current pixel is a bad pixel, correct the current pixel.
在一實施例中,上述的第一曝光時間為短曝光與長曝光的其中之一,第二曝光時間為短曝光與長曝光的其中之另一,並且,上述調整各第二像素的顏色值以對應至第一曝光時間的步驟 包括:若第二曝光時間為短曝光,將各第二像素的顏色值乘上一個增益,其中增益是根據第一曝光時間與第二曝光時間所計算出;以及若第二曝光時間為長曝光,將各第二像素的顏色值除以增益。 In one embodiment, the first exposure time is one of a short exposure and a long exposure, and the second exposure time is one of a short exposure and a long exposure, and the color value of each second pixel is adjusted as described above. Steps corresponding to the first exposure time The method includes: if the second exposure time is a short exposure, multiplying a color value of each second pixel by a gain, wherein the gain is calculated according to the first exposure time and the second exposure time; and if the second exposure time is a long exposure The color value of each second pixel is divided by the gain.
在一實施例中,上述判斷所述像素是否過曝光以產生判斷結果的步驟包括:取得所述像素中的測試像素;若測試像素具有長曝光,判斷測試像素的顏色值是否大於第一臨界值,並且若測試像素的顏色值大於第一臨界值,判斷測試像素為過曝光;若測試像素具有短曝光,判斷測試像素的顏色值乘上增益之後的乘積是否大於第二臨界值,並且若乘積大於第二臨界值,判斷測試像素為過曝光;以及在判斷結果中標記測試像素是否為過曝光。 In an embodiment, the step of determining whether the pixel is overexposed to generate a determination result comprises: obtaining a test pixel in the pixel; and if the test pixel has a long exposure, determining whether a color value of the test pixel is greater than a first threshold And if the color value of the test pixel is greater than the first threshold, determining that the test pixel is overexposed; if the test pixel has a short exposure, determining whether the product of the color value of the test pixel multiplied by the gain is greater than a second threshold, and if the product Greater than the second threshold, determining that the test pixel is overexposed; and marking whether the test pixel is overexposed in the determination result.
在一實施例中,上述像素中的多個第三像素與目前像素具有相同的通道,並且上述判斷目前像素是否為壞像素的步驟包括:根據判斷結果判斷每一第三像素是否為過曝光;對於每一第三像素,若對應的第三像素為過曝光,則更新一個計數值;對於每一第三像素,若對應的第三像素不為過曝光,則根據對應的第三像素的顏色值與目前像素的顏色值之間的差距來更新計數值;判斷計數值是否大於第三臨界值;以及若計數值不大於第三臨界值,判斷目前像素不為壞像素。 In an embodiment, the plurality of third pixels in the pixel have the same channel as the current pixel, and the step of determining whether the current pixel is a bad pixel includes: determining, according to the determination result, whether each third pixel is overexposed; For each third pixel, if the corresponding third pixel is overexposed, a count value is updated; for each third pixel, if the corresponding third pixel is not overexposed, according to the color of the corresponding third pixel The difference between the value and the color value of the current pixel is used to update the count value; whether the count value is greater than the third critical value; and if the count value is not greater than the third critical value, it is determined that the current pixel is not a bad pixel.
在一實施例中,上述根據對應的第三像素的顏色值與目前像素的顏色值之間的差距來更新計數值的步驟包括:根據目前像素的顏色值來決定第四臨界值與第五臨界值;若差距大於第四 臨界值,更新計數值;若差距小於第五臨界值,更新計數值;以及若差距介於第四臨界值與第五臨界值之間,則維持計數值不變。 In an embodiment, the step of updating the count value according to the difference between the color value of the corresponding third pixel and the color value of the current pixel includes: determining the fourth critical value and the fifth critical value according to the color value of the current pixel. Value; if the gap is greater than the fourth The threshold value is updated, and if the difference is less than the fifth threshold value, the count value is updated; and if the difference is between the fourth threshold value and the fifth threshold value, the count value is maintained unchanged.
在一實施例中,上述判斷目前像素是否為壞像素的步驟更包括:若計數值大於第三臨界值,判斷所述第三像素的其中之一是否為過曝光;以及若所述第三像素的其中之任一為過曝光,判斷目前像素為壞像素。 In an embodiment, the step of determining whether the current pixel is a bad pixel further comprises: if the count value is greater than the third threshold, determining whether one of the third pixels is overexposed; and if the third pixel Any one of them is overexposed, and it is judged that the current pixel is a bad pixel.
在一實施例中,上述修正目前像素的步驟包括:根據具有第一曝光時間的所述第三像素來修正目前像素。 In an embodiment, the step of modifying the current pixel comprises: correcting the current pixel according to the third pixel having the first exposure time.
在一實施例中,上述根據具有第一曝光時間的所述第三像素來修正目前像素的步驟是根據加權平均演算法所執行。 In an embodiment, the step of modifying the current pixel based on the third pixel having the first exposure time is performed according to a weighted average algorithm.
本發明的另一實施例提出一種影像處理裝置,包括升取樣電路、偵測電路以及修復電路。升取樣電路用以取得多個像素,其中所述像素中的多個第一像素具有第一曝光時間,所述像素中的多個第二像素具有第二曝光時間,第一曝光時間不同於第二曝光時間,並且所述像素中的目前像素屬於第一曝光時間,其中升取樣電路用以調整各第二像素的顏色值以對應至第一曝光時間,並且判斷像素是否過曝光以產生判斷結果。偵測電路耦接至升取樣電路,用以根據第一像素、調整後的第二像素與判斷結果來判斷目前像素是否為壞像素。修復電路耦接至偵測電路,若目前像素為壞像素,偵測電路用以修正目前像素。 Another embodiment of the present invention provides an image processing apparatus including an upsampling circuit, a detecting circuit, and a repairing circuit. The up sampling circuit is configured to obtain a plurality of pixels, wherein the plurality of first pixels of the pixels have a first exposure time, and the plurality of second pixels of the pixels have a second exposure time, the first exposure time being different from the first Two exposure times, and the current pixel in the pixel belongs to a first exposure time, wherein the up sampling circuit is configured to adjust a color value of each second pixel to correspond to the first exposure time, and determine whether the pixel is overexposed to generate a determination result . The detecting circuit is coupled to the up sampling circuit for determining whether the current pixel is a bad pixel according to the first pixel, the adjusted second pixel, and the determination result. The repair circuit is coupled to the detection circuit. If the current pixel is a bad pixel, the detection circuit is used to correct the current pixel.
在一實施例中,上述的第一曝光時間為短曝光與長曝光的其中之一,第二曝光時間為短曝光與長曝光的其中之另一,上 述升取樣電路調整各第二像素的顏色值以對應至第一曝光時間的操作包括:若第二曝光時間為短曝光,升取樣電路將各第二像素的顏色值乘上一個增益,其中增益是根據第一曝光時間與第二曝光時間所計算出;以及若第二曝光時間為長曝光,升取樣電路將各第二像素的顏色值除以增益。 In one embodiment, the first exposure time is one of a short exposure and a long exposure, and the second exposure time is one of a short exposure and a long exposure. The step of adjusting the color value of each second pixel to correspond to the first exposure time includes: if the second exposure time is a short exposure, the up sampling circuit multiplies the color value of each second pixel by a gain, wherein the gain It is calculated according to the first exposure time and the second exposure time; and if the second exposure time is a long exposure, the up sampling circuit divides the color value of each second pixel by the gain.
在一實施例中,上述的升取樣電路判斷所述像素是否過曝光以產生判斷結果的操作包括:升取樣電路取得所述像素中的測試像素;若測試像素具有長曝光,升取樣電路判斷測試像素的顏色值是否大於第一臨界值,並且若測試像素的顏色值大於第一臨界值,升取樣電路判斷測試像素為過曝光;若測試像素具有短曝光,升取樣電路判斷測試像素的顏色值乘上增益之後的一個乘積是否大於第二臨界值,並且若乘積大於第二臨界值,升取樣電路判斷測試像素為過曝光;以及升取樣電路在判斷結果中標記測試像素是否為過曝光。 In an embodiment, the above-mentioned up sampling circuit determines whether the pixel is overexposed to generate a determination result, including: the up sampling circuit obtains the test pixel in the pixel; if the test pixel has a long exposure, the up sampling circuit determines the test Whether the color value of the pixel is greater than the first critical value, and if the color value of the test pixel is greater than the first critical value, the up sampling circuit determines that the test pixel is overexposed; if the test pixel has a short exposure, the up sampling circuit determines the color value of the test pixel Whether the product after multiplying the gain is greater than the second threshold, and if the product is greater than the second threshold, the up sampling circuit determines that the test pixel is overexposed; and the up sampling circuit marks whether the test pixel is overexposed in the determination result.
在一實施例中,上述像素中的多個第三像素與目前像素具有相同的通道,偵測電路判斷目前像素是否為壞像素的操作包括:偵測電路根據判斷結果判斷每一第三像素是否為過曝光;對於每一第三像素,若對應的第三像素為過曝光,則偵測電路更新一個計數值;對於每一第三像素,若對應的第三像素不為過曝光,則偵測電路根據對應的第三像素的顏色值與目前像素的顏色值之間的差距來更新計數值;偵測電路判斷計數值是否大於第三臨界值;以及若計數值不大於第三臨界值,偵測電路判斷目前像素不 為壞像素。 In an embodiment, the plurality of third pixels in the pixel have the same channel as the current pixel, and the detecting circuit determines whether the current pixel is a bad pixel, and the detecting circuit determines whether each third pixel is determined according to the determination result. For each third pixel, if the corresponding third pixel is overexposed, the detection circuit updates a count value; for each third pixel, if the corresponding third pixel is not overexposed, then the detector The measuring circuit updates the counting value according to the difference between the color value of the corresponding third pixel and the color value of the current pixel; the detecting circuit determines whether the counting value is greater than the third critical value; and if the counting value is not greater than the third critical value, The detection circuit determines that the current pixel is not For bad pixels.
在一實施例中,上述的偵測電路根據對應的第三像素的顏色值與目前像素的顏色值之間的差距來更新計數值的操作包括:偵測電路根據目前像素的顏色值來決定第四臨界值與第五臨界值;若差距大於第四臨界值,偵測電路更新計數值;若差距小於第五臨界值,偵測電路更新計數值;以及若差距介於第四臨界值與第五臨界值之間,則偵測電路維持計數值不變。 In an embodiment, the detecting circuit updates the count value according to the difference between the color value of the corresponding third pixel and the color value of the current pixel, and the detecting circuit determines the first color according to the color value of the current pixel. The fourth critical value and the fifth critical value; if the difference is greater than the fourth critical value, the detecting circuit updates the counting value; if the difference is less than the fifth critical value, the detecting circuit updates the counting value; and if the difference is between the fourth critical value and the Between the five critical values, the detection circuit maintains the count value unchanged.
在一實施例中,上述若計數值大於第三臨界值,偵測電路更判斷所述第三像素的其中之一是否為過曝光,若所述第三像素的其中之任一為過曝光,偵測電路判斷目前像素為壞像素。 In one embodiment, if the count value is greater than the third threshold, the detecting circuit further determines whether one of the third pixels is overexposed, and if any one of the third pixels is overexposed, The detection circuit determines that the current pixel is a bad pixel.
在一實施例中,上述的修復電路是根據具有第一曝光時間的所述第三像素來修正目前像素。 In an embodiment, the repair circuit described above corrects the current pixel based on the third pixel having the first exposure time.
在一實施例中,上述的修復電路是根據加權平均演算法來執行上述根據具有第一曝光時間的所述第三像素來修正目前像素的操作。 In an embodiment, the repair circuit described above performs the above-described operation of correcting the current pixel according to the third pixel having the first exposure time according to a weighted average algorithm.
基於上述,本發明實施例所提出的壞像素處理方法與影像處理裝置,會將不同於目前像素的曝光時間的第一像素/第二像素的顏色值進行調整,以對應至目前像素的曝光時間。並且,像素是否過曝光的判斷結果會用來判斷目前像素是否為壞像素,並進一步對壞像素進行修正。藉此,可以在影像有不同曝光時間的情況下偵測出壞像素。 Based on the above, the bad pixel processing method and the image processing apparatus proposed by the embodiments of the present invention adjust the color values of the first pixel/second pixel different from the exposure time of the current pixel to correspond to the exposure time of the current pixel. . Moreover, the determination result of whether the pixel is overexposed is used to determine whether the current pixel is a bad pixel, and further corrects the bad pixel. Thereby, it is possible to detect bad pixels when the images have different exposure times.
為讓本發明的上述特徵和優點能更明顯易懂,下文特舉 實施例,並配合所附圖式作詳細說明如下。 In order to make the above features and advantages of the present invention more apparent, the following is a special The embodiments are described in detail below in conjunction with the drawings.
100‧‧‧影像處理裝置 100‧‧‧Image processing device
102‧‧‧升取樣電路 102‧‧‧ liter sampling circuit
104‧‧‧偵測電路 104‧‧‧Detection circuit
106‧‧‧修復電路 106‧‧‧Repair circuit
200‧‧‧原始影像 200‧‧‧ original image
R1~R8‧‧‧水平像素列 R1~R8‧‧‧ horizontal pixel column
W1~W3‧‧‧操作區塊 W 1 ~W 3 ‧‧‧Operation block
LE‧‧‧長曝光時間 LE‧‧‧Long exposure time
SE‧‧‧短曝光時間 SE‧‧‧Short exposure time
G1、B2、G3、B4、G5、R6、G7、R8、G9、R10、G11、B12、G13、B14、B15、R16、G17、R18、G19、R20、G21、B22、G23、B24、G25、G’1、B’2、G’3、B’4、G’5、R’6、G’7、R’8、G’9、R’10、G’21、B’22、G’23、B’24、G’25‧‧‧像素 G 1 , B 2 , G 3 , B 4 , G 5 , R 6 , G 7 , R 8 , G 9 , R 10 , G 11 , B 12 , G 13 , B 14 , B 15 , R 16 , G 17 , R 18 , G 19 , R 20 , G 21 , B 22 , G 23 , B 24 , G 25, G' 1 , B' 2 , G' 3 , B' 4 , G' 5 , R' 6 , G ' 7 , R' 8 , G' 9 , R' 10 , G' 21 , B' 22 , G' 23 , B' 24 , G' 25 ‧ ‧ pixels
Ws‧‧‧短曝光區塊 Ws‧‧‧Short exposure block
310‧‧‧判斷結果 310‧‧‧Results
S401~S409、S501~S513‧‧‧壞像素處理方法的各步驟 S401~S409, S501~S513‧‧‧Steps of bad pixel processing method
圖1是依照本發明一實施例所繪示的影像處理裝置的方塊圖。 FIG. 1 is a block diagram of an image processing apparatus according to an embodiment of the invention.
圖2是依照本發明一實施例所繪示的影像感測器採用不同曝光時間所獲得的原始影像的示意圖。 FIG. 2 is a schematic diagram of an original image obtained by an image sensor using different exposure times according to an embodiment of the invention.
圖3是依照本發明一實施例所繪示的操作區塊進行區塊處理的過程示意圖。 FIG. 3 is a schematic diagram of a process of performing block processing by an operation block according to an embodiment of the invention.
圖4是依照本發明一實施例所繪示的壞像素處理方法的流程圖。 FIG. 4 is a flowchart of a bad pixel processing method according to an embodiment of the invention.
圖5是依照本發明一實施例所繪示的壞像素處理方法的流程圖。 FIG. 5 is a flowchart of a bad pixel processing method according to an embodiment of the invention.
現有的壞像素偵測方法是基於一張全畫面為單一曝光時間的影像所做的處理,而當欲處理的影像變成兩條長曝光線與兩條短曝光線連續交替出現的影像時,例如是對於高動態範圍影像感測器(HDR sensor)所產生的影像,則此種方法已無法直接應用。即使針對具有單一曝光時間的區域做壞點偵測修復,但由於區域中最鄰近、具有相同曝光時間、且同顏色之像素不夠靠近欲偵測的像素,因此會增加誤判或是偵測不到的機率,藉以影響修復的品質。為了提高偵測壞像素的機率與修復品質,針對欲處理 的像素而言,倘若能對此欲處理的像素的周圍像素進行升取樣(upsampling),同時標記哪些周圍像素具有過曝光情況,最後利用執行升取樣後的像素與上述的標記以進行壞像素偵測與修復,則將可準確的偵測出壞像素並進行修復。本發明便是基於上述觀點而提出的壞像素處理方法與影像處理裝置。為了使本發明之內容更為明瞭,以下特舉實施例做為本發明確實能夠據以實施的範例。 The existing bad pixel detection method is based on a process in which a full picture is a single exposure time image, and when the image to be processed becomes an image in which two long exposure lines and two short exposure lines alternate continuously, for example, For images produced by high dynamic range HDR sensors, this method is not directly applicable. Even if the defect detection is repaired for an area with a single exposure time, the nearest neighbor, the same exposure time, and the pixels of the same color are not close enough to the pixel to be detected, so the false positive or the undetectable will be increased. The probability of affecting the quality of the repair. In order to improve the probability of detecting bad pixels and repair quality, In terms of pixels, if the surrounding pixels of the pixel to be processed can be upsampling, and at the same time, which surrounding pixels are marked with overexposure, the pixel after performing the upsampling and the above-mentioned mark are used for bad pixel detection. Test and repair will accurately detect and repair bad pixels. The present invention is a bad pixel processing method and an image processing apparatus proposed based on the above viewpoint. In order to make the content of the present invention clearer, the following specific embodiments are examples of the invention that can be implemented.
圖1是依照本發明一實施例所繪示的影像處理裝置的方塊圖。請參照圖1,影像處理裝置100包括升取樣電路102、偵測電路104以及修復電路106。影像處理裝置100例如是數位相機、數位單眼(Digital Single Lens Reflex,DSLR)相機、數位攝影機(Digital Video Camcorder,DVC)等。在另一實施例中,影像處理裝置100可內建於智慧型手機、平板電腦或筆記型電腦等電子裝置,不限於上述。 FIG. 1 is a block diagram of an image processing apparatus according to an embodiment of the invention. Referring to FIG. 1 , the image processing apparatus 100 includes an up sampling circuit 102 , a detection circuit 104 , and a repair circuit 106 . The image processing device 100 is, for example, a digital camera, a Digital Single Lens Reflex (DSLR) camera, a Digital Video Camcorder (DVC), or the like. In another embodiment, the image processing apparatus 100 can be built in an electronic device such as a smart phone, a tablet, or a notebook computer, and is not limited to the above.
在本實施例中,影像處理裝置100可具有影像感測器(未繪示),而此影像感測器是用以進行拍攝並擷取影像。其中,影像感測器可包括鏡頭、感光元件以及快門模組等。感光元件例如是互補性氧化金屬半導體(Complementary Metal-Oxide Semiconductor,CMOS)元件或其他元件。快門模組例如由多數個葉片(blades)及驅動模組所構成,而可用以逐條(line-by-line)控制這些感光元件中每條水平感光元件的曝光時間。需說明的是,上述的影像感測器會依據第一曝光時間(本實施例舉例為長 曝光時間,簡稱長曝光)與第二曝光時間(本實施例舉例為短曝光時間,簡稱短曝光)連續交錯拍攝而得到一個原始影像,其中長曝光時間不同於短曝光時間。在一實施例中,上述的影像感測器例如可控制兩條水平像素列為長曝光進行拍攝,兩條水平像素列為短曝光進行拍攝,依序交替進行。 In this embodiment, the image processing device 100 can have an image sensor (not shown) for capturing and capturing images. The image sensor may include a lens, a photosensitive element, a shutter module, and the like. The photosensitive element is, for example, a Complementary Metal-Oxide Semiconductor (CMOS) element or other element. The shutter module is composed of, for example, a plurality of blades and a driving module, and can be used to control the exposure time of each of the photosensitive elements in line-by-line. It should be noted that the image sensor described above is based on the first exposure time (this embodiment is long as an example) The exposure time, referred to as long exposure) and the second exposure time (exemplified by short exposure time in this embodiment, short exposure) are successively interlaced to obtain an original image, wherein the long exposure time is different from the short exposure time. In one embodiment, the image sensor can control, for example, two horizontal pixel columns to take a long exposure for shooting, and two horizontal pixel columns to take a short exposure for shooting, which are sequentially performed alternately.
舉例來說,圖2是依照本發明一實施例所繪示的影像感測器採用不同曝光時間所獲得的原始影像的示意圖。請參照圖2,原始影像200中的第一水平像素列R1及第二水平像素列R2是採用長曝光LE;第三水平像素列R3及第四水平像素列R4是採用短曝光SE;第五水平像素列R5及第六水平像素列R6是採用長曝光LE;第七水平像素列R7及第八水平像素列R8是採用短曝光SE。影像感測器採用長短曝光交錯的方式不限於上述,在另一實施範例中,影像感測器亦可針對單數的水平像素列進行長曝光拍攝,而針對雙數的水平像素列進行短曝光拍攝。或者,影像感測器可以對三條水平像素列進行長曝光以後,對兩條水平像素列進行短曝光。 For example, FIG. 2 is a schematic diagram of an original image obtained by using an image sensor with different exposure times according to an embodiment of the invention. Referring to FIG. 2, the first horizontal pixel column R1 and the second horizontal pixel column R2 in the original image 200 adopt a long exposure LE; the third horizontal pixel column R3 and the fourth horizontal pixel column R4 adopt a short exposure SE; The horizontal pixel column R5 and the sixth horizontal pixel column R6 adopt a long exposure LE; the seventh horizontal pixel column R7 and the eighth horizontal pixel column R8 adopt a short exposure SE. The image sensor is not limited to the above, and in another embodiment, the image sensor can also perform long exposure shooting for a single horizontal pixel column and short exposure shooting for a double horizontal pixel column. Alternatively, the image sensor can perform short exposure on the two horizontal pixel columns after long exposure of the three horizontal pixel columns.
在此說明的是,本實施例的影像處理裝置100例如是以操作區塊為單位來進行壞像素偵測與修復。詳細地說,操作區塊又可稱之為視窗(window),操作區塊的尺寸例如為N*N像素,其中N為正整數,但本發明並不限制N的數值。原始影像200中的操作區塊W1、W2、W3的尺寸例如設定為5*5像素。需說明的是,原始影像200的操作區塊並不限於3個,在此僅作為舉例解 說之用,實際應用上可針對每一輸出像素設定其所屬的操作區塊。對於每一個操作區塊,影像處理裝置100的會產生一個像素。 It is to be noted that the image processing apparatus 100 of the present embodiment performs bad pixel detection and repair, for example, in units of operating blocks. In detail, the operation block may be referred to as a window, and the size of the operation block is, for example, N * N pixels, where N is a positive integer, but the present invention does not limit the value of N. The size of the operation blocks W 1 , W 2 , and W 3 in the original image 200 is set to, for example, 5 * 5 pixels. It should be noted that the operation block of the original image 200 is not limited to three, and is only used as an example for illustration. In practice, the operation block to which it belongs may be set for each output pixel. For each of the operational blocks, one pixel is produced by the image processing apparatus 100.
圖3是依照本發明一實施例所繪示的操作區塊W1進行區塊處理的過程示意圖。請參照圖3,在本實施例中,操作區塊W1包括了25個像素,而欲處理的像素為像素G13。操作區塊W1中的25個像素為貝爾排列(bayer arrangement),並且每一個像素擁有一個顏色值(或稱通道)。例如,像素G1、G3、G5等擁有綠色的顏色值;像素B2、B4等擁有藍色的顏色值;而像素R6、R8、R10等擁有紅色的顏色值。值得注意的是,圖3中的貝爾排列僅是一個範例,在其他實施例中,操作區塊W1可以有其他的排列方式。例如,操作區塊W1中像素列R1的第一個像素可以從藍色或是紅色的像素開始排列,本發明並不在此限。操作區塊W1中的像素G1、B2、G3、B4、G5、R6、G7、R8、G9、R10、G21、B22、G23、B24與像素G25具有長曝光時間;而像素G11、B12、G13、B14、G15、R16、G17、R18、G19與像素R20具有短曝光時間。以下稱具有長曝光時間的像素為長曝光像素,稱有短曝光時間的像素為短曝光像素。 FIG. 3 is a schematic diagram of a process of performing block processing by the operation block W 1 according to an embodiment of the invention. Referring to FIG 3, in the present embodiment, operations block W 1 comprises 25 pixels, and wish to process pixel as a pixel G 13. The 25 pixels in the operation block W 1 are bayer arrangements, and each pixel has a color value (or channel). For example, the pixels G 1 , G 3 , G 5 , etc. have green color values; the pixels B 2 , B 4 , etc. have blue color values; and the pixels R 6 , R 8 , R 10 , etc. have red color values. It should be noted that the Bell arrangement in FIG. 3 is only an example. In other embodiments, the operation block W 1 may have other arrangements. For example, a first pixel operations block pixel array R1 W 1 may be arranged starting from the red or blue pixels, the present invention is permitted. The pixels G 1 , B 2 , G 3 , B 4 , G 5 , R 6 , G 7 , R 8 , G 9 , R 10 , G 21 , B 22 , G 23 , B 24 in the operation block W 1 and The pixel G 25 has a long exposure time; and the pixels G 11 , B 12 , G 13 , B 14 , G 15 , R 16 , G 17 , R 18 , G 19 and the pixel R 20 have a short exposure time. Hereinafter, a pixel having a long exposure time is referred to as a long exposure pixel, and a pixel having a short exposure time is referred to as a short exposure pixel.
底下即搭配圖1與圖3來說明影像處理裝置100中的升取樣電路102、偵測電路104以及修復電路106的功能。請參照圖1與圖3,本實施例稱欲處理的像素G13為目前像素G13,且目前像素G13的曝光時間屬於短曝光。在此,針對屬於短曝光的目前像素G13而言,升取樣電路102會調整長曝光像素的顏色值,以使這些長曝光像素的顏色值對應至目前像素G13的曝光時間。上述升取 樣電路102調整長曝光像素的顏色值以對應至目前像素G13的曝光時間的步驟亦可被稱為升取樣(upsampling)。具體來說,升取樣電路102在執行上述升取樣時,會將各長曝光像素的顏色值除以一個增益(此增益例如為上述的長曝光時間與短曝光時間的比率)。另一方面,升取樣電路102會維持短曝光像素的顏色值不變。如此一來,升取樣電路102可以得到短曝光區塊WS,其中像素G’1、B’2、G’3、B’4、G’5、R’6、G’7、R’8、G’9、R’10、G’21、B’22、G’23、B’24與像素G’25的顏色值是對應至短曝光時間。 The functions of the upsampling circuit 102, the detecting circuit 104, and the repairing circuit 106 in the image processing apparatus 100 will be described below with reference to FIGS. 1 and 3. Referring to FIG. 1 and FIG. 3, the pixel G 13 that is to be processed in this embodiment is the current pixel G 13 , and the exposure time of the current pixel G 13 is a short exposure. Here, for the current pixel G 13 belonging to the short exposure, the up sampling circuit 102 adjusts the color values of the long exposure pixels such that the color values of the long exposure pixels correspond to the exposure time of the current pixel G 13 . The step of the up sampling circuit 102 adjusting the color value of the long exposure pixel to correspond to the exposure time of the current pixel G 13 may also be referred to as upsampling. Specifically, when the up sampling is performed, the up sampling circuit 102 divides the color value of each long exposure pixel by a gain (this gain is, for example, the ratio of the long exposure time to the short exposure time described above). On the other hand, the upsampling circuit 102 maintains the color values of the short exposure pixels unchanged. In this way, the upsampling circuit 102 can obtain the short exposure block W S , wherein the pixels G′ 1 , B′ 2 , G′ 3 , B′ 4 , G′ 5 , R′ 6 , G′ 7 , R′ 8 , G '9, R' 10 , G '21, B' 22, G '23, B' 24 and pixel G 'color value of 25 corresponds to a short exposure time.
需說明的是,本實施例雖是以屬於短曝光的目前像素G13為例,但本實施例並不限制目前像素G13的曝光時間是短曝光。在另一實施例中,目前像素G13的曝光時間也可以是長曝光。在此另一實施例中,升取樣電路102會調整操作區塊中短曝光像素的顏色值以對應至長曝光時間。舉例來說,升取樣電路102會將各短曝光像素的顏色值乘上一個增益。此增益是根據長曝光時間與短曝光時間所計算出(例如為長曝光時間與短曝光時間的比率)。 It should be noted that, although the present embodiment is exemplified by the current pixel G 13 which is a short exposure, the present embodiment does not limit the exposure time of the current pixel G 13 to be a short exposure. In another embodiment, the exposure time of the current pixel G 13 may also be a long exposure. In this alternate embodiment, the upsampling circuit 102 adjusts the color values of the short exposure pixels in the operational block to correspond to long exposure times. For example, the upsampling circuit 102 multiplies the color values of each of the short exposure pixels by a gain. This gain is calculated based on the long exposure time and the short exposure time (for example, the ratio of the long exposure time to the short exposure time).
升取樣電路102也會判斷操作區塊W1中的像素是否過曝光以產生一個判斷結果。具體來說,升取樣電路102會先取得操作區塊W1中除了像素G13以外的一個像素(亦稱測試像素)。若一個測試像素具有長曝光,則升取樣電路102會判斷此測試像素的顏色值是否大於第一臨界值。若此測試像素的顏色值大於第一臨界值,則升取樣電路102會判斷此測試像素為過曝光,並且升取樣電路102將會在判斷結果310中標記此測試像素為過曝光。 倘若一個測試像素具有短曝光,則升取樣電路102會判斷此測試像素的顏色值乘於上述增益之後的乘積是否大於第二臨界值。若此乘積大於第二臨界值,則升取樣電路102會判斷此測試像素為過曝光,且升取樣電路102將會在判斷結果310中標記此測試像素為過曝光。然而,本發明並不限制上述第一臨界值與第二臨界值為多少。在此,判斷結果310是以一個矩陣(或稱遮罩)來表示,其中數值”1”表示對應的測試像素有過曝光,並且數值”0”表示對應的測試像素沒有過曝光。例如,像素G7與像素G9為過曝光。值得注意的是,判斷結果310也表示短曝光區塊Ws中的一個像素是否過曝光。即,像素G’7與像素G’9是被標記為過曝光。 Upsampling circuit 102 also determines whether the operation of the pixel block W 1 overexposure to generate a determination result. Specifically, the sampling circuit 102 will rise to obtain an operation in addition to the W block of pixels of a pixel G 13 (also known as test pixel). If a test pixel has a long exposure, the upsampling circuit 102 determines whether the color value of the test pixel is greater than the first threshold. If the color value of the test pixel is greater than the first threshold, the upsampling circuit 102 determines that the test pixel is overexposed, and the upsampling circuit 102 will mark the test pixel as overexposed in the determination result 310. If a test pixel has a short exposure, the upsampling circuit 102 determines whether the product of the color value of the test pixel multiplied by the gain is greater than the second threshold. If the product is greater than the second threshold, the upsampling circuit 102 determines that the test pixel is overexposed, and the upsampling circuit 102 will mark the test pixel as overexposed in the decision result 310. However, the present invention does not limit the first threshold value and the second threshold value. Here, the judgment result 310 is represented by a matrix (or a mask), wherein a value of "1" indicates that the corresponding test pixel has overexposure, and a value of "0" indicates that the corresponding test pixel has not been overexposed. For example, pixel G 7 and pixel G 9 are overexposed. It is to be noted that the judgment result 310 also indicates whether or not one pixel in the short exposure block Ws is overexposed. That is, the pixel G' 7 and the pixel G' 9 are marked as overexposed.
在另一實施例中,目前像素G13的曝光時間為長曝光時,而升取樣電路102同樣會產生一個判斷結果。其中產生判斷結果的方法和上述產生判斷結果310的方法相同,因此不再贅述。 In another embodiment, the exposure time of the pixel G13 is currently a long exposure, and the up sampling circuit 102 also produces a determination result. The method for generating the judgment result is the same as the method for generating the judgment result 310 described above, and therefore will not be described again.
請參照圖1與圖3,偵測電路104耦接至升取樣電路102,其中偵測電路104用以判斷目前像素G13是否為壞像素。針對屬於短曝光的目前像素G13而言,偵測電路104會根據短曝光區塊WS中的短曝光像素、調整後的長曝光像素與判斷結果310來判斷目前像素G13是否為壞像素。並且,偵測電路104是依據與目前像素G13具有相同的通道的像素(亦稱第三像素)來進行判斷。在本實施例中,由於目前像素G13具有通道G,因此上述的第三像素為像素G’1、G’3、G’5、G’7、G’9、G11、G13、G15、G17、G19、G’21、G’23與像素G’25。偵測電路104會根據判斷結果310判斷每個第三像 素是否為過曝光。對於每個第三像素,若判斷結果310中對應的第三像素為過曝光,則偵測電路104更新一個計數值(例如,加上1)。 Referring to FIG. 1 and FIG. 3, the detection circuit 104 is coupled to the connected sampling circuit 102 liters, wherein the current detection circuit 104 for determining whether a pixel is a bad pixel G 13. For the current pixel G 13 belonging to the short exposure, the detecting circuit 104 determines whether the current pixel G 13 is a bad pixel according to the short exposure pixel in the short exposure block W S , the adjusted long exposure pixel and the determination result 310 . . Moreover, the detection circuit 104 performs the determination based on the pixels (also referred to as the third pixels) having the same channel as the current pixel G 13 . In this embodiment, since the pixel G 13 has the channel G, the third pixel is the pixels G′ 1 , G′ 3 , G′ 5 , G′ 7 , G′ 9 , G 11 , G 13 , G 15 , G 17 , G 19 , G' 21 , G' 23 and pixel G' 25 . The detecting circuit 104 determines whether each third pixel is overexposed according to the determination result 310. For each third pixel, if the corresponding third pixel in the determination result 310 is overexposed, the detection circuit 104 updates a count value (for example, plus 1).
另一方面,對於每個第三像素,若判斷結果310中對應的第三像素不為過曝光,則偵測電路104會根據對應的第三像素的顏色值與目前像素G13的顏色值之間的差距來更新上述的計數值。舉例來說,偵測電路104會計算一個第三像素(例如,像素G1)的顏色值與目前像素G13的顏色值之間的差距。若此差距大於一個第四臨界值,則偵測電路104會更新上述的計數值(例如,加上1)。若此差距小於一個第五臨界值,則偵測電路104亦會更新計數值(例如,加上1)。若像素G1與像素G13的顏色值的差距介於第四臨界值與第五臨界值之間,則偵測電路104維持計數值不變。其中,偵測電路104還可根據目前像素G13的顏色值來決定上述的第四臨界值與第五臨界值。舉例來說,當目前像素G13的顏色值越大時,則第四臨界值會越大且第五臨界值會越小。然而,本發明並不限定第四臨界值與第五臨界值為多少。 On the other hand, for each third pixel, if the corresponding third pixel in the determination result 310 is not overexposed, the detecting circuit 104 may use the color value of the corresponding third pixel and the color value of the current pixel G 13 . The gap between them is to update the above count value. For example, the detection circuit 104 calculates a third pixel (e.g., pixel G 1) were the color value difference between the current pixel color values G 13. If the difference is greater than a fourth threshold, the detection circuit 104 updates the above count value (eg, plus one). If the difference is less than a fifth threshold, the detection circuit 104 also updates the count value (eg, plus one). If the difference between the color values of the pixel G 1 and the pixel G 13 is between the fourth critical value and the fifth critical value, the detecting circuit 104 maintains the count value unchanged. The detecting circuit 104 can also determine the fourth threshold value and the fifth threshold value according to the color value of the current pixel G 13 . For example, when the color value of the current pixel G 13 is larger, the fourth critical value will be larger and the fifth critical value will be smaller. However, the present invention does not limit the fourth critical value and the fifth critical value.
當上述的計數值越大時,表示目前像素G13越有可能是壞像素。偵測電路104會判斷上述的計數值是否大於一個第三臨界值。若上述的計數值不大於第三臨界值,則偵測電路104會判斷目前像素G13不為壞像素,並且輸出目前像素G13。若上述的計數值大於第三臨界值,則表示目前像素G13是一個壞像素。特別的是,偵測電路104更會判斷第三像素的其中之一是否為過曝光, 藉此用不同的方式來修復目前像素G13。具體來說,若第三像素的其中之任一為過曝光,則偵測電路104會判斷目前像素G13為壞像素,且修復電路106會根據與目前像素G13具有相同的通道、相同曝光時間的第三像素來修正目前像素G13。舉例來說,假設目前像素G13被判斷為壞像素,且周圍有一個第三像素(即,像素G’7或像素G’9)為過曝光,因此修復電路106會根據屬於短曝光的第三像素,即像素G11、G15、G17與像素G19來修正目前像素G13。在一實施例中,修復電路106例如是根據加權平均演算法來執行上述對目前像素G13的修正。具體而言,修復電路106會根據具有短曝光時間的第三像素G11、G15、G17與像素G19的顏色值來執行加權平均演算法,並根據執行加權平均演算法所得到的結果來修正目前像素G13的顏色值。因此,在考慮過曝光的情況下,修復電路106並不會利用過曝光的像素G’7與像素G’9來修復目前像素G13。 When the above count value is larger, it indicates that the pixel P 13 is more likely to be a bad pixel. The detecting circuit 104 determines whether the above count value is greater than a third critical value. If the count value is not greater than the third threshold, the detecting circuit 104 determines that the current pixel G 13 is not a bad pixel, and outputs the current pixel G 13 . If the above count value is greater than the third critical value, it indicates that the current pixel G 13 is a bad pixel. In particular, the detecting circuit 104 further determines whether one of the third pixels is overexposed, thereby repairing the current pixel G 13 in a different manner. Specifically, if any one of the third pixels is overexposed, the detecting circuit 104 determines that the current pixel G 13 is a bad pixel, and the repair circuit 106 has the same channel and the same exposure according to the current pixel G 13 . The third pixel of time corrects the current pixel G 13 . For example, suppose that the current pixel G 13 is judged to be a bad pixel, and there is a third pixel (ie, the pixel G' 7 or the pixel G' 9 ) is overexposed, so the repair circuit 106 according to the short exposure The three pixels, that is, the pixels G 11 , G 15 , G 17 and the pixel G 19 , correct the current pixel G 13 . In an embodiment, the repair circuit 106 performs the above-described correction of the current pixel G 13 according to, for example, a weighted average algorithm. Specifically, the repair circuit 106 performs a weighted average algorithm based on the color values of the third pixels G 11 , G 15 , G 17 , and the pixels G 19 having a short exposure time, and obtains results based on performing the weighted average algorithm. To correct the color value of the current pixel G 13 . Accordingly, in consideration of overexposure, repair circuit 106 does not use overexposed pixel G '7 and the pixel G' 9 to repair the current pixel G 13.
相反地,若目前像素G13為壞像素,且所有的第三像素都不為過曝光,則修復電路106會根據短曝光區塊Ws中所有的像素來修正目前像素G13。然而,修復電路106可以根據任意的演算法來修正目前像素G13,本發明並不在此限。 Conversely, if the current pixel G 13 is a bad pixel and all of the third pixels are not overexposed, the repair circuit 106 corrects the current pixel G 13 according to all the pixels in the short exposure block Ws. However, the repair circuit 106 can correct the current pixel G 13 according to any algorithm, and the present invention is not limited thereto.
需說明的是,在另一實施例中,偵測電路104也會依照類似的方法,針對屬於長曝光的目前像素來判斷其是否為壞像素。也就是說,偵測電路104會根據屬於長曝光、且與目前像素具有相同通道的第三像素來更新計數值。偵測電路104也會根據第三像素是否過曝光來更新計數值。而修復電路106會依照類似 的方法來修正屬於長曝光的目前像素。也就是說,倘若屬於長曝光的目前像素被偵測電路104判斷為壞像素且周圍有一個像素為過曝光,則修復電路106會根據與目前像素具有相同的通道且具有長曝光時間的第三像素來修正此目前像素。 It should be noted that, in another embodiment, the detecting circuit 104 also determines whether it is a bad pixel for the current pixel belonging to the long exposure according to a similar method. That is to say, the detection circuit 104 updates the count value according to the third pixel belonging to the long exposure and having the same channel as the current pixel. The detection circuit 104 also updates the count value based on whether the third pixel is overexposed. And the repair circuit 106 will follow The way to correct the current pixels that belong to long exposures. That is, if the current pixel belonging to the long exposure is determined by the detecting circuit 104 to be a bad pixel and one pixel is overexposed, the repair circuit 106 will have a third channel having the same channel as the current pixel and having a long exposure time. Pixels to correct this current pixel.
在此說明的是,本實施例的升取樣電路102、偵測電路104以及修復電路106可為由一個或數個邏輯閘組合而成的硬體電路來實作。或者,在本發明另一實施例中,升取樣電路102、偵測電路104以及修復電路106的功能可以用電腦程式碼來實作。這些電腦程式碼儲存在電子裝置的儲存單元中,並藉由一個處理單元來執行之。此處理單元為具備運算能力的硬體(例如晶片組、處理器等),用以控制電子裝置300的整體運作。處理單元例如是中央處理單元(Central Processing Unit,CPU),或是其他可程式化之微處理器(Microprocessor)、數位訊號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits,ASIC)、可程式化邏輯裝置(Programmable Logic Device,PLD)或其他類似裝置。此外,上述儲存單元可以是內嵌式儲存單元或外接式儲存單元。內嵌式儲存單元可為隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體(Flash memory)、磁碟儲存裝置(Magnetic disk storage device)等。外接式儲存單元可為小型快閃(Compact Flash,CF)記憶卡、安全數位(Secure Digital,SD)記憶卡、微安全數位(Micro SD)記憶 卡、記憶棒(Memory Stick,MS)等。在本實施例中,儲存單元可儲存一或多個用來執行負載預測方法的程式碼以及資料等。 It is noted that the upsampling circuit 102, the detecting circuit 104, and the repairing circuit 106 of the present embodiment can be implemented as a hardware circuit composed of one or several logic gates. Alternatively, in another embodiment of the present invention, the functions of the upsampling circuit 102, the detecting circuit 104, and the repairing circuit 106 can be implemented by computer code. The computer code is stored in a storage unit of the electronic device and executed by a processing unit. The processing unit is a hardware (eg, a chipset, a processor, etc.) having computing power for controlling the overall operation of the electronic device 300. The processing unit is, for example, a central processing unit (CPU), or other programmable microprocessor (Microprocessor), a digital signal processor (DSP), a programmable controller, and a special application product. Application Specific Integrated Circuits (ASICs), Programmable Logic Devices (PLDs), or the like. In addition, the above storage unit may be an in-line storage unit or an external storage unit. The embedded storage unit can be a random access memory (RAM), a read-only memory (ROM), a flash memory, a magnetic disk storage device (Magnetic disk storage). Device) and so on. The external storage unit can be a compact flash (CF) memory card, a secure digital (SD) memory card, and a micro-safe digital (Micro SD) memory. Card, Memory Stick (MS), etc. In this embodiment, the storage unit may store one or more codes, materials, and the like for performing the load prediction method.
圖4是依照本發明一實施例所繪示的壞像素處理方法的流程圖。請參照圖4,在步驟S401中,取得多個像素,其中所述像素中的多個第一像素具有第一曝光時間,所述像素中的多個第二像素具有第二曝光時間,第一曝光時間不同於第二曝光時間,並且所述像素中的目前像素屬於第一曝光時間。在步驟S403中,調整各第二像素的顏色值以對應至第一曝光時間。在步驟S405中,判斷所述像素是否過曝光以產生判斷結果。在步驟S407中,根據第一像素、調整後的第二像素與判斷結果來判斷目前像素是否為壞像素。在步驟S409中,若目前像素為壞像素,修正目前像素。藉此,本發明可利於進行高動態範圍影像的壞像素偵測與修復處理,以產生高品質的高動態範圍影像。需說明的是,在一實施例中,上述的第一曝光時間與第一像素例如是上述的長曝光時間與長曝光像素。但本發明並不在此限,第一曝光時間與第一像素也可以是短曝光時間與短曝光像素。圖4中各步驟已詳細說明如上,在此便不再贅述。值得注意的是,圖4中各步驟可以實作為多個程式碼或是電路;此外,圖4的方法可以搭配以上實施例使用,也可以單獨使用,本發明並不在此限。 FIG. 4 is a flowchart of a bad pixel processing method according to an embodiment of the invention. Referring to FIG. 4, in step S401, a plurality of pixels are obtained, wherein a plurality of first pixels in the pixels have a first exposure time, and a plurality of second pixels in the pixels have a second exposure time, first The exposure time is different from the second exposure time, and the current pixel in the pixel belongs to the first exposure time. In step S403, the color values of the respective second pixels are adjusted to correspond to the first exposure time. In step S405, it is determined whether the pixel is overexposed to generate a determination result. In step S407, it is determined whether the current pixel is a bad pixel according to the first pixel, the adjusted second pixel, and the determination result. In step S409, if the current pixel is a bad pixel, the current pixel is corrected. Thereby, the present invention can facilitate the bad pixel detection and repair processing of high dynamic range images to produce high quality high dynamic range images. It should be noted that, in an embodiment, the first exposure time and the first pixel are, for example, the long exposure time and the long exposure pixel described above. However, the present invention is not limited thereto, and the first exposure time and the first pixel may also be a short exposure time and a short exposure pixel. The steps in Fig. 4 have been described in detail above and will not be described again here. It should be noted that the steps in FIG. 4 can be implemented as a plurality of codes or circuits; in addition, the method of FIG. 4 can be used in combination with the above embodiments, or can be used alone, and the present invention is not limited thereto.
為了更清楚說明上述壞像素處理方法,以下再舉一實施例來進行說明。圖5是依照本發明一實施例所繪示的壞像素處理方法的流程圖。 In order to clarify the above-described bad pixel processing method, an embodiment will be described below. FIG. 5 is a flowchart of a bad pixel processing method according to an embodiment of the invention.
請參照圖5,在步驟S501中,依據欲處理的目前像素,取得操作區塊中的多個像素。所述像素中的多個第一像素具有第一曝光時間,所述像素中的多個第二像素具有第二曝光時間。第一曝光時間不同於第二曝光時間,並且所述像素中的目前像素屬於第一曝光時間。 Referring to FIG. 5, in step S501, a plurality of pixels in the operation block are obtained according to the current pixel to be processed. A plurality of first pixels of the pixels have a first exposure time, and a plurality of second pixels of the pixels have a second exposure time. The first exposure time is different from the second exposure time, and the current pixel in the pixel belongs to the first exposure time.
在步驟S503中,調整各第二像素的顏色值以對應至第一曝光時間,並且判斷像素是否過曝光以產生一個判斷結果。 In step S503, the color values of the respective second pixels are adjusted to correspond to the first exposure time, and it is determined whether the pixels are overexposed to generate a determination result.
在步驟S505中,根據該判斷結果判斷操作區塊中的每一第三像素是否為過曝光,其中所述第三像素與目前像素具有相同的通道。對於每一第三像素,若對應的第三像素為過曝光,則更新一個計數值。若有一個第三像素不為過曝光,則此第三像素的顏色值與目前像素的顏色值之間的差距來更新此計數值。最後,判斷此計數值是否大於第三臨界值。 In step S505, it is determined according to the determination result whether each third pixel in the operation block is overexposed, wherein the third pixel has the same channel as the current pixel. For each third pixel, if the corresponding third pixel is overexposed, a count value is updated. If there is a third pixel that is not overexposed, the difference between the color value of the third pixel and the color value of the current pixel is used to update the count value. Finally, it is determined whether the count value is greater than the third critical value.
倘若上述的計數值不大於第三臨界值,則如步驟S507所示,判斷目前像素不為壞像素,並輸出目前像素。 If the count value is not greater than the third threshold, as shown in step S507, it is determined that the current pixel is not a bad pixel, and the current pixel is output.
然而,倘若上述的計數值大於第三臨界值,則如步驟S509所示,判斷所述第三像素的其中之一是否為過曝光。 However, if the count value is greater than the third threshold, then as shown in step S509, it is determined whether one of the third pixels is overexposed.
在此,倘若所述第三像素皆沒有過曝光,則如步驟S511所示,以基於單一影像為單一曝光時間的影像處理方式修正目前像素,並輸出修正後的目前像素。步驟S511可以用任意的演算法來修正目前像素,本發明並不在此限。 Here, if none of the third pixels is overexposed, as shown in step S511, the current pixel is corrected by a single image processing method based on a single image, and the corrected current pixel is output. Step S511 can use any algorithm to correct the current pixel, and the present invention is not limited thereto.
然而,倘若所述第三像素的其中之任一為過曝光,則如 步驟S513所示,判斷目前像素為壞像素,並根據具有第一曝光時間的所述第三像素來修正目前像素。 However, if any of the third pixels is overexposed, Step S513, determining that the current pixel is a bad pixel, and correcting the current pixel according to the third pixel having the first exposure time.
需說明的是,在一實施例中,上述的第一曝光時間與第一像素例如是上述的長曝光時間與長曝光像素。但本發明並不在此限,第一曝光時間與第一像素也可以是短曝光時間與短曝光像素。圖5中各步驟已詳細說明如上,在此便不再贅述。 It should be noted that, in an embodiment, the first exposure time and the first pixel are, for example, the long exposure time and the long exposure pixel described above. However, the present invention is not limited thereto, and the first exposure time and the first pixel may also be a short exposure time and a short exposure pixel. The steps in Fig. 5 have been described in detail above, and will not be described again here.
綜上所述,在本發明實施例所提出的壞像素處理方法與影像處理裝置中,會對目前像素周圍的像素進行升取樣以得到與目前像素的曝光時間一致的像素資訊,並且會判斷及標記具有過曝情況的像素以得到一個判斷結果,最後再使用上述經升取樣後的像素資訊與判斷結果進行壞像素偵測與修復。藉此,本發明可利於在有不同曝光時間的影像中,進行壞像素偵測與修復處理。 In summary, in the bad pixel processing method and the image processing apparatus proposed in the embodiments of the present invention, the pixels around the current pixel are upsampled to obtain pixel information consistent with the exposure time of the current pixel, and the Mark the pixels with overexposure to get a judgment result, and finally use the above-mentioned upsampled pixel information and the judgment result to perform bad pixel detection and repair. Thereby, the present invention can facilitate bad pixel detection and repair processing in images with different exposure times.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of the invention is defined by the scope of the appended claims.
S401、S403、S405、S407、S409‧‧‧壞像素處理方法的各步驟 S401, S403, S405, S407, S409‧‧‧ steps of the bad pixel processing method
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW102125451A TWI520603B (en) | 2013-07-16 | 2013-07-16 | Method for processing bad pixel and image processing apparatus thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW102125451A TWI520603B (en) | 2013-07-16 | 2013-07-16 | Method for processing bad pixel and image processing apparatus thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201505438A TW201505438A (en) | 2015-02-01 |
| TWI520603B true TWI520603B (en) | 2016-02-01 |
Family
ID=53019068
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW102125451A TWI520603B (en) | 2013-07-16 | 2013-07-16 | Method for processing bad pixel and image processing apparatus thereof |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI520603B (en) |
-
2013
- 2013-07-16 TW TW102125451A patent/TWI520603B/en active
Also Published As
| Publication number | Publication date |
|---|---|
| TW201505438A (en) | 2015-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111028189B (en) | Image processing method, device, storage medium and electronic equipment | |
| CN107635102B (en) | Method and device for acquiring exposure compensation value of high-dynamic-range image | |
| CN101277385B (en) | Method and apparatus to detect a dead pixel of an image sensor and method and apparatus to capture an image from an image sensor | |
| CN112118388B (en) | Image processing method, image processing device, computer equipment and storage medium | |
| JP5719418B2 (en) | High dynamic range image exposure time control method | |
| CN101764926B (en) | Apparatus and system for defect pixel detection and correction, method for detecting and correcting defect pixel | |
| CN108200354A (en) | Control method and device, imaging device, computer device and readable storage medium | |
| CN107592473A (en) | Exposure parameter adjustment method, device, electronic device and readable storage medium | |
| KR101941801B1 (en) | Image processing method and device for led display screen | |
| WO2020034702A1 (en) | Control method, device, electronic equipment and computer readable storage medium | |
| US20200007732A1 (en) | Image processing method and electronic device | |
| JP2015144475A (en) | Imaging apparatus, control method of the same, program and storage medium | |
| WO2020034739A1 (en) | Control method and apparatus, electronic device, and computer readable storage medium | |
| CN107800971B (en) | Automatic exposure control processing method, device and equipment for panoramic shooting | |
| CN108881876B (en) | Method and device for carrying out white balance processing on image and electronic equipment | |
| CN111885281B (en) | Image Processing | |
| CN104301638B (en) | Bad pixel processing method and image processing device | |
| JP5713643B2 (en) | IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM | |
| TWI556643B (en) | Image adjustment method | |
| KR20200106854A (en) | Pixel correction | |
| JP5038190B2 (en) | Image capturing apparatus and setting method thereof | |
| TWI520603B (en) | Method for processing bad pixel and image processing apparatus thereof | |
| CN104869379B (en) | White balance compensation method and electronic device | |
| JP6157274B2 (en) | Imaging apparatus, information processing method, and program | |
| US20210366084A1 (en) | Deblurring process for digital image processing |