JP2008219230A - Imaging apparatus, and image processing method - Google Patents

Imaging apparatus, and image processing method Download PDF

Info

Publication number
JP2008219230A
JP2008219230A JP2007051141A JP2007051141A JP2008219230A JP 2008219230 A JP2008219230 A JP 2008219230A JP 2007051141 A JP2007051141 A JP 2007051141A JP 2007051141 A JP2007051141 A JP 2007051141A JP 2008219230 A JP2008219230 A JP 2008219230A
Authority
JP
Japan
Prior art keywords
image
histogram
exposure
images
entropy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007051141A
Other languages
Japanese (ja)
Inventor
Tetsuya Katagiri
哲也 片桐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2007051141A priority Critical patent/JP2008219230A/en
Publication of JP2008219230A publication Critical patent/JP2008219230A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To use entropy of each image generated from one image and having a different exposure as an index of visibility, without obtaining a plurality of images having different exposures by photographing. <P>SOLUTION: An imaging apparatus includes a generation means for generating, from one source image, the plurality of exposed images having different exposures by adding different gains to the source image; a differentiation means for differentiating the degree number of each column in a histogram corresponding to each of the plurality of exposed images according to the above gains; and a calculation means for calculating the entropy corresponding to each exposed image based on each histogram having the different degree number according to the gain. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、撮影画像各部の露出を適正化することが可能な撮像装置に関し、特に、この露出適正化処理においてエントロピーを用いる撮像装置及び画像処理方法に関するものである。   The present invention relates to an imaging apparatus capable of optimizing the exposure of each part of a captured image, and particularly to an imaging apparatus and an image processing method that use entropy in the exposure optimization process.

従来、画像の視認性を量る指標として、エントロピー(情報量)を用いてヒストグラムの広がりを求めることがある。このエントロピーをEc(カラー画像のエントロピー)とすると、Ecは以下の(1)式により与えられる。   Conventionally, as an index for measuring the visibility of an image, the spread of a histogram is sometimes obtained using entropy (amount of information). If this entropy is Ec (entropy of a color image), Ec is given by the following equation (1).

Figure 2008219230
但し、記号「i」は画像の画素値(0≦i<階調数N)を、記号Piは画素値iの出現確率を示している。また、記号「r」、「g」及び「b」はカラー画像における赤(R)、緑(G)及び青(B)を示している。
Figure 2008219230
Here, the symbol “i” indicates the pixel value (0 ≦ i <the number of gradations N) of the image, and the symbol Pi indicates the appearance probability of the pixel value i. Symbols “r”, “g”, and “b” indicate red (R), green (G), and blue (B) in the color image.

視認性の高い画像は、幅広い画素値を含むつまり画素値iがとる値の範囲が広いため、エントロピーが高くなる。一方、明るく飛んだ画像や暗くつぶれた画像は、ヒストグラムが偏るため相対的にエントロピーが低くなる。   An image with high visibility includes a wide range of pixel values, that is, the range of values taken by the pixel value i is wide, so that the entropy is high. On the other hand, the brightly flying image and the darkly crushed image have relatively low entropy because the histogram is biased.

<エントロピーを用いたダイナミックレンジ圧縮技術>
ところで、デジタルカメラ等の撮像装置による撮影に際して、撮影シーンの明るさが大きく変化するような場合、シャッタースピード等に拘わらず、画像に露出の偏り、すなわち画像中に露出オーバー或いは露出アンダーの部分が生じてしまうことがある。これに関し、画像のダイナミックレンジ(DR)圧縮として、露出の異なる複数枚の画像(多重露光画像)を合成する方法が提案されている。
<Dynamic range compression technology using entropy>
By the way, when shooting with an imaging device such as a digital camera, when the brightness of the shooting scene changes greatly, regardless of the shutter speed or the like, the image is unevenly exposed, that is, the image is overexposed or underexposed. May occur. In this regard, a method of synthesizing a plurality of images (multiple exposure images) with different exposures has been proposed as dynamic range (DR) compression of images.

この多重露光画像の合成の基準としてエントロピーを用いる方法が知られている。例えば非特許文献1には、異なる露出例えば異なるシャッタースピードで複数回撮影することで露出(露光量)の異なる複数枚の画像を取得し、この複数枚の画像から、画像各部の露出が補正された1枚の画像を生成する技術(Goshtasbyの手法)が開示されている。この技術では、多重露光画像それぞれを複数のブロック画像に分割し、各多重露光画像における同じ位置のブロック画像同士でエントロピーを比較して、最もエントロピー(情報量;平均情報量)が高いブロック画像を選択する。このように選択した各位置のブロック画像(それぞれエントロピーが最大)を合体して1枚の画像を作成する。ただし、単に合体するだけでは各ブロック画像の明るさ(輝度)が異なる、つまり各ブロック画像の繋ぎ目が不自然な所謂モザイク状の画像となるため、LPF(Low Pass Filter)等を用いた所謂ぼかし処理を行うことにより、各ブロック画像の画素値をブレンド(ブレンド処理;エントロピー・ブレンド処理ともいう)して自然な1枚の画像にする。   A method using entropy is known as a reference for the synthesis of this multiple exposure image. For example, in Non-Patent Document 1, a plurality of images with different exposures (exposure amounts) are acquired by photographing a plurality of times with different exposures, for example, different shutter speeds, and the exposure of each part of the image is corrected from the plurality of images. In addition, a technique for generating a single image (Gothasby method) is disclosed. In this technique, each multiple exposure image is divided into a plurality of block images, and the block images having the highest entropy (information amount; average information amount) are compared by comparing the entropy between the block images at the same position in each multiple exposure image. select. The block images (each having the maximum entropy) at the respective positions thus selected are combined to create one image. However, since the brightness (brightness) of the block images is different simply by combining them, that is, a so-called mosaic image in which the joints of the block images are unnatural, so-called using LPF (Low Pass Filter) or the like. By performing the blurring process, the pixel values of each block image are blended (blending process; also referred to as entropy / blending process) to form a natural image.

また、例えば特許文献1には、撮影によって露出オーバーの画像及び露出アンダーの画像(多重露光画像)を取得し、上記と同様にこれら画像が分割された各ブロック画像のエントロピーに基づいて、各多重露光画像の合成比率を決定する技術が開示されている。   Further, for example, in Patent Document 1, an overexposed image and an underexposed image (multi-exposure image) are acquired by photographing, and each multiple is based on the entropy of each block image obtained by dividing these images in the same manner as described above. A technique for determining a composite ratio of exposure images is disclosed.

また、例えば特許文献2には、1枚の画像から擬似的に多重露光画像を生成し、これら画像が分割された各ブロック画像における平均輝度値等のブロック値に基づいて、上記非特許文献1の方法と同様に多重露光画像のブレンド処理を行う技術が開示されている。
A.Goshtasby,”Fusion of Multi−Exposure Images”,Image and Vision Computing,vol.23,2005,pp.611−618 特開2004−229259号公報 特願2006−263026号公報
Further, for example, in Patent Document 2, pseudo multiple exposure images are generated from one image, and the above-mentioned Non-Patent Document 1 is based on block values such as average luminance values in each block image obtained by dividing these images. A technique for blending multiple exposure images in the same manner as in the above method is disclosed.
A. Gostasby, “Fusion of Multi-Exposure Images”, Image and Vision Computing, vol. 23, 2005, pp. 611-618 JP 2004-229259 A Japanese Patent Application No. 2006-263026

しかしながら、上記非特許文献1及び特許文献1の技術では、露出の異なる複数枚の画像(多重露光画像)をそれぞれ撮影する必要があり、この撮影に時間がかかってしまう。また、これら複数枚の画像間に被写体ブレが発生することもあり、これらから作成される画像の画質低下を招いてしまう。また、上記特許文献2の技術では、露出の異なる複数枚の画像を撮影する必要がないため当該撮影に時間がかかるという問題は発生しないものの、擬似的に生成した多重露光画像(擬似多重露光画像)のエントロピーを各多重露光画像に応じたエントロピーとして正しく求めることができず、エントロピーを視認性の指標として使用することができない。   However, in the techniques of Non-Patent Document 1 and Patent Document 1, it is necessary to capture a plurality of images (multiple exposure images) with different exposures, and this imaging takes time. In addition, subject blurring may occur between the plurality of images, resulting in a reduction in image quality of an image created from them. Further, in the technique disclosed in Patent Document 2, although it is not necessary to capture a plurality of images with different exposures, there is no problem that the imaging takes time, but a pseudo-multiple exposure image (pseudo multiple exposure image) is generated. ) Cannot be obtained correctly as the entropy corresponding to each multiple exposure image, and the entropy cannot be used as a visibility index.

具体的には、擬似多重露光画像を生成する場合、基本的に露出アンダーの画像(アンダー画像)にゲイン(デジタルゲイン)をかける、すなわち例えば図12に示すように、元画像I0(アンダー画像)に各種値のゲイン例えば1.5倍や2倍のゲインをかけることで擬似多重露光画像I1、I2を生成する。   Specifically, when generating a pseudo multiple exposure image, a gain (digital gain) is basically applied to an underexposed image (underimage), that is, as shown in FIG. 12, for example, an original image I0 (underimage). The pseudo multiple exposure images I1 and I2 are generated by applying gains of various values, for example, a gain of 1.5 times or 2 times.

図13は、元画像I0(左側図)と、これに2倍のゲインをかけてなる擬似多重露光画像I2(右側図)とのヒストグラムの一例であり、それぞれヒストグラムH1、H2とする。この場合、上記(1)式によりエントロピーEcを求めると、いずれの場合も結果(エントロピー値)は同じになる。これは、擬似多重露光画像I2ではヒストグラムH2がその各柱の間が空いた謂わば歯抜け状(櫛状)になっており、画素値(各柱の位置の画素値;横軸座標値)は元画像I0の場合と比べて2倍となっているが、その度数自体は変わらないため、発生確率は同じままであり、この発生確率の総和(=エントロピー)も変化しないことによる。   FIG. 13 is an example of a histogram of an original image I0 (left side figure) and a pseudo multiple exposure image I2 (right side figure) obtained by multiplying the original image I0 by a gain of two, which are referred to as histograms H1 and H2, respectively. In this case, when entropy Ec is obtained by the above equation (1), the result (entropy value) is the same in any case. This is because, in the pseudo multiple exposure image I2, the histogram H2 has a so-called tooth-like shape (comb shape) in which each column is open, and the pixel value (pixel value at each column position; horizontal axis coordinate value). Is twice that of the original image I0, but the frequency itself does not change, so the occurrence probability remains the same, and the total occurrence probability (= entropy) does not change.

本発明は、上記事情に鑑みてなされたもので、露出の異なる複数枚の画像(多重露光画像)それぞれを撮影する必要がなく、これら複数枚の画像間の被写体ブレの発生が防止されるとともに、1枚の画像から生成した露出の異なる各画像のエントロピーを各画像に応じたエントロピーとして求めることができ、エントロピーを視認性の指標として使用することが可能な撮像装置及び画像処理方法を提供することを目的とする。   The present invention has been made in view of the above circumstances, and there is no need to shoot each of a plurality of images (multiple exposure images) with different exposures, and subject blurring between the plurality of images is prevented. Provided are an imaging apparatus and an image processing method capable of obtaining entropy of images with different exposures generated from a single image as entropy corresponding to each image and using the entropy as a visibility index. For the purpose.

本発明に係る撮像装置は、1つの元画像から、該元画像に異なるゲインをかけることで露出の異なる複数の露出画像を生成する生成手段と、前記ゲインに応じて、前記複数の露出画像それぞれに対応するヒストグラムの各柱の度数を異ならせる差異手段と、前記ゲインに応じて各柱の度数が異なる各ヒストグラムに基づいて、各露出画像に対応するエントロピーをそれぞれ算出する算出手段とを備えることを特徴とする。   The imaging apparatus according to the present invention includes a generating unit that generates a plurality of exposure images with different exposures by applying different gains to the original image from one original image, and each of the plurality of exposure images according to the gain. Difference means for differentiating the frequency of each column of the histogram corresponding to, and a calculation means for calculating entropy corresponding to each exposure image based on each histogram in which the frequency of each column differs according to the gain. It is characterized by.

上記構成によれば、生成手段によって、1つの元画像から、該元画像に異なるゲインをかけることで露出の異なる複数の露出画像が生成され、差異手段によって、ゲインに応じて、複数の露出画像それぞれに対応するヒストグラムの各柱の度数が異ならせられ、算出手段によって、ゲインに応じて各柱の度数が異なる各ヒストグラムに基づいて、各露出画像に対応するエントロピーがそれぞれ算出される。すなわち、各露出画像が1つの画像から作成されるので、露出の異なる複数枚の画像(多重露光画像)それぞれを撮影する必要がなく、これら複数枚の画像間の被写体ブレの発生が防止される。また、各露出画像のヒストグラムの各柱の度数がゲインに応じて異なるものとなるので、これらヒストグラムから求めたエントロピーも各露出画像で異なるものとなる(各露出画像のエントロピーに差異が生じる)。したがって、1つの画像から生成された各露出画像のエントロピーを各露出画像に応じたエントロピーとして求めることができ、エントロピーを視認性の指標として使用することができるため、ひいては、例えばこのエントロピーの情報を用いて、複数の露出画像から露出やコントラストが適正化された高画質な1つの画像を得るといったことが可能となる。   According to the above configuration, a plurality of exposure images with different exposures are generated by applying different gains to the original image from one original image by the generation unit, and a plurality of exposure images are generated by the difference unit according to the gain. The frequency of each column of the histogram corresponding to each is made different, and the entropy corresponding to each exposure image is calculated based on each histogram in which the frequency of each column differs according to the gain. That is, since each exposure image is created from one image, there is no need to shoot a plurality of images (multi-exposure images) with different exposures, and subject blurring between the plurality of images can be prevented. . In addition, since the frequency of each column in the histogram of each exposure image differs depending on the gain, the entropy obtained from these histograms also differs in each exposure image (the difference in entropy of each exposure image occurs). Therefore, the entropy of each exposure image generated from one image can be obtained as the entropy corresponding to each exposure image, and the entropy can be used as an indicator of visibility. By using it, it becomes possible to obtain one image with high image quality with appropriate exposure and contrast from a plurality of exposed images.

また、上記構成において、前記差異手段は、前記各露出画像に対応する、前記元画像の各画素値が前記ゲイン倍されることで各柱間に隙間が空いた状態の間欠状ヒストグラムを、該柱間の隙間がなくなるように補間することが好ましい(請求項2)。   Further, in the above configuration, the different means includes an intermittent histogram in which a gap is formed between each column by multiplying each pixel value of the original image corresponding to each exposure image by the gain. It is preferable to interpolate so that there is no gap between the columns (claim 2).

これによれば、差異手段によって、各露出画像に対応する、元画像の各画素値がゲイン倍されることで各柱間に隙間が空いた状態の間欠状ヒストグラムが、該柱間の隙間がなくなるように補間されるので、当該補間という簡易な方法を用いて、ゲインに応じて度数が異なる各露出画像のヒストグラムを容易に得ることができる。   According to this, an intermittent histogram in which a gap is left between columns by multiplying each pixel value of the original image corresponding to each exposure image by a gain by the difference means, a gap between the columns is obtained. Since interpolation is performed so as to disappear, it is possible to easily obtain a histogram of each exposure image having a frequency different depending on the gain by using a simple method called interpolation.

また、上記構成において、前記各露出画像を複数の部分画像に分割する分割手段と、前記各露出画像の同位置での部分画像それぞれに対応する、前記算出手段により算出された各エントロピーのうちから、最大のエントロピーを選択する選択手段と、前記最大のエントロピーを有する部分画像同士を合成する合成手段とをさらに備えることが好ましい(請求項3)。   Further, in the above-described configuration, from among the entropy calculated by the calculating unit corresponding to the dividing unit that divides each exposed image into a plurality of partial images and each partial image at the same position of each exposed image. It is preferable that the apparatus further comprises selection means for selecting the maximum entropy, and combining means for combining the partial images having the maximum entropy.

これによれば、分割手段によって、各露出画像が複数の部分画像に分割され、選択手段によって、各露出画像の同位置での部分画像それぞれに対応する、算出手段により算出された各エントロピーのうちから、最大のエントロピーが選択される。そして、合成手段によって、最大のエントロピーを有する部分画像同士が合成されるので、エントロピーの情報を利用して、複数の露出画像から、画像各部(各部分画像)のエントロピーがいずれも最大となる1つの合成画像、すなわち露出やコントラストが適正化された高画質な画像を得ることができる。   According to this, each exposure image is divided into a plurality of partial images by the dividing means, and each of the entropies calculated by the calculating means corresponding to each partial image at the same position of each exposure image by the selecting means. The maximum entropy is selected. Then, since the partial images having the maximum entropy are combined by the combining means, the entropy of each part of the image (each partial image) is maximized from the plurality of exposed images using the entropy information 1 Two composite images, that is, high-quality images with appropriate exposure and contrast can be obtained.

また、上記構成において、前記ヒストグラムは、横軸座標が階調値に対応する画素値で且つ縦軸座標が度数であるヒストグラムであり、前記差異手段は、前記複数の露出画像それぞれに対応するヒストグラムを作成する作成手段であって、当該ヒストグラムの作成に際して前記横軸座標を前記ゲインに応じて縮小することが好ましい(請求項4)。   Further, in the above configuration, the histogram is a histogram in which a horizontal axis coordinate is a pixel value corresponding to a gradation value and a vertical axis coordinate is a frequency, and the difference means is a histogram corresponding to each of the plurality of exposure images. Preferably, the horizontal axis coordinates are reduced in accordance with the gain when the histogram is generated.

これによれば、ヒストグラムが、横軸座標が階調値に対応する画素値で且つ縦軸座標が度数であるヒストグラムとされる。そして、差異手段が、複数の露出画像それぞれに対応するヒストグラムを作成する作成手段とされ、この差異手段によって、当該ヒストグラムの作成に際して横軸座標がゲインに応じて縮小される。すなわち、単に、ゲインに応じて縮小された横軸座標を有するヒストグラムを作成するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   According to this, the histogram is a histogram in which the horizontal coordinate is a pixel value corresponding to the gradation value, and the vertical coordinate is the frequency. Then, the difference unit is a generation unit that generates a histogram corresponding to each of the plurality of exposure images, and the horizontal axis coordinate is reduced according to the gain when the histogram is generated by the difference unit. In other words, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of simply creating a histogram having the horizontal axis coordinates reduced according to the gain.

また、上記構成において、前記元画像の階調数をNとし、前記ゲインをGとすると、前記作成手段は、最大階調値がN/Gである前記横軸座標を有した前記ヒストグラムを作成することが好ましい(請求項5)。   Further, in the above configuration, when the number of gradations of the original image is N and the gain is G, the creation unit creates the histogram having the horizontal axis coordinate having a maximum gradation value of N / G. (Claim 5).

これによれば、作成手段によって、最大階調値がN/Gである横軸座標を有したヒストグラムが作成されるので、ゲインに応じて縮小された横軸座標を有するヒストグラムを容易に作成することができる。   According to this, a histogram having a horizontal axis coordinate having a maximum gradation value of N / G is created by the creating means, and therefore a histogram having a horizontal axis coordinate reduced according to the gain is easily created. be able to.

また、上記構成において、前記作成手段は、前記元画像の各画素値を前記Gの値で除算し、該除算により得られる整数値に対応する前記横軸座標における画素値の度数をカウントすることが好ましい(請求項6)。   In the above configuration, the creation unit divides each pixel value of the original image by the G value, and counts the frequency of the pixel value in the horizontal coordinate corresponding to the integer value obtained by the division. (Claim 6).

これによれば、作成手段によって、元画像の各画素値がGの値で除算され、該除算により得られる整数値に対応する横軸座標における画素値の度数がカウントされるので、このように簡易な度数のカウント方法を用いて、最大階調値がN/Gである横軸座標を有したヒストグラムを元画像から容易に作成することができる。   According to this, each pixel value of the original image is divided by the value of G by the creating means, and the frequency of the pixel value in the horizontal axis coordinate corresponding to the integer value obtained by the division is counted. Using a simple frequency counting method, a histogram having horizontal axis coordinates with a maximum gradation value of N / G can be easily created from the original image.

また、上記構成において、前記差異手段は、前記エントロピーの算出前に、前記各露出画像を空間的に平滑化する画像平滑化手段であることが好ましい(請求項7)。   In the above configuration, it is preferable that the difference unit is an image smoothing unit that spatially smoothes each exposed image before calculating the entropy.

これによれば、差異手段が、エントロピーの算出前に、各露出画像を空間的に平滑化する画像平滑化手段とされるので、すなわち画像平滑化手段によって各露出画像が空間的に平滑化されるので、この平滑化された各露出画像から作成したヒストグラムが、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像を空間的に平滑化するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   According to this, since the different means is an image smoothing means for spatially smoothing each exposure image before entropy calculation, that is, each exposure image is spatially smoothed by the image smoothing means. Therefore, the histogram created from each of the smoothed exposure images becomes a histogram having a different frequency depending on the gain. As described above, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of spatially smoothing each exposure image.

また、上記構成において、前記画像平滑化手段は、前記各露出画像に対してローパスフィルタ処理を行うことが好ましい(請求項8)。   In the above configuration, it is preferable that the image smoothing unit performs low-pass filter processing on each of the exposed images.

これによれば、画像平滑化手段によって、各露出画像に対してローパスフィルタ処理が行われるので、ローパスフィルタ処理という簡易な方法で、容易に各露出画像を空間的に平滑化することができる。   According to this, since the low-pass filter process is performed on each exposure image by the image smoothing means, each exposure image can be easily spatially smoothed by a simple method called low-pass filter processing.

また、上記構成において、前記複数の露出画像それぞれのヒストグラムを作成する作成手段をさらに備え、前記差異手段は、前記エントロピーの算出前に、前記作成手段により作成された各露出画像のヒストグラムを平滑化するヒストグラム平滑化手段であることが好ましい(請求項9)。   Further, in the above configuration, the image forming apparatus further includes a creating unit that creates a histogram for each of the plurality of exposure images, and the difference unit smoothes the histogram of each exposure image created by the creating unit before calculating the entropy. Preferably, it is a histogram smoothing means.

これによれば、差異手段が、エントロピーの算出前に、作成手段により作成された各露出画像のヒストグラムを平滑化するヒストグラム平滑化手段とされる、すなわちヒストグラム平滑化手段によって各露出画像のヒストグラムが平滑化されるので、この平滑化されたヒストグラムが、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像のヒストグラムを平滑化するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   According to this, the difference means is a histogram smoothing means for smoothing the histogram of each exposure image created by the creation means before calculating the entropy, that is, the histogram of each exposure image is obtained by the histogram smoothing means. Since smoothing is performed, the smoothed histogram becomes a histogram having a different frequency depending on the gain. In this way, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of smoothing the histogram of each exposure image.

また、上記構成において、前記ヒストグラム平滑化手段は、前記作成手段により作成されたヒストグラムに対する移動平均処理を行うことで該ヒストグラムを平滑化することが好ましい(請求項10)。   In the above configuration, it is preferable that the histogram smoothing unit smoothes the histogram by performing a moving average process on the histogram created by the creating unit.

これによれば、ヒストグラム平滑化手段によって、作成手段により作成されたヒストグラムに対する移動平均処理が行われることで該ヒストグラムが平滑化されるので、ヒストグラムに対する移動平均処理を行うという簡易な方法で、ヒストグラムを容易に平滑化することができる。   According to this, since the histogram smoothing means smoothes the histogram by performing the moving average process on the histogram created by the creating means, the histogram averaging can be performed by a simple method of performing the moving average process on the histogram. Can be easily smoothed.

また、上記構成において、前記合成手段は、前記最大のエントロピーを有する部分画像の画素値と、前記部分画像の画素値の位置から該部分画像の所定の基準位置までの距離に応じた重みと、を加重平均することにより、当該部分画像同士の合成を行うことが好ましい(請求項11)。   Further, in the above configuration, the synthesizing unit includes a pixel value of the partial image having the maximum entropy and a weight according to a distance from the position of the pixel value of the partial image to a predetermined reference position of the partial image. It is preferable to combine the partial images by weighted averaging.

これによれば、合成手段によって、最大のエントロピーを有する部分画像の画素値と、部分画像の画素値の位置から該部分画像の所定の基準位置までの距離に応じた重みと、が加重平均されることにより、当該部分画像同士の合成が行われるので、これら部分画像間に継ぎ目が無い(モザイク状の画像でない)ように各部分画像の画素値がブレンドされて全体の露出やコントラストが適正化された高画質な1枚の合成画像を得ることができる。   According to this, the pixel value of the partial image having the maximum entropy and the weight according to the distance from the position of the pixel value of the partial image to the predetermined reference position of the partial image are weighted and averaged by the combining means. Since the partial images are combined, the pixel values of the partial images are blended so that there is no seam between the partial images (not a mosaic image), and the overall exposure and contrast are optimized. A single high-quality composite image can be obtained.

また、上記構成において、前記元画像を撮影によって得る撮影手段をさらに備え、前記撮影手段は、線形特性及び対数特性からなる光電変換特性を有するリニアログセンサであり、前記生成手段は、前記リニアログセンサにより得られた元画像における光電変換特性を前記線形特性に統一した後、該線形特性に統一された元画像に対して異なるゲインをかけることで前記各露出画像を生成することが好ましい(請求項12)。   Further, in the above configuration, the camera further includes a photographing unit that obtains the original image by photographing, the photographing unit is a linear log sensor having a photoelectric conversion characteristic including a linear characteristic and a logarithmic characteristic, and the generating unit includes the linear log Preferably, each exposure image is generated by applying different gains to the original image unified with the linear characteristics after unifying photoelectric conversion characteristics in the original image obtained by the sensor into the linear characteristics (claim). Item 12).

これによれば、元画像を撮影によって得る撮影手段が、線形特性及び対数特性からなる光電変換特性を有するリニアログセンサとされ、生成手段によって、リニアログセンサにより得られた元画像における光電変換特性が線形特性に統一された後、該線形特性に統一された元画像に対して異なるゲインをかけることで各露出画像が生成されるので、撮影手段がこのようなリニアログセンサである場合でも、このリニアログセンサにより得られた元画像から容易に各露出画像を生成することができる。   According to this, the photographing means for obtaining the original image is a linear log sensor having a photoelectric conversion characteristic composed of a linear characteristic and a logarithmic characteristic, and the photoelectric conversion characteristic in the original image obtained by the linear log sensor by the generating means. Since each exposure image is generated by applying different gains to the original image unified to the linear characteristic after the linear characteristic is unified, even when the photographing means is such a linear log sensor, Each exposure image can be easily generated from the original image obtained by the linear log sensor.

また、本発明に係る画像処理方法によれば、1つの元画像から、該元画像に異なるゲインをかけることで露出の異なる複数の露出画像を生成する第1の工程と、前記ゲインに応じて、前記複数の露出画像それぞれに対応するヒストグラムの各柱の度数を異ならせる第2の工程と、前記ゲインに応じて各柱の度数が異なる各ヒストグラムに基づいて、各露出画像に対応するエントロピーをそれぞれ算出する第3の工程とを有することを特徴とする(請求項13)。   According to the image processing method of the present invention, the first step of generating a plurality of exposure images having different exposures by applying different gains to the original image from one original image, and depending on the gain The entropy corresponding to each exposure image based on the second step of varying the frequency of each column of the histogram corresponding to each of the plurality of exposure images, and each histogram having a different frequency of each column according to the gain. And a third step of calculating each of them (claim 13).

これによれば、第1の工程において、1つの元画像から、該元画像に異なるゲインをかけることで露出の異なる複数の露出画像が生成され、第2の工程において、ゲインに応じて、複数の露出画像それぞれに対応するヒストグラムの各柱の度数が異ならせられ、第3の工程において、ゲインに応じて各柱の度数が異なる各ヒストグラムに基づいて、各露出画像に対応するエントロピーがそれぞれ算出される。すなわち、各露出画像が1つの画像から作成されるので、露出の異なる複数枚の画像(多重露光画像)それぞれを撮影する必要がなく、これら複数枚の画像間の被写体ブレの発生が防止される。また、各露出画像のヒストグラムの各柱の度数がゲインに応じて異なるものとなるので、これらヒストグラムから求めたエントロピーも各露出画像で異なるものとなる(各露出画像のエントロピーに差異が生じる)。したがって、1つの画像から生成された各露出画像のエントロピーを各露出画像に応じたエントロピーとして求めることができ、エントロピーを視認性の指標として使用することができるため、ひいては、例えばこのエントロピーの情報を用いて、複数の露出画像から露出やコントラストが適正化された高画質な1つの画像を得るといったことが可能となる。   According to this, in the first step, a plurality of exposure images with different exposures are generated from one original image by applying different gains to the original image. In the second step, a plurality of exposure images are generated according to the gain. In the third step, the entropy corresponding to each exposure image is calculated on the basis of the histograms having different frequencies for each column in accordance with the gain. Is done. That is, since each exposure image is created from one image, there is no need to shoot a plurality of images (multi-exposure images) with different exposures, and subject blurring between the plurality of images can be prevented. . In addition, since the frequency of each column in the histogram of each exposure image differs depending on the gain, the entropy obtained from these histograms also differs in each exposure image (the difference in entropy of each exposure image occurs). Therefore, the entropy of each exposure image generated from one image can be obtained as the entropy corresponding to each exposure image, and the entropy can be used as an indicator of visibility. By using it, it becomes possible to obtain one image with high image quality with appropriate exposure and contrast from a plurality of exposed images.

また、上記構成において、前記第2の工程は、前記複数の露出画像それぞれに対応するヒストグラムの作成に際して、階調値に対応する画素値を座標とする該ヒストグラムの横軸座標を前記ゲインに応じて縮小する工程であることが好ましい(請求項14)。   Further, in the above configuration, in the creation of a histogram corresponding to each of the plurality of exposure images, the second step corresponds to the abscissa of the histogram with the pixel value corresponding to the gradation value as a coordinate according to the gain. It is preferable that the reduction step be performed (claim 14).

これによれば、第2の工程が、複数の露出画像それぞれに対応するヒストグラムの作成に際して、階調値に対応する画素値を座標とする該ヒストグラムの横軸座標がゲインに応じて縮小される工程とされるので、単に、ゲインに応じて縮小された横軸座標を有するヒストグラムを作成するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   According to this, when the histogram corresponding to each of the plurality of exposure images is created in the second step, the horizontal axis coordinate of the histogram having the pixel value corresponding to the gradation value as a coordinate is reduced according to the gain. Since it is a process, it is possible to vary the frequency of the histogram corresponding to each exposure image according to the gain by a simple method of simply creating a histogram having horizontal axis coordinates reduced according to the gain. Become.

また、上記構成において、前記第2の工程は、前記第3の工程を行う前に、前記各露出画像を空間的に平滑化する工程であることが好ましい(請求項15)。   In the above configuration, it is preferable that the second step is a step of spatially smoothing each of the exposed images before performing the third step.

これによれば、第2の工程が、第3の工程を行う前に、各露出画像を空間的に平滑化する工程とされるので、この平滑化された各露出画像から作成したヒストグラムが、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像を空間的に平滑化するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   According to this, since the second step is a step of spatially smoothing each exposure image before performing the third step, a histogram created from each smoothed exposure image is The histogram has a different frequency depending on the gain. As described above, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of spatially smoothing each exposure image.

さらに、上記構成において、前記第2の工程は、前記第3の工程を行う前に、前記複数の露出画像それぞれに対応して作成された各露出画像のヒストグラムを平滑化する工程であることが好ましい(請求項16)。   Further, in the above configuration, the second step may be a step of smoothing a histogram of each exposure image created corresponding to each of the plurality of exposure images before performing the third step. Preferred (claim 16).

これによれば、第2の工程が、第3の工程を行う前に、複数の露出画像それぞれに対応して作成された各露出画像のヒストグラムを平滑化する工程とされるので、この工程により平滑化されたヒストグラムが、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像のヒストグラムを平滑化するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   According to this, since the second step is a step of smoothing the histogram of each exposure image created corresponding to each of the plurality of exposure images before performing the third step, this step The smoothed histogram becomes a histogram having different frequencies depending on the gain. In this way, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of smoothing the histogram of each exposure image.

各露出画像が1つの画像から作成されるので、露出の異なる複数枚の画像(多重露光画像)それぞれを撮影する必要がなく、これら複数枚の画像間の被写体ブレの発生が防止される。また、各露出画像のヒストグラムの度数がゲインに応じて異なるものとなるので、このヒストグラムから求めたエントロピーも各露出画像で異なるものとなる。したがって、1つの画像から生成した各露出画像のエントロピーを各露出画像に応じたエントロピーとして求めることができ、エントロピーを視認性の指標として使用することができるため、ひいては、例えばこのエントロピーの情報を用いて、複数の露出画像から露出やコントラストが適正化された高画質な1つの画像を得るといったことが可能となる。   Since each exposure image is created from one image, it is not necessary to shoot a plurality of images (multi-exposure images) having different exposures, and subject blurring between the plurality of images is prevented. Further, since the frequency of the histogram of each exposure image differs depending on the gain, the entropy obtained from this histogram also differs for each exposure image. Therefore, since the entropy of each exposure image generated from one image can be obtained as the entropy corresponding to each exposure image, and the entropy can be used as a visibility index, for example, this entropy information is used. Thus, it is possible to obtain one image with high image quality in which exposure and contrast are optimized from a plurality of exposed images.

(実施形態1)
図1は、第1の実施形態に係る撮像装置の一例であるデジタルカメラ1の主に撮像処理に関する概略的なブロック構成図を示す。図1に示すようにデジタルカメラ1は、レンズ部2、撮像センサ3、アンプ4、A/D変換部5、画像処理部6、画像メモリ7、制御部8、モニタ部9及び操作部10を備えている。レンズ部2は、被写体光(光像)を取り込むレンズ窓として機能するとともに、この被写体光をカメラ本体の内部に配置されている撮像センサ3へ導くための光学レンズ系(被写体光の光軸Lに沿って直列的に配置される例えばズームレンズやフォーカスレンズ)を構成するものである。レンズ部2は、当該レンズの透過光量を調節するための絞りやシャッタ(いずれも図示省略)を備えており、制御部8によりこの絞りやシャッタの駆動制御がなされる構成となっている。
(Embodiment 1)
FIG. 1 is a schematic block diagram illustrating mainly an imaging process of a digital camera 1 which is an example of an imaging apparatus according to the first embodiment. As shown in FIG. 1, the digital camera 1 includes a lens unit 2, an image sensor 3, an amplifier 4, an A / D conversion unit 5, an image processing unit 6, an image memory 7, a control unit 8, a monitor unit 9, and an operation unit 10. I have. The lens unit 2 functions as a lens window for capturing subject light (light image), and an optical lens system (optical axis L of the subject light) for guiding the subject light to the imaging sensor 3 disposed inside the camera body. For example, a zoom lens or a focus lens). The lens unit 2 includes an aperture and a shutter (both not shown) for adjusting the amount of light transmitted through the lens, and the drive of the aperture and shutter is controlled by the control unit 8.

撮像センサ3は、レンズ部2において結像された被写体光像の光量に応じ、R、G、B各成分の画像信号に光電変換して後段のアンプ4へ出力するものである。本実施形態では、この撮像センサ3は、後述のリニアログセンサに対して、一般的なデジタルカメラが備えるリニアセンサ、すなわち1種類の線形特性からなる光電変換特性を有する撮像センサとなっている。なお、デジタルカメラ1は動画撮影が可能に構成されていてもよく、この場合、動画における1フレームの画像(静止画像)を使用すればよい。なお、この一般的なリニアセンサにより得られる画像のことを、後述のリニアログセンサの場合の「線形/対数画像」に対して「線形画像」という。   The image sensor 3 performs photoelectric conversion into image signals of R, G, and B components according to the amount of light of the subject light image formed by the lens unit 2 and outputs the image signal to the subsequent amplifier 4. In the present embodiment, the imaging sensor 3 is a linear sensor included in a general digital camera, that is, an imaging sensor having a photoelectric conversion characteristic composed of one type of linear characteristic with respect to a linear log sensor described later. The digital camera 1 may be configured to be able to shoot a moving image. In this case, it is sufficient to use one frame image (still image) in the moving image. An image obtained by this general linear sensor is referred to as a “linear image” with respect to a “linear / logarithmic image” in the case of a linear log sensor described later.

アンプ4は、撮像センサ3から出力された画像(映像)信号を増幅するものであり、例えばAGC(オートゲインコントロール)回路を備え、当該出力信号のゲイン(増幅率)調整を行う。アンプ4は、AGC回路の他、アナログ値としての当該画像信号のサンプリングノイズの低減を行うCDS(相関二重サンプリング)回路を備えていてもよい。なお、AGC回路に対するゲイン値は制御部8によって設定される。A/D変換部5は、アンプ4にて増幅されたアナログ値の画像信号をデジタル値の画像信号に変換するものであり、撮像センサ3の各画素で受光して得られる画素信号をそれぞれ例えば12ビットの画素データに変換する。   The amplifier 4 amplifies the image (video) signal output from the imaging sensor 3 and includes, for example, an AGC (auto gain control) circuit, and adjusts the gain (amplification factor) of the output signal. The amplifier 4 may include a CDS (correlated double sampling) circuit that reduces sampling noise of the image signal as an analog value in addition to the AGC circuit. The gain value for the AGC circuit is set by the control unit 8. The A / D converter 5 converts the analog value image signal amplified by the amplifier 4 into a digital value image signal, and each pixel signal obtained by receiving light at each pixel of the image sensor 3 is, for example, Convert to 12-bit pixel data.

画像処理部6は、A/D変換部5によるA/D変換処理によって得られた画像信号に対する各種画像処理(デジタル信号処理)を行うものである。本実施形態では、画像処理部6におけるダイナミックレンジ圧縮(DR圧縮)処理或いは露出適正化処理に主たる特徴点がある。画像処理部6におけるこの特徴点に関する処理を含む各種画像処理については後に詳述する。画像メモリ7は、ROM(Read Only Memory)やRAM(Random Access Memory)等のメモリからなり、撮像センサ3による撮影によって得られた画像データや画像処理部6による画像処理後の画像データ等を保存するものである。   The image processing unit 6 performs various image processing (digital signal processing) on the image signal obtained by the A / D conversion processing by the A / D conversion unit 5. In this embodiment, there is a main feature point in the dynamic range compression (DR compression) process or the exposure optimization process in the image processing unit 6. Various image processing including processing relating to this feature point in the image processing unit 6 will be described in detail later. The image memory 7 includes a memory such as a ROM (Read Only Memory) or a RAM (Random Access Memory), and stores image data obtained by photographing by the image sensor 3, image data after image processing by the image processing unit 6, and the like. To do.

制御部8は、各制御プログラム等を記憶するROM、一時的にデータを格納するRAM、及び制御プログラム等をROMから読み出して実行する(中央演算処理装置:CPU)等からなり、デジタルカメラ1全体の動作制御を司るものである。制御部8は、撮像センサ3や画像処理部6或いは操作部10等の装置各部からの各種信号に基づき、装置各部が必要とする各種制御パラメータ等を算出し、これを送信することで各部の動作を制御する。具体的には、制御部8は、撮像センサ3で撮影された画像信号から、自動露出制御(AE制御)、自動焦点制御(AF制御)或いはホワイトバランス(WB)処理等を行うに際してのベースとなる評価値(制御パラメータ)、すなわちAE評価値、AF評価値、WB評価値等を算出する。制御部8は、これら評価値を用いて、タイミング生成部(タイミングジェネレータ)や駆動部(いずれも図示省略)を介して、撮像センサ3やレンズ部2(絞りやシャッタ)に対する撮像動作制御やズーム・フォーカス駆動制御を行ったり、画像処理部6に対する画像処理制御を行う。なお、制御部8は、モニタ部9への表示制御や画像メモリ7に対する画像信号の入出力制御なども行う。   The control unit 8 includes a ROM that stores each control program, a RAM that temporarily stores data, and a control program that is read from the ROM and executed (central processing unit: CPU). It governs the operation control. The control unit 8 calculates various control parameters and the like required by each unit of the device based on various signals from each unit of the device such as the imaging sensor 3, the image processing unit 6, or the operation unit 10, and transmits the calculated control parameters. Control the behavior. Specifically, the control unit 8 is a base for performing automatic exposure control (AE control), automatic focus control (AF control), white balance (WB) processing, and the like from the image signal captured by the image sensor 3. Evaluation values (control parameters), that is, AE evaluation values, AF evaluation values, WB evaluation values, and the like are calculated. The control unit 8 uses these evaluation values to control imaging operation and zoom with respect to the imaging sensor 3 and the lens unit 2 (aperture and shutter) via a timing generation unit (timing generator) and a driving unit (both not shown). Perform focus drive control and perform image processing control on the image processing unit 6. The control unit 8 also performs display control on the monitor unit 9 and input / output control of image signals to the image memory 7.

モニタ部9は、撮像センサ3で撮影された画像(画像メモリ7に保存されていた画像)等のモニタ表示を行うものである。モニタ部9は、具体的には、例えばカメラ背面に配設されたカラー液晶表示素子からなる液晶表示器(LCD;Liquid Crystal Display)、或いは接眼部を構成する電子ビューファインダ(EVF;Electronic View Finder)等からなる。   The monitor unit 9 displays a monitor such as an image captured by the image sensor 3 (an image stored in the image memory 7). Specifically, the monitor unit 9 is, for example, a liquid crystal display (LCD) composed of a color liquid crystal display element disposed on the back of the camera, or an electronic viewfinder (EVF) that forms an eyepiece. Finder).

操作部10は、デジタルカメラ1に対するユーザによる操作指示(指示入力)を行うものであり、例えば電源スイッチ、レリーズスイッチ、或いは各種撮影モードを設定するモード設定スイッチ、ニュー選択スイッチ等の各種の操作スイッチ(ボタン)群からなる。例えばレリーズスイッチが押下(オン)されることで、撮影動作、すなわち撮像センサ3により被写体が撮像され、この撮像により得られた画像データに対して所定の画像処理が施された後、画像メモリ7等に記録されるといった一連の動作が実行される。   The operation unit 10 is used to give an operation instruction (instruction input) to the digital camera 1 by a user. For example, various operation switches such as a power switch, a release switch, a mode setting switch for setting various shooting modes, and a new selection switch. (Button) group. For example, when a release switch is pressed (turned on), a subject is imaged by an imaging operation, that is, the imaging sensor 3, and predetermined image processing is performed on the image data obtained by the imaging, and then the image memory 7. A series of operations such as recording in the above are executed.

ここで、画像処理部6の構成及び動作の詳細について説明する。図2は、上記画像処理部6の一回路構成例を示す機能ブロック図である。同図に示すように画像処理部6は、基本処理部61、WB補正部62、DR圧縮部63、色補間部64、色補正部65、γ補正部66、色空間変換部67及びノイズ処理部68を備えている。   Here, details of the configuration and operation of the image processing unit 6 will be described. FIG. 2 is a functional block diagram showing a circuit configuration example of the image processing unit 6. As shown in the figure, the image processing unit 6 includes a basic processing unit 61, a WB correction unit 62, a DR compression unit 63, a color interpolation unit 64, a color correction unit 65, a γ correction unit 66, a color space conversion unit 67, and noise processing. A portion 68 is provided.

基本処理部61は、後段の画像処理に対して基本となる画像処理、ここでは黒基準補正処理及びFPN補正処理を行うものである。黒基準補正処理は、A/D変換部5から入力されるデジタル画像信号の黒レベル(暗黒時の画像信号レベル)を基準の値に補正する処理である。すなわちA/D変換部5から入力される画像信号レベルをSD1とし、暗黒時の画像信号レベルをSD2とするときに、SD1−SD2の演算を行う。   The basic processing unit 61 performs basic image processing with respect to subsequent image processing, in this case, black reference correction processing and FPN correction processing. The black reference correction process is a process of correcting the black level (image signal level in darkness) of the digital image signal input from the A / D conversion unit 5 to a reference value. That is, when the image signal level input from the A / D converter 5 is SD1, and the image signal level in the dark is SD2, the calculation of SD1-SD2 is performed.

FPN補正処理は、黒基準補正処理により得られた信号の固定パターンノイズ(FPN;Fixed Pattern Noise)を除去する処理である。固定パターンノイズは、撮像センサ3の各画素回路の閾値バラツキ等が要因となって生じる、各画素が発生する画像信号の出力値のバラツキに起因するノイズである。WB補正部62は、入力画像に対するWB補正、すなわち被写体光源の色温度変化によって生じる白色変化に伴う色バランス補正を行うものである。WB補正部62は、制御部8から与えられるWB評価値に基づいて、画像信号の色バランスが所定の色バランスになるよう各色成分R、G、Bの各画素データのレベルを変換する補正を行う。   The FPN correction process is a process for removing fixed pattern noise (FPN) of the signal obtained by the black reference correction process. The fixed pattern noise is noise caused by variations in output values of image signals generated by the respective pixels, which are caused by variations in threshold values of the respective pixel circuits of the image sensor 3. The WB correction unit 62 performs WB correction on the input image, that is, color balance correction accompanying white change caused by the color temperature change of the subject light source. Based on the WB evaluation value given from the control unit 8, the WB correction unit 62 performs correction for converting the level of each pixel data of each color component R, G, B so that the color balance of the image signal becomes a predetermined color balance. Do.

DR圧縮部63は、例えば入力画像が表示系(モニタ等)のダイナミックレンジに収まるようにするべく、入力画像のダイナミックレンジ(DR)を圧縮する処理(DR圧縮処理)を行うものである。本実施形態では、このDR圧縮処理において画像各部の露出の適正化を行う。この画像各部の露出を適正化する処理のことを露出適正化処理という(本実施形態の露出適正化処理を行うことで実質的にDR圧縮処理も行っていることになる)。DR圧縮部63におけるこのDR圧縮処理(露出適正化処理)については後に詳述する。なお、このDR圧縮部63は後述するγ補正部66よりも前段に設けられているのであれば何れの位置でもよい。本実施形態では、メモリ容量が少なくて済むことから、色補間(ベイヤー補間)を行う前、すなわち色補間部64の前段にDR圧縮部63を設けている。   The DR compression unit 63 performs processing (DR compression processing) for compressing the dynamic range (DR) of the input image so that the input image falls within the dynamic range of the display system (monitor or the like), for example. In the present embodiment, the exposure of each part of the image is optimized in the DR compression process. The process for optimizing the exposure of each part of the image is called the exposure optimization process (the DR compression process is substantially performed by performing the exposure optimization process of this embodiment). This DR compression processing (exposure optimization processing) in the DR compression unit 63 will be described in detail later. The DR compression unit 63 may be located at any position as long as it is provided upstream of a later-described γ correction unit 66. In this embodiment, since the memory capacity is small, the DR compression unit 63 is provided before color interpolation (Bayer interpolation), that is, before the color interpolation unit 64.

色補間部(ベイヤー補間部)64は、入力される画像信号の各色成分R、G、B毎に、フレーム画像の不足する画素位置のデータを補間する色補間処理を行うものである。すなわち、撮像センサ3のカラーフィルタ構造は、例えばGが市松状でR、Bが線順次配列(以降、G市松RB線順次配列という)された所謂ベイヤー方式が採用されており、この関係上、色情報が不足していることから、色補間部64は実在する複数の画素データを用いて実在しない画素位置の画素データを補間する。   The color interpolation unit (Bayer interpolation unit) 64 performs color interpolation processing for interpolating data at pixel positions where the frame image is insufficient for each color component R, G, B of the input image signal. That is, the color filter structure of the image sensor 3 employs a so-called Bayer system in which, for example, G is checkered and R and B are line-sequentially arranged (hereinafter referred to as G-checkered RB line-sequentially arranged). Since the color information is insufficient, the color interpolation unit 64 interpolates pixel data at nonexistent pixel positions using a plurality of actual pixel data.

色補正部65は、色補間部64から入力される色成分R、G、Bの画像信号の色合い(色バランス;彩度)を補正する色補正処理を行うものである。色補正部65は、色成分RGBの各画像信号のレベル比を変換する3種類の変換係数を有し、撮影シーンに応じた変換係数で該レベル比を変換して画像データの色合いを補正する。   The color correction unit 65 performs color correction processing for correcting the hue (color balance; saturation) of the image signals of the color components R, G, and B input from the color interpolation unit 64. The color correction unit 65 has three types of conversion coefficients for converting the level ratio of each image signal of the color component RGB, and corrects the hue of the image data by converting the level ratio with the conversion coefficient according to the shooting scene. .

γ補正部66は、入力画像に対し、所定のガンマ特性を用いて非線形変換するガンマ補正処理を行うものである。具体的には、γ補正部66は、入力される色成分RGBの各画像信号が適切な出力レベルになるよう、画像信号のレベルを各色成分毎に、モニタ部9や外部出力されるモニターテレビ等の表示メディア(表示媒体)の表示特性(階調特性;非線形表示特性;γカーブ)に応じて、所定のガンマ補正テーブル(ガンマ補正用LUT)を用いて非線形補正を行う。ガンマ補正テーブルは、表示メディアの表示特性に応じたものが例えばγ補正部66内に予め記憶されている。   The γ correction unit 66 performs gamma correction processing that performs nonlinear conversion on the input image using a predetermined gamma characteristic. Specifically, the γ correction unit 66 sets the level of the image signal for each color component to the monitor unit 9 or an externally output monitor television so that the input image signals of the color components RGB have appropriate output levels. Nonlinear correction is performed using a predetermined gamma correction table (gamma correction LUT) according to the display characteristics (gradation characteristics; nonlinear display characteristics; γ curve) of the display medium (display medium). The gamma correction table corresponding to the display characteristics of the display medium is stored in advance in the γ correction unit 66, for example.

色空間変換部67は、入力画像データにおけるRGB、すなわち赤、緑、青の3色の階調により表現するRGB表示系から、輝度(Y)と青の色差(Cb)及び赤の色差(Cr)により表現するYCbCr表示系(YCC表示系)へ色空間変換する色空間変換処理を行うものである。ノイズ処理部68は、入力される画像信号のノイズ成分を除去するノイズ除去処理を行うものである。ノイズ処理部68は、例えばコアリング係数を用いたコアリング処理を行うことで、適正なノイズ除去処理を行う。   The color space conversion unit 67 converts the luminance (Y) and the blue color difference (Cb) and the red color difference (Cr) from the RGB display system represented by the RGB of the input image data, that is, the red, green, and blue gradations. ) To perform a color space conversion process for color space conversion to a YCbCr display system (YCC display system). The noise processing unit 68 performs noise removal processing for removing noise components of the input image signal. The noise processing unit 68 performs appropriate noise removal processing, for example, by performing coring processing using a coring coefficient.

ここで、DR圧縮部63の構成及び動作の詳細について説明する。図3は、上記DR圧縮部63の一回路構成例を示す機能ブロック図である。DR圧縮部63は、画像生成部20、エントロピー演算部30及びブレンド部40を備えている。画像生成部20は、入力された1枚の画像I(元画像I)から露出の異なる複数の画像(多重露光画像という)を擬似的に生成する、すなわち、元画像Iに対して種々の所定倍率のゲイン(デジタルゲイン;G)をかけることで複数の擬似多重露光画像を生成するものである。ここでは元画像Iに対してそれぞれ例えば2、4、8倍のゲイン(ゲイン値2.0、4.0、8.0)をかけた画像を擬似多重露光画像M1、M2及びM3として生成する。ただし、生成する擬似多重露光画像はこれら画像M1、M2及びM3の3枚に限定されない、すなわち元画像Iにかけるゲインの個数(種類)やその値は任意なものが採用可能である。これに関し、画像生成部20は、当該ゲインを、撮像センサ3の出力情報(例えばこの元画像I)から求めてもよいし、上記特許文献2の方法により、AE時における各ブロック画像の代表値例えば画素値平均(ブロック平均;Ajk)から求めてもよい。   Here, the details of the configuration and operation of the DR compression unit 63 will be described. FIG. 3 is a functional block diagram showing a circuit configuration example of the DR compression unit 63. The DR compression unit 63 includes an image generation unit 20, an entropy calculation unit 30, and a blending unit 40. The image generation unit 20 generates a plurality of images (referred to as multiple exposure images) having different exposures from one input image I (original image I), that is, various predetermined values are generated for the original image I. A plurality of pseudo multiple exposure images are generated by applying a gain of magnification (digital gain; G). Here, for example, images obtained by multiplying the original image I by, for example, 2, 4, and 8 times gains (gain values 2.0, 4.0, and 8.0) are generated as pseudo multiple exposure images M1, M2, and M3. . However, the pseudo multiple exposure images to be generated are not limited to the three images M1, M2, and M3, that is, any number (type) of gain and its value applied to the original image I can be adopted. In this regard, the image generation unit 20 may obtain the gain from the output information (for example, the original image I) of the imaging sensor 3, or the representative value of each block image at the time of AE by the method of Patent Document 2 above. For example, you may obtain | require from pixel value average (block average; Ajk).

エントロピー演算部30は、上記生成した各擬似多重露光画像を合成(ブレンド)する際に用いる後述の最大エントロピー情報を求めるべく、エントロピーに関する所定の演算を行うものである。エントロピー演算部30は、ブロック分割部31、ヒストグラム作成部32、エントロピー算出部33及び選択部34を備えている。ブロック分割部31は、元画像Iを所定の分割数すなわちj×k個の複数のブロック(ブロック画像)に分割するものである。なお、この元画像Iのj×k個の各ブロック画像は、各擬似多重露光画像をj×k個に分割した各ブロック画像と対応する。   The entropy calculation unit 30 performs a predetermined calculation related to entropy to obtain later-described maximum entropy information used when the generated pseudo multiple exposure images are combined (blended). The entropy calculation unit 30 includes a block division unit 31, a histogram creation unit 32, an entropy calculation unit 33, and a selection unit 34. The block dividing unit 31 divides the original image I into a predetermined number of divisions, that is, j × k blocks (block images). Note that each j × k block image of the original image I corresponds to each block image obtained by dividing each pseudo multiple exposure image into j × k.

ヒストグラム作成部32は、ブロック分割部31で分割されたブロック画像毎にヒストグラムを作成するものである。ヒストグラム作成部32は、画像生成部20から出力されたゲイン情報(ゲイン値2.0、4.0、8.0;これらゲイン値を「G」で表す)を用いて、横軸の階調数を(横軸の最大階調値)を階調数NからN/Gに縮小したヒストグラムを作成する(普通、ヒストグラムの横軸はNであるが、本実施形態ではN/Gとする)。この記号「N」は画像の階調数を示し、記号「/」は除算を示す。ここでは8ビット画像を扱うものとし、この場合、N=256(階調)となる。ただし、各多重露光画像を生成する際に使用したゲインが複数種類である場合には、これらの中で最大の値のゲインを用いる。例えば元画像から或る1枚の多重露光画像を生成する際に「2.1」、「2.4」、「2.5」といった複数種類のゲインをかけている場合、この多重露光画像に対応するゲイン値Gは、これらの中の最大値である「2.5」となる。この意味において、以降、各多重露光画像に対応するゲイン値を、上記Gの代わりにGmaxとする。すなわちヒストグラム作成部32はヒストグラムの横軸を階調数N/Gmaxとしたヒストグラムを作成する。   The histogram creating unit 32 creates a histogram for each block image divided by the block dividing unit 31. The histogram creation unit 32 uses the gain information output from the image generation unit 20 (gain values 2.0, 4.0, 8.0; these gain values are represented by “G”), and the horizontal axis gradations. A histogram in which the number (maximum gradation value on the horizontal axis) is reduced from the number of gradations N to N / G is created (normally the horizontal axis of the histogram is N, but in this embodiment it is N / G). . The symbol “N” indicates the number of gradations of the image, and the symbol “/” indicates division. Here, an 8-bit image is handled, and in this case, N = 256 (gradation). However, when there are a plurality of types of gains used when generating each multiple exposure image, the maximum gain is used. For example, when a plurality of gains such as “2.1”, “2.4”, and “2.5” are applied when generating a single multiple exposure image from the original image, The corresponding gain value G is “2.5” which is the maximum value among them. In this sense, hereinafter, the gain value corresponding to each multiple exposure image is set to Gmax instead of G. That is, the histogram creation unit 32 creates a histogram with the horizontal axis of the histogram having the number of gradations N / Gmax.

したがって、ゲイン値2.0、4.0及び8.0の多重露光画像に対応してそれぞれN/2.0、N/4.0及びN/8.0を横軸とするヒストグラムを作成する。実際の演算では、ヒストグラム作成部32は、各多重露光画像それぞれに対応するN/Gmax個の配列(ヒストグラムの横軸における、各柱に対応する座標位置の画素値1、2、3・・・、N/Gmaxの並び。ただし、各座標位置の柱つまり度数の値は全て初期値ゼロとなっている)を準備して(この配列情報をヒストグラム作成部32内に予め記憶していてもよい)、元画像Iにおける上記j×k個の各ブロック画像における各画素値(画素値i)に対して、整数値であるi/Gmax番目の配列をカウントアップ(度数カウント;1を加算)する。   Therefore, histograms are created with N / 2.0, N / 4.0, and N / 8.0 on the horizontal axis corresponding to multiple exposure images with gain values of 2.0, 4.0, and 8.0, respectively. . In actual calculation, the histogram creating unit 32 has N / Gmax arrays corresponding to the respective multiple exposure images (pixel values 1, 2, 3,... At the coordinate positions corresponding to the respective columns on the horizontal axis of the histogram). , N / Gmax, where the columns at each coordinate position, that is, the frequency values are all initially set to zero, may be prepared (this array information may be stored in advance in the histogram creation unit 32). ) The i / Gmax-th array that is an integer value is counted up (frequency count; 1 is added) for each pixel value (pixel value i) in each of the j × k block images in the original image I. .

具体的には、例えばGmaxが2.0の多重露光画像の場合、元画像Iの或るブロック画像における或る画素値iが60であれば、i/Gmax=60/2=30であり、この値30に対応する30番目の配列位置すなわち横軸座標の度数のカウント値が「1」大きくなる(N/Gmax=256/2を横軸とするヒストグラムの画素値30における度数がカウントアップされる)。画素値iが61であれば、i/Gmax=61/2=30.5(割り切れない値;非整数)であるが、この場合は、30.5を、その端数(少数点以下の値)0.5を切り捨てた30として扱い、画素値iが60の場合と同じ30番目の配列位置の度数がカウントアップされる。このように、各画素値iに対してi/Gmax番目(整数値)に対応する各配列位置の度数がカウントアップされる。なお、画素値iが62の場合はi/Gmax=31であり、31番目の配列位置の度数がカウントアップされる。これにより、例えば図4の右側に示すような(N/Gmax=256/2の場合)、最大階調値が128(=256/2)であるヒストグラムH4が作成される。   Specifically, for example, in the case of a multiple exposure image having a Gmax of 2.0, if a certain pixel value i in a certain block image of the original image I is 60, i / Gmax = 60/2 = 30, The count value of the frequency of the 30th array position corresponding to this value 30, that is, the horizontal coordinate, is increased by “1” (the frequency at the pixel value 30 of the histogram with the horizontal axis of N / Gmax = 256/2 is counted up. ) If the pixel value i is 61, i / Gmax = 61/2 = 30.5 (value that cannot be divided; non-integer), but in this case, 30.5 is its fraction (value below the decimal point). The frequency at the 30th array position, which is the same as when the pixel value i is 60, is counted up, with 0.5 being rounded down to 30. Thus, the frequency at each array position corresponding to the i / Gmaxth (integer value) for each pixel value i is counted up. When the pixel value i is 62, i / Gmax = 31, and the frequency at the 31st array position is counted up. Thereby, for example, as shown on the right side of FIG. 4 (when N / Gmax = 256/2), a histogram H4 having a maximum gradation value of 128 (= 256/2) is created.

ここではGmaxが2.0の場合について説明したが、Gmaxの値がこれ以外の例えば「4.0」の場合も同様に、例えば画素値iの値が「60」、「61」、「62」、「63」、「64」であるとき、それぞれi/Gmax=(60/4=15:整数)、(61/4=15.25;非整数)、(62/4=15.5;非整数)、(63/4=15.75;非整数)、(64/4=16;整数)となり、当該画素値i=60、61、62、63の場合がいずれもヒストグラム(N/Gmax=256/4の横軸を有する)における同じ15番目の配列位置の度数がカウントアップされる、つまり4回カウントされる。一方、画素値i=64の場合は、15番目より1つ上の16番目の配列位置の度数がカウントアップされる。なお、階調数N/Gmaxとされた横軸座標のn番目の配列位置にカウントされる画素値(i/Gmax)は、所謂ガウス記号による[X]と考えてもよい(X=i/Gmax)。この[X]は、Xを越えない最大の整数([X]=n、n≦X<n+1)である。例えばn=30のときは、30≦X<31であり、上述した30.5の場合は[30.5]=30番目となり、また、15.25、15.5、15.75の場合はそれぞれ[15.25]、[15.5]、[15.75]=15番目となる。   Although the case where Gmax is 2.0 has been described here, similarly, for example, when the value of Gmax is other than “4.0”, for example, the value of the pixel value i is “60”, “61”, “62”. ”,“ 63 ”,“ 64 ”, i / Gmax = (60/4 = 15: integer), (61/4 = 15.25; non-integer), (62/4 = 15.5; (Non-integer), (63/4 = 15.75; non-integer), (64/4 = 16; integer), and the pixel values i = 60, 61, 62, 63 are all histograms (N / Gmax). The frequency of the same 15th array position in (with a horizontal axis of 256/4) is counted up, that is, counted four times. On the other hand, when the pixel value i = 64, the frequency at the 16th array position, which is one higher than the 15th, is counted up. It should be noted that the pixel value (i / Gmax) counted at the nth array position on the horizontal axis coordinate with the gradation number N / Gmax may be considered as [X] by a so-called Gaussian symbol (X = i / Gmax). This [X] is the maximum integer not exceeding X ([X] = n, n ≦ X <n + 1). For example, when n = 30, 30 ≦ X <31, and in the case of 30.5, [30.5] = 30th, and in the case of 15.25, 15.5, 15.75 [15.25], [15.5], and [15.75] = 15th respectively.

このようにして、ヒストグラム作成部32は、元画像I(元画像Iの各ブロック画像における画素値i)から、ゲイン情報に基づくそれぞれ256/2、256/4、256/8の横軸を有した、j×k個のヒストグラムを作成する。なお、ヒストグラム作成部32で用いる当該ゲイン情報は、画像生成部20からエントロピー演算部30に出力されたものでなく、この画像生成部20での各多重露光画像生成時に用いるのと同じゲイン情報(ゲイン値)がヒストグラム作成部32に記憶されたものであってもよい。   In this manner, the histogram creation unit 32 has the horizontal axes of 256/2, 256/4, and 256/8 based on the gain information from the original image I (the pixel value i in each block image of the original image I). J × k histograms are created. Note that the gain information used in the histogram creation unit 32 is not output from the image generation unit 20 to the entropy calculation unit 30, but is the same gain information (when the multiple exposure image is generated in the image generation unit 20) ( (Gain value) may be stored in the histogram creating unit 32.

このように横軸の階調数をN/Gmax(256/2の場合で説明する)としたヒストグラムを求めることは、図13に示すような通常の横軸階調数N(256)とした元画像IのヒストグラムH1の階調数を128(=256/2)として考えた(仮定した)、つまり符号901、902・・・に示すようにヒストグラムH1の隣り合う2本(Gmax=2に対応)の柱を1本の柱(例えばこの2つの柱の度数が点線で示すように平均されてなる1つの柱)として考えたときの図4に示すヒストグラムH3を、上記ヒストグラムH4に変化させることに相当する。これは、図13に示すヒストグラムH1、H2がそれぞれ横軸方向に度数が足し合わされたようなヒストグラムになると言える。また、ヒストグラムH4は、ヒストグラムH2(歯抜け型ヒストグラムと表現する)における柱の存在しないところが補間された、つまり柱間の隙間が埋められて該隙間がないように補間処理されて上記“歯抜け”状態が解消されたヒストグラムであると言える。   Thus, obtaining a histogram with the horizontal axis number of gradations set to N / Gmax (described in the case of 256/2) is the normal horizontal axis gradation number N (256) as shown in FIG. The number of gradations of the histogram H1 of the original image I was considered (assumed) as 128 (= 256/2), that is, two adjacent histograms H1 (Gmax = 2) as indicated by reference numerals 901, 902. The histogram H3 shown in FIG. 4 is changed to the histogram H4 when the corresponding column is considered as one column (for example, one column obtained by averaging the frequencies of the two columns as indicated by dotted lines). It corresponds to that. It can be said that the histograms H1 and H2 shown in FIG. 13 are histograms in which the frequencies are added in the horizontal axis direction. Further, the histogram H4 is interpolated where there is no column in the histogram H2 (denoted as a missing tooth type histogram), that is, interpolated so that the gap between the pillars is filled and there is no gap. It can be said that this is a histogram in which the state is eliminated.

ただし、上記ヒストグラムH3は、説明の便宜上、元画像IのヒストグラムH1から上述のように2本の柱を1本として仮定したヒストグラムであって、元画像Iのヒストグラムの全体度数自体は、ヒストグラムH1と同じ全体度数である(ヒストグラムH3における或る1本の柱例えば画素値i=1の柱の度数は、ヒストグラムH1と同じ256階調で換算した場合、ヒストグラムH1の画素値i=1、2の各柱の度数を平均した値×2と考えることができる)。また、ゲイン値が2.0以外の場合例えばN/Gmax=256/4の場合も同様に、ヒストグラムH1の各柱を4本合わせて1本として考えたヒストグラムH3(階調数も上記128でなく64となる)が、横軸の階調数64とするヒストグラムH4に変化する。   However, for convenience of explanation, the histogram H3 is a histogram that assumes two columns as one from the histogram H1 of the original image I as described above, and the overall frequency itself of the histogram of the original image I is the histogram H1. (The frequency of a certain column in the histogram H3, for example, the column of the pixel value i = 1 is converted with the same 256 gradations as in the histogram H1, the pixel value i = 1, 2 in the histogram H1). Can be thought of as the average value of the frequency of each column x 2). Further, when the gain value is other than 2.0, for example, when N / Gmax = 256/4, similarly, the histogram H3 (the number of gradations is 128 above) that is considered as one of the four columns of the histogram H1. Changes to a histogram H4 with 64 horizontal gradations.

このことは、すなわち、各多重露光画像に対応するヒストグラムの各柱の度数がゲインに応じて異なる度数となるようにすることになる。例えばゲイン値2.0、4.0、8.0それぞれの場合に上記横軸座標を縮小したヒストグラムを考えると、この各ヒストグラムの各柱の度数、例えば画素値i=1の柱の度数は互いに異なる値となっている。違う見方をすれば、この横軸座標を縮小したヒストグラムの画素値i=1の度数は、元画像IのヒストグラムH1の同じ柱位置である画素値i=1の柱の度数と比べて、それぞれゲインに応じて異なる(高い)値となっている。   This means that the frequency of each column of the histogram corresponding to each multiple exposure image is different depending on the gain. For example, when considering a histogram obtained by reducing the horizontal coordinate in the case of gain values of 2.0, 4.0, and 8.0, the frequency of each column of each histogram, for example, the frequency of a column with a pixel value i = 1 is The values are different from each other. From a different perspective, the frequency of the pixel value i = 1 of the histogram obtained by reducing the horizontal coordinate is compared with the frequency of the column of the pixel value i = 1 at the same column position in the histogram H1 of the original image I. It is a different (high) value depending on the gain.

なお、上記説明では、1枚の画像(元画像I)からゲインを変えて生成した多重露光画像毎にヒストグラムの各柱の幅が変わっている(横軸の各最大階調値256、128、64・・・の座標位置が同じ位置になっている)が、すなわち、上記256/2、256/4、256/8となるにつれて各ヒストグラムの各柱の横軸方向の幅が大きく(太く)なっているが、全ての多重露光画像においてヒストグラムの各柱の幅が変わらない(共通の柱幅となる)ように、或いは横軸の最大階調値が上記同じ座標位置で且つ一定の値例えば256(128でもよい)で変わらないように上記“横軸座標の縮小”を行ってもよい。この場合、256/8(ゲイン最大)の場合でのヒストグラムにおける画素値1から最大画素値の座標位置までの全柱の合計幅(ヒストグラム全体の横軸方向の幅)が最も小さなものとなる(最大画素値での階調値は32)。   In the above description, the width of each column of the histogram is changed for each multiple exposure image generated by changing the gain from one image (original image I) (maximum tone values 256, 128 on the horizontal axis, 64..., That is, the width in the horizontal axis direction of each column of each histogram becomes larger (thicker) as the above becomes 256/2, 256/4, 256/8. However, in all the multiple exposure images, the width of each column of the histogram does not change (becomes a common column width), or the maximum gradation value on the horizontal axis is the same coordinate position and a constant value, for example The above-described “reduction of the horizontal coordinate” may be performed so as not to change at 256 (or 128). In this case, the total width of all the columns from the pixel value 1 to the coordinate position of the maximum pixel value in the histogram in the case of 256/8 (maximum gain) (width in the horizontal axis direction of the entire histogram) is the smallest ( The gradation value at the maximum pixel value is 32).

このように、従来では画素値にゲインをかけても全体度数(総度数)が変化しなかったものが、ゲインに応じて全体度数が変化するようになる、すなわち上述のようにゲインに応じてヒストグラムの各柱の度数が異なるものとなる。このように度数が変化するということはエントロピーも変化するので、ゲイン値に応じたエントロピーによる画像の視認性の評価が可能となる。   Thus, in the past, when the pixel value was gained, the overall frequency (total frequency) did not change, but the overall frequency changed according to the gain, that is, according to the gain as described above. The frequency of each column of the histogram is different. Since the frequency changes in this way also changes the entropy, it is possible to evaluate the visibility of the image by the entropy according to the gain value.

エントロピー算出部33は、ヒストグラム作成部32により作成したブロック画像毎のヒストグラムに基づいて、当該各ブロック画像のエントロピーを算出するものである。エントロピー(E)の算出は以下の(2)式によって行う。   The entropy calculation unit 33 calculates the entropy of each block image based on the histogram for each block image created by the histogram creation unit 32. The entropy (E) is calculated by the following equation (2).

Figure 2008219230
但し、記号「P’i」は、各ブロック画像における画素値i×Gmax〜(i+1)×Gmaxの範囲の出現確率を示す。この出現確率は、上記ヒストグラムにおける各配列(i)の柱の度数値÷ブロック画像の画素数(iの度数/ブロック画素数)である。
Figure 2008219230
However, the symbol “P′i” indicates the appearance probability of the pixel value i × Gmax to (i + 1) × Gmax in each block image. This appearance probability is the frequency value of the column of each array (i) in the histogram divided by the number of pixels of the block image (frequency of i / number of block pixels).

上記出現確率P’iについて、例えば、図4に示すヒストグラムH4の画素値iが「30」(30〜31)での斜線で示す柱の度数が50であり、当該ヒストグラムを求めるブロック画像の画素数が100×100(10000)個であるとすると、この画素値i=30に対する出現確率P’30=50/10000となる。また、出現確率P’iは、この画素数10000個のブロック画像(元画像I)における画素値としてゲイン値2を掛け戻して換算してなる画素値60〜62(i×Gmax〜(i+1)×Gmax)の階調範囲、すなわち元画像Iのヒストグラムで考えた場合の当該階調範囲に対応する柱の度数としてカウントする画素値60及び画素値61(画素値62は含まない)の出現確率である。 With respect to the appearance probability P′i, for example, the pixel value i of the histogram H4 shown in FIG. 4 is “30” (30 to 31), and the frequency of the shaded column is 50, and the pixel of the block image for which the histogram is obtained If the number is 100 × 100 (10000), the appearance probability P ′ 30 = 50/10000 for this pixel value i = 30. The appearance probability P′i is a pixel value 60 to 62 (i × Gmax to (i + 1)) obtained by multiplying the gain value 2 as a pixel value in the block image (original image I) having 10,000 pixels. × Gmax), that is, the appearance probability of the pixel value 60 and the pixel value 61 (not including the pixel value 62) counted as the frequency of the column corresponding to the gradation range when considered in the histogram of the original image I It is.

選択部34は、上記各ゲイン(各N/Gmax(=2、4、8))それぞれに対応するj×k個のブロック画像の各エントロピーを、同じ位置つまり同じブロック配列位置(j、k)のブロック画像同士で比較して、最もエントロピーが高いブロック画像、すなわち最大エントロピーの画像番号Ijk(これを最大エントロピー情報という)を選択(決定)するものである。具体的には、例えば同じ(3、5)(j=3、k=5)のブロック配列位置における、ゲイン2、4、8に対応する3つのブロック画像の3つのエントロピー値のうちから、最大のエントロピー値を有するブロック画像(当該エントロピー値が最大であるのは3つのブロック画像のうちのいずれのブロック画像であるのかを表す情報;画像番号Ijkという)が選択される。このような選択動作が全ブロック(j×k個)に亘って行われる。   The selection unit 34 sets each entropy of j × k block images corresponding to each gain (each N / Gmax (= 2, 4, 8)) at the same position, that is, the same block arrangement position (j, k). The block images having the highest entropy, that is, the maximum entropy image number Ijk (referred to as maximum entropy information) are selected (determined). Specifically, for example, the maximum of the three entropy values of the three block images corresponding to the gains 2, 4, and 8 at the same (3, 5) (j = 3, k = 5) block arrangement position A block image having the entropy value (information indicating which of the three block images has the maximum entropy value; image number Ijk) is selected. Such a selection operation is performed over all blocks (j × k).

ブレンド部40は、エントロピー演算部30から出力された最大エントロピー情報に基づいて、画像生成部20から出力された擬似多重露光画像M1、M2及びM3を合成(ブレンド処理)するものである。すなわち、各擬似多重露光画像M1、M2及びM3のブロック配列位置(j、k)における、それぞれ上記最大のエントロピーを有するブロック画像のみを合成する。つまり、ブロック配列位置(2、1)は画像M1(画像番号I21が“M1”或いはM1を示す所定の番号)のブロック画像を、ブロック配列位置(2、2)は画像M3(画像番号I22が“M3”或いはM3を示す所定の番号)のブロック画像を、・・・というようにエントロピー最大のブロック画像だけを謂わば寄せ集めて1枚の画像に合成して合成画像Oとして出力する。なお、ブレンド部40は、当該合成処理を行う前に、各擬似多重露光画像M1、M2及びM3を、元画像Iの上記j×kのブロック画像に対応させて同じくj×k個に分割しておく。 The blending unit 40 synthesizes (blends) the pseudo multiple exposure images M1, M2, and M3 output from the image generation unit 20 based on the maximum entropy information output from the entropy calculation unit 30. That is, only the block images having the maximum entropy at the block arrangement positions (j, k) of the pseudo multiple exposure images M1, M2, and M3 are synthesized. That is, the block arrangement position (2, 1) is the block image of the image M1 (the image number I 21 is “M1” or a predetermined number indicating M1), and the block arrangement position (2, 2) is the image M3 (image number I 22 is a block number having a predetermined number indicating “M3” or M3), and so on, only the block images having the maximum entropy are gathered together so as to be combined into a single image and output as a composite image O. . The blending unit 40 divides each pseudo multiple exposure image M1, M2, and M3 into j × k pieces corresponding to the j × k block images of the original image I before performing the composition processing. Keep it.

実際には、ブレンド部40は、以下の(3)〜(5)の各式を用いて上記合成を行う。すなわち、画像の或る注目画素(x、y)の出力値(O(x、y))が、最大エントロピー画像番号Ijkのブロック画像における座標(x、y)の画素値Ijk(x、y)と、注目画素(x、y)から該ブロック画像(j、k)の中心(中心画素)までの距離から求めたウエイトWjk(x、y)との加重平均として与えられるような演算を行う。   Actually, the blend unit 40 performs the above synthesis using the following equations (3) to (5). That is, the output value (O (x, y)) of a certain pixel of interest (x, y) of the image is the pixel value Ijk (x, y) of the coordinates (x, y) in the block image of the maximum entropy image number Ijk. And a weighted average of the weight Wjk (x, y) obtained from the distance from the target pixel (x, y) to the center (center pixel) of the block image (j, k).

Figure 2008219230
但し、記号「n」、「n」はj×k配列のブロック数(jが1〜n、kが1〜n)を示す。また、Wjk(x、y)は以下の(4)式で与えられる。
Figure 2008219230
However, the symbols “n r ” and “n c ” indicate the number of blocks in the j × k array (j is 1 to n r , k is 1 to n c ). Wjk (x, y) is given by the following equation (4).

Figure 2008219230
但し、Gjk(x、y)はガウシアンを示しており、以下の(5)式で与えられる。
Figure 2008219230
However, Gjk (x, y) indicates Gaussian and is given by the following equation (5).

Figure 2008219230
但し、記号「xjk」、「yjk」は、各ブロック画像の中心画素の座標(xjk,yjk)を示す。また、記号「σ」は標準偏差であって所定のブレンド半径を示している。
Figure 2008219230
However, the symbols “x jk ” and “y jk ” indicate the coordinates (x jk , y jk ) of the center pixel of each block image. The symbol “σ” is a standard deviation and indicates a predetermined blend radius.

上述の演算処理で行っていることは以下のように換言できる。すなわち、各ブロック画像は、最大エントロピーを有するブロック画像の画素値Ijk(x、y)とされることによって、ゲイン(露出;明るさ)が調整された且つ情報量の多い(コントラストの高い高画質な)好適な画像となる。しかしながら、各ブロック画像をこのまま画素値Ijk(x、y)としたのでは、各ブロック画像に境界が生じて全体が所謂モザイク画像のようになってしまう。そこで、このIjk(x、y)に対して、ブロック中心までの距離を考慮した重み(ウエイトWjk(x、y))を掛けるようにすることで、各ブロック画像間に継ぎ目(境目)が無い(モザイク状の画像でない)ように、各ブロック画像の画素値がブレンドされて全体の露出やコントラストが適正化された高画質な1枚の画像(合成画像O)を得ることができる。   What is performed in the above arithmetic processing can be rephrased as follows. In other words, each block image has a pixel value Ijk (x, y) of the block image having the maximum entropy, so that the gain (exposure; brightness) is adjusted and the amount of information is large (high image quality with high contrast). A) suitable image. However, if each block image is set to the pixel value Ijk (x, y) as it is, a boundary is generated in each block image and the whole becomes a so-called mosaic image. Therefore, there is no seam (border) between the block images by multiplying this Ijk (x, y) by a weight (weight Wjk (x, y)) considering the distance to the block center. As in the case of (not a mosaic image), it is possible to obtain a single high-quality image (synthesized image O) in which the pixel values of each block image are blended to optimize the overall exposure and contrast.

上記ブロック中心までの距離を考慮した重みとは、或るブロック画像において或る注目画素(x、y)を考えた場合の、この注目画素からブロック画像の中心画素までの距離に応じた重みであって、中心画素までの距離が近い注目画素ほど重みが大きなものとなる、すなわちブロックの中心に近い位置にある画素ほど、このブロック画像の画素値Ijk(x、y)の値を使用する割合(ウエイト)が大きくなり、一方、遠い位置にある画素つまりブロック境界に近い位置にある画素ほどこのブロック画像の画素値Ijk(x、y)の値を使用する割合が小さくなる。   The weight in consideration of the distance to the block center is a weight according to the distance from the target pixel to the center pixel of the block image when a target pixel (x, y) is considered in a block image. The ratio of using the value of the pixel value Ijk (x, y) of the block image for the pixel of interest that is closer to the center pixel is greater in weight, that is, the pixel that is closer to the center of the block. On the other hand, the ratio of using the pixel value Ijk (x, y) of the block image decreases as the pixel is farther away, that is, the pixel is closer to the block boundary.

なお、或る注目画素(x、y)からの距離を求めるときの画素は、必ずしもブロック中心の画素(中心座標)でなくともよく、ブレンドするに際して各ブロックにおいて基準となる位置(基準位置、基準点)であれば何れの位置(基準位置、基準座標)又は画素(基準画素)であってもよい。また、上記では各ブロックを矩形の領域に分割したが、当該領域の形状は矩形でなくともよく、例えば曲線によって分割されてなる形状(曲線領域)でもよい。要は1枚の画像が任意な形状(自由形状)の部分領域に分割されればよい。ただし、上記基準となる位置は、例えば空間的に或いは輝度的に基準となる位置である。また、上記部分領域の中心に相当する位置として“重心”或いは“図心”を求めてもよい。これらのことは後述の各実施形態においても同様である。   Note that the pixel for obtaining the distance from a certain pixel of interest (x, y) is not necessarily the pixel at the center of the block (center coordinate), and the position (reference position, reference) in each block when blending Any position (reference position, reference coordinates) or pixel (reference pixel) may be used. In the above description, each block is divided into rectangular areas. However, the shape of the area may not be rectangular, and may be a shape (curved area) divided by a curve, for example. In short, a single image may be divided into partial regions having an arbitrary shape (free shape). However, the reference position is, for example, a spatial or luminance reference position. Further, “centroid” or “centroid” may be obtained as a position corresponding to the center of the partial area. The same applies to each embodiment described later.

図5は、第1の実施形態に係るデジタルカメラ1のDR圧縮部63におけるDR圧縮処理(露出適正化処理)に関する動作の一例を示すフローチャートである。先ず撮像センサ3(リニアセンサ)による撮像によって撮影画像(線形画像)が取得される(ステップS1)。次に、画像生成部20によって、元画像Iに各種ゲイン(例えばゲイン値2.0、4.0、8.0)がかけられて当該各ゲインに対応する複数の擬似多重露光画像が生成され(ステップS2)、ヒストグラム作成部32によって、ブロック分割部31で分割された元画像Iのブロック画像毎に上記横軸をN/Gmaxとしたヒストグラムが作成される(ステップS3)。そして、エントロピー算出部33によって、各ブロック画像のエントロピーが算出され(ステップS4)、選択部34によって、同じブロック配列位置(j、k)のブロック画像同士が比較されて、最もエントロピーが高いブロック画像(最大エントロピー画像番号Ijk)が選択される(ステップS5)。そして、ブレンド部40によって、当該選択されたエントロピー最大のブロック画像同士が合成(ブレンド)されて1枚の画像(合成画像O)が得られる、すなわち複数枚の擬似多重露光画像から、各ブロック部の露出が最適化された1枚の画像が合成される(ステップS6)。   FIG. 5 is a flowchart illustrating an example of an operation related to the DR compression processing (exposure optimization processing) in the DR compression unit 63 of the digital camera 1 according to the first embodiment. First, a captured image (linear image) is acquired by imaging with the imaging sensor 3 (linear sensor) (step S1). Next, the image generation unit 20 applies various gains (for example, gain values 2.0, 4.0, and 8.0) to the original image I to generate a plurality of pseudo multiple exposure images corresponding to the respective gains. (Step S2) The histogram creation unit 32 creates a histogram with the horizontal axis set to N / Gmax for each block image of the original image I divided by the block division unit 31 (step S3). Then, the entropy calculation unit 33 calculates the entropy of each block image (step S4), and the selection unit 34 compares the block images at the same block arrangement position (j, k) with each other, so that the block image having the highest entropy is obtained. (Maximum entropy image number Ijk) is selected (step S5). Then, the blend unit 40 synthesizes (blends) the selected block images with the maximum entropy to obtain one image (synthesized image O). That is, each block unit is obtained from a plurality of pseudo multiple exposure images. One image with optimized exposure is synthesized (step S6).

(実施形態2)
上記第1の実施形態では、ヒストグラムを作成する際に横軸の階調数をN/Gmaxとしたが、この代わりに、第2の実施形態では、生成された擬似多重露光画像を空間的に平滑化する(ヒストグラムの作成は通常の階調数Nで行う)。これにより、第2の実施形態におけるデジタルカメラ1は、上記DR圧縮部63の代わりにDR圧縮部63aの構成を備える。
(Embodiment 2)
In the first embodiment, the number of gradations on the horizontal axis is set to N / Gmax when creating the histogram. Instead, in the second embodiment, the generated pseudo multiple exposure image is spatially converted. Smoothing is performed (histogram creation is performed with the normal number of gradations N). Accordingly, the digital camera 1 in the second embodiment includes a configuration of a DR compression unit 63 a instead of the DR compression unit 63.

図6は、第2の実施形態に係るデジタルカメラ1におけるDR圧縮部63aの一回路構成例を示す機能ブロック図である。DR圧縮部63aは、DR圧縮部63と比べて画像平滑化処理部50、エントロピー演算部30a及びブレンド部40aが異なる。画像平滑化処理部50は、画像生成部20により上述の方法で生成された擬似多重露光画像M1、M2及びM3に対して空間的な平滑化処理(画像平滑化処理という)を行うものである。具体的には、擬似多重露光画像M1、M2及びM3に対して所定のLPF処理を施す。なお、この平滑化処理により擬似多重露光画像M1’、M2’及びM3’が得られる。   FIG. 6 is a functional block diagram illustrating a circuit configuration example of the DR compression unit 63a in the digital camera 1 according to the second embodiment. The DR compression unit 63a differs from the DR compression unit 63 in an image smoothing processing unit 50, an entropy calculation unit 30a, and a blending unit 40a. The image smoothing processing unit 50 performs spatial smoothing processing (referred to as image smoothing processing) on the pseudo multiple exposure images M1, M2, and M3 generated by the above-described method by the image generating unit 20. . Specifically, predetermined LPF processing is performed on the pseudo multiple exposure images M1, M2, and M3. Note that pseudo multiple exposure images M1 ', M2', and M3 'are obtained by this smoothing process.

エントロピー演算部30aは、画像平滑化処理部50により求められた擬似多重露光画像M1’、M2’及びM3’における各ブロック画像のエントロピーを算出する。すなわち、ブロック分割部31aは、各画像M1’、M2’及びM3’をそれぞれ所定の分割数例えば上記と同様にj×k個のブロック画像に分割する。ヒストグラム作成部32aは、各画像M1’、M2’及びM3’におけるj×k個の各ブロック画像のヒストグラムを作成する。これにより作成されたヒストグラムは例えば後述のヒストグラムH6のようになる。このとき、ヒストグラムの横軸は、通常どおり、画像の階調数N(上記と同様に8ビット画像での256)とする。   The entropy calculation unit 30a calculates the entropy of each block image in the pseudo multiple exposure images M1 ', M2', and M3 'obtained by the image smoothing processing unit 50. That is, the block dividing unit 31a divides each image M1 ', M2', and M3 'into a predetermined number of divisions, for example, j * k block images as described above. The histogram creation unit 32a creates a histogram of each j × k block image in each image M1 ′, M2 ′, and M3 ′. The histogram created in this way is, for example, a histogram H6 described later. At this time, the horizontal axis of the histogram is assumed to be the number of gradations N of the image as usual (256 in the case of an 8-bit image as described above).

エントロピー算出部33aは、このヒストグラムに基づいて、以下の(6)式により各ブロック画像のエントロピーを算出する。   Based on this histogram, the entropy calculation unit 33a calculates the entropy of each block image using the following equation (6).

Figure 2008219230
但し、記号「Pi」は、各ブロック画像における画素値iの出現確率(上記ヒストグラム作成部32aにより作成されたヒストグラムの各配列(i)の柱の度数値÷ブロック画像の画素数)を示す。
Figure 2008219230
However, the symbol “Pi” indicates the appearance probability of the pixel value i in each block image (the frequency value of the column in each array (i) of the histogram created by the histogram creation unit 32a / the number of pixels in the block image).

選択部34aは、エントロピー算出部33aにより算出された、各画像M1’、M2’及びM3’におけるj×k個のブロック画像の各エントロピーを、同じブロック配列位置(j、k)のブロック画像同士で比較して、最もエントロピーが高いブロック画像の画像番号Ijk(最大エントロピー情報)を選択する。ここで求めた最大エントロピー情報はブレンド部40aに入力される。   The selection unit 34a calculates the entropy of the j × k block images in the images M1 ′, M2 ′, and M3 ′ calculated by the entropy calculation unit 33a between the block images at the same block arrangement position (j, k). And the image number Ijk (maximum entropy information) of the block image having the highest entropy is selected. The maximum entropy information obtained here is input to the blend unit 40a.

ブレンド部40aは、入力された最大エントロピー情報に基づいて、擬似多重露光画像M1’、M2’及びM3’の合成(ブレンド処理)を行う。すなわち、ブレンド部40と同様に、上記(3)〜(5)式を用いて、各画像M1’、M2’及びM3’におけるエントロピー最大のブロック画像だけを集めて1枚の画像に合成して合成画像Oとして出力する。   The blending unit 40a performs synthesis (blending processing) of the pseudo multiple exposure images M1 ', M2', and M3 'based on the input maximum entropy information. That is, like the blend unit 40, only the block images with the maximum entropy in each of the images M1 ′, M2 ′, and M3 ′ are collected and combined into one image using the above equations (3) to (5). Output as a composite image O.

本実施形態では、このように、初めに擬似多重露光画像に対して平滑化処理を施しておき、この平滑化処理後の擬似多重露光画像からヒストグラムを作成するので、例えば擬似多重露光画像M’(ゲイン値が2の場合)で考えた場合、図7に示すように、元画像IのヒストグラムH5(図13のヒストグラムH1に相当する)が、ヒストグラムH6のように変わることになる。この場合、ヒストグラムH6は、ヒストグラムH5に比べて横軸座標値(画素値)が2倍となっているが、図13に示すヒストグラムH2と違い、ヒストグラムの「歯抜け」が解消つまりヒストグラムの補間が行われている。なお、ヒストグラムH6は、ヒストグラムH2と比べて、各柱の高さ(各画素値iにおける度数)が小さくなる(高さは約半分になる)ものの、ヒストグラム全体における各柱の度数の合計値(全体度数)はヒストグラムH2の全体度数よりも大きくなっている。これは、上記(6)式中における“−Pi・log(Pi)”にも示されるとおり、出現確率Pi(柱の高さ)が小さいほど全体(−Pi・log(Pi))での情報量(エントロピー)が多くなるという理論に基づくものである。   In this embodiment, since the pseudo multiple exposure image is first subjected to the smoothing process and the histogram is created from the pseudo multiple exposure image after the smoothing process, for example, the pseudo multiple exposure image M ′ When considering (when the gain value is 2), as shown in FIG. 7, the histogram H5 of the original image I (corresponding to the histogram H1 of FIG. 13) changes like a histogram H6. In this case, the horizontal axis coordinate value (pixel value) of the histogram H6 is twice that of the histogram H5. However, unlike the histogram H2 shown in FIG. 13, the “tooth missing” of the histogram is eliminated, that is, the interpolation of the histogram. Has been done. The histogram H6 has a smaller height (frequency at each pixel value i) (the height is about half) than the histogram H2, but the total value ( The overall frequency) is larger than the overall frequency of the histogram H2. As indicated by “−Pi · log (Pi)” in the above equation (6), the smaller the appearance probability Pi (the height of the column), the smaller the information in the whole (−Pi · log (Pi)). This is based on the theory that the amount (entropy) increases.

また、この場合も、各多重露光画像に対応するヒストグラムの各柱の度数がゲインに応じて異なる度数となっている。すなわち、上述と同様、例えばゲイン値2.0、4.0、8.0それぞれの場合の各多重露光画像のヒストグラムを考えると、この各ヒストグラムの各柱の度数、例えば画素値i=1の柱の度数は互いに異なる値となっており、また、このヒストグラムの画素値i=1の度数は、元画像IのヒストグラムH1の同じ柱位置である画素値i=1の柱の度数と比べて、それぞれゲインに応じて異なる値となっている。   Also in this case, the frequency of each column of the histogram corresponding to each multiple exposure image is different depending on the gain. That is, in the same manner as described above, for example, when considering the histogram of each multiple exposure image with gain values of 2.0, 4.0, and 8.0, the frequency of each column of each histogram, for example, the pixel value i = 1. The frequency of the column is different from each other, and the frequency of the pixel value i = 1 in this histogram is compared with the frequency of the column of the pixel value i = 1 at the same column position in the histogram H1 of the original image I. Each has a different value depending on the gain.

このように、第2の実施形態の場合も、従来では画素値にゲインをかけても全体度数が変化しなかったものが、ゲインに応じて全体度数(エントロピー)が変化するようになる、すなわちゲインに応じてヒストグラムの各柱の度数が異なるものとなることから、ゲイン値に応じたエントロピーによる画像の視認性の評価が可能となる。   As described above, also in the second embodiment, the total frequency (entropy) does not change even when the pixel value is gained by the conventional gain, but the total frequency (entropy) changes according to the gain. Since the frequency of each column of the histogram differs according to the gain, it is possible to evaluate the visibility of the image by entropy according to the gain value.

図8は、第2の実施形態に係るデジタルカメラ1のDR圧縮部63aにおけるDR圧縮処理(露出適正化処理)に関する動作の一例を示すフローチャートである。先ず撮像センサ3(リニアセンサ)による撮像によって撮影画像(線形画像)が取得される(ステップS11)。次に、画像生成部20によって、元画像Iに各種ゲイン(例えばゲイン値2.0、4.0、8.0)がかけられて当該各ゲインに対応する複数の擬似多重露光画像が生成され(ステップS12)、画像平滑化処理部50によって、この生成された各擬似多重露光画像に対してLPF処理等による画像平滑化処理が行われる(ステップS13)。次に、ヒストグラム作成部32aによって、上記平滑化処理後の各擬似多重露光画像(画像M1’、M2’及びM3’)がブロック分割部31aで分割されたブロック画像毎に、横軸が階調数Nのヒストグラムが作成される(ステップS14)。そして、エントロピー算出部33aによって各ブロック画像のエントロピーが算出され(ステップS15)、選択部34aによって、当該画像M1’、M2’及びM3’における同じブロック配列位置(j、k)のブロック画像同士が比較されて、最もエントロピーが高いブロック画像(最大エントロピー画像番号Ijk)が選択される(ステップS16)。そして、ブレンド部40aによって、当該選択されたエントロピー最大のブロック画像同士が合成(ブレンド)されて1枚の画像(合成画像O)が得られる、すなわち複数枚の擬似多重露光画像から、各ブロック部の露出が最適化された1枚の画像が合成される(ステップS17)。   FIG. 8 is a flowchart illustrating an example of an operation related to the DR compression process (exposure optimization process) in the DR compression unit 63a of the digital camera 1 according to the second embodiment. First, a captured image (linear image) is acquired by imaging with the imaging sensor 3 (linear sensor) (step S11). Next, the image generation unit 20 applies various gains (for example, gain values 2.0, 4.0, and 8.0) to the original image I to generate a plurality of pseudo multiple exposure images corresponding to the respective gains. (Step S12) The image smoothing processing unit 50 performs image smoothing processing such as LPF processing on each generated pseudo multiple exposure image (Step S13). Next, for each block image obtained by dividing each of the pseudo multiple exposure images (images M1 ′, M2 ′, and M3 ′) after the smoothing process by the block dividing unit 31a by the histogram creating unit 32a, the horizontal axis indicates the gradation. A number N of histograms are created (step S14). Then, the entropy of each block image is calculated by the entropy calculation unit 33a (step S15), and the block images at the same block arrangement position (j, k) in the images M1 ′, M2 ′, and M3 ′ are calculated by the selection unit 34a. By comparison, the block image having the highest entropy (maximum entropy image number Ijk) is selected (step S16). Then, the selected block image having the maximum entropy is synthesized (blended) by the blend unit 40a to obtain one image (synthesized image O). That is, each block unit is obtained from a plurality of pseudo multiple exposure images. A single image with optimized exposure is synthesized (step S17).

(実施形態3)
上記第1の実施形態では、ヒストグラムを作成する際に横軸の階調数をN/Gmaxとしたが、この代わりに、第3の実施形態では、ヒストグラムの作成は通常の階調数Nで行い、この作成したヒストグラムを平滑化する(歯抜け型ヒストグラムを補間する)。これにより、第3の実施形態におけるデジタルカメラ1は、上記DR圧縮部63の代わりにDR圧縮部63cの構成を備える。
(Embodiment 3)
In the first embodiment, the number of gradations on the horizontal axis is set to N / Gmax when creating a histogram. Instead, in the third embodiment, the creation of a histogram is performed with a normal number of gradations N. And smoothing the created histogram (interpolating the tooth loss type histogram). Accordingly, the digital camera 1 according to the third embodiment includes the configuration of the DR compression unit 63 c instead of the DR compression unit 63.

図9は、第3の実施形態に係るデジタルカメラ1におけるDR圧縮部63cの一回路構成例を示す機能ブロック図である。DR圧縮部63cは、DR圧縮部63と比べてエントロピー演算部30c及びブレンド部40cが異なる(DR圧縮部63bと比べて画像平滑化処理部50が削除され、ヒストグラム平滑化処理部35が追加されている)。   FIG. 9 is a functional block diagram illustrating a circuit configuration example of the DR compression unit 63c in the digital camera 1 according to the third embodiment. The DR compression unit 63c is different from the DR compression unit 63 in the entropy calculation unit 30c and the blending unit 40c (the image smoothing processing unit 50 is deleted and the histogram smoothing processing unit 35 is added compared to the DR compression unit 63b). ing).

エントロピー演算部30cは、画像生成部20により求められた擬似多重露光画像M1、M2及びM3における各ブロック画像のエントロピーを算出する。ブロック分割部31cは、各画像M1、M2及びM3をそれぞれ所定の分割数例えば上記と同様にj×k個のブロック画像に分割する。ヒストグラム作成部32cは、各画像M1、M2及びM3におけるj×k個の各ブロック画像のヒストグラムを作成する。これにより作成されたヒストグラムは例えば上述のヒストグラムH6のようになる。このとき、ヒストグラムの横軸は、通常どおり、画像の階調数N(上記と同様に8ビット画像での256)とする。   The entropy calculation unit 30c calculates the entropy of each block image in the pseudo multiple exposure images M1, M2, and M3 obtained by the image generation unit 20. The block dividing unit 31c divides each of the images M1, M2, and M3 into a predetermined number of divisions, for example, j × k block images as described above. The histogram creation unit 32c creates a histogram of each j × k block image in each of the images M1, M2, and M3. The histogram created in this way is, for example, the above-described histogram H6. At this time, the horizontal axis of the histogram is assumed to be the number of gradations N of the image as usual (256 in the case of an 8-bit image as described above).

ヒストグラム平滑化処理部35は、ヒストグラム作成部32cにより作成された各ブロック画像のヒストグラムに対する平滑化処理(ヒストグラム平滑化処理という)を行うものである。具体的には、ヒストグラムの作成における各配列位置のカウントアップ後のN個(256個)の配列(柱)に対する移動平均処理を行う(移動平均値を求める)ことで、直接、ヒストグラムを平滑化する。当該移動平均による平滑化によって、後述のヒストグラムH6に示すように、柱間の隙間がこの前後の柱の度数を平均した度数を有する柱等で補間される。なお、この移動平均による方法に限らず、要はヒストグラムが平滑化される方法であれば何れの方法でもよく、例えば柱間の隙間がこれの前又は後位置の柱と同じ度数を有する柱で補間されるような方法でもよい。   The histogram smoothing processing unit 35 performs smoothing processing (referred to as histogram smoothing processing) on the histogram of each block image created by the histogram creating unit 32c. Specifically, the histogram is directly smoothed by performing a moving average process (determining a moving average value) on N (256) arrays (columns) after counting up each array position in the creation of the histogram. To do. By the smoothing by the moving average, as shown in a histogram H6 described later, the gap between the columns is interpolated by a column having a frequency obtained by averaging the frequencies of the columns before and after this. Note that this method is not limited to the method based on the moving average, and any method may be used as long as the histogram is smoothed. For example, the gap between the columns is a column having the same frequency as that of the column before or after the column. An interpolated method may be used.

エントロピー算出部33cは、この平滑化された各ブロック画像のヒストグラムから、上記と同様に(6)式を用いて各ブロック画像のエントロピーを算出する。選択部34cは、エントロピー算出部33cにより算出された、各画像M1、M2及びM3におけるj×k個のブロック画像の各エントロピーを、同じブロック配列位置(j、k)のブロック画像同士で比較して、最もエントロピーが高いブロック画像の画像番号Ijk(最大エントロピー情報)を選択する。ここで求めた最大エントロピー情報はブレンド部40cに入力される。   The entropy calculation unit 33c calculates the entropy of each block image from the smoothed histogram of each block image using the equation (6) in the same manner as described above. The selection unit 34c compares the entropies of j × k block images in the images M1, M2, and M3 calculated by the entropy calculation unit 33c between the block images at the same block arrangement position (j, k). Thus, the image number Ijk (maximum entropy information) of the block image having the highest entropy is selected. The maximum entropy information obtained here is input to the blend unit 40c.

ブレンド部40cは、入力された最大エントロピー情報に基づいて、擬似多重露光画像M1、M2及びM3の合成(ブレンド処理)を行う。すなわち、ブレンド部40と同様に、上記(3)〜(5)式を用いて、各画像M1、M2及びM3におけるエントロピー最大のブロック画像だけを集めて1枚の画像に合成して合成画像Oとして出力する。   The blend unit 40c performs synthesis (blend processing) of the pseudo multiple exposure images M1, M2, and M3 based on the input maximum entropy information. That is, similarly to the blending unit 40, using the above equations (3) to (5), only the block images with the maximum entropy in each of the images M1, M2, and M3 are collected and combined into one image to be a combined image O. Output as.

本実施形態では、このように、求めたヒストグラム自身を平滑化するので、この場合も第2の実施形態と同様(ゲイン値が2の場合とする)、元画像IのヒストグラムH5がヒストグラムH6のように変わる(図7参照)ことになり、ヒストグラムH2のような“歯抜け”が解消(補間)される。したがってこの第3の実施形態の場合も、従来では画素値にゲインをかけても全体度数が変化しなかったものが、ゲインに応じて全体度数(エントロピー)が変化する、すなわち上記と同様にゲインに応じてヒストグラムの各柱の度数が異なるものとなることから、ゲイン値に応じたエントロピーによる画像の視認性の評価が可能となる。   In this embodiment, since the obtained histogram itself is smoothed in this way, the histogram H5 of the original image I is also the histogram H6 in this case as in the second embodiment (assuming the gain value is 2). (See FIG. 7), and “tooth missing” such as the histogram H2 is eliminated (interpolated). Therefore, in the case of the third embodiment as well, the total frequency does not change even if the pixel value is gained conventionally, but the total frequency (entropy) changes according to the gain. Since the frequency of each column of the histogram differs depending on the image, it becomes possible to evaluate the visibility of the image by entropy according to the gain value.

図10は、第3の実施形態に係るデジタルカメラ1のDR圧縮部63cにおけるDR圧縮処理(露出適正化処理)に関する動作の一例を示すフローチャートである。先ず撮像センサ3(リニアセンサ)による撮像によって撮影画像(線形画像)が取得される(ステップS21)。次に、画像生成部20によって、元画像Iに各種ゲイン(例えばゲイン値2.0、4.0、8.0)がかけられて当該各ゲインに対応する複数の擬似多重露光画像が生成される(ステップS22)。生成された各擬似多重露光画像はエントロピー演算部30cに入力されてブロック分割部31cにより複数のブロック画像に分割され、ヒストグラム作成部32cによって、当該ブロック画像毎に横軸が階調数Nのヒストグラムが作成される(ステップS23)。そして、ヒストグラム平滑化処理部35によって、このヒストグラムに対する移動平均処理等が行われて各ブロック画像のヒストグラムが平滑化される(ステップS24)。次に、エントロピー算出部33cによって当該各ブロック画像のエントロピーが算出され(ステップS25)、選択部34cによって、当該画像M1、M2及びM3における同じブロック配列位置(j、k)のブロック画像同士が比較されて、最もエントロピーが高いブロック画像(最大エントロピー画像番号Ijk)が選択される(ステップS26)。そして、ブレンド部40cによって、当該選択されたエントロピー最大のブロック画像同士が合成(ブレンド)されて1枚の画像(合成画像O)が得られる、すなわち複数枚の擬似多重露光画像から、各ブロック部の露出が最適化された1枚の画像が合成される(ステップS27)。   FIG. 10 is a flowchart illustrating an example of an operation related to DR compression processing (exposure optimization processing) in the DR compression unit 63c of the digital camera 1 according to the third embodiment. First, a captured image (linear image) is acquired by imaging with the imaging sensor 3 (linear sensor) (step S21). Next, the image generation unit 20 applies various gains (for example, gain values 2.0, 4.0, and 8.0) to the original image I to generate a plurality of pseudo multiple exposure images corresponding to the respective gains. (Step S22). Each generated pseudo multiple exposure image is input to the entropy computing unit 30c and divided into a plurality of block images by the block dividing unit 31c, and the histogram creating unit 32c has a histogram with the number of gradations N on the horizontal axis for each block image. Is created (step S23). Then, the histogram smoothing processing unit 35 performs a moving average process on the histogram to smooth the histogram of each block image (step S24). Next, the entropy calculation unit 33c calculates the entropy of each block image (step S25), and the selection unit 34c compares the block images at the same block arrangement position (j, k) in the images M1, M2, and M3. Then, the block image with the highest entropy (maximum entropy image number Ijk) is selected (step S26). Then, the selected block image having the maximum entropy is synthesized (blended) by the blend unit 40c to obtain one image (synthesized image O). That is, each block unit is obtained from a plurality of pseudo multiple exposure images. One image with optimized exposure is synthesized (step S27).

以上のように、上記各実施形態に係る撮像装置(デジタルカメラ1)によれば、生成手段(画像生成部20)によって、1つの元画像Iから、該元画像Iに異なるゲイン(例えばゲイン値2.0、4.0、6.0)をかけることで露出の異なる複数の露出画像(多重露光画像;擬似多重露光画像)が生成され、差異手段(ヒストグラム作成部32、画像平滑化処理部50又はヒストグラム平滑化処理部35)によって、ゲイン(ゲイン値)に応じて、複数の露出画像それぞれに対応するヒストグラム(例えばヒストグラムH4、H6)の各柱の度数が異ならせられ、算出手段(エントロピー算出部33、33a、33c)によって、このゲインに応じて各柱の度数が異なる各ヒストグラム(上記ヒストグラムH4、H6)に基づいて、各露出画像に対応するエントロピーがそれぞれ算出される。すなわち、各露出画像が1つの画像(元画像I)から作成されるので、露出の異なる複数枚の露出画像それぞれを撮影する必要がなく、これら複数枚の画像間の被写体ブレの発生が防止される。また、各露出画像のヒストグラムの各柱の度数がゲインに応じて異なるものとなるので、これらヒストグラム(各露出画像に対応する各ヒストグラム)から求めたエントロピーも各露出画像で異なるものとなる(各露出画像のエントロピーに差異が生じる)。したがって、1つの画像から生成された各露出画像のエントロピーを各露出画像に応じたエントロピーとして求めることができ、エントロピーを視認性の指標として使用することができるため、ひいては、例えばこのエントロピーの情報を用いて、複数の露出画像から露出やコントラストが適正化された高画質な1つの画像を得るといったことが可能となる。   As described above, according to the imaging apparatus (digital camera 1) according to each of the embodiments described above, the generation unit (image generation unit 20) causes a gain (for example, a gain value) that is different from one original image I to the original image I. 2.0, 4.0, 6.0) to generate a plurality of exposure images (multi-exposure images; pseudo-multi-exposure images) having different exposures, and a difference means (histogram creation unit 32, image smoothing processing unit) 50 or the histogram smoothing processing unit 35), the frequency of each column of the histogram (for example, histograms H4 and H6) corresponding to each of the plurality of exposure images is made different according to the gain (gain value), and the calculation means (entropy) The calculation units 33, 33a, 33c) each exposure based on the histograms (histograms H4, H6) in which the frequency of each column differs according to the gain. Entropy corresponding to the image are calculated. That is, since each exposure image is created from one image (original image I), it is not necessary to shoot each of a plurality of exposure images having different exposures, and the occurrence of subject blur between these plurality of images is prevented. The In addition, since the frequency of each column of the histogram of each exposure image differs depending on the gain, the entropy obtained from these histograms (each histogram corresponding to each exposure image) also differs for each exposure image (each Differences in the entropy of the exposed image). Therefore, the entropy of each exposure image generated from one image can be obtained as the entropy corresponding to each exposure image, and the entropy can be used as an indicator of visibility. By using it, it becomes possible to obtain one image with high image quality with appropriate exposure and contrast from a plurality of exposed images.

また、差異手段によって、各露出画像に対応する、元画像の各画素値がゲイン倍されることで各柱間に隙間が空いた状態の間欠状ヒストグラム(例えばヒストグラムH2)が、該柱間の隙間がなくなるように補間されるので、当該補間という簡易な方法を用いて、ゲインに応じて度数が異なる各露出画像のヒストグラム(例えばヒストグラムH4、H6)を容易に得ることができる。   Further, an intermittent histogram (for example, histogram H2) in which a gap is left between the columns by multiplying each pixel value of the original image corresponding to each exposed image by a gain by the difference means, Since the interpolation is performed so that there is no gap, it is possible to easily obtain histograms (for example, histograms H4 and H6) of the exposure images having different frequencies depending on the gain by using a simple method called interpolation.

また、分割手段(ブロック分割部31、31a、31c)によって、各露出画像が複数の部分画像(ブロック画像)に分割され、選択手段(選択部34、34a、34c)によって、各露出画像の同位置での部分画像それぞれに対応する、算出手段により算出された各エントロピーのうちから、最大のエントロピー(最大エントロピーの画像番号Ijk)が選択される。そして、合成手段(ブレンド部40、40a、40c)によって、最大のエントロピーを有する部分画像同士が合成されるので、エントロピーの情報を利用して、複数の露出画像から、画像各部(各部分画像)のエントロピーがいずれも最大となる1つの合成画像、すなわち露出やコントラストが適正化された高画質な画像を得ることができる。   Further, each exposure image is divided into a plurality of partial images (block images) by the dividing means (block dividing sections 31, 31a, 31c), and the same image of each exposure image is obtained by the selecting means (selecting sections 34, 34a, 34c). The maximum entropy (maximum entropy image number Ijk) is selected from each entropy calculated by the calculation means corresponding to each partial image at the position. Then, since the partial images having the maximum entropy are synthesized by the synthesizing means (blending units 40, 40a, and 40c), each part of the image (each partial image) is obtained from a plurality of exposure images using the information of entropy. It is possible to obtain a single composite image in which the entropy of all of the images is maximized, that is, a high-quality image in which exposure and contrast are optimized.

また、ヒストグラムが、横軸座標が階調値に対応する画素値で且つ縦軸座標が度数であるヒストグラムとされる。そして、差異手段が、複数の露出画像それぞれに対応するヒストグラム(例えばヒストグラムH4)を作成する作成手段(ヒストグラム作成部32)とされ、この差異手段によって、当該ヒストグラム(ヒストグラムH4)の作成に際して横軸座標がゲインに応じて縮小される。すなわち、単に、ゲインに応じて縮小された横軸座標を有するヒストグラムを作成するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   Also, the histogram is a histogram in which the horizontal axis coordinates are pixel values corresponding to the gradation values and the vertical axis coordinates are frequencies. The difference means is a creation means (histogram creation section 32) that creates a histogram (for example, histogram H4) corresponding to each of the plurality of exposure images. The difference means creates a horizontal axis when creating the histogram (histogram H4). The coordinates are reduced according to the gain. In other words, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of simply creating a histogram having the horizontal axis coordinates reduced according to the gain.

また、作成手段(ヒストグラム作成部32)によって、最大階調値がN/G(N/Gmax)である横軸座標を有したヒストグラムが作成されるので、ゲインに応じて縮小された横軸座標を有するヒストグラム(ヒストグラムH4)を容易に作成することができる。   Further, since the histogram having horizontal axis coordinates with the maximum gradation value of N / G (N / Gmax) is created by the creation means (histogram creation unit 32), the horizontal axis coordinates reduced according to the gain. It is possible to easily create a histogram (histogram H4) having

また、作成手段(ヒストグラム作成部32)によって、元画像の各画素値iがGの値で除算され、該除算により得られる整数値に対応する横軸座標における画素値の度数がカウント(カウントアップ)されるので、このように簡易な度数のカウント方法を用いて、最大階調値がN/Gである横軸座標を有したヒストグラム(ヒストグラムH4)を元画像Iから容易に作成することができる。   Further, each pixel value i of the original image is divided by the G value by the creating means (histogram creating unit 32), and the frequency of the pixel value on the horizontal axis corresponding to the integer value obtained by the division is counted (counted up). Therefore, it is possible to easily create a histogram (histogram H4) having a horizontal axis coordinate having a maximum gradation value of N / G from the original image I by using a simple frequency counting method. it can.

また、差異手段が、エントロピーの算出前に、各露出画像を空間的に平滑化する画像平滑化手段(画像平滑化処理部50)とされるので、すなわち画像平滑化手段によって各露出画像が空間的に平滑化されるので、この平滑化された各露出画像から作成したヒストグラム(例えばヒストグラムH6)が、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像を空間的に平滑化するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   Further, since the difference means is an image smoothing means (image smoothing processing unit 50) that spatially smoothes each exposure image before entropy calculation, that is, each exposure image is spatially converted by the image smoothing means. Therefore, the histogram (for example, the histogram H6) created from each of the smoothed exposure images becomes a histogram having a different frequency depending on the gain. As described above, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of spatially smoothing each exposure image.

また、画像平滑化手段によって、各露出画像に対してLPF処理が行われるので、LPF処理という簡易な方法で、容易に各露出画像を空間的に平滑化することができる。   Further, since the LPF processing is performed on each exposure image by the image smoothing means, each exposure image can be spatially smoothed easily by a simple method called LPF processing.

また、差異手段が、エントロピーの算出前に、作成手段により作成された各露出画像のヒストグラム(例えばヒストグラムH2)を平滑化するヒストグラム平滑化手段(ヒストグラム平滑化処理部35)とされる、すなわちヒストグラム平滑化手段によって各露出画像のヒストグラム(ヒストグラムH2)が平滑化されるので、この平滑化されたヒストグラム(例えばヒストグラムH6)が、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像のヒストグラムを平滑化するという簡易な方法で、各露出画像に対応するヒストグラムの度数をゲインに応じて異ならせることが可能となる。   Further, the difference means is a histogram smoothing means (histogram smoothing processing unit 35) for smoothing a histogram (for example, histogram H2) of each exposure image created by the creating means before calculating the entropy. Since the histogram (histogram H2) of each exposure image is smoothed by the smoothing means, this smoothed histogram (for example, histogram H6) becomes a histogram having different frequencies depending on the gain. In this way, the frequency of the histogram corresponding to each exposure image can be varied according to the gain by a simple method of smoothing the histogram of each exposure image.

また、ヒストグラム平滑化手段によって、作成手段により作成されたヒストグラムに対する移動平均処理が行われることで該ヒストグラムが平滑化されるので、ヒストグラムに対する移動平均処理を行うという簡易な方法で、ヒストグラムを容易に平滑化することができる。   In addition, since the histogram smoothing unit smoothes the histogram by performing the moving average process on the histogram created by the creating unit, the histogram can be easily obtained by a simple method of performing the moving average process on the histogram. Can be smoothed.

また、合成手段によって、最大のエントロピーを有する部分画像の画素値(画素値Ijk(x、y))と、部分画像(ブロック画像(j、k))の画素値(注目画素(x、y))の位置から該部分画像(ブロック画像(j、k))の所定の基準位置(中心画素)までの距離に応じた重み(ウエイトWjk(x、y))と、が加重平均されることにより、当該部分画像同士の合成が行われるので、これら部分画像間に継ぎ目が無い(モザイク状の画像でない)ように各部分画像の画素値がブレンド(エントロピー・ブレンド処理)されて、全体の露出やコントラストが適正化された高画質な1枚の合成画像を得ることができる。   Further, the pixel value (pixel value Ijk (x, y)) of the partial image having the maximum entropy and the pixel value (target pixel (x, y)) of the partial image (block image (j, k)) are combined by the combining means. ) And a weight (weight Wjk (x, y)) corresponding to a distance from the position of the partial image (block image (j, k)) to a predetermined reference position (center pixel). Since the partial images are combined, the pixel values of the partial images are blended (entropy / blend processing) so that there is no seam between the partial images (not a mosaic image). It is possible to obtain a single high-quality composite image with an appropriate contrast.

また、本発明に係る画像処理方法によれば、第1の工程において、1つの元画像Iから、該元画像Iに異なるゲインをかけることで露出の異なる複数の露出画像(多重露光画像;擬似多重露光画像)が生成され、第2の工程において、ゲイン(ゲイン値)に応じて、複数の露出画像それぞれに対応するヒストグラム(例えばヒストグラムH4、H6)の各柱の度数が異ならせられ、第3の工程において、このゲインに応じて各柱の度数が異なる各ヒストグラム(上記ヒストグラムH4、H6)に基づいて、各露出画像に対応するエントロピーがそれぞれ算出される。すなわち、各露出画像が1つの画像(元画像I)から作成されるので、露出の異なる複数枚の画像(多重露光画像)それぞれを撮影する必要がなく、これら複数枚の画像間の被写体ブレの発生が防止される。また、各露出画像のヒストグラムの各柱の度数がゲインに応じて異なるものとなるので、これらヒストグラム(各露出画像に対応する各ヒストグラム)から求めたエントロピーも各露出画像で異なるものとなる(各露出画像のエントロピーに差異が生じる)。したがって、1つの画像から生成された各露出画像のエントロピーを各露出画像に応じたエントロピーとして求めることができ、エントロピーを視認性の指標として使用することができるため、ひいては、例えばこのエントロピーの情報を用いて、複数の露出画像から露出やコントラストが適正化された高画質な1つの画像を得るといったことが可能となる。   Further, according to the image processing method of the present invention, in the first step, a plurality of exposure images (multiple exposure images; pseudo-exposures) having different exposures are obtained by applying different gains to the original image I from one original image I. Multiple exposure images) are generated, and in the second step, the frequencies of the respective columns of the histograms (for example, histograms H4 and H6) corresponding to each of the plurality of exposure images are made different according to the gain (gain value). In step 3, the entropy corresponding to each exposure image is calculated based on the histograms (histograms H4 and H6) in which the frequencies of the columns differ according to the gain. That is, since each exposure image is created from one image (original image I), there is no need to shoot each of a plurality of images (multi-exposure images) with different exposures, and subject blurring between the plurality of images is not necessary. Occurrence is prevented. In addition, since the frequency of each column of the histogram of each exposure image differs depending on the gain, the entropy obtained from these histograms (each histogram corresponding to each exposure image) also differs for each exposure image (each Differences in the entropy of the exposed image). Therefore, the entropy of each exposure image generated from one image can be obtained as the entropy corresponding to each exposure image, and the entropy can be used as an indicator of visibility. By using it, it becomes possible to obtain one image with high image quality with appropriate exposure and contrast from a plurality of exposed images.

また、上記第2の工程が、複数の露出画像それぞれに対応するヒストグラムの作成に際して、階調値に対応する画素値を座標とする該ヒストグラム(例えばヒストグラムH4)の横軸座標がゲインに応じて縮小される工程とされるので、単に、ゲインに応じて縮小された横軸座標を有するヒストグラムを作成するという簡易な方法で、各露出画像に対応するヒストグラム(ヒストグラムH4)の度数をゲインに応じて異ならせることが可能となる。   Further, when the second step is to create a histogram corresponding to each of the plurality of exposure images, the horizontal axis coordinate of the histogram (for example, histogram H4) having the pixel value corresponding to the gradation value as a coordinate corresponds to the gain. Since the process is reduced, the frequency of the histogram (histogram H4) corresponding to each exposure image is simply set according to the gain by a simple method of creating a histogram having the horizontal axis coordinate reduced according to the gain. Can be different.

また、上記第2の工程が、第3の工程を行う前に、各露出画像を空間的に平滑化する工程とされるので、この平滑化された各露出画像から作成したヒストグラム(例えばヒストグラムH6)が、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像を空間的に平滑化するという簡易な方法で、各露出画像に対応するヒストグラム(ヒストグラムH6)の度数をゲインに応じて異ならせることが可能となる。   In addition, since the second step is a step of spatially smoothing each exposure image before performing the third step, a histogram (for example, histogram H6) created from each of the smoothed exposure images. ) Becomes a histogram having different frequencies depending on the gain. As described above, the frequency of the histogram (histogram H6) corresponding to each exposure image can be varied according to the gain by a simple method of spatially smoothing each exposure image.

さらに、上記第2の工程が、第3の工程を行う前に、複数の露出画像それぞれに対応して作成された各露出画像のヒストグラム(例えばヒストグラムH2)を平滑化する工程とされるので、この工程により平滑化されたヒストグラム(例えばヒストグラムH6)が、ゲインに応じて異なる度数を有するヒストグラムとなる。このように、各露出画像のヒストグラムを平滑化するという簡易な方法で、各露出画像に対応するヒストグラム(ヒストグラムH6)の度数をゲインに応じて異ならせることが可能となる。   Furthermore, since the second step is a step of smoothing a histogram (for example, histogram H2) of each exposure image created corresponding to each of the plurality of exposure images before performing the third step. The histogram (for example, histogram H6) smoothed by this process becomes a histogram having different frequencies depending on the gain. As described above, the frequency of the histogram (histogram H6) corresponding to each exposure image can be varied according to the gain by a simple method of smoothing the histogram of each exposure image.

なお、本発明は、以下の態様をとることができる。
(A)上記各実施形態では、撮像センサ3として一般的なリニアセンサを用いたが、広いダイナミックレンジ(広DR)での撮影が可能な撮像センサとして、センサ入射輝度が低い場合(暗時)に出力画素信号が線形的に変換されて出力される線形特性領域と、センサ入射輝度が高い場合(明時)に出力画素信号が対数的に変換されて出力される対数特性領域とからなる光電変換特性(線形/対数特性という;図11の左側図参照)を有するセンサ(リニアログセンサという)を用いてもよい。このリニアログセンサにより得られる線形/対数特性を有する画像を線形/対数画像と表現する。
In addition, this invention can take the following aspects.
(A) In each of the embodiments described above, a general linear sensor is used as the image sensor 3. However, when the sensor incident luminance is low (in the dark) as an image sensor capable of photographing in a wide dynamic range (wide DR). A linear characteristic region in which the output pixel signal is linearly converted and output, and a logarithmic characteristic region in which the output pixel signal is logarithmically converted and output when the sensor incident luminance is high (during light). A sensor (referred to as a linear log sensor) having conversion characteristics (referred to as linear / logarithmic characteristics; see the left side of FIG. 11) may be used. An image having linear / logarithmic characteristics obtained by this linear log sensor is expressed as a linear / logarithmic image.

上記リニアログセンサを用いる場合は、多重露光画像の生成方法が異なる。すなわちこの場合、先ず線形/対数特性における対数特性を線形特性に変換して一時的に線形特性の画像に統一する。この統一された線形特性画像に所定倍率のゲイン(例えば1.0、0.5、0.25倍)をかけることで、複数の多重露光画像(図11の右側図参照)を生成する。ただし、このとき最大画素値max(例えば8ビット画像ではmax=256)を超える場合はクリップする。これらの演算は画像生成部20によって行う。このようにして、リニアログセンサにより得られる画像(元画像I;線形/対数画像)から複数の多重露光画像(擬似多重露光画像)を容易に生成することができる。なお、生成したこの多重露光画像に対する後の露出適正化処理は上記各実施形態と同様である。   When the linear log sensor is used, a method for generating a multiple exposure image is different. That is, in this case, first, the logarithmic characteristic in the linear / logarithmic characteristic is converted into a linear characteristic and temporarily unified into an image having a linear characteristic. A plurality of multiple exposure images (see the right side of FIG. 11) are generated by applying a gain (for example, 1.0, 0.5, 0.25 times) with a predetermined magnification to the unified linear characteristic image. However, if the maximum pixel value max (for example, max = 256 for an 8-bit image) is exceeded, clipping is performed. These calculations are performed by the image generation unit 20. In this way, a plurality of multiple exposure images (pseudo multiple exposure images) can be easily generated from an image (original image I; linear / logarithmic image) obtained by the linear log sensor. The subsequent exposure optimization process for the generated multiple exposure image is the same as that in each of the above embodiments.

(B)上記各実施形態においては、元画像Iの露出適正化処理をデジタルカメラ1内(DR圧縮部63、63a、63c)において実行する構成となっているが、これに限らず、デジタルカメラ1外の所定の処理部において実行する構成としてもよい。具体的には、例えばUSB等を用いたデジタルカメラ1との直接接続又は無線接続された(ネットワーク接続された)或いはメモリカードといったストレージメディア等を用いて情報伝達可能に構成された、ユーザーインターフェイスを備える所定のホスト例えばPC(Personal Computer)やPDA(Personal Digital Assistant;個人向け携帯情報端末)において実行されてもよい。   (B) In each of the above embodiments, the exposure optimization processing for the original image I is executed in the digital camera 1 (DR compression units 63, 63a, 63c). It is good also as a structure performed in the predetermined | prescribed process part outside one. Specifically, for example, a user interface configured to be able to transmit information using a storage medium such as a direct connection or wireless connection (network connection) with a digital camera 1 using a USB or the like or a memory card is provided. It may be executed by a predetermined host provided, for example, a PC (Personal Computer) or a PDA (Personal Digital Assistant).

第1の実施形態に係る撮像装置の一例であるデジタルカメラの主に撮像処理に関する概略的なブロック構成図である。1 is a schematic block configuration diagram mainly relating to imaging processing of a digital camera which is an example of an imaging apparatus according to a first embodiment. FIG. 上記デジタルカメラにおける画像処理部の一回路構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 circuit structure of the image process part in the said digital camera. 上記画像処理部におけるDR圧縮部の一回路構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 circuit structure of DR compression part in the said image processing part. 第1の実施形態におけるヒストグラム作成によって、元画像のヒストグラムがどのようなヒストグラムに変化するかを概念的に説明するためのグラフ図である。FIG. 6 is a graph for conceptually explaining what kind of histogram the original image changes to as a result of histogram creation in the first embodiment. 第1の実施形態に係るデジタルカメラのDR圧縮部におけるDR圧縮処理(露出適正化処理)に関する動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement regarding DR compression process (exposure optimization process) in DR compression part of the digital camera which concerns on 1st Embodiment. 第2の実施形態に係るデジタルカメラにおけるDR圧縮部の一回路構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 circuit structure of DR compression part in the digital camera which concerns on 2nd Embodiment. 第2の実施形態における画像平滑化処理によって、元画像のヒストグラムがどのようなヒストグラムに変化するかを概念的に説明するためのグラフ図である。FIG. 11 is a graph for conceptually explaining what histogram of an original image changes by image smoothing processing in the second embodiment. 第2の実施形態に係るデジタルカメラのDR圧縮部におけるDR圧縮処理(露出適正化処理)に関する動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement regarding DR compression process (exposure optimization process) in DR compression part of the digital camera which concerns on 2nd Embodiment. 第3の実施形態に係るデジタルカメラにおけるDR圧縮部の一回路構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 circuit structure of DR compression part in the digital camera which concerns on 3rd Embodiment. 第3の実施形態に係るデジタルカメラのDR圧縮部におけるDR圧縮処理(露出適正化処理)に関する動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement regarding DR compression process (exposure optimization process) in DR compression part of the digital camera which concerns on 3rd Embodiment. 上記各実施形態の変形態様であって、撮像センサがリニアログセンサである場合の多重露光画像の生成方法について説明するためのグラフ図である。FIG. 10 is a graph for explaining a method of generating a multiple exposure image when the imaging sensor is a linear log sensor, which is a modification of each of the above embodiments. 擬似多重露光画像の生成(ゲイン)について説明するためのグラフ図である。It is a graph for demonstrating the production | generation (gain) of a pseudo multiple exposure image. 擬似多重露光画像の生成(ヒストグラム)について説明するためのグラフ図である。It is a graph for demonstrating the production | generation (histogram) of a pseudo multiple exposure image.

符号の説明Explanation of symbols

1 デジタルカメラ(撮像装置)
3 撮像センサ(撮影手段)
6 画像処理部
63、63a、63c DR圧縮部
20 画像生成部(生成手段)
30、30a、30c エントロピー演算部
31、31a、31c ブロック分割部(分割手段)
32 ヒストグラム作成部(差異手段)
32a、32c ヒストグラム作成部
33、33a、33c エントロピー算出部(算出手段)
34、34a、34c 選択部(選択手段)
35 ヒストグラム平滑化処理部(差異手段、ヒストグラム平滑化手段)
40、40a、40c ブレンド部(合成手段)
50 画像平滑化処理部(差異手段、画像平滑化手段)
H1、H3、H5 ヒストグラム
H2 ヒストグラム(間欠状ヒストグラム、請求項10、16に記載のヒストグラム)
H4 ヒストグラム(請求項1、4、5、13、14に記載のヒストグラム)
H6 ヒストグラム(請求項1、13に記載のヒストグラム)
1 Digital camera (imaging device)
3 Imaging sensor (photographing means)
6 Image processing units 63, 63a, 63c DR compression unit 20 Image generation unit (generation means)
30, 30a, 30c Entropy calculation unit 31, 31a, 31c Block division unit (division means)
32 Histogram creation part (difference means)
32a, 32c Histogram creation unit 33, 33a, 33c Entropy calculation unit (calculation means)
34, 34a, 34c Selection unit (selection means)
35 Histogram smoothing processing unit (difference means, histogram smoothing means)
40, 40a, 40c Blend part (synthesis means)
50 Image smoothing processing unit (difference means, image smoothing means)
H1, H3, H5 Histogram H2 Histogram (intermittent histogram, histogram according to claims 10 and 16)
H4 histogram (histogram according to claim 1, 4, 5, 13, 14)
H6 histogram (histogram according to claims 1 and 13)

Claims (16)

1つの元画像から、該元画像に異なるゲインをかけることで露出の異なる複数の露出画像を生成する生成手段と、
前記ゲインに応じて、前記複数の露出画像それぞれに対応するヒストグラムの各柱の度数を異ならせる差異手段と、
前記ゲインに応じて各柱の度数が異なる各ヒストグラムに基づいて、各露出画像に対応するエントロピーをそれぞれ算出する算出手段とを備えることを特徴とする撮像装置。
Generating means for generating a plurality of exposure images with different exposures by applying different gains to the original image from one original image;
Different means for varying the frequency of each column of the histogram corresponding to each of the plurality of exposure images according to the gain;
An imaging apparatus comprising: a calculating unit that calculates entropy corresponding to each exposure image based on each histogram in which the frequency of each column differs according to the gain.
前記差異手段は、
前記各露出画像に対応する、前記元画像の各画素値が前記ゲイン倍されることで各柱間に隙間が空いた状態の間欠状ヒストグラムを、該柱間の隙間がなくなるように補間することを特徴とする請求項1に記載の撮像装置。
The difference means is
Interpolating an intermittent histogram in which there is a gap between the columns by multiplying each pixel value of the original image corresponding to each exposure image by the gain so that there is no gap between the columns. The imaging apparatus according to claim 1.
前記各露出画像を複数の部分画像に分割する分割手段と、
前記各露出画像の同位置での部分画像それぞれに対応する、前記算出手段により算出された各エントロピーのうちから、最大のエントロピーを選択する選択手段と、
前記最大のエントロピーを有する部分画像同士を合成する合成手段とをさらに備えることを特徴とする請求項1又は2に記載の撮像装置。
Dividing means for dividing each of the exposed images into a plurality of partial images;
A selection unit that selects the maximum entropy from among each entropy calculated by the calculation unit, corresponding to each partial image at the same position of each exposure image,
The imaging apparatus according to claim 1, further comprising a combining unit that combines the partial images having the maximum entropy.
前記ヒストグラムは、横軸座標が階調値に対応する画素値で且つ縦軸座標が度数であるヒストグラムであり、
前記差異手段は、
前記複数の露出画像それぞれに対応するヒストグラムを作成する作成手段であって、
当該ヒストグラムの作成に際して前記横軸座標を前記ゲインに応じて縮小することを特徴とする請求項1〜3のいずれかに記載の撮像装置。
The histogram is a histogram in which a horizontal axis coordinate is a pixel value corresponding to a gradation value and a vertical axis coordinate is a frequency,
The difference means is
Creating means for creating a histogram corresponding to each of the plurality of exposure images,
The imaging apparatus according to claim 1, wherein the horizontal axis coordinates are reduced according to the gain when the histogram is created.
前記元画像の階調数をNとし、前記ゲインをGとすると、
前記作成手段は、
最大階調値がN/Gである前記横軸座標を有した前記ヒストグラムを作成することを特徴とする請求項4に記載の撮像装置。ただし、記号「/」は除算を示す。
When the number of gradations of the original image is N and the gain is G,
The creating means includes
The imaging apparatus according to claim 4, wherein the histogram having the horizontal axis coordinate having a maximum gradation value of N / G is created. However, the symbol “/” indicates division.
前記作成手段は、
前記元画像の各画素値を前記Gの値で除算し、該除算により得られる整数値に対応する前記横軸座標における画素値の度数をカウントすることを特徴とする請求項5に記載の撮像装置。
The creating means includes
6. The imaging according to claim 5, wherein each pixel value of the original image is divided by the G value, and the frequency of the pixel value in the horizontal coordinate corresponding to the integer value obtained by the division is counted. apparatus.
前記差異手段は、
前記エントロピーの算出前に、前記各露出画像を空間的に平滑化する画像平滑化手段であることを特徴とする請求項1〜3のいずれかに記載の撮像装置。
The difference means is
The imaging apparatus according to claim 1, wherein the imaging apparatus is an image smoothing unit that spatially smoothes each exposure image before calculating the entropy.
前記画像平滑化手段は、
前記各露出画像に対してローパスフィルタ処理を行うことを特徴とする請求項7に記載の撮像装置。
The image smoothing means includes
The imaging apparatus according to claim 7, wherein low-pass filter processing is performed on each exposure image.
前記複数の露出画像それぞれのヒストグラムを作成する作成手段をさらに備え、
前記差異手段は、
前記エントロピーの算出前に、前記作成手段により作成された各露出画像のヒストグラムを平滑化するヒストグラム平滑化手段であることを特徴とする請求項1〜3のいずれかに記載の撮像装置。
A creation means for creating a histogram of each of the plurality of exposure images;
The difference means is
The imaging apparatus according to claim 1, wherein the imaging apparatus is a histogram smoothing unit that smoothes a histogram of each exposure image created by the creation unit before calculating the entropy.
前記ヒストグラム平滑化手段は、
前記作成手段により作成されたヒストグラムに対する移動平均処理を行うことで該ヒストグラムを平滑化することを特徴とする請求項9に記載の撮像装置。
The histogram smoothing means includes:
The imaging apparatus according to claim 9, wherein the histogram is smoothed by performing a moving average process on the histogram created by the creation unit.
前記合成手段は、
前記最大のエントロピーを有する部分画像の画素値と、前記部分画像の画素値の位置から該部分画像の所定の基準位置までの距離に応じた重みと、を加重平均することにより、当該部分画像同士の合成を行うことを特徴とする請求項3に記載の撮像装置。
The synthesis means includes
By calculating the weighted average of the pixel value of the partial image having the maximum entropy and the weight according to the distance from the position of the pixel value of the partial image to the predetermined reference position of the partial image, the partial images The imaging apparatus according to claim 3, wherein:
前記元画像を撮影によって得る撮影手段をさらに備え、
前記撮影手段は、線形特性及び対数特性からなる光電変換特性を有するリニアログセンサであり、
前記生成手段は、前記リニアログセンサにより得られた元画像における光電変換特性を前記線形特性に統一した後、該線形特性に統一された元画像に対して異なるゲインをかけることで前記各露出画像を生成することを特徴とする請求項1〜11に記載の撮像装置。
It further comprises photographing means for obtaining the original image by photographing,
The photographing means is a linear log sensor having a photoelectric conversion characteristic composed of a linear characteristic and a logarithmic characteristic,
The generating means unifies the photoelectric conversion characteristics in the original image obtained by the linear log sensor to the linear characteristics, and then applies different gains to the original images unified to the linear characteristics, so that each exposure image The imaging apparatus according to claim 1, wherein:
1つの元画像から、該元画像に異なるゲインをかけることで露出の異なる複数の露出画像を生成する第1の工程と、
前記ゲインに応じて、前記複数の露出画像それぞれに対応するヒストグラムの各柱の度数を異ならせる第2の工程と、
前記ゲインに応じて各柱の度数が異なる各ヒストグラムに基づいて、各露出画像に対応するエントロピーをそれぞれ算出する第3の工程とを有することを特徴とする画像処理方法。
A first step of generating, from one original image, a plurality of exposure images having different exposures by applying different gains to the original image;
A second step of varying the frequency of each column of the histogram corresponding to each of the plurality of exposure images according to the gain;
And a third step of calculating entropy corresponding to each exposure image based on each histogram in which the frequency of each column differs according to the gain.
前記第2の工程は、
前記複数の露出画像それぞれに対応するヒストグラムの作成に際して、階調値に対応する画素値を座標とする該ヒストグラムの横軸座標を前記ゲインに応じて縮小する工程であることを特徴とする請求項13に記載の画像処理方法。
The second step includes
The step of reducing a horizontal axis coordinate of the histogram having a pixel value corresponding to a gradation value as a coordinate when generating a histogram corresponding to each of the plurality of exposure images according to the gain. 14. The image processing method according to 13.
前記第2の工程は、
前記第3の工程を行う前に、前記各露出画像を空間的に平滑化する工程であることを特徴とする請求項13に記載の画像処理方法。
The second step includes
The image processing method according to claim 13, wherein the exposure process is a process of spatially smoothing each exposure image before performing the third process.
前記第2の工程は、
前記第3の工程を行う前に、前記複数の露出画像それぞれに対応して作成された各露出画像のヒストグラムを平滑化する工程であることを特徴とする請求項13に記載の画像処理方法。
The second step includes
The image processing method according to claim 13, wherein before performing the third step, the step of smoothing a histogram of each exposure image created corresponding to each of the plurality of exposure images.
JP2007051141A 2007-03-01 2007-03-01 Imaging apparatus, and image processing method Pending JP2008219230A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007051141A JP2008219230A (en) 2007-03-01 2007-03-01 Imaging apparatus, and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007051141A JP2008219230A (en) 2007-03-01 2007-03-01 Imaging apparatus, and image processing method

Publications (1)

Publication Number Publication Date
JP2008219230A true JP2008219230A (en) 2008-09-18

Family

ID=39838783

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007051141A Pending JP2008219230A (en) 2007-03-01 2007-03-01 Imaging apparatus, and image processing method

Country Status (1)

Country Link
JP (1) JP2008219230A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010191593A (en) * 2009-02-17 2010-09-02 Honda Motor Co Ltd Device and method for detecting position of target object
JP2010191590A (en) * 2009-02-17 2010-09-02 Honda Motor Co Ltd Device and method for detecting position of target object
WO2011056994A3 (en) * 2009-11-04 2011-09-22 Board Of Regents, The University Of Texas System Adaptive automatic exposure apparatus and method for digital images
CN107592470A (en) * 2017-09-21 2018-01-16 陕西土豆数据科技有限公司 A kind of exposure algorithm applied to more lens sensors

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010191593A (en) * 2009-02-17 2010-09-02 Honda Motor Co Ltd Device and method for detecting position of target object
JP2010191590A (en) * 2009-02-17 2010-09-02 Honda Motor Co Ltd Device and method for detecting position of target object
WO2011056994A3 (en) * 2009-11-04 2011-09-22 Board Of Regents, The University Of Texas System Adaptive automatic exposure apparatus and method for digital images
US8743235B2 (en) 2009-11-04 2014-06-03 Board Of Regents, The University Of Texas System Adaptive automatic exposure apparatus and method for digital images
CN107592470A (en) * 2017-09-21 2018-01-16 陕西土豆数据科技有限公司 A kind of exposure algorithm applied to more lens sensors

Similar Documents

Publication Publication Date Title
JP5713752B2 (en) Image processing apparatus and control method thereof
US8488029B2 (en) Imaging apparatus, imaging method, integrated circuit, and storage medium
JP4678218B2 (en) Imaging apparatus and image processing method
US8970719B2 (en) Image processing apparatus and image processing method
JP5408053B2 (en) Image processing apparatus and image processing method
JP5672796B2 (en) Image processing apparatus and image processing method
WO2012108094A1 (en) Image processing device, image processing method, image processing program, and image pick-up device
JP4720537B2 (en) Imaging device
US20180077397A1 (en) Image processing apparatus, image processing method, and program
US9892497B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP2009017229A (en) Imaging device and imaging control method
EP2214136B1 (en) Method and program for controlling image capture apparatus
JP2013162347A (en) Image processor, image processing method, program, and device
JP6887853B2 (en) Imaging device, its control method, program
JP2008085634A (en) Imaging apparatus and image processing method
JP5315125B2 (en) Image processing apparatus, imaging apparatus, and composite image generation method
JP2012029045A (en) Image compositing device, image compositing method and program
JP2011171842A (en) Image processor and image processing program
JP2008219230A (en) Imaging apparatus, and image processing method
JP5609788B2 (en) Image processing apparatus and image processing method
JP2006333113A (en) Imaging device
JP5609787B2 (en) Image processing apparatus and image processing method
KR101612853B1 (en) Photographing apparatus, controlling method of photographing apparatus, and recording medium storing program to implement the controlling method
JP6157274B2 (en) Imaging apparatus, information processing method, and program
JP2009022044A (en) Image processing apparatus and image processing program