JP6025472B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP6025472B2
JP6025472B2 JP2012203019A JP2012203019A JP6025472B2 JP 6025472 B2 JP6025472 B2 JP 6025472B2 JP 2012203019 A JP2012203019 A JP 2012203019A JP 2012203019 A JP2012203019 A JP 2012203019A JP 6025472 B2 JP6025472 B2 JP 6025472B2
Authority
JP
Japan
Prior art keywords
image
images
value
unit
limit value
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.)
Expired - Fee Related
Application number
JP2012203019A
Other languages
Japanese (ja)
Other versions
JP2014060502A (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 JP2012203019A priority Critical patent/JP6025472B2/en
Publication of JP2014060502A publication Critical patent/JP2014060502A/en
Application granted granted Critical
Publication of JP6025472B2 publication Critical patent/JP6025472B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Studio Devices (AREA)

Description

本発明は、異なる露光量で撮影した複数枚の画像を用いて被写体の動き(移動体)を検出する画像処理装置及び画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method for detecting a motion (moving body) of a subject using a plurality of images taken with different exposure amounts.

露光量の異なる複数回の撮像により得られる画像を合成することで、撮像素子のダイナミックレンジの不足を補うハイダイナミックレンジ画像を作成する画像処理方法がある。このとき、露光量の異なる複数回の撮像により得られた複数画像は、時間的に異なるタイミングで撮影した画像であり、複数回の撮像をしている間に被写体の動き(移動体)が発生すると、適切なハイダイナミックレンジ画像を得ることができない。そこで、この被写体の動き(移動体)を検出し、補正する方法も開示さている。   There is an image processing method for creating a high dynamic range image that compensates for a lack of dynamic range of an image sensor by synthesizing images obtained by multiple imaging with different exposure amounts. At this time, the multiple images obtained by multiple times of imaging with different exposure amounts are images taken at different timings, and subject movement (moving body) occurs during multiple times of imaging. Then, an appropriate high dynamic range image cannot be obtained. Therefore, a method for detecting and correcting the movement (moving body) of the subject is also disclosed.

例えば、特許文献1では、2枚の画像の露光量の比である露光比を求め、各画素について露光量比を考慮した画素値の差分を求め、差分があるしきい値を超えた場合に動きありと判定する方法が開示されている。   For example, in Patent Document 1, an exposure ratio that is a ratio of exposure amounts of two images is obtained, a difference between pixel values in consideration of the exposure amount ratio is obtained for each pixel, and the difference exceeds a certain threshold value. A method for determining that there is motion is disclosed.

特開2008−028926号公報JP 2008-028926 A

しかしながら、上述の特許文献1に開示された従来技術では、白とびした部分の検出は別途行っているが、黒つぶれした領域の処理を特別に行っていないため、黒つぶれした領域での被写体の動き(移動体)を誤検出してしまう可能性がある。   However, in the conventional technique disclosed in Patent Document 1 described above, the overexposed part is separately detected, but since the process of the overexposure area is not specially performed, the object in the overexposure area is not processed. There is a possibility that a motion (moving body) is erroneously detected.

そこで、本発明の目的は、異なる露光量で撮影した複数枚の画像を用いて、被写体の動きを検出する画像処理装置に関し、白とびや黒つぶれしている部分であっても被写体の動きの誤検出を軽減することを可能にした画像処理装置を提供することである。   Accordingly, an object of the present invention relates to an image processing apparatus that detects the movement of a subject using a plurality of images taken with different exposure amounts, and relates to the movement of a subject even in an overexposed or blackened portion. An object of the present invention is to provide an image processing apparatus capable of reducing erroneous detection.

上記目的を達成するために、本発明の画像処理装置は、露出の異なる複数の画像に対して、露出ムラを補正するとともに、画像間の明るさを揃えるためのゲインを掛ける調整手段と、前記調整手段によって平均的な明るさが揃えられた2画像の間の差分値に基づいて当該2画像間の被写体の位置ずれを検出する検出手段と、前記複数の画像に対して前記検出手段によって検出される位置ずれを補正する補正手段と、前記補正手段によって補正された前記複数の画像を合成する合成手段と、を有し、前記検出手段は、前記位置ずれの検出を行う2画像の、画素値が所定の範囲内の値である領域の前記差分値に基づいて当該2画像間の位置ずれを検出し、前記所定の範囲は、前記複数の画像の画素値と、前記調整手段によって前記2画像の内の少なくとも一方に掛けられる前記ゲインに基づいて決定されることを特徴とする In order to achieve the above object, the image processing apparatus of the present invention corrects exposure unevenness for a plurality of images with different exposures, and adjusts a gain for aligning the brightness between the images, Detecting means for detecting a position shift of a subject between the two images based on a difference value between the two images whose average brightness is adjusted by the adjusting means; and detecting the plurality of images by the detecting means. A correction unit that corrects the misregistration, and a synthesizing unit that synthesizes the plurality of images corrected by the correction unit, and the detection unit includes pixels of two images that detect the misregistration. A positional shift between the two images is detected based on the difference value of a region whose value is within a predetermined range. The predetermined range is determined by the pixel values of the plurality of images and the 2 by the adjusting means. Small in image Characterized in that it is determined based on the gain applied to the one Kutomo.

本発明によれば、画像間の移動体を検出し、検出した移動体を補正しながらハイダイナミックレンジ合成を行う画像処理装置において、移動体の誤検出を軽減することができる。   ADVANTAGE OF THE INVENTION According to this invention, the misdetection of a moving body can be reduced in the image processing apparatus which detects the moving body between images and performs high dynamic range composition, correct | amending the detected moving body.

第1と第2の実施例の撮像装置1の構成Configuration of the imaging apparatus 1 of the first and second embodiments 第1の移動体補正+HDR合成処理ブロックの構成の詳細Details of the configuration of the first moving object correction + HDR synthesis processing block 第1の実施例の撮像装置1の処理に関するフローチャートThe flowchart regarding the process of the imaging device 1 of the first embodiment. 第1の実施例の輝度合わせ部と輝度制限部の処理内容Processing contents of the luminance matching unit and luminance limiting unit of the first embodiment 白とびを軽減するためのHDR撮影の露光量HDR exposure to reduce overexposure 第2の実施例の撮像装置1の処理に関するフローチャートThe flowchart regarding the process of the imaging device 1 of 2nd Example. 第2の実施例の輝度合わせ部と輝度制限部の処理内容Processing contents of the luminance matching unit and luminance limiting unit of the second embodiment 黒つぶれを軽減するためのHDR撮影の露光量HDR exposure to reduce blackout 第3の実施例の撮像装置1の構成Configuration of the imaging apparatus 1 of the third embodiment 第3の実施例の輝度合わせ部と輝度制限部の処理内容Processing contents of the luminance matching unit and luminance limiting unit of the third embodiment 第4の実施例の撮像装置1の構成Configuration of the imaging apparatus 1 of the fourth embodiment 第4の実施例の撮像装置1の処理に関するフローチャートFlowchart relating to processing of imaging apparatus 1 of the fourth embodiment 第4の実施例の露出ムラ検出部の処理内容Processing contents of the exposure unevenness detection unit of the fourth embodiment 第4の実施例の輝度合わせ部と輝度制限部の処理内容Processing contents of the luminance matching unit and luminance limiting unit of the fourth embodiment

以下に、本発明の好ましい実施の形態を、添付の図面に基づいて詳細に説明する。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

以下、第1の実施例による、異なる露光量で撮影した3枚の画像を用いて、画像間の移動体を検出、補正しながら、白とび黒つぶれを軽減して見かけ上のダイナミックレンジを広くするハイダイナミックレンジ合成(HDR合成)を行う方法について説明する。   Hereinafter, three images taken with different exposure amounts according to the first embodiment are used to detect and correct a moving body between images, while reducing overexposure and widening an apparent dynamic range. A method for performing high dynamic range synthesis (HDR synthesis) will be described.

図1は本発明の画像処理装置の一例である撮像装置1の構成を示した図である。   FIG. 1 is a diagram illustrating a configuration of an imaging apparatus 1 which is an example of an image processing apparatus of the present invention.

撮像装置1は、測光光学系(レンズ)(1000)、測光部(1010)、露光制御演算部(1020)、露光制御部(1030)、撮影光学系(レンズ)(2000)、撮像素子(2010)、A/D変換部(2020)を有する。また、輝度合わせ部(3000)、輝度制限部(3010)、現像処理部(2030)、移動体補正+HDR合成処理部(2040)を有する。また、圧縮部(2050)、記録部(2060)、メモリ(2070)、制御部(2080)、インターフェースI/F(2090)を有する。撮像装置1の各処理部は制御部(2080)によって制御される。また、場合によってはユーザー指示などの外部操作がインターフェースI/F(2090)を介して撮像装置1へと入力され、外部操作に従って制御部(2080)が処理を行う。さらに、演算処理や条件判定処理などは、必要に応じてメモリ(2070)に格納されているソフトウェアに従って制御部(2080)が行う。この時、メモリ(2070)には、演算処理や条件判定処理に関するソフトウェアや複数通りの現像処理パラメータが格納されている。また、各処理部で用いられる画像データや中間演算データなども適宜格納される。   The imaging apparatus 1 includes a photometric optical system (lens) (1000), a photometric unit (1010), an exposure control calculation unit (1020), an exposure control unit (1030), a photographing optical system (lens) (2000), and an image sensor (2010). ), An A / D converter (2020). In addition, a luminance matching unit (3000), a luminance limiting unit (3010), a development processing unit (2030), and a moving body correction + HDR synthesis processing unit (2040) are included. Further, it includes a compression unit (2050), a recording unit (2060), a memory (2070), a control unit (2080), and an interface I / F (2090). Each processing unit of the imaging apparatus 1 is controlled by the control unit (2080). In some cases, an external operation such as a user instruction is input to the imaging apparatus 1 via the interface I / F (2090), and the control unit (2080) performs processing according to the external operation. Further, arithmetic processing, condition determination processing, and the like are performed by the control unit (2080) according to software stored in the memory (2070) as necessary. At this time, the memory (2070) stores software relating to arithmetic processing and condition determination processing and a plurality of development processing parameters. In addition, image data and intermediate calculation data used in each processing unit are also stored as appropriate.

本実施例では、移動体補正・HDR合成処理部(2040)への入力画像として、第1の露光量で撮影した検出用画像と、第2の露光量で撮影した検出用画像と、第1の露光量で撮影した合成用画像と、第2の露光量で撮影した合成用画像が必要である。検出用画像とは位置ずれ検出や移動体検出を行うのに適した撮影条件で撮影されたり、画像処理等の施されたりする画像を示す。合成用画像とは、本実施例ではHDR合成処理に適した撮影条件で撮影されたり、画像処理等の施されたりする画像を示す。第1の露光量で撮影した検出用画像は、撮像素子(2010)、A/D変換部(2020)、輝度合わせ部(3000)、輝度制限部(3010)、現像処理部(2030)の処理ブロックで順に処理が行われ、メモリ1(2071)に格納される。また、第2の露光量で撮影した検出用画像は、撮像素子(2010)、A/D変換部(2020)、輝度合わせ部(3000)、輝度制限部(3010)、現像処理部(2030)で順に処理され、メモリ2(2072)に格納される。また、第1の露光量で撮影された合成用画像は、撮像素子(2010)、A/D変換部(2020)、現像処理部(2030)で順に処理され、メモリ3(2073)に格納される。また、第2の露光量で撮影された合成用画像は、撮像素子(2010)、A/D変換部(2020)、現像処理部(2030)で順に処理され、メモリ4(2074)に格納される。この時、メモリ1(2071)とメモリ2(2072)とメモリ3(2073)とメモリ4(2074)は、同一の処理ブロックでもよいが、1つの処理ブロック内の別々のメモリ領域であってもよい。   In this embodiment, as an input image to the moving body correction / HDR synthesis processing unit (2040), a detection image photographed with a first exposure amount, a detection image photographed with a second exposure amount, and a first image And a composition image photographed with the second exposure amount and a composition image photographed with the second exposure amount. The image for detection indicates an image that is photographed under photographing conditions suitable for detecting misalignment or detecting a moving object, or subjected to image processing or the like. In the present embodiment, the image for synthesis indicates an image that is shot under shooting conditions suitable for HDR synthesis processing, or that is subjected to image processing or the like. The detection image photographed with the first exposure amount is processed by the image sensor (2010), the A / D conversion unit (2020), the luminance matching unit (3000), the luminance limiting unit (3010), and the development processing unit (2030). Processing is sequentially performed in blocks and stored in the memory 1 (2071). Further, the detection image photographed with the second exposure amount includes an image sensor (2010), an A / D conversion unit (2020), a luminance matching unit (3000), a luminance limiting unit (3010), and a development processing unit (2030). Are sequentially processed and stored in the memory 2 (2072). Further, the composition image photographed with the first exposure amount is sequentially processed by the image sensor (2010), the A / D conversion unit (2020), and the development processing unit (2030), and is stored in the memory 3 (2073). The Further, the composition image photographed with the second exposure amount is sequentially processed by the imaging device (2010), the A / D conversion unit (2020), and the development processing unit (2030), and is stored in the memory 4 (2074). The At this time, the memory 1 (2071), the memory 2 (2072), the memory 3 (2073), and the memory 4 (2074) may be the same processing block, or may be separate memory areas in one processing block. Good.

図2は、移動体補正・HDR合成処理部(2040)の構成の詳細を示した図である。ここで、移動体補正・HDR合成処理部(2040)は、露光量の異なる2種類の画像データを用いて、移動体を補正してHDR合成処理を行う。ここで、図2は、撮像素子からの露光量の異なる2種類の出力を用いて処理を行うが、3枚以上の複数枚の画像に対しても、同様の処理を繰り返し行うことで対応することが可能である。   FIG. 2 is a diagram showing details of the configuration of the moving object correction / HDR synthesis processing unit (2040). Here, the moving body correction / HDR composition processing unit (2040) performs the HDR composition processing by correcting the moving body using two types of image data having different exposure amounts. Here, FIG. 2 performs processing using two types of outputs with different exposure amounts from the image sensor, but it can be dealt with by repeatedly performing the same processing for three or more images. It is possible.

移動体補正・HDR合成処理部(2040)は、位置ずれ検出部(2041)、位置ずれ補正部1(2042)、位置ずれ補正部2(2043)、HDR画像合成部(2044)、移動体検出部(2045)、移動体補正部(2046)を有する。移動体補正・HDR合成処理部(2040)の各処理部は図1の制御部(2080)によって制御される。移動体補正・HDR合成処理部(2040)内には、位置ずれ補正部1(2042)と位置ずれ補正部2(2043)と2つあるが、これらは同一の処理ブロックでもよいし、処理の高速化のために2つの処理ブロックを搭載して並列処理してもよい。   The moving object correction / HDR synthesis processing unit (2040) includes a position deviation detection unit (2041), a position deviation correction unit 1 (2042), a position deviation correction unit 2 (2043), an HDR image composition unit (2044), and a moving object detection. Unit (2045) and a moving body correction unit (2046). Each processing unit of the moving object correction / HDR synthesis processing unit (2040) is controlled by the control unit (2080) in FIG. In the moving object correction / HDR synthesis processing unit (2040), there are two positional deviation correction unit 1 (2042) and positional deviation correction unit 2 (2043). These may be the same processing block, Two processing blocks may be mounted and processed in parallel for speeding up.

図3は、本実施例で制御部(2080)が制御を行う処理フローを示したフローチャートである。以下、図3を用いて制御部(2080)が制御を行う処理フローを述べる。   FIG. 3 is a flowchart showing a processing flow in which the control unit (2080) performs control in this embodiment. Hereinafter, a processing flow in which the control unit (2080) performs control will be described with reference to FIG.

ステップS100は、制御部(2080)からの制御により被写体の明るさを測光する測光ステップである。被写体は測光光学系(レンズ)(1000)を経て、被写体像を光電変換する測光部(1010)上に結像する。また、被写体は撮影光学系(レンズ)(2000)を経て、被写体像を光電変換する撮像素子(2010)上に結像する。測光部(1010)と撮像素子(2010)は被写体像を光電変換する複数の素子から成り、各素子からの出力値を得ることができる。測光部(1010)は、被写体の高輝度な領域から低輝度な領域までの測光値を、被写体像を光電変換する素子のダイナミックレンジに応じて1回もしくは複数回の撮像で取得することができる。撮像素子(2010)は、例えば、原色カラーフィルタを備える単板カラー撮像素子とする。本実施形態では、測光部(1010)と撮像素子(2010)は異なる処理ブロックとしている。しかし、撮像素子(2010)の出力から露光制御演算部(1020)で露光制御演算を行うなど、それぞれの機能を達成できるのであれば測光部(1010)と撮像素子(2010)は同じ受光素子でもよい。また、測光光学系(レンズ)(1000)と撮影光学系(レンズ)(2000)も同一の光学系でもよい。   Step S100 is a photometric step for measuring the brightness of the subject under the control of the control unit (2080). The subject passes through a photometric optical system (lens) (1000) and forms an image on a photometric unit (1010) that photoelectrically converts the subject image. The subject is imaged on an image sensor (2010) that photoelectrically converts the subject image through a photographing optical system (lens) (2000). The photometry unit (1010) and the image sensor (2010) are composed of a plurality of elements that photoelectrically convert a subject image, and output values from the elements can be obtained. The photometry unit (1010) can acquire photometric values from a high-luminance region to a low-luminance region of the subject by one or more imaging depending on the dynamic range of the element that photoelectrically converts the subject image. . The image pickup device (2010) is, for example, a single plate color image pickup device including a primary color filter. In the present embodiment, the photometry unit (1010) and the image sensor (2010) are different processing blocks. However, the photometry unit (1010) and the image sensor (2010) may be the same light receiving element as long as each function can be achieved, for example, the exposure control calculation unit (1020) performs exposure control calculation from the output of the image sensor (2010). Good. The photometric optical system (lens) (1000) and the photographing optical system (lens) (2000) may be the same optical system.

ステップS101は、制御部(2080)からの制御により撮影の中心となる露光量を決定もしくは選択する露光量決定ステップである。撮像装置1が、自動的に中心となる露光量を決定する場合は、公知の中央部重点測光やスポット測光や多分割測光に関するアルゴリズムを用いる。露光制御演算部(1020)で中心となる露光量を決定する演算処理を行う。   Step S101 is an exposure amount determination step for determining or selecting an exposure amount that becomes the center of photographing under the control of the control unit (2080). When the imaging apparatus 1 automatically determines a central exposure amount, a known algorithm for center-weighted metering, spot metering, or multi-segment metering is used. The exposure control calculation unit (1020) performs calculation processing for determining the central exposure amount.

ステップS102は、制御部(2080)からの制御により撮影の中心となる露光量と画像のハイライトあるいはシャドウとの露光量差を決定する処理ステップである。撮像装置1が自動的に露光量差を決定する場合は、公知のハイライト(あるいは白とび)やシャドウ(あるいは黒つぶれ)を検出するアルゴリズムを用いて露光量露光制御演算部(1020)で行う。   Step S102 is a processing step for determining the exposure amount difference between the exposure amount at the center of photographing and the highlight or shadow of the image under the control of the control unit (2080). When the imaging apparatus 1 automatically determines the exposure amount difference, the exposure amount exposure control calculation unit (1020) uses a known algorithm for detecting highlight (or overexposure) or shadow (or underexposure). .

なお、ステップS101とステップS102では、ユーザーがインターフェースI/F(2090)を介して撮像装置1へと入力した中心となる露光量と中心となる露光量からの露光量差を用いてもよい。   In step S101 and step S102, a difference between the exposure amount from the central exposure amount and the central exposure amount input to the imaging apparatus 1 by the user via the interface I / F (2090) may be used.

ステップS103は、制御部(2080)からの制御により複数の異なる露光量の画像を撮像する撮像ステップである。本実施例では、露光制御部(1030)において決定した中心となる露光量と中心となる露光量からの露光量差に基づいて、撮像素子(2010)への露光制御を3回行う。この時、露光制御部(1030)は、決定した中心となる露光量と中心となる露光量からの露光量差に基づいて、入射光を撮像素子で蓄積する露光時間、入射光がレンズを通過する量、撮像素子から得られる信号のゲイン量の制御等の各種の露出制御を行う。   Step S103 is an imaging step of capturing a plurality of images with different exposure amounts under the control of the control unit (2080). In the present embodiment, the exposure control to the image sensor (2010) is performed three times based on the difference between the central exposure amount determined by the exposure control unit (1030) and the central exposure amount. At this time, the exposure control unit (1030), based on the determined central exposure amount and the exposure amount difference from the central exposure amount, the exposure time in which incident light is accumulated by the image sensor, and the incident light passes through the lens. Various exposure controls such as control of the amount to be obtained and control of the gain amount of the signal obtained from the image sensor are performed.

ステップS104は、制御部(2080)からの制御により撮像結果を取得する処理である。A/D変換部(2020)では、撮像素子(2010)からアナログ電圧として出力される信号をデジタルの画像データへと変換する。   Step S104 is processing for acquiring an imaging result under the control of the control unit (2080). The A / D converter (2020) converts a signal output as an analog voltage from the image sensor (2010) into digital image data.

ステップS105は、制御部(2080)からの制御により位置ずれ検出と移動体検出に適した検出用画像を生成する処理である。A/D変換部(2020)から出力されたデジタルデータに対して輝度合わせ部(3000)と輝度制限部(3010)と現像処理部(2030)で画像処理を行い、検出用画像を生成する。ここで、検出用画像を生成する処理方法は後述する。   Step S105 is processing for generating a detection image suitable for misalignment detection and moving body detection under the control of the control unit (2080). The luminance matching unit (3000), the luminance limiting unit (3010), and the development processing unit (2030) perform image processing on the digital data output from the A / D conversion unit (2020) to generate a detection image. Here, a processing method for generating a detection image will be described later.

ステップS106は、制御部(2080)からの制御により基準画像と比較画像の画像間の差分値に基づいて位置ずれを検出する位置ずれ検出ステップである。具体的には、位置ずれ検出部(2041)では、基準画像の画素値と比較画像の画素値の差の絶対値の総和(SAD:Sum of Absolute Difference)が、最も小さくなる比較画像の位置を調べる公知の位置ずれ検出方法を用いて処理を行う。ただし、位置ずれ検出方法としては、周波数解析から2枚の画像の位置ずれ量を検出するなど、他にもさまざまな方法が公知であるが、位置ずれ検出精度や検出処理負荷、検出処理スピードなど、撮像装置1に適した方法であれば、いずれかに限定するものではない。位置ずれ検出部(2041)で求めた、比較画像をどの方向(移動方向)にどれだけ(移動量)移動させる必要があるかという検出結果を、移動ベクトルを呼ぶことにする。本実施例では、位置ずれ検出、位置合わせの基準画像、移動体検出、移動体補正の基準画像はアンダー露出の画像とする。一方、後述する輝度合わせ処理の基準画像は標準露出の画像とする。   Step S106 is a misregistration detection step for detecting misregistration based on the difference value between the reference image and the comparison image under the control of the control unit (2080). Specifically, in the misalignment detection unit (2041), the position of the comparison image with the smallest sum of absolute values (SAD: Sum of Absolute Difference) of the pixel value of the reference image and the pixel value of the comparison image is determined. Processing is performed using a known misregistration detection method to be examined. However, there are various other misregistration detection methods such as detecting the misregistration amount of two images from frequency analysis. However, misregistration detection accuracy, detection processing load, detection processing speed, etc. The method is not limited to any one as long as the method is suitable for the imaging apparatus 1. The detection result obtained by the misregistration detection unit (2041) indicating how much (moving amount) the comparative image needs to be moved in which direction (moving direction) is referred to as a movement vector. In this embodiment, the reference image for misalignment detection, alignment, moving object detection, and moving object correction is an underexposed image. On the other hand, a reference image for luminance matching processing described later is a standard exposure image.

ステップS107は、制御部(2080)からの制御により基準画像と比較画像の画像間の位置ずれを補正する処理である。位置ずれ補正部1(2042)と位置ずれ補正部2(2043)では、メモリ上の比較画像を、位置ずれ検出部(2041)で求めた移動ベクトルの移動量だけ移動方向へ並進移動して、位置ずれ補正画像を生成する、公知の位置ずれ補正処理を行う。位置ずれ補正処理としては、並進方向のずれだけでなく、回転移動やアフィン変換、斜影変換など、他にもさまざまな処理が公知である。しかし位置ずれ補正精度や補正処理負荷、補正処理スピードなど、撮像装置1に適した処理であれば、いずれかに限定するものではない。   Step S107 is processing for correcting a positional deviation between the reference image and the comparison image under the control of the control unit (2080). The positional deviation correction unit 1 (2042) and the positional deviation correction unit 2 (2043) translate the comparison image on the memory in the movement direction by the movement amount of the movement vector obtained by the positional deviation detection unit (2041). A known misregistration correction process for generating a misregistration correction image is performed. As the misalignment correction processing, various other processes such as rotational movement, affine transformation, and oblique transformation are known in addition to translational displacement. However, the processing is not limited to any one as long as the processing is suitable for the imaging apparatus 1 such as the positional deviation correction accuracy, the correction processing load, and the correction processing speed.

ステップS108は、制御部(2080)からの制御によりHDR合成に適した合成用画像を生成する処理である。A/D変換部(2020)から出力した画像データに対して現像処理部(2030)で画像処理を行い、合成用画像を生成する。すなわち、まず、白を白くする処理がなされ、具体的には白くあるべき領域のR,G,Bが同じ値になるようなゲインをR,G,B各々にかけるホワイトバランス処理を行う。次に、飽和領域のカラーバランスが崩れることを防ぐために、R,G,Bが制限値以上の値とならないように、ホワイトクリップ処理を行う。さらに、色モザイク画像を補間することによって、全ての画素においてR、G、Bの色情報が揃ったカラー画像を生成する。生成したカラー画像は、マトリクス変換処理およびガンマ処理を経て基本的なカラー画像を生成する。本実施例では、HDR合成に適したガンマ処理パラメータは、異なる露光量で撮影した複数枚の画像ごとに別々のパラメータである。   Step S108 is processing for generating a synthesis image suitable for HDR synthesis under the control of the control unit (2080). The development processing unit (2030) performs image processing on the image data output from the A / D conversion unit (2020) to generate a composite image. That is, first, white processing is performed, and specifically, white balance processing is performed in which gains such that R, G, and B of regions that should be white have the same value are applied to each of R, G, and B. Next, in order to prevent the color balance of the saturation region from being lost, white clip processing is performed so that R, G, and B do not become values greater than the limit values. Further, by interpolating the color mosaic image, a color image in which R, G, and B color information are aligned in all pixels is generated. The generated color image is subjected to matrix conversion processing and gamma processing to generate a basic color image. In this embodiment, the gamma processing parameters suitable for HDR synthesis are different parameters for each of a plurality of images taken with different exposure amounts.

ステップS109は、制御部(2080)からの制御によりHDR合成を行う処理である。HDR画像合成部(2044)では、生成した複数の合成用画像を合成してHDR画像を生成する。複数の合成用画像を合成する方法は、領域ごとに、中心となるべき露光量(標準露出)で撮像した画像の明るさに応じて、異なる露光量の複数の画像のいずれの画像を支配的に用いるかを決める。具体的には、標準露出の明るさが明るい領域には標準露出より被写体を暗く撮像する露光量(アンダー露出)で撮像した画像を支配的に(例えばその他の画像より多い割合で)用いる。標準露出の明るさが中間の明るさである領域では標準露出の画像を支配的に用いる。そして、標準露出の明るさが暗い領域には標準露出より被写体を明るく撮像する露光量(オーバー露出)で撮像した画像を支配的に用いてハイダイナミックレンジ画像(HDR画像)を生成する。   Step S109 is processing for performing HDR synthesis under the control of the control unit (2080). The HDR image synthesis unit (2044) generates an HDR image by synthesizing the plurality of generated synthesis images. The method of combining multiple images for composition is dominant for any region, depending on the brightness of the image captured with the exposure value (standard exposure) that should be the center, and any of the multiple images with different exposure values. Decide what to use for. Specifically, in an area where the brightness of the standard exposure is bright, an image captured with an exposure amount (under exposure) that captures an object darker than the standard exposure is used predominantly (for example, at a higher rate than other images). In an area where the brightness of the standard exposure is intermediate, the image of the standard exposure is predominantly used. Then, a high dynamic range image (HDR image) is generated in an area where the brightness of the standard exposure is dark by predominantly using an image captured with an exposure amount (overexposure) that captures the subject brighter than the standard exposure.

ステップS110は、制御部(2080)からの制御により対象の基準画像と比較画像の画像間の移動体を検出する処理である。移動体検出部(2045)では、基準画像の画素値(輝度)と比較画像の画素値(輝度)の差の絶対値の総和(SAD:Sum of Absolute Difference)が、所定のしきい値よりも大きい場合に移動体と判定する処理を行う。この時、この方法を用いる前提として、基準画像と比較画像の移動していない物体の輝度は同じであるということが必要である。   Step S110 is a process of detecting a moving body between the target reference image and the comparison image under the control of the control unit (2080). In the moving object detection unit (2045), the sum of absolute values (SAD: Sum of Absolute Difference) of the difference between the pixel value (luminance) of the reference image and the pixel value (luminance) of the comparison image is less than a predetermined threshold value. When it is larger, a process of determining a moving body is performed. At this time, as a premise to use this method, it is necessary that the brightness of the object that is not moved between the reference image and the comparison image is the same.

ステップS111は、制御部(2080)からの制御により基準画像と比較画像の画像間の移動体を補正する処理である。移動体補正部(2046)では、移動体検出部(2045)で求めたHDR画像の移動体領域を、基準画像で置き換える処理を行う。   Step S111 is processing for correcting a moving body between the reference image and the comparison image under the control of the control unit (2080). The moving body correction unit (2046) performs processing for replacing the moving body region of the HDR image obtained by the moving body detection unit (2045) with the reference image.

ステップS112は、制御部(2080)からの制御によりHDR画像を記録する処理である。HDR画像をメモリ(1120)に蓄える。もしくは、圧縮部(1100)でHDR画像をJPEG等の方式に従って圧縮(符号化)し、記録部(1110)にてフラッシュメモリ等の記録媒体に記録する。   Step S112 is processing for recording an HDR image under the control of the control unit (2080). The HDR image is stored in the memory (1120). Alternatively, the HDR image is compressed (encoded) by a compression unit (1100) according to a scheme such as JPEG, and is recorded on a recording medium such as a flash memory by a recording unit (1110).

ここで、ステップS105に関して、位置ずれ検出と移動体検出に適した検出用画像を生成する処理方法の詳細を述べる。   Here, regarding step S105, details of a processing method for generating a detection image suitable for position shift detection and moving body detection will be described.

本実施例のような、異なる露光量で撮影した複数枚の画像を用いて差の絶対値から画像間の移動体を検出する場合には、異なる露光量で撮影した基準画像と比較画像であっても、同一の被写体は等しい画素値であることが好ましい。   When a moving object between images is detected from the absolute value of the difference using a plurality of images taken with different exposure amounts as in this embodiment, the reference image and the comparison image taken with different exposure amounts are used. However, it is preferable that the same subject has the same pixel value.

図4を用いて基準画像と比較画像の明るさを揃える処理の詳細を述べる。ここで、撮像素子(2010)の解像限界値は100とし、出力上限値は1000とする(本実施例では、撮像素子(2010)は理想的なセンサであるとし、オフセット出力(出力下限値)は0である)。本実施例では、解像限界値とは、低輝度領域においてS/Nや解像力などを考慮して、この値以上であれば位置ずれ検出や移動体検出に有効である輝度領域を示している。一方、出力上限値とは、撮像素子(2010)へ飽和露光量を入力した場合の出力値を示している。また、このシーンは、中心となる露光量からの露光量差が±1段であったとする。さらに、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出とオーバー露出で撮影した画像とする。   Details of the processing for aligning the brightness of the reference image and the comparison image will be described with reference to FIG. Here, the resolution limit value of the image sensor (2010) is 100, and the output upper limit value is 1000 (in this embodiment, the image sensor (2010) is an ideal sensor, and the offset output (output lower limit value). ) Is 0). In the present embodiment, the resolution limit value indicates a luminance region that is effective for detecting displacement and moving object when the value is equal to or greater than this value in consideration of S / N and resolution in a low luminance region. . On the other hand, the output upper limit value indicates an output value when a saturated exposure amount is input to the image sensor (2010). In this scene, it is assumed that the exposure amount difference from the central exposure amount is ± 1 stage. Further, the reference image is an image photographed with standard exposure, and the comparative image is an image photographed with underexposure and overexposure.

図4(A)は、HDR撮影(異なる露光量で撮影後合成してHDR画像を生成)するのに適したシーンであり、図4(B)は、そのシーンにおいて異なる露光量で撮影する被写体の明るさの領域を示した図である。このシーンのように、HDR合成に適したシーンは1回の撮影では被写体の明るさの一部しか表現することができない(撮像素子2080のダイナミックレンジがシーン(被写体)に対して狭い)。つまり、1回の撮影において撮像素子のダイナミックレンジより明るい被写体の明るさを示す値は出力上限値に張り付いてしまい、撮像素子のダイナミックレンジより暗い被写体の明るさを示す値は、解像限界値以下になってしまう。   FIG. 4A shows a scene suitable for HDR shooting (synthesizing after shooting with different exposure amounts to generate an HDR image), and FIG. 4B shows a subject shot with different exposure amounts in the scene. It is the figure which showed the area | region of brightness. Like this scene, a scene suitable for HDR synthesis can express only a part of the brightness of the subject in one shooting (the dynamic range of the image sensor 2080 is narrower than the scene (subject)). In other words, the value indicating the brightness of a subject brighter than the dynamic range of the image sensor in one shooting is stuck to the output upper limit value, and the value indicating the brightness of a subject darker than the dynamic range of the image sensor is the resolution limit. It becomes below the value.

具体的に、図4(A)のシーンにおける3つのポイントのオーバー露出・標準露出・アンダー露出で撮影した場合の、A/D変換部(2020)から出力した撮像素子(2010)の出力を図4(C)に示す。オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまう。また、アンダー露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまう(図4の括弧内の数値は解像限界値を示している)。   Specifically, the output of the image sensor (2010) output from the A / D conversion unit (2020) when shooting with three points of overexposure, standard exposure, and underexposure in the scene of FIG. Shown in 4 (C). Point 1 when shooting with overexposure sticks to the output upper limit value of the image sensor (2010). Point 3 in the case of shooting with underexposure has an output value of the image sensor (2010), but it is a value equal to or lower than the resolution limit value (the value in parentheses in FIG. 4 is the resolution limit value). Is shown).

次に、図4(A)のシーンにおける3つのポイントの、輝度合わせ部(3000)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図4(D)、標準露出画像とオーバー露出画像を比較する場合は図4(E)に示す。また、輝度制限部(3010)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図4(F)、標準露出画像とオーバー露出画像を比較する場合は図4(G)に示す。   Next, when the standard exposure image and the underexposure image are compared with the output result from the luminance matching unit (3000) of the three points in the scene of FIG. 4A, FIG. FIG. 4E shows a case where overexposed images are compared. Also, the output result from the brightness limiting unit (3010) is shown in FIG. 4 (F) when comparing the standard exposure image and the underexposure image, and in FIG. 4 (G) when comparing the standard exposure image and the overexposure image. Show.

まず、輝度合わせ部(3000)において、基準画像と比較画像の露光量差を補うゲイン処理を行う。つまり、標準露出よりも1段暗く撮影したアンダー露出画像の平均的な明るさを標準露出画像と等しく調整するためには、アンダー露出画像に2(2の1乗)倍のゲインをかける(ゲインアップする)(図4(D))。また、標準露出よりも1段明るく撮影したオーバー露出画像の平均的な明るさを標準露出画像と等しく調整するためには、オーバー露出画像に2(2の1乗)分の1のゲインをかける(ゲインダウンする)(図4(E))。   First, the luminance matching unit (3000) performs gain processing to compensate for the difference in exposure amount between the reference image and the comparison image. That is, in order to adjust the average brightness of the underexposure image taken one step darker than the standard exposure to be equal to that of the standard exposure image, a gain of 2 (2 to the power of 1) is applied to the underexposure image (gain). (Fig. 4 (D)). Further, in order to adjust the average brightness of the overexposed image taken one step brighter than the standard exposure to be equal to the standard exposure image, a gain of 1 (2 to the power of 1) is applied to the overexposed image. (Gain down) (FIG. 4E).

次に、輝度制限部(3010)において、基準画像と比較画像の同一の被写体が等しい画素値となっているとみなせる輝度値を決定する処理を行う。なぜなら、輝度合わせ部(3000)でのゲイン処理だけでは、撮像素子(2010)からの出力が解像限界値と出力上限値の範囲から外れた被写体の、基準画像の画素値(輝度)と比較画像の画素値(輝度)の差の絶対値を正しく検出できないからである。ここで、オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまったために、2(2の1乗)分の1のゲインをかけたとしても、標準露出で撮影した場合のポイント1の出力値と異なってしまう(図4(E))。また、アンダー露出で撮影した場合のポイント3は、出力値は存在するが、解像限界値以下の値となってしまった(図4の括弧内の数値は解像限界値を示している)。このため、2倍のゲインをかけたとしても、標準露出で撮影した場合のポイント3の出力値は同じとなるが、位置ずれ検出や移動体検出に適切でない輝度領域を含んでしまう(図4(D))。   Next, the brightness limiting unit (3010) performs a process of determining a brightness value that can be considered that the same subject in the reference image and the comparison image have the same pixel value. This is because the output from the image sensor (2010) is compared with the pixel value (luminance) of the reference image of a subject whose output is out of the range between the resolution limit value and the output upper limit value only by the gain processing in the luminance matching unit (3000). This is because the absolute value of the difference between image pixel values (luminance) cannot be detected correctly. Here, since the point 1 in the case of shooting with overexposure is stuck to the output upper limit value of the image sensor (2010), even if a gain of 1 (2 to the power of 2) is applied, it is standard. This is different from the output value of point 1 when shooting with exposure (FIG. 4E). Further, the point 3 in the case of shooting with underexposure has an output value, but is a value equal to or less than the resolution limit value (the value in parentheses in FIG. 4 indicates the resolution limit value). . For this reason, even if a gain of 2 is applied, the output value of point 3 when shooting with standard exposure is the same, but includes a luminance region that is not suitable for position shift detection or moving body detection (FIG. 4). (D)).

そこで、輝度制限部3010では、輝度合わせ部(3000)のゲイン量と撮像素子(2010)の解像限界値または出力上限値から、位置ずれ検出や移動体検出に有効な輝度領域を算出する。つまり、輝度合わせ部(3000)から出力したデジタルデータがどのような範囲の値を取り得るか演算し、基準画像と比較画像で共通する範囲を制限すればよい。具体的には、比較画像をα倍することで明るさを基準画像と等しくなるとみなして、次式が成り立つように制限値を設定する。具体的には、輝度制限部3010にて、次式で決まる最小の画素値の制限値以下の画素値の値が全て最小の画素値の制限値の値に変換される。また、次式で決まる最大の画素値の制限値以上の画素値の値が全て最大の画素値の制限値の値に変換される。
(最小の画素値の制限値)=Max(解像限界値,解像限界値×α)
=解像限界値 (α<1)
=解像限界値×α (α≧1)
(最大の画素値の制限値)=Min(出力上限値,出力上限値×α)
=出力上限値×α (α<1)
=出力上限値 (α≧1)
Therefore, the luminance limiting unit 3010 calculates a luminance region effective for positional deviation detection and moving body detection from the gain amount of the luminance matching unit (3000) and the resolution limit value or output upper limit value of the image sensor (2010). That is, what range of values the digital data output from the brightness matching unit (3000) can take is calculated, and the range common to the reference image and the comparison image may be limited. Specifically, it is assumed that the brightness is equal to the reference image by multiplying the comparison image by α, and the limit value is set so that the following equation is satisfied. Specifically, the luminance limiting unit 3010 converts all pixel value values equal to or smaller than the minimum pixel value limit value determined by the following expression into the minimum pixel value limit value. Also, all pixel values that are equal to or greater than the limit value of the maximum pixel value determined by the following equation are converted to the limit value of the maximum pixel value.
(Minimum pixel value limit value) = Max (resolution limit value, resolution limit value × α)
= Resolution limit value (α <1)
= Resolution limit value × α (α ≧ 1)
(Maximum pixel value limit value) = Min (output upper limit value, output upper limit value × α)
= Output upper limit x α (α <1)
= Output upper limit (α ≧ 1)

以上から、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出で撮影した画像とした場合、輝度合わせ部(3000)からの出力を、200以上、1000以下と制限する(図4(F))。また、基準画像を標準露出で撮影した画像とし、比較画像をオーバー露出で撮影した画像とした場合、輝度合わせ部(3000)からの出力を、100以上、500以下と制限する(図4(G))。   From the above, when the reference image is an image photographed with standard exposure and the comparative image is an image photographed with underexposure, the output from the luminance matching unit (3000) is limited to 200 or more and 1000 or less (FIG. 4 ( F)). In addition, when the reference image is an image captured with standard exposure and the comparative image is an image captured with overexposure, the output from the brightness matching unit (3000) is limited to 100 or more and 500 or less (FIG. 4G )).

その後、輝度制限部(3010)から出力したデジタルデータに対して、公知の処理方法を用いて中間画像を生成することとする。すなわち、まず、白を白くする処理がなされ、具体的には白くあるべき領域のR,G,Bが同じ値になるようなゲインをR,G,B各々にかけるホワイトバランス処理を行う。次に、飽和領域のカラーバランスが崩れることを防ぐために、R,G,Bが制限値以上の値とならないように、ホワイトクリップ処理を行う。さらに、色モザイク画像を補間することによって、全ての画素においてR、G、Bの色情報が揃ったカラー画像を生成する。生成したカラー画像は、マトリクス変換処理およびガンマ処理を経て基本的なカラー画像を生成する。この時、位置ずれ検出と移動体検出に適したガンマ処理パラメータは、異なる露光量で撮影した複数枚の全ての画像に対して同一のパラメータである。   Thereafter, an intermediate image is generated by using a known processing method for the digital data output from the luminance limiting unit (3010). That is, first, white processing is performed, and specifically, white balance processing is performed in which gains such that R, G, and B of regions that should be white have the same value are applied to each of R, G, and B. Next, in order to prevent the color balance of the saturation region from being lost, white clip processing is performed so that R, G, and B do not become values greater than the limit values. Further, by interpolating the color mosaic image, a color image in which R, G, and B color information are aligned in all pixels is generated. The generated color image is subjected to matrix conversion processing and gamma processing to generate a basic color image. At this time, the gamma processing parameters suitable for the position shift detection and the moving body detection are the same parameters for all of a plurality of images taken with different exposure amounts.

本実施例は、本発明の要旨の範囲内において、ステップS104において撮像結果を外部記憶装置に記録して、ステップS105からステップS112を他の画像処理装置内で行ってもよい。   In the present embodiment, within the scope of the present invention, the imaging result may be recorded in the external storage device in step S104, and steps S105 to S112 may be performed in another image processing apparatus.

さらに、三脚などの撮像装置を固定する方法を用いて撮影した場合には、基準画像と比較画像の画像間の位置ずれは発生しないため、ステップS106とステップS107を行わなくてもよい。   Further, when the image is captured using a method of fixing an imaging device such as a tripod, the positional deviation between the reference image and the comparison image does not occur, and therefore step S106 and step S107 do not have to be performed.

また、中間画像データをメモリ(2070)に十分に格納しておく容量がある場合には、ステップS104の処理直後に、中間画像を生成するステップS105とステップS108の処理を行い、その後、位置ずれ検出、移動体検出、HDR合成を行ってもよい。   If there is sufficient capacity to store the intermediate image data in the memory (2070), immediately after the process of step S104, the processes of steps S105 and S108 for generating the intermediate image are performed, and then the positional deviation is performed. Detection, moving object detection, and HDR synthesis may be performed.

さらに、ステップS108の処理直後に、HDR合成に適した中間画像に対して移動体補正処理を行うためにステップS110とステップS111の処理を行い、その後、HDR合成を行うという処理順序も可能である。   Furthermore, immediately after the process of step S108, a process sequence in which the processes of step S110 and step S111 are performed in order to perform the moving body correction process on the intermediate image suitable for the HDR composition, and then the HDR composition is performed is also possible. .

以上のように、本実施例では、位置合わせや移動体検出に用いる画像の画素値の下限値あるいは上限値を、明るさを合わせた後の出力値を考慮して決定するので、移動体の誤検出を減らすことができる。   As described above, in the present embodiment, the lower limit value or the upper limit value of the pixel value of the image used for alignment and moving body detection is determined in consideration of the output value after matching the brightness. False detection can be reduced.

本実施例では、画像の白とびを軽減する効果を優先した撮影において異なる露光量で撮影した3枚の画像を用いて画像間の移動体を検出し、検出した移動体を補正しながらHDR合成を行う方法について説明する。この時、位置ずれ検出と移動体検出に適した中間画像は、現像処理部2030によるガンマ処理前のリニアな出力結果を用いることとする。   In the present embodiment, HDR imaging is performed while detecting a moving body between images using three images taken with different exposure amounts in shooting giving priority to the effect of reducing overexposure of the image, and correcting the detected moving body. The method of performing will be described. At this time, a linear output result before the gamma processing by the development processing unit 2030 is used as an intermediate image suitable for the position shift detection and the moving body detection.

図5は、あるシーンにおける被写体の明るさを示したヒストグラムと、そのシーンにおいて異なる露光量で撮影する被写体の明るさの領域を示した図である。図5で示すように、画像の白とびをより軽減するためには、そのシーンを通常撮影する場合よりも、つまり適切な露光量よりも中心となる露光量をより暗く撮影すると効果的である。より暗く撮影することで、中心となる露光量からの露光量差が同じであっても、明るい領域をより暗く撮影することができ、HDR画像としても、明るい領域がより暗くなることで白とびが軽減する。   FIG. 5 is a diagram showing a histogram showing the brightness of a subject in a certain scene and a region of the brightness of the subject taken with different exposure amounts in that scene. As shown in FIG. 5, in order to further reduce the overexposure of an image, it is effective to shoot the scene with a darker exposure amount at the center than an appropriate exposure amount, as compared with the case of normal shooting of the scene. . By shooting darker, even if the exposure amount difference from the central exposure amount is the same, a bright area can be captured darker, and even in an HDR image, the bright area becomes darker, so that the overexposure occurs. Is reduced.

本実施例では、実施例1と同一の図1と図2で示した撮像装置1において、HDR合成を行う。ただし、本実施例では、中心となる露光量をより暗く撮影しているため、輝度合わせ部(3000)と輝度制限部(3010)での処理が実施例1と特に異なる。   In the present embodiment, HDR synthesis is performed in the imaging apparatus 1 shown in FIGS. 1 and 2 that is the same as the first embodiment. However, in this embodiment, since the exposure amount at the center is photographed darker, the processing in the luminance matching unit (3000) and the luminance limiting unit (3010) is particularly different from that in the first embodiment.

図6は、本実施例で制御部(2080)が制御を行う処理フローを示したフローチャートである。以下、図6を用いて制御部(2080)が制御を行う処理フローを述べる。   FIG. 6 is a flowchart showing a processing flow in which the control unit (2080) performs control in this embodiment. Hereinafter, a processing flow in which the control unit (2080) performs control will be described with reference to FIG.

図6の図3と同じ番号のステップの処理は同一の処理を行うため、ここでは説明を省略する。   Since the process of the step with the same number as FIG. 3 of FIG. 6 performs the same process, description is abbreviate | omitted here.

ステップS601は、制御部(2080)からの制御により撮影の中心となる露光量を決定もしくは選択する処理ステップである。ここで、撮像装置1が自動的に中心となる露光量を決定する場合は、公知の中央部重点測光やスポット測光や多分割測光に関するアルゴリズムを用いて露光制御演算部(1020)で中心となる露光量を決定する演算処理を行っている。本実施例では、画像の白とびをより軽減するため、通常撮影よりも暗く撮影する補正を行って中心となる露光量を決定する。例えば、通常撮影より1段暗く撮影してもよく、白とびを軽減できる露光量を公知の方法で求めて撮影してもよい。   Step S601 is a processing step of determining or selecting an exposure amount that becomes the center of photographing under the control of the control unit (2080). Here, when the imaging apparatus 1 automatically determines the center exposure amount, the exposure control calculation unit (1020) uses a known algorithm for center-weighted metering, spot metering, or multi-segment metering. An arithmetic process for determining the exposure amount is performed. In this embodiment, in order to reduce the overexposure of the image, correction is performed so that the image is darker than the normal image capture, and the central exposure amount is determined. For example, it may be photographed one step darker than normal photographing, or an exposure amount that can reduce overexposure may be obtained by a known method.

ステップS602は、制御部(2080)からの制御により位置ずれ検出と移動体検出に適した中間画像を生成する処理である。A/D変換部(2020)から出力したデジタルデータに対して輝度合わせ部(3000)と輝度制限部(3010)で画像処理を行い、位置ずれ検出と移動体検出に適した中間画像を、適した画像処理パラメータを用いて生成する。   Step S602 is processing to generate an intermediate image suitable for positional deviation detection and moving body detection under the control of the control unit (2080). The digital data output from the A / D conversion unit (2020) is subjected to image processing by the luminance matching unit (3000) and the luminance limiting unit (3010), and an intermediate image suitable for position shift detection and moving body detection is suitable. Generated using the image processing parameters.

ここで、ステップS602に関して、位置ずれ検出と移動体検出に適した中間画像を生成する処理方法の詳細を述べる。   Here, regarding step S602, details of a processing method for generating an intermediate image suitable for positional deviation detection and moving body detection will be described.

図7を用いて基準画像と比較画像の明るさを揃える処理の詳細を述べる。ここで、撮像素子(2010)の解像限界値は100とし、出力上限値は1000とする(本実施例では、撮像素子(2010)は理想的なセンサであるとし、オフセット出力(出力下限値)は0である)。本実施例では、標準露出画像とアンダー露出画像の輝度合わせにおいて、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出で撮影した画像とする。一方、オーバー露出画像と標準露出画像との輝度合わせにおいて、基準画像をオーバー露出で撮影した画像とし、比較画像を標準露出で撮影した画像とする。なぜなら、位置ずれ検出と移動体検出に適した中間画像の明るさは、その撮影シーンをバランスよく表現していることが望ましい。つまり、画像の白とびをより軽減するため、通常撮影よりも暗く撮影する補正を行って中心となる露光量を決定した場合、基準画像はより明るく撮影した画像とすると良い。   Details of the processing for aligning the brightness of the reference image and the comparison image will be described with reference to FIG. Here, the resolution limit value of the image sensor (2010) is 100, and the output upper limit value is 1000 (in this embodiment, the image sensor (2010) is an ideal sensor, and the offset output (output lower limit value). ) Is 0). In this embodiment, in the brightness adjustment of the standard exposure image and the underexposure image, the reference image is an image captured with standard exposure, and the comparative image is an image captured with underexposure. On the other hand, in the luminance matching between the overexposed image and the standard exposure image, the reference image is an image captured with overexposure, and the comparative image is an image captured with standard exposure. This is because the brightness of the intermediate image suitable for the position shift detection and the moving body detection desirably represents the shooting scene in a balanced manner. In other words, in order to further reduce overexposure in an image, when a correction is made so that the image is captured darker than normal imaging and the central exposure amount is determined, the reference image may be an image captured brighter.

図7(A)は、ハイダイナミックレンジ合成画像を撮影するのに適したシーンであり、図7(B)は、そのシーンにおいて異なる露光量で撮影する被写体の明るさの領域を示した図である。このシーンのように、HDR合成に適したシーンは1回の撮影では被写体の明るさの一部しか表現することができない(ダイナミックレンジがシーンに対して狭い)。つまり、撮像素子のダイナミックレンジより明るい被写体は、出力上限値に張り付いてしまい、撮像素子のダイナミックレンジより暗い被写体は、解像限界値以下になってしまう。   FIG. 7A is a scene suitable for photographing a high dynamic range composite image, and FIG. 7B is a diagram showing a brightness area of a subject to be photographed with different exposure amounts in the scene. is there. Like this scene, a scene suitable for HDR synthesis can express only part of the brightness of the subject in one shooting (dynamic range is narrower than the scene). That is, a subject brighter than the dynamic range of the image sensor sticks to the output upper limit value, and a subject darker than the dynamic range of the image sensor becomes less than the resolution limit value.

具体的に、図7(A)のシーンにおける3つのポイントのオーバー露出・標準露出・アンダー露出で撮影した場合の、A/D変換部(2020)から出力した撮像素子(2010)の出力を図7(C)に示す。オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまう。また、アンダー露出と標準露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまう(図7の括弧内の数値は解像限界値を示している)。   Specifically, the output of the image sensor (2010) output from the A / D converter (2020) when shooting with three points of overexposure, standard exposure, and underexposure in the scene of FIG. 7 (C). Point 1 when shooting with overexposure sticks to the output upper limit value of the image sensor (2010). In addition, point 3 in the case of shooting with underexposure and standard exposure has a value equal to or less than the resolution limit value although the output value of the imaging device (2010) exists (the numerical value in parentheses in FIG. 7 is the solution). Image limit value).

次に、図7(A)のシーンにおける3つのポイントの、輝度合わせ部(3000)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図7(D)、標準露出画像とオーバー露出画像を比較する場合は図7(E)に示す。また、輝度制限部(3010)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図7(F)、標準露出画像とオーバー露出画像を比較する場合は図7(G)に示す。   Next, the output results of the three points in the scene of FIG. 7A from the luminance matching unit (3000) are compared with the standard exposure image shown in FIG. FIG. 7E shows a case where overexposed images are compared. Further, the output result from the luminance limiting unit (3010) is shown in FIG. 7F when comparing the standard exposure image and the under-exposure image, and in FIG. 7G when comparing the standard exposure image and the over-exposure image. Show.

まず、輝度合わせ部(3000)において、基準画像と比較画像の露光量差を補うゲイン処理を行う。つまり、標準露出よりも1段暗く撮影したアンダー露出画像の明るさを標準露出画像と等しくするためには、アンダー露出画像に2(2の1乗)倍のゲインをかける(ゲインアップする)(図7(D))。また、オーバー露出よりも1段暗く撮影した標準露出画像の明るさをオーバー露出画像と等しくするためには、標準露出画像に2(2の1乗)倍のゲインをかける(ゲインアップする)(図7(E))。   First, the luminance matching unit (3000) performs gain processing to compensate for the difference in exposure amount between the reference image and the comparison image. That is, in order to make the brightness of the underexposure image photographed one step darker than the standard exposure equal to that of the standard exposure image, a gain of 2 (2 to the power of 1) is applied to the underexposure image (gain increase) ( FIG. 7D). Further, in order to make the brightness of the standard exposure image photographed one step darker than the overexposure equal to that of the overexposure image, a gain of 2 (2 to the power of 1) is applied to the standard exposure image (gain increase) ( FIG. 7 (E)).

次に、輝度制限部(3010)において、基準画像と比較画像の同一の被写体が等しい画素値となるような輝度を制限する処理を行う。なぜなら、輝度合わせ部(3000)でのゲイン処理だけでは、撮像素子(2010)からの出力が解像限界値と出力上限値の範囲から外れた被写体の、基準画像の画素値(輝度)と比較画像の画素値(輝度)の差の絶対値を正しく検出できないからだ。ここで、オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまったために、2(2の1乗)倍のゲインをかけたとしても、標準露出で撮影した場合のポイント1の出力値と異なってしまう(図7(E))。また、標準露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまった(図7の括弧内の数値は解像限界値を示している)。このために、2倍のゲインをかけたとしても、オーバー露出で撮影した場合のポイント3の出力値は同じとなるが、位置ずれ検出や移動体検出に適切でない輝度領域を含んでしまう(図7(E))。また、アンダー露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまった(図7の括弧内の数値は解像限界値を示している)。このため、2(2の1乗)倍のゲインをかけたとしても、標準露出で撮影した場合のポイント3の出力値は同じとなるが、位置ずれ検出や移動体検出に適切でない輝度領域を含んでしまう(図7(D))。   Next, the luminance limiting unit (3010) performs a process of limiting the luminance such that the same subject in the reference image and the comparison image have the same pixel value. This is because the output from the image sensor (2010) is compared with the pixel value (luminance) of the reference image of a subject whose output is out of the range between the resolution limit value and the output upper limit value only by the gain processing in the luminance matching unit (3000). This is because the absolute value of the difference between the image pixel values (luminance) cannot be detected correctly. Here, since the point 1 in the case of shooting with overexposure is stuck to the output upper limit value of the image sensor (2010), even if a gain of 2 (2 to the power of 1) is applied, it is a standard exposure. This is different from the output value of point 1 in the case of shooting (FIG. 7E). Point 3 in the case of shooting with standard exposure has an output value of the image pickup device (2010), but has a value equal to or less than the resolution limit value (the value in parentheses in FIG. 7 is the resolution limit). Value). For this reason, even if a gain of 2 is applied, the output value of the point 3 when shooting with overexposure is the same, but it includes a luminance region that is not appropriate for position shift detection or moving body detection (see FIG. 7 (E)). Point 3 in the case of shooting with underexposure has an output value of the image sensor (2010), but it is not more than the resolution limit value (the value in parentheses in FIG. 7 is the resolution limit). Value). For this reason, even if a gain of 2 (2 to the power of 1) is applied, the output value of point 3 when shooting with standard exposure is the same, but a luminance region that is not suitable for position shift detection or moving body detection (FIG. 7D).

そこで、輝度制限部3010では、ゲイン量と解像限界値または出力上限値から、位置ずれ検出や移動体検出に適切な輝度領域を抽出するために、画像領域の輝度値について位置合わせに用いることができる輝度値の範囲を算出する。つまり、輝度合わせ部(3000)から出力したデジタルデータがどのような範囲の値を取り得るか演算し、基準画像と比較画像で共通する範囲を制限すればよい。具体的には、比較画像をα倍(ゲインαを乗算)することで明るさを基準画像と等しくなるとみなして、次式が成り立つように制限値を設定する。具体的には、輝度制限部3010にて、次式で決まる最小の画素値の制限値以下の画素値の値が全て最小の画素値の制限値の値に変換される。また、次式で決まる最大の画素値の制限値以上の画素値の値が全て最大の画素値の制限値の値に変換される。
(最小の画素値の制限値)=Max(解像限界値,解像限界値×α)
=解像限界値 (α<1)
=解像限界値×α (α≧1)
(最大の画素値の制限値)=Min(出力上限値,出力上限値×α)
=出力上限値×α (α<1)
=出力上限値 (α≧1)
Therefore, the luminance limiting unit 3010 uses the luminance value of the image region for alignment in order to extract a luminance region suitable for position shift detection and moving body detection from the gain amount and the resolution limit value or output upper limit value. The range of luminance values that can be calculated is calculated. That is, what range of values the digital data output from the brightness matching unit (3000) can take is calculated, and the range common to the reference image and the comparison image may be limited. Specifically, it is assumed that the brightness is equal to the reference image by multiplying the comparison image by α (multiply by the gain α), and the limit value is set so that the following equation is satisfied. Specifically, the luminance limiting unit 3010 converts all pixel value values equal to or smaller than the minimum pixel value limit value determined by the following expression into the minimum pixel value limit value. Also, all pixel values that are equal to or greater than the limit value of the maximum pixel value determined by the following equation are converted to the limit value of the maximum pixel value.
(Minimum pixel value limit value) = Max (resolution limit value, resolution limit value × α)
= Resolution limit value (α <1)
= Resolution limit value × α (α ≧ 1)
(Maximum pixel value limit value) = Min (output upper limit value, output upper limit value × α)
= Output upper limit x α (α <1)
= Output upper limit (α ≧ 1)

以上から、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出で撮影した画像とした場合、輝度合わせ部(3000)からの出力を、200以上、1000以下と制限する(図7(F))。また、基準画像をオーバー露出で撮影した画像とし、比較画像を標準露出で撮影した画像とした場合、輝度合わせ部(3000)からの出力を、200以上、1000以下と制限する(図7(G))。   From the above, when the reference image is an image photographed with standard exposure and the comparative image is an image photographed with underexposure, the output from the luminance matching unit (3000) is limited to 200 or more and 1000 or less (FIG. 7 ( F)). Further, when the reference image is an image captured with overexposure and the comparative image is an image captured with standard exposure, the output from the luminance matching unit (3000) is limited to 200 or more and 1000 or less (FIG. 7G )).

以上のように、本実施例では、位置合わせや移動体検出に用いる画像の画素値の下限値あるいは上限値を、明るさを合わせた後の出力値を考慮して決定するので、移動体の誤検出を減らすことができる。   As described above, in the present embodiment, the lower limit value or the upper limit value of the pixel value of the image used for alignment and moving body detection is determined in consideration of the output value after matching the brightness. False detection can be reduced.

さらに、本実施例では画像の白とびをより軽減するために、通常撮影する場合よりも中心となる露出をより暗く設定して撮影する。   Furthermore, in this embodiment, in order to reduce the overexposure of the image, the image is shot with the central exposure set darker than in normal shooting.

以下、実施例3では、画像の黒つぶれをより軽減する効果を優先した撮影における、異なる露光量で撮影した3枚の画像を用いて、画像間の移動体を検出し、検出した移動体を補正しながらHDR合成を行う方法について説明する。   Hereinafter, in the third embodiment, a moving body between images is detected using three images shot at different exposure amounts in shooting that gives priority to the effect of reducing the blackout of the image, and the detected moving body is detected. A method of performing HDR synthesis while correcting will be described.

図8は、あるシーンにおける被写体の明るさを示したヒストグラムと、そのシーンにおいて異なる露光量で撮影する被写体の明るさの領域を示した図である。図7で示すように、画像の黒つぶれをより軽減するためには、そのシーンを通常撮影する場合よりも、つまり適切な露光量よりも中心となる露光量をより明るく撮影すると効果的である。より明るく撮影することで、中心となる露光量からの露光量差が同じであっても、暗い領域をより明るく撮影することができ、HDR画像としても、暗い領域がより明るくなることで黒つぶれが軽減する。   FIG. 8 is a diagram showing a histogram showing the brightness of a subject in a certain scene and a region of the brightness of the subject taken with different exposure amounts in that scene. As shown in FIG. 7, in order to further reduce the blackout of the image, it is effective to photograph the scene brighter than the normal exposure, that is, to shoot the exposure amount at the center rather than the appropriate exposure amount. . By shooting brighter, even if the exposure difference from the central exposure amount is the same, dark areas can be shot brighter, and even in HDR images, dark areas become brighter and blackouts are lost. Is reduced.

本実施例では、実施例1と同一の図2で示した撮像装置1において、HDR合成を行う。ただし、本実施例では、中心となる露光量をより明るく撮影しているため、輝度合わせ部(3000)と輝度制限部(3010)での処理が実施例1・実施例2と特に異なる。   In the present embodiment, HDR synthesis is performed in the imaging apparatus 1 shown in FIG. However, in this embodiment, since the central exposure amount is photographed brighter, the processing in the luminance matching unit (3000) and the luminance limiting unit (3010) is particularly different from the first and second embodiments.

図9は、本実施例で制御部(2080)が制御を行う処理フローを示したフローチャートである。図9の図3と同じ番号のステップの処理は同一の処理を行うため、ここでは説明を省略する。   FIG. 9 is a flowchart showing a processing flow in which the control unit (2080) performs control in this embodiment. Since the process of the step with the same number as FIG. 3 of FIG. 9 performs the same process, description is abbreviate | omitted here.

ステップS901は、制御部(2080)からの制御により撮影の中心となる露光量を決定もしくは選択する処理ステップである。ここで、撮像装置1が自動的に中心となる露光量を決定する場合は、公知の中央部重点測光やスポット測光や多分割測光に関するアルゴリズムを用いて露光制御演算部(1020)で中心となる露光量を決定する演算処理を行っている。本実施例では、画像の黒つぶれをより軽減するため、通常撮影よりも明るく撮影する補正を行って中心となる露光量を決定する。例えば、通常撮影より1段明るく撮影してもよく、黒つぶれを軽減できる露光量を公知の方法で求めて撮影してもよい。   Step S901 is a processing step of determining or selecting an exposure amount serving as the center of photographing under the control of the control unit (2080). Here, when the imaging apparatus 1 automatically determines the center exposure amount, the exposure control calculation unit (1020) uses a known algorithm for center-weighted metering, spot metering, or multi-segment metering. An arithmetic process for determining the exposure amount is performed. In the present embodiment, in order to further reduce the blackout of the image, correction is performed so that the image is shot brighter than normal shooting, and the central exposure amount is determined. For example, the image may be photographed one step brighter than normal photographing, and the exposure amount that can reduce blackout may be obtained by a known method.

ステップS902は、制御部(2080)からの制御により位置ずれ検出に適した中間画像を生成する処理である。A/D変換部(2020)から出力したデジタルデータに対して輝度合わせ部(3000)と現像処理部(2030)と輝度制限部(3010)で画像処理を行い、位置ずれ検出と移動体検出に適した中間画像を、適した画像処理パラメータを用いて生成する。   Step S <b> 902 is processing for generating an intermediate image suitable for misregistration detection under the control of the control unit (2080). The digital data output from the A / D conversion unit (2020) is subjected to image processing by the luminance matching unit (3000), the development processing unit (2030), and the luminance limiting unit (3010) to detect misalignment and moving object. A suitable intermediate image is generated using suitable image processing parameters.

図10を用いて基準画像と比較画像の明るさを揃える処理の詳細を述べる。ここで、撮像素子(2010)の解像限界値は100とし、出力上限値は1000とする(本実施例では、撮像素子(2010)は理想的なセンサであるとし、オフセット出力(出力下限値)は0である)。本実施例では、解像限界値とは、低輝度領域においてS/Nや解像力などを考慮して、この値以下は位置ずれ検出や移動体検出に適切でない輝度領域を示している。一方、出力上限値とは、撮像素子(2010)が飽和露光量を入力した場合の出力値を示している。また、このシーンは、中心となる露光量からの露光量差が±1段であったとする。さらに、基準画像を標準露出で撮影した画像とし、比較画像をオーバー露出で撮影した画像とする。一方、基準画像をアンダー露出で撮影した画像とし、比較画像を標準露出で撮影した画像とする。なぜなら、位置ずれ検出と移動体検出に適した中間画像の明るさは、その撮影シーンをバランスよく表現していることが望ましい。つまり、画像の黒つぶれをより軽減するため、通常撮影よりも明るく撮影する補正を行って中心となる露光量を決定した場合、基準画像はより暗く撮影した画像とすると良い。   Details of the processing for aligning the brightness of the reference image and the comparison image will be described with reference to FIG. Here, the resolution limit value of the image sensor (2010) is 100, and the output upper limit value is 1000 (in this embodiment, the image sensor (2010) is an ideal sensor, and the offset output (output lower limit value). ) Is 0). In this embodiment, the resolution limit value indicates a luminance region that is not suitable for position shift detection or moving body detection in consideration of S / N, resolution, and the like in a low luminance region. On the other hand, the output upper limit value indicates an output value when the image sensor (2010) inputs a saturated exposure amount. In this scene, it is assumed that the exposure amount difference from the central exposure amount is ± 1 stage. Further, the reference image is an image taken with standard exposure, and the comparative image is an image taken with overexposure. On the other hand, the reference image is an image photographed with underexposure, and the comparative image is an image photographed with standard exposure. This is because the brightness of the intermediate image suitable for the position shift detection and the moving body detection desirably represents the shooting scene in a balanced manner. That is, in order to further reduce the blackout of the image, it is preferable that the reference image is a darker image when correction is performed so that the image is brighter than normal shooting and the central exposure amount is determined.

図10(A)は、HDR合成画像を撮影するのに適したシーンであり、図10(B)は、そのシーンにおいて異なる露光量で撮影する被写体の明るさの領域を示した図である。このシーンのように、HDR合成に適したシーンは1回の撮影では被写体の明るさの一部しか表現することができない(ダイナミックレンジがシーンに対して狭い)。つまり、撮像素子のダイナミックレンジより明るい被写体は、出力上限値に張り付いてしまい、撮像素子のダイナミックレンジより暗い被写体は、解像限界値以下になってしまう。   FIG. 10A is a scene suitable for capturing an HDR composite image, and FIG. 10B is a diagram showing brightness areas of a subject that are captured with different exposure amounts in the scene. Like this scene, a scene suitable for HDR synthesis can express only part of the brightness of the subject in one shooting (dynamic range is narrower than the scene). That is, a subject brighter than the dynamic range of the image sensor sticks to the output upper limit value, and a subject darker than the dynamic range of the image sensor becomes less than the resolution limit value.

具体的に、図10(A)のシーンにおける3つのポイントのオーバー露出・標準露出・アンダー露出で撮影した場合の、A/D変換部(2020)から出力した撮像素子(2010)の出力を図10(C)に示す。オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまう。また、アンダー露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまう(図10の括弧内の数値は解像限界値を示している)。   Specifically, the output of the image sensor (2010) output from the A / D conversion unit (2020) when shooting with three points of overexposure, standard exposure, and underexposure in the scene of FIG. 10 (C). Point 1 when shooting with overexposure sticks to the output upper limit value of the image sensor (2010). Point 3 in the case of shooting with underexposure has an output value of the image sensor (2010), but becomes a value equal to or less than the resolution limit value (the value in parentheses in FIG. 10 is the resolution limit value). Is shown).

次に、図10(A)のシーンにおける3つのポイントの、輝度合わせ部(3000)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図10(D)、標準露出画像とオーバー露出画像を比較する場合は図10(E)に示す。また、ガンマ処理後の輝度制限部(3010)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図10(F)、標準露出画像とオーバー露出画像を比較する場合は図10(G)に示す。   Next, the output results from the luminance matching unit (3000) of the three points in the scene of FIG. 10A are compared with the standard exposure image in FIG. FIG. 10E shows a case where overexposed images are compared. Further, the output result from the luminance limiting unit (3010) after the gamma processing is shown in FIG. 10F when comparing the standard exposure image and the underexposure image, and when outputting the standard exposure image and the overexposure image in FIG. Shown in (G).

まず、輝度合わせ部(3000)において、基準画像と比較画像の露光量差を補うゲイン処理を行う。つまり、アンダー露出よりも1段明るく撮影した標準露出画像の明るさをアンダー露出画像と等しくするためには、標準露出画像に2(2の1乗)分の1のゲインをかける(ゲインダウンする)(図10(D))。また、標準露出よりも1段明るく撮影したオーバー露出画像の明るさを標準露出画像と等しくするためには、オーバー露出画像に2(2の1乗)分の1のゲインをかける(ゲインダウンする)(図10(E))。   First, the luminance matching unit (3000) performs gain processing to compensate for the difference in exposure amount between the reference image and the comparison image. That is, in order to make the brightness of the standard exposure image taken one step brighter than underexposure equal to that of the underexposure image, a gain of 1/2 (2 to the power of 1) is applied to the standard exposure image (gain reduction). (FIG. 10D). Further, in order to make the brightness of the overexposed image taken one step brighter than the standard exposure equal to that of the standard exposure image, a gain of 1/2 (2 to the power of 1) is applied to the overexposed image (gain reduction). (FIG. 10E).

次に、輝度合わせ部(3000)から出力したデジタルデータに対して、公知の処理方法を用いて中間画像を生成することとする。すなわち、まず、白を白くする処理がなされ、具体的には白くあるべき領域のR,G,Bが同じ値になるようなゲインをR,G,B各々にかけるホワイトバランス処理を行う。次に、飽和領域のカラーバランスが崩れることを防ぐために、R,G,Bが制限値以上の値とならないように、ホワイトクリップ処理を行う。さらに、色モザイク画像を補間することによって、全ての画素においてR、G、Bの色情報が揃ったカラー画像を生成する。生成したカラー画像は、マトリクス変換処理およびガンマ処理を経て基本的なカラー画像を生成する。この時、位置ずれ検出と移動体検出に適したガンマ処理パラメータは、異なる露光量で撮影した複数枚の全ての画像に対して同一のパラメータである。本実施例で用いたガンマ処理パラメータは、出力信号(y)は入力信号(x)を1/2.2乗する処理パラメータ(y=x^1/2.2=x^0.45)であるとするが、位置ずれ検出と移動体検出に適したガンマ処理パラメータであれば限定するものではない。   Next, an intermediate image is generated by using a known processing method for the digital data output from the luminance matching unit (3000). That is, first, white processing is performed, and specifically, white balance processing is performed in which gains such that R, G, and B of regions that should be white have the same value are applied to each of R, G, and B. Next, in order to prevent the color balance of the saturation region from being lost, white clip processing is performed so that R, G, and B do not become values greater than the limit values. Further, by interpolating the color mosaic image, a color image in which R, G, and B color information are aligned in all pixels is generated. The generated color image is subjected to matrix conversion processing and gamma processing to generate a basic color image. At this time, the gamma processing parameters suitable for the position shift detection and the moving body detection are the same parameters for all of a plurality of images taken with different exposure amounts. The gamma processing parameter used in the present embodiment is a processing parameter (y = x ^ 1/2 / 2.2 = x ^ 0.45) in which the output signal (y) is a power of 1/2. As long as there is a gamma processing parameter suitable for misregistration detection and moving object detection, there is no limitation.

その後、ガンマ処理部2035からの出力に対して、輝度制限部(3010)において、基準画像と比較画像の同一の被写体が等しい画素値となるような輝度を制限する処理を行う。なぜなら、輝度合わせ部(3000)でのゲイン処理だけでは、撮像素子(2010)からの出力が解像限界値と出力上限値の範囲から外れた被写体の、基準画像の画素値(輝度)と比較画像の画素値(輝度)の差の絶対値を正しく検出できないからだ。ここで、オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまったために、2(2の1乗)分の1のゲインをかけたとしても、標準露出で撮影した場合のポイント1の出力値と異なってしまう(図10(E))。また、アンダー露出で撮影した場合のポイント3は、出力値は存在するが、解像限界値以下の値となってしまった(図10の括弧内の数値は解像限界値を示している)。このため、2分の1のゲインをかけたとしても、標準露出で撮影した場合のポイント3の出力値は同じとなるが、位置ずれ検出や移動体検出に適切でない輝度領域を含んでしまう(図10(D))。   Thereafter, the luminance limiting unit (3010) performs processing for limiting the luminance such that the same subject of the reference image and the comparison image have the same pixel value with respect to the output from the gamma processing unit 2035. This is because the output from the image sensor (2010) is compared with the pixel value (luminance) of the reference image of a subject whose output is out of the range between the resolution limit value and the output upper limit value only by the gain processing in the luminance matching unit (3000). This is because the absolute value of the difference between the image pixel values (luminance) cannot be detected correctly. Here, since the point 1 in the case of shooting with overexposure is stuck to the output upper limit value of the image sensor (2010), even if a gain of 1 (2 to the power of 2) is applied, it is standard. This is different from the output value of point 1 when shooting with exposure (FIG. 10E). In addition, the point 3 in the case of photographing with underexposure has an output value, but is a value equal to or less than the resolution limit value (the numerical value in parentheses in FIG. 10 indicates the resolution limit value). . For this reason, even if a gain of 1/2 is applied, the output value of the point 3 when the image is taken with the standard exposure is the same, but it includes a luminance region that is not suitable for position shift detection or moving body detection ( FIG. 10 (D)).

そこで、輝度制限部3010では、位置ずれ検出や移動体検出に適切な輝度領域を抽出するために、ゲイン量と解像限界値または出力上限値から、画像領域の輝度値について位置合わせに用いることができる輝度値の範囲を算出する。つまり、輝度合わせ部(3000)から出力したデジタルデータがどのような範囲の値を取り得るか演算し、基準画像と比較画像で共通する範囲を制限すればよい。具体的には、比較画像をα倍することで明るさを基準画像と等しくなるとみなして、次式が成り立つように制限値を設定する。具体的には、輝度制限部3010にて、次式で決まる最小の画素値の制限値以下の画素値の値が全て最小の画素値の制限値の値に変換される。また、次式で決まる最大の画素値の制限値以上の画素値の値が全て最大の画素値の制限値の値に変換される。
(最小の画素値の制限値)=Max(解像限界値,解像限界値×α)^0.45
=(解像限界値)^0.45 (α<1)
={(出力上限値)×α}^0.45 (α≧1)
(最大の画素値の制限値)=Min(出力上限値,出力上限値×α)^0.45
={(出力上限値)×α}^0.45 (α<1)
=(出力上限値)^0.45 (α≧1)
Therefore, the luminance limiting unit 3010 uses the gain value and the resolution limit value or the output upper limit value for the alignment of the luminance value of the image region in order to extract a luminance region suitable for position shift detection and moving body detection. The range of luminance values that can be calculated is calculated. That is, what range of values the digital data output from the brightness matching unit (3000) can take is calculated, and the range common to the reference image and the comparison image may be limited. Specifically, it is assumed that the brightness is equal to the reference image by multiplying the comparison image by α, and the limit value is set so that the following equation is satisfied. Specifically, the luminance limiting unit 3010 converts all pixel value values equal to or smaller than the minimum pixel value limit value determined by the following expression into the minimum pixel value limit value. Also, all pixel values that are equal to or greater than the limit value of the maximum pixel value determined by the following equation are converted to the limit value of the maximum pixel value.
(Limit value of minimum pixel value) = Max (resolution limit value, resolution limit value × α) ^ 0.45
= (Resolution limit value) ^ 0.45 (α <1)
= {(Output upper limit value) × α} ^ 0.45 (α ≧ 1)
(Maximum pixel value limit value) = Min (output upper limit value, output upper limit value × α) ^ 0.45
= {(Output upper limit value) × α} ^ 0.45 (α <1)
= (Output upper limit value) ^ 0.45 (α ≧ 1)

以上から、基準画像をアンダー露出で撮影した画像とし、比較画像を標準露出で撮影した画像とした場合、位置合わせに適した中間画像を8以上16以下と制限する(図10(F))。また、基準画像を標準露出で撮影した画像とし、比較画像をオーバー露出で撮影した画像とした場合、位置合わせに適した中間画像を8以上16以下と制限する(図10(G))。   From the above, when the reference image is an image captured with underexposure and the comparative image is an image captured with standard exposure, the intermediate image suitable for alignment is limited to 8 to 16 (FIG. 10F). Further, when the reference image is an image captured with standard exposure and the comparative image is an image captured with overexposure, the intermediate image suitable for alignment is limited to 8 or more and 16 or less (FIG. 10G).

以上のように、本実施例では、位置合わせや移動体検出に用いる画像の画素値の下限値あるいは上限値を、明るさを合わせた後の出力値を考慮して決定するので、移動体の誤検出を減らすことができる。   As described above, in the present embodiment, the lower limit value or the upper limit value of the pixel value of the image used for alignment and moving body detection is determined in consideration of the output value after matching the brightness. False detection can be reduced.

さらに、本実施例では画像の白とびをより軽減するために、通常撮影する場合よりも中心となる露出をより明るく設定して撮影する。   Further, in this embodiment, in order to further reduce overexposure of an image, shooting is performed with a central exposure set brighter than in normal shooting.

実施例4では、異なる露光量で撮影し、シャッター精度や絞り精度による露出ムラも含んでいる3枚の画像を用いて、画像間の移動体を検出し、検出した移動体を補正しながらHDR合成を行う方法について説明する。   In the fourth embodiment, a moving body between images is detected using three images shot with different exposure amounts and including exposure unevenness due to shutter accuracy and aperture accuracy, and HDR is detected while correcting the detected moving body. A method for performing the synthesis will be described.

本実施例の移動体検出方法では、前提として、基準画像と比較画像の移動していない物体の輝度は同じであるということが必要である。よって、意図して設定した中心となる露光量からの露光量差以外に発生した、シャッター精度や絞り精度による露出ムラなどの中心となる露光量からの露光量差に関しては、その露光量差を補正した方が良好な移動体検出結果を得られる。また、露出ムラは画像全体が一律に暗くなる・明るくなるという現象とだけではなく、シャッターの開閉速度ムラなどによって画像の一部が明るくなったり暗くなったりしてしまう現象も含まれている。よって、露出ムラを補正するためには、画像の領域ごとに露出ムラを検出し、画像の領域ごとに検出した露出ムラをゲイン処理で補正する必要がある。   In the moving body detection method of the present embodiment, as a premise, it is necessary that the brightness of the object that has not moved between the reference image and the comparison image is the same. Therefore, regarding the exposure amount difference from the central exposure amount, such as exposure unevenness due to shutter accuracy and aperture accuracy, other than the exposure amount difference from the central exposure amount that was set intentionally, the exposure amount difference is A better moving object detection result can be obtained with correction. In addition, the uneven exposure includes not only the phenomenon that the entire image is uniformly darkened / lightened, but also the phenomenon that a part of the image becomes bright or dark due to uneven opening / closing speed of the shutter. Therefore, in order to correct the exposure unevenness, it is necessary to detect the exposure unevenness for each area of the image and correct the exposure unevenness detected for each area of the image by gain processing.

図11は、本発明の実施形態にかかわる、撮像装置1の構成を示した図である。図1と同じ処理ブロックには同じ番号を付しており、説明を省略する。   FIG. 11 is a diagram illustrating a configuration of the imaging apparatus 1 according to the embodiment of the present invention. The same processing blocks as those in FIG.

本実施例では、露出ムラ検出部(4000)、露出ムラ補正部(4010)が設けられ、それぞれ前述した露出ムラを検出、補正する。   In this embodiment, an exposure unevenness detection unit (4000) and an exposure unevenness correction unit (4010) are provided to detect and correct the above-described exposure unevenness.

図12は、本実施例で制御部(2080)が制御を行う処理フローを示したフローチャートである。以下、図12を用いて制御部(2080)が制御を行う処理フローを述べる。図12の図3と同じ番号のステップの処理は同一の処理を行うため、ここでは説明を省略する。   FIG. 12 is a flowchart showing a processing flow in which the control unit (2080) performs control in this embodiment. Hereinafter, a processing flow in which the control unit (2080) performs control will be described with reference to FIG. Since the processing of the step with the same number as FIG. 3 in FIG. 12 performs the same processing, description thereof is omitted here.

ステップS1201は、制御部(2080)からの制御により露出ムラを検出する処理である。ここで、本実施例における、露出ムラ検出結果を図14に示す。露出ムラ検出部(4000)では、図13(A)で示したように、ノイズや移動体の影響を軽減するために、画像を複数の大きな領域に分割する。そして、意図して設定した中心となる露光量からの露光量差を考慮した、基準画像と比較画像の撮像素子(2010)からの出力値の比を求める。図13(B)は、基準画像のゲインを1倍とした場合の、ある撮影における比較画像のゲインを示した図である。本実施例では、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出とオーバー露出で撮影した画像とする。   Step S1201 is processing for detecting exposure unevenness under the control of the control unit (2080). Here, the exposure unevenness detection result in the present embodiment is shown in FIG. As shown in FIG. 13A, the exposure unevenness detection unit (4000) divides the image into a plurality of large areas in order to reduce the influence of noise and moving objects. Then, the ratio of the output value from the image sensor (2010) of the reference image and the comparative image is determined in consideration of the exposure amount difference from the intentionally set center exposure amount. FIG. 13B is a diagram illustrating the gain of a comparative image in a certain shooting when the gain of the reference image is set to 1. In this embodiment, the reference image is an image captured with standard exposure, and the comparative image is an image captured with underexposure and overexposure.

ステップS1202は、制御部(2080)からの制御により露出ムラを補正する処理である。露出ムラ補正部(4010)では、撮像素子(2010)からアナログ電圧として出力された信号をA/D変換部(2020)で変換したデジタルデータに対して、図13(B)で算出したゲインに従って領域ごとにゲイン処理を行う。   Step S1202 is processing for correcting exposure unevenness under the control of the control unit (2080). In the exposure unevenness correction unit (4010), the digital data obtained by converting the signal output as the analog voltage from the image sensor (2010) by the A / D conversion unit (2020) according to the gain calculated in FIG. 13B. Gain processing is performed for each region.

ステップS1203は、制御部(2080)からの制御により位置ずれ検出と移動体検出に適した中間画像を生成する処理である。A/D変換部(2020)から出力したデジタルデータに対して輝度合わせ部(3000)と輝度制限部(3010)と現像処理部(2030)で実施例1と基本的には同一な画像処理を行い、位置ずれ検出と移動体検出に適した中間画像を生成する。ただし、輝度制限部(3010)では、本実施例のように露出ムラ補正を行った場合には、輝度合わせ部(3000)のゲイン量だけでなく、露出ムラ補正部(4010)のゲイン量も考慮する必要がある。つまり、輝度制限部では3010では、輝度合わせ部(3000)のゲイン量と露出ムラ補正部(4010)のゲイン量と撮像素子(2010)の解像限界値と出力上限値から、輝度を制限する必要がある。   Step S1203 is processing for generating an intermediate image suitable for position shift detection and moving body detection under the control of the control unit (2080). For the digital data output from the A / D conversion unit (2020), the luminance matching unit (3000), the luminance limiting unit (3010), and the development processing unit (2030) perform basically the same image processing as in the first embodiment. To generate an intermediate image suitable for misregistration detection and moving object detection. However, in the brightness limiting unit (3010), when exposure unevenness correction is performed as in the present embodiment, not only the gain amount of the brightness matching unit (3000) but also the gain amount of the exposure unevenness correction unit (4010) It is necessary to consider. That is, in the luminance limiting unit 3010, the luminance is limited from the gain amount of the luminance matching unit (3000), the gain amount of the exposure unevenness correcting unit (4010), the resolution limit value of the image sensor (2010), and the output upper limit value. There is a need.

図14を用いて基準画像と比較画像の明るさを揃える処理の詳細を述べる。ここで、撮像素子(2010)の解像限界値は100とし、出力上限値は1000とする(本実施例では、撮像素子(2010)は理想的なセンサであるとし、オフセット出力(出力下限値)は0である)。本実施例では、解像限界値とは、低輝度領域においてS/Nや解像力などを考慮して、この値以下は位置ずれ検出や移動体検出に適切でない輝度領域を示している。一方、出力上限値とは、撮像素子(2010)が飽和露光量を入力した場合の出力値を示している。また、このシーンは、中心となる露光量からの露光量差が±1段であったとする。さらに、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出とオーバー露出で撮影した画像とする。   Details of the processing for aligning the brightness of the reference image and the comparison image will be described with reference to FIG. Here, the resolution limit value of the image sensor (2010) is 100, and the output upper limit value is 1000 (in this embodiment, the image sensor (2010) is an ideal sensor, and the offset output (output lower limit value). ) Is 0). In this embodiment, the resolution limit value indicates a luminance region that is not suitable for position shift detection or moving body detection in consideration of S / N, resolution, and the like in a low luminance region. On the other hand, the output upper limit value indicates an output value when the image sensor (2010) inputs a saturated exposure amount. In this scene, it is assumed that the exposure amount difference from the central exposure amount is ± 1 stage. Further, the reference image is an image photographed with standard exposure, and the comparative image is an image photographed with underexposure and overexposure.

図14(A)のシーンのヒストグラムは、図14(B)で示される。このシーンのように、HDR合成に適したシーンは1回の撮影では被写体の明るさの一部しか表現することができない(ダイナミックレンジがシーンに対して狭い)。つまり、撮像素子のダイナミックレンジより明るい被写体は、出力上限値に張り付いてしまい、撮像素子のダイナミックレンジより暗い被写体は、解像限界値以下になってしまう。   A histogram of the scene in FIG. 14A is shown in FIG. Like this scene, a scene suitable for HDR synthesis can express only part of the brightness of the subject in one shooting (dynamic range is narrower than the scene). That is, a subject brighter than the dynamic range of the image sensor sticks to the output upper limit value, and a subject darker than the dynamic range of the image sensor becomes less than the resolution limit value.

具体的に、図14(A)のシーンにおける3つのポイントのオーバー露出・標準露出・アンダー露出で撮影した場合の、A/D変換部(2020)から出力した撮像素子(2010)の出力を図14(C)に示す。オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまう。また、アンダー露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまう(図14の括弧内の数値は解像限界値を示している)。   Specifically, the output of the image sensor (2010) output from the A / D converter (2020) when shooting with three points of overexposure, standard exposure, and underexposure in the scene of FIG. 14 (C). Point 1 when shooting with overexposure sticks to the output upper limit value of the image sensor (2010). Point 3 in the case of shooting with underexposure has an output value of the image pickup device (2010), but becomes a value equal to or smaller than the resolution limit value (the value in parentheses in FIG. 14 is the resolution limit value). Is shown).

次に、図14(A)のシーンにおける3つのポイントの、輝度合わせ部(3000)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図14(D)、標準露出画像とオーバー露出画像を比較する場合は図14(E)に示す。また、輝度制限部(3010)からの出力結果を、標準露出画像とアンダー露出画像を比較する場合は図14(F)、標準露出画像とオーバー露出画像を比較する場合は図14(G)に示す。   Next, the output results from the luminance matching unit (3000) of the three points in the scene of FIG. 14 (A) are compared with those of FIG. FIG. 14E shows a case where overexposed images are compared. Also, the output result from the brightness limiting unit (3010) is shown in FIG. 14 (F) when comparing the standard exposure image and the underexposure image, and in FIG. 14 (G) when comparing the standard exposure image and the overexposure image. Show.

まず、輝度合わせ部(3000)において、露出ムラ補正部(4010)からの出力に対して、基準画像と比較画像の露光量差を補うゲイン処理を行う。つまり、標準露出よりも1段暗く撮影したアンダー露出画像の明るさを標準露出画像と等しくするためには、アンダー露出画像に2(2の1乗)倍のゲインをかける(ゲインアップする)(図14(D))。また、標準露出よりも1段明るく撮影したオーバー露出画像の明るさを標準露出画像と等しくするためには、オーバー露出画像に2(2の1乗)分の1のゲインをかける(ゲインダウンする)(図14(E))。   First, in the brightness matching unit (3000), a gain process for compensating for the difference in exposure amount between the reference image and the comparison image is performed on the output from the exposure unevenness correction unit (4010). That is, in order to make the brightness of the underexposure image photographed one step darker than the standard exposure equal to that of the standard exposure image, a gain of 2 (2 to the power of 1) is applied to the underexposure image (gain increase) ( FIG. 14 (D)). Further, in order to make the brightness of the overexposed image taken one step brighter than the standard exposure equal to that of the standard exposure image, a gain of 1/2 (2 to the power of 1) is applied to the overexposed image (gain reduction). (FIG. 14E).

次に、輝度制限部(3010)において、基準画像と比較画像の同一の被写体が等しい画素値となるような輝度を制限する処理を行う。なぜなら、輝度合わせ部(3000)でのゲイン処理だけでは、撮像素子(2010)からの出力が解像限界値と出力上限値の範囲から外れた被写体の、基準画像の画素値(輝度)と比較画像の画素値(輝度)の差の絶対値を正しく検出できないからだ。ここで、オーバー露出で撮影した場合のポイント1は、撮像素子(2010)の出力上限値に張り付いてしまったために、2(2の1乗)分の1のゲインをかけたとしても、標準露出で撮影した場合のポイント1の出力値と異なってしまう(図14(E))。また、アンダー露出で撮影した場合のポイント3は、撮像素子(2010)の出力値は存在するが、解像限界値以下の値となってしまった(図14の括弧内の数値は解像限界値を示している)。このため、2倍のゲインをかけたとしても、標準露出で撮影した場合のポイント3の出力値は同じとなるが、位置ずれ検出や移動体検出に適切でない輝度領域を含んでしまう(図14(D))。   Next, the luminance limiting unit (3010) performs a process of limiting the luminance such that the same subject in the reference image and the comparison image have the same pixel value. This is because the output from the image sensor (2010) is compared with the pixel value (luminance) of the reference image of a subject whose output is out of the range between the resolution limit value and the output upper limit value only by the gain processing in the luminance matching unit (3000). This is because the absolute value of the difference between the image pixel values (luminance) cannot be detected correctly. Here, since the point 1 in the case of shooting with overexposure is stuck to the output upper limit value of the image sensor (2010), even if a gain of 1 (2 to the power of 2) is applied, it is standard. This is different from the output value of point 1 when shooting with exposure (FIG. 14E). Point 3 in the case of shooting with underexposure has an output value of the image sensor (2010), but is a value equal to or less than the resolution limit value (the value in parentheses in FIG. 14 is the resolution limit). Value). For this reason, even if a gain of 2 is applied, the output value of the point 3 when the image is taken with the standard exposure is the same, but includes a luminance region that is not suitable for position shift detection or moving body detection (FIG. 14). (D)).

そこで、輝度制限部3010では、位置ずれ検出や移動体検出に適切な輝度領域を抽出するために、ゲイン量と解像限界値または出力上限値から、画像領域の輝度値について位置合わせに用いることができる輝度値の範囲を算出する。この時、撮像素子(2010)の解像限界値と出力上限値は画像に対して一意の値である。このため、輝度制限部(3010)の上限の制限値は領域ごとに算出した露出ムラ補正ゲインの最小値を、輝度制限部(3010)の下限の制限値は領域ごとに算出した露出ムラ補正ゲインの最大値を考慮する。つまり、輝度合わせ部(3000)から出力したデジタルデータがどのような範囲の値を取り得るか演算し、基準画像と比較画像で共通する範囲を制限すればよい。具体的には、比較画像をα倍することで明るさを基準画像と等しくなるとみなして、露出ムラ補正ゲインの最小値をβ、露出ムラ補正ゲインの最大値をγとして次式が成り立つように制限値を設定する。
(最小の画素値の制限値)=Max(解像限界値,解像限界値×α×γ)
=解像限界値 (α×γ<1)
=解像限界値×α×γ (α×γ≧1)
(最大の画素値の制限値)=Min(出力上限値,出力上限値×α)
=出力上限値×α×β (α×β<1)
=出力上限値 (α×β≧1)
Therefore, the luminance limiting unit 3010 uses the gain value and the resolution limit value or the output upper limit value for the alignment of the luminance value of the image region in order to extract a luminance region suitable for position shift detection and moving body detection. The range of luminance values that can be calculated is calculated. At this time, the resolution limit value and the output upper limit value of the image sensor (2010) are unique values for the image. For this reason, the upper limit value of the brightness limiter (3010) is the minimum value of the exposure unevenness correction gain calculated for each area, and the lower limit value of the brightness limiter (3010) is the exposure unevenness correction gain calculated for each area. Consider the maximum value of. That is, what range of values the digital data output from the brightness matching unit (3000) can take is calculated, and the range common to the reference image and the comparison image may be limited. Specifically, assuming that the brightness is equal to the reference image by multiplying the comparison image by α, the following expression is established, assuming that the minimum value of the exposure unevenness correction gain is β and the maximum value of the exposure unevenness correction gain is γ. Set the limit value.
(Minimum pixel value limit value) = Max (resolution limit value, resolution limit value × α × γ)
= Resolution limit value (α × γ <1)
= Resolution limit value × α × γ (α × γ ≧ 1)
(Maximum pixel value limit value) = Min (output upper limit value, output upper limit value × α)
= Output upper limit value × α × β (α × β <1)
= Output upper limit (α × β ≧ 1)

以上から、基準画像を標準露出で撮影した画像とし、比較画像をアンダー露出で撮影した画像とした場合、輝度合わせ部(3000)からの出力を、220以下と制限する(図14(F))。また、基準画像を標準露出で撮影した画像とし、比較画像をオーバー露出で撮影した画像とした場合、輝度合わせ部(3000)からの出力を、100以上、495以下と制限する(図14(G))。ただし、輝度制限部(3010)の上限と下限の制限値を画像の領域ごとに設定できる場合は、それぞれの領域のゲイン量に対応する制限値を用いてもよい。   From the above, when the reference image is an image photographed with standard exposure and the comparative image is an image photographed with underexposure, the output from the luminance matching unit (3000) is limited to 220 or less (FIG. 14F). . In addition, when the reference image is an image captured with standard exposure and the comparative image is an image captured with overexposure, the output from the luminance matching unit (3000) is limited to 100 or more and 495 or less (FIG. 14G )). However, if the upper limit and lower limit limits of the luminance limiter (3010) can be set for each area of the image, limit values corresponding to the gain amount of each area may be used.

その後、輝度制限部(3010)から出力したデジタルデータに対して、公知の処理方法を用いて中間画像を生成することとする。すなわち、まず、白を白くする処理がなされ、具体的には白くあるべき領域のR,G,Bが同じ値になるようなゲインをR,G,B各々にかけるホワイトバランス処理を行う。次に、飽和領域のカラーバランスが崩れることを防ぐために、R,G,Bが制限値以上の値とならないように、ホワイトクリップ処理を行う。さらに、色モザイク画像を補間することによって、全ての画素においてR、G、Bの色情報が揃ったカラー画像を生成する。生成したカラー画像は、マトリクス変換処理およびガンマ処理を経て基本的なカラー画像を生成する。この時、位置ずれ検出と移動体検出に適したガンマ処理パラメータは、異なる露光量で撮影した複数枚の全ての画像に対して同一のパラメータである。   Thereafter, an intermediate image is generated by using a known processing method for the digital data output from the luminance limiting unit (3010). That is, first, white processing is performed, and specifically, white balance processing is performed in which gains such that R, G, and B of regions that should be white have the same value are applied to each of R, G, and B. Next, in order to prevent the color balance of the saturation region from being lost, white clip processing is performed so that R, G, and B do not become values greater than the limit values. Further, by interpolating the color mosaic image, a color image in which R, G, and B color information are aligned in all pixels is generated. The generated color image is subjected to matrix conversion processing and gamma processing to generate a basic color image. At this time, the gamma processing parameters suitable for the position shift detection and the moving body detection are the same parameters for all of a plurality of images taken with different exposure amounts.

以上のように、本実施例では、位置合わせや移動体検出に用いる画像の画素値の下限値あるいは上限値を、明るさを合わせた後の出力値を考慮して決定するので、移動体の誤検出を減らすことができる。   As described above, in the present embodiment, the lower limit value or the upper limit value of the pixel value of the image used for alignment and moving body detection is determined in consideration of the output value after matching the brightness. False detection can be reduced.

また本実施例では露出ムラを補正することで、基準画像と比較画像の輝度をより正確に揃えることができるため、ステップS110において、より正確に移動体を検出できる。   Further, in the present embodiment, by correcting the exposure unevenness, the luminance of the reference image and the comparison image can be more accurately aligned, so that the moving body can be detected more accurately in step S110.

(他の実施形態)
本発明の目的は以下のようにしても達成できる。すなわち、前述した各実施形態の機能を実現するための手順が記述されたソフトウェアのプログラムコードを記録した記憶媒体を、システムまたは装置に供給する。そしてそのシステムまたは装置のコンピュータ(またはCPU、MPU等)が記憶媒体に格納されたプログラムコードを読み出して実行するのである。
(Other embodiments)
The object of the present invention can also be achieved as follows. That is, a storage medium in which a program code of software in which a procedure for realizing the functions of the above-described embodiments is described is recorded is supplied to the system or apparatus. The computer (or CPU, MPU, etc.) of the system or apparatus reads out and executes the program code stored in the storage medium.

この場合、記憶媒体から読み出されたプログラムコード自体が本発明の新規な機能を実現することになり、そのプログラムコードを記憶した記憶媒体およびプログラムは本発明を構成することになる。   In this case, the program code itself read from the storage medium realizes the novel function of the present invention, and the storage medium and program storing the program code constitute the present invention.

また、プログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスクなどが挙げられる。また、CD−ROM、CD−R、CD−RW、DVD−ROM、DVD−RAM、DVD−RW、DVD−R、磁気テープ、不揮発性のメモリカード、ROM等も用いることができる。   Examples of the storage medium for supplying the program code include a flexible disk, a hard disk, an optical disk, and a magneto-optical disk. Further, a CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-R, magnetic tape, nonvolatile memory card, ROM, or the like can also be used.

また、コンピュータが読み出したプログラムコードを実行可能とすることにより、前述した各実施形態の機能が実現される。さらに、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)等が実際の処理の一部または全部を行い、その処理によって前述した各実施形態の機能が実現される場合も含まれる。   Further, by making the program code read by the computer executable, the functions of the above-described embodiments are realized. Furthermore, when the OS (operating system) running on the computer performs part or all of the actual processing based on the instruction of the program code, the functions of the above-described embodiments are realized by the processing. Is also included.

更に、以下の場合も含まれる。まず記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれる。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部または全部を行う。   Furthermore, the following cases are also included. First, the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. Thereafter, based on the instruction of the program code, the CPU or the like provided in the function expansion board or function expansion unit performs part or all of the actual processing.

また、本発明はデジタルカメラのような撮影を主目的とした機器にかぎらず、携帯電話、パーソナルコンピュータ(ラップトップ型、デスクトップ型、タブレット型など)、ゲーム機など、撮像装置を内蔵もしくは外部接続する任意の機器に適用可能である。従って、本明細書における「撮像装置」は、撮像機能を備えた任意の電子機器を包含することが意図されている。   In addition, the present invention is not limited to devices such as digital cameras, but includes built-in or external connection of imaging devices such as mobile phones, personal computers (laptop type, desktop type, tablet type, etc.), game machines, etc. It can be applied to any device. Therefore, the “imaging device” in this specification is intended to include any electronic device having an imaging function.

以上、本発明の好ましい実施形態について説明したが、本発明はこれらの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to these embodiment, A various deformation | transformation and change are possible within the range of the summary.

1000 測光光学系(レンズ)
1010 測光部
1020 露光制御演算部
1030 露光制御部
2000 撮影光学系(レンズ)
2010 撮像素子
2020 A/D変換部
2030 現像処理部
2040 移動体補正・HDR合成処理部
2041 位置ずれ検出部
2042 位置ずれ補正部(1)
2043 位置ずれ補正部(2)
2044 HDR画像合成部
2045 移動体検出部
2046 移動体補正部
2050 圧縮部
2060 記録部
2070 メモリ
2080 制御部
2090 I/F
3000 輝度合わせ部
3010 輝度制限部
4000 露出ムラ検出部
4010 露出ムラ補正部
1000 Photometric optical system (lens)
1010 Photometry unit 1020 Exposure control calculation unit 1030 Exposure control unit 2000 Imaging optical system (lens)
2010 Image Sensor 2020 A / D Conversion Unit 2030 Development Processing Unit 2040 Moving Body Correction / HDR Compositing Processing Unit 2041 Misalignment Detection Unit 2042 Misalignment Correction Unit (1)
2043 Position shift correction unit (2)
2044 HDR image composition unit 2045 Moving object detection unit 2046 Moving object correction unit 2050 Compression unit 2060 Recording unit 2070 Memory 2080 Control unit 2090 I / F
3000 brightness matching unit 3010 brightness limiting unit 4000 exposure unevenness detection unit 4010 exposure unevenness correction unit

Claims (8)

露出の異なる複数の画像に対して、露出ムラを補正するとともに、画像間の明るさを揃えるためのゲインを掛ける調整手段と、
前記調整手段によって平均的な明るさが揃えられた2画像の間の差分値に基づいて当該2画像間の被写体の位置ずれを検出する検出手段と、
前記複数の画像に対して前記検出手段によって検出される位置ずれを補正する補正手段と、
前記補正手段によって補正された前記複数の画像を合成する合成手段と、を有し、
前記検出手段は、前記位置ずれの検出を行う2画像の、画素値が所定の範囲内の値である領域の前記差分値に基づいて当該2画像間の位置ずれを検出し、
前記所定の範囲は、前記複数の画像の画素値と、前記調整手段によって前記2画像の内の少なくとも一方に掛けられる前記ゲインに基づいて決定されることを特徴とする画像処理装置。
Adjusting means for correcting exposure unevenness for a plurality of images with different exposures and multiplying gains for aligning the brightness between the images;
Detecting means for detecting a position shift of a subject between the two images based on a difference value between the two images whose average brightness is aligned by the adjusting means;
Correction means for correcting a positional shift detected by the detection means for the plurality of images;
Combining the plurality of images corrected by the correction unit,
The detection means detects a positional shift between the two images based on the difference value of the region where the pixel value is a value within a predetermined range of the two images for detecting the positional shift,
The image processing apparatus according to claim 1, wherein the predetermined range is determined based on pixel values of the plurality of images and the gain applied to at least one of the two images by the adjusting unit.
前記検出手段は、前記所定の範囲を、前記複数の画像の画素値の上限値と、前記位置ずれの検出に有効な所定の下限値と、前記ゲインに基づいて決定することを特徴とする請求項1に記載の画像処理装置。   The detection unit is configured to determine the predetermined range based on an upper limit value of pixel values of the plurality of images, a predetermined lower limit value effective in detecting the positional deviation, and the gain. Item 8. The image processing apparatus according to Item 1. 前記複数の画像の画素の上限値とは、前記複数の画像が撮影された撮像素子の飽和露光量に対応する画素値であることを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the upper limit value of the pixels of the plurality of images is a pixel value corresponding to a saturation exposure amount of an imaging device in which the plurality of images are captured. 前記所定の範囲の最大値は、
前記検出手段の対象となる2画像の前記上限値と、前記上限値に前記ゲインを乗算した値の小さい方であることを特徴とする請求項2に記載の画像処理装置。
The maximum value of the predetermined range is
The image processing apparatus according to claim 2, wherein the upper limit value of the two images to be detected by the detection unit and the smaller value obtained by multiplying the upper limit value by the gain.
前記所定の範囲の最小値は、
前記検出手段の対象となる2画像の前記下限値と、前記下限値に前記ゲインを乗算した値の大きい方であることを特徴とする請求項2または4に記載の画像処理装置。
The minimum value of the predetermined range is
5. The image processing apparatus according to claim 2, wherein the lower limit value of two images to be detected by the detection unit and the larger value obtained by multiplying the lower limit value by the gain are larger.
撮像手段と、
前記撮像手段で撮像される画像の露光量を設定する制御手段と、を有し、
前記調整手段は、前記制御手段により前記撮像手段が撮影する前記露出の異なる複数の画像の中心となる露光量が、前記撮像手段によって撮影される被写体の適正な露光量よりも暗く設定されている場合には、前記2画像間のより明るい露光量で撮影した画像に平均的な明るさを揃えることを特徴とする請求項1乃至5のいずれか1つに記載の画像処理装置。
Imaging means;
Control means for setting an exposure amount of an image picked up by the image pickup means,
In the adjusting unit, the exposure amount that is the center of the plurality of images with different exposures that are captured by the imaging unit by the control unit is set to be darker than the appropriate exposure amount of the subject that is captured by the imaging unit. 6. The image processing apparatus according to claim 1, wherein an average brightness is aligned with an image captured with a brighter exposure amount between the two images.
撮像手段と、
前記撮像手段で撮像される画像の露光量を設定する制御手段と、を有し、
前記調整手段は、前記制御手段により前記撮像手段が撮影する前記露出の異なる複数の画像の中心となる露光量が、前記撮像手段によって撮影される被写体の適正な露光量よりも明るく設定されている場合には、前記2画像間のより暗い露光量で撮影した画像に平均的な明るさを揃えることを特徴とする請求項1乃至6のいずれか1つに記載の画像処理装置。
Imaging means;
Control means for setting an exposure amount of an image picked up by the image pickup means,
In the adjusting unit, an exposure amount that is the center of the plurality of images with different exposures captured by the imaging unit by the control unit is set to be brighter than an appropriate exposure amount of a subject photographed by the imaging unit. In the case, the image processing apparatus according to any one of claims 1 to 6, wherein an average brightness is aligned with an image captured with a darker exposure amount between the two images.
露出の異なる複数の画像に対して、露出ムラを補正するとともに、画像間の明るさを揃えるためのゲインを掛ける調整ステップと、
前記調整ステップによって平均的な明るさが揃えられた2画像の間の差分値に基づいて当該2画像間の被写体の位置ずれを検出する検出ステップと、
前記複数の画像に対して前記検出ステップによって検出される位置ずれを補正する補正ステップと、
前記補正ステップによって補正された前記複数の画像を合成する合成ステップと、を有し、
前記検出ステップでは、前記位置ずれの検出を行う2画像の、画素値が所定の範囲内の値である領域の前記差分値に基づいて当該2画像間の位置ずれを検出し、
前記所定の範囲は、前記複数の画像の画素値と、前記調整ステップによって前記2画像の内の少なくとも一方に掛けられる前記ゲインに基づいて決定されることを特徴とする画像処理方法。
An adjustment step for correcting exposure unevenness and multiplying gains for aligning the brightness between images for a plurality of images with different exposures;
A detection step of detecting a position shift of a subject between the two images based on a difference value between the two images whose average brightness is aligned by the adjustment step;
A correction step of correcting the positional deviation detected by the detection step for the plurality of images;
Combining the plurality of images corrected by the correction step, and
In the detection step, a position shift between the two images is detected based on the difference value of the region in which the pixel value is a value within a predetermined range of the two images for detecting the position shift.
The image processing method according to claim 1, wherein the predetermined range is determined based on pixel values of the plurality of images and the gain applied to at least one of the two images by the adjustment step .
JP2012203019A 2012-09-14 2012-09-14 Image processing apparatus and image processing method Expired - Fee Related JP6025472B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012203019A JP6025472B2 (en) 2012-09-14 2012-09-14 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012203019A JP6025472B2 (en) 2012-09-14 2012-09-14 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2014060502A JP2014060502A (en) 2014-04-03
JP6025472B2 true JP6025472B2 (en) 2016-11-16

Family

ID=50616622

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012203019A Expired - Fee Related JP6025472B2 (en) 2012-09-14 2012-09-14 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP6025472B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6648914B2 (en) * 2015-06-16 2020-02-14 キヤノン株式会社 Image processing apparatus, image processing method, and program
JP6603557B2 (en) * 2015-11-25 2019-11-06 ハンファテクウィン株式会社 Image processing apparatus and image processing method
US10148888B2 (en) * 2016-05-18 2018-12-04 Texas Instruments Incorporated Image data processing for multi-exposure wide dynamic range image data
JP6887853B2 (en) * 2017-04-03 2021-06-16 キヤノン株式会社 Imaging device, its control method, program
CN107995425B (en) * 2017-12-11 2019-08-20 维沃移动通信有限公司 A kind of image processing method and mobile terminal
JP2019169940A (en) * 2018-03-22 2019-10-03 株式会社リコー Photographing device, photographing method, photographing program, image processing apparatus, image processing method, and image processing program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4806329B2 (en) * 2006-10-23 2011-11-02 三洋電機株式会社 Imaging apparatus and imaging method
JP4781233B2 (en) * 2006-11-07 2011-09-28 キヤノン株式会社 Image processing apparatus, imaging apparatus, and image processing method
JP5054583B2 (en) * 2008-03-17 2012-10-24 株式会社リコー Imaging device

Also Published As

Publication number Publication date
JP2014060502A (en) 2014-04-03

Similar Documents

Publication Publication Date Title
US10574961B2 (en) Image processing apparatus and image processing method thereof
US8106965B2 (en) Image capturing device which corrects a target luminance, based on which an exposure condition is determined
JP5787648B2 (en) Image processing apparatus and image processing apparatus control method
JP6025472B2 (en) Image processing apparatus and image processing method
US8294795B2 (en) Image capturing apparatus and medium storing image processing program
JP4914300B2 (en) Imaging apparatus and imaging control method
US7486884B2 (en) Imaging device and imaging method
JP2017022610A (en) Image processing apparatus and image processing method
US9892497B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US9071766B2 (en) Image capturing apparatus and control method thereof
JP5898509B2 (en) Imaging apparatus, control method therefor, program, and storage medium
JP2015144475A (en) Imaging apparatus, control method of the same, program and storage medium
JP2007325145A (en) Image processing apparatus, method and program
JP5225137B2 (en) Imaging apparatus, image processing method, and program
JP6108680B2 (en) Imaging apparatus, control method therefor, program, and storage medium
JP5713643B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JPWO2019111659A1 (en) Image processing equipment, imaging equipment, image processing methods, and programs
JP7247609B2 (en) Imaging device, imaging method and program
JP5245648B2 (en) Image processing apparatus and program
JP6570311B2 (en) Image processing apparatus and image processing method
JP5120414B2 (en) Electronic camera and image processing program
JP5772064B2 (en) Imaging apparatus and image generation program
JP6272006B2 (en) Imaging apparatus, image processing method, and program
JP2015037222A (en) Image processing apparatus, imaging apparatus, control method, and program
JP6701299B2 (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150914

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160606

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160614

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160729

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: 20160913

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161011

R151 Written notification of patent or utility model registration

Ref document number: 6025472

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees