The present invention relates to a technology of obtaining an image having an improved gray scale (gradation) by synthesizing image data for a plurality of frames obtained by shooting an identical object with a different amount of exposure.
In a back light shooting condition under an open-air clear sky, an object luminance range within a scene (hereinafter, simply referred to as a “luminance range”) is widened. When the object having a wide luminance range is shot using a digital camera, the resulting scene may not be suitable for a dynamic range recordable by a photographic imaging system or an image signal processing system. In this case, a so-called shadow phenomenon in which an image is blocked up occurs in a dark portion of an image. Similarly, a so-called highlight phenomenon in which an image is blown out occurs in a bright portion of an image.
As a technique for avoiding such a phenomenon, there is known a high dynamic range (HDR) imaging technique (hereinafter, referred to as a “HDR technique”). In the HDR technique, a shooting is performed in a plurality of tries for an identical scene by changing a shutter speed so that a plurality of image data are obtained with a different amount of exposure. Then, a synthesis processing is performed such that a pixel value of the image data obtained with a relatively large amount of exposure is used in an area where a shadow phenomenon may occur in an image, and a pixel value of the image data obtained with a relatively small amount of exposure is used in an area where a highlight phenomenon may occur. As a result, it is possible to obtain an image in which a gray scale is appropriately reproduced from a dark portion to a bright portion.
Japanese Patent Application Laid-open No. 06-141229 (JP06-141229A) discloses a technique of obtaining two or more images with a different electric charge storing time, adding the two or more images by applying a weight depending on a signal level of each image, and compressing the obtained signal level having a wide dynamic range to a reference level.
In the technique disclosed in Japanese Patent Application Laid-open No. 06-141229, it is necessary to increase a bit width (bit depth) when a plurality of signals are synthesized. For this reason, a necessary hardware size increases. In order to address such a problem, Japanese Patent Application Laid-open No. 2004-266347 (JP2004-266347A) discloses a technique of suppressing increase of the bit width (number of bits) of the image signal by performing a process of non-linearly compressing a high level part of the image signal and then synthesizing a plurality of images with a predetermined weight.
According to an embodiment of the present invention, there is provided an image processing apparatus comprising: a gray-scale conversion characteristic deriving unit that sets a reference image out of a plurality of input images obtained by shooting an identical object with a different amount of exposure and derives a gray-scale conversion characteristic from the reference image; a normalizing unit that generates a correction image by correcting brightness of the reference image based on an amount of exposure of the reference image and an amount of exposure of a non-reference image other than the reference image; a position alignment processing unit that computes a positional deviation between the correction image and the non-reference image and generates a position alignment image by aligning a position of the non-reference image with respect to the reference image based on the positional deviation; and an image synthesis processing unit that derives a new pixel value for each pixel using a pixel value of a single or a plurality of images selected out of the reference image and the position alignment image based on the gray-scale conversion characteristic to generate a synthesized image.
According to another embodiment of the present invention, there is provided an image processing method comprising: setting a reference image out of a plurality of input images obtained by shooting an identical object with a different amount of exposure; deriving a gray-scale conversion characteristic from the reference image; generating a correction image by correcting brightness of the reference image based on an amount of exposure of the reference image and an amount of exposure of a non-reference image other than the reference image; computing a positional deviation between the correction image and the non-reference image and generating a position alignment image by aligning a position of the non-reference image with respect to the reference image based on the positional deviation; and deriving a new pixel value for each pixel using a pixel value of a single or a plurality of images selected from the reference image and the position alignment image based on the gray-scale conversion characteristic to generate a synthesized image.
According to still another embodiment of the present invention, there is provided a computer readable recording device having an image processing program encoded and recorded thereon in a computer readable format, the image processing program performing a process of generating a synthesized image having an improved gray scale by synthesizing a plurality of input images obtained by shooting an identical object with a different amount of exposure, wherein the image processing program causes a computer to execute a method comprising: a reference image setting step of setting a reference image out of a plurality of the input images; a gray-scale conversion characteristic deriving step of deriving a gray-scale conversion characteristic from the reference image; a normalizing step of generating a correction image by correcting brightness of the reference image based on an amount of exposure of the reference image and an amount of exposure of a non-reference image other than the reference image; a position alignment processing step of computing a positional deviation between the correction image and the non-reference image and generating a position alignment image by aligning a position of the non-reference image with respect to the reference image based on the positional deviation; and an image synthesis step of deriving a new pixel value for each pixel using a pixel value of a single or a plurality of images selected from the reference image and the position alignment image based on the gray-scale conversion characteristic to generate a synthesized image.
According to further another embodiment of the present invention, there is provided a photographic imaging apparatus having an image pickup unit capable of photoelectrically converting an object image formed by a photographic lens and outputting an image signal, the photographic imaging apparatus comprising: a shooting control unit that obtains a plurality of input images by shooting an identical object with a different amount of exposure, using the image pickup unit; a gray-scale conversion characteristic deriving unit that sets a reference image out of a plurality of the input images and derives a gray-scale conversion characteristic from the reference image; a normalizing unit that generates a correction image by correcting brightness of the reference image based on the amount of exposure of reference image and an amount of exposure of a non-reference image other than the reference image; a position alignment processing unit that computes a positional deviation between the correction image and the non-reference image and generates a position alignment image by aligning a position of the non-reference image with the reference image based on the positional deviation; and an image synthesis processing unit that derives a new pixel value for each pixel using a pixel value of a single or a plurality of images selected from the reference image and the position alignment image based on the gray-scale conversion characteristic to generate a synthesized image.
The foregoing and additional features and characteristics of this disclosure will become more apparent from the following detailed description considered with the reference to the accompanying drawings.
The digital camera 100 includes: a photographic optical system 110; a lens driving unit 112; an image pickup unit 120; an analog front end (denoted by “AFE” in
The lens driving unit 112, the image pickup unit 120, the analog front end 122, the image recording medium 130, the manipulation unit 140, the display unit 150, the memory unit 160, the CPU 170, and the DSP 190 are electrically connected to one another via a system bus 180. The RAM 164, the CPU 170, and the DSP 190 are accessible to one another.
The photographic optical system 110 forms an object image on a light-receiving area of the image pickup unit 120. The lens driving unit 112 performs a focal point adjustment operation of the photographic optical system 110. In a case where the photographic optical system 110 is a variable focal point optical system, the photographic optical system 110 may be driven by the lens driving unit 112 to change a focal length.
The image pickup unit 120 includes a shutter and an image pickup element. Object light transmitting through the photographic optical system 110 is incident to the image pickup element while the shutter is opened. The object image formed on the light-receiving area of the image pickup element is photoelectrically converted to generate an analog image signal. In a case where the image pickup element has a functionality of an electronic shutter capable of electrically controlling an exposure time (photoelectrical conversion time), the mechanical shutter may be dispensable. The analog image signal is input to the analog front end 122. The analog front end 122 performs noise reduction, signal amplification, analog/digital (A/D) conversion, and the like to generate a digital image signal. This digital image signal is temporarily stored in the RAM 164.
The DSP 190 applies various digital signal processings such as demosaicing, gray-scale conversion, color balance correction, shading correction, and noise reduction to the digital image signal temporarily stored in the RAM 164. In addition, the DSP 190 records the digital image signal in the image recording medium 130 or outputs the digital image signal to the display unit 150 as necessary.
The image recording medium 130 includes a flash memory, a magnetic recording device, and the like and is detachably installed in the digital camera 100. Alternatively, the image recording medium 130 may be integrated into the digital camera 100. In this case, an area for recording image data may be prepared inside the ROM 162 and may be used as the image recording medium 130.
The manipulation unit 140 includes any one of or a plurality of types including a push switch, a slide switch, a dial switch, a touch panel, and the like to receive user manipulation. The display unit 150 includes a thin-film transistor (TFT) liquid crystal display panel and a backlight unit, or a self-emissive type display device such as an organic electroluminescence display device to display information such as images, text, and the like. In addition, the display unit 150 has a display interface, so that the image data written to a video RAM (VRAM) area provided in the RAM 164 is read by the display interface to display information such as images or text on the display unit 150.
The ROM 162 includes a flash memory or the like and stores a control program (firmware) executed by the CPU 170, an adjustment parameter, information necessary to be stored while the digital camera 100 is powered off, and the like. The RAM 164 includes a synchronous dynamic RAM (SDRAM) or the like and is accessible at a relatively high speed. The CPU 170 analyzes and executes the firmware transmitted from the ROM 162 to the RAM 164 and generally controls the operation of the digital camera 100.
The DSP 190 applies various processings described above to the digital image signal temporarily stored in the RAM 164 to generate recording image data, display image data, and the like.
The digital camera 100 is capable of executing an operation of shooting a still image in a high dynamic range (HDR) shooting mode. That is, the digital camera 100 may be operated such that a plurality of image data are obtained by shooting an identical object with a different amount of exposure, and synthesized image data having an improved gray scale (gradation or tone) are created from a plurality of the image data. Naturally, the digital camera 100 may perform a moving picture shooting in the HDR shooting mode. In this case, the shooting is performed by changing the amount of exposure at a frame rate greater than the recording frame rate of the moving picture, and image data for a single frame is created from a plurality of the obtained image data so that created image data is recorded. By the way, it is desirable that the shooting is performed using the same composition when the identical object is shot with a different amount of exposure as described above. That is, in order to obtain better quality synthesized image data, it is desirable that a plurality of images obtained through a series of shootings have the same scene except that the amount of exposure is different. However, in some cases, a shooting range may slightly change during the shooting operation if the handheld shooting is performed, or a position or shape of the object may change within the scene if the object is movable. In such cases, processings such as position alignment, image cutting, or pasting may be performed based on a pattern matching technique to synthesize an image.
When the shooting operation is performed by changing the amount of exposure as described above, the CPU 170 as an image pickup control unit controls the image pickup unit 120 such that a determined number of exposure processes are performed with the amount of exposure determined for each exposure process. That is, the CPU 170 controls the image pickup unit 120 such that the identical object is shot with a different amount of exposure to obtain a plurality of image data.
The digital camera 100 may have a plurality of photographic imaging systems, each of which includes the photographic optical system 110, the lens driving unit 112, the image pickup unit 120, and the like. In this case, it is possible to approximately simultaneously obtain images from each photographic imaging system with a different amount of exposure using a plurality of photographic imaging systems in response to a single release manipulation from a user. Using this configuration, it is possible to obtain a plurality of images with a different amount of exposure for each frame at the time of the moving picture shooting.
Alternatively, the digital camera 100 may include a plurality of image pickup units 120. In this case, in the digital camera 100, a beam splitter (optical path splitting member) may be disposed in the rear side of the photographic optical system 110, and the image pickup units 120 may be disposed on a plurality of optical paths split by the beam splitter. The beam splitter splits a light beam at an unequal splitting ratio. For example, in a case where the beam splitter splits and emits an input light beam into a pair of light beams, the beam splitter may be designed such that a ratio between a light amount of the light beam emitted along one optical path and a light amount of the light beam emitted along the other optical path is set to, for example, 1:4. In such a beam splitter configuration, a shutter speed (exposure time) or an aperture stop set in the photographic optical system 110 has the same exposure condition for each image pickup unit 120. However, the light amount of the object light incident to each image pickup unit 120 is different due to the effect of the beam splitter. As a result, it is possible to obtain a plurality of images with a different amount of exposure through a single shooting operation. In this configuration, it is possible to obtain a plurality of images with a different amount of exposure through a single exposure operation. Using this configuration, it is possible to obtain a plurality of images with a different amount of exposure for each frame at the time of the moving picture shooting.
In order to obtain a plurality of images with a different amount of exposure, any one of the three methods described above may be employed. That is, as a first method, the exposure operation is sequentially performed several times by changing the exposure condition. As a second method, different exposure conditions are set for each of the photographic imaging systems, and the shooting is performed approximately simultaneously. As a third method, the object light is guided to a plurality of image pickup elements at a different splitting ratio using the optical path splitting member disposed in the rear side of a single photographic optical system, so that a plurality of images with a different amount of exposure are obtained through a single exposure operation.
The memory 220 is a memory accessible at a relatively high speed, such as a double data rate (DDR) SDRAM. The subsidiary memory unit 230 includes a hard disc drive or a solid-state drive (SSD) having a relatively large storage capacity.
The memory card interface 250 is configured such that the memory card MC can be detachably installed. The image data created through a shooting operation using the digital camera and the like and stored in the memory card MC may be read to the computer 200 through the memory card interface 250. Alternatively, the image data in the computer 200 may be written to the memory card MC.
The optical disc drive 260 is configured to read data from the optical disc OD. Alternatively, the optical disc drive 260 may be configured to write data onto the optical disc OD as necessary.
The network interface 270 is configured to exchange information between the computer 200 and an external information processing apparatus such as a server connected via a network NW.
The display unit 280 includes a flat panel display device and the like to display text, icons, color images, and the like.
The image processing unit 300 is implemented by causing the CPU 210 to analyze and execute the image processing program loaded on the memory 220. This image processing program is encoded and recorded in a computer readable recording device (nonvolatile computer readable recording medium) such as a memory card MC or an optical disc OD using a computer readable format and is distributed to a user of the computer 200. Alternatively, the image processing program downloaded from an external information processing apparatus such as a server via a network NW may be stored in the subsidiary memory unit 230. Alternatively, the image processing program may be downloaded from an external information processing apparatus and the like through other types of wired/wireless interfaces and may be stored in the subsidiary memory unit 230.
The image processing unit 300 executes the following image processing for the image data stored in the subsidiary memory unit 230 or the image data input through the memory card MC, the optical disc OD, the network NW, and the like. Hereinafter, the processing in the image processing unit 300 according to first and second embodiments will be described.
The image processing unit 300 includes a gray-scale conversion characteristic deriving unit 310, an image synthesis processing unit 320, and an image acquisition unit 330. The image recording unit 360 connected to the image processing unit 300 corresponds to the image recording medium 130 and the subsidiary memory unit 230 described above in conjunction with
The image acquisition unit 330 obtains a plurality of input image data by shooting an identical object with a different amount of exposure. In order to obtain a plurality of input image data with a different amount of exposure, any one of the three methods described above may be employed. In the following description, it is assumed that the first method is employed, in which exposure is sequentially performed several times by changing the exposure condition. Hereinafter, the case where an identical object is sequentially shot several times with a different amount of exposure will be referred to as “exposure bracketing.” In this exposure bracketing, the amount of exposure may be controlled by changing a length of the exposure time in order to obtain a plurality of images having the same motion blur or aberration. Alternatively, the amount of exposure may be controlled by changing the aperture stop value if an exposure change step (correction step) in the exposure bracketing is small so that a variation of the motion blur or aberration obtained by changing the aperture stop does not matter in most cases. Alternatively, in a case where a neutral density (ND) filter insertable/extractable to/from an optical path of the object light is provided inside the photographic optical system 110 and the like, the images with a different amount of exposure may be obtained through an insertion-extraction switching of the ND filter.
In a case where the image processing unit 300 is implemented by the DSP 190 of the digital camera 100, the image acquisition unit 330 may obtain a plurality of input image data as follows. Specifically, the digital image signal is sequentially output from the analog front end 122 while exposure bracketing is performed in the digital camera 100. The image acquisition unit 330 may obtain a plurality of input image data obtained by causing the DSP 190 to process the digital image signal. Alternatively, the image acquisition unit 330 may obtain the input image data by reading a plurality of input image data recorded in the image recording unit 360 (image recording medium 130) through exposure bracketing in the past. In any case, the input image data may be obtained from so-called raw image data. In addition, the input image data may be image data having any format such as a red/green/blue (RGB) format or a luminance/chroma-blue/chroma-red (YCbCr) format subjected to a development process.
The number of input image data obtained by the image acquisition unit 330 may be set to any number n equal to or greater than 2. This number n may be a fixed value or a user definable value or may be automatically set based on a result obtained by detecting a luminance (brightness) distribution in an object image during a shooting preparation operation (during a live-view display operation). For example, in a case where a difference between the maximum luminance and the minimum luminance within an object image is relatively small as in a front light photographic condition under a cloudy sky, the number of exposure (number of input image data) in the exposure bracketing may be set to a relatively small value. In contrast, in a case where a difference between the maximum luminance of the brightest portion and the minimum luminance of the darkest portion within an object image is relatively large as in a back light photographic condition under a clear sky or a night scene, the number of exposure in the exposure bracketing may be set to a relatively large value. In this case, the correction step may be arbitrarily set by a user or may be automatically set.
In the following description, a plurality of input image data are referred to as input image data 1, input image data 2, input image data 3, . . . , and input image data n in the order of the amount of exposure (input image data 1 has a smallest amount of exposure). The amounts of exposure for obtaining input image data 1, input image data 2, input image data 3, . . . , and input image data n sequentially increase stepwise and are set to Ep(1), Ep(2), Ep(3), . . . , and Ep(n), respectively. For example, for convenient description purposes, assuming that the exposure correction step is set to 1 Ev, and the number of exposure is set to 5, the amounts of exposure may be set to +0 Ev (×1), +1 Ev (×2), +2 Ev (×4), +3 Ev (×8), and +4 Ev (×16) with respect to the smallest amount of exposure (That is, Ep(2)=2×Ep(1), Ep(3)=4×Ep(1), Ep(4)=8×Ep(1), and Ep(5)=16×Ep(1)).
From such input image data, a pixel value P(i, j) is obtained for a pixel position (i, j). Here, assuming that the number of pixels of an image in a vertical direction is set to Mv, and the number of pixels in a horizontal direction is set to Mh, i denotes an integer from 0 to (Mv−1), and j denotes an integer from 0 to (Mh−1). Hereinafter, pixel values of input image data 1, input image data 2, . . . , and input image data n in a predetermined pixel position (i, j) will be denoted by P1(i, j), P2(i, j), . . . , and Pn(i, j), respectively. In addition, input image data 1, input image data 2, . . . , and input image data n will be collectively denoted by input image data 1 to n. It is noted that the exposure correction step or the number of exposure described above may be arbitrarily set depending on an object or a purpose of a photographic work. In the exposure correction step, the amount of exposure may be set to change at an equal or unequal interval.
The gray-scale conversion characteristic deriving unit 310 selects one of a plurality of input image data 1 to n obtained by the image acquisition unit 330 as reference image data (data of a reference image R) and analyzes the reference image data to derive a gray-scale conversion characteristic (gradation conversion characteristic). Various methods may be employed to select the reference image data. For example, the input image data obtained with the smallest amount of exposure out of a plurality of input image data obtained through a series of exposure bracketing processes may be set to the reference image data. Alternatively, the input image data obtained with an intermediate amount of exposure or the input image data obtained with the largest amount of exposure may also be set as the reference image data. Alternatively, a histogram for a plurality of input image data may be analyzed, and the input image data in which the center of the pixel value distribution is not excessively biased to a bright side or a dark side may be set to the reference image data. According to the present embodiment, it is assumed that the image data (input image data 1) obtained with the smallest amount of exposure is set to the reference image data. The pixel value R(i, j) of the reference image R becomes P1(i, j). The gray-scale conversion characteristic deriving unit 310 derives gray-scale conversion characteristic information corresponding to each pixel included in the reference image data based on the derived gray-scale conversion characteristic. The gray-scale conversion characteristic and the gray-scale conversion characteristic information will be described in detail below.
The reference image data is input to the gray-scale conversion characteristic deriving unit 310, the normalizing unit 410, and the image synthesis processing unit 320. The non-reference image data 2, . . . , and n as input image data other than the reference image data (data of non-reference images U2, . . . , and Un) are input to the position alignment processing unit 420. The input image data 2, the input image data 3, . . . , and the input image data n are set as non-reference image data 2, non-reference image data 3, . . . , and non-reference image data n, respectively. A pixel value Ux(i, j) of the non-reference image Ux becomes Px(i, j). Here, x denotes an integer from 2 to n.
Since the amount of exposure of the reference image R is different from that of each non-reference image Ux, the normalizing unit 410 corrects the reference image R corresponding to the reference image data, generates correction image data 2, . . . , and correction image data n for the correction images A2, . . . , and An, and inputs correction image data 2, . . . , and correction image data n to the position alignment processing unit 420. The normalizing unit 410 corrects brightness (pixel value) of the reference image R based on a ratio Ep(x)/Ep(1) between the amount of exposure Ep(1) of the reference image R and the amount of exposure Ep(x) of the non-reference image U. As described in the following Equation (1), the pixel value Ax(i, j) of the correction image Ax (where, x=2 to n) is obtained by multiplying Ep(x)/Ep(1) and the pixel value R(i, j) of the reference image R.
The position alignment processing unit 420 generates a position alignment image Qx (where, x=2 to n) by aligning a position of each non-reference image Ux with the reference image R. Since the amount of exposure of the reference image R is different from that of the non-reference image Ux, the position alignment processing unit 420 computes a positional deviation between the correction image Ax subjected to correction of brightness of the reference image R and the non-reference image Ux and aligns a position of the non-reference image Ux with the reference image R based on the computed positional deviation. For example, the position alignment processing unit 420 computes a positional deviation between the correction image Ax and the non-reference image Ux as a motion vector using a block matching method and modifies the non-reference image Ux based on the motion vector to generate the position alignment image Qx. The position alignment processing unit 420 inputs data of the position alignment images Q2, . . . , and Qn (position alignment image data 2, . . . , and position alignment image data n) to the image synthesis processing unit 320. Hereinafter, the reference image R and the position alignment images Q2, . . . , and Qn are often referred to as original images W1, . . . , and Wn used in the processing of the image synthesis processing unit 320. The original image W1 corresponds to the reference image R, and the original images W2, . . . , and Wn correspond to the position alignment images Q2, . . . , and Qn, respectively.
The image synthesis processing unit 320 generates a synthesized image S from a single or a plurality of images selected from the original images W1, . . . , and Wn (corresponding to the reference image R and the position alignment images Q2, . . . , and Qn). The image synthesis processing unit 320 compares the gray-scale conversion characteristic information (values regarding the gray-scale conversion characteristic) G(i, j) and the threshold value TH1 to THn. In addition, the image synthesis processing unit 320 selects a single or a plurality of images from the original images W1, . . . , and Wn depending on the comparison result and performs correction or weighted-averaging (weighted sum) for the selected image. The image synthesis processing unit 320 sets the threshold value THk (integer k=1 to n) based on the amount of exposure Ep(1) of the reference image R and the amount of exposure Ep(k) of each non-reference image Uk. According to the present embodiment, the threshold value THk (where, integer k=1 to n) is a ratio Ep(k)/Ep(1) of the amount of exposure between the reference image R and each non-reference image Uk. For example, in a case where a value of the gray-scale conversion characteristic information G(i, j) is between a pair of threshold values THk−1 and THk, the image synthesis processing unit 320 mixes pixel values (a pair of pixel values Wk−1(i, j) and Wk(i, j)) of the corresponding pixel position (i, j) out of a pair of the selected original images Wk−1 and Wk at a certain mixing ratio (weight) by weighted-averaging them. The mixing ratio is derived based on a relationship between a value of the gray-scale conversion characteristic information G(i, j) and a pair of threshold values THk−1 and THk.
The gray-scale conversion characteristic may be set such that a value of gray-scale conversion characteristic information G(i, j) tends to decrease as the pixel value R(i, j) of the reference image data increases. That is, a high value of gray-scale conversion characteristic information G(i, j) is derived for a low (dark) pixel value R(i, j), and a low value of gray-scale conversion characteristic information G(i, j) is derived for a high (bright) pixel value R(i, j). For example, the derived gray-scale conversion characteristic may be a so-called reversed-S characteristic as illustrated in the graph in the center of
According to the present embodiment, the value of the gray-scale conversion characteristic information G(i, j) is an amplification factor (magnification) of the pixel value before and after the gray-scale conversion. For example, as described above, in a case where exposure bracketing is performed five times at 1 Ev in the exposure correction step, exposure is performed at a amplification factor of ×1 (+0 Ev) to ×16 (+4 Ev) for the input image data 1 to input image data n with respect to the minimum amount of exposure (amount of exposure of the input image data 1). The value of the gray-scale conversion characteristic information G(i, j) is preferably set according to a ratio range of the amount of exposure of ×1 to ×16. That is, the amplification factor G(i, j) is preferably set to a value equal to or greater than 1 and equal to or smaller than 16 (or a slightly wider range than that). As a result, the pixel value of the amplification factor G(i, j) can be generated from a pixel value of the original image with an amount of exposure close to G(i, j) times that of the reference image. In addition, in a case where the amplification factor G(i, j) is smaller than the threshold value TH1, the value of G(i, j) is reset by clipping to G(i, j)=TH1. In a case where the amplification factor G(i, j) is greater than the threshold value THn, the value of G(i, j) may be clipped to G(i, j)=THn and be reset.
The threshold values and the number thereof are set based on the exposure correction step and the number of exposure (number of input image data) of exposure bracketing such that appropriate original images W1, . . . , and Wn are selected based on a comparison result between the value of the derived gray-scale conversion characteristic information G(i, j) and the threshold values. According to the present embodiment, the number of threshold values is equal to the number of input image data. The threshold value THk (where, integer k=1 to n) means a ratio (Ep(k)/Ep(1)) between the reference image R and the amount of exposure of each non-reference image Uk. As a result, in a case where a large amplification factor, that is, a relatively large value of the gray-scale conversion characteristic information G(i, j) is set for a certain pixel, an original image W1, . . . , and Wn of a relatively large amount of exposure is selected. In addition, in a case where a relatively small value of gray-scale conversion characteristic information G(i, j) is set, an original image W1, . . . , and Wn of a small amount of exposure is selected.
According to the gray-scale conversion characteristic described above, the value of G(i, j) decreases as R(i, j) increases, and the value of gray-scale conversion characteristic information G(i, j) is set to the amplification factor, so that a pixel value of the synthesized image data can be set as described below. That is, in the reference image R, a relatively high amplification factor is set for a relatively dark pixel. Accordingly, an original image W1, . . . , and Wn (reference image R and position alignment images Q2, . . . , and Qn) having a relatively large amount of exposure is selected for a relatively dark pixel. As a result, it is possible to increase a gray scale in a shadow portion of an object and reduce noise influence. In contrast, a relatively small amplification factor is set for a relatively bright pixel in the image of the reference image data. Accordingly, an original image W1, . . . , and Wn having a relatively small amount of exposure is selected for a relatively bright pixel. As a result, it is possible to increase a gray scale in a highlight portion of the object. In this manner, it is possible to reproduce a gray scale for a luminance range wider than that of the object. In addition, it is possible to also reduce noise in a shadow portion. In this case, since the value of the gray-scale conversion characteristic information G(i, j) is treated as the amplification factor, it is possible to facilitate matching with the exposure correction step in the exposure bracketing and thus simplify the gray-scale conversion processing of the image data.
In the embodiment of the present invention, during the image synthesis processing, the pixel values of the synthesized image S are generated for each pixel position (i, j) using pixel values of a single or a plurality of images out of the original images W1, . . . , and Wn generated from a plurality of input image data 1 to input image data n obtained through a series of exposure bracketing processes. If each pixel value of the synthesized image S is generated in this manner, it is possible to obtain a synthesized image just like that subjected to gray-scale conversion. For this reason, a representation “gray-scale conversion characteristic” is employed herein.
Here, an exemplary method of deriving the gray-scale conversion characteristic using the gray-scale conversion characteristic deriving unit 310 will be described.
The gray-scale conversion characteristic information G(i, j) corresponding to each pixel value R(i, j) of the reference image data is derived based on the gray-scale conversion characteristic of
The method of deriving the gray-scale conversion characteristic described in conjunction with
The following method may be performed in the process of deriving the gray-scale conversion characteristic information G(i, j) described above. For example, a single gray-scale conversion characteristic may be derived for a single image based on the method described in conjunction with
For example, in the gray-scale conversion characteristic deriving unit 310, an image formed using the reference image data is divided into an arbitrary number of blocks in a grid shape along intersecting vertical and horizontal axes to establish a plurality of blocks. In the gray-scale conversion characteristic deriving unit 310, the processing described in conjunction with
In a case where the image processing unit 300 is integrated into a digital camera 100, the area for deriving the gray-scale conversion characteristic may be established by manipulating a touch panel and selecting a main object and the like while a user sees a live-view image displayed on the display unit 150. Alternatively, in a case where the image processing unit 300 is implemented using a computer 200, the area for deriving the gray-scale conversion characteristic may be set by manipulating a computer mouse and the like while a user sees an image displayed on the display unit 280. Using the gray-scale conversion characteristic derived for each area divided based on any one of the methods described above, it is possible to derive the gray-scale conversion characteristic information G(i, j) for the pixel value R(i, j) in each area of the reference image data in a space-variant manner.
In a case where the value of the gray-scale conversion characteristic information G(i, j) is smaller than the threshold value TH1, the reference image R (original image W1) is selected and corrected. For example, the pixel value S(i, j) of the synthesized image S may be derived based on the following Equation (2).
In a case where the value of the gray-scale conversion characteristic information G(i, j) is smaller than the threshold value TH1, the pixel value is derived using Equation (2). Therefore, as the value of the gray-scale conversion characteristic information G(i, j) decreases below the threshold value TH1, the pixel value S(i, j) also decreases. As a result, it is possible to widen a reproducible gray-scale range in a dark portion in an image. In addition, in a case where the pixel value S(i, j) is derived based on Equation (2), the threshold value TH1 may preferably be set to TH1=1. This is because continuity of the pixel value S(i, j) is obtained when the value of the gray-scale conversion characteristic information G(i, j) changes in the vicinity of “1,” so that it is possible to suppress a tone jump.
In a case where the value of the gray-scale conversion characteristic information G(i, j) is equal to or greater than the threshold value TH1 and equal to or smaller than the threshold value TH2, the reference image R (original image W1) and the position alignment image Q2 (original image W2) are selected. The pixel values R(i, j) and Q2(i, j) corresponding to a predetermined pixel position (i, j) out of the reference image R and the position alignment image Q2 are mixed using the following Equation (3) regarding weighted averaging to derive the pixel value S(i, j) of the pixel position (i, j) corresponding to the mixed synthesized image S.
As apparent from Equation (3), as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH1, the mixing ratio of the pixel value R(i, j) of the reference image R increases. The mixing ratio corresponds to a weight in the weighted averaging (weighted summing). In addition, when the value of the gray-scale conversion characteristic information G(i, j) is equal to the threshold value TH1, the mixing ratio of the pixel value R(i, j) of the reference image R becomes 100%, and the pixel value S(i, j) becomes equal to the pixel value R(i, j). In contrast, as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH2, the mixing ratio of the pixel value Q2(i, j) of the position alignment image Q2 increases. In addition, when the value of the gray-scale conversion characteristic information G(i, j) is equal to the threshold value TH2, the mixing ratio of the pixel value Q2(i, j) of the position alignment image Q2 becomes 100%, and the pixel value S(i, j) becomes equal to the pixel value Q2(i, j). A change of the mixing ratio of the pixel values R(i, j) and Q2(i, j) is illustrated in
In a case where the value of the gray-scale conversion characteristic information G(i, j) exceeds the threshold value TH2 and is equal to or smaller than the threshold value TH3, the position alignment images Q2 and Q3 are selected. The pixel values Q2(i, j) and Q3(i, j) corresponding to a predetermined pixel position (i, j) of the position alignment images Q2 and Q3 are mixed using the following Equation (4) regarding weighted averaging to derive the pixel value S(i, j) in the corresponding pixel position (i, j) of the synthesized image S.
As apparent from Equation (4), as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH2, the mixing ratio (weight) of the pixel value Q2(i, j) of the position alignment image Q2 increases. In addition, when the value of the gray-scale conversion characteristic information G(i, j) infinitely approaches the threshold value TH2, the mixing ratio of the pixel value Q2(i, j) of the position alignment image Q2 approaches 100%, and the pixel value S(i, j) becomes infinitely equal to the pixel value Q2(i, j). In contrast, as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH3, the mixing ratio of the pixel value Q3(i, j) of the position alignment image Q3 increases. In addition, when the value of the gray-scale conversion characteristic information G(i, j) is equal to the threshold value TH3, the mixing ratio of the pixel value Q3(i, j) of the position alignment image Q3 becomes 100%, and the pixel value S(i, j) becomes equal to the pixel value Q3(i, j).
Similarly, in a case where the value of the gray-scale conversion characteristic information G(i, j) exceeds the threshold value THn−1 and is equal to or smaller than the threshold value THn, the position alignment image Qn−1 and the position alignment image Qn are selected. The pixel values Q−1(i, j) and Qn(i, j) corresponding to a predetermined pixel position (i, j) of such position alignment images Qn−1 and Qn are mixed using the following Equation (5) regarding weighted averaging to derive the pixel value S(i, j) in the corresponding pixel position (i, j) of the synthesized image S.
As apparent from Equation (5), as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value THn−1, the mixing ratio (weight) of the pixel value Qn−1(i, j) of the position alignment image Qn−1 increases. In addition, as the value of the gray-scale conversion characteristic information G(i, j) infinitely approaches the threshold value THn−1, the mixing ratio of the pixel value Qn−1(i, j) of the position alignment image Qn−1 approaches 100%, and the pixel value S(i, j) becomes infinitely equal to the pixel value Qn−1(i, j). In contrast, as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value THn, the mixing ratio of the pixel value Qn(i, j) of the position alignment image Qn increases. In addition, when the value of the gray-scale conversion characteristic information G(i, j) is equal to the threshold value THn, the mixing ratio of the pixel value Qn(i, j) of the position alignment image Qn becomes 100%, and the pixel value S(i, j) becomes equal to the pixel value Qn(i, j).
As described above, when the value of the gray-scale conversion characteristic information G(i, j) is equal to the threshold value THn, the pixel value S(i, j) of the derived synthesized image S becomes equal to the pixel value Qn(i, j) of the position alignment image Qn. In addition, when the value of the gray-scale conversion characteristic information G(i, j) is taken from a range between a pair of neighboring threshold values THn−1 and THn, the pixel values Qn−1(i, j) and Qn(i, j) of the position alignment images Qn−1 and Qn are mixed at a mixing ratio derived based on a pair of the threshold values THn−1 and THn and the value of the gray-scale conversion characteristic information G(i, j).
For a general integer k (where, k=3 to n), in a case where the value of the gray-scale conversion characteristic information G(i, j) exceeds the threshold value THk−1 and is equal to or smaller than the threshold value THk, the position alignment images Qk−1 and Qk are selected. The pixel values Qk−1(i, j) and Qk(i, j) corresponding to a predetermined pixel position (i, j) of the position alignment images Qk−1 and Qk are mixed using the following Equation (6) regarding weighted averaging to derive the pixel value S(i, j) of the pixel position (i, j) corresponding to the synthesized image S.
In a case where the value of the gray-scale conversion characteristic information G(i, j) exceeds the threshold value THn, the position alignment image Qn is selected and corrected. For example, the pixel value S(i, j) may be derived based on the following Equation (7).
In a case where the gray-scale conversion characteristic information G(i, j) exceeds the threshold value THn, the pixel value is derived using Equation (7). Therefore, as the value of the gray-scale conversion characteristic information G(i, j) increases over the threshold value THn, the pixel value S(i, j) also increases. As a result, it is possible to widen a reproducible gray-scale range in a bright portion of an image. Even when the pixel value S(i, j) is derived using Equation (7), it is preferable that the threshold value TH1 be set to “1” for the same reason as that described in conjunction with Equation (2).
In step S100, the image processing unit 300 obtains the input image data 1 to n. In step S102, the image processing unit 300 sets several input image data out of the input image data 1 to n as the reference image data. In the present embodiment, it is assumed that the input image data 1 obtained using the smallest amount of exposure in a series of exposure bracketing processes is set to the reference image data.
In step S104, the image processing unit 300 analyzes the reference image data to create gray-scale conversion characteristic information G(i, j) corresponding to each pixel position (i, j). The gray-scale conversion characteristic information G(i, j) is treated as an amplification factor. Details of the sequence of creating the gray-scale conversion characteristic information G(i, j) are similar to those described above in conjunction with
In step S106, the image processing unit 300 computes the ratio Ep(x)/Ep(1) between the amount of exposure Ep(1) of the reference image R and the amount of exposure Ep(x) of each non-reference image Ux. In step S108, the image processing unit 300 generates a correction image Ax (where, x=2 to n) by correcting brightness of the reference image R based on the ratio Ep(x)/Ep(1) as described in conjunction with Equation (1). In step S110, the image processing unit 300 aligns a position of the non-reference image Ux with the reference image R based on a positional deviation between the correction image Ax and the non-reference image Ux to generate a position alignment image Qx. In step S112, the image processing unit 300 determines whether or not the position alignment images Qx are generated for overall image data x (where, x=2 to n). In a case where the position alignment images Qx are not generated for overall image data x, the routine returns to step S106, and steps S106 to S110 are repeated for the next image data x. In a case where the position alignment images Qx are generated for overall image data x, the routine advances to step S114.
In step S114, the image processing unit 300 compares values of the gray-scale conversion characteristic information G(i, j) in a predetermined pixel position (i, j) of the gray-scale conversion characteristic information G(i, j) generated in step S104 with the threshold values TH1 to THn. Specifically, the image processing unit 300 determines which one of Condition(1) to Condition(n+1) for the gray-scale conversion characteristic information G(i, j) described below is satisfied.
{Condition(1): G≦TH1, Condition(2): TH1<G≦TH2, . . . Condition(k): THk−1<G≦THk, . . . Condition(n): THn−1<G≦THn, and Condition(n+1): THn<G}
In step S116, the image processing unit 300 selects a single or a plurality of images out of the original images W1, . . . , and Wn (reference image R and position alignment image Q2, . . . , and Qn) depending on the satisfied condition regarding the gray-scale conversion characteristic information G(i, j). In addition, the image processing unit 300 generates the pixel value S(i, j) of the output image (synthesized image) S using the pixel value of a single or a plurality of the selected images in the pixel position (i, j). Details of step S116 will be described below.
In step S118, the image processing unit 300 determines whether or not the processing in steps S114 and S116 is performed for overall pixel positions (i, j). If it is determined NO in step S118, steps S114 to S116 are repeatedly processed. Otherwise, if it is determined YES in step S114, the image processing unit 300 performs a process of outputting synthesized image data S in step S120. As a result, the image based on the synthesized image data S is recorded on the image recording unit 360 of
If Condition(2) is satisfied, in step S116b, the image processing unit 300 generates the pixel value S(i, j) of the output image S by mixing pixel values of the reference image R and the position alignment image Q2 in the pixel position (i, j) at a mixing ratio based on the value of the gray-scale conversion characteristic information G(i, j) and the threshold values TH1 and TH2. That is, the image processing unit 300 computes Equation (3) described above.
If Condition(k) (where, k=3 to n) is satisfied, similar to steps S116c and S116d, the image processing unit 300 generate the pixel value S(i, j) of the output image S by mixing pixel values of the position alignment images Qk−1 and Qk in the pixel position (i, j) at a mixing ratio based on the value of the gray-scale conversion characteristic information G(i, j) and the threshold values THk−1 and THk. That is, the image processing unit 300 computes Equation (6) described above.
If Condition(n+1) is satisfied, similar to step S116e, the image processing unit 300 generates the pixel value S(i, j) of the output image S by correcting the pixel value of the position alignment image Qn in the pixel position (i, j) based on the value of the gray-scale conversion characteristic information G(i, j) and the threshold values TH1 and THn. That is, the image processing unit 300 computes Equation (7) described above.
(Effects and Advantages)
According to the first embodiment, the gray-scale conversion characteristic deriving unit 310 derives the gray-scale conversion characteristic G from the reference image R selected from a plurality of input images obtained by shooting an identical object with a different amount of exposure. The normalizing unit 410 generates the correction image Ax by correcting the brightness of the reference image based on the amount of exposure Ep(x) of the non-reference image Ux other than the reference image and the amount of exposure Ep(1) of the reference image. The position alignment processing unit 420 computes a positional deviation between the correction image Ax and the non-reference image Ux and generates the position alignment image Qx by aligning a position of the non-reference image with the reference image based on the positional deviation. The image synthesis processing unit 320 derives a new pixel value for each pixel using the pixel value of a single or a plurality of the selected images out of the reference image R and the position alignment images Qx based on the gray-scale conversion characteristic to generate a synthesized image S.
In this manner, the reference image R and the non-reference images Ux are set from a plurality of input images obtained with a different amount of exposure. A single or a plurality of images are selected out of the reference image R and the position alignment image Qx generated by aligning a position of the non-reference image Ux with the reference image R, and a new pixel value is derived for each pixel, so that an HDR image is generated as a synthesized image S. For this reason, it is possible to form a HDR image having a gray-scale conversion characteristic suitable for the scene. In this case, the pixel values R(i, j) and Qx(i, j) respectively corresponding to the reference image R and the position alignment image Qx represented using a predetermined bit depth are mixed (weighted-averaged) to obtain a corresponding pixel value S(i, j) of the synthesized image S represented using the same bit depth. For this reason, it is possible to perform a process of obtaining the synthesized image S without adding a bit depth. Accordingly, it is possible to perform the synthesis processing within a bit depth range of the synthesized image data finally obtained and thus suppress a hardware size from increasing. In addition, due to the position alignment described above, it is possible to suppress degradation of the synthesized image S caused by a time-dependent positional deviation of the input image.
In this case, if the gray-scale conversion characteristic is derived in a space-variant manner as described above, it is possible to perform an image synthesis processing with a gray-scale conversion characteristic suitable for each area within an image. In addition, the position alignment processing unit 420 may generate a plurality of position alignment images by aligning positions of a plurality of non-reference images with the reference image, and the image synthesis processing unit 320 may derive a new pixel value for each pixel using the pixel values of a single or a plurality of images selected out of a plurality of position alignment images based on the gray-scale conversion characteristic. As a result, it is possible to improve a dynamic range and obtain the synthesized image S with reduced degradation.
The gray-scale conversion characteristic deriving unit 310 derives an amplification factor for each pixel value of the reference image as a gray-scale conversion characteristic G. The image synthesis processing unit 320 selects two or more images out of the reference image and the position alignment image depending on the amplification factor and mixes the pixel values of the two or more selected images at a mixing ratio derived based on the amplification factor to derive a new pixel value. If an image is generated through such a mixing process, it is possible to suppress generation of a so-called artifact. That is, a change of brightness becomes smoother in the image formed from the synthesized image data. Therefore, it is possible to suppress generation of an abnormal phenomenon such as a tone jump in which a gray scale unnaturally changes in an image in which a tone delicately changes as in a human skin.
The image synthesis processing unit 320 sets the threshold value depending on the amount of exposure set when each of a plurality of input images is obtained. The image synthesis processing unit 320 mixes the pixel values of the two or more selected images at a mixing ratio derived based on the amplification factor and the threshold value. As a result, it is possible to further suppress an unnatural change of the gray scale in the image.
In the first try of step S210, the image processing unit 300 determines whether or not Condition(1) to Condition(3) regarding the gray-scale conversion characteristic information G(i, j) described above are satisfied based on a comparison result between the value of the gray-scale conversion characteristic information G(i, j) and the threshold values TH1 to TH3. If Condition(1) is satisfied, in step S212, the image processing unit 300 performs the same processing as that of step S116a to compute Equation (2) described above and outputs the result. If Condition(2) is satisfied, in step S214, the image processing unit 300 performs the same processing as that of step S116b to compute Equation (3) described above and output the result. If Condition(3) is satisfied, in step S216, the image processing unit 300 outputs the pixel value Q2(i, j) of the position alignment image Q2. If none of Condition(1) to Condition(3) is satisfied, the routine advances to step S220 without performing anything. In step S220, the image processing unit 300 determines whether or not the processing of step S210 is performed for overall pixel positions (i, j). If it is determined NO in step S220, the routine returns to step S210.
In the (x−1)th try of step S210, the image processing unit 300 determines whether or not Condition(x−1) to Condition(x+1) regarding the gray-scale conversion characteristic information G(i, j) described above are satisfied based on the comparison result between the value of the gray-scale conversion characteristic information G(i, j) and the threshold values THx−2 to THx+1. If Condition(x−1) is satisfied, in step S212, the image processing unit 300 directly outputs the pixel value S(i, j) obtained in the previous try of step S214. If Condition(x) is satisfied, the routine advances to step S214. In step S214, the image processing unit 300 mixes the output (Qx−1) of the previous try of step S216 and the pixel value of the position alignment image Qx at a mixing ratio based on the value of the gray-scale conversion characteristic information G(i, j) and the threshold values THx−1 and THx as described in the following Equation (8), and outputs the result as a pixel value S(i, j) of the output image S.
If Condition(x+1) is satisfied, in step S216, the image processing unit 300 outputs the pixel value Qx(i, j) of the position alignment image Qx. If none of Condition(x−1) to Condition(x+1) is satisfied, the routine advances to step S220 without performing anything.
According to the second embodiment, the image processing unit 300 dividingly executes the image synthesis processing in a plurality of tries. For this reason, a processing scale is reduced, and it is possible to reduce a memory capacity such as the memory unit 160.
For example, the position alignment/dissimilarity computation unit 420a sets a neighboring pixel area (3×3) with respect to the coordinates (i, j) and computes a sum of absolute differences SAD as the dissimilarity Dfx between the correction image Ax and the position alignment image Qx in the corresponding area based on the following Equation (9).
The image synthesis processing unit 320 selects a single or a plurality of images from the reference image R, the position alignment images Q2, . . . , and Qn, and the correction images A2, . . . , and An based on the value of the gray-scale conversion characteristic information G(i, j) and the threshold values TH1 to THn and generates the synthesized image S by correcting the selected images or performing weighted-averaging. For example, in a case where the value of the gray-scale conversion characteristic information G(i, j) is between a pair of threshold values THk−1 and THk (k>2), the image synthesis processing unit 320 generates the synthesized image S by selecting four images (a pair of position alignment images Qk−1 and Qk and a pair of correction images Ak−1 and Ak) and synthesizing the selected images based on the value of the gray-scale conversion characteristic information G(i, j), a pair of threshold values THk−1 and THk, and a pair of dissimilarities Dfk−1 and Dfk.
In a case where the value of the gray-scale conversion characteristic information G(i, j) is equal to or smaller than the threshold value TH1, the reference image R is selected and corrected. For example, the pixel value S(i, j) of the synthesized image S may be derived based on Equation (2) described above.
In a case where the value of the gray-scale conversion characteristic information G(i, j) is greater than the threshold value TH1 and is equal to or smaller than the threshold value TH2, the reference image R, the position alignment image Q2, and the correction image A2 are selected. The pixel values R(i, j), Q2(i, j), and A2(i, j) corresponding to a predetermined pixel position (i, j) out of the reference image R, the position alignment image Q2, and the correction image A2 are mixed using the following Equations (10) and (11). In addition, the pixel value S(i, j) corresponding to the synthesized image S in the pixel position (i, j) is derived.
As recognized by substituting Equation (10), Equation (11) also expresses the weighted average of the pixel value R(i, j) of the reference image R, the pixel value Q2(i, j) of the position alignment image Q2, and the pixel value A2(i, j) of the correction image A2.
Here, the pixel value B2(i, j) of the intermediate image B2 is obtained by weighted-averaging the pixel value Q2(i, j) of the position alignment image Q2 and the pixel value A2(i, j) of the correction image A2 based on the function F(Df2). As illustrated in
As apparent from Equation (11), in the pixel value S(i, j) of the synthesized image S, the mixing ratio of the pixel value R(i, j) of the reference image R increases as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH1. In contrast, the mixing ratio of the pixel value B2(i, j) of the intermediate image B2 increases as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH2. Therefore, in the pixel value S(i, j), the mixing ratio between the pixel value Q2(i, j) of the position alignment image Q2 and the pixel value A2(i, j) of the correction image A2 increases as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value TH2.
Similarly, for a general integer k (where, k=3 to n) in a case where the value of the gray-scale conversion characteristic information G(i, j) exceeds the threshold value THk−1 and is equal to or smaller than the threshold value THk, four images including the position alignment images Qk−1 and Qk and the correction images Ak−1 and Ak are selected. The pixel values Qk−1(i, j), Qk(i, j), Ak−1(i, j), and Ak(i, j) corresponding to a predetermined pixel position (i, j) of the position alignment images Qk−1 and Qk and the correction images Ak−1 and Ak are mixed using the following Equations (12), (13), and (14). In addition, the pixel value S(i, j) of the pixel position (i, j) corresponding to the synthesized image S is derived.
Equation (14) changes to Equation (15) by substituting Equations (12) and (13). As recognized from Equation (15), the weighted average of the pixel value Qk−1(i, j) of the position alignment image Qk−1, the pixel value Qk(i, j) of the position alignment image Qk, the pixel value Ak−1(i, j) of the correction image Ak−1, and the pixel value Ak(i, j) of the correction image Ak is also expressed.
Here, the pixel value Bk(i, j) of the intermediate image Bk is obtained by weighted-averaging the pixel value Qk(i, j) of the position alignment image Qk and the pixel value Ak(i, j) of the correction image Ak according to the function F(Dfk). As illustrated in
As apparent from Equation (14), in the pixel value S(i, j) of the synthesized image S, the mixing ratio of the pixel value Bk−1(i, j) of the intermediate image Bk−1 increases as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value THk−1. Therefore, as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value THk−1, the mixing ratio of the pixel value Qk−1(i, j) of the position alignment image Qk−1 and the pixel value Ak−1(i, j) of the correction image Ak−1 increases. In contrast, as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value THk, the mixing ratio of the pixel value Bk(i, j) of the intermediate image Bk increases. Therefore, as the value of the gray-scale conversion characteristic information G(i, j) approaches the threshold value THk, the mixing ratio of the pixel value Qk(i, j) of the position alignment image Qk and the pixel value Ak(i, j) of the correction image Ak increases.
In a case where the value of the gray-scale conversion characteristic information G(i, j) exceeds the threshold value THn, four images including the position alignment images Qn−1 and Qn and the correction images An−1 and An are selected. From the pixel values Qn−1(i, j), Qn(i, j), An−1(i, j), and An(i, j) corresponding to a predetermined pixel position (i, j) out of the position alignment images Qn−1 and Qn and the correction images An−1 and An, for example, the pixel value S(i, j) can be derived based on the following Equation (16).
In step S111, the image processing unit 300 computes the dissimilarity Dfx between the correction image Ax and the position alignment image Qx. In step S117, the image processing unit 300 selects a single or a plurality of images from the reference image R, the position alignment images Q2, . . . , and Qn, and the correction images A2, . . . , and An depending on a condition satisfied for the gray-scale conversion characteristic information G(i, j). In addition, the image processing unit 300 generates a pixel value S(i, j) of the output image (synthesized image) S using the pixel value at the pixel position (i, j) of a single or a plurality of the selected images.
If Condition(2) is satisfied, in step S117b, the image processing unit 300 generates the pixel value S(i, j) of the output image S by mixing the pixel values of the reference image R, the position alignment image Q2, and the correction image A2 at the pixel position (i, j) at a mixing ratio based on the value of the gray-scale conversion characteristic information G(i, j), the threshold values TH1 and TH2, and the dissimilarity Df2. That is, the image processing unit 300 computes Equations (10) and (11) described above.
In steps S117c and S117d, in a case where Condition(k) (where, k=3 to n) is satisfied, the image processing unit 300 generates the pixel value S(i, j) of the output image S by mixing the pixel values of the position alignment images Qk−1 and Qk and the pixel values of the correction images Ak−1 and Ak in the pixel position (i, j) at a mixing ratio based on the value of the gray-scale conversion characteristic information G(i, j), the threshold values THk−1 and THk, and the dissimilarities Dfk−1 and Dfk. That is, the image processing unit 300 computes Equations (13), (14), or (15) described above.
In step S117e, if Condition(n+1) is satisfied, the image processing unit 300 generate the pixel value S(i, j) of the output image S by mixing the pixel values of the position alignment images Qn−1 and Qn and the pixel values of the correction images An−1 and An in the pixel position (i, j) at a mixing ratio based on the value of the gray-scale conversion characteristic information G(i, j), the threshold values TH1, THn−1, and THn, and the dissimilarities Dfn−1 and Dfn. That is, the image processing unit 300 computes Equation (16) described above.
According to the third embodiment, a dissimilarity computation unit 420a computes a dissimilarity Df between the correction image and the non-reference image. The image synthesis processing unit 320 derives a new pixel value by selecting two or more images from the reference image, the position alignment image, and the correction image based on the amplification factor and mixing pixel values of the two or more selected images at a mixing ratio derived based on the amplification factor and the dissimilarity. As a result, it is possible to adjust the mixing ratio of the pixel value of the position alignment image based on the dissimilarity Df.
The image synthesis processing unit 320 mixes pixel values of the position alignment image and the correction image at a mixing ratio derived based on a predetermined function F regarding the dissimilarity Df. As a result, it is possible to adjust a contribution of the pixel value of the position alignment image and a contribution of the pixel value of the correction image for the pixel value of the synthesized image, depending on a positional deviation degree of the position alignment image with respect to the reference image.
The image synthesis processing unit 320 derives the mixing ratio of the position alignment image such that the mixing ratio of the position alignment image increases as the dissimilarity Df decreases. As a result, as the dissimilarity decreases, a contribution of the pixel value of the position alignment image increases. In contrast, as the dissimilarity increases, a contribution of the pixel value of the position alignment image to the pixel value of the synthesized image decreases. Accordingly, it is possible to prevent degradation of the synthesized image caused by a positional deviation of the position alignment image with respect to the reference image.
If Condition(1) is satisfied in the first try of step S210, in step S213, the image processing unit 300 performs the same processing as that of step S117a to compute Equation (2) described above and output the result. If Condition(2) is satisfied, in step S215, the image processing unit 300 performs the same processing as that of step S117b to compute Equations (10) and (11) described above and output the result. If Condition(3) is satisfied, in step S217, the image processing unit 300 mixes pixel values of the position alignment image Q2 and the correction image A2 to generate and output a pixel value of the intermediate image B2. If none of Condition(1) to Condition(3) is satisfied, the routine advances to step S220 without performing anything.
If Condition(x+1) is satisfied, in step S217, the image processing unit 300 generates a pixel value of the intermediate image Bx by mixing pixel values of the position alignment image Qx and the correction image Ax, and outputs the result. If none of Condition(x−1) to Condition(x+1) is satisfied, the routine advances to step S220 without performing anything.
According to the fourth embodiment, the image processing unit 300 dividingly executes the image synthesis processing in a plurality of tries. For this reason, the processing scale is reduced, so that it is possible to reduce a capacity of the memory such as the memory unit 160.
In the first to fourth embodiments described above, description has been made for an example in which a pair of input image data are selected based on the gray-scale conversion characteristic information G(i, j), and the pixel values of the input image data are mixed. However, the invention is not limited to such an example. That is, three or more input image data may be selected based on the gray-scale conversion characteristic information G(i, j), and pixel values of the selected input image data may be mixed.
In the first to fourth embodiments described above, the pixel values Pn(i, j) of the input image data have not been described in detail for simple and easy description purposes. However, the pixel values Pn(i, j) of the input image data may be given as described below. Specifically, in a case where the input image data is so-called RGB image data, the aforementioned processing may be applied to each pixel value of red, green, and blue as the pixel value Pn(i, j). In a case where the input image data is represented using a color space such as YCbCr or Lab, the aforementioned processing may be applied to each value of Y, Cb, Cr, L, a, and b as the pixel value Pn(i, j) or may be applied only to values Y and L as the pixel value Pn(i, j).
In the first to fourth embodiments described above, description has been made for an example in which the threshold values TH1 to THn are set automatically based on the number of exposure and the exposure correction step at the time of a series of exposure bracketing processes or manually by a user setup. In addition, description has been made for a fact that the gray-scale conversion characteristic can be derived in a space-variant manner, and the gray-scale conversion characteristic information G(i, j) can be derived from each of the derived gray-scale conversion characteristics. Alternatively, a single characteristic may be derived from overall reference image data as the gray-scale conversion characteristic, the gray-scale conversion characteristic information G(i, j) corresponding to each pixel position (i, j) may be derived, and the threshold values TH1 to THn may be set in a space-variant manner. In this case, the threshold values TH1 to THn set in a space-variant manner may be derived based on the number of exposure and the exposure correction step at the time of a series of exposure bracketing processes and a result of analyzing the reference image data. Although the threshold values TH1 to THn and the amplification factor G(i, j) as the gray-scale conversion characteristic information are expressed using an antilogarithmic representation in the first to fourth embodiments, they may be given by a logarithmic representation having a base of 2.
The image processing apparatus described above may be mounted on a digital camera, a digital movie camera capable of capturing a still image, a camera-equipped mobile phone, a personal digital assistant (PDA), a portable computer, and the like. The image processing apparatus may be implemented by causing a computer to execute the image processing program.
While embodiments of the present invention have been described, the present invention may be variously changed or modified without departing from the scope or spirit of the present invention. Those skilled in the art would appreciate that such changes and modifications are incorporated into the scope of the invention and equivalents thereof as apparent from the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2011-025122 | Feb 2011 | JP | national |
This application is a continuation of International Patent Application No. PCT/JP2011/77982, filed on Dec. 2, 2011, which claims the benefit of Japanese Patent Application No. JP 2011-25122, filed on Feb. 8, 2011, which are incorporated by reference as if fully set forth.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2011/077982 | Dec 2011 | US |
Child | 13949878 | US |