JP6826472B2 - Image processing device and its control method - Google Patents

Image processing device and its control method Download PDF

Info

Publication number
JP6826472B2
JP6826472B2 JP2017054872A JP2017054872A JP6826472B2 JP 6826472 B2 JP6826472 B2 JP 6826472B2 JP 2017054872 A JP2017054872 A JP 2017054872A JP 2017054872 A JP2017054872 A JP 2017054872A JP 6826472 B2 JP6826472 B2 JP 6826472B2
Authority
JP
Japan
Prior art keywords
image data
gamma
image
bright
region
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.)
Active
Application number
JP2017054872A
Other languages
Japanese (ja)
Other versions
JP2017229058A (en
Inventor
靖浩 伊藤
靖浩 伊藤
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.)
Canon Inc
Original Assignee
Canon 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 Canon Inc filed Critical Canon Inc
Priority to US15/609,475 priority Critical patent/US10313605B2/en
Publication of JP2017229058A publication Critical patent/JP2017229058A/en
Application granted granted Critical
Publication of JP6826472B2 publication Critical patent/JP6826472B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、ビデオカメラ、デジタルカメラなどによる撮像画像のダイナミックレンジの拡張技術に関するものである。 The present invention relates to a technique for extending the dynamic range of captured images by a video camera, a digital camera, or the like.

露光の異なる複数の画像を合成してダイナミックレンジの広い映像を得るための画像合成処理が従来よりいくつか提案されている。 Several image composition processes have been conventionally proposed for synthesizing a plurality of images having different exposures to obtain an image having a wide dynamic range.

たとえば、撮影時の露光時間の異なる複数の画像に対して、露光時間の短い画像(短秒撮影画像)を、露光時間の長い画像(長秒撮影画像)の特性に合わせるためのゲイン調整を行う。その後画像合成することでダイナミックレンジの広い画像を得る手法が特許文献1で提案されている。 For example, for a plurality of images having different exposure times at the time of shooting, gain adjustment is performed to match an image having a short exposure time (short-time shot image) to the characteristics of an image having a long exposure time (long-time shot image). .. Patent Document 1 proposes a method of obtaining an image having a wide dynamic range by then synthesizing the images.

また、注目画素の周囲に局所的なフィルタを適用し、局所領域の分散値を露光時間の異なる画像間で比較し、分散値の高さに応じて画像合成時の合成比率を高くするという手法が特許文献2で提案されている。この方法では、画素毎に露光時間の異なる画像どうしで、どちらがより画素飽和を起こすことなく撮影ができているかを判断し、画素飽和の可能性の低い画素を合成に用いるよう工夫している。 In addition, a method of applying a local filter around the pixel of interest, comparing the dispersion value of the local region between images with different exposure times, and increasing the composition ratio during image composition according to the height of the dispersion value. Is proposed in Patent Document 2. In this method, it is determined which of the images having different exposure times for each pixel can be photographed without causing pixel saturation, and the pixels having a low possibility of pixel saturation are used for synthesis.

特開2002−190983号公報JP-A-2002-190983 米国特許出願公開第2005/046708号公報U.S. Patent Application Publication No. 2005/046708

ここで、撮影しようとするシーンのダイナミックレンジが非常に大きく、かつ、明るさの分布が明るい方と暗い方に二分している場合を考える。たとえば、屋内と屋外の両方が含まれるシーンが、このケースであると考えるとわかりやすい。 Here, consider a case where the dynamic range of the scene to be shot is very large and the brightness distribution is divided into a bright side and a dark side. For example, it's easy to think of this case as a scene that includes both indoors and outdoors.

このような場合のシーンのヒストグラム例を図14に示す。図14において、横軸はシーン(画像)内の輝度、縦軸は画素の頻度、実線はシーンの輝度分布、点線はガンマを示す。シーンの明るさの分布が二分している場合、画素の多くは画素値下限、および画素値上限付近に集まるようになり、中間調部分は画素が少なくなる傾向にある。このため、特許文献1に示されるように長秒撮影画像に合わせて短秒撮影画像のゲイン調整を行った場合、非常に大きなゲインがかかることになる。その結果、明るい方の画素の画素値は非常に大きな値となり、結果として合成画像の画素値も画素値上限付近と下限付近に集中する傾向となる。これをモニタ等へ出力する場合、図14内の点線で示すようなガンマを合成画像に適用することになり、高輝度部分では非常にコントラストが低くなってしまう。 FIG. 14 shows an example of a histogram of a scene in such a case. In FIG. 14, the horizontal axis represents the brightness in the scene (image), the vertical axis represents the frequency of pixels, the solid line represents the brightness distribution of the scene, and the dotted line represents gamma. When the brightness distribution of the scene is divided into two, most of the pixels tend to gather near the lower limit of the pixel value and the upper limit of the pixel value, and the number of pixels tends to decrease in the halftone portion. Therefore, when the gain of the short-second captured image is adjusted according to the long-second captured image as shown in Patent Document 1, a very large gain is applied. As a result, the pixel value of the brighter pixel becomes a very large value, and as a result, the pixel value of the composite image also tends to be concentrated near the upper limit and the lower limit of the pixel value. When this is output to a monitor or the like, gamma as shown by the dotted line in FIG. 14 is applied to the composite image, and the contrast becomes very low in the high-luminance portion.

また、特許文献2に記載された方法の場合、暗い画素値ではセンサーのSN比が低下するため、シーンの暗い部分では、短秒撮影画像における参照画素の局所領域の分散値が高く、長秒撮影画像における局所領域の分散値は低くなる。明るい部分でも短秒撮影画像の局所領域の分散値は高くなり、長秒撮影画像では画素飽和を発生させ、局所分散が低くなる。この結果、局所分散の高い画素のみを用いれば画素の多くが短秒撮影画像で構成された合成画像に、逆に局所分散の低い画素を用いれば、画素の多くが長秒撮影画像で構成された合成画像になってしまい、合成後にダイナミックレンジ向上効果を得にくいという課題があった。 Further, in the case of the method described in Patent Document 2, since the SN ratio of the sensor decreases at a dark pixel value, the dispersion value of the local region of the reference pixel in the short-second captured image is high in the dark portion of the scene, and the long seconds. The variance value of the local region in the captured image becomes low. Even in a bright portion, the dispersion value of the local region of the short-second captured image becomes high, and in the long-second captured image, pixel saturation occurs and the local dispersion becomes low. As a result, if only pixels with high local dispersion are used, most of the pixels are composed of short-second captured images, and conversely, if pixels with low local dispersion are used, most of the pixels are composed of long-second captured images. There is a problem that it becomes a composite image and it is difficult to obtain the effect of improving the dynamic range after compositing.

本発明はかかる問題点に鑑みなされたものであり、露光量の異なる複数の画像からダイナミックレンジが広く、かつ、合成後でもコントラストの高い画像を得る技術を提供しようとするものである。 The present invention has been made in view of such a problem, and an object of the present invention is to provide a technique for obtaining an image having a wide dynamic range and high contrast even after compositing from a plurality of images having different exposure amounts.

この課題を解決するため、例えば本発明の画像処理装置は以下の構成を備える。すなわち、
露光量の異なる複数の画像データからHDR(High Dynamic Range)画像データを生成する画像処理装置であって、
複数の画像データのそれぞれに第1のガンマを適用し、当該第1のガンマの適用後の複数の画像データを合成することで、第1のHDR画像データを生成する第1の合成手段と、
前記複数の画像データのうちの予め設定された1つの画像データが、予め設定された条件を満たす明領域を含む場合には、当該明領域に基づき、前記予め設定された1つの画像データから、明領域、暗領域、及び、中間領域を判別する判別手段と、
前記複数の画像データのうちの1つに、前記第1のガンマとは異なる第2のガンマを適用して、当該第2のガンマを適用して得た画像データと前記第1のHDR画像データとを、前記判別手段による判別の結果に応じて合成することで第2のHDR画像データを生成する第2の合成手段とを有する。
In order to solve this problem, for example, the image processing apparatus of the present invention has the following configuration. That is,
An image processing device that generates HDR (High Dynamic Range) image data from a plurality of image data having different exposure amounts.
A first synthesizing means for generating a first HDR image data by applying a first gamma to each of a plurality of image data and synthesizing a plurality of image data after the application of the first gamma.
When one preset image data among the plurality of image data includes a bright region satisfying a preset condition, the preset image data is based on the bright region. A discriminating means for discriminating between a bright region, a dark region, and an intermediate region,
An image data obtained by applying a second gamma different from the first gamma to one of the plurality of image data and applying the second gamma, and the first HDR image data. It has a second synthesizing means for generating a second HDR image data by synthesizing the and according to the result of the discrimination by the discriminating means.

本発明によれば、露光量の異なる複数の画像からダイナミックレンジが広く、かつ、合成後でもコントラストの高い画像を得ることが可能になる。 According to the present invention, it is possible to obtain an image having a wide dynamic range and high contrast even after compositing from a plurality of images having different exposure amounts.

第1実施形態における画像処理装置のブロック構成図。The block block diagram of the image processing apparatus in 1st Embodiment. 第1実施形態における画像処理の全体処理を示すフローチャート。The flowchart which shows the whole processing of the image processing in 1st Embodiment. 第1実施形態における明領域判定処理を示すフローチャート。The flowchart which shows the bright region determination process in 1st Embodiment. 第1実施形態に明領域画素決定処理の流れを示すフローチャート。The flowchart which shows the flow of the bright region pixel determination process in 1st Embodiment. 第1実施形態の明領域判定処理に用いる原画像、輝度平均画像、及び、そのヒストグラムを示す図。The figure which shows the original image, the luminance average image, and the histogram thereof used for the bright region determination process of 1st Embodiment. 第1実施形態の明領域概略マップとヒストグラムを示す図。The figure which shows the bright area schematic map and the histogram of 1st Embodiment. 第1実施形態におけるゼロ区間計数の概略図。The schematic diagram of the zero section count in 1st Embodiment. 第1実施形態における3値化を示す図。The figure which shows the ternation in 1st Embodiment. 第1実施形態における輝度画像データ、明領域マップ、合成マップを示す図。The figure which shows the luminance image data, the bright area map, and the composite map in 1st Embodiment. 第1実施形態における合成マップの生成するためのテーブルを示す図。The figure which shows the table for generating the synthetic map in 1st Embodiment. 第1実施形態の第1のガンマ、第2のガンマの概略を示す図。The figure which shows the outline of the 1st gamma and the 2nd gamma of 1st Embodiment. 第1実施形態における合成マップの生成処理を示すフローチャート。The flowchart which shows the generation process of the synthetic map in 1st Embodiment. 第1実施形態における合成マップと合成比率との関係を示す図。The figure which shows the relationship between the synthesis map and the synthesis ratio in 1st Embodiment. ダイナミックレンジの広いシーンの輝度分布とガンマの傾向を示す図。The figure which shows the tendency of the brightness distribution and gamma of a scene with a wide dynamic range. 第2実施形態における明領域判定処理の流れを示すフローチャート。The flowchart which shows the flow of the bright region determination process in 2nd Embodiment. 通常の4枚の画像に適用するガンマ曲線を示す図。The figure which shows the gamma curve applied to four normal images. HDR画像の輝度分布の例を示す図。The figure which shows the example of the luminance distribution of an HDR image. 第3の実施形態における画像合成処理の流れを示すフローチャート。The flowchart which shows the flow of the image composition processing in 3rd Embodiment. 第3の実施形態における第2のガンマの合成処理を示すフローチャート。The flowchart which shows the synthesis process of the 2nd gamma in 3rd Embodiment.

以下、添付図面に従って本発明に係る実施形態を詳細に説明する。なお、以下に示す実施形態では画像処理装置として、デジタルカメラなどの撮像装置に適用した例を説明するが、あくまでも一例であって、本発明は以下の実施形態の記載に限定されるものではない。 Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings. In addition, in the embodiment shown below, an example applied to an image pickup device such as a digital camera as an image processing device will be described, but the present invention is merely an example, and the present invention is not limited to the description of the following embodiment. ..

[第1実施形態]
[概要]
第1実施形態の概要について説明する。第1実施形態では、露光の異なる4枚の画像を入力し、これらの画像に対して通常のガンマ(第1ガンマ)を適用し、その後で合成して、HDR(High Dynamic Range)画像データ(以下、基本HDR画像データ)を生成する。そして、本実施形態では、入力した4枚の画像内に、明部のコントラスト向上に利用できる画像の存在を判定する。そのような画像がない場合には、基本HDR画像データを最終的なHDR画像データとして決定する。一方、明部のコントラストを向上させる画像が存在した場合には、その画像を利用して、通常とは異なるガンマ(第2のガンマ)を適用した上で、基本HDR画像データと、第2ガンマを適用して得た画像データとを合成処理を行って、明部領域のコントラストを更に向上させたHDR画像データを生成し、出力する。以下、更に詳しく説明する。
[First Embodiment]
[Overview]
The outline of the first embodiment will be described. In the first embodiment, four images having different exposures are input, normal gamma (first gamma) is applied to these images, and then they are combined to obtain HDR (High Dynamic Range) image data ( Hereinafter, basic HDR image data) is generated. Then, in the present embodiment, it is determined that there is an image that can be used to improve the contrast of the bright part in the four input images. If there is no such image, the basic HDR image data is determined as the final HDR image data. On the other hand, if there is an image that improves the contrast of the bright part, the image is used to apply a different gamma (second gamma), and then the basic HDR image data and the second gamma. Is performed to synthesize the image data obtained by applying the above to generate and output HDR image data in which the contrast in the bright region is further improved. Hereinafter, it will be described in more detail.

[装置構成]
図1は、第1実施形態が適用する画像処理装置のブロック構成図である。撮像部101は、被写体からの光を検知するための装置で、例えば、ズームレンズ、フォーカスレンズ、ぶれ補正レンズ、絞り、シャッター、光学ローパスフィルタ、iRカットフィルタ、カラーフィルタ、及び、CMOSやCCDなどのセンサなどから構成される。A/D変換部102は、被写体の光の検知量をデジタル値に変換するための装置である。信号処理部103は、上記デジタル値の信号処理し、デジタル画像を生成するための装置であり、例えば、デモザイキング処理、ホワイトバランス処理、ガンマ処理などを行う。本実施形態で説明する画像合成処理もこの信号処理部103により実行される。エンコーダ部105は、上記デジタル画像にデータ圧縮を行うための装置であり、例えばJpegに圧縮するなどの処理を行う。メディアインターフェース部106は、PCその他メディア(例えば、ハードディスク、メモリーカード、CFカード、SDカード、USBメモリ)につなぐためのインターフェースである。
CPU107は、上述した各構成の処理の全てに関わる。ROM108とRAM109は、その処理に必要なプログラム、データ、作業領域などをCPU107に提供する。また、ROM108には、後述する制御プログラムも格納されている。なお、RAM109のアクセス速度がROM108のそれよりも十分に速い場合、ROM108に格納されたプログラムは、一旦RAM109に読み込まれてから実行されても構わない。
[Device configuration]
FIG. 1 is a block configuration diagram of an image processing device to which the first embodiment is applied. The imaging unit 101 is a device for detecting light from a subject, for example, a zoom lens, a focus lens, a blur correction lens, an aperture, a shutter, an optical low-pass filter, an iR cut filter, a color filter, CMOS, a CCD, and the like. It is composed of the sensors of. The A / D conversion unit 102 is a device for converting the detected amount of light of the subject into a digital value. The signal processing unit 103 is a device for processing the digital value signal and generating a digital image, and performs, for example, demosaiking processing, white balance processing, gamma processing, and the like. The image composition process described in this embodiment is also executed by the signal processing unit 103. The encoder unit 105 is a device for compressing data on the digital image, and performs processing such as compression to Jpeg, for example. The media interface unit 106 is an interface for connecting to a PC or other media (for example, a hard disk, a memory card, a CF card, an SD card, a USB memory).
The CPU 107 is involved in all the processes of each configuration described above. The ROM 108 and the RAM 109 provide the CPU 107 with programs, data, work areas, and the like necessary for the processing. The ROM 108 also stores a control program described later. If the access speed of the RAM 109 is sufficiently faster than that of the ROM 108, the program stored in the ROM 108 may be once read into the RAM 109 and then executed.

操作部111は、ユーザからの指示を入力する装置であり、例えば、ボタンやモードダイヤルで構成される。キャラクタージェネレーション部112は、文字やグラフィックを生成するための装置である。D/A変換部104は、上記デジタル画像をアナログ変換するための装置である。表示部113は、撮影画像を表示、あるいはGUI等の画像を表示する装置で、一般的にはCRTや液晶ディスプレイなどが用いられる。また、公知のタッチスクリーンであっても良い。その場合、タッチスクリーンによる入力については操作部111の入力として扱うことも可能である。 The operation unit 111 is a device for inputting an instruction from the user, and is composed of, for example, a button and a mode dial. The character generation unit 112 is a device for generating characters and graphics. The D / A conversion unit 104 is a device for analog-converting the digital image. The display unit 113 is a device for displaying a captured image or displaying an image such as a GUI, and a CRT, a liquid crystal display, or the like is generally used. Further, a known touch screen may be used. In that case, the input by the touch screen can be treated as the input of the operation unit 111.

撮像系制御部110は、CPU107で指示された撮像系の制御を行うための装置で、例えば、フォーカスを合わせる、シャッターを開く、絞りを調節するなどの制御を行う。システム構成については、上記以外にも様々な構成要素が存在するが、実施形態の主眼ではないので、その説明は省略する。 The image pickup system control unit 110 is a device for controlling the image pickup system instructed by the CPU 107, and performs controls such as focusing, opening a shutter, and adjusting an aperture. Regarding the system configuration, there are various components other than the above, but since they are not the main focus of the embodiment, the description thereof will be omitted.

本実施形態で示す画像合成処理は、撮像部101で撮影され、A/D変換部102でA/D変換されるまでを画像入力部とし、画像入力部で得られた画像データを信号処理部103で画像処理し、その際にCPU107、ROM108、RAM109を利用する。その画像処理の詳細について、以下に示す。なお、以下の説明において、撮像部101で撮像された画像データは、R、G、Bの3成分の色空間の画像データであり、各色成分は8ビット(256階調)であるものとする。これは、具体例を示すことで技術内容をよりわかりやすくするためであって、あくまで一例であると理解されたい。 In the image composition processing shown in the present embodiment, an image input unit is used until the image is captured by the imaging unit 101 and A / D is converted by the A / D conversion unit 102, and the image data obtained by the image input unit is used as a signal processing unit. Image processing is performed by 103, and the CPU 107, ROM 108, and RAM 109 are used at that time. The details of the image processing are shown below. In the following description, it is assumed that the image data captured by the imaging unit 101 is image data in the color space of the three components R, G, and B, and each color component has 8 bits (256 gradations). .. It should be understood that this is just an example, in order to make the technical content easier to understand by showing a concrete example.

[全体処理の流れ]
第1実施形態の画像処理装置の信号処理部103における画像合成処理の流れを図2のフローチャートを用いて説明する。本処理は、操作部111によるHDR撮影モードが設定され、撮像処理を行った場合の処理である。HDR撮影モードにおいて、ユーザが操作部111を操作して撮像指示(シャッターボタン)を操作したとき、CPU107は、撮像系制御部110を制御し、シャッター速度を段階的に変えて、露光量の異なる4枚の画像I1乃至I4を撮像させる。露光量の関係は、I1>I2>I3>I4であるものとする。ここで、画像I1は、4枚中で、露光量が最大であるので、被写体の明部は「白とび」となる可能性が高いものの、被写体の暗部の階調整が維持されやすい画像と言える。一方、画像I4は、被写体の暗部が「黒つぶれ」となる可能性が高いものの、被写体の明部の階調整が維持されやすい画像と言える。
[Overall processing flow]
The flow of the image composition processing in the signal processing unit 103 of the image processing apparatus of the first embodiment will be described with reference to the flowchart of FIG. This process is a process when the HDR shooting mode is set by the operation unit 111 and the imaging process is performed. In the HDR shooting mode, when the user operates the operation unit 111 to operate the image pickup instruction (shutter button), the CPU 107 controls the image pickup system control unit 110 and changes the shutter speed stepwise to change the exposure amount. Four images I 1 to I 4 are imaged. It is assumed that the relationship of the exposure amount is I 1 > I 2 > I 3 > I 4 . Here, since the exposure amount of the image I 1 is the largest among the four images, the bright part of the subject is likely to be "blown out", but the image is such that the floor adjustment of the dark part of the subject is easily maintained. I can say. On the other hand, the image I 4 can be said to be an image in which the dark part of the subject is likely to be “blackened”, but the floor adjustment of the bright part of the subject is easily maintained.

ステップS201にて、信号処理部103は、撮像部101で撮像され、A/D変換部102でA/D変換された、撮像した4枚の画像データI1〜I4を入力し、RAM109に保存する。そして、ステップS202にて、信号処理部103は、入力した画像データI1〜I4に対して、第1ガンマを適用し、ガンマ適用後の画像データI1〜I4もRAM109に保存する。これは、後述するように、第1ガンマ適用前の画像を再利用可能とするためである。また、ここで適用する第1のガンマは、広いダイナミックレンジを確保しつつも、黒とびや白つぶれが出にくいガンマであることが望ましい。そのため、実施形態では、例えば図11(a)に示されるようなlogガンマを適用する。 In step S201, the signal processing unit 103 inputs the four image data I 1 to I 4 captured by the imaging unit 101 and A / D converted by the A / D conversion unit 102, and inputs the image data I 1 to I 4 to the RAM 109. save. Then, at step S202, the signal processing unit 103, the image data I 1 ~I 4 input, the first gamma is applied, the image data I 1 ~I 4 after gamma applicable saved in RAM 109. This is to make it possible to reuse the image before applying the first gamma, as will be described later. Further, it is desirable that the first gamma applied here is a gamma that does not easily cause overexposure or underexposure while ensuring a wide dynamic range. Therefore, in the embodiment, for example, log gamma as shown in FIG. 11A is applied.

本実施形態のように、露光条件が異なる4枚の画像データI1〜I4をもとに、例えば10ビットのHDR合成画像を出力する場合、図11(a)に示されるようなlogガンマは、各露光条件によって図16(a)〜(d)のように、各露光画像のセンサから得られた入力画素値によって出力画素値が異なってくる。これらのガンマを適用した後の画像を合成することで、図17に示されるような、撮影シーンの明るさに対して出力画素値を連続的に持つHDR合成画像ができる。なお、もちろんこれ以外のガンマでも構わない。 When, for example, a 10-bit HDR composite image is output based on four image data I 1 to I 4 having different exposure conditions as in the present embodiment, the log gamma as shown in FIG. 11 (a) is output. As shown in FIGS. 16A to 16D, the output pixel value differs depending on the input pixel value obtained from the sensor of each exposed image. By synthesizing the images after applying these gammas, an HDR composite image having an output pixel value continuously with respect to the brightness of the shooting scene can be obtained as shown in FIG. Of course, other gammas may be used.

ステップS203にて、信号処理部103は、第1ガンマ適用後の画像データI1〜I4を用いて第1の画像合成処理を行い、ダイナミックレンジの広い1枚の画像データを生成し、生成した画像データをRAM109に保存する。以降、この合成処理で生成されたダイナミックレンジの広い画像データを基本HDR画像データという。 In step S203, the signal processing unit 103 performs the first image composition processing using the image data I 1 to I 4 after applying the first gamma, and generates one image data having a wide dynamic range. The image data is stored in the RAM 109. Hereinafter, the image data having a wide dynamic range generated by this compositing process will be referred to as basic HDR image data.

なお、基本HDR画像データの生成法そのものは公知の合成処理を利用するものとする。具体例を示すのであれば、次の通りである。なお、以下の説明における画像データは既に第1ガンマが適用済みとする。 It should be noted that the method itself for generating the basic HDR image data shall use a known synthesis process. A specific example is as follows. It is assumed that the first gamma has already been applied to the image data in the following description.

HDR画像の明るさを示す範囲を3等分(合成する画像の数から1減じた値)する。明るさの低い方から高い方に向かって各範囲をR1、R2,R3と定義する。 The range indicating the brightness of the HDR image is divided into three equal parts (the number of images to be combined minus one). Each range is defined as R1, R2, and R3 from the lower brightness side to the higher brightness side.

R1の範囲は、明るさが低い部分であるので、そのR1の範囲で特に階調性が維持される画像データI(R1)を生成するには、画像データI1、I2を用いる。式で示せば次のようになる。
I(R1)=G(I1,I2
ここで、G(x、y)は画像xと画像yとの合成処理を示す関数である。
Since the range of R1 is a portion where the brightness is low, the image data I1 and I2 are used to generate the image data I (R1) in which the gradation property is particularly maintained in the range of R1. The formula is as follows.
I (R1) = G (I 1 , I 2 )
Here, G (x, y) is a function indicating a composition process of the image x and the image y.

範囲R1,R2で階調性が維持される画像I(R2)は次のようになる。
I(R2)=G(I(R1),I3
同様に、全領域R1〜R3で階調性が維持される画像I(R3)は、次式のようになる。
I(R3)=G(I(R2),I4
この画像データI(R3)が、先に説明した基本HDR画像データということができる。
The image I (R2) whose gradation is maintained in the ranges R1 and R2 is as follows.
I (R2) = G (I (R1), I 3 )
Similarly, the image I (R3) in which the gradation property is maintained in all the regions R1 to R3 is as follows.
I (R3) = G (I (R2), I 4 )
This image data I (R3) can be said to be the basic HDR image data described above.

さて、本実施形態では、オリジナルの画像から、被写体の明部領域のコントラストを更に向上できるか否かを判定する。否の場合には基本HDR画像データをHDRの合成結果として出力する。一方、コントラストを更に向上できると判定した場合には、基本HDR画像データから明部領域のコントラストを更に向上させた、新たなHDR画像データを生成し、それをHDRの合成結果として出力する。かかる処理を行うのは、S204以降となる。 Now, in the present embodiment, it is determined from the original image whether or not the contrast in the bright region of the subject can be further improved. If not, the basic HDR image data is output as the HDR composition result. On the other hand, when it is determined that the contrast can be further improved, new HDR image data in which the contrast in the bright region is further improved is generated from the basic HDR image data, and the new HDR image data is output as the HDR composition result. Such processing is performed after S204.

ステップS204にて、信号処理部103は、第1ガンマが非適用の画像データI3を用いて、或る程度の明るさを持ち、比較的大きな面積の領域が含まれているのを判定する(詳細後述)。ここで判定する対象として画像データI3を選んだ理由は、以下の通りである。 In step S204, the signal processing unit 103 determines that the image data I 3 to which the first gamma is not applied has a certain degree of brightness and includes a region having a relatively large area. (Details will be described later). The reason for selecting the image data I 3 as the determination target here is as follows.

露光量の少ない画像データほど、被写体画像内のより明るい領域のコントラストを維持できる。かかる点は、露光量の一番少ない画像データI4が良いように思える。しかし、本発明者は、コントラストを向上させる明領域は可能な限り広くしたいと考えた。そのためには、対象とする明瞭領域の下限は低くしたい。そのため、その中間領域の階調性をも維持可能な画像データI3を判定の対象とした。なお、判定対象の画像データは、ユーザにより指定可能しても良いし、場合によっては画像データI2を判定対象としても良い。 The smaller the exposure amount, the more the contrast in the brighter region in the subject image can be maintained. In this respect, the image data I 4 having the smallest exposure amount seems to be good. However, the present inventor wanted to make the bright region for improving contrast as wide as possible. For that purpose, we want to lower the lower limit of the target clarity area. Therefore, the image data I 3 that can maintain the gradation of the intermediate region is used as the judgment target. The image data to be determined may be specified by the user, or the image data I 2 may be the determination target in some cases.

ステップS205にて、信号処理部103は、ステップS204の判定結果に基づき、明領域の更なるコントラストの向上が可能か否かを判定する。否の場合には、処理をステップS206に進め、信号処理部103は、基本HDR画像データを、本実施形態における合成結果を示す合成画像データとしてエンコーダ部105へ出力する。エンコーダ部105でエンコードされた合成画像データは、メディアI/F106を通じてメディアに出力したり、RAM109へ格納したりする。 In step S205, the signal processing unit 103 determines whether or not the contrast in the bright region can be further improved based on the determination result in step S204. If not, the process proceeds to step S206, and the signal processing unit 103 outputs the basic HDR image data to the encoder unit 105 as composite image data indicating the composite result in the present embodiment. The composite image data encoded by the encoder unit 105 is output to the media through the media I / F 106 or stored in the RAM 109.

一方、明領域のコントラストを更に向上できると判定した場合は、信号処理部103は、処理をステップS207に進める。 On the other hand, when it is determined that the contrast in the bright region can be further improved, the signal processing unit 103 advances the processing to step S207.

ステップS207にて、信号処理部103は、ステップS204で算出した明領域の大まかな位置を示す情報をもとに、入力画像中のどの画素位置が明領域であるかを示す明領域画素を決定し、決定した結果をRAM109に保存する。この明領域画素の決定の詳細については後述する。 In step S207, the signal processing unit 103 determines which pixel position in the input image is the bright region pixel based on the information indicating the rough position of the bright region calculated in step S204. Then, the determined result is saved in the RAM 109. The details of determining the bright region pixel will be described later.

ステップS208にて、信号処理部103は、RAM109に保存された入力画像データI1乃至I4のうち最も露光量の少ない画像データI4に対して、第1のガンマとは異なる第2のガンマを適用する。これによって第2のガンマを適用して得られた画像データを、以降、画像データLと表記する。 In step S208, the signal processing unit 103 has a second gamma different from the first gamma for the image data I 4 having the least exposure amount among the input image data I 1 to I 4 stored in the RAM 109. To apply. The image data obtained by applying the second gamma in this manner is hereinafter referred to as image data L.

第2のガンマは、たとえば図1(b)に示すような、入力画像の画素値に対してS字カーブ、かつ最大(または最小)出力画素値が第1のガンマとは異なるガンマが考えられる。このカーブを適用することで、シーン内で或る明るさに対応する被写体がなく、且つ、第1のガンマを適用した場合に比べ、よりシーン内の被写体の或る明るさ部分に出力画素値が多くなるようガンマを持たせることで、結果的にHDR画像全体の階調性をよくすることができる。もちろん第2のガンマも、ここで挙げたS字カーブ以外のガンマ特性でも問題ない。ただし、明部に階調がより割り当てられるガンマであることが望ましい。これは、そして、信号処理部103は、第2のガンマ適用後の画像データLをRAM109に保存する。 As the second gamma, for example, as shown in FIG. 1B, a gamma having an S-shaped curve with respect to the pixel value of the input image and a maximum (or minimum) output pixel value different from that of the first gamma can be considered. .. By applying this curve, there is no subject corresponding to a certain brightness in the scene, and the output pixel value is applied to a certain brightness part of the subject in the scene as compared with the case where the first gamma is applied. As a result, the gradation of the entire HDR image can be improved by providing gamma so that the number of pixels increases. Of course, there is no problem with the second gamma as well as the gamma characteristics other than the S-shaped curve mentioned here. However, it is desirable that the gamma is more assigned to the bright part. This means that the signal processing unit 103 stores the image data L after the application of the second gamma in the RAM 109.

そして、ステップS209にて、信号処理部103は、基本HDR画像データと、第2のガンマを適用して得られた画像データLとの合成処理を行い、明領域のコントラストを向上させたHDR画像データを生成する。ここで、明領域のコントラストを向上後のHDR画像をIHDRと表すなら、次式のようになる。
HDR=G(I(R3),L)
そして、S210にて、信号処理部103は、生成したHDR画像データを、本実施形態における合成結果を示す合成画像データとしてエンコーダ部105へ出力する。エンコーダ部105でエンコードされた合成画像データは、メディアI/F106を通じてメディアに出力したり、RAM109へ格納したりする。以上説明した処理により、本第1実施形態における画像合成処理が完了する。
Then, in step S209, the signal processing unit 103 performs a synthesis process of the basic HDR image data and the image data L obtained by applying the second gamma to improve the contrast in the bright region. Generate data. Here, if the HDR image after improving the contrast in the bright region is expressed as I HDR , it becomes as follows.
I HDR = G (I (R3), L)
Then, in S210, the signal processing unit 103 outputs the generated HDR image data to the encoder unit 105 as composite image data indicating the composite result in the present embodiment. The composite image data encoded by the encoder unit 105 is output to the media through the media I / F 106 or stored in the RAM 109. The image composition process according to the first embodiment is completed by the process described above.

[明領域判定処理の流れ]
次に、図2のステップS204の撮像した画像データI3の明領域判定処理について説明する。
[Flow of bright area judgment processing]
Next, the bright region determination process of the image data I 3 captured in step S204 of FIG. 2 will be described.

明領域判定処理は、入力画像中に明るく、かつ比較的大きな面積を持つ領域が存在するかどうかを大まかに調べる処理である。本第1実施形態では、明るく、且つ、比較的大きな面積を持つ領域を明領域と呼ぶ。以下、図3のフローチャートを用いて詳細に説明する。 The bright area determination process is a process for roughly checking whether or not a bright area having a relatively large area exists in the input image. In the first embodiment, a bright region having a relatively large area is referred to as a bright region. Hereinafter, a detailed description will be given using the flowchart of FIG.

ステップS301にて、信号処理部103は、撮像部101で撮像して得られた画像データI3に対し輝度成分Yを求める色変換を行う。画像データがRGBであれば、変換方法は一般的なRGBから1成分の輝度Yへの変換式で構わない。この変換処理によって生成された輝度画像データはRAM109に保存される。なお、輝度Yも8ビットで表されるものとする。 In step S301, the signal processing unit 103 performs color conversion for obtaining the luminance component Y for the image data I 3 obtained by imaging with the image capturing unit 101. If the image data is RGB, the conversion method may be a general conversion formula from RGB to the luminance Y of one component. The luminance image data generated by this conversion process is stored in the RAM 109. It is assumed that the brightness Y is also represented by 8 bits.

ステップS302にて、信号処理部103は、ステップS301で生成された輝度画像データを予め設定されたサイズの複数の部分領域(画素ブロック)に分割し、各部分領域の平均輝度値YAVを求める。 In step S302, the signal processing unit 103 divides the luminance image data generated in step S301 into a plurality of partial regions (pixel blocks) having a preset size, and obtains the average luminance value Y AV of each partial region. ..

1つの部分領域内の座標(x,y)の輝度値をY(x,y)と表したとき、その部分領域の平均輝度値YAVは、次式(1)で与えられる。
AV=ΣY(x、y)/(p×q) …(1)
ここで、pは部分領域の水平方向の画素数、qは部分領域の垂直方向の画素数である。また、Σは、xを0、1、…、p−1、yを0,1、…、q−1と変更した場合の合算(積分)関数を示している。
When the luminance value of the coordinates (x, y) in one partial region is expressed as Y (x, y), the average luminance value Y AV of that partial region is given by the following equation (1).
Y AV = ΣY (x, y) / (p × q)… (1)
Here, p is the number of pixels in the horizontal direction of the partial region, and q is the number of pixels in the vertical direction of the partial region. Further, Σ indicates a summing (integral) function when x is changed to 0, 1, ..., P-1, y is 0, 1, ..., Q-1.

第1実施形態における撮像部101が、水平方向2400画素、垂直方向1400画素の画像データを撮像し、1つの部分領域のサイズが100×100画素であるものとする。この場合、画像データは24×14個の部分領域(24×14画素で構成される縮小画像データとも言える)に分割され、各部分領域の平均輝度が算出されることになる。 It is assumed that the imaging unit 101 in the first embodiment captures image data of 2400 pixels in the horizontal direction and 1400 pixels in the vertical direction, and the size of one partial region is 100 × 100 pixels. In this case, the image data is divided into 24 × 14 partial regions (which can also be said to be reduced image data composed of 24 × 14 pixels), and the average brightness of each partial region is calculated.

このときの様子を図5の模式図を用いて説明する。図5(a)は対象となる画像データ(実施形態ではI3)を示し、図5(b)は各部分領域をその平均値で示した画像(以下、輝度平均画像という)を示している。 The situation at this time will be described with reference to the schematic diagram of FIG. FIG. 5 (a) shows the target image data (I 3 in the embodiment), and FIG. 5 (b) shows an image (hereinafter, referred to as a luminance average image) in which each partial region is shown by its average value. ..

ステップS303にて、信号処理部103は、ステップS302によって得られた輝度平均画像に対するヒストグラムを取得する。得られたヒストグラムは例えば図5(c)のようになる。水平軸は輝度値、垂直軸は度数(部分領域の個数)である。 In step S303, the signal processing unit 103 acquires a histogram with respect to the luminance average image obtained in step S302. The obtained histogram is shown in FIG. 5 (c), for example. The horizontal axis is the brightness value, and the vertical axis is the frequency (number of partial areas).

ステップS304にて、信号処理部103は、ステップS302で得られた輝度平均画像から2値化閾値THを求め、その閾値を用いて2値化を行って2値化画像を得る。2値化の方法は、公知のアルゴリズムで行えばよい。典型的には、大津法などで2値化閾値THを求め、その閾値THを用いて2値化すればよい。図6(a)は、2値化画像を示している。ここで、実施形態では、2値化画像における閾値以上の輝度を持つ画素は“255”、閾値未満の輝度の画素は“0”とする。また、2値化閾値THは、図6(b)に示す参照符号602で示すように、ヒストグラムを最も精度よく分離できる頻度部分に設定される。 In step S304, the signal processing unit 103 obtains the binarization threshold TH from the luminance average image obtained in step S302, and performs binarization using the threshold value to obtain a binarization image. The binarization method may be performed by a known algorithm. Typically, the binarization threshold value TH may be obtained by the Otsu method or the like, and the binarization may be performed using the threshold value TH. FIG. 6A shows a binarized image. Here, in the embodiment, the pixel having the brightness equal to or higher than the threshold value in the binarized image is set to "255", and the pixel having the brightness lower than the threshold value is set to "0". Further, the binarization threshold TH is set to a frequency portion where the histogram can be separated most accurately, as shown by reference numeral 602 shown in FIG. 6B.

ステップS305にて、信号処理部103は、ステップS304で求めた2値化閾値を基に、ヒストグラムにおけるゼロ区間を数える。具体的には、図7に示すように、2値化閾値602を開始点として、明度の高い方向に向かって頻度が“0”となっているビンの個数を計数する。そして、頻度が0となるビンの範囲をゼロ区間701と定義する。ゼロ区間701の捜索範囲は、2値化閾値602を開始点として、一定の範囲内にゼロ区間701がある程度の長さ(たとえばビン数が“5”)で存在するかどうかを調べる。ゼロ区間が見つかった場合は、着目画像データ中に明領域が見つかったという判定結果をRAM109へ格納し、見つからなかった場合は着目画像データに明領域なしという判定結果をRAM109へ格納する。 In step S305, the signal processing unit 103 counts the zero interval in the histogram based on the binarization threshold value obtained in step S304. Specifically, as shown in FIG. 7, the number of bins whose frequency is “0” in the direction of higher brightness is counted starting from the binarization threshold value 602. Then, the range of bins whose frequency is 0 is defined as the zero interval 701. The search range of the zero section 701 starts from the binarization threshold value 602 and checks whether the zero section 701 exists within a certain range with a certain length (for example, the number of bins is “5”). When the zero interval is found, the determination result that a bright area is found in the image data of interest is stored in the RAM 109, and when it is not found, the determination result that there is no bright area in the image data of interest is stored in the RAM 109.

なお、ここで説明したゼロ区間の捜索範囲の決め方や、ゼロ区間の長さは一例であって、本実施形態を実現する上でほかの方法を用いて決定しても構わない。たとえば、ゼロ区間の長さは、部分領域の個数に依存して決定しても良いし、ユーザが適宜設定できるようにしても良い。また、ゼロ区間の捜索範囲も、2値化閾値602の中心から大小両方向に捜索しても良いし、片側だけを捜索しても構わない。 The method of determining the search range of the zero section and the length of the zero section described here are examples, and may be determined by using another method in order to realize the present embodiment. For example, the length of the zero interval may be determined depending on the number of subregions, or may be appropriately set by the user. Further, the search range of the zero section may be searched in both large and small directions from the center of the binarization threshold value 602, or only one side may be searched.

ステップS306にて、信号処理部103は、ステップS304で生成した2値化画像をもとに、画素値が“0”の領域において、画素値が“255”と接する部分を、画素値“255”や“0”とは別の画素値“128”に設定し、2値画像データの3値化を行う。図8は、2値画像データ601から3値画像データ801への変換例を示している。図示では、2値画像データにおける画素値“0”(図示の黒い部分)のうち、画素値“255”に接する画素値が“128”(図示の灰色)となっていることを示している。このように、2値化閾値以上の輝度を持つ領域の周囲に、新たに画素値“128”を持つ画素が存在するような画像を得る。つまり、画像データを構成する各部分領域を、明部領域、暗部領域、及び、その中間領域に分類する。なお、この3値画像データはRAM109に格納されることになる。 In step S306, the signal processing unit 103 sets the portion in contact with the pixel value “255” in the region where the pixel value is “0” based on the binarized image generated in step S304 to the pixel value “255”. The pixel value "128", which is different from "" and "0", is set, and the binary image data is ternaryized. FIG. 8 shows an example of conversion from binary image data 601 to ternary image data 801. In the figure, among the pixel values "0" (black part in the figure) in the binary image data, the pixel value in contact with the pixel value "255" is "128" (gray in the figure). In this way, an image is obtained in which pixels having a pixel value of "128" newly exist around the region having a brightness equal to or higher than the binarization threshold. That is, each partial region constituting the image data is classified into a bright region, a dark region, and an intermediate region thereof. The binary image data will be stored in the RAM 109.

ステップS309に処理が進んだ場合、信号処理部103は、3値化画像データを、明領域概略マップデータとして出力する。なお、所定長さのゼロ区間701が見つからなかった場合には、3値化画像データは生成されず、本処理を終えることになる。 When the processing proceeds to step S309, the signal processing unit 103 outputs the quantified image data as bright region schematic map data. If the zero section 701 having a predetermined length is not found, the ternary image data is not generated and the present process is completed.

なお、実施形態では、図3の処理を画像データI3に対して行うものとしたが、以下のようにしてもよい。 In the embodiment, the processing of FIG. 3 is performed on the image data I 3 , but the following may be used.

まず、撮像した画像I1〜I4の全てに図3の処理を行い、いずれにも、所定長さのゼロ区間がない場合には、明領域無しとして判定する。そして、所定長さのゼロ区間を持つ画像データが1つでも存在した場合、その中の最も露光量の少ない画像データから生成した3値化画像データを明領域概略マップデータとして出力する。 First, all of the captured images I 1 to I 4 are subjected to the processing of FIG. 3, and if there is no zero section of a predetermined length in any of them, it is determined that there is no bright region. Then, when even one image data having a zero interval of a predetermined length exists, the ternary image data generated from the image data having the smallest exposure amount is output as the bright region schematic map data.

[明領域画素決定処理の流れ]
図2のステップS204の明領域判定処理で、明領域があるかどうかの判定、および、明領域概略マップデータの作成を行った。図2のステップS207の明領域画素決定処理では、入力画像中で明領域となる部分を画素単位で決定するための明領域マップデータを生成する。明領域マップデータとは、実際に第1のガンマを適用して得られた基本HDR画像データと、第2のガンマを適用した画像とをどの程度の割合で合成するかを示す情報であり、たとえば8ビットの白黒画像として保持される。本実施形態では、画素値が“0”の暗部領域の場合は第1のガンマの適用で生成した基本HDR画像データを用い、画素値が“255”の明部領域の場合には第2のガンマを適用した画像データを用い、画素値が“128”の中間領域場の合は基本HDR画像データと、第2のガンマを適用して得た画像データとを合成した画素値を出力させる。なお、3つの画素値が判別できれば良いので、必ずしも3値化で0、128、255のいずれかにしなければならない、というわけではない。
[Flow of bright region pixel determination process]
In the bright area determination process of step S204 of FIG. 2, it was determined whether or not there was a bright area, and the outline map data of the bright area was created. In the bright region pixel determination process of step S207 of FIG. 2, bright region map data for determining a portion to be a bright region in the input image on a pixel-by-pixel basis is generated. The bright region map data is information indicating the ratio of the basic HDR image data actually obtained by applying the first gamma and the image to which the second gamma is applied to be combined. For example, it is retained as an 8-bit black and white image. In the present embodiment, the basic HDR image data generated by applying the first gamma is used in the dark region where the pixel value is “0”, and the second region in the bright region where the pixel value is “255”. Using the image data to which the gamma is applied, in the case of the intermediate region field where the pixel value is "128", the pixel value obtained by combining the basic HDR image data and the image data obtained by applying the second gamma is output. Since it is sufficient if the three pixel values can be discriminated, it is not always necessary to set the value to 0, 128, or 255 by ternation.

明領域画素決定処理について、図4のフローチャートを用いて詳細に説明する。 The bright region pixel determination process will be described in detail with reference to the flowchart of FIG.

ステップS401にて、信号処理部103は、ステップS201で作成した明領域概略マップデータを読み込む。 In step S401, the signal processing unit 103 reads the bright region outline map data created in step S201.

ステップS402では、ステップS401で読み込んだ明領域概略マップデータを、入力画像と同じサイズまで拡大させて、明領域マップデータを生成する。このとき、拡大にはニアレストネイバー方式を用いて、明領域マップデータ内の全画素は、先に規定した3つ以外の画素値を取らないようにする。 In step S402, the bright region outline map data read in step S401 is enlarged to the same size as the input image to generate bright region map data. At this time, the nearest neighbor method is used for enlargement so that all the pixels in the bright region map data do not take pixel values other than the three defined above.

ステップS403では、RAM109に格納していた入力画像(明領域概略マップデータの元になった画像データI3とする)を読み込み、輝度画像データを生成する。入力画像のRGBから輝度Yへの変換は、まず一般的な変換式を用いて行えば良い。そして、得られた輝度成分のみで構成される画像データに対して、ガウシアンフィルタなどの平滑化処理を行うことで、輝度画像データを生成する。 In step S403, the input image (referred to as the image data I 3 that is the source of the bright region outline map data) stored in the RAM 109 is read, and the luminance image data is generated. The conversion of the input image from RGB to the luminance Y may be performed first by using a general conversion formula. Then, the luminance image data is generated by performing a smoothing process such as a Gaussian filter on the image data composed of only the obtained luminance component.

ステップS404では、明領域が入力画像のどの位置になるのかを画素単位で決定する。具体的には、ステップS402で生成した明領域マップデータに基づき、輝度画像データの各画素が明領域画素かどうかを判定する。詳細については後述する。 In step S404, the position of the bright region in the input image is determined on a pixel-by-pixel basis. Specifically, based on the bright region map data generated in step S402, it is determined whether or not each pixel of the luminance image data is a bright region pixel. Details will be described later.

ステップS405では、ステップS404で生成した明領域画素をマップしたものを合成マップデータとして出力し、RAM109へ格納する。以上説明した処理により、ステップS204の明領域画素決定処理が完了する。 In step S405, a map of the bright region pixels generated in step S404 is output as composite map data and stored in the RAM 109. By the process described above, the bright region pixel determination process in step S204 is completed.

[明領域画素判定処理]
ここでは、ステップS404の明領域画素判定処理について、図9および図12のフローチャートを用いて詳細に説明する。
[Bright area pixel determination processing]
Here, the bright region pixel determination process in step S404 will be described in detail with reference to the flowcharts of FIGS. 9 and 12.

ステップS1201では、信号処理部103は、まず明領域画素判定を行う画素位置を初期化する。たとえば入力した画像データの左上隅の画素を判定開始位置としてセットする。同様に、信号処理部103は、明領域マップデータ902の左上隅の画素を参照開始位置としてセットする。なお、以下の説明では、判定対象画素、参照対象画素それぞれの位置は、ラスタースキャン順に更新されていくものとする。 In step S1201, the signal processing unit 103 first initializes the pixel position for determining the bright region pixel. For example, the pixel in the upper left corner of the input image data is set as the determination start position. Similarly, the signal processing unit 103 sets the pixel in the upper left corner of the bright region map data 902 as the reference start position. In the following description, the positions of the determination target pixel and the reference target pixel are updated in the order of raster scan.

ステップS1202では、入力画像内の判定対象画素位置に対応する明領域マップデータ902の値が“0”になっているかどうかを確認する。0になっていればステップS1208へ、それ以外の場合はステップS1203へ移行する。 In step S1202, it is confirmed whether or not the value of the bright region map data 902 corresponding to the determination target pixel position in the input image is “0”. If it is 0, the process proceeds to step S1208, and if not, the process proceeds to step S1203.

ステップS1203では、入力画像内の判定対象画素位置に対応する明領域マップデータ902の値が“255”になっているかどうかを確認する。“255”になっていればステップS1207へ、そうでなければステップS1204へ移行する。 In step S1203, it is confirmed whether or not the value of the bright region map data 902 corresponding to the determination target pixel position in the input image is “255”. If it is "255", the process proceeds to step S1207, otherwise the process proceeds to step S1204.

ステップS1204では、明領域画素の出力値を決定する。具体的には、図10に示すように、輝度画像データを入力とした場合に、合成マップデータに出力する値を決定するテーブルを持ち、テーブルを参照して出力値を決定する。なお、このときに或る入力値以下は出力値を0、或る入力値以上は出力を255としてもよい。この部分は、合成マップデータでは境界と位置付けられる部分であるため、明領域とそうでない部分が混在している可能性が高く、入力画像の明るさによって厳密に判定する必要がある。このため、輝度画像データをもとに明領域画素の出力値の判定を行う。 In step S1204, the output value of the bright region pixel is determined. Specifically, as shown in FIG. 10, when the luminance image data is input, it has a table for determining the value to be output to the composite map data, and the output value is determined by referring to the table. At this time, the output value may be 0 for a certain input value or less, and the output may be 255 for a certain input value or more. Since this part is positioned as a boundary in the composite map data, there is a high possibility that a bright area and a non-bright area are mixed, and it is necessary to make a strict judgment based on the brightness of the input image. Therefore, the output value of the bright region pixel is determined based on the luminance image data.

ステップS1205では、全画素の明領域判定処理が完了したかどうかを判定する。完了していればステップS1209へ、していなければステップS1206へ移行する。 In step S1205, it is determined whether or not the bright region determination process for all pixels is completed. If it is completed, the process proceeds to step S1209, and if not, the process proceeds to step S1206.

ステップS1206は、次の判定画素位置へ判定対象を移動させる。たとえば、位置画素右側を判定対象にする、または一行下の左端画素を判定対象にする等が挙げられる。 In step S1206, the determination target is moved to the next determination pixel position. For example, the right side of the position pixel is set as the determination target, or the leftmost pixel one line below is set as the determination target.

ステップS1207は、合成マップデータの画素値を“255”をセットする。この部分は、明領域マップデータで確実に明るい場所と判定された領域であるため、出力値を“255”とする。ステップS1208は、合成マップデータの画素値を“0”にセットする。この部分は、先ほどとは逆に明領域マップデータでは確実に暗い場所と判定された領域であるため、出力値を0とする。ステップS1209は、生成された合成マップデータ903を出力し、RAM109へ格納する。 In step S1207, the pixel value of the composite map data is set to "255". Since this part is a region determined to be a bright place by the bright area map data, the output value is set to "255". In step S1208, the pixel value of the composite map data is set to “0”. Contrary to the above, this part is a region that is definitely determined to be a dark place in the bright region map data, so the output value is set to 0. In step S1209, the generated composite map data 903 is output and stored in the RAM 109.

以上説明した処理により、ステップS404の明領域画素判定処理&合成マップデータの出力処理が完了する。ここで、生成される合成マップデータ903における画素値は0乃至255の値を取り得る。 By the process described above, the bright region pixel determination process and the composite map data output process in step S404 are completed. Here, the pixel value in the generated composite map data 903 can take a value of 0 to 255.

[画像合成処理]
ステップS203、S209の画像合成処理について説明する。
[Image composition processing]
The image composition processing of steps S203 and S209 will be described.

ステップS203で示した関数G()は、基本的に式(2)のように、2枚の画像データの合成演算処理である。
out=G(Ishort,Ilong
=IOut(x,y)=A×IShort (x,y)+(1-A)×ILong (x,y) …(2)
ここで、xとyは画素位置を表す変数、Aは合成マップデータの画素位置(x、y)の値から決まる合成比率である。IShortは露光量の少ない画像、Ilongは露光量の多い画像を表している。ここで、合成比率Aの生成方法について説明する。
The function G () shown in step S203 is basically a synthesis operation process of two image data as in the equation (2).
I out = G (I short , I long )
= I Out (x, y) = A × I Short (x, y) + (1-A) × I Long (x, y)… (2)
Here, x and y are variables representing pixel positions, and A is a composition ratio determined by the values of the pixel positions (x, y) of the composition map data. I Short represents an image with a small amount of exposure, and I long represents an image with a large amount of exposure. Here, a method of generating the synthesis ratio A will be described.

ここで、合成比率Aの導出には、画像IShortの輝度成分を用いる。画像IShortから各画素の輝度成分を求め、平滑化処理を行う。平滑化処理には、たとえば5×5のガウシアンフィルタを用いればよい。平滑化処理後の輝度成分に対して、図13のように、輝度成分に対して、合成マップデータの出力値を参照する。その結果、各画素における合成比率Aの値が決定する。図13において、Aの決定方法は、閾値th2、th3を設定し、輝度がth2より少なければ出力値は0、th3より大きければ出力値は1とし、th2とth3の間は線形補間した結果を用いている。 Here, the luminance component of the image I Short is used to derive the composition ratio A. The brightness component of each pixel is obtained from the image I Short , and smoothing processing is performed. For the smoothing process, for example, a 5 × 5 Gaussian filter may be used. As shown in FIG. 13, for the luminance component after the smoothing process, the output value of the composite map data is referred to for the luminance component. As a result, the value of the composition ratio A in each pixel is determined. In FIG. 13, in the determination method of A, the threshold values th2 and th3 are set, the output value is 0 if the brightness is less than th2, the output value is 1 if the brightness is larger than th3, and the result of linear interpolation between th2 and th3 is obtained. I am using it.

S203では、画像データI1〜I4について、式(2)を当てはめて演算を行うことになる。なお、各演算における閾値th2、th3は、合成する2つの画像の関係から予め決まった値となる。 In S203, the calculation is performed by applying the equation (2) to the image data I 1 to I 4 . The threshold values th2 and th3 in each calculation are predetermined values based on the relationship between the two images to be combined.

次に、S209の合成処理を説明する。S209の合成処理は、式(2)における画像データIshortが第2のガンマ適用後の画像データLであり、画像データILongが基本HDR画像となる。そして、合成マップデータAとして図4のS405で生成した合成マップデータ903を用いることになる。図4のS405で求めた合成マップデータ903の画素値は0乃至255の値を取るので、合成比率は合成マップデータの画素値を255で除算した値を用いることになる。つまり、合成マップデータの座標(x、y)の値をMとするなら、合成比率Aは、A=M/255となる。 Next, the synthesis process of S209 will be described. In the synthesis process of S209, the image data I short in the formula (2) is the image data L after the application of the second gamma, and the image data I Long is the basic HDR image. Then, the composite map data 903 generated in S405 of FIG. 4 is used as the composite map data A. Since the pixel value of the composite map data 903 obtained in S405 of FIG. 4 takes a value of 0 to 255, the composite ratio uses the value obtained by dividing the pixel value of the composite map data by 255. That is, if the values of the coordinates (x, y) of the composite map data are M, the composite ratio A is A = M / 255.

上記の式からわかるように、合成マップデータ903における“0”の領域は、図9の暗領域であり、その領域の階調度を強調、もしくは維持するために基本HDR画像データを用いることを示している。逆に明領域では、第2のガンマを適用した画像データLを用いることを示している。そして、中間部については、基本HDR画像データと画像データLとを、合成マップデータに基づき合成していく。この結果、明領域については、基本HDR画像よりも更にコントラストを向上させることができる。 As can be seen from the above equation, the “0” region in the composite map data 903 is the dark region of FIG. 9, indicating that the basic HDR image data is used to emphasize or maintain the gradation of the region. ing. On the contrary, in the bright region, it is shown that the image data L to which the second gamma is applied is used. Then, for the intermediate portion, the basic HDR image data and the image data L are combined based on the composite map data. As a result, in the bright region, the contrast can be further improved as compared with the basic HDR image.

以上説明したように、本実施形態よれば、露光条件の異なる複数の画像からHDR画像データを生成する際に、複数の画像のうちの所定画像が予め設定された明度条件を満たすかどうかを判定し、満たさない場合には通常の第1のガンマを各画像に適用して通常HDR画像を生成する。そして、複数の画像のうちの所定画像が予め設定された明度条件を満たした場合には、当該画像と通常HDR画像とから、明度領域のコントラストを更に向上させたHDR画像を生成することが可能となる。 As described above, according to the present embodiment, when HDR image data is generated from a plurality of images having different exposure conditions, it is determined whether or not a predetermined image among the plurality of images satisfies a preset brightness condition. If not satisfied, a normal first gamma is applied to each image to generate a normal HDR image. Then, when a predetermined image among the plurality of images satisfies the preset brightness condition, it is possible to generate an HDR image with further improved contrast in the brightness region from the image and the normal HDR image. It becomes.

[第2の実施形態]
[概要]
第2実施形態の概要について説明する。第2実施形態では、露光の異なる2枚の画像を入力し、その中のいずれか1枚の入力画像をもとに、明部のコントラスト向上の可否の判断を行う。そして、視認性向上ができると判断された場合には、露光の異なる合成を行う場合に選択した画像に対して、通常の画像合成処理とともに、通常とは異なる画像処理を行ったうえでさらに画像合成を行う。コントラスト向上ができると判断されなかった場合には通常の画像合成処理のみを行う。なお本第2の実施形態は、第1実施形態との差分のみを記載する。
[Second Embodiment]
[Overview]
The outline of the second embodiment will be described. In the second embodiment, two images having different exposures are input, and based on the input image of any one of them, it is determined whether or not the contrast of the bright part can be improved. Then, when it is determined that the visibility can be improved, the image selected when the composition with different exposures is performed is further subjected to image processing different from the usual image processing in addition to the normal image composition processing. Perform synthesis. If it is not determined that the contrast can be improved, only normal image composition processing is performed. In this second embodiment, only the difference from the first embodiment is described.

第1実施形態と異なる部分は、ステップS204における撮影画像の明領域判定処理、特にステップS309の明領域概略マップデータの出力方法が異なる。 The difference from the first embodiment is that the bright region determination process of the captured image in step S204, particularly the output method of the bright region schematic map data in step S309 is different.

本第2の実施形態の、明領域概略マップデータを出力するにあたり、露光量の少ない方のみを行えばよい。これは、合成枚数が2枚の場合、必然的に撮像可能なシーンの輝度レンジが狭く、露光量の大きい方の撮影画像に図14のようなガンマをかけても、コントラストの低下が起こりにくいためである。このため、ステップS309のマップデータの出力処理は、露光量の少ない撮影画像をもとにして得られた2値化画像を出力する。図15は、本第2の実施形態における明領域概略マップデータの出力処理のフローチャートである。図3との違いは、上記の如く、合成に用いる画像が2枚であるので、1パスで処理が完了する点である。 In outputting the bright region outline map data of the second embodiment, only the one with the smaller exposure amount needs to be output. This is because when the number of composite images is two, the brightness range of the scene that can be captured is inevitably narrow, and even if the gamma as shown in FIG. 14 is applied to the captured image with the larger exposure amount, the contrast is unlikely to decrease. Because. Therefore, the map data output process in step S309 outputs a binarized image obtained based on the captured image having a small exposure amount. FIG. 15 is a flowchart of output processing of bright region schematic map data in the second embodiment. The difference from FIG. 3 is that, as described above, since the number of images used for compositing is two, the processing is completed in one pass.

[第3の実施形態]
第3の実施形態について説明する。第3実施形態では、露光の異なる4枚の画像を1セットとし、時系列に並ぶ複数セット、つまり、動画像を処理する例を説明する。そして、第3の実施形態では、着目している1セット分の画像を入力し、その中で所定条件を満たす画像を特定し、その画像に基づき明部のコントラスト向上ができるかどうかの判断を行う。そして、視認性向上ができると判断された場合には、露光の異なる合成を行う場合に選択した画像に対して、通常のガンマ変換とともに、通常とは異なるガンマ変換条件でガンマ変換を行った上、さらに前フレームで視認性向上のための画像合成をどの程度行ったかをもとに、現フレームの画像合成を行う。以下、更に詳しく説明する。なお本第3の実施形態は、第1実施形態との差分のみを記載する。
[Third Embodiment]
A third embodiment will be described. In the third embodiment, an example in which four images having different exposures are set as one set and a plurality of sets arranged in chronological order, that is, moving images are processed will be described. Then, in the third embodiment, one set of images of interest is input, an image satisfying a predetermined condition is specified, and it is determined whether or not the contrast of the bright part can be improved based on the image. Do. Then, when it is judged that the visibility can be improved, the images selected when performing the composition with different exposures are subjected to gamma conversion under normal gamma conversion conditions in addition to normal gamma conversion. Furthermore, the image composition of the current frame is performed based on the degree of image composition for improving the visibility in the previous frame. Hereinafter, it will be described in more detail. In this third embodiment, only the difference from the first embodiment is described.

第3実施形態では、RAM109で保持する情報が第1の実施形態で説明した画像入力部で得られた画像データに加えて、前フレームでのHDR合成画像を出力した際に、第2のガンマ画像をどの程度を第1のガンマに合成したかを表す合成比率Ip、および現フレームでの第2のガンマ画像をどの程度合成するかを示す合成比率Inとを保持する。以下、これらのデータをどのように利用するかを説明する。 In the third embodiment, when the information held in the RAM 109 is the image data obtained by the image input unit described in the first embodiment and the HDR composite image in the previous frame is output, the second gamma It holds a composition ratio Ip indicating how much the image is combined with the first gamma, and a composition ratio In indicating how much the second gamma image in the current frame is combined. Hereinafter, how to use these data will be described.

図18は、第3実施形態の画像処理装置の信号処理部103における画像合成処理の流れを示したものである。ステップS1801〜ステップS1803は図2のステップS201〜S203、ステップS1807〜S1808はステップS207〜S208と同じである。ステップS1804と、ステップS1809が第1実施形態と異なる部分である。 FIG. 18 shows the flow of image composition processing in the signal processing unit 103 of the image processing apparatus of the third embodiment. Steps S1801 to S1803 are the same as steps S201 to S203 in FIG. 2, and steps S1807 to S1808 are the same as steps S207 to S208. Step S1804 and step S1809 are different parts from the first embodiment.

ステップS1804にて、信号処理部103は、明領域のコントラスト向上可否の判断を行い、後述する変数JLに代入すべき数値を決定する。明領域コントラスト向上が可能だと判断された場合には、信号処理部103は変数JLに255を、不可だと判断された場合、変数JLに0を代入する。 In step S1804, the signal processing unit 103 determines whether or not the contrast in the bright region can be improved, and determines a numerical value to be assigned to the variable JL described later. When it is determined that the bright region contrast can be improved, the signal processing unit 103 substitutes 255 for the variable JL, and when it is determined that it is not possible, 0 is assigned to the variable JL.

ステップS1809にて、信号処理部103は、ステップS1802およびステップS1808で作成したガンマ適用後画像を用いて画像合成を行い、ダイナミックレンジの広い画像を生成する。詳細については後述するが、ステップS1804の結果に基づき、第1および第2のガンマが適用後の画像、およびRAM109に保持されている前フレームでのHDR合成画像における第2のガンマ画像の合成比率Ipを用いて画像合成を行う。 In step S1809, the signal processing unit 103 performs image composition using the gamma-applied image created in step S1802 and step S1808 to generate an image having a wide dynamic range. The details will be described later, but based on the result of step S1804, the composition ratio of the second gamma image in the image after the application of the first and second gammas and the HDR composite image in the previous frame held in the RAM 109. Image composition is performed using Ip.

図19は、第3実施形態の画像処理装置でのステップS1806における第2のガンマ画像の合成処理の流れを示すフローチャートである。 FIG. 19 is a flowchart showing the flow of the second gamma image compositing process in step S1806 in the image processing apparatus of the third embodiment.

ステップS1901にて、信号処理部103は、RAM109に保持された、前フレームでの第2のガンマ画像の合成比率Ipを取得する。なお、Ipは例えば0から255の整数で表される。 In step S1901, the signal processing unit 103 acquires the composite ratio Ip of the second gamma image in the previous frame held in the RAM 109. Ip is represented by, for example, an integer from 0 to 255.

ステップS1902にて、信号処理部103は、現フレームでの第2のガンマ画像の合成比率Inを例えば次式(5)のように計算する。
In = Ip + Kp*(JL - Ip) + Ki*(JL - Ip) …(5)
求めたInは、RAM109に保持される。ここで、JLは現フレームにおけるステップS203で求められた明領域があるかどうかの判定結果を用いる。明領域がある場合には先のステップS1804で求めた255を、明領域がない場合には0を代入する。また、Kp、Kiは制御パラメータで、例えばKp = 0.5, Ki = 0.3 とすればよい。
In step S1902, the signal processing unit 103 calculates the composition ratio In of the second gamma image in the current frame, for example, by the following equation (5).
In = Ip + Kp * (JL --Ip) + Ki * (JL --Ip)… (5)
The obtained In is held in the RAM 109. Here, JL uses the determination result of whether or not there is a bright region obtained in step S203 in the current frame. If there is a bright region, 255 obtained in the previous step S1804 is substituted, and if there is no bright region, 0 is substituted. Kp and Ki are control parameters, for example, Kp = 0.5 and Ki = 0.3.

ステップS1903にて、信号処理部103は、ステップS1902で求めたInに基づいて、次式(6)のように、第二のガンマ画像を第1のガンマ画像に合成する。そして、Inを次フレームでのIpとして合成に利用する。
Out3(x,y)=In×A/255×ILocal(x,y)+(255-In)×((255-A)/255)×IOut1(x,y) …(6)
ここで、AはステップS204で生成した合成マップである。
In step S1903, the signal processing unit 103 synthesizes the second gamma image into the first gamma image according to the following equation (6) based on the In obtained in step S1902. Then, In is used for synthesis as Ip in the next frame.
I Out3 (x, y) = In × A / 255 × I Local (x, y) + (255-In) × ((255-A) / 255) × I Out1 (x, y)… (6)
Here, A is a composite map generated in step S204.

このようにIn加えて第2のガンマを合成した場合、Aの値がフレーム毎に大きく変動した場合や、ステップS203での結果がフレーム毎に変化した場合においても、合成画像Iout3は第2のガンマ画像の合成度合が大きく変動することがなくなる。このため、合成画像を動画として見た場合において、変化の少ない画像が得られる。 When the second gamma is synthesized by adding In in this way, the composite image Iout3 is the second gamma even when the value of A fluctuates greatly from frame to frame or when the result in step S203 changes from frame to frame. The degree of gamma image composition does not fluctuate significantly. Therefore, when the composite image is viewed as a moving image, an image with little change can be obtained.

以上説明したように、第3の実施形態においては、第2のガンマを合成するかどうかがフレーム毎に変化したとしても、出力画像で大きな画像変化を発生させることなく、見やすい画像を提供することができる。 As described above, in the third embodiment, even if whether or not to synthesize the second gamma changes for each frame, an easy-to-see image is provided without causing a large image change in the output image. Can be done.

[その他の場合]
第1実施形態および第2実施形態では、ガンマ変換を2種類持つことでコントラスト向上効果を得たが、本発明はこれに限定されるものではなく、ガンマ変換のほか、折れ線ガンマ等、他のトーンカーブを用いても構わない。この時もコントラスト向上のためのトーンカーブには、コントラストを向上させるべき明領域または暗領域に階調を多く持つトーンカーブであることが望ましい。
[Other cases]
In the first embodiment and the second embodiment, the contrast improving effect is obtained by having two types of gamma conversion, but the present invention is not limited to this, and in addition to the gamma conversion, other gamma conversion and the like are obtained. A tone curve may be used. Even at this time, it is desirable that the tone curve for improving the contrast is a tone curve having many gradations in a bright region or a dark region where the contrast should be improved.

また、合成処理に利用する画像データの個数は、第1の実施形態では4枚、第2の実施形態では2枚としているが、N枚(ただしN≧2)の画像に一般化できることは言うまでもない。 Further, the number of image data used for the compositing process is 4 in the first embodiment and 2 in the second embodiment, but it goes without saying that it can be generalized to N images (however, N ≧ 2). No.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。 The present invention is also realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiment is supplied to the system or device via a network or various storage media, and the computer (or CPU, MPU, etc.) of the system or device reads the program. This is the process to be executed.

101…撮像部、102…A/D変換部、103…信号処理部、107…CPU、108…ROM、109…RAM 101 ... Imaging unit, 102 ... A / D conversion unit, 103 ... Signal processing unit, 107 ... CPU, 108 ... ROM, 109 ... RAM

Claims (11)

露光量の異なる複数の画像データからHDR(High Dynamic Range)画像データを生成する画像処理装置であって、
複数の画像データのそれぞれに第1のガンマを適用し、当該第1のガンマの適用後の複数の画像データを合成することで、第1のHDR画像データを生成する第1の合成手段と、
前記複数の画像データのうちの予め設定された1つの画像データが、予め設定された条件を満たす明領域を含む場合には、当該明領域に基づき、前記予め設定された1つの画像データから、明領域、暗領域、及び、中間領域を判別する判別手段と、
前記複数の画像データのうちの1つに、前記第1のガンマとは異なる第2のガンマを適用して、当該第2のガンマを適用して得た画像データと前記第1のHDR画像データとを、前記判別手段による判別の結果に応じて合成することで第2のHDR画像データを生成する第2の合成手段と
を有することを特徴とする画像処理装置。
An image processing device that generates HDR (High Dynamic Range) image data from a plurality of image data having different exposure amounts.
A first synthesizing means for generating a first HDR image data by applying a first gamma to each of a plurality of image data and synthesizing a plurality of image data after the application of the first gamma.
When one preset image data among the plurality of image data includes a bright region satisfying a preset condition, the preset image data is based on the bright region. A discriminating means for discriminating between a bright region, a dark region, and an intermediate region,
An image data obtained by applying a second gamma different from the first gamma to one of the plurality of image data and applying the second gamma, and the first HDR image data. An image processing apparatus comprising: and a second synthesizing means for generating a second HDR image data by synthesizing according to the result of the discrimination by the discriminating means.
前記判別手段は、前記露光量の異なる複数の画像データのうち、露光量が最大、最小の画像データを除く1つの画像データを用いることを特徴とする請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the discriminating means uses one image data excluding the image data having the maximum and minimum exposure amounts among the plurality of image data having different exposure amounts. 前記判別手段により、前記複数の画像データのうちの予め設定された1つの画像データが前記予め設定された条件を満たす明領域が有ると判定された場合には、前記第2のHDR画像データを出力し、無いと判定された場合には前記第1のHDR画像データを出力することを特徴とする請求項1又は2に記載の画像処理装置。 When it is determined by the discriminating means that one of the plurality of image data presets has a bright region satisfying the preset conditions, the second HDR image data is used. The image processing apparatus according to claim 1 or 2, wherein the first HDR image data is output when it is determined that there is no output. 前記判別手段は、
前記予め設定された1つの画像データを、輝度成分のみで構成される輝度画像データに変換する手段と、
前記輝度画像データを、それぞれが所定の画素数で構成される、複数の画素ブロックに分割し、画素ブロックそれぞれの平均輝度値を算出し、当該平均輝度値を成分とする縮小画像データを生成し、当該縮小画像データの輝度値のヒストグラムを求める手段と、
前記ヒストグラムから、所定のアルゴリズムに従って明部、暗部に分けるための閾値を算出する手段と、
前記ヒストグラムにおける前記閾値が示すビンを含み、連続する所定の数のビンの度数が0であるか否かを判定する手段とを含み、
前記判別手段は、前記度数が0の連続する所定の数のビンが存在した場合、前記複数の画像データのうちの予め設定された1つの画像データが、予め設定された条件を満たす明領域があると判定する
ことを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。
The discriminating means
A means for converting one preset image data into luminance image data composed of only luminance components, and
The brightness image data is divided into a plurality of pixel blocks, each of which is composed of a predetermined number of pixels, the average brightness value of each pixel block is calculated, and reduced image data having the average brightness value as a component is generated. , A means for obtaining a histogram of the brightness value of the reduced image data,
A means for calculating a threshold value for dividing into a bright part and a dark part according to a predetermined algorithm from the histogram, and
It includes bins indicated by the threshold in the histogram, and includes means for determining whether or not the frequency of a predetermined number of consecutive bins is 0.
In the discriminating means, when a predetermined number of consecutive bins having a frequency of 0 are present, one preset image data among the plurality of image data has a bright region satisfying a preset condition. The image processing apparatus according to any one of claims 1 to 3, wherein the image processing apparatus is determined to be present.
前記判別手段は、前記予め設定された1つの画像データから、明領域、暗領域、及び、中間領域を判別するためのマップデータを生成する生成手段を含み、
前記生成手段は、
前記明部、前記閾値に基づき、前記縮小画像データを明部、暗部を判別する2値画像データを生成する手段と、
生成した2値画像データにおける前記暗部の領域に属する画素の、前記明部の領域に接する画素を中間部に変更し、明部、暗部、中間部を判別する3値画像データを生成する3値画像生成手段と、
生成した3値画像データを、オリジナルの画像のサイズまで拡大する手段とを有し、
前記生成手段は、前記拡大によって得られた3値画像データから、前記マップデータを生成することを特徴とする請求項4に記載の画像処理装置。
The discriminating means includes a generating means for generating map data for discriminating a bright region, a dark region, and an intermediate region from the one preset image data.
The generation means
A means for generating binary image data for discriminating between bright and dark parts of the reduced image data based on the bright part and the threshold value.
In the generated binary image data, the pixels belonging to the dark area and the pixels in contact with the bright area are changed to the intermediate part, and the ternary image data for discriminating the bright part, the dark part, and the intermediate part is generated. Image generation means and
It has a means to enlarge the generated binary image data to the size of the original image.
The image processing apparatus according to claim 4, wherein the generation means generates the map data from the binary image data obtained by the enlargement.
前記第1のガンマは、logガンマであり、
前記第2のガンマは、明部の階調性を強調するガンマである
ことを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。
The first gamma is a log gamma and is
The image processing apparatus according to any one of claims 1 to 4, wherein the second gamma is a gamma that emphasizes the gradation of bright areas.
露光量の異なる複数の画像データからHDR(High Dynamic Range)画像データを生成する画像処理装置の制御方法であって、
第1の合成手段が、複数の画像データのそれぞれに第1のガンマを適用し、当該第1のガンマの適用後の複数の画像データを合成することで、第1のHDR画像データを生成する第1の合成工程と、
判別手段が、前記複数の画像データのうちの予め設定された1つの画像データが、予め設定された条件を満たす明領域を含む場合には、当該明領域に基づき、前記予め設定された1つの画像データから、明領域、暗領域、及び、中間領域を判別する判別工程と、
第2の合成手段が、前記複数の画像データのうちの1つに、前記第1のガンマとは異なる第2のガンマを適用して、当該第2のガンマを適用して得た画像データと前記第1のHDR画像データとを、前記判別工程による判別の結果に応じて合成することで第2のHDR画像データを生成する第2の合成工程と
を有することを特徴とする画像処理装置の制御方法。
It is a control method of an image processing device that generates HDR (High Dynamic Range) image data from a plurality of image data having different exposure amounts.
The first compositing means applies the first gamma to each of the plurality of image data, and synthesizes the plurality of image data after the application of the first gamma to generate the first HDR image data. The first synthesis step and
When the determination means includes a bright region in which one preset image data among the plurality of image data satisfies the preset condition, the one preset image data is based on the bright region. A discrimination step for discriminating a bright region, a dark region, and an intermediate region from image data, and
The second compositing means applies a second gamma different from the first gamma to one of the plurality of image data, and applies the second gamma to the image data obtained. An image processing apparatus comprising: a second synthesizing step of generating a second HDR image data by synthesizing the first HDR image data according to the result of discrimination by the discrimination step. Control method.
露光量の異なる複数の画像データからHDR(High Dynamic Range)画像データを生成する画像処理装置であって、
複数の画像データのそれぞれに第1のガンマを適用し、当該第1のガンマの適用後の複数の画像データを合成することで、第1のHDR画像データを生成する第1の合成手段と、
前記複数の画像データのうちの予め設定された1つの画像データが、予め設定された条件を満たす明領域を含むか否かを判定する判定手段と、
該判定手段による判定で前記条件を満たす明領域が含むと判定された場合には、当該明領域に基づき、前記予め設定された1つの画像データから、明領域、暗領域、及び、中間領域を判別するためのマップデータを生成する生成手段と、
前記判定手段による判定結果と、前フレームへの前記判定手段による判定結果から、前記マップデータの補正量を算出する補正量算出手段と、
前記複数の画像データのうちの1つに、前記第1のガンマとは異なる第2のガンマを適用して、当該第2のガンマを適用して得た画像データと前記第1のHDR画像データとを、前記補正量算出手段により算出された補正量で補正したマップデータを参照して合成することで第2のHDR画像データを生成する第2の合成手段と
を有することを特徴とする画像処理装置。
An image processing device that generates HDR (High Dynamic Range) image data from a plurality of image data having different exposure amounts.
A first synthesizing means for generating a first HDR image data by applying a first gamma to each of a plurality of image data and synthesizing a plurality of image data after the application of the first gamma.
A determination means for determining whether or not one preset image data out of the plurality of image data includes a bright region satisfying the preset conditions.
When it is determined by the determination means that the bright region satisfying the above conditions is included, the bright region, the dark region, and the intermediate region are divided from the one preset image data based on the bright region. A generation means for generating map data for discrimination, and
A correction amount calculation means for calculating the correction amount of the map data from the determination result by the determination means and the determination result by the determination means for the previous frame.
An image data obtained by applying a second gamma different from the first gamma to one of the plurality of image data and applying the second gamma, and the first HDR image data. The image is characterized by having a second synthesizing means for generating a second HDR image data by synthesizing with reference to the map data corrected by the correction amount calculated by the correction amount calculating means. Processing equipment.
露光量の異なる複数の画像データからHDR(High Dynamic Range)画像データを生成する画像処理装置の制御方法であって、
第1の合成手段が、複数の画像データのそれぞれに第1のガンマを適用し、当該第1のガンマの適用後の複数の画像データを合成することで、第1のHDR画像データを生成する第1の合成工程と、
判定手段が、前記複数の画像データのうちの予め設定された1つの画像データが、予め設定された条件を満たす明領域を含むか否かを判定する判定工程と、
生成手段が、前記判定工程による判定で前記条件を満たす明領域が含むと判定された場合には、当該明領域に基づき、前記予め設定された1つの画像データから、明領域、暗領域、及び、中間領域を判別するためのマップデータを生成する生成工程と、
算出手段が、前記判定工程による判定結果と、前フレームの前記判定工程による判定結果から、前記マップデータの補正量を算出する算出工程と、
第2の合成手段が、前記複数の画像データのうちの1つに、前記第1のガンマとは異なる第2のガンマを適用して、当該第2のガンマを適用して得た画像データと前記第1のHDR画像データとを、前記算出工程により算出された補正量で補正したマップデータを参照して合成することで第2のHDR画像データを生成する第2の合成工程と
を有することを特徴とする画像処理装置の制御方法。
It is a control method of an image processing device that generates HDR (High Dynamic Range) image data from a plurality of image data having different exposure amounts.
The first compositing means applies the first gamma to each of the plurality of image data, and synthesizes the plurality of image data after the application of the first gamma to generate the first HDR image data. The first synthesis step and
A determination step in which the determination means determines whether or not one preset image data out of the plurality of image data includes a bright region satisfying the preset conditions.
When the generation means is determined to include a bright region satisfying the above conditions by the determination by the determination step, the bright region, the dark region, and the bright region and the dark region are derived from the one preset image data based on the bright region. , A generation process that generates map data to determine the intermediate region,
The calculation means includes a calculation step of calculating the correction amount of the map data from the determination result by the determination step and the determination result by the determination step of the previous frame.
The second synthesizing means applies a second gamma different from the first gamma to one of the plurality of image data, and applies the second gamma to the image data obtained. It has a second synthesizing step of generating a second HDR image data by synthesizing the first HDR image data with reference to the map data corrected by the correction amount calculated by the calculation step. A method of controlling an image processing device, which comprises.
コンピュータが読み込み実行することで、前記コンピュータに、請求項7又は9に記載の方法の各工程を実行させるためのプログラム。 A program for causing the computer to execute each step of the method according to claim 7 or 9, when the computer reads and executes the process. 請求項10に記載のプログラムを格納したコンピュータが読み込み可能な記憶媒体。 A storage medium that can be read by a computer that stores the program according to claim 10.
JP2017054872A 2016-06-15 2017-03-21 Image processing device and its control method Active JP6826472B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/609,475 US10313605B2 (en) 2016-06-15 2017-05-31 Image processing apparatus and control method thereof for generating high dynamic range image data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016119150 2016-06-15
JP2016119150 2016-06-15

Publications (2)

Publication Number Publication Date
JP2017229058A JP2017229058A (en) 2017-12-28
JP6826472B2 true JP6826472B2 (en) 2021-02-03

Family

ID=60891997

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017054872A Active JP6826472B2 (en) 2016-06-15 2017-03-21 Image processing device and its control method

Country Status (1)

Country Link
JP (1) JP6826472B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021014560A1 (en) * 2019-07-23 2021-01-28 パナソニックIpマネジメント株式会社 Imaging device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004032171A (en) * 2002-06-24 2004-01-29 Fuji Photo Film Co Ltd Imaging apparatus
US7508421B2 (en) * 2002-06-24 2009-03-24 Fujifilm Corporation Image pickup apparatus and image processing method
JP4402710B2 (en) * 2007-09-18 2010-01-20 オリンパス株式会社 Imaging device
JP2012257193A (en) * 2011-05-13 2012-12-27 Sony Corp Image processing apparatus, image pickup apparatus, image processing method, and program
JP6278972B2 (en) * 2012-11-16 2018-02-14 トムソン ライセンシングThomson Licensing Method, apparatus and processor readable medium for processing of high dynamic range images
JP2015080157A (en) * 2013-10-18 2015-04-23 キヤノン株式会社 Image processing device, image processing method and program
JP6543787B2 (en) * 2014-09-09 2019-07-17 ハンファテクウィン株式会社 Image processing apparatus and image processing method
US9613408B2 (en) * 2014-09-25 2017-04-04 Intel Corporation High dynamic range image composition using multiple images

Also Published As

Publication number Publication date
JP2017229058A (en) 2017-12-28

Similar Documents

Publication Publication Date Title
US10313605B2 (en) Image processing apparatus and control method thereof for generating high dynamic range image data
JP5713752B2 (en) Image processing apparatus and control method thereof
US8379102B2 (en) Image processing apparatus and image processing method for generating high dynamic range images
US8526057B2 (en) Image processing apparatus and image processing method
JP6415062B2 (en) Image processing apparatus, image processing method, control program, and recording medium
JP6074254B2 (en) Image processing apparatus and control method thereof
US10091422B2 (en) Image processing device and recording medium
JP6312487B2 (en) Image processing apparatus, control method therefor, and program
KR101136506B1 (en) Image generation method, device, its program and recording medium stored with program
JP2000228747A (en) Picture processor
JP2010034964A (en) Image composition apparatus, image composition method and image composition program
EP3131281B1 (en) Image processing apparatus and method, recording medium on which temporarily computer-readable image processing program has been stored, and image pickup apparatus
JP2018195079A (en) Image processing apparatus and image processing method
JP2013162347A (en) Image processor, image processing method, program, and device
US11336834B2 (en) Device, control method, and storage medium, with setting exposure condition for each area based on exposure value map
JP2007249436A (en) Image signal processor and processing method
JP2018182376A (en) Image processing apparatus
JP2007180851A (en) Gray scale transformation device, program and method for raw image, and electronic camera
JP6826472B2 (en) Image processing device and its control method
JP6786273B2 (en) Image processing equipment, image processing methods, and programs
JP6867563B1 (en) Image processing method
JP2008219230A (en) Imaging apparatus, and image processing method
KR20160001582A (en) Apparatus and method for processing image
KR102282464B1 (en) Image processing apparatus and image processing method
US20220261970A1 (en) Methods, systems and computer program products for generating high dynamic range image frames

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200323

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20201130

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20201218

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210115

R151 Written notification of patent or utility model registration

Ref document number: 6826472

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151