The present invention relates to an image processing device that gives high-quality video and an image pickup device that incorporates the image processing device.
Functionality and image quality have been increased recently in image pickup devices, such as digital still cameras and digital video cameras. One of the factors that determines the image quality of a pickup image is contrast. The term contrast means a difference between a dark portion of the image and a light portion of the image, and a high contrast gives a clear image. Another factor that also determines the image quality is a dynamic range (hereinafter referred to as DR). DR means a ratio of a minimum value of a signal recognizable to a maximum value of the signal. In the following discussion, DR refers to a ratio of maximum luminance to minimum luminance in a pickup scene.
When an image is displayed on a display such as a liquid-crystal display, a brightness range within which the display can represent brightness is subject to a limitation. Depending on an input image and performance of the display, so-called blocked up shadows where a gradation in the dark portion is lost may be caused. By performing a gradation conversion process to increase a pixel value of an original image, the blocked up shadows are overcome, and an image with a clear dark portion results. The increasing of the pixel value causes blown-out highlights where the light portion is saturated, reduces the contrast, and lowers the image quality in the light portion. In particular, when a scene with a high DR is captured, a dark portion and a light portion are likely to be mixed and the above problem is thus likely to occur.
To overcome this problem, a gradation conversion technique based on the retinex theory has been proposed. The retinex theory is a theory based on a model of human vision characteristics. According to the retinex theory, the brightness of an object is determined by a product of reflectance of the object and illumination light, and the vision of the eyes responsive to the brightness of the object is strongly correlated with the reflectance of the object. Therefore, if only an illumination light component of an input image is compressed with a reflectance component of an object maintained in the gradation conversion, a high-contrast image free from blocked up shadows and blown-out highlights can be obtained. It is not easy to accurately discriminate the illumination light component and reflectance from a pickup image. If the possibility that the illumination light continuously varies in actual space is high, a low-frequency component that is obtained by low-pass filtering the input image can be considered to be an illumination light component. A high-contrast image can be obtained by compressing the illumination light component and by multiplying the reflectance component of the input image by the compressed illumination light component.
In practice, however, there are times when the illumination light varies discontinuously. If the gradation conversion process is performed based on the above-described assumption, undershooting and overshooting, referred to as halos, occur in an edge surrounding area where the illumination light sharply changes, and the image is degraded.
The principle on which the halos are generated is described with reference to
According to PTL 1, the pixel values of a target pixel and a peripheral pixel are compared at a low-pass filter to calculate a low-frequency component, and if a difference between the two pixel values is equal to or above a predetermined threshold value, the target pixel is excluded as a reference target. This arrangement controls the smoothing of the low-frequency component at the edge where the illumination light sharply changes, and the relaxation of the edge. The generation of halos is thus controlled.
According to PTL 1, the target pixel is compared with the peripheral pixel in terms of pixel value, and no consideration is given to whether the difference therebetween is attributed to a difference in illumination light or a difference in reflectance of object. If the illumination light component is calculated through the method of PTL 1, the reflectance component of the object affects the illumination light component in a region where the difference in the illumination light component is small while the difference in the reflectance component of object is large. When the illumination light component is compressed, the reflectance component of object is also compressed. As a result, contrast is decreased, degrading the image.
Referring to
The present invention has been developed in view of the above situation, and it is an object of the present invention to provide an image processing device that gives a high-quality image that is free from halos and gives high contrast from a dark portion to a light portion of the image, and an image pickup device that includes the image processing device and processes a pickup image as an input image through the image processing device.
To solve the problem, the present invention of a first aspect relates to an image processing device that calculates an illumination light component of an input image from brightness of a target pixel and brightness of a peripheral pixel in the input image and performs a gradation conversion process on the input image in accordance with the illumination light component. The image processing device varies a weight to brightness on the illumination light component in response to a difference between distance information responsive to the target pixel, calculated from distance information indicating a distance to a subject in the input image, and distance information responsive to the peripheral pixel, calculated from the distance information indicating the distance to the subject in the input image, and calculates an area that is referenced as the peripheral pixel and is different in response to the distance information responsive to the target pixel.
In the present invention of a second aspect in view of the first aspect, the illumination light component is calculated by reducing more in size the area referenced as the peripheral pixel as the distance to the subject represented by the distance information responsive to the target pixel is longer.
In the present invention of a third aspect in view of the first and second aspects, a high-frequency component extracted from the input image is added to an image as a result of the gradation conversion process.
In the present invention of a fourth aspect in view of the first through third aspects, an image pickup device includes the image processing device, wherein an image picked up is input to the image processing device as the input image.
The present invention provides a high-quality image that is free from halos and gives high contrast from a dark portion to a light portion in an image.
Preferred embodiments of an image pickup device of the present invention are described below with reference to the accompanying drawings.
The image processing device 10 includes a brightness (Y) calculating unit 11, an illumination light component (L) calculating unit 12, and an illumination light component (L) compression unit 13. The L calculating unit 11 calculates brightness of a target pixel and brightness of a peripheral pixel in response to an input image. The L calculating unit 12 calculates the illumination light component of the input image based on the brightness of the target pixel and the brightness of the peripheral pixel, calculated by the Y calculating unit 11. Since there are times when the brightness Y is available as information, the Y calculating unit 11 is not an essential element in the image processing device 10.
The image processing device 10 performs a gradation conversion process on the illumination light component calculated by the L calculating unit 12. In the example herein, the L compression unit 13 performs the gradation conversion process by compressing the illumination light component.
In the main feature of the present invention, the L calculating unit 12 acquires distance information indicating a distance to a subject in the input image in the calculation of the illumination light component, and varies brightness in response to a difference between the distance information of the target pixel and the distance information of the peripheral pixel. In the calculation of the illumination light component, the L calculating unit 12 varies an area that serves as a peripheral pixel, namely, a filtering area in response to the distance information of the target pixel. The units 11 through 13 are described in detail with reference to
The left and right cameras CL and CR in the image pickup apparatus 1a acquire a left image and a right image as input images. The left image is input to the H calculating unit 31, the Y calculating unit 32, and the parallax calculating unit 33. The right image is input to the parallax calculating unit 33. The following description is equally applicable even if the left and right images are input in a manner reverse to the manner described above.
The parallax calculating unit 33 calculates parallax from the left and right images as the distance information to the subject. Available as a method of calculation parallax is the block matching method, for example. The block matching method is a method of evaluating a similarity between images. In the block matching method, a given region is selected from one image, a region having the highest similarity with that region is selected from a comparative image, and a deviation in position between the comparison target region and the selected region having the highest similarity becomes parallax. Various evaluation functions to evaluate the similarity are used. For example, in one available method called SAD (Sum of Absolute Difference), a region having a minimum total sum of absolute values of differences in pixel value or in luminance value between two images is selected as a region having the highest similarity.
The relationship between a distance to a subject and parallax is described with reference to
When the distance information is used in an image processing process to be discussed later, the input image needs to be associated with the distance information. In view of this necessity, the use of the parallax that results from calculating corresponding points from the images from the left and right cameras CL and CR is better than associating the information from the infrared sensor with the input image.
Next, the Y calculating unit 32 calculates brightness Y of each pixel from the input image. The brightness Y is calculated from the pixel value of the input image. For example, if the input image is a color image having RGB values, Y may be defined using the RGB to YCbCr conversion expression defined by International Telecommunication Union as below.
Y=0.29891×R+0.58661×G+0.11448×B (1)
The brightness Y may be a maximum value of RGB values, namely, Y=Max (R, G, B). The use of the maximum value of the RGB values provides an image quality improvement effect in the gradation conversion process to be discussed below. Note that the calculation of the brightness Y is performed by the Y calculating unit 32 in parallel with, prior to or subsequent to the calculation of the parallax by the parallax calculating unit 33. If information of brightness is available from an illumination sensor or the like in advance, it is not necessary to calculate the brightness from the input image. The input information of brightness may thus be used.
Next, the H calculating unit 31 extracts a high-frequency component H from the input image (the left image in this example), in other words, calculates the high-frequency component H. To calculate the high-frequency component H, a high-pass filter is simply used. For example, a space derivative filter, such as a Sobel filter, is used. The calculation by the H calculating unit 31 may be performed in parallel with, prior to or subsequent to calculation operations of the Y calculating unit 32 and the parallax calculating unit 33.
The L calculating unit 34 calculates the illumination light component L of the input image. The calculation method of the L calculating unit 34 is described below. The illumination light component L is calculated by smoothing the brightness Y. When a smoothing operation is performed in a predetermined region (in a filter), a difference between a distance to a subject image-picked up by a pixel used to calculate the illumination light component L in the center of the filter (hereinafter referred to as a target pixel) and a distance to the subject image-picked up by a pixel around the target pixel (hereinafter referred to as a peripheral pixel) in the filter is calculated from the distance information, and brightness is weight-averaged in accordance with the difference. The parallax may be used as the distance information. In such a case, a weight of the weigh-averaging is increased when the parallax is smaller. When the parallax is smaller, the subject is considered to be at a shorter distance in actual space and the difference in the illumination light component L is considered to be smaller. The weight of the weigh-averaging is decreased when the parallax is larger. When the parallax is larger, the subject is considered to be at a longer distance in the actual space and the difference in the illumination light component L is considered to be larger.
Described below with reference to
Pixel values 51 of the image of
The pixel values 51 of
L=(50×1+100×16+150×3+200×5)/25=124
Whether to set a pixel as a target for smoothing is determined in accordance with the brightness thereof (a difference in brightness from the target pixel T) using the method described in PTL 1. The weight of a pixel that serves as a target for smoothing is set to be 1, and the weight of a pixel that does not serve as a target for smoothing is set to be 0. For example, if a difference of a pixel value as to whether to smooth is 75, the weight has a weight coefficient 55 of
The illumination light component L becomes substantially smaller than the correct value “200” of the target pixel T of
On the other hand, in accordance with the present embodiment, weight coefficients 56 are calculated in accordance with the parallax values 52 of
L=(50×1.0×1+100×0.25×13+100×0.50×3+150×0.5×3+200×1.00×5)/(1.0×6+0.50×6+0.25×13)=143
It is thus understood that an illumination light component L close to the correct value is calculated in comparison with the related-art method. More specifically, a high-quality illumination light component L with the reflectance components R separated therefrom is calculated. In the example described herein, the weight coefficient 56 is determined as being proportional to the parallax value 52. The embodiment is not limited to this. It is acceptable if the weight coefficient 56 accounts for the tendency of the parallax value 52.
To help understand the advantages of the present invention, the input image that the process and advantages of the present invention are applied to is described with reference to
To verify the advantages of the present invention, the illumination light component L is calculated using a simple smoothing filter as a comparative example, and an image 64 of the illumination light component L of
Input images that the process and advantages of the present invention (different from the input images of
To verify the advantages of the present invention, the illumination light component L is calculated through the method described in PTL 1 as a comparative example, and an image 74 of the illumination light component L of
The weighting with the distance information used as the parallax is described in more detail with reference to
For example, a weight W in the calculation of the illumination light component L may be defined by the following Expression (2). Here Dij represents parallax of the target pixel, |Dij−Di+k,j+l| represents a difference between the parallax of the target pixel and the parallax of the peripheral pixel, and k and l respectively represent variables representing displacements of a reference pixel from the target pixel in a horizontal direction and a vertical direction in the filter. In Expression (2), an example of a weighting function W is parallax Dij. Even if information representing distance, different from the parallax as the distance information, is used, the same weighting function may be used.
If the parallax of the target pixel is “10” and the parallax of the peripheral pixel is “9”, the difference from the parallax “10” is “1”. The weight is 1−1/10=0.9. If the parallax of the target pixel is “2” and the parallax of the peripheral pixel is “1”, the difference from the parallax “2” is “1”. The weight is 1−1/2=0.5. Even if the differences of parallax are the same value, the weight accounts for the difference in distance in the actual space.
A calculation method of the illumination light component L accounting for the difference in distance between the target pixel and the peripheral pixel is expressed by the following Expression (3).
Herein, Dij represents the distance information of the target pixel, |Dij−Di+k,j+l| represents a difference between the distance information of the target pixel and the distance information of the reference pixel, and k and l respectively represent sizes of the filter in the horizontal direction and in the vertical direction. Also, W(Dij, |Dij−Di+k,j+l|) is a weighting function of variables Dij and |Dij−Di+k,j+l|.
In the present embodiment as described above, the difference in distance between the target pixel and the peripheral pixel is accounted for in the calculation of the illumination light component L. An excellent illumination light component is calculated in a scene, such as the input image 61 of
Next, the gradation conversion process is described. Since the brightness of an object is determined by the produce of the reflectance and the illumination light of the object, the brightness Y of the input image is expressed using the illumination light component L and the reflectance component R as below.
Y=R×L (4)
Let Y′ represent the brightness of an image, L′ represent an illumination light component L, and R′ represent a reflectance component, subsequent to the gradation conversion, and the brightness Y′ of the image is expressed as below.
Y′=R′×L′ (5)
In the present embodiment, the gradation conversion is performed so that only the illumination light component L of the input image is compressed with the reflectance component R maintained. More specifically, the gradation conversion is simply performed so that the reflectance component R remains unchanged at the gradation conversion, and it is thus sufficient if the relationship expressed by the following Expression (6) holds.
R=R′ (6)
If the reflectance component is eliminated from Expressions (4) through (6), the following Expression results.
Y′=Y×L′/L (7)
The brightness Y of the image subsequent to the gradation conversion is expressed by only the brightness Y of the input image, the illumination light component L, and the illumination light component L′ of the image subsequent to the gradation conversion. If the illumination light component L′ subsequent to the gradation conversion is defined, the gradation conversion process may be performed with the reflectance component maintained without the need to calculate the reflectance component.
Next, the definition of the illumination light component L′ is described. In the present embodiment, the L compression unit 35 of
Referring to
The compression process may be performed on a color image having RGB values. Pixel values R′G′B′ subsequent to the gradation conversion are obtained by multiplying the pixel values RGB of the input image by L′/L as expressed by the following Expressions (8) through (10).
R′=R×L′/L (8)
G′=G×L′/L (9)
B′=B×L′/L (10)
Y′ is calculated in accordance with R′G′B′ and Expression (1) as below.
This expression satisfies Expression (7).
If the brightness Y is defined as a maximum value of RGB values, Expression (7) is also satisfied. The brightness Y as the maximum value of the RGB values provides the following effect in a high saturation region. For example, the brightness Y of a pixel having a high saturation, for example, having RGB values (R,G,B)=(10, 10, 255), is calculated in accordance with Expression (1). Then, Y=38, and if the maximum value of the RGB values are used, Y=255. If the brightness Y is calculated in accordance with Expression (1) to brighten a dark portion in the gradation conversion process, a process to brighten the dark portion is performed, and the B value is already saturated. In this case, there is a possibility that only the R and G values are increased and that the saturation is decreased. On the other hand, if the maximum value of the RGB value is used as the brightness Y, the pixel is treated as a saturated and bright pixel, and the brightness is restrained. The saturation is not decreased. Therefore, if the gradation conversion process is performed in accordance with Expressions (8) through (10), it is preferable that the maximum value of the RGB values is used as the brightness Y.
The compression of the illumination light component in the gradation conversion process results in an image that is clear in the image from the dark portion to the light portion thereof. Since the difference in the value of the illumination light component L between adjacent pixels in a region where L is continuous is small, in other words, a difference in L′/L is also small between the adjacent pixels, the contrast between the adjacent pixels is maintained through the gradation conversion process. A high-quality image having a high contrast from the dark portion to the light portion thus results.
The filter size used in the illumination light component calculation is varied in response to the distance to the subject in the process of the L calculating unit 34 of
A filter of a size to at least modest degree is preferable because if the filter size is too small in the calculation of the illumination light component, the illumination light component may be insufficiently smoothed. However, if the filter size is large, a difference in distance of a subject at a long distance is difficult to detect even if the illumination light changes sharply in the actual space. As a result, the illumination light component is smoothed, and the edge is relaxed, causing halos. In fact, a calculation unit of distance information, such as an infrared sensor, or the left and right cameras CL and CR (i.e., stereo camera), provides a low calculation resolution at a long distance. For example, as illustrated by the graph 40 of
The calculation method of the illumination light component calculation of multiple subjects at long distances is described with reference to
Although the subject 102 and the subject 103 are present at different distances in the actual space, these two subjects are at the same distance in the input distance information as illustrated by the distance image 104 of
If the distance to the subject is long in the present invention, the filter size is reduced as illustrated by a filter 108 in an image 107 of
The possibility that a filter having a too small size causes the illumination light components not to be sufficiently smoothed has been discussed. Since a filtering region per unit filter size in the actual space expands more as the distance to the subject becomes longer. A sufficient region is filtered in the actual space with the distance to the subject being long even if the filter size is reduced.
This point is described further with reference to
The subject 111 is relatively compared in size with the filter 112. In
Described below with reference to
The use of the high-frequency component H of the input image leads to a further image quality improvement effect. The image pickup apparatus 1a of
The H adder 36 then adds the high-frequency component H of the input image calculated by the H calculating unit 31 to the image that has undergone the gradation conversion process to compress the illumination light component L. The contrast of the illumination light component L in the edge surrounding area is increased, leading to an increase in the image quality.
A still sufficient image quality improvement effect results without adding the illumination light component. In such a case, the H adder 36 is not included, and the output value from the L compression unit 35, namely, in the above example, the RGB values with the illumination light component compressed through the process of Expression (1), and Expressions (8) through (10), are simply output as an output image.
Even when the high-frequency component is to be added, the illumination light component may be increased as described in PTL 1 and then the high-frequency component may be added. However, if the high-frequency component is not to be added, an area that suffers from a decrease in contrast is limited to the edge surrounding area of the illumination light component and the contrast of the remaining area is maintained. If the increased high-frequency components are added, the advantages of the present invention are sufficiently provided by performing an adjustment so that the edge is not excessively accentuated.
In accordance with the present embodiment as described above, the illumination light component of the input image is calculated in view of the distance to the subject, the calculated illumination light component is compressed, and the gradation conversion process is performed to maintain the reflectance component. The input image is thus converted into an image with halos controlled and a high contrast from a dark portion to a light portion. By adding the high-frequency component of the input image, a high-quality image with an even higher contrast results.
The image pickup device having the image processing device that performs the image processing has been described as the first embodiment. The image processing device of the present invention (the image processing device 10 of
Only the images of the left and right cameras CL and CR may be input but the distance information may not be input. In such a case, the display device calculates the parallax of the left and right cameras CL and CR and uses the parallax as the distance information. The image processing device of the present invention may be included not only in the display device, but also in a personal computer (PC), a video device such as, blu-ray recorder. The image processing device thus converts the input image into a high-contrast output image with halos controlled.
Elements of the image processing apparatuses of the present invention, for example, nits 11 through 13 in the image processing device 10 of
A recording medium having recorded a program code of the software to implement the function of the above-described variety of configurations may be supplied to the display device, the PC, the recorder, and the like, and the microprocessor or the DSP in the device may execute the program code. The object of the present invention is thus achieved. In such a case, the program code itself of the software implements the functions of the variety of configurations. The present invention includes the program code itself, and the recording medium having stored the program code (an external recording medium and an internal storage device) on condition that a controller reads and executes the code. The external recording media include a variety of media including optical disks, such as CD, DVD, and BD, and a semiconductor memory such as a memory card. The internal storage devices include a hard disk and a semiconductor memory. The program code may be downloaded from the Internet, and then executed. Also, the program code may be received via a broadcast wave, and then executed.
Number | Date | Country | Kind |
---|---|---|---|
2011-128322 | Jun 2011 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2012/061058 | 4/25/2012 | WO | 00 | 11/25/2013 |